From 84291d0d727fc29e14ce67db55edf5e29b87af69 Mon Sep 17 00:00:00 2001 From: Amine Khaldi Date: Fri, 15 Jul 2011 22:27:16 +0000 Subject: [PATCH] * Bring back rbuild build to be used until bug 6372 is fixed. svn path=/branches/GSoC_2011/ThemesSupport/; revision=52691 --- Makefile | 633 ++++ ReactOS-amd64.rbuild | 113 + ReactOS-arm.rbuild | 160 + ReactOS-generic.rbuild | 150 + ReactOS-i386.rbuild | 81 + ReactOS-ppc.rbuild | 25 + base/applications/applications.rbuild | 109 + base/applications/cacls/cacls.rbuild | 12 + base/applications/calc/calc.rbuild | 16 + base/applications/charmap/charmap.rbuild | 14 + base/applications/cmdutils/cmdutils.rbuild | 28 + .../cmdutils/dbgprint/dbgprint.rbuild | 5 + .../cmdutils/doskey/doskey.rbuild | 7 + base/applications/cmdutils/find/find.rbuild | 8 + .../cmdutils/hostname/hostname.rbuild | 7 + .../cmdutils/lodctr/lodctr.rbuild | 7 + base/applications/cmdutils/more/more.rbuild | 8 + base/applications/cmdutils/reg/reg.rbuild | 11 + base/applications/cmdutils/xcopy/xcopy.rbuild | 11 + base/applications/control/control.rbuild | 9 + base/applications/dxdiag/dxdiag.rbuild | 35 + base/applications/extrac32/extrac32.rbuild | 9 + base/applications/findstr/findstr.rbuild | 8 + base/applications/fontview/fontview.rbuild | 11 + base/applications/games/games.rbuild | 13 + .../games/solitaire/solitaire.rbuild | 11 + base/applications/games/spider/spider.rbuild | 10 + .../applications/games/winmine/winmine.rbuild | 13 + base/applications/hh/hh.rbuild | 9 + base/applications/iexplore/iexplore.rbuild | 10 + .../kbswitch/kbsdll/kbsdll.rbuild | 10 + base/applications/kbswitch/kbswitch.rbuild | 16 + base/applications/logoff/logoff.rbuild | 11 + base/applications/magnify/magnify.rbuild | 12 + base/applications/mmc/mmc.rbuild | 16 + base/applications/mplay32/mplay32.rbuild | 14 + base/applications/msconfig/msconfig.rbuild | 22 + .../mscutils/devmgmt/devmgmt.rbuild | 21 + base/applications/mscutils/directory.rbuild | 13 + .../mscutils/eventvwr/eventvwr.rbuild | 10 + .../mscutils/servman/servman.rbuild | 35 + base/applications/mstsc/mstsc.rbuild | 36 + base/applications/network/arp/arp.rbuild | 10 + base/applications/network/dwnl/dwnl.rbuild | 9 + .../applications/network/finger/finger.rbuild | 12 + base/applications/network/ftp/ftp.rbuild | 29 + .../network/ipconfig/ipconfig.rbuild | 10 + base/applications/network/net/net.rbuild | 12 + .../network/netstat/netstat.rbuild | 11 + base/applications/network/network.rbuild | 43 + .../network/nslookup/nslookup.rbuild | 12 + base/applications/network/ping/ping.rbuild | 9 + base/applications/network/route/route.rbuild | 9 + .../applications/network/telnet/telnet.rbuild | 30 + .../network/tracert/tracert.rbuild | 9 + base/applications/network/whois/whois.rbuild | 8 + base/applications/notepad/notepad.rbuild | 17 + base/applications/rapps/rapps.rbuild | 41 + base/applications/regedit/clb/clb.rbuild | 13 + base/applications/regedit/regedit.rbuild | 37 + base/applications/regedt32/regedt32.rbuild | 9 + base/applications/sc/sc.rbuild | 16 + .../screensavers/3dtext/3dtext.rbuild | 17 + .../screensavers/logon/logon.rbuild | 13 + .../screensavers/screensavers.rbuild | 10 + base/applications/shutdown/shutdown.rbuild | 11 + base/applications/sndrec32/sndrec32.rbuild | 20 + base/applications/sndvol32/sndvol32.rbuild | 19 + base/applications/taskmgr/taskmgr.rbuild | 33 + base/applications/winhlp32/winhlp32.rbuild | 26 + base/applications/winver/winver.rbuild | 7 + base/applications/wordpad/wordpad.rbuild | 21 + base/applications/write/write.rbuild | 9 + base/base.rbuild | 19 + base/services/audiosrv/audiosrv.rbuild | 15 + base/services/eventlog/eventlog.rbuild | 18 + base/services/rpcss/rpcss.rbuild | 27 + base/services/services.rbuild | 34 + base/services/spoolsv/spoolsv.rbuild | 10 + base/services/svchost/svchost.rbuild | 8 + base/services/tcpsvcs/tcpsvcs.rbuild | 17 + base/services/telnetd/telnetd.rbuild | 15 + base/services/tftpd/tftpd.rbuild | 11 + base/services/umpnpmgr/umpnpmgr.rbuild | 16 + base/services/wlansvc/wlansvc.rbuild | 14 + base/setup/reactos/reactos.rbuild | 13 + base/setup/setup.rbuild | 19 + base/setup/setup/setup.rbuild | 8 + base/setup/usetup/usetup.rbuild | 44 + base/setup/vmwinst/vmwinst.rbuild | 16 + base/setup/welcome/welcome.rbuild | 10 + base/shell/cmd/cmd.rbuild | 77 + base/shell/explorer-new/explorer.rbuild | 28 + base/shell/explorer/explorer.rbuild | 71 + base/shell/explorer/notifyhook/notifyhook.def | 6 + .../explorer/notifyhook/notifyhook.rbuild | 10 + base/shell/shell.rbuild | 13 + base/system/autochk/autochk.rbuild | 9 + base/system/bootok/bootok.rbuild | 8 + base/system/expand/expand.rbuild | 11 + base/system/format/format.rbuild | 10 + base/system/lsass/lsass.rbuild | 11 + base/system/msiexec/msiexec.rbuild | 17 + base/system/regsvr32/regsvr32.rbuild | 10 + base/system/rundll32/rundll32.rbuild | 8 + base/system/runonce/runonce.rbuild | 9 + base/system/services/services.rbuild | 21 + base/system/smss/smss.rbuild | 32 + base/system/system.rbuild | 46 + base/system/userinit/userinit.rbuild | 14 + base/system/winlogon/winlogon.rbuild | 19 + baseaddress.rbuild | 266 ++ boot/armllb/armllb.rbuild | 80 + boot/boot.rbuild | 15 + boot/bootdata/bootcd/bootcd.rbuild | 15 + .../bootcdregtest/bootcdregtest.rbuild | 6 + boot/bootdata/bootdata.rbuild | 28 + boot/bootdata/livecd/livecd.rbuild | 14 + .../livecdregtest/livecdregtest.rbuild | 5 + boot/bootdata/packages/reactos.dff | 876 +++++ boot/freeldr/bootsect/bootsect.rbuild | 28 + boot/freeldr/fdebug/fdebug.rbuild | 11 + boot/freeldr/freeldr.rbuild | 47 + boot/freeldr/freeldr/arch/i386/fathelp.S | 4 +- boot/freeldr/freeldr/arch/i386/fathelp.asm | 235 ++ boot/freeldr/freeldr/freeldr.rbuild | 57 + boot/freeldr/freeldr/freeldr_arch.rbuild | 111 + boot/freeldr/freeldr/freeldr_base.rbuild | 92 + boot/freeldr/freeldr/freeldr_base64k.rbuild | 32 + boot/freeldr/freeldr/freeldr_main.rbuild | 8 + boot/freeldr/freeldr/freeldr_startup.rbuild | 25 + boot/freeldr/freeldr/setupldr.rbuild | 24 + boot/freeldr/freeldr/setupldr_main.rbuild | 22 + boot/freeldr/install/installfreeldr.rbuild | 7 + config.template.rbuild | 107 + dll/3rdparty/3rdparty.rbuild | 25 + dll/3rdparty/dxtn/dxtn.rbuild | 8 + dll/3rdparty/libjpeg/libjpeg.rbuild | 58 + dll/3rdparty/libpng/libpng.rbuild | 28 + dll/3rdparty/libtiff/libtiff.rbuild | 53 + dll/3rdparty/libxslt/libxslt.rbuild | 36 + dll/3rdparty/mesa32/mesa32.rbuild | 297 ++ dll/cpl/access/access.rbuild | 17 + dll/cpl/appwiz/appwiz.rbuild | 15 + dll/cpl/console/console.rbuild | 14 + dll/cpl/cpl.rbuild | 58 + dll/cpl/desk/desk.rbuild | 36 + dll/cpl/hdwwiz/hdwwiz.rbuild | 16 + dll/cpl/input/input.rbuild | 16 + dll/cpl/intl/intl.rbuild | 24 + dll/cpl/joy/joy.rbuild | 14 + dll/cpl/liccpa/liccpa.rbuild | 14 + dll/cpl/main/main.rbuild | 17 + dll/cpl/mmsys/mmsys.rbuild | 21 + dll/cpl/ncpa/ncpa.rbuild | 12 + dll/cpl/odbccp32/odbccp32.rbuild | 10 + dll/cpl/powercfg/powercfg.rbuild | 18 + dll/cpl/sysdm/sysdm.rbuild | 28 + dll/cpl/telephon/telephon.rbuild | 14 + dll/cpl/timedate/timedate.rbuild | 20 + dll/cpl/usrmgr/usrmgr.rbuild | 21 + dll/directx/amstream/amstream.rbuild | 21 + dll/directx/bdaplgin/bdaplgin.rbuild | 33 + dll/directx/d3d8/d3d8.rbuild | 7 + dll/directx/d3d8thk/d3d8thk.rbuild | 7 + dll/directx/d3d9/d3d9.rbuild | 33 + dll/directx/ddraw/ddraw.rbuild | 73 + dll/directx/devenum/devenum.rbuild | 26 + dll/directx/dinput/dinput.rbuild | 27 + dll/directx/dinput8/dinput8.rbuild | 21 + dll/directx/directx.rbuild | 62 + dll/directx/dmusic/dmusic.rbuild | 29 + dll/directx/dplay/dplay.rbuild | 18 + dll/directx/dplayx/dplayx.rbuild | 27 + dll/directx/dsound/dsound.rbuild | 30 + dll/directx/dsound_new/dsound_new.rbuild | 31 + dll/directx/dxdiagn/dxdiagn.rbuild | 21 + dll/directx/ksproxy/datatype.cpp | 2 - dll/directx/ksproxy/input_pin.cpp | 6 +- dll/directx/ksproxy/interface.cpp | 2 - dll/directx/ksproxy/ksproxy.cpp | 3 +- dll/directx/ksproxy/ksproxy.rbuild | 42 + dll/directx/ksproxy/output_pin.cpp | 5 +- dll/directx/ksuser/ksuser.rbuild | 10 + dll/directx/msdmo/msdmo.rbuild | 16 + dll/directx/msdmo/stubs.c | 2 +- dll/directx/msdvbnp/msdvbnp.rbuild | 34 + dll/directx/msvidctl/msvidctl.rbuild | 30 + dll/directx/qedit/qedit.rbuild | 19 + dll/directx/quartz/quartz.rbuild | 64 + dll/directx/wine/d3d8/d3d8.rbuild | 32 + dll/directx/wine/d3d9/d3d9.rbuild | 34 + dll/directx/wine/d3dx9_24/d3dx9_24.rbuild | 20 + dll/directx/wine/d3dx9_24/d3dx9_24.spec | 8 +- dll/directx/wine/d3dx9_25/d3dx9_25.rbuild | 20 + dll/directx/wine/d3dx9_26/d3dx9_26.rbuild | 20 + dll/directx/wine/d3dx9_27/d3dx9_27.rbuild | 20 + dll/directx/wine/d3dx9_28/d3dx9_28.rbuild | 20 + dll/directx/wine/d3dx9_29/d3dx9_29.rbuild | 20 + dll/directx/wine/d3dx9_30/d3dx9_30.rbuild | 20 + dll/directx/wine/d3dx9_31/d3dx9_31.rbuild | 20 + dll/directx/wine/d3dx9_32/d3dx9_32.rbuild | 20 + dll/directx/wine/d3dx9_33/d3dx9_33.rbuild | 20 + dll/directx/wine/d3dx9_34/d3dx9_34.rbuild | 20 + dll/directx/wine/d3dx9_35/d3dx9_35.rbuild | 20 + dll/directx/wine/d3dx9_36/d3dx9_36.rbuild | 30 + dll/directx/wine/d3dx9_36/d3dx9_36.spec | 382 +- dll/directx/wine/d3dx9_36/d3dx9_36_main.c | 4 - dll/directx/wine/d3dx9_37/d3dx9_37.rbuild | 20 + dll/directx/wine/d3dx9_38/d3dx9_38.rbuild | 20 + dll/directx/wine/d3dx9_39/d3dx9_39.rbuild | 20 + dll/directx/wine/d3dx9_40/d3dx9_40.rbuild | 20 + dll/directx/wine/d3dx9_41/d3dx9_41.rbuild | 20 + dll/directx/wine/d3dx9_42/d3dx9_42.rbuild | 20 + dll/directx/wine/ddraw/ddraw.rbuild | 39 + dll/directx/wine/wine.rbuild | 73 + dll/directx/wine/wined3d/state.c | 2 +- dll/directx/wine/wined3d/wined3d.rbuild | 52 + dll/dll.rbuild | 29 + dll/keyboard/kbda1/kbda1.rbuild | 8 + dll/keyboard/kbda2/kbda2.rbuild | 8 + dll/keyboard/kbda3/kbda3.rbuild | 8 + dll/keyboard/kbdal/kbdal.rbuild | 8 + dll/keyboard/kbdarme/kbdarme.rbuild | 8 + dll/keyboard/kbdarmw/kbdarmw.rbuild | 8 + dll/keyboard/kbdaze/kbdaze.rbuild | 8 + dll/keyboard/kbdazel/kbdazel.rbuild | 8 + dll/keyboard/kbdbe/kbdbe.rbuild | 8 + dll/keyboard/kbdbga/kbdbga.rbuild | 8 + dll/keyboard/kbdbgm/kbdbgm.rbuild | 8 + dll/keyboard/kbdbgt/kbdbgt.rbuild | 8 + dll/keyboard/kbdblr/kbdblr.rbuild | 8 + dll/keyboard/kbdbr/kbdbr.rbuild | 8 + dll/keyboard/kbdbur/kbdbur.rbuild | 8 + dll/keyboard/kbdcan/kbdcan.rbuild | 8 + dll/keyboard/kbdcr/kbdcr.rbuild | 8 + dll/keyboard/kbdcz/kbdcz.rbuild | 8 + dll/keyboard/kbdcz1/kbdcz1.rbuild | 8 + dll/keyboard/kbdda/kbdda.rbuild | 8 + dll/keyboard/kbddv/kbddv.rbuild | 8 + dll/keyboard/kbdes/kbdes.rbuild | 8 + dll/keyboard/kbdest/kbdest.rbuild | 8 + dll/keyboard/kbdfc/kbdfc.rbuild | 8 + dll/keyboard/kbdfi/kbdfi.rbuild | 8 + dll/keyboard/kbdfr/kbdfr.rbuild | 8 + dll/keyboard/kbdgeo/kbdgeo.rbuild | 8 + dll/keyboard/kbdgerg/kbdgerg.rbuild | 8 + dll/keyboard/kbdgneo/kbdgneo.rbuild | 8 + dll/keyboard/kbdgr/kbdgr.rbuild | 8 + dll/keyboard/kbdgrist/kbdgrist.rbuild | 8 + dll/keyboard/kbdhe/kbdhe.rbuild | 8 + dll/keyboard/kbdheb/kbdheb.rbuild | 8 + dll/keyboard/kbdhu/kbdhu.rbuild | 8 + dll/keyboard/kbdic/kbdic.rbuild | 8 + dll/keyboard/kbdinasa/kbdinasa.rbuild | 8 + dll/keyboard/kbdinben/kbdinben.rbuild | 8 + dll/keyboard/kbdindev/kbdindev.rbuild | 8 + dll/keyboard/kbdinguj/kbdinguj.rbuild | 8 + dll/keyboard/kbdinmal/kbdinmal.rbuild | 8 + dll/keyboard/kbdir/kbdir.rbuild | 8 + dll/keyboard/kbdit/kbdit.rbuild | 8 + dll/keyboard/kbdja/kbdja.rbuild | 8 + dll/keyboard/kbdkaz/kbdkaz.rbuild | 8 + dll/keyboard/kbdko/kbdko.rbuild | 8 + dll/keyboard/kbdla/kbdla.rbuild | 8 + dll/keyboard/kbdlt1/kbdlt1.rbuild | 8 + dll/keyboard/kbdlv/kbdlv.rbuild | 8 + dll/keyboard/kbdmac/kbdmac.rbuild | 8 + dll/keyboard/kbdne/kbdne.rbuild | 8 + dll/keyboard/kbdno/kbdno.rbuild | 8 + dll/keyboard/kbdpl1/kbdpl1.rbuild | 8 + dll/keyboard/kbdpo/kbdpo.rbuild | 8 + dll/keyboard/kbdro/kbdro.rbuild | 8 + dll/keyboard/kbdru/kbdru.rbuild | 8 + dll/keyboard/kbdru1/kbdru1.rbuild | 8 + dll/keyboard/kbdsg/kbdsg.rbuild | 8 + dll/keyboard/kbdsk/kbdsk.rbuild | 8 + dll/keyboard/kbdsk1/kbdsk1.rbuild | 8 + dll/keyboard/kbdsw/kbdsw.rbuild | 8 + dll/keyboard/kbdtat/kbdtat.rbuild | 8 + dll/keyboard/kbdth0/kbdth0.rbuild | 8 + dll/keyboard/kbdth1/kbdth1.rbuild | 8 + dll/keyboard/kbdth2/kbdth2.rbuild | 8 + dll/keyboard/kbdth3/kbdth3.rbuild | 8 + dll/keyboard/kbdtuf/kbdtuf.rbuild | 8 + dll/keyboard/kbdtuq/kbdtuq.rbuild | 8 + dll/keyboard/kbduk/kbduk.rbuild | 8 + dll/keyboard/kbdur/kbdur.rbuild | 8 + dll/keyboard/kbdurs/kbdurs.rbuild | 8 + dll/keyboard/kbdus/kbdus.rbuild | 8 + dll/keyboard/kbdusa/kbdusa.rbuild | 8 + dll/keyboard/kbdusl/kbdusl.rbuild | 8 + dll/keyboard/kbdusr/kbdusr.rbuild | 8 + dll/keyboard/kbdusx/kbdusx.rbuild | 8 + dll/keyboard/kbduzb/kbduzb.rbuild | 8 + dll/keyboard/kbdvntc/kbdvntc.rbuild | 8 + dll/keyboard/kbdycc/kbdycc.rbuild | 8 + dll/keyboard/kbdycl/kbdycl.rbuild | 8 + dll/keyboard/keyboard.rbuild | 241 ++ dll/nls/idndl/idndl.rbuild | 11 + dll/nls/idndl_redist/idndl_redist.rbuild | 15 + dll/nls/nls.rbuild | 16 + dll/nls/normaliz/normaliz.rbuild | 6 + .../normaliz_redist/normaliz_redist.rbuild | 20 + dll/ntdll/def/ntdll.pspec | 1432 ++++++++ dll/ntdll/ntdll.rbuild | 63 + dll/shellext/deskadp/deskadp.rbuild | 14 + dll/shellext/deskmon/deskmon.rbuild | 14 + dll/shellext/devcpux/devcpux.rbuild | 11 + dll/shellext/fontext/fontext.rbuild | 16 + dll/shellext/shellext.rbuild | 19 + dll/shellext/slayer/slayer.rbuild | 13 + dll/win32/acledit/acledit.rbuild | 13 + dll/win32/aclui/aclui.rbuild | 20 + dll/win32/activeds/activeds.rbuild | 11 + dll/win32/actxprxy/actxprxy.rbuild | 36 + dll/win32/advapi32/advapi32.rbuild | 63 + dll/win32/advpack/advpack.rbuild | 20 + dll/win32/atl/atl.rbuild | 30 + dll/win32/atl/stubs.c | 4 +- dll/win32/authz/authz.rbuild | 11 + dll/win32/avicap32/avicap32.rbuild | 15 + dll/win32/avifil32/avifil32.rbuild | 33 + dll/win32/batt/batt.rbuild | 8 + dll/win32/bcrypt/bcrypt.rbuild | 9 + dll/win32/beepmidi/beepmidi.rbuild | 8 + dll/win32/browseui/browseui.rbuild | 48 + dll/win32/cabinet/cabinet.rbuild | 17 + dll/win32/cabinet/stubs.c | 2 +- dll/win32/cards/cards.rbuild | 12 + dll/win32/cfgmgr32/cfgmgr32.rbuild | 6 + dll/win32/clusapi/clusapi.rbuild | 11 + dll/win32/comcat/comcat.rbuild | 18 + dll/win32/comctl32/comctl32.rbuild | 60 + dll/win32/comdlg32/comdlg32.rbuild | 31 + dll/win32/compstui/compstui.rbuild | 13 + dll/win32/credui/credui.rbuild | 17 + dll/win32/crtdll/crtdll.rbuild | 22 + dll/win32/crypt32/crypt32.rbuild | 45 + dll/win32/cryptdlg/cryptdlg.rbuild | 18 + dll/win32/cryptdll/cryptdll.rbuild | 13 + dll/win32/cryptdll/stubs.c | 2 +- dll/win32/cryptnet/cryptnet.rbuild | 16 + dll/win32/cryptui/cryptui.rbuild | 26 + dll/win32/dbghelp/dbghelp.rbuild | 50 + dll/win32/dciman32/dciman32.rbuild | 13 + dll/win32/devmgr/devmgr.rbuild | 16 + dll/win32/dhcpcsvc/dhcpcsvc.rbuild | 33 + dll/win32/dnsapi/dnsapi.rbuild | 23 + dll/win32/dwmapi/dwmapi.rbuild | 14 + dll/win32/faultrep/faultrep.rbuild | 9 + dll/win32/fmifs/fmifs.rbuild | 15 + dll/win32/fusion/fusion.rbuild | 18 + dll/win32/gdi32/gdi32.rbuild | 53 + dll/win32/gdiplus/gdiplus.rbuild | 36 + dll/win32/getuname/getuname.rbuild | 9 + dll/win32/glu32/glu32.rbuild | 116 + dll/win32/hhctrl.ocx/hhctrl.ocx.rbuild | 34 + dll/win32/hid/hid.rbuild | 9 + dll/win32/hlink/hlink.rbuild | 22 + dll/win32/hnetcfg/hnetcfg.rbuild | 19 + dll/win32/httpapi/httpapi.rbuild | 9 + dll/win32/iccvid/iccvid.rbuild | 13 + dll/win32/icmp/icmp.rbuild | 10 + dll/win32/imaadp32.acm/imaadp32.acm.rbuild | 11 + dll/win32/imagehlp/imagehlp.rbuild | 14 + dll/win32/imm32/imm32.rbuild | 19 + dll/win32/inetcomm/inetcomm.rbuild | 28 + dll/win32/inetmib1/inetmib1.rbuild | 15 + dll/win32/initpki/initpki.rbuild | 10 + dll/win32/inseng/inseng.rbuild | 15 + dll/win32/iphlpapi/iphlpapi.rbuild | 22 + dll/win32/itircl/itircl.rbuild | 10 + dll/win32/itss/itss.rbuild | 23 + dll/win32/jscript/jscript.rbuild | 44 + dll/win32/kernel32/kernel32.pspec | 1458 ++++++++ dll/win32/kernel32/kernel32.rbuild | 143 + dll/win32/loadperf/loadperf.rbuild | 13 + dll/win32/loadperf/stubs.c | 2 +- dll/win32/localspl/localspl.rbuild | 16 + dll/win32/localui/localui.rbuild | 17 + dll/win32/lpk/lpk.rbuild | 13 + dll/win32/lsasrv/lsasrv.rbuild | 17 + dll/win32/lz32/lz32.rbuild | 11 + dll/win32/mapi32/mapi32.rbuild | 24 + dll/win32/mciavi32/mciavi32.rbuild | 17 + dll/win32/mcicda/mcicda.rbuild | 11 + dll/win32/mciqtz32/mciqtz32.rbuild | 16 + dll/win32/mciseq/mciseq.rbuild | 11 + dll/win32/mciwave/mciwave.rbuild | 12 + dll/win32/mlang/mlang.rbuild | 22 + dll/win32/mmdrv/mmdrv.rbuild | 15 + dll/win32/modemui/modemui.rbuild | 12 + dll/win32/mpr/mpr.rbuild | 22 + dll/win32/mprapi/mprapi.rbuild | 8 + .../msacm32/msacm32.drv/msacm32.drv.rbuild | 12 + dll/win32/msacm32/msacm32.rbuild | 24 + dll/win32/msadp32.acm/msadp32.acm.rbuild | 11 + dll/win32/msafd/msafd.rbuild | 17 + dll/win32/mscat32/mscat32.rbuild | 13 + dll/win32/mscms/mscms.rbuild | 16 + dll/win32/mscoree/mscoree.rbuild | 12 + dll/win32/msctf/msctf.rbuild | 31 + dll/win32/msftedit/msftedit.rbuild | 12 + dll/win32/msg711.acm/msg711.acm.rbuild | 11 + dll/win32/msgina/msgina.rbuild | 17 + dll/win32/msgsm32.acm/msgsm32.acm.rbuild | 10 + dll/win32/mshtml.tlb/mshtml.tlb.rbuild | 15 + dll/win32/mshtml/mshtml.rbuild | 96 + dll/win32/msi/msi.rbuild | 88 + dll/win32/msimg32/msimg32.rbuild | 12 + dll/win32/msimtf/msimtf.rbuild | 15 + dll/win32/msisip/msisip.rbuild | 12 + dll/win32/msisys.ocx/msisys.ocx.rbuild | 11 + dll/win32/msnet32/msnet32.rbuild | 9 + dll/win32/msrle32/msrle32.rbuild | 12 + dll/win32/mssign32/mssign32.rbuild | 10 + dll/win32/mssip32/mssip32.rbuild | 10 + dll/win32/mstask/mstask.rbuild | 27 + dll/win32/msvcrt/msvcrt.rbuild | 26 + dll/win32/msvcrt20/msvcrt20.rbuild | 15 + dll/win32/msvcrt40/msvcrt40.rbuild | 13 + dll/win32/msvfw32/msvfw32.rbuild | 23 + dll/win32/msvidc32/msvidc32.rbuild | 11 + dll/win32/mswsock/mswsock.rbuild | 8 + dll/win32/msxml3/msxml3.rbuild | 67 + dll/win32/nddeapi/nddeapi.rbuild | 9 + dll/win32/netapi32/netapi32.rbuild | 27 + dll/win32/netcfgx/netcfgx.rbuild | 23 + dll/win32/netevent/netevent.rbuild | 6 + dll/win32/netid/netid.rbuild | 12 + dll/win32/netshell/netshell.rbuild | 28 + dll/win32/newdev/newdev.rbuild | 16 + dll/win32/ntdsapi/ntdsapi.rbuild | 10 + dll/win32/ntlanman/ntlanman.rbuild | 11 + dll/win32/ntmarta/ntmarta.rbuild | 12 + dll/win32/ntprint/ntprint.rbuild | 13 + dll/win32/objsel/objsel.rbuild | 22 + dll/win32/odbc32/odbc32.rbuild | 13 + dll/win32/odbccp32/odbccp32.rbuild | 15 + dll/win32/ole32/ole32.rbuild | 85 + dll/win32/oleacc/oleacc.rbuild | 16 + dll/win32/oleaut32/oleaut32.rbuild | 65 + dll/win32/olecli32/olecli32.rbuild | 13 + dll/win32/oledlg/oledlg.rbuild | 20 + dll/win32/olepro32/olepro32.rbuild | 14 + dll/win32/olesvr32/olesvr32.rbuild | 13 + dll/win32/olethk32/olethk32.rbuild | 10 + dll/win32/opengl32/opengl32.rbuild | 13 + dll/win32/pdh/pdh.rbuild | 10 + dll/win32/pidgen/pidgen.rbuild | 10 + dll/win32/powrprof/powrprof.rbuild | 13 + dll/win32/printui/printui.rbuild | 11 + dll/win32/psapi/psapi.rbuild | 12 + dll/win32/pstorec/pstorec.rbuild | 19 + dll/win32/qmgr/qmgr.rbuild | 34 + dll/win32/qmgrprxy/qmgrprxy.rbuild | 27 + dll/win32/query/query.rbuild | 11 + dll/win32/rasadhlp/rasadhlp.rbuild | 12 + dll/win32/rasapi32/rasapi32.rbuild | 13 + dll/win32/rasdlg/rasdlg.rbuild | 9 + dll/win32/rasman/rasman.rbuild | 9 + dll/win32/resutils/resutils.rbuild | 9 + dll/win32/riched20/riched20.rbuild | 40 + dll/win32/riched32/riched32.rbuild | 16 + dll/win32/rpcrt4/rpcrt4.rbuild | 49 + dll/win32/rsabase/rsabase.rbuild | 15 + dll/win32/rsaenh/rsaenh.rbuild | 27 + dll/win32/samlib/samlib.rbuild | 9 + dll/win32/samsrv/samsrv.rbuild | 9 + dll/win32/sccbase/sccbase.rbuild | 10 + dll/win32/schannel/schannel.rbuild | 15 + dll/win32/secur32/secur32.rbuild | 15 + dll/win32/security/security.rbuild | 8 + dll/win32/sensapi/sensapi.rbuild | 11 + dll/win32/serialui/serialui.rbuild | 8 + dll/win32/setupapi/setupapi.rbuild | 43 + dll/win32/sfc/sfc.rbuild | 6 + dll/win32/sfc_os/sfc_os.rbuild | 6 + dll/win32/shdoclc/shdoclc.rbuild | 9 + dll/win32/shdocvw/shdocvw.rbuild | 49 + dll/win32/shell32/shell32.rbuild | 86 + dll/win32/shfolder/shfolder.rbuild | 14 + dll/win32/shimgvw/shimgvw.rbuild | 12 + dll/win32/shlwapi/shlwapi.rbuild | 43 + dll/win32/slbcsp/slbcsp.rbuild | 10 + dll/win32/smdll/smdll.rbuild | 10 + dll/win32/sndblst/sndblst.rbuild | 17 + dll/win32/snmpapi/snmpapi.rbuild | 11 + dll/win32/softpub/softpub.rbuild | 10 + dll/win32/spoolss/spoolss.rbuild | 15 + dll/win32/srclient/srclient.rbuild | 8 + dll/win32/stdole2.tlb/stdole2.rbuild | 17 + dll/win32/stdole32.tlb/stdole32.rbuild | 19 + dll/win32/sti/sti.rbuild | 36 + dll/win32/sxs/sxs.rbuild | 11 + dll/win32/syssetup/syssetup.rbuild | 23 + dll/win32/t2embed/t2embed.rbuild | 14 + dll/win32/tapi32/tapi32.rbuild | 17 + dll/win32/tapiui/tapiui.rbuild | 4 + dll/win32/traffic/traffic.rbuild | 9 + dll/win32/twain_32/twain_32.rbuild | 13 + dll/win32/uext2/uext2.rbuild | 8 + dll/win32/ufat/ufat.rbuild | 8 + dll/win32/ufatx/ufatx.rbuild | 7 + dll/win32/untfs/untfs.rbuild | 8 + dll/win32/updspapi/updspapi.rbuild | 10 + dll/win32/url/url.rbuild | 11 + dll/win32/urlmon/urlmon.rbuild | 56 + dll/win32/user32/user32.pspec | 787 +++++ dll/win32/user32/user32.rbuild | 76 + dll/win32/userenv/userenv.rbuild | 19 + dll/win32/usp10/usp10.rbuild | 19 + dll/win32/uxtheme/uxtheme.rbuild | 29 + dll/win32/vdmdbg/vdmdbg.rbuild | 7 + dll/win32/version/version.rbuild | 17 + dll/win32/wdmaud.drv/wdmaud.rbuild | 26 + dll/win32/win32.rbuild | 688 ++++ dll/win32/windowscodecs/windowscodecs.rbuild | 40 + dll/win32/winemp3.acm/winemp3.acm.rbuild | 14 + dll/win32/winfax/winfax.rbuild | 7 + dll/win32/wing32/wing32.rbuild | 11 + dll/win32/winhttp/winhttp.rbuild | 25 + dll/win32/wininet/wininet.rbuild | 39 + dll/win32/winmm/midimap/midimap.rbuild | 13 + dll/win32/winmm/winmm.rbuild | 28 + dll/win32/winspool/winspool.rbuild | 11 + dll/win32/winsta/winsta.rbuild | 15 + dll/win32/wintrust/wintrust.rbuild | 21 + dll/win32/wlanapi/wlanapi.rbuild | 11 + dll/win32/wldap32/wldap32.rbuild | 34 + dll/win32/wmi/wmi.rbuild | 9 + dll/win32/ws2_32/ws2_32.rbuild | 29 + dll/win32/ws2_32_new/ws2_32.rbuild | 52 + dll/win32/ws2help/ws2help.rbuild | 14 + dll/win32/wshirda/wshirda.rbuild | 8 + dll/win32/wshtcpip/wshtcpip.rbuild | 12 + dll/win32/wsock32/wsock32.rbuild | 8 + dll/win32/wtsapi32/wtsapi32.rbuild | 14 + dll/win32/wuapi/wuapi.rbuild | 20 + dll/win32/xinput1_1/xinput1_1.rbuild | 8 + dll/win32/xinput1_2/xinput1_2.rbuild | 8 + dll/win32/xinput1_3/xinput1_3.rbuild | 9 + dll/win32/xinput9_1_0/xinput9_1_0.rbuild | 8 + dll/win32/xmllite/xmllite.rbuild | 9 + drivers/base/beep/beep.rbuild | 8 + drivers/base/bootvid/bootvid.rbuild | 24 + drivers/base/directory.rbuild | 26 + drivers/base/kdcom/kdcom.rbuild | 24 + drivers/base/kddll/kddll.rbuild | 25 + drivers/base/nmidebug/nmidebug.rbuild | 10 + drivers/base/null/null.rbuild | 10 + drivers/battery/battc/battc.rbuild | 11 + drivers/battery/directory.rbuild | 7 + drivers/bluetooth/directory.rbuild | 7 + drivers/bluetooth/fbtusb/fbtusb.rbuild | 15 + drivers/bus/acpi/acpi.rbuild | 44 + drivers/bus/acpi/acpica/acpica.rbuild | 140 + drivers/bus/acpi/cmbatt/cmbatt.rbuild | 15 + drivers/bus/acpi/compbatt/compbatt.rbuild | 13 + drivers/bus/directory.rbuild | 19 + drivers/bus/isapnp/isapnp.rbuild | 13 + drivers/bus/pci/pci.rbuild | 12 + drivers/bus/pcix/pcix.rbuild | 51 + drivers/bus/pcmcia/pcmcia.rbuild | 12 + drivers/directx/directory.rbuild | 13 + drivers/directx/dxapi/dxapi.rbuild | 13 + drivers/directx/dxg/dxg.rbuild | 14 + drivers/directx/dxgthk/dxgthk.rbuild | 10 + drivers/drivers.rbuild | 61 + drivers/filesystems/cdfs/cdfs.rbuild | 23 + drivers/filesystems/directory.rbuild | 28 + drivers/filesystems/ext2/ext2.rbuild | 33 + drivers/filesystems/fastfat/vfatfs.rbuild | 31 + .../filesystems/fastfat_new/fastfat.rbuild | 31 + drivers/filesystems/fs_rec/fs_rec.rbuild | 15 + drivers/filesystems/msfs/msfs.rbuild | 14 + drivers/filesystems/mup/mup.rbuild | 10 + drivers/filesystems/npfs/npfs.rbuild | 17 + drivers/filesystems/ntfs/ntfs.rbuild | 25 + drivers/input/directory.rbuild | 16 + drivers/input/i8042prt/i8042prt.rbuild | 18 + drivers/input/kbdclass/kbdclass.rbuild | 12 + drivers/input/mouclass/mouclass.rbuild | 11 + drivers/input/sermouse/sermouse.rbuild | 14 + drivers/ksfilter/directory.rbuild | 11 + drivers/ksfilter/ks/ks.rbuild | 36 + drivers/ksfilter/swenum/swenum.rbuild | 8 + drivers/multimedia/audio/directory.rbuild | 20 + .../multimedia/audio/mpu401_nt4/mpu401.rbuild | 17 + .../audio/sb16_nt4.old/sb16_nt4.rbuild | 11 + .../audio/sndblst.old/sndblst.rbuild | 14 + .../audio/sndblst_sys/sndblst.rbuild | 9 + drivers/multimedia/audio/sound/sound.rbuild | 14 + drivers/multimedia/bdasup/bdasup.rbuild | 10 + drivers/multimedia/directory.rbuild | 10 + drivers/network/acd/rasacd.rbuild | 14 + drivers/network/afd/afd.rbuild | 28 + drivers/network/dd/directory.rbuild | 10 + drivers/network/dd/ne2000/ne2000.rbuild | 13 + drivers/network/dd/pcnet/pcnet.rbuild | 15 + drivers/network/directory.rbuild | 19 + drivers/network/ndis/ndis.rbuild | 40 + drivers/network/tcpip/tcpip.rbuild | 37 + drivers/network/tdi/tdi.rbuild | 23 + drivers/parallel/directory.rbuild | 7 + drivers/parallel/parallel/parallel.rbuild | 9 + drivers/serial/directory.rbuild | 10 + drivers/serial/serenum/serenum.rbuild | 12 + drivers/serial/serial/serial.rbuild | 19 + drivers/setup/blue/blue.rbuild | 11 + drivers/setup/directory.rbuild | 7 + drivers/storage/class/cdrom/cdrom.rbuild | 13 + drivers/storage/class/class2/class2.rbuild | 12 + drivers/storage/class/directory.rbuild | 19 + drivers/storage/class/disk/disk.rbuild | 12 + drivers/storage/class/ramdisk/ramdisk.rbuild | 9 + drivers/storage/classpnp/classpnp.rbuild | 37 + drivers/storage/directory.rbuild | 22 + drivers/storage/floppy/floppy.rbuild | 15 + drivers/storage/ide/atapi/atapi.rbuild | 10 + drivers/storage/ide/directory.rbuild | 16 + drivers/storage/ide/pciide/pciide.rbuild | 9 + drivers/storage/ide/pciidex/pciidex.rbuild | 13 + drivers/storage/ide/uniata/uniata.rbuild | 27 + drivers/storage/port/buslogic/buslogic.rbuild | 9 + drivers/storage/port/directory.rbuild | 7 + drivers/storage/scsiport/scsiport.pspec | 51 + drivers/storage/scsiport/scsiport.rbuild | 13 + drivers/usb/directory.rbuild | 16 + drivers/usb/nt4compat/directory.rbuild | 7 + .../usb/nt4compat/usbdriver/usbdriver.rbuild | 30 + drivers/usb/usbd/usbd.rbuild | 9 + drivers/usb/usbehci/usbehci.rbuild | 18 + drivers/usb/usbhub/usbhub.rbuild | 13 + drivers/usb/usbstor/usbstor.rbuild | 10 + drivers/video/directory.rbuild | 16 + drivers/video/displays/directory.rbuild | 16 + .../video/displays/framebuf/framebuf.rbuild | 13 + .../displays/framebuf_new/framebuf_new.rbuild | 21 + .../displays/framebufacc/framebufacc.rbuild | 13 + drivers/video/displays/vga/vgaddi.rbuild | 24 + drivers/video/font/bmfd/bmfd.rbuild | 9 + drivers/video/font/directory.rbuild | 11 + drivers/video/font/ftfd/ftfd.rbuild | 13 + drivers/video/miniport/directory.rbuild | 19 + drivers/video/miniport/vbe/vbemp.rbuild | 9 + drivers/video/miniport/vga/vgamp.rbuild | 10 + drivers/video/miniport/vga_new/vga.rbuild | 18 + .../video/miniport/vmx_svga/vmx_svga.rbuild | 9 + drivers/video/miniport/xboxvmp/xboxvmp.rbuild | 9 + drivers/video/videoprt/videoprt.rbuild | 26 + .../backpln/audio_test/audio_test.rbuild | 13 + drivers/wdm/audio/backpln/directory.rbuild | 10 + .../wdm/audio/backpln/portcls/portcls.rbuild | 65 + drivers/wdm/audio/directory.rbuild | 22 + .../audio/drivers/CMIDriver/cmidriver.rbuild | 24 + drivers/wdm/audio/drivers/directory.rbuild | 13 + .../wdm/audio/drivers/mpu401/mpu401.rbuild | 14 + drivers/wdm/audio/drivers/sb16/sb16.rbuild | 11 + drivers/wdm/audio/drm/directory.rbuild | 7 + drivers/wdm/audio/drm/drmk/drmk.rbuild | 16 + drivers/wdm/audio/filters/directory.rbuild | 10 + .../wdm/audio/filters/kmixer/kmixer.rbuild | 14 + .../audio/filters/splitter/splitter.rbuild | 9 + drivers/wdm/audio/legacy/directory.rbuild | 10 + drivers/wdm/audio/legacy/stream/stream.rbuild | 17 + drivers/wdm/audio/legacy/wdmaud/wdmaud.rbuild | 20 + drivers/wdm/audio/sysaudio/sysaudio.rbuild | 16 + drivers/wdm/wdm.rbuild | 7 + drivers/wmi/wmilib.rbuild | 9 + hal/hal.pspec | 106 + hal/hal.rbuild | 27 + hal/halarm/directory.rbuild | 18 + hal/halarm/hal.rbuild | 18 + hal/halarm/hal_generic.rbuild | 33 + hal/halarm/versa/halup.rbuild | 16 + hal/halppc/directory.rbuild | 10 + hal/halppc/generic/generic.rbuild | 29 + hal/halppc/up/halup.rbuild | 13 + hal/halx86/directory.rbuild | 25 + hal/halx86/hal.rbuild | 21 + hal/halx86/hal_generic.rbuild | 35 + hal/halx86/hal_generic_acpi.rbuild | 26 + hal/halx86/hal_generic_mp.rbuild | 23 + hal/halx86/hal_generic_pcat.rbuild | 27 + hal/halx86/hal_generic_up.rbuild | 17 + hal/halx86/hal_mini.rbuild | 46 + hal/halx86/halacpi.rbuild | 22 + hal/halx86/halamd64.rbuild | 33 + hal/halx86/halmps.rbuild | 27 + hal/halx86/halxbox.rbuild | 23 + hal/halx86/mp/i386/mps.S | 4 +- include/directory.rbuild | 13 + include/dxsdk/dxsdk.rbuild | 20 + include/psdk/psdk.rbuild | 88 + include/reactos/idl/idl.rbuild | 36 + include/reactos/mc/mc.rbuild | 31 + include/reactos/reactos.rbuild | 13 + include/reactos/syscalls.inc | 94 + include/reactos/version.h | 32 + include/reactos/wine/wineheaders.rbuild | 5 + lib/3rdparty/3rdparty.rbuild | 46 + lib/3rdparty/adns/adns.rbuild | 22 + lib/3rdparty/bzip2/bzip2.rbuild | 14 + lib/3rdparty/cardlib/cardlib.rbuild | 19 + lib/3rdparty/expat/expat.rbuild | 13 + lib/3rdparty/freetype/freetype.rbuild | 94 + lib/3rdparty/fullfat/fullfat.rbuild | 21 + lib/3rdparty/icu4ros/icu4ros.rbuild | 57 + lib/3rdparty/libmpg123/libmpg123.rbuild | 42 + .../libsamplerate/libsamplerate.rbuild | 9 + lib/3rdparty/libwine/libwine.rbuild | 17 + lib/3rdparty/libxml2/libxml2.rbuild | 64 + lib/3rdparty/mingw/mingw.rbuild | 73 + lib/3rdparty/zlib/zlib.rbuild | 42 + lib/atl/atl.rbuild | 10 + lib/cmlib/cmlib.rbuild | 34 + lib/cportlib/cportlib.rbuild | 8 + lib/debugsup/debugsup.rbuild | 10 + lib/dnslib/dnslib.rbuild | 22 + lib/drivers/chew/chew.rbuild | 7 + lib/drivers/csq/csq.rbuild | 6 + lib/drivers/directory.rbuild | 19 + lib/drivers/ip/ip.rbuild | 44 + lib/drivers/oskittcp/oskittcp.rbuild | 48 + lib/drivers/sound/legacy/legacy.rbuild | 10 + lib/drivers/sound/mmebuddy/mmebuddy.rbuild | 32 + lib/drivers/sound/mment4/mment4.rbuild | 9 + lib/drivers/sound/mmixer/mmixer.rbuild | 13 + lib/drivers/sound/shared/shared.rbuild | 9 + lib/drivers/sound/sound.rbuild | 25 + .../sound/soundblaster/soundblaster.rbuild | 13 + lib/drivers/sound/uartmidi/uartmidi.rbuild | 9 + lib/epsapi/epsapi.rbuild | 9 + lib/fslib/directory.rbuild | 16 + lib/fslib/ext2lib/ext2lib.rbuild | 14 + lib/fslib/ntfslib/ntfslib.rbuild | 6 + lib/fslib/vfatlib/vfatlib.rbuild | 19 + lib/fslib/vfatxlib/vfatxlib.rbuild | 7 + lib/inflib/inflib.rbuild | 30 + lib/lib.mak | 7 + lib/lib.rbuild | 67 + lib/lsalib/lsalib.rbuild | 7 + lib/newinflib/inflib.rbuild | 29 + lib/nls/idna/idna.rbuild | 15 + lib/nls/nls.rbuild | 13 + lib/nls/normalize/normalize.rbuild | 12 + lib/nls/scripts/scripts.rbuild | 12 + lib/ppcmmu/ppcmmu.rbuild | 9 + lib/pseh/pseh.rbuild | 25 + lib/recyclebin/recyclebin.rbuild | 10 + lib/rossym/delete.c | 8 +- lib/rossym/dummy.c | 33 +- lib/rossym/find.c | 124 +- lib/rossym/fromfile.c | 191 +- lib/rossym/frommem.c | 203 +- lib/rossym/initum.c | 7 +- lib/rossym/rossym.rbuild | 15 + lib/rossym/rossympriv.h | 7 + lib/rossym/zwfile.c | 14 +- lib/rtl/i386/rtlswap.S | 53 + lib/rtl/rtl.rbuild | 112 + lib/sdk/crt/crt.rbuild | 575 +++ lib/sdk/crt/libcntpr.rbuild | 244 ++ lib/sdk/crt/math/i386/atan2.c | 27 + lib/sdk/crt/math/i386/exp.c | 64 + lib/sdk/crt/math/i386/fmod.c | 49 + lib/sdk/crt/math/i386/fmodf.c | 28 + lib/sdk/crt/math/i386/sqrtf.c | 12 + lib/sdk/crt/mem/i386/memcpy_asm.s | 0 lib/sdk/delayimp/delayimp.rbuild | 7 + lib/sdk/dxguid/dxguid.rbuild | 5 + lib/sdk/ioevent/ioevent.rbuild | 5 + lib/sdk/nt/nt.rbuild | 5 + lib/sdk/scrnsave/scrnsave.rbuild | 7 + lib/sdk/sdk.rbuild | 32 + lib/sdk/strmiids/strmiids.rbuild | 5 + lib/sdk/uuid/uuid.c | 176 + lib/sdk/uuid/uuid.rbuild | 5 + lib/sdk/wdmguid/wdmguid.rbuild | 5 + lib/smlib/smlib.rbuild | 11 + lib/tdilib/tdilib.rbuild | 9 + media/drivers/drivers.rbuild | 7 + media/drivers/etc/etc.rbuild | 12 + media/fonts/fonts.rbuild | 36 + media/inf/inf.rbuild | 35 + media/media.rbuild | 22 + media/nls/nls.rbuild | 68 + media/sounds/sounds.rbuild | 7 + media/vgafonts/vgafonts.rbuild | 13 + modules/directory.rbuild | 25 + modules/empty.rbuild | 3 + ntoskrnl/kdbg/i386/longjmp.S | 70 + ntoskrnl/kdbg/i386/setjmp.S | 61 + ntoskrnl/kdbg/kdb_symbols.c | 109 +- ntoskrnl/ntkrnlmp.rbuild | 9 + ntoskrnl/ntoskrnl-generic.rbuild | 590 ++++ ntoskrnl/ntoskrnl.pspec | 1644 +++++++++ ntoskrnl/ntoskrnl.rbuild | 11 + ntoskrnl/ntoskrnl.spec | 2 +- ntoskrnl/ntoskrnl_i386.lnk | 43 +- proxy.mak | 21 + subsystems/csr/csr.rbuild | 15 + subsystems/csr/csrsrv/csrsrv.rbuild | 18 + subsystems/ntvdm/ntvdm.rbuild | 11 + subsystems/subsystems.rbuild | 12 + subsystems/win/basesrv/basesrv.rbuild | 13 + subsystems/win/directory.rbuild | 10 + subsystems/win/winsrv/winsrv.rbuild | 15 + subsystems/win32/csrss/csrsrv/csrsrv.rbuild | 21 + subsystems/win32/csrss/csrss.rbuild | 21 + .../win32/csrss/win32csr/win32csr.rbuild | 33 + subsystems/win32/win32.rbuild | 10 + subsystems/win32/win32k/win32k.pspec | 229 ++ subsystems/win32/win32k/win32k.rbuild | 212 ++ tools/bin2c.mak | 36 + tools/buildno/buildno.cpp | 421 +++ tools/buildno/buildno.mak | 57 + tools/buildno/pch.h | 44 + tools/cabman/cabman.rbuild | 11 + tools/cdmake/cdmake.rbuild | 6 + tools/gendib/gendib.mak | 57 + tools/geninc/data.c | 1567 +++++++++ tools/geninc/geninc.rbuild | 10 + tools/hpp/hpp.rbuild | 6 + tools/kbdtool/kbdtool.rbuild | 8 + tools/log2lines/log2lines.mak | 99 + tools/mkhive/mkhive.rbuild | 19 + tools/nandflash/nandflash.rbuild | 5 + tools/ofw_interface/ofw_interface.mak | 63 + tools/pefixup.mak | 36 + tools/pipetools/pipetools.mak | 47 + tools/rbuild/automaticdependency.cpp | 560 +++ tools/rbuild/autoregister.cpp | 88 + tools/rbuild/backend/backend.cpp | 126 + tools/rbuild/backend/backend.h | 77 + .../backend/dependencymap/dependencymap.cpp | 204 ++ .../backend/dependencymap/dependencymap.h | 64 + tools/rbuild/backend/mingw/compilers/gcc.mak | 158 + tools/rbuild/backend/mingw/compilers/msc.mak | 101 + tools/rbuild/backend/mingw/linkers/ld.mak | 90 + tools/rbuild/backend/mingw/linkers/mslink.mak | 1 + tools/rbuild/backend/mingw/mingw.cpp | 1358 +++++++ tools/rbuild/backend/mingw/mingw.h | 151 + tools/rbuild/backend/mingw/modulehandler.cpp | 3112 +++++++++++++++++ tools/rbuild/backend/mingw/modulehandler.h | 372 ++ .../backend/mingw/mstools_detection.cpp | 2295 ++++++++++++ tools/rbuild/backend/mingw/pch_detection.h | 17 + tools/rbuild/backend/mingw/pipe_detection.c | 23 + tools/rbuild/backend/mingw/proxymakefile.cpp | 127 + tools/rbuild/backend/mingw/rule.cpp | 157 + tools/rbuild/backend/mingw/rule.h | 47 + tools/rbuild/backend/mingw/rules.mak | 364 ++ tools/rbuild/backend/msbuild/msbuild.cpp | 270 ++ tools/rbuild/backend/msbuild/msbuild.h | 68 + tools/rbuild/backend/msvc/genguid.cpp | 95 + tools/rbuild/backend/msvc/msvc.cpp | 568 +++ tools/rbuild/backend/msvc/msvc.h | 282 ++ tools/rbuild/backend/msvc/msvcmaker.cpp | 872 +++++ tools/rbuild/backend/msvc/projmaker.cpp | 330 ++ tools/rbuild/backend/msvc/propsmaker.cpp | 195 ++ .../backend/msvc/rules/reactos.defaults.props | 27 + .../rbuild/backend/msvc/rules/reactos.targets | 6 + .../backend/msvc/rules/s_as_mscpp.props | 21 + .../backend/msvc/rules/s_as_mscpp.rules | 44 + .../backend/msvc/rules/s_as_mscpp.targets | 84 + .../rbuild/backend/msvc/rules/s_as_mscpp.xml | 145 + tools/rbuild/backend/msvc/rules/spec.props | 38 + tools/rbuild/backend/msvc/rules/spec.rules | 57 + tools/rbuild/backend/msvc/rules/spec.targets | 159 + tools/rbuild/backend/msvc/rules/spec.xml | 274 ++ tools/rbuild/backend/msvc/slnmaker.cpp | 137 + tools/rbuild/backend/msvc/vcprojmaker.cpp | 674 ++++ tools/rbuild/backend/msvc/vcxprojmaker.cpp | 282 ++ tools/rbuild/backend/msvc/vspropsmaker.cpp | 268 ++ .../backend/versionreport/versionreport.cpp | 126 + .../backend/versionreport/versionreport.h | 65 + tools/rbuild/bootstrap.cpp | 122 + tools/rbuild/cdfile.cpp | 65 + tools/rbuild/compilationunit.cpp | 137 + tools/rbuild/compilationunitsupportcode.cpp | 97 + tools/rbuild/compilerdirective.cpp | 145 + tools/rbuild/compilerflag.cpp | 67 + tools/rbuild/configuration.cpp | 42 + tools/rbuild/define.cpp | 97 + tools/rbuild/directory.cpp | 249 ++ tools/rbuild/doc/rbuild.dbk | 1809 ++++++++++ tools/rbuild/doc/rbuild.txt | 538 +++ tools/rbuild/empty.def | 1 + tools/rbuild/exception.cpp | 184 + tools/rbuild/exception.h | 146 + tools/rbuild/filesupportcode.cpp | 90 + tools/rbuild/global.cpp | 70 + tools/rbuild/include.cpp | 137 + tools/rbuild/installfile.cpp | 68 + tools/rbuild/linkerflag.cpp | 64 + tools/rbuild/linkerscript.cpp | 38 + tools/rbuild/makefile | 3 + tools/rbuild/module.cpp | 1981 +++++++++++ tools/rbuild/pch.h | 81 + tools/rbuild/project.cpp | 549 +++ tools/rbuild/project.dtd | 155 + tools/rbuild/rbuild.cpp | 422 +++ tools/rbuild/rbuild.dsp | 360 ++ tools/rbuild/rbuild.dsw | 29 + tools/rbuild/rbuild.h | 1100 ++++++ tools/rbuild/rbuild.mak | 560 +++ tools/rbuild/rbuild.sln | 19 + tools/rbuild/rbuild.vcproj | 1286 +++++++ tools/rbuild/stubbedcomponent.cpp | 118 + tools/rbuild/syssetupgenerator.cpp | 117 + tools/rbuild/test.h | 162 + tools/rbuild/tests/alltests.cpp | 215 ++ tools/rbuild/tests/cdfiletest.cpp | 40 + tools/rbuild/tests/compilationunittest.cpp | 49 + .../tests/data/automaticdependency.rbuild | 16 + .../data/automaticdependency_include.rbuild | 17 + tools/rbuild/tests/data/cdfile.rbuild | 9 + .../rbuild/tests/data/compilationunit.rbuild | 13 + tools/rbuild/tests/data/define.rbuild | 10 + tools/rbuild/tests/data/if.rbuild | 14 + tools/rbuild/tests/data/include.rbuild | 15 + tools/rbuild/tests/data/invoke.rbuild | 14 + tools/rbuild/tests/data/linkerflag.rbuild | 8 + tools/rbuild/tests/data/module.rbuild | 18 + tools/rbuild/tests/data/project.rbuild | 12 + tools/rbuild/tests/data/sourcefile1.c | 13 + .../data/sourcefile1/sourcefile1_header3.h | 1 + .../data/sourcefile1/sourcefile_includenext.h | 1 + tools/rbuild/tests/data/sourcefile1_header1.h | 1 + tools/rbuild/tests/data/sourcefile1_header2.h | 3 + tools/rbuild/tests/data/sourcefile1_recurse.h | 2 + tools/rbuild/tests/data/sourcefile_include.c | 2 + tools/rbuild/tests/data/sourcefile_include.h | 1 + .../tests/data/sourcefile_includenext.h | 1 + tools/rbuild/tests/data/symbol.rbuild | 10 + tools/rbuild/tests/definetest.cpp | 39 + tools/rbuild/tests/functiontest.cpp | 28 + tools/rbuild/tests/iftest.cpp | 68 + tools/rbuild/tests/includetest.cpp | 42 + tools/rbuild/tests/invoketest.cpp | 37 + tools/rbuild/tests/linkerflagtest.cpp | 37 + tools/rbuild/tests/moduletest.cpp | 55 + tools/rbuild/tests/projecttest.cpp | 28 + tools/rbuild/tests/sourcefiletest.cpp | 91 + tools/rbuild/tests/symboltest.cpp | 43 + tools/rbuild/testsupportcode.cpp | 413 +++ tools/rbuild/xmlnode.cpp | 38 + tools/rbuild_helper/rbuild_helper.rbuild | 7 + tools/rgenstat/rgenstat.rbuild | 6 + tools/rsym/raddr2line.mak | 41 + tools/rsym/rsym.c | 985 ++++++ tools/rsym/rsym.mak | 64 + tools/ssprintf.cpp | 1969 +++++++++++ tools/ssprintf.h | 40 + tools/tools.mak | 54 + tools/tools.rbuild | 49 + tools/unicode/unicode.rbuild | 74 + tools/utf16le/utf16le.rbuild | 5 + tools/widl/widl.rbuild | 26 + tools/winebuild/Makefile.in | 39 + tools/winebuild/build.h | 329 ++ tools/winebuild/import.c | 1306 +++++++ tools/winebuild/main.c | 685 ++++ tools/winebuild/mkstemps.c | 139 + tools/winebuild/parser.c | 1048 ++++++ tools/winebuild/relay.c | 1182 +++++++ tools/winebuild/res16.c | 334 ++ tools/winebuild/res32.c | 666 ++++ tools/winebuild/ros_diff.patch | 388 ++ tools/winebuild/spec16.c | 1047 ++++++ tools/winebuild/spec32.c | 989 ++++++ tools/winebuild/utils.c | 995 ++++++ tools/winebuild/winebuild.man.in | 491 +++ tools/winebuild/winebuild.rbuild | 14 + tools/wmc/wmc.rbuild | 11 + tools/wpp/wpp.rbuild | 8 + tools/wrc/wrc.rbuild | 19 + tools/xml.cpp | 966 +++++ tools/xml.h | 242 ++ 981 files changed, 70847 insertions(+), 655 deletions(-) create mode 100644 Makefile create mode 100644 ReactOS-amd64.rbuild create mode 100644 ReactOS-arm.rbuild create mode 100644 ReactOS-generic.rbuild create mode 100644 ReactOS-i386.rbuild create mode 100644 ReactOS-ppc.rbuild create mode 100644 base/applications/applications.rbuild create mode 100644 base/applications/cacls/cacls.rbuild create mode 100644 base/applications/calc/calc.rbuild create mode 100644 base/applications/charmap/charmap.rbuild create mode 100644 base/applications/cmdutils/cmdutils.rbuild create mode 100644 base/applications/cmdutils/dbgprint/dbgprint.rbuild create mode 100644 base/applications/cmdutils/doskey/doskey.rbuild create mode 100644 base/applications/cmdutils/find/find.rbuild create mode 100644 base/applications/cmdutils/hostname/hostname.rbuild create mode 100644 base/applications/cmdutils/lodctr/lodctr.rbuild create mode 100644 base/applications/cmdutils/more/more.rbuild create mode 100644 base/applications/cmdutils/reg/reg.rbuild create mode 100644 base/applications/cmdutils/xcopy/xcopy.rbuild create mode 100644 base/applications/control/control.rbuild create mode 100644 base/applications/dxdiag/dxdiag.rbuild create mode 100644 base/applications/extrac32/extrac32.rbuild create mode 100644 base/applications/findstr/findstr.rbuild create mode 100644 base/applications/fontview/fontview.rbuild create mode 100644 base/applications/games/games.rbuild create mode 100644 base/applications/games/solitaire/solitaire.rbuild create mode 100644 base/applications/games/spider/spider.rbuild create mode 100644 base/applications/games/winmine/winmine.rbuild create mode 100644 base/applications/hh/hh.rbuild create mode 100644 base/applications/iexplore/iexplore.rbuild create mode 100644 base/applications/kbswitch/kbsdll/kbsdll.rbuild create mode 100644 base/applications/kbswitch/kbswitch.rbuild create mode 100644 base/applications/logoff/logoff.rbuild create mode 100644 base/applications/magnify/magnify.rbuild create mode 100644 base/applications/mmc/mmc.rbuild create mode 100644 base/applications/mplay32/mplay32.rbuild create mode 100644 base/applications/msconfig/msconfig.rbuild create mode 100644 base/applications/mscutils/devmgmt/devmgmt.rbuild create mode 100644 base/applications/mscutils/directory.rbuild create mode 100644 base/applications/mscutils/eventvwr/eventvwr.rbuild create mode 100644 base/applications/mscutils/servman/servman.rbuild create mode 100644 base/applications/mstsc/mstsc.rbuild create mode 100644 base/applications/network/arp/arp.rbuild create mode 100644 base/applications/network/dwnl/dwnl.rbuild create mode 100644 base/applications/network/finger/finger.rbuild create mode 100644 base/applications/network/ftp/ftp.rbuild create mode 100644 base/applications/network/ipconfig/ipconfig.rbuild create mode 100644 base/applications/network/net/net.rbuild create mode 100644 base/applications/network/netstat/netstat.rbuild create mode 100644 base/applications/network/network.rbuild create mode 100644 base/applications/network/nslookup/nslookup.rbuild create mode 100644 base/applications/network/ping/ping.rbuild create mode 100644 base/applications/network/route/route.rbuild create mode 100644 base/applications/network/telnet/telnet.rbuild create mode 100644 base/applications/network/tracert/tracert.rbuild create mode 100644 base/applications/network/whois/whois.rbuild create mode 100644 base/applications/notepad/notepad.rbuild create mode 100644 base/applications/rapps/rapps.rbuild create mode 100644 base/applications/regedit/clb/clb.rbuild create mode 100644 base/applications/regedit/regedit.rbuild create mode 100644 base/applications/regedt32/regedt32.rbuild create mode 100644 base/applications/sc/sc.rbuild create mode 100644 base/applications/screensavers/3dtext/3dtext.rbuild create mode 100644 base/applications/screensavers/logon/logon.rbuild create mode 100644 base/applications/screensavers/screensavers.rbuild create mode 100644 base/applications/shutdown/shutdown.rbuild create mode 100644 base/applications/sndrec32/sndrec32.rbuild create mode 100644 base/applications/sndvol32/sndvol32.rbuild create mode 100644 base/applications/taskmgr/taskmgr.rbuild create mode 100644 base/applications/winhlp32/winhlp32.rbuild create mode 100644 base/applications/winver/winver.rbuild create mode 100644 base/applications/wordpad/wordpad.rbuild create mode 100644 base/applications/write/write.rbuild create mode 100644 base/base.rbuild create mode 100644 base/services/audiosrv/audiosrv.rbuild create mode 100644 base/services/eventlog/eventlog.rbuild create mode 100644 base/services/rpcss/rpcss.rbuild create mode 100644 base/services/services.rbuild create mode 100644 base/services/spoolsv/spoolsv.rbuild create mode 100644 base/services/svchost/svchost.rbuild create mode 100644 base/services/tcpsvcs/tcpsvcs.rbuild create mode 100644 base/services/telnetd/telnetd.rbuild create mode 100644 base/services/tftpd/tftpd.rbuild create mode 100644 base/services/umpnpmgr/umpnpmgr.rbuild create mode 100644 base/services/wlansvc/wlansvc.rbuild create mode 100644 base/setup/reactos/reactos.rbuild create mode 100644 base/setup/setup.rbuild create mode 100644 base/setup/setup/setup.rbuild create mode 100644 base/setup/usetup/usetup.rbuild create mode 100644 base/setup/vmwinst/vmwinst.rbuild create mode 100644 base/setup/welcome/welcome.rbuild create mode 100644 base/shell/cmd/cmd.rbuild create mode 100644 base/shell/explorer-new/explorer.rbuild create mode 100644 base/shell/explorer/explorer.rbuild create mode 100644 base/shell/explorer/notifyhook/notifyhook.def create mode 100644 base/shell/explorer/notifyhook/notifyhook.rbuild create mode 100644 base/shell/shell.rbuild create mode 100644 base/system/autochk/autochk.rbuild create mode 100644 base/system/bootok/bootok.rbuild create mode 100644 base/system/expand/expand.rbuild create mode 100644 base/system/format/format.rbuild create mode 100644 base/system/lsass/lsass.rbuild create mode 100644 base/system/msiexec/msiexec.rbuild create mode 100644 base/system/regsvr32/regsvr32.rbuild create mode 100644 base/system/rundll32/rundll32.rbuild create mode 100644 base/system/runonce/runonce.rbuild create mode 100644 base/system/services/services.rbuild create mode 100644 base/system/smss/smss.rbuild create mode 100644 base/system/system.rbuild create mode 100644 base/system/userinit/userinit.rbuild create mode 100644 base/system/winlogon/winlogon.rbuild create mode 100644 baseaddress.rbuild create mode 100644 boot/armllb/armllb.rbuild create mode 100644 boot/boot.rbuild create mode 100644 boot/bootdata/bootcd/bootcd.rbuild create mode 100644 boot/bootdata/bootcdregtest/bootcdregtest.rbuild create mode 100644 boot/bootdata/bootdata.rbuild create mode 100644 boot/bootdata/livecd/livecd.rbuild create mode 100644 boot/bootdata/livecdregtest/livecdregtest.rbuild create mode 100644 boot/bootdata/packages/reactos.dff create mode 100644 boot/freeldr/bootsect/bootsect.rbuild create mode 100644 boot/freeldr/fdebug/fdebug.rbuild create mode 100644 boot/freeldr/freeldr.rbuild create mode 100644 boot/freeldr/freeldr/arch/i386/fathelp.asm create mode 100644 boot/freeldr/freeldr/freeldr.rbuild create mode 100644 boot/freeldr/freeldr/freeldr_arch.rbuild create mode 100644 boot/freeldr/freeldr/freeldr_base.rbuild create mode 100644 boot/freeldr/freeldr/freeldr_base64k.rbuild create mode 100644 boot/freeldr/freeldr/freeldr_main.rbuild create mode 100644 boot/freeldr/freeldr/freeldr_startup.rbuild create mode 100644 boot/freeldr/freeldr/setupldr.rbuild create mode 100644 boot/freeldr/freeldr/setupldr_main.rbuild create mode 100644 boot/freeldr/install/installfreeldr.rbuild create mode 100644 config.template.rbuild create mode 100644 dll/3rdparty/3rdparty.rbuild create mode 100644 dll/3rdparty/dxtn/dxtn.rbuild create mode 100644 dll/3rdparty/libjpeg/libjpeg.rbuild create mode 100644 dll/3rdparty/libpng/libpng.rbuild create mode 100644 dll/3rdparty/libtiff/libtiff.rbuild create mode 100644 dll/3rdparty/libxslt/libxslt.rbuild create mode 100644 dll/3rdparty/mesa32/mesa32.rbuild create mode 100644 dll/cpl/access/access.rbuild create mode 100644 dll/cpl/appwiz/appwiz.rbuild create mode 100644 dll/cpl/console/console.rbuild create mode 100644 dll/cpl/cpl.rbuild create mode 100644 dll/cpl/desk/desk.rbuild create mode 100644 dll/cpl/hdwwiz/hdwwiz.rbuild create mode 100644 dll/cpl/input/input.rbuild create mode 100644 dll/cpl/intl/intl.rbuild create mode 100644 dll/cpl/joy/joy.rbuild create mode 100644 dll/cpl/liccpa/liccpa.rbuild create mode 100644 dll/cpl/main/main.rbuild create mode 100644 dll/cpl/mmsys/mmsys.rbuild create mode 100644 dll/cpl/ncpa/ncpa.rbuild create mode 100644 dll/cpl/odbccp32/odbccp32.rbuild create mode 100644 dll/cpl/powercfg/powercfg.rbuild create mode 100644 dll/cpl/sysdm/sysdm.rbuild create mode 100644 dll/cpl/telephon/telephon.rbuild create mode 100644 dll/cpl/timedate/timedate.rbuild create mode 100644 dll/cpl/usrmgr/usrmgr.rbuild create mode 100644 dll/directx/amstream/amstream.rbuild create mode 100644 dll/directx/bdaplgin/bdaplgin.rbuild create mode 100644 dll/directx/d3d8/d3d8.rbuild create mode 100644 dll/directx/d3d8thk/d3d8thk.rbuild create mode 100644 dll/directx/d3d9/d3d9.rbuild create mode 100644 dll/directx/ddraw/ddraw.rbuild create mode 100644 dll/directx/devenum/devenum.rbuild create mode 100644 dll/directx/dinput/dinput.rbuild create mode 100644 dll/directx/dinput8/dinput8.rbuild create mode 100644 dll/directx/directx.rbuild create mode 100644 dll/directx/dmusic/dmusic.rbuild create mode 100644 dll/directx/dplay/dplay.rbuild create mode 100644 dll/directx/dplayx/dplayx.rbuild create mode 100644 dll/directx/dsound/dsound.rbuild create mode 100644 dll/directx/dsound_new/dsound_new.rbuild create mode 100644 dll/directx/dxdiagn/dxdiagn.rbuild create mode 100644 dll/directx/ksproxy/ksproxy.rbuild create mode 100644 dll/directx/ksuser/ksuser.rbuild create mode 100644 dll/directx/msdmo/msdmo.rbuild create mode 100644 dll/directx/msdvbnp/msdvbnp.rbuild create mode 100644 dll/directx/msvidctl/msvidctl.rbuild create mode 100644 dll/directx/qedit/qedit.rbuild create mode 100644 dll/directx/quartz/quartz.rbuild create mode 100644 dll/directx/wine/d3d8/d3d8.rbuild create mode 100644 dll/directx/wine/d3d9/d3d9.rbuild create mode 100644 dll/directx/wine/d3dx9_24/d3dx9_24.rbuild create mode 100644 dll/directx/wine/d3dx9_25/d3dx9_25.rbuild create mode 100644 dll/directx/wine/d3dx9_26/d3dx9_26.rbuild create mode 100644 dll/directx/wine/d3dx9_27/d3dx9_27.rbuild create mode 100644 dll/directx/wine/d3dx9_28/d3dx9_28.rbuild create mode 100644 dll/directx/wine/d3dx9_29/d3dx9_29.rbuild create mode 100644 dll/directx/wine/d3dx9_30/d3dx9_30.rbuild create mode 100644 dll/directx/wine/d3dx9_31/d3dx9_31.rbuild create mode 100644 dll/directx/wine/d3dx9_32/d3dx9_32.rbuild create mode 100644 dll/directx/wine/d3dx9_33/d3dx9_33.rbuild create mode 100644 dll/directx/wine/d3dx9_34/d3dx9_34.rbuild create mode 100644 dll/directx/wine/d3dx9_35/d3dx9_35.rbuild create mode 100644 dll/directx/wine/d3dx9_36/d3dx9_36.rbuild create mode 100644 dll/directx/wine/d3dx9_37/d3dx9_37.rbuild create mode 100644 dll/directx/wine/d3dx9_38/d3dx9_38.rbuild create mode 100644 dll/directx/wine/d3dx9_39/d3dx9_39.rbuild create mode 100644 dll/directx/wine/d3dx9_40/d3dx9_40.rbuild create mode 100644 dll/directx/wine/d3dx9_41/d3dx9_41.rbuild create mode 100644 dll/directx/wine/d3dx9_42/d3dx9_42.rbuild create mode 100644 dll/directx/wine/ddraw/ddraw.rbuild create mode 100644 dll/directx/wine/wine.rbuild create mode 100644 dll/directx/wine/wined3d/wined3d.rbuild create mode 100644 dll/dll.rbuild create mode 100644 dll/keyboard/kbda1/kbda1.rbuild create mode 100644 dll/keyboard/kbda2/kbda2.rbuild create mode 100644 dll/keyboard/kbda3/kbda3.rbuild create mode 100644 dll/keyboard/kbdal/kbdal.rbuild create mode 100644 dll/keyboard/kbdarme/kbdarme.rbuild create mode 100644 dll/keyboard/kbdarmw/kbdarmw.rbuild create mode 100644 dll/keyboard/kbdaze/kbdaze.rbuild create mode 100644 dll/keyboard/kbdazel/kbdazel.rbuild create mode 100644 dll/keyboard/kbdbe/kbdbe.rbuild create mode 100644 dll/keyboard/kbdbga/kbdbga.rbuild create mode 100644 dll/keyboard/kbdbgm/kbdbgm.rbuild create mode 100644 dll/keyboard/kbdbgt/kbdbgt.rbuild create mode 100644 dll/keyboard/kbdblr/kbdblr.rbuild create mode 100644 dll/keyboard/kbdbr/kbdbr.rbuild create mode 100644 dll/keyboard/kbdbur/kbdbur.rbuild create mode 100644 dll/keyboard/kbdcan/kbdcan.rbuild create mode 100644 dll/keyboard/kbdcr/kbdcr.rbuild create mode 100644 dll/keyboard/kbdcz/kbdcz.rbuild create mode 100644 dll/keyboard/kbdcz1/kbdcz1.rbuild create mode 100644 dll/keyboard/kbdda/kbdda.rbuild create mode 100644 dll/keyboard/kbddv/kbddv.rbuild create mode 100644 dll/keyboard/kbdes/kbdes.rbuild create mode 100644 dll/keyboard/kbdest/kbdest.rbuild create mode 100644 dll/keyboard/kbdfc/kbdfc.rbuild create mode 100644 dll/keyboard/kbdfi/kbdfi.rbuild create mode 100644 dll/keyboard/kbdfr/kbdfr.rbuild create mode 100644 dll/keyboard/kbdgeo/kbdgeo.rbuild create mode 100644 dll/keyboard/kbdgerg/kbdgerg.rbuild create mode 100644 dll/keyboard/kbdgneo/kbdgneo.rbuild create mode 100644 dll/keyboard/kbdgr/kbdgr.rbuild create mode 100644 dll/keyboard/kbdgrist/kbdgrist.rbuild create mode 100644 dll/keyboard/kbdhe/kbdhe.rbuild create mode 100644 dll/keyboard/kbdheb/kbdheb.rbuild create mode 100644 dll/keyboard/kbdhu/kbdhu.rbuild create mode 100644 dll/keyboard/kbdic/kbdic.rbuild create mode 100644 dll/keyboard/kbdinasa/kbdinasa.rbuild create mode 100644 dll/keyboard/kbdinben/kbdinben.rbuild create mode 100644 dll/keyboard/kbdindev/kbdindev.rbuild create mode 100644 dll/keyboard/kbdinguj/kbdinguj.rbuild create mode 100644 dll/keyboard/kbdinmal/kbdinmal.rbuild create mode 100644 dll/keyboard/kbdir/kbdir.rbuild create mode 100644 dll/keyboard/kbdit/kbdit.rbuild create mode 100644 dll/keyboard/kbdja/kbdja.rbuild create mode 100644 dll/keyboard/kbdkaz/kbdkaz.rbuild create mode 100644 dll/keyboard/kbdko/kbdko.rbuild create mode 100644 dll/keyboard/kbdla/kbdla.rbuild create mode 100644 dll/keyboard/kbdlt1/kbdlt1.rbuild create mode 100644 dll/keyboard/kbdlv/kbdlv.rbuild create mode 100644 dll/keyboard/kbdmac/kbdmac.rbuild create mode 100644 dll/keyboard/kbdne/kbdne.rbuild create mode 100644 dll/keyboard/kbdno/kbdno.rbuild create mode 100644 dll/keyboard/kbdpl1/kbdpl1.rbuild create mode 100644 dll/keyboard/kbdpo/kbdpo.rbuild create mode 100644 dll/keyboard/kbdro/kbdro.rbuild create mode 100644 dll/keyboard/kbdru/kbdru.rbuild create mode 100644 dll/keyboard/kbdru1/kbdru1.rbuild create mode 100644 dll/keyboard/kbdsg/kbdsg.rbuild create mode 100644 dll/keyboard/kbdsk/kbdsk.rbuild create mode 100644 dll/keyboard/kbdsk1/kbdsk1.rbuild create mode 100644 dll/keyboard/kbdsw/kbdsw.rbuild create mode 100644 dll/keyboard/kbdtat/kbdtat.rbuild create mode 100644 dll/keyboard/kbdth0/kbdth0.rbuild create mode 100644 dll/keyboard/kbdth1/kbdth1.rbuild create mode 100644 dll/keyboard/kbdth2/kbdth2.rbuild create mode 100644 dll/keyboard/kbdth3/kbdth3.rbuild create mode 100644 dll/keyboard/kbdtuf/kbdtuf.rbuild create mode 100644 dll/keyboard/kbdtuq/kbdtuq.rbuild create mode 100644 dll/keyboard/kbduk/kbduk.rbuild create mode 100644 dll/keyboard/kbdur/kbdur.rbuild create mode 100644 dll/keyboard/kbdurs/kbdurs.rbuild create mode 100644 dll/keyboard/kbdus/kbdus.rbuild create mode 100644 dll/keyboard/kbdusa/kbdusa.rbuild create mode 100644 dll/keyboard/kbdusl/kbdusl.rbuild create mode 100644 dll/keyboard/kbdusr/kbdusr.rbuild create mode 100644 dll/keyboard/kbdusx/kbdusx.rbuild create mode 100644 dll/keyboard/kbduzb/kbduzb.rbuild create mode 100644 dll/keyboard/kbdvntc/kbdvntc.rbuild create mode 100644 dll/keyboard/kbdycc/kbdycc.rbuild create mode 100644 dll/keyboard/kbdycl/kbdycl.rbuild create mode 100644 dll/keyboard/keyboard.rbuild create mode 100644 dll/nls/idndl/idndl.rbuild create mode 100644 dll/nls/idndl_redist/idndl_redist.rbuild create mode 100644 dll/nls/nls.rbuild create mode 100644 dll/nls/normaliz/normaliz.rbuild create mode 100644 dll/nls/normaliz_redist/normaliz_redist.rbuild create mode 100644 dll/ntdll/def/ntdll.pspec create mode 100644 dll/ntdll/ntdll.rbuild create mode 100644 dll/shellext/deskadp/deskadp.rbuild create mode 100644 dll/shellext/deskmon/deskmon.rbuild create mode 100644 dll/shellext/devcpux/devcpux.rbuild create mode 100644 dll/shellext/fontext/fontext.rbuild create mode 100644 dll/shellext/shellext.rbuild create mode 100644 dll/shellext/slayer/slayer.rbuild create mode 100644 dll/win32/acledit/acledit.rbuild create mode 100644 dll/win32/aclui/aclui.rbuild create mode 100644 dll/win32/activeds/activeds.rbuild create mode 100644 dll/win32/actxprxy/actxprxy.rbuild create mode 100644 dll/win32/advapi32/advapi32.rbuild create mode 100644 dll/win32/advpack/advpack.rbuild create mode 100644 dll/win32/atl/atl.rbuild create mode 100644 dll/win32/authz/authz.rbuild create mode 100644 dll/win32/avicap32/avicap32.rbuild create mode 100644 dll/win32/avifil32/avifil32.rbuild create mode 100644 dll/win32/batt/batt.rbuild create mode 100644 dll/win32/bcrypt/bcrypt.rbuild create mode 100644 dll/win32/beepmidi/beepmidi.rbuild create mode 100644 dll/win32/browseui/browseui.rbuild create mode 100644 dll/win32/cabinet/cabinet.rbuild create mode 100644 dll/win32/cards/cards.rbuild create mode 100644 dll/win32/cfgmgr32/cfgmgr32.rbuild create mode 100644 dll/win32/clusapi/clusapi.rbuild create mode 100644 dll/win32/comcat/comcat.rbuild create mode 100644 dll/win32/comctl32/comctl32.rbuild create mode 100644 dll/win32/comdlg32/comdlg32.rbuild create mode 100644 dll/win32/compstui/compstui.rbuild create mode 100644 dll/win32/credui/credui.rbuild create mode 100644 dll/win32/crtdll/crtdll.rbuild create mode 100644 dll/win32/crypt32/crypt32.rbuild create mode 100644 dll/win32/cryptdlg/cryptdlg.rbuild create mode 100644 dll/win32/cryptdll/cryptdll.rbuild create mode 100644 dll/win32/cryptnet/cryptnet.rbuild create mode 100644 dll/win32/cryptui/cryptui.rbuild create mode 100644 dll/win32/dbghelp/dbghelp.rbuild create mode 100644 dll/win32/dciman32/dciman32.rbuild create mode 100644 dll/win32/devmgr/devmgr.rbuild create mode 100644 dll/win32/dhcpcsvc/dhcpcsvc.rbuild create mode 100644 dll/win32/dnsapi/dnsapi.rbuild create mode 100644 dll/win32/dwmapi/dwmapi.rbuild create mode 100644 dll/win32/faultrep/faultrep.rbuild create mode 100644 dll/win32/fmifs/fmifs.rbuild create mode 100644 dll/win32/fusion/fusion.rbuild create mode 100644 dll/win32/gdi32/gdi32.rbuild create mode 100644 dll/win32/gdiplus/gdiplus.rbuild create mode 100644 dll/win32/getuname/getuname.rbuild create mode 100644 dll/win32/glu32/glu32.rbuild create mode 100644 dll/win32/hhctrl.ocx/hhctrl.ocx.rbuild create mode 100644 dll/win32/hid/hid.rbuild create mode 100644 dll/win32/hlink/hlink.rbuild create mode 100644 dll/win32/hnetcfg/hnetcfg.rbuild create mode 100644 dll/win32/httpapi/httpapi.rbuild create mode 100644 dll/win32/iccvid/iccvid.rbuild create mode 100644 dll/win32/icmp/icmp.rbuild create mode 100644 dll/win32/imaadp32.acm/imaadp32.acm.rbuild create mode 100644 dll/win32/imagehlp/imagehlp.rbuild create mode 100644 dll/win32/imm32/imm32.rbuild create mode 100644 dll/win32/inetcomm/inetcomm.rbuild create mode 100644 dll/win32/inetmib1/inetmib1.rbuild create mode 100644 dll/win32/initpki/initpki.rbuild create mode 100644 dll/win32/inseng/inseng.rbuild create mode 100644 dll/win32/iphlpapi/iphlpapi.rbuild create mode 100644 dll/win32/itircl/itircl.rbuild create mode 100644 dll/win32/itss/itss.rbuild create mode 100644 dll/win32/jscript/jscript.rbuild create mode 100644 dll/win32/kernel32/kernel32.pspec create mode 100644 dll/win32/kernel32/kernel32.rbuild create mode 100644 dll/win32/loadperf/loadperf.rbuild create mode 100644 dll/win32/localspl/localspl.rbuild create mode 100644 dll/win32/localui/localui.rbuild create mode 100644 dll/win32/lpk/lpk.rbuild create mode 100644 dll/win32/lsasrv/lsasrv.rbuild create mode 100644 dll/win32/lz32/lz32.rbuild create mode 100644 dll/win32/mapi32/mapi32.rbuild create mode 100644 dll/win32/mciavi32/mciavi32.rbuild create mode 100644 dll/win32/mcicda/mcicda.rbuild create mode 100644 dll/win32/mciqtz32/mciqtz32.rbuild create mode 100644 dll/win32/mciseq/mciseq.rbuild create mode 100644 dll/win32/mciwave/mciwave.rbuild create mode 100644 dll/win32/mlang/mlang.rbuild create mode 100644 dll/win32/mmdrv/mmdrv.rbuild create mode 100644 dll/win32/modemui/modemui.rbuild create mode 100644 dll/win32/mpr/mpr.rbuild create mode 100644 dll/win32/mprapi/mprapi.rbuild create mode 100644 dll/win32/msacm32/msacm32.drv/msacm32.drv.rbuild create mode 100644 dll/win32/msacm32/msacm32.rbuild create mode 100644 dll/win32/msadp32.acm/msadp32.acm.rbuild create mode 100644 dll/win32/msafd/msafd.rbuild create mode 100644 dll/win32/mscat32/mscat32.rbuild create mode 100644 dll/win32/mscms/mscms.rbuild create mode 100644 dll/win32/mscoree/mscoree.rbuild create mode 100644 dll/win32/msctf/msctf.rbuild create mode 100644 dll/win32/msftedit/msftedit.rbuild create mode 100644 dll/win32/msg711.acm/msg711.acm.rbuild create mode 100644 dll/win32/msgina/msgina.rbuild create mode 100644 dll/win32/msgsm32.acm/msgsm32.acm.rbuild create mode 100644 dll/win32/mshtml.tlb/mshtml.tlb.rbuild create mode 100644 dll/win32/mshtml/mshtml.rbuild create mode 100644 dll/win32/msi/msi.rbuild create mode 100644 dll/win32/msimg32/msimg32.rbuild create mode 100644 dll/win32/msimtf/msimtf.rbuild create mode 100644 dll/win32/msisip/msisip.rbuild create mode 100644 dll/win32/msisys.ocx/msisys.ocx.rbuild create mode 100644 dll/win32/msnet32/msnet32.rbuild create mode 100644 dll/win32/msrle32/msrle32.rbuild create mode 100644 dll/win32/mssign32/mssign32.rbuild create mode 100644 dll/win32/mssip32/mssip32.rbuild create mode 100644 dll/win32/mstask/mstask.rbuild create mode 100644 dll/win32/msvcrt/msvcrt.rbuild create mode 100644 dll/win32/msvcrt20/msvcrt20.rbuild create mode 100644 dll/win32/msvcrt40/msvcrt40.rbuild create mode 100644 dll/win32/msvfw32/msvfw32.rbuild create mode 100644 dll/win32/msvidc32/msvidc32.rbuild create mode 100644 dll/win32/mswsock/mswsock.rbuild create mode 100644 dll/win32/msxml3/msxml3.rbuild create mode 100644 dll/win32/nddeapi/nddeapi.rbuild create mode 100644 dll/win32/netapi32/netapi32.rbuild create mode 100644 dll/win32/netcfgx/netcfgx.rbuild create mode 100644 dll/win32/netevent/netevent.rbuild create mode 100644 dll/win32/netid/netid.rbuild create mode 100644 dll/win32/netshell/netshell.rbuild create mode 100644 dll/win32/newdev/newdev.rbuild create mode 100644 dll/win32/ntdsapi/ntdsapi.rbuild create mode 100644 dll/win32/ntlanman/ntlanman.rbuild create mode 100644 dll/win32/ntmarta/ntmarta.rbuild create mode 100644 dll/win32/ntprint/ntprint.rbuild create mode 100644 dll/win32/objsel/objsel.rbuild create mode 100644 dll/win32/odbc32/odbc32.rbuild create mode 100644 dll/win32/odbccp32/odbccp32.rbuild create mode 100644 dll/win32/ole32/ole32.rbuild create mode 100644 dll/win32/oleacc/oleacc.rbuild create mode 100644 dll/win32/oleaut32/oleaut32.rbuild create mode 100644 dll/win32/olecli32/olecli32.rbuild create mode 100644 dll/win32/oledlg/oledlg.rbuild create mode 100644 dll/win32/olepro32/olepro32.rbuild create mode 100644 dll/win32/olesvr32/olesvr32.rbuild create mode 100644 dll/win32/olethk32/olethk32.rbuild create mode 100644 dll/win32/opengl32/opengl32.rbuild create mode 100644 dll/win32/pdh/pdh.rbuild create mode 100644 dll/win32/pidgen/pidgen.rbuild create mode 100644 dll/win32/powrprof/powrprof.rbuild create mode 100644 dll/win32/printui/printui.rbuild create mode 100644 dll/win32/psapi/psapi.rbuild create mode 100644 dll/win32/pstorec/pstorec.rbuild create mode 100644 dll/win32/qmgr/qmgr.rbuild create mode 100644 dll/win32/qmgrprxy/qmgrprxy.rbuild create mode 100644 dll/win32/query/query.rbuild create mode 100644 dll/win32/rasadhlp/rasadhlp.rbuild create mode 100644 dll/win32/rasapi32/rasapi32.rbuild create mode 100644 dll/win32/rasdlg/rasdlg.rbuild create mode 100644 dll/win32/rasman/rasman.rbuild create mode 100644 dll/win32/resutils/resutils.rbuild create mode 100644 dll/win32/riched20/riched20.rbuild create mode 100644 dll/win32/riched32/riched32.rbuild create mode 100644 dll/win32/rpcrt4/rpcrt4.rbuild create mode 100644 dll/win32/rsabase/rsabase.rbuild create mode 100644 dll/win32/rsaenh/rsaenh.rbuild create mode 100644 dll/win32/samlib/samlib.rbuild create mode 100644 dll/win32/samsrv/samsrv.rbuild create mode 100644 dll/win32/sccbase/sccbase.rbuild create mode 100644 dll/win32/schannel/schannel.rbuild create mode 100644 dll/win32/secur32/secur32.rbuild create mode 100644 dll/win32/security/security.rbuild create mode 100644 dll/win32/sensapi/sensapi.rbuild create mode 100644 dll/win32/serialui/serialui.rbuild create mode 100644 dll/win32/setupapi/setupapi.rbuild create mode 100644 dll/win32/sfc/sfc.rbuild create mode 100644 dll/win32/sfc_os/sfc_os.rbuild create mode 100644 dll/win32/shdoclc/shdoclc.rbuild create mode 100644 dll/win32/shdocvw/shdocvw.rbuild create mode 100644 dll/win32/shell32/shell32.rbuild create mode 100644 dll/win32/shfolder/shfolder.rbuild create mode 100644 dll/win32/shimgvw/shimgvw.rbuild create mode 100644 dll/win32/shlwapi/shlwapi.rbuild create mode 100644 dll/win32/slbcsp/slbcsp.rbuild create mode 100644 dll/win32/smdll/smdll.rbuild create mode 100644 dll/win32/sndblst/sndblst.rbuild create mode 100644 dll/win32/snmpapi/snmpapi.rbuild create mode 100644 dll/win32/softpub/softpub.rbuild create mode 100644 dll/win32/spoolss/spoolss.rbuild create mode 100644 dll/win32/srclient/srclient.rbuild create mode 100644 dll/win32/stdole2.tlb/stdole2.rbuild create mode 100644 dll/win32/stdole32.tlb/stdole32.rbuild create mode 100644 dll/win32/sti/sti.rbuild create mode 100644 dll/win32/sxs/sxs.rbuild create mode 100644 dll/win32/syssetup/syssetup.rbuild create mode 100644 dll/win32/t2embed/t2embed.rbuild create mode 100644 dll/win32/tapi32/tapi32.rbuild create mode 100644 dll/win32/tapiui/tapiui.rbuild create mode 100644 dll/win32/traffic/traffic.rbuild create mode 100644 dll/win32/twain_32/twain_32.rbuild create mode 100644 dll/win32/uext2/uext2.rbuild create mode 100644 dll/win32/ufat/ufat.rbuild create mode 100644 dll/win32/ufatx/ufatx.rbuild create mode 100644 dll/win32/untfs/untfs.rbuild create mode 100644 dll/win32/updspapi/updspapi.rbuild create mode 100644 dll/win32/url/url.rbuild create mode 100644 dll/win32/urlmon/urlmon.rbuild create mode 100644 dll/win32/user32/user32.pspec create mode 100644 dll/win32/user32/user32.rbuild create mode 100644 dll/win32/userenv/userenv.rbuild create mode 100644 dll/win32/usp10/usp10.rbuild create mode 100644 dll/win32/uxtheme/uxtheme.rbuild create mode 100644 dll/win32/vdmdbg/vdmdbg.rbuild create mode 100644 dll/win32/version/version.rbuild create mode 100644 dll/win32/wdmaud.drv/wdmaud.rbuild create mode 100644 dll/win32/win32.rbuild create mode 100644 dll/win32/windowscodecs/windowscodecs.rbuild create mode 100644 dll/win32/winemp3.acm/winemp3.acm.rbuild create mode 100644 dll/win32/winfax/winfax.rbuild create mode 100644 dll/win32/wing32/wing32.rbuild create mode 100644 dll/win32/winhttp/winhttp.rbuild create mode 100644 dll/win32/wininet/wininet.rbuild create mode 100644 dll/win32/winmm/midimap/midimap.rbuild create mode 100644 dll/win32/winmm/winmm.rbuild create mode 100644 dll/win32/winspool/winspool.rbuild create mode 100644 dll/win32/winsta/winsta.rbuild create mode 100644 dll/win32/wintrust/wintrust.rbuild create mode 100644 dll/win32/wlanapi/wlanapi.rbuild create mode 100644 dll/win32/wldap32/wldap32.rbuild create mode 100644 dll/win32/wmi/wmi.rbuild create mode 100644 dll/win32/ws2_32/ws2_32.rbuild create mode 100644 dll/win32/ws2_32_new/ws2_32.rbuild create mode 100644 dll/win32/ws2help/ws2help.rbuild create mode 100644 dll/win32/wshirda/wshirda.rbuild create mode 100644 dll/win32/wshtcpip/wshtcpip.rbuild create mode 100644 dll/win32/wsock32/wsock32.rbuild create mode 100644 dll/win32/wtsapi32/wtsapi32.rbuild create mode 100644 dll/win32/wuapi/wuapi.rbuild create mode 100644 dll/win32/xinput1_1/xinput1_1.rbuild create mode 100644 dll/win32/xinput1_2/xinput1_2.rbuild create mode 100644 dll/win32/xinput1_3/xinput1_3.rbuild create mode 100644 dll/win32/xinput9_1_0/xinput9_1_0.rbuild create mode 100644 dll/win32/xmllite/xmllite.rbuild create mode 100644 drivers/base/beep/beep.rbuild create mode 100644 drivers/base/bootvid/bootvid.rbuild create mode 100644 drivers/base/directory.rbuild create mode 100644 drivers/base/kdcom/kdcom.rbuild create mode 100644 drivers/base/kddll/kddll.rbuild create mode 100644 drivers/base/nmidebug/nmidebug.rbuild create mode 100644 drivers/base/null/null.rbuild create mode 100644 drivers/battery/battc/battc.rbuild create mode 100644 drivers/battery/directory.rbuild create mode 100644 drivers/bluetooth/directory.rbuild create mode 100644 drivers/bluetooth/fbtusb/fbtusb.rbuild create mode 100644 drivers/bus/acpi/acpi.rbuild create mode 100644 drivers/bus/acpi/acpica/acpica.rbuild create mode 100644 drivers/bus/acpi/cmbatt/cmbatt.rbuild create mode 100644 drivers/bus/acpi/compbatt/compbatt.rbuild create mode 100644 drivers/bus/directory.rbuild create mode 100644 drivers/bus/isapnp/isapnp.rbuild create mode 100644 drivers/bus/pci/pci.rbuild create mode 100644 drivers/bus/pcix/pcix.rbuild create mode 100644 drivers/bus/pcmcia/pcmcia.rbuild create mode 100644 drivers/directx/directory.rbuild create mode 100644 drivers/directx/dxapi/dxapi.rbuild create mode 100644 drivers/directx/dxg/dxg.rbuild create mode 100644 drivers/directx/dxgthk/dxgthk.rbuild create mode 100644 drivers/drivers.rbuild create mode 100644 drivers/filesystems/cdfs/cdfs.rbuild create mode 100644 drivers/filesystems/directory.rbuild create mode 100644 drivers/filesystems/ext2/ext2.rbuild create mode 100644 drivers/filesystems/fastfat/vfatfs.rbuild create mode 100644 drivers/filesystems/fastfat_new/fastfat.rbuild create mode 100644 drivers/filesystems/fs_rec/fs_rec.rbuild create mode 100644 drivers/filesystems/msfs/msfs.rbuild create mode 100644 drivers/filesystems/mup/mup.rbuild create mode 100644 drivers/filesystems/npfs/npfs.rbuild create mode 100644 drivers/filesystems/ntfs/ntfs.rbuild create mode 100644 drivers/input/directory.rbuild create mode 100644 drivers/input/i8042prt/i8042prt.rbuild create mode 100644 drivers/input/kbdclass/kbdclass.rbuild create mode 100644 drivers/input/mouclass/mouclass.rbuild create mode 100644 drivers/input/sermouse/sermouse.rbuild create mode 100644 drivers/ksfilter/directory.rbuild create mode 100644 drivers/ksfilter/ks/ks.rbuild create mode 100644 drivers/ksfilter/swenum/swenum.rbuild create mode 100644 drivers/multimedia/audio/directory.rbuild create mode 100644 drivers/multimedia/audio/mpu401_nt4/mpu401.rbuild create mode 100644 drivers/multimedia/audio/sb16_nt4.old/sb16_nt4.rbuild create mode 100644 drivers/multimedia/audio/sndblst.old/sndblst.rbuild create mode 100644 drivers/multimedia/audio/sndblst_sys/sndblst.rbuild create mode 100644 drivers/multimedia/audio/sound/sound.rbuild create mode 100644 drivers/multimedia/bdasup/bdasup.rbuild create mode 100644 drivers/multimedia/directory.rbuild create mode 100644 drivers/network/acd/rasacd.rbuild create mode 100644 drivers/network/afd/afd.rbuild create mode 100644 drivers/network/dd/directory.rbuild create mode 100644 drivers/network/dd/ne2000/ne2000.rbuild create mode 100644 drivers/network/dd/pcnet/pcnet.rbuild create mode 100644 drivers/network/directory.rbuild create mode 100644 drivers/network/ndis/ndis.rbuild create mode 100644 drivers/network/tcpip/tcpip.rbuild create mode 100644 drivers/network/tdi/tdi.rbuild create mode 100644 drivers/parallel/directory.rbuild create mode 100644 drivers/parallel/parallel/parallel.rbuild create mode 100644 drivers/serial/directory.rbuild create mode 100644 drivers/serial/serenum/serenum.rbuild create mode 100644 drivers/serial/serial/serial.rbuild create mode 100644 drivers/setup/blue/blue.rbuild create mode 100644 drivers/setup/directory.rbuild create mode 100644 drivers/storage/class/cdrom/cdrom.rbuild create mode 100644 drivers/storage/class/class2/class2.rbuild create mode 100644 drivers/storage/class/directory.rbuild create mode 100644 drivers/storage/class/disk/disk.rbuild create mode 100644 drivers/storage/class/ramdisk/ramdisk.rbuild create mode 100644 drivers/storage/classpnp/classpnp.rbuild create mode 100644 drivers/storage/directory.rbuild create mode 100644 drivers/storage/floppy/floppy.rbuild create mode 100644 drivers/storage/ide/atapi/atapi.rbuild create mode 100644 drivers/storage/ide/directory.rbuild create mode 100644 drivers/storage/ide/pciide/pciide.rbuild create mode 100644 drivers/storage/ide/pciidex/pciidex.rbuild create mode 100644 drivers/storage/ide/uniata/uniata.rbuild create mode 100644 drivers/storage/port/buslogic/buslogic.rbuild create mode 100644 drivers/storage/port/directory.rbuild create mode 100644 drivers/storage/scsiport/scsiport.pspec create mode 100644 drivers/storage/scsiport/scsiport.rbuild create mode 100644 drivers/usb/directory.rbuild create mode 100644 drivers/usb/nt4compat/directory.rbuild create mode 100644 drivers/usb/nt4compat/usbdriver/usbdriver.rbuild create mode 100644 drivers/usb/usbd/usbd.rbuild create mode 100644 drivers/usb/usbehci/usbehci.rbuild create mode 100644 drivers/usb/usbhub/usbhub.rbuild create mode 100644 drivers/usb/usbstor/usbstor.rbuild create mode 100644 drivers/video/directory.rbuild create mode 100644 drivers/video/displays/directory.rbuild create mode 100644 drivers/video/displays/framebuf/framebuf.rbuild create mode 100644 drivers/video/displays/framebuf_new/framebuf_new.rbuild create mode 100644 drivers/video/displays/framebufacc/framebufacc.rbuild create mode 100644 drivers/video/displays/vga/vgaddi.rbuild create mode 100644 drivers/video/font/bmfd/bmfd.rbuild create mode 100644 drivers/video/font/directory.rbuild create mode 100644 drivers/video/font/ftfd/ftfd.rbuild create mode 100644 drivers/video/miniport/directory.rbuild create mode 100644 drivers/video/miniport/vbe/vbemp.rbuild create mode 100644 drivers/video/miniport/vga/vgamp.rbuild create mode 100644 drivers/video/miniport/vga_new/vga.rbuild create mode 100644 drivers/video/miniport/vmx_svga/vmx_svga.rbuild create mode 100644 drivers/video/miniport/xboxvmp/xboxvmp.rbuild create mode 100644 drivers/video/videoprt/videoprt.rbuild create mode 100644 drivers/wdm/audio/backpln/audio_test/audio_test.rbuild create mode 100644 drivers/wdm/audio/backpln/directory.rbuild create mode 100644 drivers/wdm/audio/backpln/portcls/portcls.rbuild create mode 100644 drivers/wdm/audio/directory.rbuild create mode 100644 drivers/wdm/audio/drivers/CMIDriver/cmidriver.rbuild create mode 100644 drivers/wdm/audio/drivers/directory.rbuild create mode 100644 drivers/wdm/audio/drivers/mpu401/mpu401.rbuild create mode 100644 drivers/wdm/audio/drivers/sb16/sb16.rbuild create mode 100644 drivers/wdm/audio/drm/directory.rbuild create mode 100644 drivers/wdm/audio/drm/drmk/drmk.rbuild create mode 100644 drivers/wdm/audio/filters/directory.rbuild create mode 100644 drivers/wdm/audio/filters/kmixer/kmixer.rbuild create mode 100644 drivers/wdm/audio/filters/splitter/splitter.rbuild create mode 100644 drivers/wdm/audio/legacy/directory.rbuild create mode 100644 drivers/wdm/audio/legacy/stream/stream.rbuild create mode 100644 drivers/wdm/audio/legacy/wdmaud/wdmaud.rbuild create mode 100644 drivers/wdm/audio/sysaudio/sysaudio.rbuild create mode 100644 drivers/wdm/wdm.rbuild create mode 100644 drivers/wmi/wmilib.rbuild create mode 100644 hal/hal.pspec create mode 100644 hal/hal.rbuild create mode 100644 hal/halarm/directory.rbuild create mode 100644 hal/halarm/hal.rbuild create mode 100644 hal/halarm/hal_generic.rbuild create mode 100644 hal/halarm/versa/halup.rbuild create mode 100644 hal/halppc/directory.rbuild create mode 100644 hal/halppc/generic/generic.rbuild create mode 100644 hal/halppc/up/halup.rbuild create mode 100644 hal/halx86/directory.rbuild create mode 100644 hal/halx86/hal.rbuild create mode 100644 hal/halx86/hal_generic.rbuild create mode 100644 hal/halx86/hal_generic_acpi.rbuild create mode 100644 hal/halx86/hal_generic_mp.rbuild create mode 100644 hal/halx86/hal_generic_pcat.rbuild create mode 100644 hal/halx86/hal_generic_up.rbuild create mode 100644 hal/halx86/hal_mini.rbuild create mode 100644 hal/halx86/halacpi.rbuild create mode 100644 hal/halx86/halamd64.rbuild create mode 100644 hal/halx86/halmps.rbuild create mode 100644 hal/halx86/halxbox.rbuild create mode 100644 include/directory.rbuild create mode 100644 include/dxsdk/dxsdk.rbuild create mode 100644 include/psdk/psdk.rbuild create mode 100644 include/reactos/idl/idl.rbuild create mode 100644 include/reactos/mc/mc.rbuild create mode 100644 include/reactos/reactos.rbuild create mode 100644 include/reactos/syscalls.inc create mode 100644 include/reactos/version.h create mode 100644 include/reactos/wine/wineheaders.rbuild create mode 100644 lib/3rdparty/3rdparty.rbuild create mode 100644 lib/3rdparty/adns/adns.rbuild create mode 100644 lib/3rdparty/bzip2/bzip2.rbuild create mode 100644 lib/3rdparty/cardlib/cardlib.rbuild create mode 100644 lib/3rdparty/expat/expat.rbuild create mode 100644 lib/3rdparty/freetype/freetype.rbuild create mode 100644 lib/3rdparty/fullfat/fullfat.rbuild create mode 100644 lib/3rdparty/icu4ros/icu4ros.rbuild create mode 100644 lib/3rdparty/libmpg123/libmpg123.rbuild create mode 100644 lib/3rdparty/libsamplerate/libsamplerate.rbuild create mode 100644 lib/3rdparty/libwine/libwine.rbuild create mode 100644 lib/3rdparty/libxml2/libxml2.rbuild create mode 100644 lib/3rdparty/mingw/mingw.rbuild create mode 100644 lib/3rdparty/zlib/zlib.rbuild create mode 100644 lib/atl/atl.rbuild create mode 100644 lib/cmlib/cmlib.rbuild create mode 100644 lib/cportlib/cportlib.rbuild create mode 100644 lib/debugsup/debugsup.rbuild create mode 100644 lib/dnslib/dnslib.rbuild create mode 100644 lib/drivers/chew/chew.rbuild create mode 100644 lib/drivers/csq/csq.rbuild create mode 100644 lib/drivers/directory.rbuild create mode 100644 lib/drivers/ip/ip.rbuild create mode 100644 lib/drivers/oskittcp/oskittcp.rbuild create mode 100644 lib/drivers/sound/legacy/legacy.rbuild create mode 100644 lib/drivers/sound/mmebuddy/mmebuddy.rbuild create mode 100644 lib/drivers/sound/mment4/mment4.rbuild create mode 100644 lib/drivers/sound/mmixer/mmixer.rbuild create mode 100644 lib/drivers/sound/shared/shared.rbuild create mode 100644 lib/drivers/sound/sound.rbuild create mode 100644 lib/drivers/sound/soundblaster/soundblaster.rbuild create mode 100644 lib/drivers/sound/uartmidi/uartmidi.rbuild create mode 100644 lib/epsapi/epsapi.rbuild create mode 100644 lib/fslib/directory.rbuild create mode 100644 lib/fslib/ext2lib/ext2lib.rbuild create mode 100644 lib/fslib/ntfslib/ntfslib.rbuild create mode 100644 lib/fslib/vfatlib/vfatlib.rbuild create mode 100644 lib/fslib/vfatxlib/vfatxlib.rbuild create mode 100644 lib/inflib/inflib.rbuild create mode 100644 lib/lib.mak create mode 100644 lib/lib.rbuild create mode 100644 lib/lsalib/lsalib.rbuild create mode 100644 lib/newinflib/inflib.rbuild create mode 100644 lib/nls/idna/idna.rbuild create mode 100644 lib/nls/nls.rbuild create mode 100644 lib/nls/normalize/normalize.rbuild create mode 100644 lib/nls/scripts/scripts.rbuild create mode 100644 lib/ppcmmu/ppcmmu.rbuild create mode 100644 lib/pseh/pseh.rbuild create mode 100644 lib/recyclebin/recyclebin.rbuild create mode 100644 lib/rossym/rossym.rbuild create mode 100644 lib/rtl/i386/rtlswap.S create mode 100644 lib/rtl/rtl.rbuild create mode 100644 lib/sdk/crt/crt.rbuild create mode 100644 lib/sdk/crt/libcntpr.rbuild create mode 100644 lib/sdk/crt/math/i386/atan2.c create mode 100644 lib/sdk/crt/math/i386/exp.c create mode 100644 lib/sdk/crt/math/i386/fmod.c create mode 100644 lib/sdk/crt/math/i386/fmodf.c create mode 100644 lib/sdk/crt/math/i386/sqrtf.c create mode 100644 lib/sdk/crt/mem/i386/memcpy_asm.s create mode 100644 lib/sdk/delayimp/delayimp.rbuild create mode 100644 lib/sdk/dxguid/dxguid.rbuild create mode 100644 lib/sdk/ioevent/ioevent.rbuild create mode 100644 lib/sdk/nt/nt.rbuild create mode 100644 lib/sdk/scrnsave/scrnsave.rbuild create mode 100644 lib/sdk/sdk.rbuild create mode 100644 lib/sdk/strmiids/strmiids.rbuild create mode 100644 lib/sdk/uuid/uuid.c create mode 100644 lib/sdk/uuid/uuid.rbuild create mode 100644 lib/sdk/wdmguid/wdmguid.rbuild create mode 100644 lib/smlib/smlib.rbuild create mode 100644 lib/tdilib/tdilib.rbuild create mode 100644 media/drivers/drivers.rbuild create mode 100644 media/drivers/etc/etc.rbuild create mode 100644 media/fonts/fonts.rbuild create mode 100644 media/inf/inf.rbuild create mode 100644 media/media.rbuild create mode 100644 media/nls/nls.rbuild create mode 100644 media/sounds/sounds.rbuild create mode 100644 media/vgafonts/vgafonts.rbuild create mode 100644 modules/directory.rbuild create mode 100644 modules/empty.rbuild create mode 100644 ntoskrnl/kdbg/i386/longjmp.S create mode 100644 ntoskrnl/kdbg/i386/setjmp.S create mode 100644 ntoskrnl/ntkrnlmp.rbuild create mode 100644 ntoskrnl/ntoskrnl-generic.rbuild create mode 100644 ntoskrnl/ntoskrnl.pspec create mode 100644 ntoskrnl/ntoskrnl.rbuild create mode 100644 proxy.mak create mode 100644 subsystems/csr/csr.rbuild create mode 100644 subsystems/csr/csrsrv/csrsrv.rbuild create mode 100644 subsystems/ntvdm/ntvdm.rbuild create mode 100644 subsystems/subsystems.rbuild create mode 100644 subsystems/win/basesrv/basesrv.rbuild create mode 100644 subsystems/win/directory.rbuild create mode 100644 subsystems/win/winsrv/winsrv.rbuild create mode 100644 subsystems/win32/csrss/csrsrv/csrsrv.rbuild create mode 100644 subsystems/win32/csrss/csrss.rbuild create mode 100644 subsystems/win32/csrss/win32csr/win32csr.rbuild create mode 100644 subsystems/win32/win32.rbuild create mode 100644 subsystems/win32/win32k/win32k.pspec create mode 100644 subsystems/win32/win32k/win32k.rbuild create mode 100644 tools/bin2c.mak create mode 100644 tools/buildno/buildno.cpp create mode 100644 tools/buildno/buildno.mak create mode 100644 tools/buildno/pch.h create mode 100644 tools/cabman/cabman.rbuild create mode 100644 tools/cdmake/cdmake.rbuild create mode 100644 tools/gendib/gendib.mak create mode 100644 tools/geninc/data.c create mode 100644 tools/geninc/geninc.rbuild create mode 100644 tools/hpp/hpp.rbuild create mode 100644 tools/kbdtool/kbdtool.rbuild create mode 100644 tools/log2lines/log2lines.mak create mode 100644 tools/mkhive/mkhive.rbuild create mode 100644 tools/nandflash/nandflash.rbuild create mode 100644 tools/ofw_interface/ofw_interface.mak create mode 100644 tools/pefixup.mak create mode 100644 tools/pipetools/pipetools.mak create mode 100644 tools/rbuild/automaticdependency.cpp create mode 100644 tools/rbuild/autoregister.cpp create mode 100644 tools/rbuild/backend/backend.cpp create mode 100644 tools/rbuild/backend/backend.h create mode 100644 tools/rbuild/backend/dependencymap/dependencymap.cpp create mode 100644 tools/rbuild/backend/dependencymap/dependencymap.h create mode 100644 tools/rbuild/backend/mingw/compilers/gcc.mak create mode 100644 tools/rbuild/backend/mingw/compilers/msc.mak create mode 100644 tools/rbuild/backend/mingw/linkers/ld.mak create mode 100644 tools/rbuild/backend/mingw/linkers/mslink.mak create mode 100644 tools/rbuild/backend/mingw/mingw.cpp create mode 100644 tools/rbuild/backend/mingw/mingw.h create mode 100644 tools/rbuild/backend/mingw/modulehandler.cpp create mode 100644 tools/rbuild/backend/mingw/modulehandler.h create mode 100644 tools/rbuild/backend/mingw/mstools_detection.cpp create mode 100644 tools/rbuild/backend/mingw/pch_detection.h create mode 100644 tools/rbuild/backend/mingw/pipe_detection.c create mode 100644 tools/rbuild/backend/mingw/proxymakefile.cpp create mode 100644 tools/rbuild/backend/mingw/rule.cpp create mode 100644 tools/rbuild/backend/mingw/rule.h create mode 100644 tools/rbuild/backend/mingw/rules.mak create mode 100644 tools/rbuild/backend/msbuild/msbuild.cpp create mode 100644 tools/rbuild/backend/msbuild/msbuild.h create mode 100644 tools/rbuild/backend/msvc/genguid.cpp create mode 100644 tools/rbuild/backend/msvc/msvc.cpp create mode 100644 tools/rbuild/backend/msvc/msvc.h create mode 100644 tools/rbuild/backend/msvc/msvcmaker.cpp create mode 100644 tools/rbuild/backend/msvc/projmaker.cpp create mode 100644 tools/rbuild/backend/msvc/propsmaker.cpp create mode 100644 tools/rbuild/backend/msvc/rules/reactos.defaults.props create mode 100644 tools/rbuild/backend/msvc/rules/reactos.targets create mode 100644 tools/rbuild/backend/msvc/rules/s_as_mscpp.props create mode 100644 tools/rbuild/backend/msvc/rules/s_as_mscpp.rules create mode 100644 tools/rbuild/backend/msvc/rules/s_as_mscpp.targets create mode 100644 tools/rbuild/backend/msvc/rules/s_as_mscpp.xml create mode 100644 tools/rbuild/backend/msvc/rules/spec.props create mode 100644 tools/rbuild/backend/msvc/rules/spec.rules create mode 100644 tools/rbuild/backend/msvc/rules/spec.targets create mode 100644 tools/rbuild/backend/msvc/rules/spec.xml create mode 100644 tools/rbuild/backend/msvc/slnmaker.cpp create mode 100644 tools/rbuild/backend/msvc/vcprojmaker.cpp create mode 100644 tools/rbuild/backend/msvc/vcxprojmaker.cpp create mode 100644 tools/rbuild/backend/msvc/vspropsmaker.cpp create mode 100644 tools/rbuild/backend/versionreport/versionreport.cpp create mode 100644 tools/rbuild/backend/versionreport/versionreport.h create mode 100644 tools/rbuild/bootstrap.cpp create mode 100644 tools/rbuild/cdfile.cpp create mode 100644 tools/rbuild/compilationunit.cpp create mode 100644 tools/rbuild/compilationunitsupportcode.cpp create mode 100644 tools/rbuild/compilerdirective.cpp create mode 100644 tools/rbuild/compilerflag.cpp create mode 100644 tools/rbuild/configuration.cpp create mode 100644 tools/rbuild/define.cpp create mode 100644 tools/rbuild/directory.cpp create mode 100644 tools/rbuild/doc/rbuild.dbk create mode 100644 tools/rbuild/doc/rbuild.txt create mode 100644 tools/rbuild/empty.def create mode 100644 tools/rbuild/exception.cpp create mode 100644 tools/rbuild/exception.h create mode 100644 tools/rbuild/filesupportcode.cpp create mode 100644 tools/rbuild/global.cpp create mode 100644 tools/rbuild/include.cpp create mode 100644 tools/rbuild/installfile.cpp create mode 100644 tools/rbuild/linkerflag.cpp create mode 100644 tools/rbuild/linkerscript.cpp create mode 100644 tools/rbuild/makefile create mode 100644 tools/rbuild/module.cpp create mode 100644 tools/rbuild/pch.h create mode 100644 tools/rbuild/project.cpp create mode 100644 tools/rbuild/project.dtd create mode 100644 tools/rbuild/rbuild.cpp create mode 100644 tools/rbuild/rbuild.dsp create mode 100644 tools/rbuild/rbuild.dsw create mode 100644 tools/rbuild/rbuild.h create mode 100644 tools/rbuild/rbuild.mak create mode 100644 tools/rbuild/rbuild.sln create mode 100644 tools/rbuild/rbuild.vcproj create mode 100644 tools/rbuild/stubbedcomponent.cpp create mode 100644 tools/rbuild/syssetupgenerator.cpp create mode 100644 tools/rbuild/test.h create mode 100644 tools/rbuild/tests/alltests.cpp create mode 100644 tools/rbuild/tests/cdfiletest.cpp create mode 100644 tools/rbuild/tests/compilationunittest.cpp create mode 100644 tools/rbuild/tests/data/automaticdependency.rbuild create mode 100644 tools/rbuild/tests/data/automaticdependency_include.rbuild create mode 100644 tools/rbuild/tests/data/cdfile.rbuild create mode 100644 tools/rbuild/tests/data/compilationunit.rbuild create mode 100644 tools/rbuild/tests/data/define.rbuild create mode 100644 tools/rbuild/tests/data/if.rbuild create mode 100644 tools/rbuild/tests/data/include.rbuild create mode 100644 tools/rbuild/tests/data/invoke.rbuild create mode 100644 tools/rbuild/tests/data/linkerflag.rbuild create mode 100644 tools/rbuild/tests/data/module.rbuild create mode 100644 tools/rbuild/tests/data/project.rbuild create mode 100644 tools/rbuild/tests/data/sourcefile1.c create mode 100644 tools/rbuild/tests/data/sourcefile1/sourcefile1_header3.h create mode 100644 tools/rbuild/tests/data/sourcefile1/sourcefile_includenext.h create mode 100644 tools/rbuild/tests/data/sourcefile1_header1.h create mode 100644 tools/rbuild/tests/data/sourcefile1_header2.h create mode 100644 tools/rbuild/tests/data/sourcefile1_recurse.h create mode 100644 tools/rbuild/tests/data/sourcefile_include.c create mode 100644 tools/rbuild/tests/data/sourcefile_include.h create mode 100644 tools/rbuild/tests/data/sourcefile_includenext.h create mode 100644 tools/rbuild/tests/data/symbol.rbuild create mode 100644 tools/rbuild/tests/definetest.cpp create mode 100644 tools/rbuild/tests/functiontest.cpp create mode 100644 tools/rbuild/tests/iftest.cpp create mode 100644 tools/rbuild/tests/includetest.cpp create mode 100644 tools/rbuild/tests/invoketest.cpp create mode 100644 tools/rbuild/tests/linkerflagtest.cpp create mode 100644 tools/rbuild/tests/moduletest.cpp create mode 100644 tools/rbuild/tests/projecttest.cpp create mode 100644 tools/rbuild/tests/sourcefiletest.cpp create mode 100644 tools/rbuild/tests/symboltest.cpp create mode 100644 tools/rbuild/testsupportcode.cpp create mode 100644 tools/rbuild/xmlnode.cpp create mode 100644 tools/rbuild_helper/rbuild_helper.rbuild create mode 100644 tools/rgenstat/rgenstat.rbuild create mode 100644 tools/rsym/raddr2line.mak create mode 100644 tools/rsym/rsym.c create mode 100644 tools/rsym/rsym.mak create mode 100644 tools/ssprintf.cpp create mode 100644 tools/ssprintf.h create mode 100644 tools/tools.mak create mode 100644 tools/tools.rbuild create mode 100644 tools/unicode/unicode.rbuild create mode 100644 tools/utf16le/utf16le.rbuild create mode 100644 tools/widl/widl.rbuild create mode 100644 tools/winebuild/Makefile.in create mode 100644 tools/winebuild/build.h create mode 100644 tools/winebuild/import.c create mode 100644 tools/winebuild/main.c create mode 100644 tools/winebuild/mkstemps.c create mode 100644 tools/winebuild/parser.c create mode 100644 tools/winebuild/relay.c create mode 100644 tools/winebuild/res16.c create mode 100644 tools/winebuild/res32.c create mode 100644 tools/winebuild/ros_diff.patch create mode 100644 tools/winebuild/spec16.c create mode 100644 tools/winebuild/spec32.c create mode 100644 tools/winebuild/utils.c create mode 100644 tools/winebuild/winebuild.man.in create mode 100644 tools/winebuild/winebuild.rbuild create mode 100644 tools/wmc/wmc.rbuild create mode 100644 tools/wpp/wpp.rbuild create mode 100644 tools/wrc/wrc.rbuild create mode 100644 tools/xml.cpp create mode 100644 tools/xml.h diff --git a/Makefile b/Makefile new file mode 100644 index 00000000000..cf320c428f6 --- /dev/null +++ b/Makefile @@ -0,0 +1,633 @@ +# Well-known targets: +# +# all (default target) +# This target builds all of ReactOS. +# +# module +# These targets builds a single module. Replace module with the name of +# the module you want to build. +# +# bootcd +# This target builds an ISO (ReactOS.iso) from which ReactOS can be booted +# and installed. +# +# livecd +# This target builds an ISO (ReactOS-Live.iso) from which ReactOS can be +# booted, but not installed. +# +# install +# This target installs all of ReactOS to a location specified by the +# ROS_INSTALL environment variable. +# +# module_install +# These targets installs a single module to a location specified by the +# ROS_INSTALL environment variable. Replace module with the name of the +# module you want to install. +# +# clean +# This target cleans (deletes) all files that are generated when building +# ReactOS. +# +# module_clean +# These targets cleans (deletes) files that are generated when building a +# single module. Replace module with the name of the module you want to +# clean. +# +# depends +# This target does a complete dependency check of the ReactOS codebase. +# This can require several minutes to complete. If you only need to check +# dependencies for a single or few modules then you can use the +# module_depends targets instead. This target can also repair a damaged or +# missing makefile-${ROS_ARCH}.auto if needed. +# +# module_depends +# These targets do a dependency check of individual modules. Replace module +# with the name of the module for which you want to check dependencies. +# This is faster than the depends target which does a complete dependency +# check of the ReactOS codebase. +# +# bootcdregtest +# This target builds an ISO (ReactOS-RegTest.ISO) which is used for unattended +# regression testing. +# +# +# Accepted environment variables: +# +# ROS_ARCH +# This variable specifies the name of the architecture to build ReactOS for. +# The variable defaults to i386. +# +# ROS_PREFIX +# This variable specifies the prefix of the MinGW installation. On Windows +# a prefix is usually not needed, but on linux it is usually "mingw32". If +# not present and no executable named "gcc" can be found, then the prefix is +# assumed to be "mingw32". If your gcc is named i386-mingw32-gcc then set +# ROS_PREFIX to i386-mingw32. Don't include the dash (-) before gcc. +# +# ROS_INTERMEDIATE +# This variable controls where to put intermediate files. Intermediate +# files are generated files that are needed to generate the final +# output files. Examples of intermediate files include *.o, *.a, and +# *.coff. N.B. Don't put a path separator at the end. The variable +# defaults to .\obj-{ROS_ARCH}. +# +# ROS_OUTPUT +# This variable controls where to put output files. Output files are +# generated files that makes up the result of the build process. +# Examples of output files include *.exe, *.dll, and *.sys. N.B. Don't +# put a path separator at the end. The variable defaults to .\output-{ROS_ARCH}. +# +# ROS_CDOUTPUT +# This variable controls the name of the ReactOS directory on cdrom. +# The variable defaults to reactos. +# Warning: setting this value may lead to a not bootable/installable cdrom. +# +# ROS_TEMPORARY +# This variable controls where to put temporary files. Temporary files +# are (usually small) generated files that are needed to generate the +# intermediate or final output files. Examples of temporary files include +# *.rci (preprocessed .rc files for wrc), *.tmp, and *.exp. N.B. Don't put +# a path separator at the end. The variable defaults to {ROS_INTERMEDIATE} +# directory. +# +# ROS_INSTALL +# This variable controls where to install output files to when using +# 'make install'. N.B. Don't put a path separator at the end. The variable +# defaults to .\{ROS_CDOUTPUT}. +# +# ROS_BUILDMAP +# This variable controls if map files are to be generated for executable +# output files. Map files have the extension .map. The value can be either +# full (to build map files with assembly code), yes (to build map files +# without source code) or no (to not build any map files). The variable +# defaults to no. +# +# ROS_BUILDNOSTRIP +# This variable controls if non-symbol-stripped versions are to be built +# of executable output files. Non-symbol-stripped executable output files +# have .nostrip added to the filename just before the extension. The value +# can be either yes (to build non-symbol-stripped versions of executable +# output files) or no (to not build non-symbol-stripped versions of +# executable output files). The variable defaults to no. +# +# ROS_LEAN_AND_MEAN +# This variable controls if all binaries should be stripped out of useless +# data added by GCC/LD as well as of RSYM symbol data. Output binary size +# will go from 80 to 40MB, memory usage from 58 to 38MB and the install CD +# from 18 to 13MB. The variable defaults to no. +# +# ROS_GENERATE_RSYM +# This variable controls generation of RSYM symbol data. The value can be +# either yes (to generate symbol data) or no. The variable defaults to yes. +# +# ROS_RBUILDFLAGS +# Pass parameters to rbuild. +# -v Be verbose. +# -c Clean as you go. Delete generated files as soon as they are not needed anymore. +# -dd Disable automatic dependencies. +# -da Enable automatic dependencies. +# -df Enable full dependencies. +# -dm{module} Check only automatic dependencies for this module. +# -hd Disable precompiled headers. +# -mi Let make handle creation of install directories. Rbuild will not generate the directories. +# -ps Generate proxy makefiles in source tree instead of the output tree. +# -ud Disable compilation units. +# -r Input XML +# +# ROS_AUTOMAKE +# Alternate name of makefile-${ROS_ARCH}.auto +# +# ROS_BUILDENGINE +# The Build engine to be used. The variable defaults to rbuild (RBUILD_TARGET) +# + +# check for versions of make that don't have features we need... +# the function "eval" is only available in 3.80+, which happens to be the minimum +# version that has the features we use... +# THIS CHECK IS BORROWED FROM THE "GMSL" PROJECT, AND IS COVERED BY THE GPL LICENSE +# YOU CAN FIND OUT MORE ABOUT GMSL - A VERY COOL PROJECT - AT: +# http://gmsl.sourceforge.net/ + +__gmsl_have_eval := +__gmsl_ignore := $(eval __gmsl_have_eval := T) + +ifndef __gmsl_have_eval +$(error ReactOS's makefiles use GNU Make 3.80+ features, you have $(MAKE_VERSION), you MUST UPGRADE in order to build ReactOS - Sorry) +endif +# END of code borrowed from GMSL ( http://gmsl.sourceforge.net/ ) + +define NL + + +endef + +.PHONY: all +.PHONY: clean +.PHONY: world +.PHONY: universe + +ifneq ($(ROS_ARCH),) + ARCH := $(ROS_ARCH) +else + ARCH := i386 +endif + +ifeq ($(ROS_AUTOMAKE),) + ROS_AUTOMAKE=makefile-$(ARCH).auto +endif + +all: $(ROS_AUTOMAKE) + + +.SUFFIXES: + +ifeq ($(HOST),) +ifeq ($(word 1,$(shell gcc -dumpmachine)),mingw32) +ifeq ($(findstring msys,$(shell sh --version 2>nul)),msys) +export OSTYPE = msys +HOST=mingw32-linux +HOST_CFLAGS+=-fshort-wchar +HOST_CPPFLAGS+=-fshort-wchar +else +HOST=mingw32-windows +endif +else +HOST=mingw32-linux +HOST_CFLAGS+=-fshort-wchar +HOST_CPPFLAGS+=-fshort-wchar +endif +endif + +# Default to half-verbose mode +ifeq ($(VERBOSE),no) + Q = @ + HALFVERBOSEECHO = no + BUILDNO_QUIET = -q +else +ifeq ($(VERBOSE),full) + Q = + HALFVERBOSEECHO = no + BUILDNO_QUIET = +else + Q = @ + HALFVERBOSEECHO = yes + BUILDNO_QUIET = -q +endif +endif +ifeq ($(HOST),mingw32-linux) + QUOTE = " +else + QUOTE = +endif +ifeq ($(HALFVERBOSEECHO),yes) + ECHO_CP =@echo $(QUOTE)[COPY] $@$(QUOTE) + ECHO_MKDIR =@echo $(QUOTE)[MKDIR] $@$(QUOTE) + ECHO_BUILDNO =@echo $(QUOTE)[BUILDNO] $@$(QUOTE) + ECHO_INVOKE =@echo $(QUOTE)[INVOKE] $<$(QUOTE) + ECHO_PCH =@echo $(QUOTE)[PCH] $@$(QUOTE) + ECHO_CPP =@echo $(QUOTE)[CPP] $@$(QUOTE) + ECHO_CC =@echo $(QUOTE)[CC] $<$(QUOTE) + ECHO_HOSTCC =@echo $(QUOTE)[HOST-CC] $<$(QUOTE) + ECHO_CL =@echo $(QUOTE)[CL] $<$(QUOTE) + ECHO_AS =@echo $(QUOTE)[AS] $<$(QUOTE) + ECHO_NASM =@echo $(QUOTE)[NASM] $<$(QUOTE) + ECHO_AR =@echo $(QUOTE)[AR] $@$(QUOTE) + ECHO_HOSTAR =@echo $(QUOTE)[HOST-AR] $@$(QUOTE) + ECHO_WINEBLD =@echo $(QUOTE)[WINEBLD] $@$(QUOTE) + ECHO_WRC =@echo $(QUOTE)[WRC] $@$(QUOTE) + ECHO_RC =@echo $(QUOTE)[RC] $@$(QUOTE) + ECHO_CVTRES =@echo $(QUOTE)[CVTRES] $@$(QUOTE) + ECHO_WIDL =@echo $(QUOTE)[WIDL] $@$(QUOTE) + ECHO_BIN2RES =@echo $(QUOTE)[BIN2RES] $<$(QUOTE) + ECHO_IMPLIB =@echo $(QUOTE)[IMPLIB] $@$(QUOTE) + ECHO_LD =@echo $(QUOTE)[LD] $@$(QUOTE) + ECHO_HOSTLD =@echo $(QUOTE)[HOST-LD] $@$(QUOTE) + ECHO_LINK =@echo $(QUOTE)[LINK] $@$(QUOTE) + ECHO_NM =@echo $(QUOTE)[NM] $@$(QUOTE) + ECHO_OBJDUMP =@echo $(QUOTE)[OBJDUMP] $@$(QUOTE) + ECHO_RBUILD =@echo $(QUOTE)[RBUILD] $@$(QUOTE) + ECHO_RSYM =@echo $(QUOTE)[RSYM] $@$(QUOTE) + ECHO_PEFIXUP =@echo $(QUOTE)[PEFIXUP] $@$(QUOTE) + ECHO_WMC =@echo $(QUOTE)[WMC] $@$(QUOTE) + ECHO_NCI =@echo $(QUOTE)[NCI] $@$(QUOTE) + ECHO_CABMAN =@echo $(QUOTE)[CABMAN] $<$(QUOTE) + ECHO_CDMAKE =@echo $(QUOTE)[CDMAKE] $@$(QUOTE) + ECHO_MKHIVE =@echo $(QUOTE)[MKHIVE] $@$(QUOTE) + ECHO_REGTESTS=@echo $(QUOTE)[REGTESTS] $@$(QUOTE) + ECHO_TEST =@echo $(QUOTE)[TEST] $@$(QUOTE) + ECHO_GENDIB =@echo $(QUOTE)[GENDIB] $@$(QUOTE) + ECHO_STRIP =@echo $(QUOTE)[STRIP] $@$(QUOTE) + ECHO_RGENSTAT=@echo $(QUOTE)[RGENSTAT] $@$(QUOTE) + ECHO_DEPENDS =@echo $(QUOTE)[DEPENDS] $<$(QUOTE) + ECHO_RSP =@echo $(QUOTE)[RSP] $@$(QUOTE) +else + ECHO_CP = + ECHO_MKDIR = + ECHO_BUILDNO = + ECHO_INVOKE = + ECHO_PCH = + ECHO_CPP = + ECHO_CC = + ECHO_HOSTCC = + ECHO_AS = + ECHO_NASM = + ECHO_AR = + ECHO_HOSTAR = + ECHO_WINEBLD = + ECHO_WRC = + ECHO_RC = + ECHO_CVTRES = + ECHO_WIDL = + ECHO_BIN2RES = + ECHO_IMPLIB = + ECHO_LD = + ECHO_HOSTLD = + ECHO_NM = + ECHO_OBJDUMP = + ECHO_RBUILD = + ECHO_RSYM = + ECHO_WMC = + ECHO_NCI = + ECHO_CABMAN = + ECHO_CDMAKE = + ECHO_MKHIVE = + ECHO_REGTESTS= + ECHO_TEST = + ECHO_GENDIB = + ECHO_STRIP = + ECHO_RGENSTAT= + ECHO_DEPENDS = + ECHO_RSP = +endif + +# Set host compiler/linker +ifeq ($(HOST_CC),) + HOST_CC = gcc +endif +ifeq ($(HOST_CPP),) + HOST_CPP = g++ +endif +host_gcc = $(Q)$(HOST_CC) +host_gpp = $(Q)$(HOST_CPP) +host_ld = $(Q)ld +host_ar = $(Q)ar +host_objcopy = $(Q)objcopy + +# Set target compiler/linker +ifneq ($(ROS_PREFIX),) + PREFIX_ := $(ROS_PREFIX)- +else + ifeq ($(HOST),mingw32-linux) + PREFIX_ := mingw32- + else + PREFIX_ := + endif +endif +ifeq ($(TARGET_CC),) + TARGET_CC = $(PREFIX_)gcc +endif +ifeq ($(TARGET_CPP),) + TARGET_CPP = $(PREFIX_)g++ +endif +gcc = $(Q)$(TARGET_CC) +gpp = $(Q)$(TARGET_CPP) +gas = $(Q)$(TARGET_CC) -x assembler-with-cpp +ld = $(Q)$(PREFIX_)ld +nm = $(Q)$(PREFIX_)nm +objdump = $(Q)$(PREFIX_)objdump +ar = $(Q)$(PREFIX_)ar +objcopy = $(Q)$(PREFIX_)objcopy +dlltool = $(Q)$(PREFIX_)dlltool +strip = $(Q)$(PREFIX_)strip +windres = $(Q)$(PREFIX_)windres + +# Set utilities +ifeq ($(OSTYPE),msys) + HOST=mingw32-linux +endif +ifeq ($(HOST),mingw32-linux) + ifeq ($(OSTYPE),msys) + export EXEPOSTFIX = .exe + else + export EXEPOSTFIX = + endif + export SEP = / + mkdir = -$(Q)mkdir -p + checkpoint = $(Q)touch + rm = $(Q)rm -f + cp = $(Q)cp + NUL = /dev/null +else # mingw32-windows + export EXEPOSTFIX = .exe + ROS_EMPTY = + export SEP = \$(ROS_EMPTY) + mkdir = -$(Q)mkdir + checkpoint = $(Q)copy /y NUL + rm = $(Q)del /f /q + cp = $(Q)copy /y + NUL = NUL +endif + +ifneq ($(ROS_INTERMEDIATE),) + INTERMEDIATE := $(ROS_INTERMEDIATE) +else + INTERMEDIATE := obj-$(ARCH) +endif +INTERMEDIATE_ := $(INTERMEDIATE)$(SEP) + +ifneq ($(ROS_OUTPUT),) + OUTPUT := $(ROS_OUTPUT) +else + OUTPUT := output-$(ARCH) +endif +OUTPUT_ := $(OUTPUT)$(SEP) + +ifneq ($(ROS_CDOUTPUT),) + CDOUTPUT := $(ROS_CDOUTPUT) +else + CDOUTPUT := reactos +endif +CDOUTPUT_ := $(CDOUTPUT)$(SEP) + +ifneq ($(ROS_TEMPORARY),) + TEMPORARY := $(ROS_TEMPORARY) +else + TEMPORARY := $(INTERMEDIATE) +endif +TEMPORARY_ := $(TEMPORARY)$(SEP) + +ifneq ($(ROS_INSTALL),) + INSTALL := $(ROS_INSTALL) +else + INSTALL := $(CDOUTPUT) +endif +INSTALL_ := $(INSTALL)$(SEP) + +RBUILD_FLAGS := -rReactOS-$(ARCH).rbuild -DARCH=$(ARCH) + +$(INTERMEDIATE): + $(ECHO_MKDIR) + ${mkdir} $@ + +ifneq ($(INTERMEDIATE),$(OUTPUT)) +$(OUTPUT): + $(ECHO_MKDIR) + ${mkdir} $@ +endif + +ifneq ($(TEMPORARY),$(INTERMEDIATE)) +ifneq ($(TEMPORARY),$(OUTPUT)) +$(TEMPORARY): + $(ECHO_MKDIR) + ${mkdir} $@ +endif +endif + +BUILDNO_H = $(INTERMEDIATE_)include$(SEP)reactos$(SEP)buildno.h + +include lib/lib.mak +include tools/tools.mak +-include $(ROS_AUTOMAKE) + +PREAUTO := \ + $(BIN2C_TARGET) \ + $(BIN2RES_TARGET) \ + $(BUILDNO_H) \ + $(GENDIB_DIB_FILES) \ + $(NCI_SERVICE_FILES) + +ifeq ($(ARCH),powerpc) +PREAUTO += $(OFW_INTERFACE_SERVICE_FILES) $(PPCMMU_TARGETS) +endif + +ifeq ($(ROS_BUILDENGINE),) +ROS_BUILDENGINE=$(RBUILD_TARGET) +endif + +$(ROS_AUTOMAKE): $(ROS_BUILDENGINE) $(XMLBUILDFILES) | $(PREAUTO) + ${mkdir} $(OUTPUT_)media$(SEP)inf 2>$(NUL) + $(ECHO_RBUILD) + $(Q)$(ROS_BUILDENGINE) $(RBUILD_FLAGS) $(ROS_RBUILDFLAGS) mingw + +world: all bootcd livecd + +universe: + $(MAKE) KDBG=1 DBG=1 \ + ROS_AUTOMAKE=makefile-$(ARCH)-kd.auto \ + ROS_INSTALL=reactos-$(ARCH)-kd \ + ROS_INTERMEDIATE=obj-$(ARCH)-kd \ + ROS_OUTPUT=output-$(ARCH)-kd \ + world + $(MAKE) KDBG=0 DBG=1 \ + ROS_AUTOMAKE=makefile-$(ARCH)-d.auto \ + ROS_INSTALL=reactos-$(ARCH)-d \ + ROS_INTERMEDIATE=obj-$(ARCH)-d \ + ROS_OUTPUT=output-$(ARCH)-d \ + world + $(MAKE) KDBG=0 DBG=0 \ + ROS_AUTOMAKE=makefile-$(ARCH)-r.auto \ + ROS_INSTALL=reactos-$(ARCH)-r \ + ROS_INTERMEDIATE=obj-$(ARCH)-r \ + ROS_OUTPUT=output-$(ARCH)-r \ + world + +.PHONY: rgenstat +rgenstat: $(RGENSTAT_TARGET) + $(ECHO_RGENSTAT) + $(Q)$(RGENSTAT_TARGET) apistatus.lst apistatus.xml + +.PHONY: msbuild +msbuild: $(ROS_BUILDENGINE) + $(ECHO_RBUILD) + $(Q)$(ROS_BUILDENGINE) $(RBUILD_FLAGS) $(ROS_RBUILDFLAGS) msbuild + +.PHONY: msbuild_clean +msbuild_clean: $(ROS_BUILDENGINE) + $(ECHO_RBUILD) + $(Q)$(ROS_BUILDENGINE) $(RBUILD_FLAGS) $(ROS_RBUILDFLAGS) -c msbuild + +.PHONY: depmap +depmap: $(ROS_BUILDENGINE) + $(ECHO_RBUILD) + $(Q)$(ROS_BUILDENGINE) $(RBUILD_FLAGS) $(ROS_RBUILDFLAGS) depmap + +.PHONY: vreport +vreport:$(ROS_BUILDENGINE) + $(ECHO_RBUILD) + $(Q)$(ROS_BUILDENGINE) $(RBUILD_FLAGS) $(ROS_RBUILDFLAGS) vreport + +.PHONY: msvc +msvc: $(ROS_BUILDENGINE) + $(ECHO_RBUILD) + $(Q)$(ROS_BUILDENGINE) $(RBUILD_FLAGS) $(ROS_RBUILDFLAGS) msvc + +.PHONY: msvc6 +msvc6: $(ROS_BUILDENGINE) + $(ECHO_RBUILD) + $(Q)$(ROS_BUILDENGINE) $(RBUILD_FLAGS) $(ROS_RBUILDFLAGS) -vs6.00 -voversionconfiguration msvc + +.PHONY: msvc7 +msvc7: $(ROS_BUILDENGINE) + $(ECHO_RBUILD) + $(Q)$(ROS_BUILDENGINE) $(RBUILD_FLAGS) $(ROS_RBUILDFLAGS) -vs7.00 -voversionconfiguration msvc + +.PHONY: msvc71 +msvc71: $(ROS_BUILDENGINE) + $(ECHO_RBUILD) + $(Q)$(ROS_BUILDENGINE) $(RBUILD_FLAGS) $(ROS_RBUILDFLAGS) -vs7.10 -voversionconfiguration msvc + +.PHONY: msvc8 +msvc8: $(ROS_BUILDENGINE) + $(ECHO_RBUILD) + $(Q)$(ROS_BUILDENGINE) $(RBUILD_FLAGS) $(ROS_RBUILDFLAGS) -vs8.00 -voversionconfiguration msvc + +.PHONY: msvc9 +msvc9: $(ROS_BUILDENGINE) + $(ECHO_RBUILD) + $(Q)$(ROS_BUILDENGINE) $(RBUILD_FLAGS) $(ROS_RBUILDFLAGS) -vs9.00 -voversionconfiguration msvc + +.PHONY: msvc10 +msvc10: $(ROS_BUILDENGINE) + $(ECHO_RBUILD) + $(Q)$(ROS_BUILDENGINE) $(RBUILD_FLAGS) $(ROS_RBUILDFLAGS) -vs10.00 -voversionconfiguration msvc + +.PHONY: msvc6_clean +msvc6_clean: $(ROS_BUILDENGINE) + $(ECHO_RBUILD) + $(Q)$(ROS_BUILDENGINE) $(RBUILD_FLAGS) $(ROS_RBUILDFLAGS) -c -vs6.00 -voversionconfiguration msvc + +.PHONY: msvc7_clean +msvc7_clean: $(ROS_BUILDENGINE) + $(ECHO_RBUILD) + $(Q)$(ROS_BUILDENGINE) $(RBUILD_FLAGS) $(ROS_RBUILDFLAGS) -c -vs7.00 -voversionconfiguration msvc + +.PHONY: msvc71_clean +msvc71_clean: $(ROS_BUILDENGINE) + $(ECHO_RBUILD) + $(Q)$(ROS_BUILDENGINE) $(RBUILD_FLAGS) $(ROS_RBUILDFLAGS) -c -vs7.10 -voversionconfiguration msvc + +.PHONY: msvc8_clean +msvc8_clean: $(ROS_BUILDENGINE) + $(ECHO_RBUILD) + $(Q)$(ROS_BUILDENGINE) $(RBUILD_FLAGS) $(ROS_RBUILDFLAGS) -c -vs8.00 -voversionconfiguration msvc + +.PHONY: msvc9_clean +msvc9_clean: $(ROS_BUILDENGINE) + $(ECHO_RBUILD) + $(Q)$(ROS_BUILDENGINE) $(RBUILD_FLAGS) $(ROS_RBUILDFLAGS) -c -vs9.00 -voversionconfiguration msvc + +.PHONY: msvc10_clean +msvc10_clean: $(ROS_BUILDENGINE) + $(ECHO_RBUILD) + $(Q)$(ROS_BUILDENGINE) $(RBUILD_FLAGS) $(ROS_RBUILDFLAGS) -c -vs10.00 -voversionconfiguration msvc + +.PHONY: msvc_clean +msvc_clean: $(ROS_BUILDENGINE) + $(ECHO_RBUILD) + $(Q)$(ROS_BUILDENGINE) $(RBUILD_FLAGS) $(ROS_RBUILDFLAGS) -c msvc + +.PHONY: msvc_clean_all +msvc_clean_all: $(ROS_BUILDENGINE) + $(ECHO_RBUILD) + $(Q)$(ROS_BUILDENGINE) $(RBUILD_FLAGS) $(ROS_RBUILDFLAGS) -c -vs6.00 -voversionconfiguration msvc + $(Q)$(ROS_BUILDENGINE) $(RBUILD_FLAGS) $(ROS_RBUILDFLAGS) -c -vs7.00 -voversionconfiguration msvc + $(Q)$(ROS_BUILDENGINE) $(RBUILD_FLAGS) $(ROS_RBUILDFLAGS) -c -vs7.10 -voversionconfiguration msvc + $(Q)$(ROS_BUILDENGINE) $(RBUILD_FLAGS) $(ROS_RBUILDFLAGS) -c -vs8.10 -voversionconfiguration msvc + +.PHONY: msvc7_install_debug +msvc7_install_debug: $(ROS_BUILDENGINE) + $(ECHO_RBUILD) + $(Q)$(ROS_BUILDENGINE) $(RBUILD_FLAGS) $(ROS_RBUILDFLAGS) -vs7.00 -vcdebug -voversionconfiguration msvc + +.PHONY: msvc7_install_release +msvc7_install_release: $(ROS_BUILDENGINE) + $(ECHO_RBUILD) + $(Q)$(ROS_BUILDENGINE) $(RBUILD_FLAGS) $(ROS_RBUILDFLAGS) -vs7.00 -vcrelease -voversionconfiguration msvc + +.PHONY: msvc7_install_speed +msvc7_install_speed: $(ROS_BUILDENGINE) + $(ECHO_RBUILD) + $(Q)$(ROS_BUILDENGINE) $(RBUILD_FLAGS) $(ROS_RBUILDFLAGS) -vs7.00 -vcspeed -voversionconfiguration msvc + +.PHONY: msvc71_install_debug +msvc71_install_debug: $(ROS_BUILDENGINE) + $(ECHO_RBUILD) + $(Q)$(ROS_BUILDENGINE) $(RBUILD_FLAGS) $(ROS_RBUILDFLAGS) -vs7.10 -vcdebug -voversionconfiguration msvc + +.PHONY: msvc71_install_release +msvc71_install_release: $(ROS_BUILDENGINE) + $(ECHO_RBUILD) + $(Q)$(ROS_BUILDENGINE) $(RBUILD_FLAGS) $(ROS_RBUILDFLAGS) -vs7.10 -vcrelease -voversionconfiguration msvc + + +.PHONY: msvc71_install_speed +msvc71_install_speed: $(ROS_BUILDENGINE) + $(ECHO_RBUILD) + $(Q)$(ROS_BUILDENGINE) $(RBUILD_FLAGS) $(ROS_RBUILDFLAGS) -vs7.10 -vcspeed -voversionconfiguration msvc + +.PHONY: msvc8_install_debug +msvc8_install_debug: $(ROS_BUILDENGINE) + $(ECHO_RBUILD) + $(Q)$(ROS_BUILDENGINE) $(RBUILD_FLAGS) $(ROS_RBUILDFLAGS) -vs8.00 -vcdebug -voversionconfiguration msvc + +.PHONY: msvc8_install_release +msvc8_install_release: $(ROS_BUILDENGINE) + $(ECHO_RBUILD) + $(Q)$(ROS_BUILDENGINE) $(RBUILD_FLAGS) $(ROS_RBUILDFLAGS) -vs8.00 -vcrelease -voversionconfiguration msvc + +.PHONY: msvc8_install_speed +msvc8_install_speed: $(ROS_BUILDENGINE) + $(ECHO_RBUILD) + $(Q)$(ROS_BUILDENGINE) $(RBUILD_FLAGS) $(ROS_RBUILDFLAGS) -vs8.00 -vcspeed -voversionconfiguration msvc + +.PHONY: makefile_auto_clean +makefile_auto_clean: + -@$(rm) $(ROS_AUTOMAKE) $(PREAUTO) 2>$(NUL) + +.PHONY: clean +clean: makefile_auto_clean + +.PHONY: depends +depends: $(ROS_BUILDENGINE) + $(ECHO_RBUILD) + $(Q)$(ROS_BUILDENGINE) $(RBUILD_FLAGS) $(ROS_RBUILDFLAGS) mingw diff --git a/ReactOS-amd64.rbuild b/ReactOS-amd64.rbuild new file mode 100644 index 00000000000..aed1245aba4 --- /dev/null +++ b/ReactOS-amd64.rbuild @@ -0,0 +1,113 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + -ftracer + -momit-leaf-frame-pointer + + -fms-extensions + -mpreferred-stack-boundary=4 + -m64 --win64 + + + -U_X86_ + -UWIN32 + -Wno-format + + + + -disable-stdcall-fixup + -file-alignment=0x1000 + -section-alignment=0x1000 + --unique=.eh_frame + -static + --exclude-all-symbols + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/ReactOS-arm.rbuild b/ReactOS-arm.rbuild new file mode 100644 index 00000000000..22da8090ddb --- /dev/null +++ b/ReactOS-arm.rbuild @@ -0,0 +1,160 @@ + + + + + + + + + + + + + + + + + + + + + include/reactos/arm + + + + + + + + -ftracer + + -fms-extensions + -Wno-attributes + -U_UNICODE + -UUNICODE + + + + + + + --strip-debug + -static + -file-alignment=0x1000 + -section-alignment=0x1000 + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/ReactOS-generic.rbuild b/ReactOS-generic.rbuild new file mode 100644 index 00000000000..7b6d23a19a2 --- /dev/null +++ b/ReactOS-generic.rbuild @@ -0,0 +1,150 @@ + + + + + + + + + + 1 + + + + + 0 + + + + 1 + + + + + + + + 0x400 + 0x600 + 0x400 + 0x400 + 0x400 + + + + 0x500 + 0x600 + 0x500 + 0x500 + 0x500 + + + + 0x501 + 0x600 + 0x501 + 0x501 + 0x501 + + + + 0x502 + 0x600 + 0x502 + 0x502 + 0x502 + + + + 0x600 + 0x600 + 0x600 + 0x600 + 0x600 + + + . + include + include + include/psdk + include/psdk + include/dxsdk + include/dxsdk + include/crt + include/crt/mingw32 + include/crt/msc + include/ddk + include/GL + include/ndk + include/reactos + include/reactos + include/reactos/mc + include/reactos/libs + + include/host + + + -Wall + -Wno-char-subscripts + -Wno-non-virtual-dtor + + + + __inline + 1 + /Zl + /Zi + /W1 + + + + + -Os + + + -Os + + + -O1 + + + -O2 + + + -O3 + + + -fno-strict-aliasing + -Wpointer-arith + -Wno-multichar + -Wno-error=uninitialized + + + + + + /O1 + + + /O2 + + + /Ox /GS- + /Ot + + + /Ox /GS- + /Os + + + /Ox /GS- + /Os + /Ob2 + /GF + /Gy + + + /GS- + + + diff --git a/ReactOS-i386.rbuild b/ReactOS-i386.rbuild new file mode 100644 index 00000000000..5bfd52a6177 --- /dev/null +++ b/ReactOS-i386.rbuild @@ -0,0 +1,81 @@ + + + + + + + + + + + + + + + + + + + + + + + + -ftracer + -momit-leaf-frame-pointer + + -fms-extensions + -mpreferred-stack-boundary=2 + -m32 --win32 + -gstabs+ + -fno-set-stack-executable + -fno-optimize-sibling-calls + -gstabs+ + + + + -disable-stdcall-fixup + -file-alignment=0x1000 + -section-alignment=0x1000 + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/ReactOS-ppc.rbuild b/ReactOS-ppc.rbuild new file mode 100644 index 00000000000..1dd201e05b3 --- /dev/null +++ b/ReactOS-ppc.rbuild @@ -0,0 +1,25 @@ + + + + + + + + + + + + + + + + + -fshort-wchar + -fsigned-char + -mfull-toc + -meabi + -O2 + -Wno-strict-aliasing + -gstabs+ + -gstabs+ + diff --git a/base/applications/applications.rbuild b/base/applications/applications.rbuild new file mode 100644 index 00000000000..8255a9c61ad --- /dev/null +++ b/base/applications/applications.rbuild @@ -0,0 +1,109 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/base/applications/cacls/cacls.rbuild b/base/applications/cacls/cacls.rbuild new file mode 100644 index 00000000000..96b8fbee462 --- /dev/null +++ b/base/applications/cacls/cacls.rbuild @@ -0,0 +1,12 @@ + + + + . + advapi32 + ntdll + user32 + shell32 + cacls.c + cacls.rc + precomp.h + diff --git a/base/applications/calc/calc.rbuild b/base/applications/calc/calc.rbuild new file mode 100644 index 00000000000..325ab22970b --- /dev/null +++ b/base/applications/calc/calc.rbuild @@ -0,0 +1,16 @@ + + + + . + 1 + advapi32 + gdi32 + user32 + about.c + convert.c + function.c + rpn.c + utl.c + winmain.c + resource.rc + diff --git a/base/applications/charmap/charmap.rbuild b/base/applications/charmap/charmap.rbuild new file mode 100644 index 00000000000..bdea2fd7f1f --- /dev/null +++ b/base/applications/charmap/charmap.rbuild @@ -0,0 +1,14 @@ + + + + . + gdi32 + user32 + comctl32 + about.c + charmap.c + lrgcell.c + map.c + charmap.rc + precomp.h + diff --git a/base/applications/cmdutils/cmdutils.rbuild b/base/applications/cmdutils/cmdutils.rbuild new file mode 100644 index 00000000000..23f964db9c1 --- /dev/null +++ b/base/applications/cmdutils/cmdutils.rbuild @@ -0,0 +1,28 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/base/applications/cmdutils/dbgprint/dbgprint.rbuild b/base/applications/cmdutils/dbgprint/dbgprint.rbuild new file mode 100644 index 00000000000..7fae9cfe87a --- /dev/null +++ b/base/applications/cmdutils/dbgprint/dbgprint.rbuild @@ -0,0 +1,5 @@ + + + + dbgprint.c + diff --git a/base/applications/cmdutils/doskey/doskey.rbuild b/base/applications/cmdutils/doskey/doskey.rbuild new file mode 100644 index 00000000000..f38eb3009d7 --- /dev/null +++ b/base/applications/cmdutils/doskey/doskey.rbuild @@ -0,0 +1,7 @@ + + + + user32 + doskey.c + doskey.rc + diff --git a/base/applications/cmdutils/find/find.rbuild b/base/applications/cmdutils/find/find.rbuild new file mode 100644 index 00000000000..84a700aa724 --- /dev/null +++ b/base/applications/cmdutils/find/find.rbuild @@ -0,0 +1,8 @@ + + + + user32 + find.c + find.rc + rsrc.rc + diff --git a/base/applications/cmdutils/hostname/hostname.rbuild b/base/applications/cmdutils/hostname/hostname.rbuild new file mode 100644 index 00000000000..76a3f4084d7 --- /dev/null +++ b/base/applications/cmdutils/hostname/hostname.rbuild @@ -0,0 +1,7 @@ + + + + hostname.c + hostname.rc + + diff --git a/base/applications/cmdutils/lodctr/lodctr.rbuild b/base/applications/cmdutils/lodctr/lodctr.rbuild new file mode 100644 index 00000000000..ea5e7cf1198 --- /dev/null +++ b/base/applications/cmdutils/lodctr/lodctr.rbuild @@ -0,0 +1,7 @@ + + + + loadperf + wine + lodctr_main.c + diff --git a/base/applications/cmdutils/more/more.rbuild b/base/applications/cmdutils/more/more.rbuild new file mode 100644 index 00000000000..c94585a53ba --- /dev/null +++ b/base/applications/cmdutils/more/more.rbuild @@ -0,0 +1,8 @@ + + + + ntdll + user32 + more.c + more.rc + diff --git a/base/applications/cmdutils/reg/reg.rbuild b/base/applications/cmdutils/reg/reg.rbuild new file mode 100644 index 00000000000..ac33ef4fd0b --- /dev/null +++ b/base/applications/cmdutils/reg/reg.rbuild @@ -0,0 +1,11 @@ + + + + . + 0x600 + wine + advapi32 + user32 + reg.c + rsrc.rc + diff --git a/base/applications/cmdutils/xcopy/xcopy.rbuild b/base/applications/cmdutils/xcopy/xcopy.rbuild new file mode 100644 index 00000000000..437fa46bf63 --- /dev/null +++ b/base/applications/cmdutils/xcopy/xcopy.rbuild @@ -0,0 +1,11 @@ + + + + . + wine + shell32 + user32 + xcopy.c + rsrc.rc + + diff --git a/base/applications/control/control.rbuild b/base/applications/control/control.rbuild new file mode 100644 index 00000000000..2fe410ec9c7 --- /dev/null +++ b/base/applications/control/control.rbuild @@ -0,0 +1,9 @@ + + + + . + advapi32 + shell32 + control.c + control.rc + diff --git a/base/applications/dxdiag/dxdiag.rbuild b/base/applications/dxdiag/dxdiag.rbuild new file mode 100644 index 00000000000..1da09c53cdd --- /dev/null +++ b/base/applications/dxdiag/dxdiag.rbuild @@ -0,0 +1,35 @@ + + + + . + user32 + advapi32 + comctl32 + shell32 + version + dinput8 + setupapi + dxguid + dsound + ddraw + version + gdi32 + winmm + wintrust + d3d9 + system.c + display.c + sound.c + music.c + input.c + network.c + help.c + dxdiag.c + dxdiag.rc + ddtest.c + d3dtest.c + d3dtest7.c + d3dtest8.c + d3dtest9.c + precomp.h + diff --git a/base/applications/extrac32/extrac32.rbuild b/base/applications/extrac32/extrac32.rbuild new file mode 100644 index 00000000000..24532ddfd3d --- /dev/null +++ b/base/applications/extrac32/extrac32.rbuild @@ -0,0 +1,9 @@ + + . + wine + shell32 + setupapi + shlwapi + user32 + extrac32.c + diff --git a/base/applications/findstr/findstr.rbuild b/base/applications/findstr/findstr.rbuild new file mode 100644 index 00000000000..64306e39df8 --- /dev/null +++ b/base/applications/findstr/findstr.rbuild @@ -0,0 +1,8 @@ + + + + user32 + findstr.c + findstr.rc + rsrc.rc + diff --git a/base/applications/fontview/fontview.rbuild b/base/applications/fontview/fontview.rbuild new file mode 100644 index 00000000000..f5cad36f1a9 --- /dev/null +++ b/base/applications/fontview/fontview.rbuild @@ -0,0 +1,11 @@ + + + + . + gdi32 + user32 + shell32 + fontview.c + display.c + fontview.rc + diff --git a/base/applications/games/games.rbuild b/base/applications/games/games.rbuild new file mode 100644 index 00000000000..53c751369f3 --- /dev/null +++ b/base/applications/games/games.rbuild @@ -0,0 +1,13 @@ + + + + + + + + + + + + + \ No newline at end of file diff --git a/base/applications/games/solitaire/solitaire.rbuild b/base/applications/games/solitaire/solitaire.rbuild new file mode 100644 index 00000000000..b6e397e6111 --- /dev/null +++ b/base/applications/games/solitaire/solitaire.rbuild @@ -0,0 +1,11 @@ + + + + . + . + cardlib + solcreate.cpp + solgame.cpp + solitaire.cpp + rsrc.rc + diff --git a/base/applications/games/spider/spider.rbuild b/base/applications/games/spider/spider.rbuild new file mode 100644 index 00000000000..f675836fc37 --- /dev/null +++ b/base/applications/games/spider/spider.rbuild @@ -0,0 +1,10 @@ + + + + . + . + cardlib + spigame.cpp + spider.cpp + rsrc.rc + diff --git a/base/applications/games/winmine/winmine.rbuild b/base/applications/games/winmine/winmine.rbuild new file mode 100644 index 00000000000..97abb45666d --- /dev/null +++ b/base/applications/games/winmine/winmine.rbuild @@ -0,0 +1,13 @@ + + + + . + wine + gdi32 + user32 + advapi32 + shell32 + main.c + dialog.c + rsrc.rc + diff --git a/base/applications/hh/hh.rbuild b/base/applications/hh/hh.rbuild new file mode 100644 index 00000000000..c81f6680097 --- /dev/null +++ b/base/applications/hh/hh.rbuild @@ -0,0 +1,9 @@ + + + + . + user32 + gdi32 + main.c + hh.rc + diff --git a/base/applications/iexplore/iexplore.rbuild b/base/applications/iexplore/iexplore.rbuild new file mode 100644 index 00000000000..5fa8e6a0c14 --- /dev/null +++ b/base/applications/iexplore/iexplore.rbuild @@ -0,0 +1,10 @@ + + + + . + user32 + gdi32 + shdocvw + main.c + iexplore.rc + diff --git a/base/applications/kbswitch/kbsdll/kbsdll.rbuild b/base/applications/kbswitch/kbsdll/kbsdll.rbuild new file mode 100644 index 00000000000..f459343e6c3 --- /dev/null +++ b/base/applications/kbswitch/kbsdll/kbsdll.rbuild @@ -0,0 +1,10 @@ + + + + + . + user32 + comctl32 + kbsdll.c + kbsdll.rc + diff --git a/base/applications/kbswitch/kbswitch.rbuild b/base/applications/kbswitch/kbswitch.rbuild new file mode 100644 index 00000000000..11ea960adae --- /dev/null +++ b/base/applications/kbswitch/kbswitch.rbuild @@ -0,0 +1,16 @@ + + + + + . + advapi32 + user32 + shell32 + gdi32 + kbswitch.c + kbswitch.rc + + + + + diff --git a/base/applications/logoff/logoff.rbuild b/base/applications/logoff/logoff.rbuild new file mode 100644 index 00000000000..d53f79499e4 --- /dev/null +++ b/base/applications/logoff/logoff.rbuild @@ -0,0 +1,11 @@ + + + + . + advapi32 + user32 + misc.c + logoff.c + logoff.rc + precomp.h + diff --git a/base/applications/magnify/magnify.rbuild b/base/applications/magnify/magnify.rbuild new file mode 100644 index 00000000000..8c06ce8e5bf --- /dev/null +++ b/base/applications/magnify/magnify.rbuild @@ -0,0 +1,12 @@ + + + + . + user32 + gdi32 + advapi32 + shell32 + magnifier.c + settings.c + magnify.rc + diff --git a/base/applications/mmc/mmc.rbuild b/base/applications/mmc/mmc.rbuild new file mode 100644 index 00000000000..8976acd569e --- /dev/null +++ b/base/applications/mmc/mmc.rbuild @@ -0,0 +1,16 @@ + + + + . + user32 + gdi32 + comdlg32 + advapi32 + shell32 + comctl32 + console.c + misc.c + mmc.c + mmc.rc + precomp.h + diff --git a/base/applications/mplay32/mplay32.rbuild b/base/applications/mplay32/mplay32.rbuild new file mode 100644 index 00000000000..77003d90898 --- /dev/null +++ b/base/applications/mplay32/mplay32.rbuild @@ -0,0 +1,14 @@ + + + + . + advapi32 + comctl32 + comdlg32 + user32 + gdi32 + winmm + shell32 + mplay32.c + mplay32.rc + diff --git a/base/applications/msconfig/msconfig.rbuild b/base/applications/msconfig/msconfig.rbuild new file mode 100644 index 00000000000..958125f2d0f --- /dev/null +++ b/base/applications/msconfig/msconfig.rbuild @@ -0,0 +1,22 @@ + + + + . + user32 + advapi32 + version + comctl32 + shell32 + shlwapi + + toolspage.c + srvpage.c + systempage.c + startuppage.c + freeldrpage.c + generalpage.c + msconfig.c + + msconfig.rc + precomp.h + diff --git a/base/applications/mscutils/devmgmt/devmgmt.rbuild b/base/applications/mscutils/devmgmt/devmgmt.rbuild new file mode 100644 index 00000000000..a5f6844f06a --- /dev/null +++ b/base/applications/mscutils/devmgmt/devmgmt.rbuild @@ -0,0 +1,21 @@ + + + +. + ntdll + setupapi + gdi32 + user32 + comctl32 + advapi32 + devmgr + + about.c + devmgmt.c + enumdevices.c + mainwnd.c + misc.c + + devmgmt.rc + precomp.h + diff --git a/base/applications/mscutils/directory.rbuild b/base/applications/mscutils/directory.rbuild new file mode 100644 index 00000000000..454397af7cc --- /dev/null +++ b/base/applications/mscutils/directory.rbuild @@ -0,0 +1,13 @@ + + + + + + + + + + + + + diff --git a/base/applications/mscutils/eventvwr/eventvwr.rbuild b/base/applications/mscutils/eventvwr/eventvwr.rbuild new file mode 100644 index 00000000000..cb23e1f3eef --- /dev/null +++ b/base/applications/mscutils/eventvwr/eventvwr.rbuild @@ -0,0 +1,10 @@ + + + + . + user32 + comctl32 + advapi32 + eventvwr.c + eventvwr.rc + diff --git a/base/applications/mscutils/servman/servman.rbuild b/base/applications/mscutils/servman/servman.rbuild new file mode 100644 index 00000000000..1d4951f89c7 --- /dev/null +++ b/base/applications/mscutils/servman/servman.rbuild @@ -0,0 +1,35 @@ + + + + . + user32 + gdi32 + advapi32 + version + comctl32 + shell32 + comdlg32 + + about.c + control.c + create.c + delete.c + dependencies_tv1.c + dependencies_tv2.c + export.c + listview.c + mainwnd.c + misc.c + progress.c + propsheet.c + propsheet_depends.c + propsheet_general.c + query.c + servman.c + start.c + stop.c + stop_dependencies.c + + servman.rc + precomp.h + diff --git a/base/applications/mstsc/mstsc.rbuild b/base/applications/mstsc/mstsc.rbuild new file mode 100644 index 00000000000..c8ed8e3e571 --- /dev/null +++ b/base/applications/mstsc/mstsc.rbuild @@ -0,0 +1,36 @@ + + + + . + user32 + gdi32 + comctl32 + ws2_32 + advapi32 + shell32 + ole32 + comdlg32 + + bitmap.c + bsops.c + cache.c + channels.c + connectdialog.c + iso.c + licence.c + mcs.c + mppc.c + orders.c + pstcache.c + rdp5.c + rdp.c + secure.c + settings.c + ssl_calls.c + tcp.c + uimain.c + win32.c + + rdc.rc + precomp.h + diff --git a/base/applications/network/arp/arp.rbuild b/base/applications/network/arp/arp.rbuild new file mode 100644 index 00000000000..ed2e096b15d --- /dev/null +++ b/base/applications/network/arp/arp.rbuild @@ -0,0 +1,10 @@ + + + + . + iphlpapi + ws2_32 + shlwapi + arp.c + arp.rc + diff --git a/base/applications/network/dwnl/dwnl.rbuild b/base/applications/network/dwnl/dwnl.rbuild new file mode 100644 index 00000000000..36c30c0459c --- /dev/null +++ b/base/applications/network/dwnl/dwnl.rbuild @@ -0,0 +1,9 @@ + + + + . + urlmon + wininet + uuid + dwnl.c + diff --git a/base/applications/network/finger/finger.rbuild b/base/applications/network/finger/finger.rbuild new file mode 100644 index 00000000000..fd25abc54d0 --- /dev/null +++ b/base/applications/network/finger/finger.rbuild @@ -0,0 +1,12 @@ + + + + . + + ws2_32 + finger.c + err.c + getopt.c + net.c + finger.rc + diff --git a/base/applications/network/ftp/ftp.rbuild b/base/applications/network/ftp/ftp.rbuild new file mode 100644 index 00000000000..60f7ea5c659 --- /dev/null +++ b/base/applications/network/ftp/ftp.rbuild @@ -0,0 +1,29 @@ + + + + . + + + + _chdir + _getcwd + _mktemp + _unlink + _close + _fileno + _read + _write + _lseek + + ws2_32 + iphlpapi + oldnames + cmds.c + cmdtab.c + domacro.c + fake.c + ftp.c + main.c + ruserpass.c + ftp.rc + diff --git a/base/applications/network/ipconfig/ipconfig.rbuild b/base/applications/network/ipconfig/ipconfig.rbuild new file mode 100644 index 00000000000..454bd37f5c7 --- /dev/null +++ b/base/applications/network/ipconfig/ipconfig.rbuild @@ -0,0 +1,10 @@ + + + + . + user32 + iphlpapi + advapi32 + ipconfig.c + ipconfig.rc + diff --git a/base/applications/network/net/net.rbuild b/base/applications/network/net/net.rbuild new file mode 100644 index 00000000000..889e3a67571 --- /dev/null +++ b/base/applications/network/net/net.rbuild @@ -0,0 +1,12 @@ + + + + . + + ws2_32 + main.c + cmdstart.c + cmdStop.c + help.c + process.c + diff --git a/base/applications/network/netstat/netstat.rbuild b/base/applications/network/netstat/netstat.rbuild new file mode 100644 index 00000000000..b7d4c4c973c --- /dev/null +++ b/base/applications/network/netstat/netstat.rbuild @@ -0,0 +1,11 @@ + + + + . + user32 + ws2_32 + snmpapi + iphlpapi + netstat.c + netstat.rc + diff --git a/base/applications/network/network.rbuild b/base/applications/network/network.rbuild new file mode 100644 index 00000000000..61109ec8bd7 --- /dev/null +++ b/base/applications/network/network.rbuild @@ -0,0 +1,43 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/base/applications/network/nslookup/nslookup.rbuild b/base/applications/network/nslookup/nslookup.rbuild new file mode 100644 index 00000000000..e483d4ab5f3 --- /dev/null +++ b/base/applications/network/nslookup/nslookup.rbuild @@ -0,0 +1,12 @@ + + + + . + user32 + ws2_32 + snmpapi + iphlpapi + nslookup.c + utility.c + nslookup.rc + diff --git a/base/applications/network/ping/ping.rbuild b/base/applications/network/ping/ping.rbuild new file mode 100644 index 00000000000..72dacc18479 --- /dev/null +++ b/base/applications/network/ping/ping.rbuild @@ -0,0 +1,9 @@ + + + + . + + ws2_32 + ping.c + ping.rc + diff --git a/base/applications/network/route/route.rbuild b/base/applications/network/route/route.rbuild new file mode 100644 index 00000000000..eea7b8d76a3 --- /dev/null +++ b/base/applications/network/route/route.rbuild @@ -0,0 +1,9 @@ + + + + . + ws2_32 + iphlpapi + route.c + route.rc + diff --git a/base/applications/network/telnet/telnet.rbuild b/base/applications/network/telnet/telnet.rbuild new file mode 100644 index 00000000000..92e63337318 --- /dev/null +++ b/base/applications/network/telnet/telnet.rbuild @@ -0,0 +1,30 @@ + + + + . + ws2_32 + user32 + + + ansiprsr.cpp + keytrans.cpp + tcharmap.cpp + tconsole.cpp + tkeydef.cpp + tkeymap.cpp + tmapldr.cpp + tmouse.cpp + tnclass.cpp + tnclip.cpp + tncon.cpp + tnconfig.cpp + tnerror.cpp + tnetwork.cpp + tnmain.cpp + tnmisc.cpp + tscript.cpp + tscroll.cpp + ttelhndl.cpp + + telnet.rc + diff --git a/base/applications/network/tracert/tracert.rbuild b/base/applications/network/tracert/tracert.rbuild new file mode 100644 index 00000000000..f2f9a33b813 --- /dev/null +++ b/base/applications/network/tracert/tracert.rbuild @@ -0,0 +1,9 @@ + + + + . + + ws2_32 + tracert.c + tracert.rc + diff --git a/base/applications/network/whois/whois.rbuild b/base/applications/network/whois/whois.rbuild new file mode 100644 index 00000000000..f208aa2d97c --- /dev/null +++ b/base/applications/network/whois/whois.rbuild @@ -0,0 +1,8 @@ + + + + . + ws2_32 + whois.c + whois.rc + diff --git a/base/applications/notepad/notepad.rbuild b/base/applications/notepad/notepad.rbuild new file mode 100644 index 00000000000..8a89a7e8e76 --- /dev/null +++ b/base/applications/notepad/notepad.rbuild @@ -0,0 +1,17 @@ + + + + . + user32 + gdi32 + comdlg32 + comctl32 + advapi32 + shell32 + dialog.c + main.c + text.c + settings.c + rsrc.rc + notepad.h + diff --git a/base/applications/rapps/rapps.rbuild b/base/applications/rapps/rapps.rbuild new file mode 100644 index 00000000000..bc83f3aade9 --- /dev/null +++ b/base/applications/rapps/rapps.rbuild @@ -0,0 +1,41 @@ + + + + + include/reactos + . + . + + advapi32 + comctl32 + gdi32 + urlmon + user32 + uuid + shell32 + shlwapi + ntdll + + rappsmsg + + aboutdlg.c + available.c + installdlg.c + installed.c + listview.c + loaddlg.c + misc.c + parser.c + richedit.c + settingsdlg.c + splitter.c + statusbar.c + toolbar.c + treeview.c + winmain.c + rapps.rc + + + rappsmsg.mc + + diff --git a/base/applications/regedit/clb/clb.rbuild b/base/applications/regedit/clb/clb.rbuild new file mode 100644 index 00000000000..aad50816d78 --- /dev/null +++ b/base/applications/regedit/clb/clb.rbuild @@ -0,0 +1,13 @@ + + + + + . + ntdll + user32 + gdi32 + comctl32 + clb.c + clb.rc + precomp.h + diff --git a/base/applications/regedit/regedit.rbuild b/base/applications/regedit/regedit.rbuild new file mode 100644 index 00000000000..786ee44d6cf --- /dev/null +++ b/base/applications/regedit/regedit.rbuild @@ -0,0 +1,37 @@ + + + + + . + + + uuid + user32 + gdi32 + advapi32 + ole32 + shell32 + comctl32 + comdlg32 + shlwapi + uuid + about.c + childwnd.c + edit.c + find.c + framewnd.c + hexedit.c + listview.c + main.c + error.c + regedit.c + regproc.c + security.c + treeview.c + regedit.rc + regedit.h + + + + + diff --git a/base/applications/regedt32/regedt32.rbuild b/base/applications/regedt32/regedt32.rbuild new file mode 100644 index 00000000000..6b0b03773e9 --- /dev/null +++ b/base/applications/regedt32/regedt32.rbuild @@ -0,0 +1,9 @@ + + + + . + shell32 + shlwapi + regedt32.c + resource.rc + diff --git a/base/applications/sc/sc.rbuild b/base/applications/sc/sc.rbuild new file mode 100644 index 00000000000..4bef374d021 --- /dev/null +++ b/base/applications/sc/sc.rbuild @@ -0,0 +1,16 @@ + + + + + advapi32 + control.c + create.c + delete.c + print.c + query.c + sc.c + start.c + usage.c + sc.rc + sc.h + diff --git a/base/applications/screensavers/3dtext/3dtext.rbuild b/base/applications/screensavers/3dtext/3dtext.rbuild new file mode 100644 index 00000000000..1a1e115b763 --- /dev/null +++ b/base/applications/screensavers/3dtext/3dtext.rbuild @@ -0,0 +1,17 @@ + + + + scrnsave + chkstk + user32 + gdi32 + opengl32 + glu32 + advapi32 + + 3dtext.c + settings.c + rsrc.rc + + + diff --git a/base/applications/screensavers/logon/logon.rbuild b/base/applications/screensavers/logon/logon.rbuild new file mode 100644 index 00000000000..562c62de9b1 --- /dev/null +++ b/base/applications/screensavers/logon/logon.rbuild @@ -0,0 +1,13 @@ + + + + . + scrnsave + user32 + gdi32 + + + + logon.c + logon.rc + diff --git a/base/applications/screensavers/screensavers.rbuild b/base/applications/screensavers/screensavers.rbuild new file mode 100644 index 00000000000..ed3d070a2a3 --- /dev/null +++ b/base/applications/screensavers/screensavers.rbuild @@ -0,0 +1,10 @@ + + + + + + + + + + diff --git a/base/applications/shutdown/shutdown.rbuild b/base/applications/shutdown/shutdown.rbuild new file mode 100644 index 00000000000..6260c0055ab --- /dev/null +++ b/base/applications/shutdown/shutdown.rbuild @@ -0,0 +1,11 @@ + + + + . + advapi32 + user32 + misc.c + shutdown.c + shutdown.rc + precomp.h + diff --git a/base/applications/sndrec32/sndrec32.rbuild b/base/applications/sndrec32/sndrec32.rbuild new file mode 100644 index 00000000000..f101a14ba3a --- /dev/null +++ b/base/applications/sndrec32/sndrec32.rbuild @@ -0,0 +1,20 @@ + + + + . + winmm + user32 + msacm32 + comctl32 + comdlg32 + gdi32 + audio_format.cpp + audio_membuffer.cpp + audio_producer.cpp + audio_receiver.cpp + audio_resampler_acm.cpp + audio_wavein.cpp + audio_waveout.cpp + sndrec32.cpp + rsrc.rc + diff --git a/base/applications/sndvol32/sndvol32.rbuild b/base/applications/sndvol32/sndvol32.rbuild new file mode 100644 index 00000000000..38d5d9e0f5a --- /dev/null +++ b/base/applications/sndvol32/sndvol32.rbuild @@ -0,0 +1,19 @@ + + + + include/wine + . + ntdll + user32 + advapi32 + gdi32 + comctl32 + shell32 + winmm + sndvol32.h + dialog.c + misc.c + mixer.c + sndvol32.c + sndvol32.rc + diff --git a/base/applications/taskmgr/taskmgr.rbuild b/base/applications/taskmgr/taskmgr.rbuild new file mode 100644 index 00000000000..8db44813d26 --- /dev/null +++ b/base/applications/taskmgr/taskmgr.rbuild @@ -0,0 +1,33 @@ + + + + . + ntdll + advapi32 + user32 + gdi32 + shell32 + comctl32 + precomp.h + + about.c + affinity.c + applpage.c + column.c + dbgchnl.c + debug.c + endproc.c + graph.c + optnmenu.c + perfdata.c + perfpage.c + priority.c + procpage.c + proclist.c + run.c + trayicon.c + taskmgr.c + graphctl.c + + taskmgr.rc + diff --git a/base/applications/winhlp32/winhlp32.rbuild b/base/applications/winhlp32/winhlp32.rbuild new file mode 100644 index 00000000000..fd3234ec387 --- /dev/null +++ b/base/applications/winhlp32/winhlp32.rbuild @@ -0,0 +1,26 @@ + + + + . + include/reactos/wine + + + + + _fileno + _isatty + + wine + user32 + gdi32 + shell32 + comctl32 + comdlg32 + callback.c + hlpfile.c + macro.c + string.c + winhelp.c + lex.yy.c + rsrc.rc + diff --git a/base/applications/winver/winver.rbuild b/base/applications/winver/winver.rbuild new file mode 100644 index 00000000000..4f24a7166bd --- /dev/null +++ b/base/applications/winver/winver.rbuild @@ -0,0 +1,7 @@ + + + + . + shell32 + winver.c + diff --git a/base/applications/wordpad/wordpad.rbuild b/base/applications/wordpad/wordpad.rbuild new file mode 100644 index 00000000000..069fb119a0b --- /dev/null +++ b/base/applications/wordpad/wordpad.rbuild @@ -0,0 +1,21 @@ + + + + . + include/reactos/wine + + wine + comdlg32 + uuid + ole32 + shell32 + user32 + gdi32 + advapi32 + comctl32 + olecallback.c + print.c + registry.c + wordpad.c + rsrc.rc + diff --git a/base/applications/write/write.rbuild b/base/applications/write/write.rbuild new file mode 100644 index 00000000000..92f85eee3ef --- /dev/null +++ b/base/applications/write/write.rbuild @@ -0,0 +1,9 @@ + + + + . + user32 + gdi32 + write.c + rsrc.rc + diff --git a/base/base.rbuild b/base/base.rbuild new file mode 100644 index 00000000000..63cf67e1bd9 --- /dev/null +++ b/base/base.rbuild @@ -0,0 +1,19 @@ + + + + + + + + + + + + + + + + + + + diff --git a/base/services/audiosrv/audiosrv.rbuild b/base/services/audiosrv/audiosrv.rbuild new file mode 100644 index 00000000000..82a79207e56 --- /dev/null +++ b/base/services/audiosrv/audiosrv.rbuild @@ -0,0 +1,15 @@ + + + + . + advapi32 + user32 + setupapi + main.c + pnp_list_manager.c + pnp_list_lock.c + pnp.c + services.c + debug.c + audiosrv.rc + diff --git a/base/services/eventlog/eventlog.rbuild b/base/services/eventlog/eventlog.rbuild new file mode 100644 index 00000000000..eaea162f895 --- /dev/null +++ b/base/services/eventlog/eventlog.rbuild @@ -0,0 +1,18 @@ + + + + . + . + ntdll + advapi32 + eventlog_server + rpcrt4 + pseh + eventlog.c + eventsource.c + logport.c + eventlog.rc + rpc.c + file.c + eventlog.h + diff --git a/base/services/rpcss/rpcss.rbuild b/base/services/rpcss/rpcss.rbuild new file mode 100644 index 00000000000..95b29e83210 --- /dev/null +++ b/base/services/rpcss/rpcss.rbuild @@ -0,0 +1,27 @@ + + + + + . + . + wine + rpcss_epm_server + rpcss_irot_server + rpcrt4 + advapi32 + pseh + epmp.c + irotp.c + rpcss_main.c + service_main.c + epm.idl + irot.idl + rpcss.rc + + + epm.idl + + + irot.idl + + diff --git a/base/services/services.rbuild b/base/services/services.rbuild new file mode 100644 index 00000000000..5125d9b2f79 --- /dev/null +++ b/base/services/services.rbuild @@ -0,0 +1,34 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/base/services/spoolsv/spoolsv.rbuild b/base/services/spoolsv/spoolsv.rbuild new file mode 100644 index 00000000000..be3b2394295 --- /dev/null +++ b/base/services/spoolsv/spoolsv.rbuild @@ -0,0 +1,10 @@ + + + + . + wine + ntdll + advapi32 + spoolsv.c + spoolsv.rc + diff --git a/base/services/svchost/svchost.rbuild b/base/services/svchost/svchost.rbuild new file mode 100644 index 00000000000..3831d516fe1 --- /dev/null +++ b/base/services/svchost/svchost.rbuild @@ -0,0 +1,8 @@ + + + + . + advapi32 + svchost.c + svchost.rc + diff --git a/base/services/tcpsvcs/tcpsvcs.rbuild b/base/services/tcpsvcs/tcpsvcs.rbuild new file mode 100644 index 00000000000..f2b435f5aa9 --- /dev/null +++ b/base/services/tcpsvcs/tcpsvcs.rbuild @@ -0,0 +1,17 @@ + + + + . + ws2_32 + advapi32 + tcpsvcs.c + skelserver.c + echo.c + discard.c + daytime.c + qotd.c + chargen.c + tcpsvcs.rc + log.c + tcpsvcs.h + diff --git a/base/services/telnetd/telnetd.rbuild b/base/services/telnetd/telnetd.rbuild new file mode 100644 index 00000000000..1b17bfcb83f --- /dev/null +++ b/base/services/telnetd/telnetd.rbuild @@ -0,0 +1,15 @@ + + + + + .. + + ntdll + advapi32 + ws2_32 + wine + + telnetd.c + serviceentry.c + telnetd.rc + diff --git a/base/services/tftpd/tftpd.rbuild b/base/services/tftpd/tftpd.rbuild new file mode 100644 index 00000000000..0008cfb287e --- /dev/null +++ b/base/services/tftpd/tftpd.rbuild @@ -0,0 +1,11 @@ + + + + + .. + ntdll + advapi32 + ws2_32 + wine + tftpd.cpp + diff --git a/base/services/umpnpmgr/umpnpmgr.rbuild b/base/services/umpnpmgr/umpnpmgr.rbuild new file mode 100644 index 00000000000..9887e4eb65e --- /dev/null +++ b/base/services/umpnpmgr/umpnpmgr.rbuild @@ -0,0 +1,16 @@ + + + + . + . + 0x600 + pnp_server + ntdll + advapi32 + rpcrt4 + pseh + wdmguid + userenv + umpnpmgr.c + umpnpmgr.rc + diff --git a/base/services/wlansvc/wlansvc.rbuild b/base/services/wlansvc/wlansvc.rbuild new file mode 100644 index 00000000000..4f656380d58 --- /dev/null +++ b/base/services/wlansvc/wlansvc.rbuild @@ -0,0 +1,14 @@ + + + + . + . + wlansvc_server + ntdll + advapi32 + rpcrt4 + pseh + iphlpapi + wlansvc.c + rpcserver.c + diff --git a/base/setup/reactos/reactos.rbuild b/base/setup/reactos/reactos.rbuild new file mode 100644 index 00000000000..3eb79d0eb72 --- /dev/null +++ b/base/setup/reactos/reactos.rbuild @@ -0,0 +1,13 @@ + + + + + . + gdi32 + user32 + comctl32 + setupapi + uuid + reactos.c + reactos.rc + diff --git a/base/setup/setup.rbuild b/base/setup/setup.rbuild new file mode 100644 index 00000000000..f9b981b6b6b --- /dev/null +++ b/base/setup/setup.rbuild @@ -0,0 +1,19 @@ + + + + + + + + + + + + + + + + + + + diff --git a/base/setup/setup/setup.rbuild b/base/setup/setup/setup.rbuild new file mode 100644 index 00000000000..07e4118c79e --- /dev/null +++ b/base/setup/setup/setup.rbuild @@ -0,0 +1,8 @@ + + + + . + userenv + setup.c + setup.rc + diff --git a/base/setup/usetup/usetup.rbuild b/base/setup/usetup/usetup.rbuild new file mode 100644 index 00000000000..51f3c0386a0 --- /dev/null +++ b/base/setup/usetup/usetup.rbuild @@ -0,0 +1,44 @@ + + + + + . + . + . + include/reactos/drivers + zlib + newinflib + ext2lib + vfatlib + ntdll + + consup.c + devinst.c + usetup.c + + + + console.c + keytrans.c + + console.c + fslist.c + + bootsup.c + cabinet.c + chkdsk.c + drivesup.c + filequeue.c + filesup.c + format.c + fslist.c + genlist.c + inffile.c + inicache.c + partlist.c + progress.c + registry.c + settings.c + usetup.rc + mui.c + diff --git a/base/setup/vmwinst/vmwinst.rbuild b/base/setup/vmwinst/vmwinst.rbuild new file mode 100644 index 00000000000..ce056c35d94 --- /dev/null +++ b/base/setup/vmwinst/vmwinst.rbuild @@ -0,0 +1,16 @@ + + + + . + advapi32 + comctl32 + comdlg32 + newdev + user32 + setupapi + shell32 + ntdll + pseh + vmwinst.c + vmwinst.rc + diff --git a/base/setup/welcome/welcome.rbuild b/base/setup/welcome/welcome.rbuild new file mode 100644 index 00000000000..910d78bb7a7 --- /dev/null +++ b/base/setup/welcome/welcome.rbuild @@ -0,0 +1,10 @@ + + + + + . + gdi32 + user32 + welcome.c + welcome.rc + diff --git a/base/shell/cmd/cmd.rbuild b/base/shell/cmd/cmd.rbuild new file mode 100644 index 00000000000..78e1a3b340c --- /dev/null +++ b/base/shell/cmd/cmd.rbuild @@ -0,0 +1,77 @@ + + + + + include/reactos/wine + . + + + wine + advapi32 + user32 + cmd.rc + main.c + precomp.h + + alias.c + assoc.c + attrib.c + batch.c + beep.c + call.c + chcp.c + choice.c + cls.c + cmd.c + cmddbg.c + cmdinput.c + cmdtable.c + color.c + console.c + copy.c + date.c + del.c + delay.c + dir.c + dirstack.c + echo.c + error.c + filecomp.c + for.c + free.c + goto.c + history.c + if.c + internal.c + label.c + locale.c + memory.c + misc.c + mklink.c + move.c + msgbox.c + parser.c + path.c + pause.c + prompt.c + redir.c + ren.c + replace.c + screen.c + set.c + setlocal.c + shift.c + start.c + strtoclr.c + time.c + timer.c + title.c + type.c + ver.c + verify.c + vol.c + where.c + window.c + + + diff --git a/base/shell/explorer-new/explorer.rbuild b/base/shell/explorer-new/explorer.rbuild new file mode 100644 index 00000000000..0ded92135c0 --- /dev/null +++ b/base/shell/explorer-new/explorer.rbuild @@ -0,0 +1,28 @@ + + + + . + + advapi32 + gdi32 + user32 + comctl32 + ole32 + oleaut32 + shell32 + shlwapi + uuid + version + precomp.h + desktop.c + dragdrop.c + explorer.c + startmnu.c + taskband.c + taskswnd.c + tbsite.c + trayntfy.c + trayprop.c + traywnd.c + explorer.rc + diff --git a/base/shell/explorer/explorer.rbuild b/base/shell/explorer/explorer.rbuild new file mode 100644 index 00000000000..7d64e7f42c3 --- /dev/null +++ b/base/shell/explorer/explorer.rbuild @@ -0,0 +1,71 @@ + + + + + . + + + advapi32 + gdi32 + user32 + ws2_32 + msimg32 + comctl32 + ole32 + oleaut32 + shell32 + uuid + notifyhook + precomp.h + + desktop.cpp + + + searchprogram.cpp + settings.cpp + + + entries.cpp + fatfs.cpp + filechild.cpp + shellfs.cpp + mainframe.cpp + ntobjfs.cpp + pane.cpp + regfs.cpp + shellbrowser.cpp + unixfs.cpp + webchild.cpp + winfs.cpp + + + shellservices.cpp + startup.c + + + desktopbar.cpp + favorites.cpp + taskbar.cpp + startmenu.cpp + traynotify.cpp + quicklaunch.cpp + + + shellclasses.cpp + utility.cpp + window.cpp + dragdropimpl.cpp + shellbrowserimpl.cpp + xmlstorage.cpp + xs-native.cpp + + explorer.cpp + i386-stub-win32.c + explorer.rc + --enable-stdcall-fixup + +explorer-cfg-template.xml + + + + diff --git a/base/shell/explorer/notifyhook/notifyhook.def b/base/shell/explorer/notifyhook/notifyhook.def new file mode 100644 index 00000000000..47ddf67e5c9 --- /dev/null +++ b/base/shell/explorer/notifyhook/notifyhook.def @@ -0,0 +1,6 @@ +LIBRARY notifyhook.dll +EXPORTS +DeinstallNotifyHook +GetWindowModulePath +GetWindowModulePathCopyData +InstallNotifyHook diff --git a/base/shell/explorer/notifyhook/notifyhook.rbuild b/base/shell/explorer/notifyhook/notifyhook.rbuild new file mode 100644 index 00000000000..909cd62433e --- /dev/null +++ b/base/shell/explorer/notifyhook/notifyhook.rbuild @@ -0,0 +1,10 @@ + + + + + . + + user32 + notifyhook.c + notifyhook.rc + diff --git a/base/shell/shell.rbuild b/base/shell/shell.rbuild new file mode 100644 index 00000000000..efdd8f323e7 --- /dev/null +++ b/base/shell/shell.rbuild @@ -0,0 +1,13 @@ + + + + + + + + + + + + + diff --git a/base/system/autochk/autochk.rbuild b/base/system/autochk/autochk.rbuild new file mode 100644 index 00000000000..f2464aefbd7 --- /dev/null +++ b/base/system/autochk/autochk.rbuild @@ -0,0 +1,9 @@ + + + + . + nt + ntdll + autochk.c + autochk.rc + diff --git a/base/system/bootok/bootok.rbuild b/base/system/bootok/bootok.rbuild new file mode 100644 index 00000000000..341adcaff23 --- /dev/null +++ b/base/system/bootok/bootok.rbuild @@ -0,0 +1,8 @@ + + + + . + advapi32 + bootok.c + bootok.rc + diff --git a/base/system/expand/expand.rbuild b/base/system/expand/expand.rbuild new file mode 100644 index 00000000000..6e67355660f --- /dev/null +++ b/base/system/expand/expand.rbuild @@ -0,0 +1,11 @@ + + + + include/reactos/wine + . + lz32 + setupapi + user32 + expand.c + expand.rc + diff --git a/base/system/format/format.rbuild b/base/system/format/format.rbuild new file mode 100644 index 00000000000..5f29105a247 --- /dev/null +++ b/base/system/format/format.rbuild @@ -0,0 +1,10 @@ + + + + . + ntdll + user32 + fmifs + format.rc + format.c + diff --git a/base/system/lsass/lsass.rbuild b/base/system/lsass/lsass.rbuild new file mode 100644 index 00000000000..119e149d97c --- /dev/null +++ b/base/system/lsass/lsass.rbuild @@ -0,0 +1,11 @@ + + + + . + include/reactos/subsys + advapi32 + ntdll + lsasrv + lsass.c + lsass.rc + diff --git a/base/system/msiexec/msiexec.rbuild b/base/system/msiexec/msiexec.rbuild new file mode 100644 index 00000000000..228875d72c7 --- /dev/null +++ b/base/system/msiexec/msiexec.rbuild @@ -0,0 +1,17 @@ + + + + . + include/wine + + uuid + wine + ntdll + user32 + advapi32 + ole32 + msi + msiexec.c + service.c + rsrc.rc + diff --git a/base/system/regsvr32/regsvr32.rbuild b/base/system/regsvr32/regsvr32.rbuild new file mode 100644 index 00000000000..cb39613dd65 --- /dev/null +++ b/base/system/regsvr32/regsvr32.rbuild @@ -0,0 +1,10 @@ + + + + . + user32 + shell32 + ole32 + regsvr32.c + regsvr32.rc + diff --git a/base/system/rundll32/rundll32.rbuild b/base/system/rundll32/rundll32.rbuild new file mode 100644 index 00000000000..bb9241629a6 --- /dev/null +++ b/base/system/rundll32/rundll32.rbuild @@ -0,0 +1,8 @@ + + + + . + user32 + rundll32.c + rundll32.rc + diff --git a/base/system/runonce/runonce.rbuild b/base/system/runonce/runonce.rbuild new file mode 100644 index 00000000000..9dba7660b1c --- /dev/null +++ b/base/system/runonce/runonce.rbuild @@ -0,0 +1,9 @@ + + + + . + advapi32 + user32 + runonce.c + runonce.rc + diff --git a/base/system/services/services.rbuild b/base/system/services/services.rbuild new file mode 100644 index 00000000000..d363b2691b3 --- /dev/null +++ b/base/system/services/services.rbuild @@ -0,0 +1,21 @@ + + + + . + . + include/reactos/subsys + scm_server + ntdll + user32 + advapi32 + rpcrt4 + pseh + config.c + database.c + driver.c + groupdb.c + rpcserver.c + services.c + services.rc + services.h + diff --git a/base/system/smss/smss.rbuild b/base/system/smss/smss.rbuild new file mode 100644 index 00000000000..e305e15f12d --- /dev/null +++ b/base/system/smss/smss.rbuild @@ -0,0 +1,32 @@ + + + + . + include/reactos/subsys + nt + smlib + ntdll + smss.h + + client.c + debug.c + init.c + initdosdev.c + initenv.c + initheap.c + initmv.c + initobdir.c + initpage.c + initreg.c + initrun.c + initss.c + initwkdll.c + print.c + smapi.c + smapicomp.c + smapiexec.c + smapiquery.c + smss.c + + smss.rc + diff --git a/base/system/system.rbuild b/base/system/system.rbuild new file mode 100644 index 00000000000..7e7d348a6b0 --- /dev/null +++ b/base/system/system.rbuild @@ -0,0 +1,46 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/base/system/userinit/userinit.rbuild b/base/system/userinit/userinit.rbuild new file mode 100644 index 00000000000..753a8e4b666 --- /dev/null +++ b/base/system/userinit/userinit.rbuild @@ -0,0 +1,14 @@ + + + + . + wine + ntdll + user32 + gdi32 + advapi32 + shell32 + shlwapi + userinit.c + userinit.rc + diff --git a/base/system/winlogon/winlogon.rbuild b/base/system/winlogon/winlogon.rbuild new file mode 100644 index 00000000000..cc5b2a33ddc --- /dev/null +++ b/base/system/winlogon/winlogon.rbuild @@ -0,0 +1,19 @@ + + + + . + wine + ntdll + user32 + advapi32 + userenv + secur32 + environment.c + sas.c + screensaver.c + setup.c + winlogon.c + wlx.c + winlogon.rc + winlogon.h + diff --git a/baseaddress.rbuild b/baseaddress.rbuild new file mode 100644 index 00000000000..aa0f140acc3 --- /dev/null +++ b/baseaddress.rbuild @@ -0,0 +1,266 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/boot/armllb/armllb.rbuild b/boot/armllb/armllb.rbuild new file mode 100644 index 00000000000..4c4c0d9f9e3 --- /dev/null +++ b/boot/armllb/armllb.rbuild @@ -0,0 +1,80 @@ + + + + + + libcntpr + rtl + ./inc + + + + + -Wl,--image-base=0x401FEFF8 + + + + + + + --image-base=0x80FFF000 + + + + + + -Wl,--image-base=0xF000 + + + boot.s + main.c + crtsupp.c + envir.c + fw.c + + keyboard.c + matrix.c + serial.c + time.c + video.c + + + hwinfo.c + hwinit.c + hwlcd.c + hwsynkp.c + hwtwl40x.c + hwuart.c + + + + + hwuart.c + hwinfo.c + hwinit.c + + + + + hwclcd.c + hwkmi.c + hwuart.c + hwinfo.c + hwinit.c + + + + + loader.c + + + -fms-extensions + -ffreestanding + -fno-builtin + -fno-inline + -fno-zero-initialized-in-bss + -Os + + + + diff --git a/boot/boot.rbuild b/boot/boot.rbuild new file mode 100644 index 00000000000..ff2421c0b8a --- /dev/null +++ b/boot/boot.rbuild @@ -0,0 +1,15 @@ + + + + + + + + + + + + + + + diff --git a/boot/bootdata/bootcd/bootcd.rbuild b/boot/bootdata/bootcd/bootcd.rbuild new file mode 100644 index 00000000000..4896a937edb --- /dev/null +++ b/boot/bootdata/bootcd/bootcd.rbuild @@ -0,0 +1,15 @@ + + + + + + isoboot + + + + + + isoboot + + + diff --git a/boot/bootdata/bootcdregtest/bootcdregtest.rbuild b/boot/bootdata/bootcdregtest/bootcdregtest.rbuild new file mode 100644 index 00000000000..f3b85391618 --- /dev/null +++ b/boot/bootdata/bootcdregtest/bootcdregtest.rbuild @@ -0,0 +1,6 @@ + + + + isobtrt + unattend.inf + diff --git a/boot/bootdata/bootdata.rbuild b/boot/bootdata/bootdata.rbuild new file mode 100644 index 00000000000..205bcefc192 --- /dev/null +++ b/boot/bootdata/bootdata.rbuild @@ -0,0 +1,28 @@ + + + + autorun.inf + icon.ico + readme.txt + bootcd.ini + + hivecls_$(ARCH).inf + hivedef_$(ARCH).inf + hivesft_$(ARCH).inf + hivesys_$(ARCH).inf + txtsetup.sif + unattend.inf + + + + + + + + + + + + + + diff --git a/boot/bootdata/livecd/livecd.rbuild b/boot/bootdata/livecd/livecd.rbuild new file mode 100644 index 00000000000..8a04d1289bc --- /dev/null +++ b/boot/bootdata/livecd/livecd.rbuild @@ -0,0 +1,14 @@ + + + + + + isoboot + + + + + isoboot + + + diff --git a/boot/bootdata/livecdregtest/livecdregtest.rbuild b/boot/bootdata/livecdregtest/livecdregtest.rbuild new file mode 100644 index 00000000000..52836fabe65 --- /dev/null +++ b/boot/bootdata/livecdregtest/livecdregtest.rbuild @@ -0,0 +1,5 @@ + + + + isobtrt + \ No newline at end of file diff --git a/boot/bootdata/packages/reactos.dff b/boot/bootdata/packages/reactos.dff new file mode 100644 index 00000000000..917366595af --- /dev/null +++ b/boot/bootdata/packages/reactos.dff @@ -0,0 +1,876 @@ +; Main ReactOS package + +.Set DiskLabelTemplate="ReactOS" ; Label of disk +.Set CabinetNameTemplate="reactos.cab" ; reactos.cab +.Set InfFileName="reactos.inf" ; reactos.inf + + +;.Set Cabinet=on +;.Set Compress=on + +.InfBegin +[Version] +Signature = "$ReactOS$" + +[Directories] +1 = system32 +2 = system32\drivers +3 = Fonts +4 = +5 = system32\drivers\etc +6 = inf +7 = bin +8 = media + +.InfEnd + +; Contents of disk +.InfBegin +[SourceFiles] +.InfEnd + + +; Base files +base\applications\cacls\cacls.exe 1 +base\applications\calc\calc.exe 1 +base\applications\charmap\charmap.exe 1 +base\applications\cmdutils\dbgprint\dbgprint.exe 1 +base\applications\cmdutils\doskey\doskey.exe 1 +base\applications\cmdutils\find\find.exe 1 +base\applications\cmdutils\hostname\hostname.exe 1 +base\applications\cmdutils\lodctr\lodctr.exe 1 +base\applications\cmdutils\more\more.exe 1 +base\applications\cmdutils\reg\reg.exe 1 +base\applications\cmdutils\xcopy\xcopy.exe 1 +base\applications\control\control.exe 1 +base\applications\dxdiag\dxdiag.exe 1 +base\applications\extrac32\extrac32.exe 1 +base\applications\findstr\findstr.exe 1 +base\applications\fontview\fontview.exe 1 +base\applications\iexplore\iexplore.exe 1 +base\applications\games\solitaire\sol.exe 1 +base\applications\games\spider\spider.exe 1 +base\applications\games\winmine\winmine.exe 1 +base\applications\hh\hh.exe 4 +base\applications\kbswitch\kbswitch.exe 1 +base\applications\kbswitch\kbsdll\kbsdll.dll 1 +base\applications\logoff\logoff.exe 1 +base\applications\magnify\magnify.exe 1 +base\applications\mplay32\mplay32.exe 1 +base\applications\msconfig\msconfig.exe 1 +base\applications\mscutils\devmgmt\devmgmt.exe 1 +base\applications\mscutils\eventvwr\eventvwr.exe 1 +base\applications\mscutils\servman\servman.exe 1 +base\applications\mspaint\mspaint.exe 1 +base\applications\mstsc\mstsc.exe 1 +base\applications\network\arp\arp.exe 1 +base\applications\network\dwnl\dwnl.exe 1 +base\applications\network\finger\finger.exe 1 +base\applications\network\ftp\ftp.exe 1 +base\applications\network\ipconfig\ipconfig.exe 1 +base\applications\network\net\net.exe 1 +base\applications\network\netstat\netstat.exe 1 +base\applications\network\nslookup\nslookup.exe 1 +base\applications\network\ping\ping.exe 1 +base\applications\network\route\route.exe 1 +base\applications\network\telnet\telnet.exe 1 +base\applications\network\tracert\tracert.exe 1 +base\applications\network\whois\whois.exe 1 +base\applications\notepad\notepad.exe 1 +base\applications\rapps\rapps.exe 1 +base\applications\regedit\regedit.exe 4 +base\applications\regedit\clb\clb.dll 1 +base\applications\regedt32\regedt32.exe 1 +base\applications\sc\sc.exe 1 +base\applications\screensavers\3dtext\3dtext.scr 1 +base\applications\screensavers\logon\logon.scr 1 +base\applications\shutdown\shutdown.exe 1 +base\applications\sndrec32\sndrec32.exe 1 +base\applications\sndvol32\sndvol32.exe 1 +base\applications\taskmgr\taskmgr.exe 1 +base\applications\winhlp32\winhlp32.exe 4 +base\applications\winver\winver.exe 1 +base\applications\wordpad\wordpad.exe 1 +base\applications\write\write.exe 1 + +base\services\audiosrv\audiosrv.exe 1 +base\services\eventlog\eventlog.exe 1 +base\services\rpcss\rpcss.exe 1 +base\services\spoolsv\spoolsv.exe 1 +base\services\svchost\svchost.exe 1 +base\services\tcpsvcs\tcpsvcs.exe 1 +base\services\tcpsvcs\quotes 5 +base\services\telnetd\telnetd.exe 1 +base\services\umpnpmgr\umpnpmgr.exe 1 +base\services\wlansvc\wlansvc.exe 1 + +base\setup\setup\setup.exe 1 +base\setup\vmwinst\vmwinst.exe 1 + +base\shell\cmd\cmd.exe 1 +base\shell\explorer\explorer.exe 4 optional +base\shell\explorer\explorer-cfg-template.xml 4 optional +base\shell\explorer\notifyhook\notifyhook.dll 1 optional +base\shell\explorer-new\explorer_new.exe 4 optional + +base\system\autochk\autochk.exe 1 +base\system\bootok\bootok.exe 1 +base\system\expand\expand.exe 1 +base\system\subst\subst.exe 1 +base\system\format\format.exe 1 +base\system\lsass\lsass.exe 1 +base\system\msiexec\msiexec.exe 1 +base\system\regsvr32\regsvr32.exe 1 +base\system\rundll32\rundll32.exe 1 +base\system\runonce\runonce.exe 1 +base\system\services\services.exe 1 +base\system\smss\smss.exe 1 +base\system\userinit\userinit.exe 1 +base\system\winlogon\winlogon.exe 1 + +; Dynamic Link Libraries +dll\3rdparty\dxtn\dxtn.dll 1 optional +dll\3rdparty\libjpeg\libjpeg.dll 1 +dll\3rdparty\libpng\libpng.dll 1 +dll\3rdparty\libtiff\libtiff.dll 1 +dll\3rdparty\libxslt\libxslt.dll 1 +dll\3rdparty\mesa32\mesa32.dll 1 + +dll\cpl\access\access.cpl 1 +dll\cpl\appwiz\appwiz.cpl 1 +dll\cpl\console\console.dll 1 +dll\cpl\desk\desk.cpl 1 +dll\cpl\hdwwiz\hdwwiz.cpl 1 +dll\cpl\input\input.dll 1 +dll\cpl\inetcpl\inetcpl.cpl 1 +dll\cpl\intl\intl.cpl 1 +dll\cpl\joy\joy.cpl 1 +;dll\cpl\liccpa\liccpa.cpl 1 +dll\cpl\main\main.cpl 1 +dll\cpl\mmsys\mmsys.cpl 1 +dll\cpl\ncpa\ncpa.cpl 1 +;dll\cpl\odbccp32\odbccp32.cpl 1 +dll\cpl\powercfg\powercfg.cpl 1 +dll\cpl\sysdm\sysdm.cpl 1 +;dll\cpl\telephon\telephon.cpl 1 +dll\cpl\timedate\timedate.cpl 1 +;dll\cpl\usrmgr\usrmgr.cpl 1 + +dll\directx\amstream\amstream.dll 1 +;dll\directx\bdaplgin\bdaplgin.ax 1 +dll\directx\d3d8thk\d3d8thk.dll 1 +dll\directx\devenum\devenum.dll 1 +dll\directx\dinput\dinput.dll 1 +dll\directx\dinput8\dinput8.dll 1 +dll\directx\dmusic\dmusic.dll 1 +dll\directx\dplay\dplay.dll 1 +dll\directx\dplayx\dplayx.dll 1 +dll\directx\dsound\dsound.dll 1 +dll\directx\dxdiagn\dxdiagn.dll 1 +dll\directx\ksproxy\ksproxy.ax 1 +dll\directx\ksuser\ksuser.dll 1 +dll\directx\msdmo\msdmo.dll 1 +;dll\directx\msdvbnp\msdvbnp.ax 1 +;dll\directx\msvidctl\msvidctl.dll 1 +dll\directx\qedit\qedit.dll 1 +dll\directx\quartz\quartz.dll 1 +dll\directx\wine\ddraw\ddraw.dll 1 +dll\directx\wine\d3d8\d3d8.dll 1 +dll\directx\wine\d3d9\d3d9.dll 1 +dll\directx\wine\wined3d\wined3d.dll 1 + +dll\keyboard\kbda1\kbda1.dll 1 +dll\keyboard\kbda2\kbda2.dll 1 +dll\keyboard\kbda3\kbda3.dll 1 +dll\keyboard\kbdal\kbdal.dll 1 +dll\keyboard\kbdarme\kbdarme.dll 1 +dll\keyboard\kbdarmw\kbdarmw.dll 1 +dll\keyboard\kbdaze\kbdaze.dll 1 +dll\keyboard\kbdazel\kbdazel.dll 1 +dll\keyboard\kbdbe\kbdbe.dll 1 +dll\keyboard\kbdbga\kbdbga.dll 1 +dll\keyboard\kbdbgm\kbdbgm.dll 1 +dll\keyboard\kbdbgt\kbdbgt.dll 1 +dll\keyboard\kbdblr\kbdblr.dll 1 +dll\keyboard\kbdbr\kbdbr.dll 1 +dll\keyboard\kbdbur\kbdbur.dll 1 +dll\keyboard\kbdcan\kbdcan.dll 1 +dll\keyboard\kbdcr\kbdcr.dll 1 +dll\keyboard\kbdcz\kbdcz.dll 1 +dll\keyboard\kbdcz1\kbdcz1.dll 1 +dll\keyboard\kbdda\kbdda.dll 1 +dll\keyboard\kbddv\kbddv.dll 1 +dll\keyboard\kbdes\kbdes.dll 1 +dll\keyboard\kbdest\kbdest.dll 1 +dll\keyboard\kbdfc\kbdfc.dll 1 +dll\keyboard\kbdfi\kbdfi.dll 1 +dll\keyboard\kbdfr\kbdfr.dll 1 +dll\keyboard\kbdgeo\kbdgeo.dll 1 +dll\keyboard\kbdgerg\kbdgerg.dll 1 +dll\keyboard\kbdgneo\kbdgneo.dll 1 +dll\keyboard\kbdgr\kbdgr.dll 1 +dll\keyboard\kbdgrist\kbdgrist.dll 1 +dll\keyboard\kbdhe\kbdhe.dll 1 +dll\keyboard\kbdheb\kbdheb.dll 1 +dll\keyboard\kbdhu\kbdhu.dll 1 +dll\keyboard\kbdic\kbdic.dll 1 +dll\keyboard\kbdinasa\kbdinasa.dll 1 +dll\keyboard\kbdinben\kbdinben.dll 1 +dll\keyboard\kbdindev\kbdindev.dll 1 +dll\keyboard\kbdinguj\kbdinguj.dll 1 +dll\keyboard\kbdinmal\kbdinmal.dll 1 +dll\keyboard\kbdir\kbdir.dll 1 +dll\keyboard\kbdit\kbdit.dll 1 +dll\keyboard\kbdja\kbdja.dll 1 +dll\keyboard\kbdkaz\kbdkaz.dll 1 +dll\keyboard\kbdko\kbdko.dll 1 +dll\keyboard\kbdla\kbdla.dll 1 +dll\keyboard\kbdlt1\kbdlt1.dll 1 +dll\keyboard\kbdlv\kbdlv.dll 1 +dll\keyboard\kbdmac\kbdmac.dll 1 +dll\keyboard\kbdne\kbdne.dll 1 +dll\keyboard\kbdno\kbdno.dll 1 +dll\keyboard\kbdpl1\kbdpl1.dll 1 +dll\keyboard\kbdpo\kbdpo.dll 1 +dll\keyboard\kbdro\kbdro.dll 1 +dll\keyboard\kbdru\kbdru.dll 1 +dll\keyboard\kbdru1\kbdru1.dll 1 +dll\keyboard\kbdsg\kbdsg.dll 1 +dll\keyboard\kbdsk\kbdsk.dll 1 +dll\keyboard\kbdsk1\kbdsk1.dll 1 +dll\keyboard\kbdsw\kbdsw.dll 1 +dll\keyboard\kbdtat\kbdtat.dll 1 +dll\keyboard\kbdth0\kbdth0.dll 1 +dll\keyboard\kbdth1\kbdth1.dll 1 +dll\keyboard\kbdth2\kbdth2.dll 1 +dll\keyboard\kbdth3\kbdth3.dll 1 +dll\keyboard\kbdtuf\kbdtuf.dll 1 +dll\keyboard\kbdtuq\kbdtuq.dll 1 +dll\keyboard\kbduk\kbduk.dll 1 +dll\keyboard\kbdur\kbdur.dll 1 +dll\keyboard\kbdurs\kbdurs.dll 1 +dll\keyboard\kbdus\kbdus.dll 1 +dll\keyboard\kbdusa\kbdusa.dll 1 +dll\keyboard\kbdusl\kbdusl.dll 1 +dll\keyboard\kbdusr\kbdusr.dll 1 +dll\keyboard\kbdusx\kbdusx.dll 1 +dll\keyboard\kbduzb\kbduzb.dll 1 +dll\keyboard\kbdvntc\kbdvntc.dll 1 +dll\keyboard\kbdycc\kbdycc.dll 1 +dll\keyboard\kbdycl\kbdycl.dll 1 + +dll\ntdll\ntdll.dll 1 + +dll\win32\acledit\acledit.dll 1 +dll\win32\aclui\aclui.dll 1 +dll\win32\activeds\activeds.dll 1 +dll\win32\actxprxy\actxprxy.dll 1 +dll\win32\advapi32\advapi32.dll 1 +dll\win32\advpack\advpack.dll 1 +dll\win32\atl\atl.dll 1 +dll\win32\authz\authz.dll 1 +dll\win32\avicap32\avicap32.dll 1 +dll\win32\avifil32\avifil32.dll 1 +dll\win32\batt\batt.dll 1 +dll\win32\bcrypt\bcrypt.dll 1 +dll\win32\beepmidi\beepmidi.dll 1 +dll\win32\browseui\browseui.dll 1 +dll\win32\cabinet\cabinet.dll 1 +dll\win32\cards\cards.dll 1 +dll\win32\cfgmgr32\cfgmgr32.dll 1 +dll\win32\clusapi\clusapi.dll 1 +dll\win32\comcat\comcat.dll 1 +dll\win32\comctl32\comctl32.dll 1 +dll\win32\comdlg32\comdlg32.dll 1 +dll\win32\compstui\compstui.dll 1 +dll\win32\credui\credui.dll 1 +dll\win32\crtdll\crtdll.dll 1 +dll\win32\crypt32\crypt32.dll 1 +dll\win32\cryptdlg\cryptdlg.dll 1 +dll\win32\cryptdll\cryptdll.dll 1 +dll\win32\cryptnet\cryptnet.dll 1 +dll\win32\cryptui\cryptui.dll 1 +dll\win32\dbghelp\dbghelp.dll 1 +dll\win32\dciman32\dciman32.dll 1 +dll\win32\devmgr\devmgr.dll 1 +dll\win32\dhcpcsvc\dhcpcsvc.dll 1 +dll\win32\dnsapi\dnsapi.dll 1 +dll\win32\dwmapi\dwmapi.dll 1 +dll\win32\faultrep\faultrep.dll 1 +dll\win32\fmifs\fmifs.dll 1 +dll\win32\fusion\fusion.dll 1 +dll\win32\gdi32\gdi32.dll 1 +dll\win32\gdiplus\gdiplus.dll 1 +dll\win32\getuname\getuname.dll 1 +dll\win32\glu32\glu32.dll 1 +dll\win32\hhctrl.ocx\hhctrl.ocx 1 +dll\win32\hid\hid.dll 1 +dll\win32\hlink\hlink.dll 1 +dll\win32\hnetcfg\hnetcfg.dll 1 +dll\win32\httpapi\httpapi.dll 1 +dll\win32\iccvid\iccvid.dll 1 +dll\win32\icmp\icmp.dll 1 +dll\win32\imaadp32.acm\imaadp32.acm 1 +dll\win32\imagehlp\imagehlp.dll 1 +dll\win32\imm32\imm32.dll 1 +dll\win32\inetcomm\inetcomm.dll 1 +dll\win32\inetmib1\inetmib1.dll 1 +dll\win32\initpki\initpki.dll 1 +dll\win32\inseng\inseng.dll 1 +dll\win32\iphlpapi\iphlpapi.dll 1 +dll\win32\itircl\itircl.dll 1 +dll\win32\itss\itss.dll 1 +dll\win32\jscript\jscript.dll 1 +dll\win32\kernel32\kernel32.dll 1 +dll\win32\loadperf\loadperf.dll 1 +dll\win32\localspl\localspl.dll 1 +dll\win32\localui\localui.dll 1 +dll\win32\lpk\lpk.dll 1 +dll\win32\lsasrv\lsasrv.dll 1 +dll\win32\lz32\lz32.dll 1 +dll\win32\mapi32\mapi32.dll 1 +dll\win32\mciavi32\mciavi32.dll 1 +dll\win32\mcicda\mcicda.dll 1 +dll\win32\mciqtz32\mciqtz32.dll 1 +dll\win32\mciseq\mciseq.dll 1 +dll\win32\mciwave\mciwave.dll 1 +dll\win32\mlang\mlang.dll 1 +dll\win32\mmdrv\mmdrv.dll 1 +dll\win32\modemui\modemui.dll 1 +dll\win32\mpr\mpr.dll 1 +dll\win32\mprapi\mprapi.dll 1 +dll\win32\msacm32\msacm32.dll 1 +dll\win32\msacm32\msacm32.drv\msacm32.drv 1 +dll\win32\msadp32.acm\msadp32.acm 1 +dll\win32\msafd\msafd.dll 1 +dll\win32\mscat32\mscat32.dll 1 +dll\win32\mscms\mscms.dll 1 +dll\win32\mscoree\mscoree.dll 1 +dll\win32\msctf\msctf.dll 1 +dll\win32\msftedit\msftedit.dll 1 +dll\win32\msg711.acm\msg711.acm 1 +dll\win32\msgina\msgina.dll 1 +dll\win32\msgsm32.acm\msgsm32.acm 1 +dll\win32\mshtml\mshtml.dll 1 +dll\win32\mshtml.tlb\mshtml.tlb 1 +dll\win32\msi\msi.dll 1 +dll\win32\msimg32\msimg32.dll 1 +dll\win32\msimtf\msimtf.dll 1 +dll\win32\msisip\msisip.dll 1 +dll\win32\msisys.ocx\msisys.ocx 1 +dll\win32\msnet32\msnet32.dll 1 +dll\win32\msports\msports.dll 1 +dll\win32\msrle32\msrle32.dll 1 +dll\win32\mssign32\mssign32.dll 1 +dll\win32\mssip32\mssip32.dll 1 +dll\win32\mstask\mstask.dll 1 +dll\win32\msvcrt\msvcrt.dll 1 +dll\win32\msvcrt20\msvcrt20.dll 1 +dll\win32\msvcrt40\msvcrt40.dll 1 +dll\win32\msvfw32\msvfw32.dll 1 +dll\win32\msvidc32\msvidc32.dll 1 +dll\win32\mswsock\mswsock.dll 1 +dll\win32\msxml3\msxml3.dll 1 +dll\win32\nddeapi\nddeapi.dll 1 +dll\win32\netapi32\netapi32.dll 1 +dll\win32\netcfgx\netcfgx.dll 1 +dll\win32\netevent\netevent.dll 1 +dll\win32\netid\netid.dll 1 +dll\win32\netshell\netshell.dll 1 +dll\win32\newdev\newdev.dll 1 +dll\win32\ntdsapi\ntdsapi.dll 1 +dll\win32\ntlanman\ntlanman.dll 1 +dll\win32\ntmarta\ntmarta.dll 1 +dll\win32\ntprint\ntprint.dll 1 +dll\win32\objsel\objsel.dll 1 +dll\win32\odbc32\odbc32.dll 1 +dll\win32\odbccp32\odbccp32.dll 1 +dll\win32\ole32\ole32.dll 1 +dll\win32\oleacc\oleacc.dll 1 +dll\win32\oleaut32\oleaut32.dll 1 +dll\win32\olecli32\olecli32.dll 1 +dll\win32\oledlg\oledlg.dll 1 +dll\win32\olepro32\olepro32.dll 1 +dll\win32\olesvr32\olesvr32.dll 1 +dll\win32\olethk32\olethk32.dll 1 +dll\win32\opengl32\opengl32.dll 1 +dll\win32\pdh\pdh.dll 1 +dll\win32\pidgen\pidgen.dll 1 +dll\win32\powrprof\powrprof.dll 1 +dll\win32\printui\printui.dll 1 +dll\win32\psapi\psapi.dll 1 +dll\win32\pstorec\pstorec.dll 1 +dll\win32\qmgr\qmgr.dll 1 +dll\win32\qmgrprxy\qmgrprxy.dll 1 +dll\win32\query\query.dll 1 +dll\win32\rasadhlp\rasadhlp.dll 1 +dll\win32\rasapi32\rasapi32.dll 1 +dll\win32\rasdlg\rasdlg.dll 1 +dll\win32\rasman\rasman.dll 1 +dll\win32\resutils\resutils.dll 1 +dll\win32\riched20\riched20.dll 1 +dll\win32\riched32\riched32.dll 1 +dll\win32\rpcrt4\rpcrt4.dll 1 +dll\win32\rsabase\rsabase.dll 1 +dll\win32\rsaenh\rsaenh.dll 1 +dll\win32\samlib\samlib.dll 1 +dll\win32\samsrv\samsrv.dll 1 +dll\win32\sccbase\sccbase.dll 1 +dll\win32\schannel\schannel.dll 1 +dll\win32\secur32\secur32.dll 1 +dll\win32\security\security.dll 1 +dll\win32\sensapi\sensapi.dll 1 +dll\win32\serialui\serialui.dll 1 +dll\win32\setupapi\setupapi.dll 1 +dll\win32\sfc\sfc.dll 1 +dll\win32\sfc_os\sfc_os.dll 1 +dll\win32\shdoclc\shdoclc.dll 1 +dll\win32\shdocvw\shdocvw.dll 1 +dll\win32\shell32\shell32.dll 1 +dll\win32\shfolder\shfolder.dll 1 +dll\win32\shimgvw\shimgvw.dll 1 +dll\win32\shlwapi\shlwapi.dll 1 +dll\win32\slbcsp\slbcsp.dll 1 +dll\win32\smdll\smdll.dll 1 +dll\win32\sndblst\sndblst.dll 1 +dll\win32\snmpapi\snmpapi.dll 1 +dll\win32\softpub\softpub.dll 1 +dll\win32\spoolss\spoolss.dll 1 +dll\win32\srclient\srclient.dll 1 +dll\win32\stdole2.tlb\stdole2.tlb 1 +dll\win32\stdole32.tlb\stdole32.tlb 1 +dll\win32\sti\sti.dll 1 +dll\win32\sxs\sxs.dll 1 +dll\win32\syssetup\syssetup.dll 1 +dll\win32\t2embed\t2embed.dll 1 +dll\win32\tapi32\tapi32.dll 1 +dll\win32\tapiui\tapiui.dll 1 +dll\win32\traffic\traffic.dll 1 +dll\win32\twain_32\twain_32.dll 1 +dll\win32\uext2\uext2.dll 1 +dll\win32\ufat\ufat.dll 1 +dll\win32\ufatx\ufatx.dll 1 optional +dll\win32\unicows\unicows.dll 1 +dll\win32\untfs\untfs.dll 1 +dll\win32\updspapi\updspapi.dll 1 +dll\win32\url\url.dll 1 +dll\win32\urlmon\urlmon.dll 1 +dll\win32\user32\user32.dll 1 +dll\win32\userenv\userenv.dll 1 +dll\win32\usp10\usp10.dll 1 +dll\win32\uxtheme\uxtheme.dll 1 +dll\win32\vdmdbg\vdmdbg.dll 1 +dll\win32\version\version.dll 1 +dll\win32\wdmaud.drv\wdmaud.drv 1 +dll\win32\wer\wer.dll 1 +dll\win32\windowscodecs\windowscodecs.dll 1 +dll\win32\winemp3.acm\winemp3.acm 1 +dll\win32\winfax\winfax.dll 1 +dll\win32\wing32\wing32.dll 1 +dll\win32\winhttp\winhttp.dll 1 +dll\win32\wininet\wininet.dll 1 +dll\win32\winmm\winmm.dll 1 +dll\win32\winmm\midimap\midimap.dll 1 +dll\win32\winspool\winspool.drv 1 +dll\win32\winsta\winsta.dll 1 +dll\win32\wintrust\wintrust.dll 1 +dll\win32\wlanapi\wlanapi.dll 1 +dll\win32\wldap32\wldap32.dll 1 +dll\win32\wmi\wmi.dll 1 +dll\win32\ws2_32\ws2_32.dll 1 +dll\win32\ws2help\ws2help.dll 1 +dll\win32\wshirda\wshirda.dll 1 +dll\win32\wshtcpip\wshtcpip.dll 1 +dll\win32\wsock32\wsock32.dll 1 +dll\win32\wtsapi32\wtsapi32.dll 1 +dll\win32\wuapi\wuapi.dll 1 +dll\win32\xinput1_1\xinput1_1.dll 1 +dll\win32\xinput1_2\xinput1_2.dll 1 +dll\win32\xinput1_3\xinput1_3.dll 1 +dll\win32\xinput9_1_0\xinput9_1_0.dll 1 +dll\win32\xmllite\xmllite.dll 1 + +; Shell Extensions +dll\shellext\deskadp\deskadp.dll 1 +dll\shellext\deskmon\deskmon.dll 1 +dll\shellext\devcpux\devcpux.dll 1 +dll\shellext\fontext\fontext.dll 1 +dll\shellext\slayer\slayer.dll 1 + +; Drivers +drivers\base\beep\beep.sys 2 +drivers\base\bootvid\bootvid.dll 1 +drivers\base\nmidebug\nmidebug.sys 2 +drivers\base\null\null.sys 2 + +drivers\battery\battc\battc.sys 2 + +drivers\bus\acpi\cmbatt\cmbatt.sys 2 +drivers\bus\acpi\compbatt\compbatt.sys 2 + +drivers\directx\dxapi\dxapi.sys 2 +drivers\directx\dxg\dxg.sys 2 +drivers\directx\dxgthk\dxgthk.sys 2 + +drivers\filesystems\fs_rec\fs_rec.sys 2 +drivers\filesystems\msfs\msfs.sys 2 +drivers\filesystems\mup\mup.sys 2 +drivers\filesystems\npfs\npfs.sys 2 + +drivers\input\mouclass\mouclass.sys 2 +drivers\input\sermouse\sermouse.sys 2 + +drivers\ksfilter\ks\ks.sys 2 +;drivers\multimedia\bdasup\bdasup.sys 2 + +drivers\network\afd\afd.sys 2 +drivers\network\ndis\ndis.sys 2 +drivers\network\tcpip\tcpip.sys 2 +drivers\network\tdi\tdi.sys 2 +drivers\network\dd\ne2000\ne2000.sys 2 +drivers\network\dd\pcnet\pcnet.sys 2 + +drivers\serial\serenum\serenum.sys 2 +drivers\serial\serial\serial.sys 2 + +drivers\storage\ide\pciide\pciide.sys 2 +drivers\storage\ide\pciidex\pciidex.sys 2 + +;drivers\usb\miniport\usbohci\usbohci.sys 2 +;drivers\usb\miniport\usbuhci\usbuhci.sys 2 +;drivers\usb\usbhub\usbhub.sys 2 +;drivers\usb\usbport\usbport.sys 2 +;drivers\usb\nt4compat\usbdriver\usbdriver.sys 2 + +drivers\video\displays\vga\vgaddi.dll 1 +drivers\video\displays\framebuf\framebuf.dll 1 +drivers\video\miniport\vga\vgamp.sys 2 +drivers\video\miniport\vbe\vbemp.sys 2 +drivers\video\videoprt\videoprt.sys 2 +drivers\video\font\ftfd\ftfd.dll 1 + +drivers\wdm\audio\filters\kmixer\kmixer.sys 2 +drivers\wdm\audio\sysaudio\sysaudio.sys 2 +drivers\wdm\audio\legacy\wdmaud\wdmaud.sys 2 +drivers\wdm\audio\backpln\portcls\portcls.sys 2 +drivers\wdm\audio\drm\drmk\drmk.sys 2 +drivers\wmi\wmilib.sys 2 + +; Media +media\fonts\DejaVuSans.ttf 3 +media\fonts\DejaVuSans-Bold.ttf 3 +media\fonts\DejaVuSans-BoldOblique.ttf 3 +media\fonts\DejaVuSansMono.ttf 3 +media\fonts\DejaVuSansMono-Bold.ttf 3 +media\fonts\DejaVuSansMono-BoldOblique.ttf 3 +media\fonts\DejaVuSansMono-Oblique.ttf 3 +media\fonts\DejaVuSans-Oblique.ttf 3 +media\fonts\DejaVuSerif.ttf 3 +media\fonts\DejaVuSerif-Bold.ttf 3 +media\fonts\DejaVuSerif-BoldItalic.ttf 3 +media\fonts\DejaVuSerif-Italic.ttf 3 + +media\fonts\FreeMono.ttf 3 +media\fonts\FreeMonoBold.ttf 3 +media\fonts\FreeMonoBoldOblique.ttf 3 +media\fonts\FreeMonoOblique.ttf 3 + +media\fonts\LiberationMono-Bold.ttf 3 +media\fonts\LiberationMono-BoldItalic.ttf 3 +media\fonts\LiberationMono-Italic.ttf 3 +media\fonts\LiberationMono-Regular.ttf 3 +media\fonts\LiberationSans-Bold.ttf 3 +media\fonts\LiberationSans-BoldItalic.ttf 3 +media\fonts\LiberationSans-Italic.ttf 3 +media\fonts\LiberationSans-Regular.ttf 3 +media\fonts\LiberationSerif-Bold.ttf 3 +media\fonts\LiberationSerif-BoldItalic.ttf 3 +media\fonts\LiberationSerif-Italic.ttf 3 +media\fonts\LiberationSerif-Regular.ttf 3 + +media\fonts\Marlett.ttf 3 +media\fonts\symbol.ttf 3 +media\fonts\tahoma.ttf 3 +media\fonts\tahomabd.ttf 3 + +media\vgafonts\vgafonts.cab 4 + +media\nls\c_037.nls 1 +media\nls\c_424.nls 1 +media\nls\c_500.nls 1 +media\nls\c_737.nls 1 +media\nls\c_775.nls 1 +media\nls\c_850.nls 1 +media\nls\c_852.nls 1 +media\nls\c_855.nls 1 +media\nls\c_856.nls 1 +media\nls\c_857.nls 1 +media\nls\c_860.nls 1 +media\nls\c_861.nls 1 +media\nls\c_862.nls 1 +media\nls\c_863.nls 1 +media\nls\c_864.nls 1 +media\nls\c_865.nls 1 +media\nls\c_866.nls 1 +media\nls\c_869.nls 1 +media\nls\c_874.nls 1 +media\nls\c_875.nls 1 +media\nls\c_878.nls 1 +media\nls\c_932.nls 1 +media\nls\c_936.nls 1 +media\nls\c_949.nls 1 +media\nls\c_950.nls 1 +media\nls\c_1006.nls 1 +media\nls\c_1026.nls 1 +media\nls\c_1250.nls 1 +media\nls\c_1251.nls 1 +media\nls\c_1253.nls 1 +media\nls\c_1254.nls 1 +media\nls\c_1255.nls 1 +media\nls\c_1256.nls 1 +media\nls\c_1257.nls 1 +media\nls\c_1258.nls 1 +media\nls\c_10000.nls 1 +media\nls\c_10006.nls 1 +media\nls\c_10007.nls 1 +media\nls\c_10029.nls 1 +media\nls\c_10079.nls 1 +media\nls\c_10081.nls 1 +media\nls\c_20866.nls 1 +media\nls\c_21866.nls 1 +media\nls\c_28591.nls 1 +media\nls\c_28592.nls 1 +media\nls\c_28593.nls 1 +media\nls\c_28594.nls 1 +media\nls\c_28595.nls 1 +media\nls\c_28596.nls 1 +media\nls\c_28597.nls 1 +media\nls\c_28598.nls 1 +media\nls\c_28599.nls 1 +media\nls\c_28600.nls 1 +media\nls\c_28603.nls 1 +media\nls\c_28604.nls 1 +media\nls\c_28605.nls 1 +media\nls\c_28606.nls 1 +media\drivers\etc\hosts 5 +media\drivers\etc\services 5 +media\inf\audio.inf 6 +media\inf\acpi.inf 6 +media\inf\battery.inf 6 +media\inf\cdrom.inf 6 +media\inf\cpu.inf 6 +media\inf\disk.inf 6 +media\inf\display.inf 6 +media\inf\font.inf 6 +media\inf\fdc.inf 6 +media\inf\hdc.inf 6 +media\inf\intl.inf 6 +media\inf\layout.inf 6 +media\inf\machine.inf 6 +media\inf\msmouse.inf 6 +media\inf\keyboard.inf 6 +media\inf\ks.inf 6 +media\inf\NET_NIC.inf 6 +media\inf\netamd.inf 6 +media\inf\netisa.inf 6 +media\inf\netrtpnt.inf 6 +media\inf\nettcpip.inf 6 +media\inf\ports.inf 6 +media\inf\scsi.inf 6 +media\inf\syssetup.inf 6 +media\inf\unknown.inf 6 +media\inf\usbport.inf 6 +media\inf\usb.inf 6 +media\inf\usbstor.inf 6 +media\inf\xboxdisp.inf 6 + + +; Media Files +media\sounds\ReactOS_LogOn.wav 8 + +; Ini Files +boot\bootdata\system.ini 4 + +; Regression Testing +boot\bootdata\bootcdregtest\regtest.cmd 7 optional + +; Subsystems +subsystems\win32\csrss\csrss.exe 1 +subsystems\win32\csrss\win32csr\win32csr.dll 1 +subsystems\win32\csrss\csrsrv\csrsrv.dll 1 +subsystems\ntvdm\ntvdm.exe 1 optional +subsystems\win32\win32k\win32k.sys 1 + +; Optional/proprietary files +modules\optional\DroidSansFallback.ttf 3 optional +modules\optional\NOTICE_for_Droid_Font.txt 4 optional +modules\optional\netkvm2k.inf 6 optional +modules\optional\netkvm2k.cat 6 optional +modules\optional\netkvm.sys 2 optional +modules\optional\alcxwdm.inf 6 optional +modules\optional\alcxwdm.sys 2 optional +modules\optional\mfc42.dll 1 optional +modules\optional\mfc42u.dll 1 optional +modules\optional\mfc71.dll 1 optional +modules\optional\mfc71u.dll 1 optional +modules\optional\msvbvm50.dll 1 optional +modules\optional\msvbvm60.dll 1 optional +modules\optional\msvcirt.dll 1 optional +modules\optional\msvcp71.dll 1 optional +modules\optional\msvcr71.dll 1 optional +modules\optional\vmx_fb.dll 1 optional +modules\optional\vmx_mode.dll 1 optional +modules\optional\vmx_svga.inf 6 optional +modules\optional\vmx_svga.sys 2 optional +modules\optional\wine_gecko-1.0.0-x86.cab 4 optional + +; Rosapps +modules\rosapps\applications\screensavers\cylfrac\cylfrac.scr 1 optional +modules\rosapps\applications\screensavers\matrix\matrix.scr 1 optional +modules\rosapps\applications\screensavers\blankscr\scrnsave.scr 1 optional +modules\rosapps\applications\screensavers\starfield\starfield.scr 1 optional +modules\rosapps\applications\screensavers\mazescr\mazescr.scr 1 optional +modules\rosapps\applications\screensavers\butterflies\butterflies.scr 1 optional +modules\rosapps\applications\cmdutils\comp\comp.exe 1 optional +modules\rosapps\applications\cmdutils\mode\mode.exe 1 optional +modules\rosapps\applications\cmdutils\sort\sort.exe 1 optional +modules\rosapps\applications\cmdutils\tee\tee.exe 1 optional +modules\rosapps\applications\cmdutils\touch\touch.exe 1 optional +modules\rosapps\applications\cmdutils\uptime\uptime.exe 1 optional +modules\rosapps\applications\cmdutils\y\y.exe 1 optional +modules\rosapps\applications\devutils\gdb2\gdb2.exe 1 optional +modules\rosapps\applications\devutils\gdihv\gdihv.exe 1 optional +modules\rosapps\applications\devutils\genguid\genguid.exe 1 optional +modules\rosapps\applications\sysutils\gettype\gettype.exe 1 optional +modules\rosapps\applications\net\ncftp\ncftp.exe 1 optional +modules\rosapps\applications\net\netreg\netreg.exe 1 optional +modules\rosapps\applications\net\niclist\niclist.exe 1 optional +modules\rosapps\applications\net\roshttpd\roshttpd.exe 1 optional +modules\rosapps\applications\notevil\notevil.exe 1 optional +modules\rosapps\applications\sysutils\chkdsk\chkdsk.exe 1 optional +modules\rosapps\applications\sysutils\systeminfo\systeminfo.exe 1 optional +modules\rosapps\applications\sysutils\chklib\chklib.exe 1 optional +modules\rosapps\applications\sysutils\ctm\ctm.exe 1 optional +modules\rosapps\applications\sysutils\kill\kill.exe 1 optional +modules\rosapps\applications\sysutils\lsdd\lsdd.exe 1 optional +modules\rosapps\applications\sysutils\man\man.exe 1 optional +modules\rosapps\applications\sysutils\pedump\pedump.exe 1 optional +modules\rosapps\applications\sysutils\regexpl\regexpl.exe 1 optional +modules\rosapps\applications\sysutils\tcat\tcat.exe 1 optional +modules\rosapps\applications\sysutils\tlist\tlist.exe 1 optional +modules\rosapps\applications\sysutils\screenshot\screenshot.exe 1 optional +modules\rosapps\applications\sysutils\utils\binpatch\binpatch.exe 1 optional +modules\rosapps\applications\sysutils\utils\cat\cat.exe 1 optional +modules\rosapps\applications\sysutils\utils\driver\load\load.exe 1 optional +modules\rosapps\applications\sysutils\utils\driver\unload\unload.exe 1 optional +modules\rosapps\applications\sysutils\utils\infinst\infinst.exe 1 optional +modules\rosapps\applications\sysutils\utils\nts2w32err\nts2w32err.exe 1 optional +modules\rosapps\applications\sysutils\utils\objdir\objdir.exe 1 optional +modules\rosapps\applications\sysutils\utils\partinfo\partinfo.exe 1 optional +modules\rosapps\applications\sysutils\utils\ps\ps.exe 1 optional +modules\rosapps\applications\sysutils\utils\rosperf\rosperf.exe 1 optional +modules\rosapps\applications\sysutils\utils\stats\stats.exe 1 optional +modules\rosapps\applications\sysutils\utils\tickcount\tickcount.exe 1 optional +modules\rosapps\applications\winfile\winfile.exe 1 optional +modules\rosapps\demos\maze\maze.exe 1 optional +modules\rosapps\drivers\green\green.sys 2 optional + +; Rostests +modules\rostests\rosautotest\rosautotest.exe 1 optional +modules\rostests\drivers\kmtest\kmtest.sys 2 optional +modules\rostests\drivers\kmtest\kmtestassist.sys 2 optional +modules\rostests\tests\pseh2\pseh2_test.exe 7 optional +modules\rostests\winetests\advapi32\advapi32_winetest.exe 7 optional +modules\rostests\winetests\advpack\advpack_winetest.exe 7 optional +modules\rostests\winetests\amstream\amstream_winetest.exe 7 optional +modules\rostests\winetests\atl\atl_winetest.exe 7 optional +modules\rostests\winetests\avifil32\avifil32_winetest.exe 7 optional +modules\rostests\winetests\browseui\browseui_winetest.exe 7 optional +modules\rostests\winetests\cabinet\cabinet_winetest.exe 7 optional +modules\rostests\winetests\comcat\comcat_winetest.exe 7 optional +modules\rostests\winetests\comctl32\comctl32_winetest.exe 7 optional +modules\rostests\winetests\comdlg32\comdlg32_winetest.exe 7 optional +modules\rostests\winetests\credui\credui_winetest.exe 7 optional +modules\rostests\winetests\crypt32\crypt32_winetest.exe 7 optional +modules\rostests\winetests\cryptnet\cryptnet_winetest.exe 7 optional +modules\rostests\winetests\cryptui\cryptui_winetest.exe 7 optional +modules\rostests\winetests\dnsapi\dnsapi_winetest.exe 7 optional +modules\rostests\winetests\dsound\dsound_winetest.exe 7 optional +modules\rostests\winetests\fusion\fusion_winetest.exe 7 optional +modules\rostests\winetests\gdi32\gdi32_winetest.exe 7 optional +modules\rostests\winetests\gdiplus\gdiplus_winetest.exe 7 optional +modules\rostests\winetests\hlink\hlink_winetest.exe 7 optional +modules\rostests\winetests\icmp\icmp_winetest.exe 7 optional +modules\rostests\winetests\imm32\imm32_winetest.exe 7 optional +modules\rostests\winetests\inetcomm\inetcomm_winetest.exe 7 optional +modules\rostests\winetests\inetmib1\inetmib1_winetest.exe 7 optional +modules\rostests\winetests\iphlpapi\iphlpapi_winetest.exe 7 optional +modules\rostests\winetests\itss\itss_winetest.exe 7 optional +modules\rostests\winetests\jscript\jscript_winetest.exe 7 optional +modules\rostests\winetests\kernel32\kernel32_winetest.exe 7 optional +modules\rostests\winetests\localspl\localspl_winetest.exe 7 optional +modules\rostests\winetests\localui\localui_winetest.exe 7 optional +modules\rostests\winetests\lz32\lz32_winetest.exe 7 optional +modules\rostests\winetests\mapi32\mapi32_winetest.exe 7 optional +modules\rostests\winetests\mlang\mlang_winetest.exe 7 optional +modules\rostests\winetests\msacm32\msacm32_winetest.exe 7 optional +modules\rostests\winetests\mscms\mscms_winetest.exe 7 optional +modules\rostests\winetests\msctf\msctf_winetest.exe 7 optional +modules\rostests\winetests\mshtml\mshtml_winetest.exe 7 optional +modules\rostests\winetests\msi\msi_winetest.exe 7 optional +modules\rostests\winetests\mstask\mstask_winetest.exe 7 optional +modules\rostests\winetests\msvcrt\msvcrt_winetest.exe 7 optional +modules\rostests\winetests\msvcrtd\msvcrtd_winetest.exe 7 optional +modules\rostests\winetests\msvfw32\msvfw32_winetest.exe 7 optional +modules\rostests\winetests\msxml3\msxml3_winetest.exe 7 optional +modules\rostests\winetests\netapi32\netapi32_winetest.exe 7 optional +modules\rostests\winetests\ntdll\ntdll_winetest.exe 7 optional +modules\rostests\winetests\ntdsapi\ntdsapi_winetest.exe 7 optional +modules\rostests\winetests\ntprint\ntprint_winetest.exe 7 optional +modules\rostests\winetests\odbccp32\odbccp32_winetest.exe 7 optional +modules\rostests\winetests\ole32\ole32_winetest.exe 7 optional +modules\rostests\winetests\oleacc\oleacc_winetest.exe 7 optional +modules\rostests\winetests\oleaut32\oleaut32_winetest.exe 7 optional +modules\rostests\winetests\opengl32\opengl32_winetest.exe 7 optional +modules\rostests\winetests\pdh\pdh_winetest.exe 7 optional +modules\rostests\winetests\powrprof\powrprof_winetest.exe 7 optional +modules\rostests\winetests\psapi\psapi_winetest.exe 7 optional +modules\rostests\winetests\qmgr\qmgr_winetest.exe 7 optional +modules\rostests\winetests\quartz\quartz_winetest.exe 7 optional +modules\rostests\winetests\rasapi32\rasapi32_winetest.exe 7 optional +modules\rostests\winetests\riched20\riched20_winetest.exe 7 optional +modules\rostests\winetests\riched32\riched32_winetest.exe 7 optional +modules\rostests\winetests\rpcrt4\rpcrt4_winetest.exe 7 optional +modules\rostests\winetests\rsabase\rsabase_winetest.exe 7 optional +modules\rostests\winetests\rsaenh\rsaenh_winetest.exe 7 optional +modules\rostests\winetests\schannel\schannel_winetest.exe 7 optional +modules\rostests\winetests\secur32\secur32_winetest.exe 7 optional +modules\rostests\winetests\serialui\serialui_winetest.exe 7 optional +modules\rostests\winetests\setupapi\setupapi_winetest.exe 7 optional +modules\rostests\winetests\shdocvw\shdocvw_winetest.exe 7 optional +modules\rostests\winetests\shell32\shell32_winetest.exe 7 optional +modules\rostests\winetests\shlwapi\shlwapi_winetest.exe 7 optional +modules\rostests\winetests\snmpapi\snmpapi_winetest.exe 7 optional +modules\rostests\winetests\spoolss\spoolss_winetest.exe 7 optional +modules\rostests\winetests\twain_32\twain_32_winetest.exe 7 optional +modules\rostests\winetests\urlmon\urlmon_winetest.exe 7 optional +modules\rostests\winetests\user32\user32_winetest.exe 7 optional +modules\rostests\winetests\usp10\usp10_winetest.exe 7 optional +modules\rostests\winetests\uxtheme\uxtheme_winetest.exe 7 optional +modules\rostests\winetests\version\version_winetest.exe 7 optional +modules\rostests\winetests\winhttp\winhttp_winetest.exe 7 optional +modules\rostests\winetests\wininet\wininet_winetest.exe 7 optional +modules\rostests\winetests\winmm\winmm_winetest.exe 7 optional +modules\rostests\winetests\wintrust\wintrust_winetest.exe 7 optional +modules\rostests\winetests\wlanapi\wlanapi_winetest.exe 7 optional +modules\rostests\winetests\wldap32\wldap32_winetest.exe 7 optional +modules\rostests\winetests\ws2_32\ws2_32_winetest.exe 7 optional +modules\rostests\winetests\xmllite\xmllite_winetest.exe 7 optional + +modules\rostests\apitests\dciman32\dciman32_apitest.exe 7 optional +modules\rostests\apitests\gdi32\gdi32_apitest.exe 7 optional +modules\rostests\apitests\ntdll\ntdll_apitest.exe 7 optional +modules\rostests\apitests\user32\user32_apitest.exe 7 optional +modules\rostests\apitests\ws2_32\ws2_32_apitest.exe 7 optional + +modules\wallpaper\Angelus_02_ROSWP.bmp 4 optional diff --git a/boot/freeldr/bootsect/bootsect.rbuild b/boot/freeldr/bootsect/bootsect.rbuild new file mode 100644 index 00000000000..0a6be4b63be --- /dev/null +++ b/boot/freeldr/bootsect/bootsect.rbuild @@ -0,0 +1,28 @@ + + + + + + dosmbr.asm + + + + ext2.asm + + + + fat32.asm + + + + fat.asm + + + + isoboot.asm + + + + isobtrt.asm + + diff --git a/boot/freeldr/fdebug/fdebug.rbuild b/boot/freeldr/fdebug/fdebug.rbuild new file mode 100644 index 00000000000..8ae515c2f4c --- /dev/null +++ b/boot/freeldr/fdebug/fdebug.rbuild @@ -0,0 +1,11 @@ + + + + . + user32 + comdlg32 + gdi32 + fdebug.c + rs232.c + fdebug.rc + diff --git a/boot/freeldr/freeldr.rbuild b/boot/freeldr/freeldr.rbuild new file mode 100644 index 00000000000..ad87a71fd22 --- /dev/null +++ b/boot/freeldr/freeldr.rbuild @@ -0,0 +1,47 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/boot/freeldr/freeldr/arch/i386/fathelp.S b/boot/freeldr/freeldr/arch/i386/fathelp.S index 7bd7fb33d95..4403aa55c6c 100644 --- a/boot/freeldr/freeldr/arch/i386/fathelp.S +++ b/boot/freeldr/freeldr/arch/i386/fathelp.S @@ -56,6 +56,7 @@ PUBLIC _mainCRTStartup // For Mingw32 builds where the linker looks for this sym _mainCRTStartup: PUBLIC start start: +#if 0 .byte HEX(e9) .byte HEX(fd) .byte HEX(01) @@ -134,7 +135,7 @@ LoadFile_Done: // Reads the entire FAT into memory at 7000:0000 ReadFatIntoMemory: - mov ax, [bp+HiddenSectors] + mov ax, [bp+HiddenSectors] mov dx, [bp+HiddenSectors+2] add ax, [bp+ReservedSectors] adc dx, 0 @@ -233,6 +234,7 @@ msgLoading: .asciz "Loading FreeLoader...\r\n" .org HEX(1fe) // Pad to 510 bytes .word HEX(0aa55) // BootSector signature +#endif .endcode16 diff --git a/boot/freeldr/freeldr/arch/i386/fathelp.asm b/boot/freeldr/freeldr/arch/i386/fathelp.asm new file mode 100644 index 00000000000..90e42a00475 --- /dev/null +++ b/boot/freeldr/freeldr/arch/i386/fathelp.asm @@ -0,0 +1,235 @@ +; FATHELP.ASM +; FAT12/16 Boot Sector Helper Code +; Copyright (c) 1998, 2001, 2002, 2003 Brian Palmer + + + +;org 8000h + +segment .text + +bits 16 + + +BootSectorStackTop equ 0x7bf2 +DataAreaStartHigh equ 0x2 +DataAreaStartLow equ 0x4 +BiosCHSDriveSizeHigh equ 0x6 +BiosCHSDriveSizeLow equ 0x8 +BiosCHSDriveSize equ 0x8 +ReadSectorsOffset equ 0xa +ReadClusterOffset equ 0xc +PutCharsOffset equ 0xe + +OEMName equ 3 +BytesPerSector equ 11 +SectsPerCluster equ 13 +ReservedSectors equ 14 +NumberOfFats equ 16 +MaxRootEntries equ 17 +TotalSectors equ 19 +MediaDescriptor equ 21 +SectorsPerFat equ 22 +SectorsPerTrack equ 24 +NumberOfHeads equ 26 +HiddenSectors equ 28 +TotalSectorsBig equ 32 +BootDrive equ 36 +Reserved equ 37 +ExtendSig equ 38 +SerialNumber equ 39 +VolumeLabel equ 43 +FileSystem equ 54 + +BootPartition equ 0x7dfd + + +; This code will be stored in the first 512 bytes +; of freeldr.sys. The first 3 bytes will be a jmp +; instruction to skip past the FAT helper code +; that is stored in the rest of the 512 bytes. +; +; This code is loaded at 0000:8000 so we have to +; encode a jmp instruction to jump to 0000:8200 + +global _mainCRTStartup ; For Mingw32 builds where the linker looks for this symbol +_mainCRTStartup: +global start +start: + db 0xe9 + db 0xfd + db 0x01 + +; Now starts the extra boot code that we will store +; in the first 512 bytes of freeldr.sys. This code +; allows the FAT12/16 bootsector to navigate the +; FAT table so that we can still load freeldr.sys +; even if it is fragmented. + + +FatHelperEntryPoint: + + push ax ; First save AX - the start cluster of freeldr.sys + + + ; Display "Loading FreeLoader..." message + mov esi,msgLoading ; Loading message + call [bp-PutCharsOffset] ; Display it + + + call ReadFatIntoMemory + + pop ax ; Restore AX (start cluster) + ; AX has start cluster of freeldr.sys + + mov bx,800h + mov es,bx + +LoadFile: + push ax + call IsFat12 + pop ax + jnc LoadFile2 + cmp ax,0ff8h ; Check to see if this is the last cluster in the chain + jmp LoadFile3 +LoadFile2: + cmp ax,0fff8h +LoadFile3: + jae LoadFile_Done ; If so continue, if not then read then next one + push ax + xor bx,bx ; Load ROSLDR starting at 0000:8000h + push es + call [bp-ReadClusterOffset] + pop es + + xor bx,bx + mov bl,BYTE [BYTE bp+SectsPerCluster] + shl bx,5 ; BX = BX * 512 / 16 + mov ax,es ; Increment the load address by + add ax,bx ; The size of a cluster + mov es,ax + + call IsFat12 + pop ax + push es + jnc LoadFile4 + call GetFatEntry12 ; Get the next entry + jmp LoadFile5 +LoadFile4: + call GetFatEntry16 +LoadFile5: + pop es + + jmp LoadFile ; Load the next cluster (if any) + +LoadFile_Done: + mov dl,BYTE [BYTE bp+BootDrive] ; Load the boot drive into DL + mov dh,[BootPartition] ; Load the boot partition into DH + + push 0 ; push segment (0x0000) + mov bx, [0x8000 + 0xA8] ; load the RVA of the EntryPoint into eax + add bx, 0x8000 ; RVA -> VA and skip 3 bytes (jump to fathelper code) + push bx ; push offset + retf ; Transfer control to FreeLoader + +; Reads the entire FAT into memory at 7000:0000 +ReadFatIntoMemory: + mov ax,WORD [BYTE bp+HiddenSectors] + mov dx,WORD [BYTE bp+HiddenSectors+2] + add ax,WORD [BYTE bp+ReservedSectors] + adc dx,byte 0 + mov cx,WORD [BYTE bp+SectorsPerFat] + mov bx,7000h + mov es,bx + xor bx,bx + call [bp-ReadSectorsOffset] + ret + + +; Returns the FAT entry for a given cluster number for 16-bit FAT +; On entry AX has cluster number +; On return AX has FAT entry for that cluster +GetFatEntry16: + + mov cx,2 ; AX = AX * 2 (since FAT16 entries are 2 bytes) + mul cx + shl dx,12 + + mov bx,7000h + add bx,dx + mov es,bx + mov bx,ax ; Restore FAT entry offset + mov ax,WORD [es:bx] ; Get FAT entry + + ret + + +; Returns the FAT entry for a given cluster number for 12-bit FAT +; On entry AX has cluster number +; On return AX has FAT entry for that cluster +GetFatEntry12: + + push ax + mov cx,ax + shr ax,1 + add ax,cx ; AX = AX * 1.5 (AX = AX + (AX / 2)) (since FAT12 entries are 12 bits) + + mov bx,7000h + mov es,bx + mov bx,ax ; Put FAT entry offset into BX + mov ax,WORD [es:bx] ; Get FAT entry + pop cx ; Get cluster number from stack + and cx,1 + jz UseLow12Bits + and ax,0fff0h + shr ax,4 + jmp GetFatEntry12_Done + +UseLow12Bits: + and ax,0fffh + +GetFatEntry12_Done: + + ret + + +; Returns CF = 1 if this is a FAT12 file system +; Otherwise CF = 0 for FAT16 +IsFat12: + + mov ebx,DWORD [BYTE bp-DataAreaStartLow] + ; EBX now has the number of the starting sector of the data area + ; starting from the beginning of the disk, so subtrace hidden sectors + sub ebx,DWORD [BYTE bp+HiddenSectors] + + + xor eax,eax + mov ax,WORD [BYTE bp+TotalSectors] + cmp ax,byte 0 + jnz IsFat12_2 + mov eax,DWORD [BYTE bp+TotalSectorsBig] + + ; EAX now contains the number of sectors on the volume + +IsFat12_2: + sub eax,ebx ; Subtract data area start sector + xor edx,edx ; from total sectors of volume + + ; EDX:EAX now contains the number of data sectors on the volume + movzx ebx,BYTE [BYTE bp+SectsPerCluster] + div ebx + ; EAX now has the number of clusters on the volume + stc + cmp eax,4085 + jb IsFat12_Done + clc + +IsFat12_Done: + ret + + + +msgLoading db 'Loading FreeLoader...',0dh,0ah,0 + + times 510-($-$$) db 0 ; Pad to 510 bytes + dw 0aa55h ; BootSector signature diff --git a/boot/freeldr/freeldr/freeldr.rbuild b/boot/freeldr/freeldr/freeldr.rbuild new file mode 100644 index 00000000000..7ca1a75e734 --- /dev/null +++ b/boot/freeldr/freeldr/freeldr.rbuild @@ -0,0 +1,57 @@ + + + + + + freeldr_startup + freeldr_base64k + freeldr_base + freeldr_arch + freeldr_main + rossym + cmlib + rtl + libcntpr + ppcmmu + + + + + + freeldr_$(ARCH).lnk + + freeldr_startup + freeldr_base64k + freeldr_base + freeldr_arch + freeldr_main + rossym + cmlib + rtl + libcntpr + + + + + + freeldr_$(ARCH).lnk + + freeldr_startup + freeldr_base64k + freeldr_base + + mini_hal + + freeldr_arch + freeldr_main + rossym + cmlib + rtl + libcntpr + cportlib + + -static + -lgcc + + + diff --git a/boot/freeldr/freeldr/freeldr_arch.rbuild b/boot/freeldr/freeldr/freeldr_arch.rbuild new file mode 100644 index 00000000000..1a7bc730661 --- /dev/null +++ b/boot/freeldr/freeldr/freeldr_arch.rbuild @@ -0,0 +1,111 @@ + + + + include + cache + include + include/reactos/libs + include/reactos/elf + + + + + + + archmach.c + custom.c + drivemap.c + halstub.c + hardware.c + hwacpi.c + hwapm.c + hwpci.c + i386bug.c + i386disk.c + i386rtl.c + i386vid.c + machpc.c + miscboot.c + ntoskrnl.c + pccons.c + pcdisk.c + pcmem.c + pcrtc.c + pcvideo.c + machxbox.c + xboxcons.c + xboxdisk.c + xboxfont.c + xboxhw.c + xboxi2c.c + xboxmem.c + xboxrtc.c + xboxvideo.c + + + + + boot.s + loader.c + mach.c + mboot.c + ofw.c + ofw_util.s + ofw_calls.s + ofwdisk.c + ofw_method.c + prep.c + prep_ide.c + prep_pci.c + prep_vga.c + + + + + macharm.c + + + + + + loader.c + + + hardware.c + hwacpi.c + hwapm.c + hwpci.c + i386rtl.c + i386disk.c + i386vid.c + machpc.c + pccons.c + pcdisk.c + pcmem.c + pcrtc.c + pcvideo.c + + + + + + + + + wlmemory.c + + + + + ntsetup.c + wlmemory.c + + + + + ntsetup.c + wlmemory.c + + + + diff --git a/boot/freeldr/freeldr/freeldr_base.rbuild b/boot/freeldr/freeldr/freeldr_base.rbuild new file mode 100644 index 00000000000..78131dbd92c --- /dev/null +++ b/boot/freeldr/freeldr/freeldr_base.rbuild @@ -0,0 +1,92 @@ + + + + include + cache + . + include + + + + + mm.c + time.c + + + blocklist.c + cache.c + + + rs232.c + + + disk.c + partition.c + ramdisk.c + + scsiport.c + + + + ext2.c + fat.c + fs.c + iso.c + ntfs.c + pxe.c + + + ini_init.c + inifile.c + parse.c + + + meminit.c + mm.c + + + registry.c + arcname.c + archwsup.c + binhive.c + + + bget.c + libsupp.c + + + directui.c + gui.c + minitui.c + noui.c + tui.c + tuimenu.c + ui.c + + + fade.c + palette.c + video.c + + + conversion.c + peloader.c + winldr.c + wlmemory.c + wlregistry.c + + headless.c + + + freeldr.c + debug.c + version.c + cmdline.c + machine.c + + freeldr.h + + options.c + linuxboot.c + oslist.c + diff --git a/boot/freeldr/freeldr/freeldr_base64k.rbuild b/boot/freeldr/freeldr/freeldr_base64k.rbuild new file mode 100644 index 00000000000..28a671a9f7f --- /dev/null +++ b/boot/freeldr/freeldr/freeldr_base64k.rbuild @@ -0,0 +1,32 @@ + + + + include + include + + + + + boot.S + drvmap.S + i386cpu.S + i386idt.S + i386pnp.S + i386pxe.S + i386trap.S + int386.S + linux.S + mb.S + + + + + drvmap.S + i386cpu.S + i386idt.S + i386trap.S + mb.S + + + + diff --git a/boot/freeldr/freeldr/freeldr_main.rbuild b/boot/freeldr/freeldr/freeldr_main.rbuild new file mode 100644 index 00000000000..f45ef931fdc --- /dev/null +++ b/boot/freeldr/freeldr/freeldr_main.rbuild @@ -0,0 +1,8 @@ + + + + include + include + + bootmgr.c + diff --git a/boot/freeldr/freeldr/freeldr_startup.rbuild b/boot/freeldr/freeldr/freeldr_startup.rbuild new file mode 100644 index 00000000000..53fd6a9d9eb --- /dev/null +++ b/boot/freeldr/freeldr/freeldr_startup.rbuild @@ -0,0 +1,25 @@ + + + + include + include + + + + fathelp.asm + arch.S + + + + + fathelp.S + arch.S + + + + + boot.s + + + + diff --git a/boot/freeldr/freeldr/setupldr.rbuild b/boot/freeldr/freeldr/setupldr.rbuild new file mode 100644 index 00000000000..b14d46c73f8 --- /dev/null +++ b/boot/freeldr/freeldr/setupldr.rbuild @@ -0,0 +1,24 @@ + + + + + freeldr_$(ARCH).lnk + + freeldr_startup + freeldr_base64k + freeldr_base + + mini_hal + + freeldr_arch + setupldr_main + rossym + cmlib + cportlib + rtl + libcntpr + + -static + -lgcc + + diff --git a/boot/freeldr/freeldr/setupldr_main.rbuild b/boot/freeldr/freeldr/setupldr_main.rbuild new file mode 100644 index 00000000000..8b03906284e --- /dev/null +++ b/boot/freeldr/freeldr/setupldr_main.rbuild @@ -0,0 +1,22 @@ + + + + include + include + + + bootmgr.c + + inffile.c + + + + setupldr2.c + + + + + setupldr2.c + + + diff --git a/boot/freeldr/install/installfreeldr.rbuild b/boot/freeldr/install/installfreeldr.rbuild new file mode 100644 index 00000000000..81140e8715a --- /dev/null +++ b/boot/freeldr/install/installfreeldr.rbuild @@ -0,0 +1,7 @@ + + + + . + install.c + volume.c + diff --git a/config.template.rbuild b/config.template.rbuild new file mode 100644 index 00000000000..5e20dd5fd55 --- /dev/null +++ b/config.template.rbuild @@ -0,0 +1,107 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/dll/3rdparty/3rdparty.rbuild b/dll/3rdparty/3rdparty.rbuild new file mode 100644 index 00000000000..c6900d07259 --- /dev/null +++ b/dll/3rdparty/3rdparty.rbuild @@ -0,0 +1,25 @@ + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/dll/3rdparty/dxtn/dxtn.rbuild b/dll/3rdparty/dxtn/dxtn.rbuild new file mode 100644 index 00000000000..325a5599002 --- /dev/null +++ b/dll/3rdparty/dxtn/dxtn.rbuild @@ -0,0 +1,8 @@ + + + . + fxt1.c + dxtn.c + wrapper.c + texstore.c + diff --git a/dll/3rdparty/libjpeg/libjpeg.rbuild b/dll/3rdparty/libjpeg/libjpeg.rbuild new file mode 100644 index 00000000000..7baac85f6d4 --- /dev/null +++ b/dll/3rdparty/libjpeg/libjpeg.rbuild @@ -0,0 +1,58 @@ + + + + + + + + mainptr + . + include/reactos/libs/libjpeg + include/reactos/libs/zlib + jaricom.c + jcapimin.c + jcapistd.c + jcarith.c + jccoefct.c + jccolor.c + jcdctmgr.c + jchuff.c + jcinit.c + jcmainct.c + jcmarker.c + jcmaster.c + jcomapi.c + jcparam.c + jcprepct.c + jcsample.c + jctrans.c + jdapimin.c + jdapistd.c + jdarith.c + jdatadst.c + jdatasrc.c + jdcoefct.c + jdcolor.c + jddctmgr.c + jdhuff.c + jdinput.c + jdmainct.c + jdmarker.c + jdmaster.c + jdmerge.c + jdpostct.c + jdsample.c + jdtrans.c + jerror.c + jfdctflt.c + jfdctfst.c + jfdctint.c + jidctflt.c + jidctfst.c + jidctint.c + jquant1.c + jquant2.c + jutils.c + jmemmgr.c + jmemnobs.c + diff --git a/dll/3rdparty/libpng/libpng.rbuild b/dll/3rdparty/libpng/libpng.rbuild new file mode 100644 index 00000000000..d9960db6d30 --- /dev/null +++ b/dll/3rdparty/libpng/libpng.rbuild @@ -0,0 +1,28 @@ + + + + + + + + . + include/reactos/libs/zlib + include/reactos/libs/libpng + zlib + png.c + pngerror.c + pngget.c + pngmem.c + pngpread.c + pngread.c + pngrio.c + pngrtran.c + pngrutil.c + pngset.c + pngtest.c + pngtrans.c + pngwio.c + pngwrite.c + pngwtran.c + pngwutil.c + diff --git a/dll/3rdparty/libtiff/libtiff.rbuild b/dll/3rdparty/libtiff/libtiff.rbuild new file mode 100644 index 00000000000..ce7027cbd95 --- /dev/null +++ b/dll/3rdparty/libtiff/libtiff.rbuild @@ -0,0 +1,53 @@ + + + + + + + + + . + include/reactos/libs/zlib + include/reactos/libs/libtiff + getopt + user32 + zlib + mkg3states.c + tif_aux.c + tif_close.c + tif_codec.c + tif_color.c + tif_compress.c + tif_dir.c + tif_dirinfo.c + tif_dirread.c + tif_dirwrite.c + tif_dumpmode.c + tif_error.c + tif_extension.c + tif_fax3.c + tif_fax3sm.c + tif_flush.c + tif_getimage.c + tif_jbig.c + tif_jpeg.c + tif_luv.c + tif_lzw.c + tif_next.c + tif_ojpeg.c + tif_open.c + tif_packbits.c + tif_pixarlog.c + tif_predict.c + tif_print.c + tif_read.c + tif_strip.c + tif_swab.c + tif_thunder.c + tif_tile.c + tif_version.c + tif_warning.c + tif_win32.c + tif_write.c + tif_zip.c + diff --git a/dll/3rdparty/libxslt/libxslt.rbuild b/dll/3rdparty/libxslt/libxslt.rbuild new file mode 100644 index 00000000000..3c58dc1db55 --- /dev/null +++ b/dll/3rdparty/libxslt/libxslt.rbuild @@ -0,0 +1,36 @@ + + + + + + + + + + + + + include + . + libxml2 + ws2_32 + attributes.c + attrvt.c + documents.c + extensions.c + extra.c + functions.c + imports.c + keys.c + namespaces.c + numbers.c + pattern.c + preproc.c + security.c + templates.c + transform.c + variables.c + xslt.c + xsltlocale.c + xsltutils.c + diff --git a/dll/3rdparty/mesa32/mesa32.rbuild b/dll/3rdparty/mesa32/mesa32.rbuild new file mode 100644 index 00000000000..c13d8eeaef4 --- /dev/null +++ b/dll/3rdparty/mesa32/mesa32.rbuild @@ -0,0 +1,297 @@ + + + + + -enable-stdcall-fixup + -w + ntdll + user32 + + gdi32 + + + + + + + + + + + + + include + src + src/main + src/glapi + src/math + src/tnl + src/shader + src/shader/grammar + src/shader/slang + src/shader/slang/OSDependent/Linux + src/shader/slang/OGLCompilersDLL + + + + driverfuncs.c + + + + wmesa.c + wgl.c + + + icd.c + + + + + glapi_getproc.c + glapi.c + glthread.c + + + accum.c + api_arrayelt.c + api_exec.c + api_loopback.c + api_noop.c + api_validate.c + arrayobj.c + attrib.c + blend.c + bufferobj.c + buffers.c + clear.c + clip.c + colortab.c + context.c + convolve.c + debug.c + depth.c + depthstencil.c + dispatch.c + dlist.c + dlopen.c + drawpix.c + enable.c + enums.c + eval.c + execmem.c + extensions.c + fbobject.c + feedback.c + ffvertex_prog.c + fog.c + framebuffer.c + get.c + getstring.c + hash.c + hint.c + histogram.c + image.c + imports.c + light.c + lines.c + matrix.c + mipmap.c + mm.c + multisample.c + pixel.c + pixelstore.c + points.c + polygon.c + queryobj.c + rastpos.c + rbadaptors.c + readpix.c + renderbuffer.c + scissor.c + shaders.c + state.c + stencil.c + texcompress.c + texcompress_fxt1.c + texcompress_s3tc.c + texenv.c + texenvprogram.c + texgen.c + texformat.c + teximage.c + texobj.c + texparam.c + texrender.c + texstate.c + texstore.c + varray.c + vtxfmt.c + + + m_debug_clip.c + m_debug_norm.c + m_debug_xform.c + m_eval.c + m_matrix.c + m_translate.c + m_vector.c + m_xform.c + + + arbprogparse.c + arbprogram.c + atifragshader.c + nvfragparse.c + nvprogram.c + nvvertparse.c + prog_cache.c + prog_debug.c + prog_execute.c + prog_instruction.c + prog_noise.c + prog_parameter.c + prog_print.c + prog_statevars.c + prog_uniform.c + program.c + programopt.c + shader_api.c + + slang_builtin.c + slang_codegen.c + slang_compile.c + slang_compile_function.c + slang_compile_operation.c + slang_compile_struct.c + slang_compile_variable.c + slang_emit.c + slang_ir.c + slang_label.c + slang_link.c + slang_log.c + slang_mem.c + slang_preprocess.c + slang_print.c + slang_simplify.c + slang_storage.c + slang_typeinfo.c + slang_utility.c + slang_vartable.c + + + grammar_mesa.c + + + + s_aaline.c + s_aatriangle.c + s_accum.c + s_alpha.c + s_atifragshader.c + s_bitmap.c + s_blend.c + s_blit.c + s_buffers.c + s_context.c + s_copypix.c + s_depth.c + s_drawpix.c + s_feedback.c + s_fog.c + s_fragprog.c + s_imaging.c + s_lines.c + s_logic.c + s_masking.c + s_points.c + s_readpix.c + s_span.c + s_stencil.c + s_texcombine.c + s_texfilter.c + s_texstore.c + s_triangle.c + s_zoom.c + + + ss_context.c + ss_triangle.c + + + t_context.c + t_draw.c + t_pipeline.c + t_rasterpos.c + t_vb_cull.c + t_vb_fog.c + t_vb_light.c + t_vb_normals.c + t_vb_points.c + t_vb_program.c + t_vb_render.c + t_vb_texgen.c + t_vb_texmat.c + t_vb_vertex.c + t_vertex.c + t_vertex_generic.c + t_vp_build.c + + t_vertex_sse.c + + + + vbo_context.c + vbo_exec.c + vbo_exec_api.c + vbo_exec_array.c + vbo_exec_draw.c + vbo_exec_eval.c + vbo_rebase.c + vbo_save.c + vbo_save_api.c + vbo_save_draw.c + vbo_save_loopback.c + vbo_split.c + vbo_split_copy.c + vbo_split_inplace.c + + + + + x86sse.c + + 3dnow.c + 3dnow_normal.S + 3dnow_xform1.S + 3dnow_xform2.S + 3dnow_xform3.S + 3dnow_xform4.S + common_x86.c + common_x86_asm.S + glapi_x86.S + mmx_blend.S + read_rgba_span_x86.S + sse_normal.S + sse_xform1.S + sse_xform2.S + sse_xform3.S + sse_xform4.S + x86.c + x86_cliptest.S + x86_xform2.S + x86_xform3.S + x86_xform4.S + sse.c + + + + + + x86-64.c + + xform4.S + + + + + diff --git a/dll/cpl/access/access.rbuild b/dll/cpl/access/access.rbuild new file mode 100644 index 00000000000..257cb69b693 --- /dev/null +++ b/dll/cpl/access/access.rbuild @@ -0,0 +1,17 @@ + + + + + . + gdi32 + user32 + advapi32 + comctl32 + access.c + display.c + general.c + keyboard.c + mouse.c + sound.c + access.rc + diff --git a/dll/cpl/appwiz/appwiz.rbuild b/dll/cpl/appwiz/appwiz.rbuild new file mode 100644 index 00000000000..316a0899215 --- /dev/null +++ b/dll/cpl/appwiz/appwiz.rbuild @@ -0,0 +1,15 @@ + + + + + . + advapi32 + user32 + comctl32 + ole32 + uuid + shell32 + appwiz.c + createlink.c + appwiz.rc + diff --git a/dll/cpl/console/console.rbuild b/dll/cpl/console/console.rbuild new file mode 100644 index 00000000000..da172610fed --- /dev/null +++ b/dll/cpl/console/console.rbuild @@ -0,0 +1,14 @@ + + + . + user32 + comctl32 + gdi32 + console.c + options.c + font.c + layout.c + colors.c + console.rc + console.h + diff --git a/dll/cpl/cpl.rbuild b/dll/cpl/cpl.rbuild new file mode 100644 index 00000000000..4f4e896d174 --- /dev/null +++ b/dll/cpl/cpl.rbuild @@ -0,0 +1,58 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/dll/cpl/desk/desk.rbuild b/dll/cpl/desk/desk.rbuild new file mode 100644 index 00000000000..fddd10ef8e7 --- /dev/null +++ b/dll/cpl/desk/desk.rbuild @@ -0,0 +1,36 @@ + + + + + . + + user32 + advapi32 + gdi32 + comctl32 + comdlg32 + ole32 + setupapi + shell32 + ntdll + msimg32 + uuid + advmon.c + appearance.c + background.c + classinst.c + desk.c + devsett.c + dibitmap.c + misc.c + preview.c + screensaver.c + advappdlg.c + effappdlg.c + settings.c + monslctl.c + general.c + desk.rc + draw.c + theme.c + diff --git a/dll/cpl/hdwwiz/hdwwiz.rbuild b/dll/cpl/hdwwiz/hdwwiz.rbuild new file mode 100644 index 00000000000..8c671910253 --- /dev/null +++ b/dll/cpl/hdwwiz/hdwwiz.rbuild @@ -0,0 +1,16 @@ + + + + + . + setupapi + advapi32 + comctl32 + rpcrt4 + user32 + gdi32 + devmgr + ntdll + hdwwiz.c + hdwwiz.rc + diff --git a/dll/cpl/input/input.rbuild b/dll/cpl/input/input.rbuild new file mode 100644 index 00000000000..81357d65636 --- /dev/null +++ b/dll/cpl/input/input.rbuild @@ -0,0 +1,16 @@ + + + + + . + advapi32 + user32 + comctl32 + gdi32 + input.c + settings.c + keysettings.c + add.c + changekeyseq.c + input.rc + diff --git a/dll/cpl/intl/intl.rbuild b/dll/cpl/intl/intl.rbuild new file mode 100644 index 00000000000..631c8958de7 --- /dev/null +++ b/dll/cpl/intl/intl.rbuild @@ -0,0 +1,24 @@ + + + + + . + user32 + comctl32 + advapi32 + setupapi + shell32 + currency.c + date.c + generalp.c + intl.c + inplocale.c + numbers.c + time.c + misc.c + kblayouts.c + languages.c + advanced.c + sort.c + intl.rc + diff --git a/dll/cpl/joy/joy.rbuild b/dll/cpl/joy/joy.rbuild new file mode 100644 index 00000000000..7bacdcd182e --- /dev/null +++ b/dll/cpl/joy/joy.rbuild @@ -0,0 +1,14 @@ + + + + + . + advapi32 + user32 + comctl32 + ole32 + uuid + shell32 + joy.c + joy.rc + diff --git a/dll/cpl/liccpa/liccpa.rbuild b/dll/cpl/liccpa/liccpa.rbuild new file mode 100644 index 00000000000..f2c7b058578 --- /dev/null +++ b/dll/cpl/liccpa/liccpa.rbuild @@ -0,0 +1,14 @@ + + + + + . + advapi32 + user32 + comctl32 + ole32 + uuid + shell32 + liccpa.c + liccpa.rc + diff --git a/dll/cpl/main/main.rbuild b/dll/cpl/main/main.rbuild new file mode 100644 index 00000000000..f0025d068cc --- /dev/null +++ b/dll/cpl/main/main.rbuild @@ -0,0 +1,17 @@ + + + + + . + advapi32 + user32 + comctl32 + devmgr + comdlg32 + shell32 + gdi32 + keyboard.c + main.c + mouse.c + main.rc + diff --git a/dll/cpl/mmsys/mmsys.rbuild b/dll/cpl/mmsys/mmsys.rbuild new file mode 100644 index 00000000000..3180e2a7888 --- /dev/null +++ b/dll/cpl/mmsys/mmsys.rbuild @@ -0,0 +1,21 @@ + + + + + . + user32 + comctl32 + devmgr + gdi32 + winmm + advapi32 + shell32 + setupapi + shlwapi + mmsys.c + sounds.c + volume.c + audio.c + voice.c + mmsys.rc + diff --git a/dll/cpl/ncpa/ncpa.rbuild b/dll/cpl/ncpa/ncpa.rbuild new file mode 100644 index 00000000000..c5ddfedc5a6 --- /dev/null +++ b/dll/cpl/ncpa/ncpa.rbuild @@ -0,0 +1,12 @@ + + + + + . + + 0x600 + + advapi32 + shell32 + ncpa.c + diff --git a/dll/cpl/odbccp32/odbccp32.rbuild b/dll/cpl/odbccp32/odbccp32.rbuild new file mode 100644 index 00000000000..abaf981d0ed --- /dev/null +++ b/dll/cpl/odbccp32/odbccp32.rbuild @@ -0,0 +1,10 @@ + + + + + . + user32 + comctl32 + odbccp32.c + odbccp32.rc + diff --git a/dll/cpl/powercfg/powercfg.rbuild b/dll/cpl/powercfg/powercfg.rbuild new file mode 100644 index 00000000000..9e53839dc2e --- /dev/null +++ b/dll/cpl/powercfg/powercfg.rbuild @@ -0,0 +1,18 @@ + + + + + . + include/reactos/wine + user32 + powrprof + comctl32 + shell32 + advapi32 + powercfg.c + powershemes.c + alarms.c + advanced.c + hibernate.c + powercfg.rc + diff --git a/dll/cpl/sysdm/sysdm.rbuild b/dll/cpl/sysdm/sysdm.rbuild new file mode 100644 index 00000000000..739e41ccc15 --- /dev/null +++ b/dll/cpl/sysdm/sysdm.rbuild @@ -0,0 +1,28 @@ + + + + + . + advapi32 + setupapi + user32 + gdi32 + comctl32 + msimg32 + shell32 + shlwapi + ole32 + powrprof + advanced.c + environment.c + general.c + hardprof.c + hardware.c + licence.c + startrec.c + sysdm.c + userprofile.c + virtmem.c + sysdm.rc + precomp.h + diff --git a/dll/cpl/telephon/telephon.rbuild b/dll/cpl/telephon/telephon.rbuild new file mode 100644 index 00000000000..1f0a53552d2 --- /dev/null +++ b/dll/cpl/telephon/telephon.rbuild @@ -0,0 +1,14 @@ + + + + + . + advapi32 + user32 + comctl32 + ole32 + uuid + shell32 + telephon.c + telephon.rc + diff --git a/dll/cpl/timedate/timedate.rbuild b/dll/cpl/timedate/timedate.rbuild new file mode 100644 index 00000000000..a611b2a74ea --- /dev/null +++ b/dll/cpl/timedate/timedate.rbuild @@ -0,0 +1,20 @@ + + + + + . + advapi32 + user32 + gdi32 + comctl32 + ws2_32 + iphlpapi + clock.c + dateandtime.c + internettime.c + monthcal.c + ntpclient.c + timedate.c + timezone.c + timedate.rc + diff --git a/dll/cpl/usrmgr/usrmgr.rbuild b/dll/cpl/usrmgr/usrmgr.rbuild new file mode 100644 index 00000000000..472bec32e51 --- /dev/null +++ b/dll/cpl/usrmgr/usrmgr.rbuild @@ -0,0 +1,21 @@ + + + + + . + include/reactos/wine + advapi32 + user32 + gdi32 + comctl32 + ntdll + netapi32 + extra.c + groupprops.c + groups.c + misc.c + userprops.c + users.c + usrmgr.c + usrmgr.rc + diff --git a/dll/directx/amstream/amstream.rbuild b/dll/directx/amstream/amstream.rbuild new file mode 100644 index 00000000000..46780d34e0b --- /dev/null +++ b/dll/directx/amstream/amstream.rbuild @@ -0,0 +1,21 @@ + + + + . + include/reactos/wine + 0x600 + + amstream.c + main.c + mediastream.c + mediastreamfilter.c + regsvr.c + amstream_i.c + version.rc + wine + strmiids + uuid + ole32 + advapi32 + ntdll + diff --git a/dll/directx/bdaplgin/bdaplgin.rbuild b/dll/directx/bdaplgin/bdaplgin.rbuild new file mode 100644 index 00000000000..a2d8a1dd705 --- /dev/null +++ b/dll/directx/bdaplgin/bdaplgin.rbuild @@ -0,0 +1,33 @@ + + + + + + + . + ntdll + advapi32 + ole32 + advapi32 + msvcrt + ksproxy + + -fno-exceptions + -fno-rtti + + + /GR- + + + bdaplgin.cpp + bdaplgin.rc + classfactory.cpp + controlnode.cpp + devicecontrol.cpp + digitaldemo.cpp + frequencyfilter.cpp + lnbinfo.cpp + pincontrol.cpp + signalstatistics.cpp + + diff --git a/dll/directx/d3d8/d3d8.rbuild b/dll/directx/d3d8/d3d8.rbuild new file mode 100644 index 00000000000..bbcbf25c3b8 --- /dev/null +++ b/dll/directx/d3d8/d3d8.rbuild @@ -0,0 +1,7 @@ + + + + + d3d8.c + d3d8.rc + diff --git a/dll/directx/d3d8thk/d3d8thk.rbuild b/dll/directx/d3d8thk/d3d8thk.rbuild new file mode 100644 index 00000000000..285670c46f6 --- /dev/null +++ b/dll/directx/d3d8thk/d3d8thk.rbuild @@ -0,0 +1,7 @@ + + + + + gdi32 + d3d8thk.rc + diff --git a/dll/directx/d3d9/d3d9.rbuild b/dll/directx/d3d9/d3d9.rbuild new file mode 100644 index 00000000000..54fc3c5d4c3 --- /dev/null +++ b/dll/directx/d3d9/d3d9.rbuild @@ -0,0 +1,33 @@ + + + + + + advapi32 + user32 + gdi32 + uuid + dxguid + version + d3d8thk + + d3d9.c + d3d9_baseobject.c + d3d9_callbacks.c + d3d9_caps.c + d3d9_create.c + d3d9_cursor.c + d3d9_device.c + d3d9_haldevice.c + d3d9_helpers.c + d3d9_impl.c + d3d9_mipmap.c + d3d9_puredevice.c + d3d9_resource.c + d3d9_swapchain.c + d3d9_texture.c + adapter.c + device.c + format.c + d3d9.rc + diff --git a/dll/directx/ddraw/ddraw.rbuild b/dll/directx/ddraw/ddraw.rbuild new file mode 100644 index 00000000000..016afa6090a --- /dev/null +++ b/dll/directx/ddraw/ddraw.rbuild @@ -0,0 +1,73 @@ + + + + + . + user32 + gdi32 + d3d8thk + dxguid + ole32 + uuid + advapi32 + pseh + + ddraw.rc + main.c + startup.c + cleanup.c + + + ddraw_main.c + ddraw_displaymode.c + ddraw_setcooperativelevel.c + GetCaps.c + GetDeviceIdentifier.c + ddraw_stubs.c + callbacks_dd_hel.c + + + surface_stubs.c + surface_main.c + callbacks_surf_hel.c + createsurface.c + + + clipper_stubs.c + clipper_main.c + + + color_stubs.c + + + DirectD3D_main.c + + + gamma_stubs.c + + + kernel_stubs.c + + + palette.c + createpalette.c + + + videoport_stubs.c + + + DirectDraw7_Vtable.c + DirectDraw4_Vtable.c + DirectDraw2_Vtable.c + DirectDraw_Vtable.c + DirectDrawSurface7_Vtable.c + DirectDrawSurface4_Vtable.c + DirectDrawSurface3_Vtable.c + DirectDrawSurface2_Vtable.c + DirectDrawSurface_Vtable.c + DirectD3D_Vtable.c + DirectD3D2_Vtable.c + DirectD3D3_Vtable.c + DirectD3D7_Vtable.c + + diff --git a/dll/directx/devenum/devenum.rbuild b/dll/directx/devenum/devenum.rbuild new file mode 100644 index 00000000000..3ca2d48c1c7 --- /dev/null +++ b/dll/directx/devenum/devenum.rbuild @@ -0,0 +1,26 @@ + + + + + + 0x600 + . + include/reactos/wine + wine + uuid + ntdll + advapi32 + ole32 + oleaut32 + winmm + dxguid + strmiids + user32 + avicap32 + devenum.rc + createdevenum.c + devenum_main.c + factory.c + mediacatenum.c + parsedisplayname.c + diff --git a/dll/directx/dinput/dinput.rbuild b/dll/directx/dinput/dinput.rbuild new file mode 100644 index 00000000000..e873de7b29f --- /dev/null +++ b/dll/directx/dinput/dinput.rbuild @@ -0,0 +1,27 @@ + + + + + + 0x600 + . + include/reactos/wine + wine + uuid + ntdll + user32 + advapi32 + ole32 + winmm + dxguid + version.rc + data_formats.c + device.c + dinput_main.c + effect_linuxinput.c + joystick_linux.c + joystick_linuxinput.c + keyboard.c + mouse.c + regsvr.c + diff --git a/dll/directx/dinput8/dinput8.rbuild b/dll/directx/dinput8/dinput8.rbuild new file mode 100644 index 00000000000..65f23d513de --- /dev/null +++ b/dll/directx/dinput8/dinput8.rbuild @@ -0,0 +1,21 @@ + + + + + + 0x600 + . + include/reactos/wine + wine + uuid + ntdll + user32 + advapi32 + ole32 + winmm + dxguid + dinput + version.rc + dinput8_main.c + regsvr.c + diff --git a/dll/directx/directx.rbuild b/dll/directx/directx.rbuild new file mode 100644 index 00000000000..97839e654bf --- /dev/null +++ b/dll/directx/directx.rbuild @@ -0,0 +1,62 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/dll/directx/dmusic/dmusic.rbuild b/dll/directx/dmusic/dmusic.rbuild new file mode 100644 index 00000000000..9de6f1abcaf --- /dev/null +++ b/dll/directx/dmusic/dmusic.rbuild @@ -0,0 +1,29 @@ + + + + + + 0x600 + + . + include/reactos/wine + wine + uuid + ntdll + user32 + advapi32 + ole32 + dxguid + dsound + version.rc + buffer.c + clock.c + collection.c + dmusic.c + dmusic_main.c + download.c + downloadedinstrument.c + instrument.c + port.c + regsvr.c + diff --git a/dll/directx/dplay/dplay.rbuild b/dll/directx/dplay/dplay.rbuild new file mode 100644 index 00000000000..1273d33b852 --- /dev/null +++ b/dll/directx/dplay/dplay.rbuild @@ -0,0 +1,18 @@ + + + + + . + include/reactos/wine + wine + uuid + ntdll + user32 + advapi32 + ole32 + winmm + dxguid + dinput + version.rc + dplay_main.c + diff --git a/dll/directx/dplayx/dplayx.rbuild b/dll/directx/dplayx/dplayx.rbuild new file mode 100644 index 00000000000..5292fbd199c --- /dev/null +++ b/dll/directx/dplayx/dplayx.rbuild @@ -0,0 +1,27 @@ + + + + + + . + include/reactos/wine + wine + uuid + ntdll + user32 + advapi32 + ole32 + winmm + dxguid + version.rc + dpclassfactory.c + dplay.c + dplaysp.c + dplayx_global.c + dplayx_main.c + dplayx_messages.c + dplobby.c + lobbysp.c + name_server.c + regsvr.c + diff --git a/dll/directx/dsound/dsound.rbuild b/dll/directx/dsound/dsound.rbuild new file mode 100644 index 00000000000..fa66e5b99a9 --- /dev/null +++ b/dll/directx/dsound/dsound.rbuild @@ -0,0 +1,30 @@ + + + + + + . + include/reactos/wine + + + wine + uuid + ntdll + user32 + advapi32 + ole32 + winmm + dxguid + version.rc + buffer.c + capture.c + dsound.c + dsound_convert.c + dsound_main.c + duplex.c + mixer.c + primary.c + propset.c + regsvr.c + sound3d.c + diff --git a/dll/directx/dsound_new/dsound_new.rbuild b/dll/directx/dsound_new/dsound_new.rbuild new file mode 100644 index 00000000000..5d4baf0e564 --- /dev/null +++ b/dll/directx/dsound_new/dsound_new.rbuild @@ -0,0 +1,31 @@ + + + + + + . + uuid + ntdll + user32 + advapi32 + ole32 + winmm + dxguid + setupapi + ksuser + capture.c + capturebuffer.c + classfactory.c + devicelist.c + directsound.c + dsound.c + enum.c + misc.c + notify.c + primary.c + property.c + regsvr.c + secondary.c + stubs.c + version.rc + diff --git a/dll/directx/dxdiagn/dxdiagn.rbuild b/dll/directx/dxdiagn/dxdiagn.rbuild new file mode 100644 index 00000000000..c874773e1c8 --- /dev/null +++ b/dll/directx/dxdiagn/dxdiagn.rbuild @@ -0,0 +1,21 @@ + + + + + + . + include/reactos/wine + wine + uuid + ntdll + user32 + advapi32 + ole32 + oleaut32 + dxguid + strmiids + container.c + dxdiag_main.c + provider.c + regsvr.c + diff --git a/dll/directx/ksproxy/datatype.cpp b/dll/directx/ksproxy/datatype.cpp index 8ad71a5ca8d..965e847b55b 100644 --- a/dll/directx/ksproxy/datatype.cpp +++ b/dll/directx/ksproxy/datatype.cpp @@ -11,8 +11,6 @@ /* FIXME guid mess */ #ifndef _MSC_VER const GUID IID_IUnknown = {0x00000000, 0x0000, 0x0000, {0xC0, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x46}}; -#else -const GUID IID_IKsDataTypeHandler = {0x5FFBAA02L, 0x49A3, 0x11D0, {0x9F, 0x36, 0x00, 0xAA, 0x00, 0xA2, 0x16, 0xA1}}; #endif const GUID IID_IClassFactory = {0x00000001, 0x0000, 0x0000, {0xC0, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x46}}; diff --git a/dll/directx/ksproxy/input_pin.cpp b/dll/directx/ksproxy/input_pin.cpp index d6b5b5a2fca..e56eacb938c 100644 --- a/dll/directx/ksproxy/input_pin.cpp +++ b/dll/directx/ksproxy/input_pin.cpp @@ -10,10 +10,8 @@ const GUID IID_IKsPinPipe = {0xe539cd90, 0xa8b4, 0x11d1, {0x81, 0x89, 0x00, 0xa0, 0xc9, 0x06, 0x28, 0x02}}; const GUID IID_IKsPinEx = {0x7bb38260L, 0xd19c, 0x11d2, {0xb3, 0x8a, 0x00, 0xa0, 0xc9, 0x5e, 0xc2, 0x2e}}; -#ifdef _MSC_VER -const GUID IID_IKsPin = {0xb61178d1L, 0xa2d9, 0x11cf, {0x9e, 0x53, 0x00, 0xaa, 0x00, 0xa2, 0x16, 0xa1}}; -const GUID IID_IKsInterfaceHandler = {0xD3ABC7E0L, 0x9A61, 0x11D0, {0xA4, 0x0D, 0x00, 0xA0, 0xC9, 0x22, 0x31, 0x96}}; -#endif + + #ifndef _MSC_VER const GUID KSPROPSETID_Connection = {0x1D58C920L, 0xAC9B, 0x11CF, {0xA5, 0xD6, 0x28, 0xDB, 0x04, 0xC1, 0x00, 0x00}}; diff --git a/dll/directx/ksproxy/interface.cpp b/dll/directx/ksproxy/interface.cpp index 67196fbe60f..7eb0fd284d5 100644 --- a/dll/directx/ksproxy/interface.cpp +++ b/dll/directx/ksproxy/interface.cpp @@ -10,8 +10,6 @@ const GUID IID_IKsObject = {0x423c13a2, 0x2070, 0x11d0, {0x9e, 0xf7, 0x00, 0xaa, 0x00, 0xa2, 0x16, 0xa1}}; -extern const GUID IID_IKsInterfaceHandler; - class CKsInterfaceHandler : public IKsInterfaceHandler { public: diff --git a/dll/directx/ksproxy/ksproxy.cpp b/dll/directx/ksproxy/ksproxy.cpp index 545af53154d..7baa7e30496 100644 --- a/dll/directx/ksproxy/ksproxy.cpp +++ b/dll/directx/ksproxy/ksproxy.cpp @@ -16,13 +16,12 @@ const GUID CLSID_KsQualityForwarder = {0xe05592e4, 0xc0b5, 0x11d0, {0 #ifndef _MSC_VER +const GUID CLSID_KsIBasicAudioInterfaceHandler = {0xb9f8ac3e, 0x0f71, 0x11d2, {0xb7, 0x2c, 0x00, 0xc0, 0x4f, 0xb6, 0xbd, 0x3d}}; const GUID KSPROPSETID_Pin = {0x8C134960, 0x51AD, 0x11CF, {0x87, 0x8A, 0x94, 0xF8, 0x01, 0xC1, 0x00, 0x00}}; const GUID KSINTERFACESETID_Standard = {STATIC_KSINTERFACESETID_Standard}; const GUID CLSID_Proxy = {0x17CCA71B, 0xECD7, 0x11D0, {0xB9, 0x08, 0x00, 0xA0, 0xC9, 0x22, 0x31, 0x96}}; #endif -const GUID CLSID_KsIBasicAudioInterfaceHandler = {0xb9f8ac3e, 0x0f71, 0x11d2, {0xb7, 0x2c, 0x00, 0xc0, 0x4f, 0xb6, 0xbd, 0x3d}}; - static INTERFACE_TABLE InterfaceTable[] = { {&MEDIATYPE_Audio, CKsDataTypeHandler_Constructor}, diff --git a/dll/directx/ksproxy/ksproxy.rbuild b/dll/directx/ksproxy/ksproxy.rbuild new file mode 100644 index 00000000000..c81a4c4ec9f --- /dev/null +++ b/dll/directx/ksproxy/ksproxy.rbuild @@ -0,0 +1,42 @@ + + + + + + + . + ntdll + advapi32 + ole32 + setupapi + msvcrt + strmiids + ksuser + + -fno-exceptions + -fno-rtti + + + + /GR- + + allocator.cpp + basicaudio.cpp + classfactory.cpp + clockforward.cpp + cvpconfig.cpp + cvpvbiconfig.cpp + datatype.cpp + enum_mediatypes.cpp + enumpins.cpp + input_pin.cpp + interface.cpp + ksproxy.cpp + ksproxy.rc + mediasample.cpp + node.cpp + output_pin.cpp + proxy.cpp + qualityforward.cpp + + diff --git a/dll/directx/ksproxy/output_pin.cpp b/dll/directx/ksproxy/output_pin.cpp index c096ab4ea54..2bf85c8a06b 100644 --- a/dll/directx/ksproxy/output_pin.cpp +++ b/dll/directx/ksproxy/output_pin.cpp @@ -8,9 +8,6 @@ */ #include "precomp.h" -extern const GUID IID_IKsPin; -extern const GUID IID_IKsInterfaceHandler; - class COutputPin : public IPin, public IKsObject, public IKsPropertySet, @@ -1684,7 +1681,7 @@ COutputPin::Connect(IPin *pReceivePin, const AM_MEDIA_TYPE *pmt) if (GetSupportedSets(&pGuid, &NumGuids)) { // load all proxy plugins - if (FAILED(LoadProxyPlugins(pGuid, NumGuids))) + if (FAILED(LoadProxyPlugins(pGuid, NumGuids))); { #ifdef KSPROXY_TRACE OutputDebugStringW(L"COutputPin::Connect LoadProxyPlugins failed\n"); diff --git a/dll/directx/ksuser/ksuser.rbuild b/dll/directx/ksuser/ksuser.rbuild new file mode 100644 index 00000000000..f316eeedd45 --- /dev/null +++ b/dll/directx/ksuser/ksuser.rbuild @@ -0,0 +1,10 @@ + + + + + . + advapi32 + ntdll + ksuser.c + ksuser.rc + diff --git a/dll/directx/msdmo/msdmo.rbuild b/dll/directx/msdmo/msdmo.rbuild new file mode 100644 index 00000000000..b6dabb41476 --- /dev/null +++ b/dll/directx/msdmo/msdmo.rbuild @@ -0,0 +1,16 @@ + + + . + include/reactos/wine + + dmoreg.c + dmort.c + stubs.c + rsrc.rc + wine + uuid + ole32 + user32 + advapi32 + ntdll + diff --git a/dll/directx/msdmo/stubs.c b/dll/directx/msdmo/stubs.c index dfafe7afd49..1b4dee9a72f 100644 --- a/dll/directx/msdmo/stubs.c +++ b/dll/directx/msdmo/stubs.c @@ -1,7 +1,7 @@ #include #define NDEBUG -#include +#include void WINAPI diff --git a/dll/directx/msdvbnp/msdvbnp.rbuild b/dll/directx/msdvbnp/msdvbnp.rbuild new file mode 100644 index 00000000000..f9cd0ea83b2 --- /dev/null +++ b/dll/directx/msdvbnp/msdvbnp.rbuild @@ -0,0 +1,34 @@ + + + + + + + . + ntdll + advapi32 + ole32 + advapi32 + msvcrt + strmiids + + -fno-exceptions + -fno-rtti + + + /GR- + + + classfactory.cpp + enum_mediatypes.cpp + enumpins.cpp + ethernetfilter.cpp + msdvbnp.cpp + msdvbnp.rc + ipv4.cpp + ipv6.cpp + networkprovider.cpp + pin.cpp + scanningtuner.cpp + + diff --git a/dll/directx/msvidctl/msvidctl.rbuild b/dll/directx/msvidctl/msvidctl.rbuild new file mode 100644 index 00000000000..a603121b1f9 --- /dev/null +++ b/dll/directx/msvidctl/msvidctl.rbuild @@ -0,0 +1,30 @@ + + + + + + + . + ntdll + advapi32 + ole32 + advapi32 + msvcrt + strmiids + + -fno-exceptions + -fno-rtti + + + /GR- + + + classfactory.cpp + enumtuningspaces.cpp + msvidctl.cpp + msvidctl.rc + tunerequest.cpp + tuningspace.cpp + tuningspace_container.cpp + + diff --git a/dll/directx/qedit/qedit.rbuild b/dll/directx/qedit/qedit.rbuild new file mode 100644 index 00000000000..0fd54bf8ea3 --- /dev/null +++ b/dll/directx/qedit/qedit.rbuild @@ -0,0 +1,19 @@ + + + + . + include/reactos/wine + 0x600 + + main.c + mediadet.c + regsvr.c + samplegrabber.c + wine + strmiids + uuid + oleaut32 + ole32 + advapi32 + ntdll + diff --git a/dll/directx/quartz/quartz.rbuild b/dll/directx/quartz/quartz.rbuild new file mode 100644 index 00000000000..4a86c54b112 --- /dev/null +++ b/dll/directx/quartz/quartz.rbuild @@ -0,0 +1,64 @@ + + + + + + + . + include/reactos/wine + 0x600 + + QUARTZ_ + + + wine + uuid + advapi32 + dsound + strmiids + ole32 + oleaut32 + shlwapi + user32 + gdi32 + advapi32 + msvfw32 + msacm32 + ntdll + quartz_proxy + rpcrt4 + pseh + avidec.c + acmwrapper.c + waveparser.c + videorenderer.c + transform.c + systemclock.c + regsvr.c + pin.c + parser.c + nullrenderer.c + mpegsplit.c + memallocator.c + main.c + filtermapper.c + filtergraph.c + filesource.c + enumregfilters.c + enumpins.c + enummoniker.c + enumfilters.c + dsoundrender.c + enummedia.c + control.c + avisplit.c + version.rc + + + + QUARTZ_ + + + quartz_strmif.idl + + \ No newline at end of file diff --git a/dll/directx/wine/d3d8/d3d8.rbuild b/dll/directx/wine/d3d8/d3d8.rbuild new file mode 100644 index 00000000000..84e2a26d275 --- /dev/null +++ b/dll/directx/wine/d3d8/d3d8.rbuild @@ -0,0 +1,32 @@ + + + + + . + include/reactos/wine + + + + uuid + wine + user32 + gdi32 + advapi32 + wined3d + + buffer.c + cubetexture.c + d3d8_main.c + device.c + directx.c + shader.c + surface.c + swapchain.c + texture.c + vertexdeclaration.c + volume.c + volumetexture.c + version.rc + + wineheaders + diff --git a/dll/directx/wine/d3d9/d3d9.rbuild b/dll/directx/wine/d3d9/d3d9.rbuild new file mode 100644 index 00000000000..af8412a9cb4 --- /dev/null +++ b/dll/directx/wine/d3d9/d3d9.rbuild @@ -0,0 +1,34 @@ + + + + + . + include/reactos/wine + + + + uuid + wine + user32 + gdi32 + advapi32 + wined3d + + buffer.c + cubetexture.c + d3d9_main.c + device.c + directx.c + query.c + shader.c + stateblock.c + surface.c + swapchain.c + texture.c + vertexdeclaration.c + volume.c + volumetexture.c + version.rc + + wineheaders + diff --git a/dll/directx/wine/d3dx9_24/d3dx9_24.rbuild b/dll/directx/wine/d3dx9_24/d3dx9_24.rbuild new file mode 100644 index 00000000000..a59b236c196 --- /dev/null +++ b/dll/directx/wine/d3dx9_24/d3dx9_24.rbuild @@ -0,0 +1,20 @@ + + + + + . + include/reactos/wine + + + d3d9 + wine + user32 + gdi32 + advapi32 + wined3d + + d3dx9_24_main.c + version.rc + + wineheaders + diff --git a/dll/directx/wine/d3dx9_24/d3dx9_24.spec b/dll/directx/wine/d3dx9_24/d3dx9_24.spec index 6f86ff0d57c..3a7e007e873 100644 --- a/dll/directx/wine/d3dx9_24/d3dx9_24.spec +++ b/dll/directx/wine/d3dx9_24/d3dx9_24.spec @@ -26,7 +26,7 @@ @ stdcall D3DXConcatenateMeshes(ptr long long ptr ptr ptr ptr ptr) d3dx9_36.D3DXConcatenateMeshes @ stdcall D3DXConvertMeshSubsetToSingleStrip(ptr long long ptr ptr) d3dx9_36.D3DXConvertMeshSubsetToSingleStrip @ stdcall D3DXConvertMeshSubsetToStrips(ptr long long ptr ptr ptr ptr) d3dx9_36.D3DXConvertMeshSubsetToStrips -@ stdcall -stub D3DXCpuOptimizations(long) +@ stub D3DXCpuOptimizations @ stdcall D3DXCreateAnimationController(long long long long ptr) d3dx9_36.D3DXCreateAnimationController @ stdcall D3DXCreateBox(ptr long long long ptr ptr) d3dx9_36.D3DXCreateBox @ stdcall D3DXCreateBuffer(long ptr) d3dx9_36.D3DXCreateBuffer @@ -159,8 +159,8 @@ @ stdcall D3DXGetShaderSamplers(ptr ptr ptr) d3dx9_36.D3DXGetShaderSamplers @ stdcall D3DXGetShaderSize(ptr) d3dx9_36.D3DXGetShaderSize @ stdcall D3DXGetShaderVersion(ptr) d3dx9_36.D3DXGetShaderVersion -@ stdcall -stub D3DXGetTargetDescByName(long long long) -@ stdcall -stub D3DXGetTargetDescByVersion(long long long) +@ stub D3DXGetTargetDescByName +@ stub D3DXGetTargetDescByVersion @ stdcall D3DXGetVertexShaderProfile(ptr) d3dx9_36.D3DXGetVertexShaderProfile @ stdcall D3DXIntersect(ptr ptr ptr ptr ptr ptr ptr ptr ptr ptr) d3dx9_36.D3DXIntersect @ stdcall D3DXIntersectSubset(ptr long ptr ptr ptr ptr ptr ptr ptr ptr ptr) d3dx9_36.D3DXIntersectSubset @@ -185,7 +185,7 @@ @ stdcall D3DXLoadSurfaceFromMemory(ptr ptr ptr ptr long long ptr ptr long long) d3dx9_36.D3DXLoadSurfaceFromMemory @ stdcall D3DXLoadSurfaceFromResourceA(ptr ptr ptr long ptr ptr long long ptr) d3dx9_36.D3DXLoadSurfaceFromResourceA @ stdcall D3DXLoadSurfaceFromResourceW(ptr ptr ptr long ptr ptr long long ptr) d3dx9_36.D3DXLoadSurfaceFromResourceW -@ stdcall D3DXLoadSurfaceFromSurface(ptr ptr ptr ptr ptr ptr long long) d3dx9_36.D3DXLoadSurfaceFromSurface +@ stdcall D3DXLoadSurfaceFromSurface(ptr ptr ptr ptr ptr ptr long) d3dx9_36.D3DXLoadSurfaceFromSurface @ stdcall D3DXLoadVolumeFromFileA(ptr ptr ptr ptr ptr long long ptr) d3dx9_36.D3DXLoadVolumeFromFileA @ stdcall D3DXLoadVolumeFromFileInMemory(ptr ptr ptr ptr long ptr long long ptr) d3dx9_36.D3DXLoadVolumeFromFileInMemory @ stdcall D3DXLoadVolumeFromFileW(ptr ptr ptr ptr ptr long long ptr) d3dx9_36.D3DXLoadVolumeFromFileW diff --git a/dll/directx/wine/d3dx9_25/d3dx9_25.rbuild b/dll/directx/wine/d3dx9_25/d3dx9_25.rbuild new file mode 100644 index 00000000000..0fadc998ba1 --- /dev/null +++ b/dll/directx/wine/d3dx9_25/d3dx9_25.rbuild @@ -0,0 +1,20 @@ + + + + + . + include/reactos/wine + + + d3d9 + wine + user32 + gdi32 + advapi32 + wined3d + + d3dx9_25_main.c + version.rc + + wineheaders + diff --git a/dll/directx/wine/d3dx9_26/d3dx9_26.rbuild b/dll/directx/wine/d3dx9_26/d3dx9_26.rbuild new file mode 100644 index 00000000000..1a5965c2513 --- /dev/null +++ b/dll/directx/wine/d3dx9_26/d3dx9_26.rbuild @@ -0,0 +1,20 @@ + + + + + . + include/reactos/wine + + + d3d9 + wine + user32 + gdi32 + advapi32 + wined3d + + d3dx9_26_main.c + version.rc + + wineheaders + diff --git a/dll/directx/wine/d3dx9_27/d3dx9_27.rbuild b/dll/directx/wine/d3dx9_27/d3dx9_27.rbuild new file mode 100644 index 00000000000..daea575dc78 --- /dev/null +++ b/dll/directx/wine/d3dx9_27/d3dx9_27.rbuild @@ -0,0 +1,20 @@ + + + + + . + include/reactos/wine + + + d3d9 + wine + user32 + gdi32 + advapi32 + wined3d + + d3dx9_27_main.c + version.rc + + wineheaders + diff --git a/dll/directx/wine/d3dx9_28/d3dx9_28.rbuild b/dll/directx/wine/d3dx9_28/d3dx9_28.rbuild new file mode 100644 index 00000000000..79f53825d46 --- /dev/null +++ b/dll/directx/wine/d3dx9_28/d3dx9_28.rbuild @@ -0,0 +1,20 @@ + + + + + . + include/reactos/wine + + + d3d9 + wine + user32 + gdi32 + advapi32 + wined3d + + d3dx9_28_main.c + version.rc + + wineheaders + diff --git a/dll/directx/wine/d3dx9_29/d3dx9_29.rbuild b/dll/directx/wine/d3dx9_29/d3dx9_29.rbuild new file mode 100644 index 00000000000..61898fcf4f5 --- /dev/null +++ b/dll/directx/wine/d3dx9_29/d3dx9_29.rbuild @@ -0,0 +1,20 @@ + + + + + . + include/reactos/wine + + + d3d9 + wine + user32 + gdi32 + advapi32 + wined3d + + d3dx9_29_main.c + version.rc + + wineheaders + diff --git a/dll/directx/wine/d3dx9_30/d3dx9_30.rbuild b/dll/directx/wine/d3dx9_30/d3dx9_30.rbuild new file mode 100644 index 00000000000..e7c5eb68535 --- /dev/null +++ b/dll/directx/wine/d3dx9_30/d3dx9_30.rbuild @@ -0,0 +1,20 @@ + + + + + . + include/reactos/wine + + + d3d9 + wine + user32 + gdi32 + advapi32 + wined3d + + d3dx9_30_main.c + version.rc + + wineheaders + diff --git a/dll/directx/wine/d3dx9_31/d3dx9_31.rbuild b/dll/directx/wine/d3dx9_31/d3dx9_31.rbuild new file mode 100644 index 00000000000..86b91f21f86 --- /dev/null +++ b/dll/directx/wine/d3dx9_31/d3dx9_31.rbuild @@ -0,0 +1,20 @@ + + + + + . + include/reactos/wine + + + d3d9 + wine + user32 + gdi32 + advapi32 + wined3d + + d3dx9_31_main.c + version.rc + + wineheaders + diff --git a/dll/directx/wine/d3dx9_32/d3dx9_32.rbuild b/dll/directx/wine/d3dx9_32/d3dx9_32.rbuild new file mode 100644 index 00000000000..f8bc87fa318 --- /dev/null +++ b/dll/directx/wine/d3dx9_32/d3dx9_32.rbuild @@ -0,0 +1,20 @@ + + + + + . + include/reactos/wine + + + d3d9 + wine + user32 + gdi32 + advapi32 + wined3d + + d3dx9_32_main.c + version.rc + + wineheaders + diff --git a/dll/directx/wine/d3dx9_33/d3dx9_33.rbuild b/dll/directx/wine/d3dx9_33/d3dx9_33.rbuild new file mode 100644 index 00000000000..d45efae1f40 --- /dev/null +++ b/dll/directx/wine/d3dx9_33/d3dx9_33.rbuild @@ -0,0 +1,20 @@ + + + + + . + include/reactos/wine + + + d3d9 + wine + user32 + gdi32 + advapi32 + wined3d + + d3dx9_33_main.c + version.rc + + wineheaders + diff --git a/dll/directx/wine/d3dx9_34/d3dx9_34.rbuild b/dll/directx/wine/d3dx9_34/d3dx9_34.rbuild new file mode 100644 index 00000000000..778d6adce91 --- /dev/null +++ b/dll/directx/wine/d3dx9_34/d3dx9_34.rbuild @@ -0,0 +1,20 @@ + + + + + . + include/reactos/wine + + + d3d9 + wine + user32 + gdi32 + advapi32 + wined3d + + d3dx9_34_main.c + version.rc + + wineheaders + diff --git a/dll/directx/wine/d3dx9_35/d3dx9_35.rbuild b/dll/directx/wine/d3dx9_35/d3dx9_35.rbuild new file mode 100644 index 00000000000..35bb8b42720 --- /dev/null +++ b/dll/directx/wine/d3dx9_35/d3dx9_35.rbuild @@ -0,0 +1,20 @@ + + + + + . + include/reactos/wine + + + d3d9 + wine + user32 + gdi32 + advapi32 + wined3d + + d3dx9_35_main.c + version.rc + + wineheaders + diff --git a/dll/directx/wine/d3dx9_36/d3dx9_36.rbuild b/dll/directx/wine/d3dx9_36/d3dx9_36.rbuild new file mode 100644 index 00000000000..52fc95074c7 --- /dev/null +++ b/dll/directx/wine/d3dx9_36/d3dx9_36.rbuild @@ -0,0 +1,30 @@ + + + + + . + include/reactos/wine + + + d3d9 + wine + user32 + gdi32 + advapi32 + msvcrt + wined3d + + core.c + d3dx9_36_main.c + font.c + math.c + mesh.c + shader.c + sprite.c + surface.c + texture.c + util.c + version.rc + + wineheaders + diff --git a/dll/directx/wine/d3dx9_36/d3dx9_36.spec b/dll/directx/wine/d3dx9_36/d3dx9_36.spec index 94b29bcfd02..792408194d2 100644 --- a/dll/directx/wine/d3dx9_36/d3dx9_36.spec +++ b/dll/directx/wine/d3dx9_36/d3dx9_36.spec @@ -4,150 +4,150 @@ @ stdcall D3DXAssembleShaderFromResourceA(long str ptr ptr long ptr ptr) @ stdcall D3DXAssembleShaderFromResourceW(long wstr ptr ptr long ptr ptr) @ stdcall D3DXBoxBoundProbe(ptr ptr ptr ptr) -@ stdcall -stub D3DXCheckCubeTextureRequirements(ptr ptr ptr long ptr long) -@ stdcall -stub D3DXCheckTextureRequirements(ptr ptr ptr ptr long ptr long) +@ stub D3DXCheckCubeTextureRequirements +@ stub D3DXCheckTextureRequirements @ stdcall D3DXCheckVersion(long long) -@ stdcall -stub D3DXCheckVolumeTextureRequirements(ptr ptr ptr ptr ptr long ptr long) -@ stdcall -stub D3DXCleanMesh(ptr ptr ptr ptr ptr) +@ stub D3DXCheckVolumeTextureRequirements +@ stub D3DXCleanMesh @ stdcall D3DXColorAdjustContrast(ptr ptr long) @ stdcall D3DXColorAdjustSaturation(ptr ptr long) @ stdcall D3DXCompileShader(ptr long ptr ptr ptr ptr long ptr ptr ptr) -@ stdcall -stub D3DXCompileShaderFromFileA(ptr ptr ptr ptr ptr long ptr ptr ptr) -@ stdcall -stub D3DXCompileShaderFromFileW(ptr ptr ptr ptr ptr long ptr ptr ptr) -@ stdcall -stub D3DXCompileShaderFromResourceA(long ptr ptr ptr ptr ptr long ptr ptr ptr) -@ stdcall -stub D3DXCompileShaderFromResourceW(long ptr ptr ptr ptr ptr long ptr ptr ptr) +@ stub D3DXCompileShaderFromFileA +@ stub D3DXCompileShaderFromFileW +@ stub D3DXCompileShaderFromResourceA +@ stub D3DXCompileShaderFromResourceW @ stdcall D3DXComputeBoundingBox(ptr long long ptr ptr) @ stdcall D3DXComputeBoundingSphere(ptr long long ptr ptr) @ stub D3DXComputeIMTFromPerTexelSignal @ stub D3DXComputeIMTFromPerVertexSignal @ stub D3DXComputeIMTFromSignal @ stub D3DXComputeIMTFromTexture -@ stdcall -stub D3DXComputeNormalMap(ptr ptr ptr long long long) -@ stdcall -stub D3DXComputeNormals(ptr ptr) -@ stdcall -stub D3DXComputeTangent(ptr long long long long ptr) -@ stdcall -stub D3DXComputeTangentFrame(ptr long) -@ stdcall -stub D3DXComputeTangentFrameEx(ptr long long long long long long long long long ptr long long long ptr ptr) -@ stdcall -stub D3DXConcatenateMeshes(ptr long long ptr ptr ptr ptr ptr) -@ stdcall -stub D3DXConvertMeshSubsetToSingleStrip(ptr long long ptr ptr) -@ stdcall -stub D3DXConvertMeshSubsetToStrips(ptr long long ptr ptr ptr ptr) -@ stdcall -stub D3DXCreateAnimationController(long long long long ptr) -@ stdcall -stub D3DXCreateBox(ptr long long long ptr ptr) +@ stub D3DXComputeNormalMap +@ stub D3DXComputeNormals +@ stub D3DXComputeTangent +@ stub D3DXComputeTangentFrame +@ stub D3DXComputeTangentFrameEx +@ stub D3DXConcatenateMeshes +@ stub D3DXConvertMeshSubsetToSingleStrip +@ stub D3DXConvertMeshSubsetToStrips +@ stub D3DXCreateAnimationController +@ stub D3DXCreateBox @ stdcall D3DXCreateBuffer(long ptr) -@ stdcall -stub D3DXCreateCompressedAnimationSet(ptr long long ptr long ptr ptr) -@ stdcall -stub D3DXCreateCubeTexture(ptr long long long long long ptr) -@ stdcall -stub D3DXCreateCubeTextureFromFileA(ptr ptr ptr) -@ stdcall -stub D3DXCreateCubeTextureFromFileExA(ptr ptr long long long long long long long long ptr ptr ptr) -@ stdcall -stub D3DXCreateCubeTextureFromFileExW(ptr ptr long long long long long long long long ptr ptr ptr) -@ stdcall -stub D3DXCreateCubeTextureFromFileInMemory(ptr ptr long ptr) -@ stdcall -stub D3DXCreateCubeTextureFromFileInMemoryEx(ptr ptr long long long long long long long long long ptr ptr ptr) -@ stdcall -stub D3DXCreateCubeTextureFromFileW(ptr ptr ptr) -@ stdcall -stub D3DXCreateCubeTextureFromResourceA(ptr long ptr ptr) d3dx9_36.D3DXCreateCubeTextureFromResourceA -@ stdcall -stub D3DXCreateCubeTextureFromResourceExA(ptr long long long long long long long long long long ptr ptr ptr) -@ stdcall -stub D3DXCreateCubeTextureFromResourceExW(ptr long long long long long long long long long long ptr ptr ptr) -@ stdcall -stub D3DXCreateCubeTextureFromResourceW(ptr long ptr ptr) -@ stdcall -stub D3DXCreateCylinder(ptr long long long long long ptr ptr) -@ stdcall -stub D3DXCreateEffect(ptr ptr long ptr ptr long ptr ptr ptr) -@ stdcall -stub D3DXCreateEffectCompiler(ptr long ptr ptr long ptr ptr) -@ stdcall -stub D3DXCreateEffectCompilerFromFileA(ptr ptr ptr long ptr ptr) -@ stdcall -stub D3DXCreateEffectCompilerFromFileW(ptr ptr ptr long ptr ptr) -@ stdcall -stub D3DXCreateEffectCompilerFromResourceA(long ptr ptr ptr long ptr ptr) -@ stdcall -stub D3DXCreateEffectCompilerFromResourceW(long ptr ptr ptr long ptr ptr) -@ stdcall -stub D3DXCreateEffectEx(ptr ptr long ptr ptr ptr long ptr ptr ptr) -@ stdcall -stub D3DXCreateEffectFromFileA(ptr ptr ptr ptr long ptr ptr ptr) -@ stdcall -stub D3DXCreateEffectFromFileExA(ptr ptr ptr ptr ptr long ptr ptr ptr) -@ stdcall -stub D3DXCreateEffectFromFileExW(ptr ptr ptr ptr ptr long ptr ptr ptr) -@ stdcall -stub D3DXCreateEffectFromFileW(ptr ptr ptr ptr long ptr ptr ptr) -@ stdcall -stub D3DXCreateEffectFromResourceA(ptr long ptr ptr ptr long ptr ptr ptr) -@ stdcall -stub D3DXCreateEffectFromResourceExA(ptr long ptr ptr ptr ptr long ptr ptr ptr) -@ stdcall -stub D3DXCreateEffectFromResourceExW(ptr long ptr ptr ptr ptr long ptr ptr ptr) -@ stdcall -stub D3DXCreateEffectFromResourceW(ptr long ptr ptr ptr long ptr ptr ptr) -@ stdcall -stub D3DXCreateEffectPool(ptr) +@ stub D3DXCreateCompressedAnimationSet +@ stub D3DXCreateCubeTexture +@ stub D3DXCreateCubeTextureFromFileA +@ stub D3DXCreateCubeTextureFromFileExA +@ stub D3DXCreateCubeTextureFromFileExW +@ stub D3DXCreateCubeTextureFromFileInMemory +@ stub D3DXCreateCubeTextureFromFileInMemoryEx +@ stub D3DXCreateCubeTextureFromFileW +@ stub D3DXCreateCubeTextureFromResourceA +@ stub D3DXCreateCubeTextureFromResourceExA +@ stub D3DXCreateCubeTextureFromResourceExW +@ stub D3DXCreateCubeTextureFromResourceW +@ stub D3DXCreateCylinder +@ stub D3DXCreateEffect +@ stub D3DXCreateEffectCompiler +@ stub D3DXCreateEffectCompilerFromFileA +@ stub D3DXCreateEffectCompilerFromFileW +@ stub D3DXCreateEffectCompilerFromResourceA +@ stub D3DXCreateEffectCompilerFromResourceW +@ stub D3DXCreateEffectEx +@ stub D3DXCreateEffectFromFileA +@ stub D3DXCreateEffectFromFileExA +@ stub D3DXCreateEffectFromFileExW +@ stub D3DXCreateEffectFromFileW +@ stub D3DXCreateEffectFromResourceA +@ stub D3DXCreateEffectFromResourceExA +@ stub D3DXCreateEffectFromResourceExW +@ stub D3DXCreateEffectFromResourceW +@ stub D3DXCreateEffectPool @ stdcall D3DXCreateFontA(ptr long long long long long long long long long str ptr) @ stdcall D3DXCreateFontIndirectA(ptr ptr ptr) @ stdcall D3DXCreateFontIndirectW(ptr ptr ptr) @ stdcall D3DXCreateFontW(ptr long long long long long long long long long wstr ptr) -@ stdcall -stub D3DXCreateFragmentLinker(ptr long ptr) +@ stub D3DXCreateFragmentLinker @ stub D3DXCreateFragmentLinkerEx -@ stdcall -stub D3DXCreateKeyframedAnimationSet(ptr long long long long ptr ptr) -@ stdcall -stub D3DXCreateLine(ptr ptr) +@ stub D3DXCreateKeyframedAnimationSet +@ stub D3DXCreateLine @ stdcall D3DXCreateMatrixStack(long ptr) -@ stdcall -stub D3DXCreateMesh(long long long ptr ptr ptr) -@ stdcall -stub D3DXCreateMeshFVF(long long long long ptr ptr) -@ stdcall -stub D3DXCreateNPatchMesh(ptr ptr) -@ stdcall -stub D3DXCreatePMeshFromStream(ptr long ptr ptr ptr ptr ptr) -@ stdcall -stub D3DXCreatePatchMesh(ptr long long long ptr ptr ptr) -@ stdcall -stub D3DXCreatePolygon(ptr long long ptr ptr) -@ stdcall -stub D3DXCreatePRTBuffer(long long long ptr) -@ stdcall -stub D3DXCreatePRTBufferTex(long long long long ptr) -@ stdcall -stub D3DXCreatePRTCompBuffer(long long long ptr ptr ptr ptr) -@ stdcall -stub D3DXCreatePRTEngine(ptr ptr long ptr ptr) -@ stdcall -stub D3DXCreateRenderToEnvMap(ptr long long long long long ptr) -@ stdcall -stub D3DXCreateRenderToSurface(ptr long long long long long ptr) -@ stdcall -stub D3DXCreateSPMesh(ptr ptr ptr ptr ptr) -@ stdcall -stub D3DXCreateSkinInfo(long ptr long ptr) -@ stdcall -stub D3DXCreateSkinInfoFromBlendedMesh(ptr long ptr ptr) -@ stdcall -stub D3DXCreateSkinInfoFVF(long long long ptr) -@ stdcall -stub D3DXCreateSphere(ptr long long long ptr ptr) +@ stub D3DXCreateMesh +@ stub D3DXCreateMeshFVF +@ stub D3DXCreateNPatchMesh +@ stub D3DXCreatePMeshFromStream +@ stub D3DXCreatePatchMesh +@ stub D3DXCreatePolygon +@ stub D3DXCreatePRTBuffer +@ stub D3DXCreatePRTBufferTex +@ stub D3DXCreatePRTCompBuffer +@ stub D3DXCreatePRTEngine +@ stub D3DXCreateRenderToEnvMap +@ stub D3DXCreateRenderToSurface +@ stub D3DXCreateSPMesh +@ stub D3DXCreateSkinInfo +@ stub D3DXCreateSkinInfoFromBlendedMesh +@ stub D3DXCreateSkinInfoFVF +@ stub D3DXCreateSphere @ stdcall D3DXCreateSprite(ptr ptr) -@ stdcall -stub D3DXCreateTeapot(ptr ptr ptr) -@ stdcall -stub D3DXCreateTextA(ptr long ptr long long ptr ptr ptr) -@ stdcall -stub D3DXCreateTextW(ptr long ptr long long ptr ptr ptr) +@ stub D3DXCreateTeapot +@ stub D3DXCreateTextA +@ stub D3DXCreateTextW @ stdcall D3DXCreateTexture(ptr long long long long long long ptr) -@ stdcall -stub D3DXCreateTextureFromFileA(ptr ptr ptr) -@ stdcall -stub D3DXCreateTextureFromFileExA(ptr ptr long long long long long long long long long ptr ptr ptr) -@ stdcall -stub D3DXCreateTextureFromFileExW(ptr ptr long long long long long long long long long ptr ptr ptr) -@ stdcall -stub D3DXCreateTextureFromFileInMemory(ptr ptr long ptr) -@ stdcall -stub D3DXCreateTextureFromFileInMemoryEx(ptr ptr long long long long long long long long long long ptr ptr ptr) -@ stdcall -stub D3DXCreateTextureFromFileW(ptr ptr ptr) -@ stdcall -stub D3DXCreateTextureFromResourceA(ptr long ptr ptr) -@ stdcall -stub D3DXCreateTextureFromResourceExA(ptr long ptr long long long long long long long long long ptr ptr ptr) -@ stdcall -stub D3DXCreateTextureFromResourceExW(ptr long ptr long long long long long long long long long ptr ptr ptr) -@ stdcall -stub D3DXCreateTextureFromResourceW(ptr long ptr ptr) -@ stdcall -stub D3DXCreateTextureGutterHelper(long long ptr long ptr) -@ stdcall -stub D3DXCreateTextureShader(ptr ptr) -@ stdcall -stub D3DXCreateTorus(ptr long long long long ptr ptr) -@ stdcall -stub D3DXCreateVolumeTexture(ptr long long long long long long long ptr) -@ stdcall -stub D3DXCreateVolumeTextureFromFileA(ptr ptr ptr) -@ stdcall -stub D3DXCreateVolumeTextureFromFileExA(ptr ptr long long long long long long long long long long ptr ptr ptr) -@ stdcall -stub D3DXCreateVolumeTextureFromFileExW(ptr ptr long long long long long long long long long long ptr ptr ptr) -@ stdcall -stub D3DXCreateVolumeTextureFromFileInMemory(ptr ptr long ptr) -@ stdcall -stub D3DXCreateVolumeTextureFromFileInMemoryEx(ptr ptr long long long long long long long long long long long ptr ptr ptr) -@ stdcall -stub D3DXCreateVolumeTextureFromFileW(ptr ptr ptr) -@ stdcall -stub D3DXCreateVolumeTextureFromResourceA(ptr long ptr ptr) -@ stdcall -stub D3DXCreateVolumeTextureFromResourceExA(ptr long ptr long long long long long long long long long long ptr ptr ptr) -@ stdcall -stub D3DXCreateVolumeTextureFromResourceExW(ptr long ptr long long long long long long long long long long ptr ptr ptr) -@ stdcall -stub D3DXCreateVolumeTextureFromResourceW(ptr long ptr ptr) +@ stub D3DXCreateTextureFromFileA +@ stub D3DXCreateTextureFromFileExA +@ stub D3DXCreateTextureFromFileExW +@ stub D3DXCreateTextureFromFileInMemory +@ stub D3DXCreateTextureFromFileInMemoryEx +@ stub D3DXCreateTextureFromFileW +@ stub D3DXCreateTextureFromResourceA +@ stub D3DXCreateTextureFromResourceExA +@ stub D3DXCreateTextureFromResourceExW +@ stub D3DXCreateTextureFromResourceW +@ stub D3DXCreateTextureGutterHelper +@ stub D3DXCreateTextureShader +@ stub D3DXCreateTorus +@ stub D3DXCreateVolumeTexture +@ stub D3DXCreateVolumeTextureFromFileA +@ stub D3DXCreateVolumeTextureFromFileExA +@ stub D3DXCreateVolumeTextureFromFileExW +@ stub D3DXCreateVolumeTextureFromFileInMemory +@ stub D3DXCreateVolumeTextureFromFileInMemoryEx +@ stub D3DXCreateVolumeTextureFromFileW +@ stub D3DXCreateVolumeTextureFromResourceA +@ stub D3DXCreateVolumeTextureFromResourceExA +@ stub D3DXCreateVolumeTextureFromResourceExW +@ stub D3DXCreateVolumeTextureFromResourceW @ stdcall D3DXDebugMute(long) -@ stdcall -stub D3DXDeclaratorFromFVF(long ptr) -@ stdcall -stub D3DXDisassembleEffect(ptr long ptr) -@ stdcall -stub D3DXDisassembleShader(ptr long ptr ptr) -@ stdcall -stub D3DXFileCreate(ptr) -@ stdcall -stub D3DXFillCubeTexture(ptr ptr ptr) -@ stdcall -stub D3DXFillCubeTextureTX(ptr ptr)TX -@ stdcall -stub D3DXFillTexture(ptr ptr ptr) -@ stdcall -stub D3DXFillTextureTX(ptr ptr) -@ stdcall -stub D3DXFillVolumeTexture(ptr ptr ptr) -@ stdcall -stub D3DXFillVolumeTextureTX(ptr ptr) -@ stdcall -stub D3DXFilterTexture(ptr ptr long long) +@ stub D3DXDeclaratorFromFVF +@ stub D3DXDisassembleEffect +@ stub D3DXDisassembleShader +@ stub D3DXFileCreate +@ stub D3DXFillCubeTexture +@ stub D3DXFillCubeTextureTX +@ stub D3DXFillTexture +@ stub D3DXFillTextureTX +@ stub D3DXFillVolumeTexture +@ stub D3DXFillVolumeTextureTX +@ stub D3DXFilterTexture @ stdcall D3DXFindShaderComment(ptr long ptr ptr) -@ stdcall -stub D3DXFloat16To32Array(ptr ptr long) -@ stdcall -stub D3DXFloat32To16Array(ptr ptr long) -@ stdcall -stub D3DXFrameAppendChild(ptr ptr) -@ stdcall -stub D3DXFrameCalculateBoundingSphere(ptr ptr ptr) -@ stdcall -stub D3DXFrameDestroy(ptr ptr) -@ stdcall -stub D3DXFrameFind(ptr ptr) -@ stdcall -stub D3DXFrameNumNamedMatrices(ptr) -@ stdcall -stub D3DXFrameRegisterNamedMatrices(ptr ptr) +@ stub D3DXFloat16To32Array +@ stub D3DXFloat32To16Array +@ stub D3DXFrameAppendChild +@ stub D3DXFrameCalculateBoundingSphere +@ stub D3DXFrameDestroy +@ stub D3DXFrameFind +@ stub D3DXFrameNumNamedMatrices +@ stub D3DXFrameRegisterNamedMatrices @ stdcall D3DXFresnelTerm(long long) -@ stdcall -stub D3DXFVFFromDeclarator(ptr ptr) -@ stdcall -stub D3DXGatherFragments(ptr long ptr ptr long ptr ptr) -@ stdcall -stub D3DXGatherFragmentsFromFileA(ptr ptr ptr long ptr ptr) -@ stdcall -stub D3DXGatherFragmentsFromFileW(ptr ptr ptr long ptr ptr) -@ stdcall -stub D3DXGatherFragmentsFromResourceA(long ptr ptr ptr long ptr ptr) -@ stdcall -stub D3DXGatherFragmentsFromResourceW(long ptr ptr ptr long ptr ptr) -@ stdcall -stub D3DXGenerateOutputDecl(ptr ptr) -@ stdcall -stub D3DXGeneratePMesh(ptr ptr ptr ptr long long ptr) -@ stdcall -stub D3DXGetDeclLength(ptr) +@ stub D3DXFVFFromDeclarator +@ stub D3DXGatherFragments +@ stub D3DXGatherFragmentsFromFileA +@ stub D3DXGatherFragmentsFromFileW +@ stub D3DXGatherFragmentsFromResourceA +@ stub D3DXGatherFragmentsFromResourceW +@ stub D3DXGenerateOutputDecl +@ stub D3DXGeneratePMesh +@ stub D3DXGetDeclLength @ stdcall D3DXGetDeclVertexSize(ptr long) @ stdcall D3DXGetDriverLevel(ptr) @ stdcall D3DXGetFVFVertexSize(long) @@ -159,29 +159,29 @@ @ stdcall D3DXGetPixelShaderProfile(ptr) @ stdcall D3DXGetShaderConstantTable(ptr ptr) @ stdcall D3DXGetShaderConstantTableEx(ptr long ptr) -@ stdcall -stub D3DXGetShaderInputSemantics(ptr ptr ptr) -@ stdcall -stub D3DXGetShaderOutputSemantics(ptr ptr ptr) -@ stdcall -stub D3DXGetShaderSamplers(ptr ptr ptr) +@ stub D3DXGetShaderInputSemantics +@ stub D3DXGetShaderOutputSemantics +@ stub D3DXGetShaderSamplers @ stdcall D3DXGetShaderSize(ptr) @ stdcall D3DXGetShaderVersion(ptr) @ stdcall D3DXGetVertexShaderProfile(ptr) -@ stdcall -stub D3DXIntersect(ptr ptr ptr ptr ptr ptr ptr ptr ptr ptr) -@ stdcall -stub D3DXIntersectSubset(ptr long ptr ptr ptr ptr ptr ptr ptr ptr ptr) +@ stub D3DXIntersect +@ stub D3DXIntersectSubset @ stdcall D3DXIntersectTri(ptr ptr ptr ptr ptr ptr ptr ptr) -@ stdcall -stub D3DXLoadMeshFromXA(ptr long ptr ptr ptr ptr ptr ptr) -@ stdcall -stub D3DXLoadMeshFromXInMemory(ptr long long ptr ptr ptr ptr ptr ptr) -@ stdcall -stub D3DXLoadMeshFromXResource(long ptr ptr long ptr ptr ptr ptr ptr ptr) -@ stdcall -stub D3DXLoadMeshFromXW(ptr long ptr ptr ptr ptr ptr ptr) -@ stdcall -stub D3DXLoadMeshFromXof(ptr long ptr ptr ptr ptr ptr ptr) -@ stdcall -stub D3DXLoadMeshHierarchyFromXA(ptr long ptr ptr ptr ptr ptr) -@ stdcall -stub D3DXLoadMeshHierarchyFromXInMemory(ptr long long ptr ptr ptr ptr ptr) -@ stdcall -stub D3DXLoadMeshHierarchyFromXW(ptr long ptr ptr ptr ptr ptr) -@ stdcall -stub D3DXLoadPatchMeshFromXof(ptr long ptr ptr ptr long ptr) -@ stdcall -stub D3DXLoadPRTBufferFromFileA(ptr ptr) -@ stdcall -stub D3DXLoadPRTBufferFromFileW(ptr ptr) -@ stdcall -stub D3DXLoadPRTCompBufferFromFileA(ptr ptr) -@ stdcall -stub D3DXLoadPRTCompBufferFromFileW(ptr ptr) -@ stdcall -stub D3DXLoadSkinMeshFromXof(ptr long ptr ptr ptr ptr ptr ptr ptr) +@ stub D3DXLoadMeshFromXA +@ stub D3DXLoadMeshFromXInMemory +@ stub D3DXLoadMeshFromXResource +@ stub D3DXLoadMeshFromXW +@ stub D3DXLoadMeshFromXof +@ stub D3DXLoadMeshHierarchyFromXA +@ stub D3DXLoadMeshHierarchyFromXInMemory +@ stub D3DXLoadMeshHierarchyFromXW +@ stub D3DXLoadPatchMeshFromXof +@ stub D3DXLoadPRTBufferFromFileA +@ stub D3DXLoadPRTBufferFromFileW +@ stub D3DXLoadPRTCompBufferFromFileA +@ stub D3DXLoadPRTCompBufferFromFileW +@ stub D3DXLoadSkinMeshFromXof @ stdcall D3DXLoadSurfaceFromFileA(ptr ptr ptr str ptr long long ptr) @ stdcall D3DXLoadSurfaceFromFileInMemory(ptr ptr ptr ptr long ptr long long ptr) @ stdcall D3DXLoadSurfaceFromFileW(ptr ptr ptr wstr ptr long long ptr) @@ -189,13 +189,13 @@ @ stdcall D3DXLoadSurfaceFromResourceA(ptr ptr ptr ptr str ptr long long ptr) @ stdcall D3DXLoadSurfaceFromResourceW(ptr ptr ptr ptr wstr ptr long long ptr) @ stdcall D3DXLoadSurfaceFromSurface(ptr ptr ptr ptr ptr ptr long long) -@ stdcall -stub D3DXLoadVolumeFromFileA(ptr ptr ptr ptr ptr long long ptr) -@ stdcall -stub D3DXLoadVolumeFromFileInMemory(ptr ptr ptr ptr long ptr long long ptr) -@ stdcall -stub D3DXLoadVolumeFromFileW(ptr ptr ptr ptr ptr long long ptr) -@ stdcall -stub D3DXLoadVolumeFromMemory(ptr ptr ptr ptr long long long ptr ptr long long) -@ stdcall -stub D3DXLoadVolumeFromResourceA(ptr ptr ptr long ptr ptr long long ptr) -@ stdcall -stub D3DXLoadVolumeFromResourceW(ptr ptr ptr long ptr ptr long long ptr) -@ stdcall -stub D3DXLoadVolumeFromVolume(ptr ptr ptr ptr ptr ptr long long) +@ stub D3DXLoadVolumeFromFileA +@ stub D3DXLoadVolumeFromFileInMemory +@ stub D3DXLoadVolumeFromFileW +@ stub D3DXLoadVolumeFromMemory +@ stub D3DXLoadVolumeFromResourceA +@ stub D3DXLoadVolumeFromResourceW +@ stub D3DXLoadVolumeFromVolume @ stdcall D3DXMatrixAffineTransformation(ptr long ptr ptr ptr) @ stdcall D3DXMatrixAffineTransformation2D(ptr long ptr long ptr) @ stdcall D3DXMatrixDecompose(ptr ptr ptr ptr) @@ -228,8 +228,8 @@ @ stdcall D3DXMatrixTransformation2D(ptr ptr long ptr ptr long ptr) @ stdcall D3DXMatrixTranslation(ptr long long long) @ stdcall D3DXMatrixTranspose(ptr ptr) -@ stdcall -stub D3DXOptimizeFaces(ptr long long long ptr) -@ stdcall -stub D3DXOptimizeVertices(ptr long long long ptr) +@ stub D3DXOptimizeFaces +@ stub D3DXOptimizeVertices @ stdcall D3DXPlaneFromPointNormal(ptr ptr ptr) @ stdcall D3DXPlaneFromPoints(ptr ptr ptr ptr) @ stdcall D3DXPlaneIntersectLine(ptr ptr ptr ptr) @@ -252,56 +252,56 @@ @ stdcall D3DXQuaternionRotationYawPitchRoll(ptr long long long) @ stdcall D3DXQuaternionSlerp(ptr ptr ptr long) @ stdcall D3DXQuaternionSquad(ptr ptr ptr ptr ptr long) -@ stdcall -stub D3DXQuaternionSquadSetup(ptr ptr ptr ptr ptr ptr ptr) +@ stub D3DXQuaternionSquadSetup @ stdcall D3DXQuaternionToAxisAngle(ptr ptr ptr) -@ stdcall -stub D3DXRectPatchSize(ptr ptr ptr) -@ stdcall -stub D3DXSaveMeshHierarchyToFileA(ptr long ptr ptr ptr) -@ stdcall -stub D3DXSaveMeshHierarchyToFileW(ptr long ptr ptr ptr) -@ stdcall -stub D3DXSaveMeshToXA(ptr ptr ptr ptr ptr long long) -@ stdcall -stub D3DXSaveMeshToXW(ptr ptr ptr ptr ptr long long) -@ stdcall -stub D3DXSavePRTBufferToFileA(ptr ptr) -@ stdcall -stub D3DXSavePRTBufferToFileW(ptr ptr) -@ stdcall -stub D3DXSavePRTCompBufferToFileA(ptr ptr) -@ stdcall -stub D3DXSavePRTCompBufferToFileW(ptr ptr) -@ stdcall -stub D3DXSaveSurfaceToFileA(ptr long ptr ptr ptr) -@ stdcall -stub D3DXSaveSurfaceToFileInMemory(ptr long ptr ptr ptr) -@ stdcall -stub D3DXSaveSurfaceToFileW(ptr long ptr ptr ptr) -@ stdcall -stub D3DXSaveTextureToFileA(ptr long ptr ptr) -@ stdcall -stub D3DXSaveTextureToFileInMemory(ptr long ptr ptr) -@ stdcall -stub D3DXSaveTextureToFileW(ptr long ptr ptr) -@ stdcall -stub D3DXSaveVolumeToFileA(ptr long ptr ptr ptr) -@ stdcall -stub D3DXSaveVolumeToFileInMemory(ptr long ptr ptr ptr) -@ stdcall -stub D3DXSaveVolumeToFileW(ptr long ptr ptr ptr) -@ stdcall -stub D3DXSHAdd(ptr long ptr ptr) -@ stdcall -stub D3DXSHDot(long ptr ptr) -@ stdcall -stub D3DXSHEvalConeLight(long ptr long long long long ptr ptr ptr) -@ stdcall -stub D3DXSHEvalDirection(ptr long ptr) -@ stdcall -stub D3DXSHEvalDirectionalLight(long ptr long long long long ptr ptr ptr) -@ stdcall -stub D3DXSHEvalHemisphereLight(long ptr long long ptr ptr ptr) -@ stdcall -stub D3DXSHEvalSphericalLight(long ptr long long long long ptr ptr ptr) +@ stub D3DXRectPatchSize +@ stub D3DXSaveMeshHierarchyToFileA +@ stub D3DXSaveMeshHierarchyToFileW +@ stub D3DXSaveMeshToXA +@ stub D3DXSaveMeshToXW +@ stub D3DXSavePRTBufferToFileA +@ stub D3DXSavePRTBufferToFileW +@ stub D3DXSavePRTCompBufferToFileA +@ stub D3DXSavePRTCompBufferToFileW +@ stub D3DXSaveSurfaceToFileA +@ stub D3DXSaveSurfaceToFileInMemory +@ stub D3DXSaveSurfaceToFileW +@ stub D3DXSaveTextureToFileA +@ stub D3DXSaveTextureToFileInMemory +@ stub D3DXSaveTextureToFileW +@ stub D3DXSaveVolumeToFileA +@ stub D3DXSaveVolumeToFileInMemory +@ stub D3DXSaveVolumeToFileW +@ stub D3DXSHAdd +@ stub D3DXSHDot +@ stub D3DXSHEvalConeLight +@ stub D3DXSHEvalDirection +@ stub D3DXSHEvalDirectionalLight +@ stub D3DXSHEvalHemisphereLight +@ stub D3DXSHEvalSphericalLight @ stub D3DXSHMultiply2 @ stub D3DXSHMultiply3 @ stub D3DXSHMultiply4 @ stub D3DXSHMultiply5 @ stub D3DXSHMultiply6 -@ stdcall -stub D3DXSHProjectCubeMap(long ptr ptr ptr ptr) -@ stdcall -stub D3DXSHPRTCompSplitMeshSC(ptr long long ptr long ptr long long ptr ptr long ptr ptr ptr ptr ptr) -@ stdcall -stub D3DXSHPRTCompSuperCluster(ptr ptr long long ptr ptr) -@ stdcall -stub D3DXSHRotate(ptr long ptr ptr) -@ stdcall -stub D3DXSHRotateZ(ptr long long ptr) -@ stdcall -stub D3DXSHScale(ptr long ptr ptr) -@ stdcall -stub D3DXSimplifyMesh(ptr ptr ptr ptr long long ptr) +@ stub D3DXSHProjectCubeMap +@ stub D3DXSHPRTCompSplitMeshSC +@ stub D3DXSHPRTCompSuperCluster +@ stub D3DXSHRotate +@ stub D3DXSHRotateZ +@ stub D3DXSHScale +@ stub D3DXSimplifyMesh @ stdcall D3DXSphereBoundProbe(ptr long ptr ptr) -@ stdcall -stub D3DXSplitMesh(ptr ptr long long ptr ptr ptr ptr ptr) -@ stdcall -stub D3DXTessellateNPatches(ptr ptr long long ptr ptr) -@ stdcall -stub D3DXTessellateRectPatch(ptr ptr ptr ptr ptr) -@ stdcall -stub D3DXTessellateTriPatch(ptr ptr ptr ptr ptr) -@ stdcall -stub D3DXTriPatchSize(ptr ptr ptr) +@ stub D3DXSplitMesh +@ stub D3DXTessellateNPatches +@ stub D3DXTessellateRectPatch +@ stub D3DXTessellateTriPatch +@ stub D3DXTriPatchSize @ stub D3DXUVAtlasCreate @ stub D3DXUVAtlasPack @ stub D3DXUVAtlasPartition -@ stdcall -stub D3DXValidMesh(ptr ptr ptr) -@ stdcall -stub D3DXValidPatchMesh(ptr ptr ptr ptr) +@ stub D3DXValidMesh +@ stub D3DXValidPatchMesh @ stdcall D3DXVec2BaryCentric(ptr ptr ptr ptr long long) @ stdcall D3DXVec2CatmullRom(ptr ptr ptr ptr ptr long) @ stdcall D3DXVec2Hermite(ptr ptr ptr ptr ptr long) @@ -333,4 +333,4 @@ @ stdcall D3DXVec4Normalize(ptr ptr) @ stdcall D3DXVec4Transform(ptr ptr ptr) @ stdcall D3DXVec4TransformArray(ptr long ptr long ptr long) -@ stdcall -stub D3DXWeldVertices(ptr long ptr ptr ptr ptr ptr) +@ stub D3DXWeldVertices diff --git a/dll/directx/wine/d3dx9_36/d3dx9_36_main.c b/dll/directx/wine/d3dx9_36/d3dx9_36_main.c index ffd5361c457..e9c700444ef 100644 --- a/dll/directx/wine/d3dx9_36/d3dx9_36_main.c +++ b/dll/directx/wine/d3dx9_36/d3dx9_36_main.c @@ -33,10 +33,6 @@ #include "d3dx9.h" -#ifdef _MSC_VER -DEFINE_GUID(IID_IUnknown, 0x00000000, 0x0000, 0x0000, 0xc0, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x46); -#endif - /*********************************************************************** * DllMain. */ diff --git a/dll/directx/wine/d3dx9_37/d3dx9_37.rbuild b/dll/directx/wine/d3dx9_37/d3dx9_37.rbuild new file mode 100644 index 00000000000..56a701bd5d4 --- /dev/null +++ b/dll/directx/wine/d3dx9_37/d3dx9_37.rbuild @@ -0,0 +1,20 @@ + + + + + . + include/reactos/wine + + + d3d9 + wine + user32 + gdi32 + advapi32 + wined3d + + d3dx9_37_main.c + version.rc + + wineheaders + diff --git a/dll/directx/wine/d3dx9_38/d3dx9_38.rbuild b/dll/directx/wine/d3dx9_38/d3dx9_38.rbuild new file mode 100644 index 00000000000..1bf726c9928 --- /dev/null +++ b/dll/directx/wine/d3dx9_38/d3dx9_38.rbuild @@ -0,0 +1,20 @@ + + + + + . + include/reactos/wine + + + d3d9 + wine + user32 + gdi32 + advapi32 + wined3d + + d3dx9_38_main.c + version.rc + + wineheaders + diff --git a/dll/directx/wine/d3dx9_39/d3dx9_39.rbuild b/dll/directx/wine/d3dx9_39/d3dx9_39.rbuild new file mode 100644 index 00000000000..2b16c77c65e --- /dev/null +++ b/dll/directx/wine/d3dx9_39/d3dx9_39.rbuild @@ -0,0 +1,20 @@ + + + + + . + include/reactos/wine + + + d3d9 + wine + user32 + gdi32 + advapi32 + wined3d + + d3dx9_39_main.c + version.rc + + wineheaders + diff --git a/dll/directx/wine/d3dx9_40/d3dx9_40.rbuild b/dll/directx/wine/d3dx9_40/d3dx9_40.rbuild new file mode 100644 index 00000000000..f6bb05dd6c4 --- /dev/null +++ b/dll/directx/wine/d3dx9_40/d3dx9_40.rbuild @@ -0,0 +1,20 @@ + + + + + . + include/reactos/wine + + + d3d9 + wine + user32 + gdi32 + advapi32 + wined3d + + d3dx9_40_main.c + version.rc + + wineheaders + diff --git a/dll/directx/wine/d3dx9_41/d3dx9_41.rbuild b/dll/directx/wine/d3dx9_41/d3dx9_41.rbuild new file mode 100644 index 00000000000..386bc8b8fe9 --- /dev/null +++ b/dll/directx/wine/d3dx9_41/d3dx9_41.rbuild @@ -0,0 +1,20 @@ + + + + + . + include/reactos/wine + + + d3d9 + wine + user32 + gdi32 + advapi32 + wined3d + + d3dx9_41_main.c + version.rc + + wineheaders + diff --git a/dll/directx/wine/d3dx9_42/d3dx9_42.rbuild b/dll/directx/wine/d3dx9_42/d3dx9_42.rbuild new file mode 100644 index 00000000000..d10af3a3b29 --- /dev/null +++ b/dll/directx/wine/d3dx9_42/d3dx9_42.rbuild @@ -0,0 +1,20 @@ + + + + + . + include/reactos/wine + + + d3d9 + wine + user32 + gdi32 + advapi32 + wined3d + + d3dx9_42_main.c + version.rc + + wineheaders + diff --git a/dll/directx/wine/ddraw/ddraw.rbuild b/dll/directx/wine/ddraw/ddraw.rbuild new file mode 100644 index 00000000000..fa6bba2c88d --- /dev/null +++ b/dll/directx/wine/ddraw/ddraw.rbuild @@ -0,0 +1,39 @@ + + + + + + . + include/reactos/wine + + + /FIwine/typeof.h + + advapi32 + dxguid + gdi32 + ole32 + pseh + user32 + uuid + wine + wined3d + + clipper.c + ddraw.c + device.c + executebuffer.c + light.c + main.c + material.c + palette.c + regsvr.c + stubs.c + surface.c + utils.c + version.rc + vertexbuffer.c + viewport.c + + wineheaders + diff --git a/dll/directx/wine/wine.rbuild b/dll/directx/wine/wine.rbuild new file mode 100644 index 00000000000..85d0bbe906e --- /dev/null +++ b/dll/directx/wine/wine.rbuild @@ -0,0 +1,73 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/dll/directx/wine/wined3d/state.c b/dll/directx/wine/wined3d/state.c index 378e0f96827..a43cc383ca1 100644 --- a/dll/directx/wine/wined3d/state.c +++ b/dll/directx/wine/wined3d/state.c @@ -1,4 +1,4 @@ -/* +/* * Direct3D state management * * Copyright 2002 Lionel Ulmer diff --git a/dll/directx/wine/wined3d/wined3d.rbuild b/dll/directx/wine/wined3d/wined3d.rbuild new file mode 100644 index 00000000000..aa464944fe9 --- /dev/null +++ b/dll/directx/wine/wined3d/wined3d.rbuild @@ -0,0 +1,52 @@ + + + + + . + include/reactos/wine + + + + + wine + user32 + opengl32 + gdi32 + advapi32 + uuid + + ati_fragment_shader.c + arb_program_shader.c + buffer.c + clipper.c + context.c + device.c + directx.c + drawprim.c + gl_compat.c + glsl_shader.c + nvidia_texture_shader.c + palette.c + query.c + resource.c + shader.c + shader_sm1.c + shader_sm4.c + state.c + stateblock.c + surface.c + swapchain.c + texture.c + utils.c + vertexdeclaration.c + view.c + volume.c + wined3d_main.c + version.rc + + powf.c + sqrtf.c + + + wineheaders + diff --git a/dll/dll.rbuild b/dll/dll.rbuild new file mode 100644 index 00000000000..c602a970785 --- /dev/null +++ b/dll/dll.rbuild @@ -0,0 +1,29 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/dll/keyboard/kbda1/kbda1.rbuild b/dll/keyboard/kbda1/kbda1.rbuild new file mode 100644 index 00000000000..31d033df20d --- /dev/null +++ b/dll/keyboard/kbda1/kbda1.rbuild @@ -0,0 +1,8 @@ + + + + + include + kbda1.c + kbda1.rc + diff --git a/dll/keyboard/kbda2/kbda2.rbuild b/dll/keyboard/kbda2/kbda2.rbuild new file mode 100644 index 00000000000..4cf31ccc2fa --- /dev/null +++ b/dll/keyboard/kbda2/kbda2.rbuild @@ -0,0 +1,8 @@ + + + + + include + kbda2.c + kbda2.rc + diff --git a/dll/keyboard/kbda3/kbda3.rbuild b/dll/keyboard/kbda3/kbda3.rbuild new file mode 100644 index 00000000000..9d7c0d09a22 --- /dev/null +++ b/dll/keyboard/kbda3/kbda3.rbuild @@ -0,0 +1,8 @@ + + + + + include + kbda3.c + kbda3.rc + diff --git a/dll/keyboard/kbdal/kbdal.rbuild b/dll/keyboard/kbdal/kbdal.rbuild new file mode 100644 index 00000000000..073cb694d3b --- /dev/null +++ b/dll/keyboard/kbdal/kbdal.rbuild @@ -0,0 +1,8 @@ + + + + + include + kbdal.c + kbdal.rc + diff --git a/dll/keyboard/kbdarme/kbdarme.rbuild b/dll/keyboard/kbdarme/kbdarme.rbuild new file mode 100644 index 00000000000..5b057472893 --- /dev/null +++ b/dll/keyboard/kbdarme/kbdarme.rbuild @@ -0,0 +1,8 @@ + + + + + include + kbdarme.c + kbdarme.rc + diff --git a/dll/keyboard/kbdarmw/kbdarmw.rbuild b/dll/keyboard/kbdarmw/kbdarmw.rbuild new file mode 100644 index 00000000000..2564cceba8f --- /dev/null +++ b/dll/keyboard/kbdarmw/kbdarmw.rbuild @@ -0,0 +1,8 @@ + + + + + include + kbdarmw.c + kbdarmw.rc + diff --git a/dll/keyboard/kbdaze/kbdaze.rbuild b/dll/keyboard/kbdaze/kbdaze.rbuild new file mode 100644 index 00000000000..dc9396f2a7b --- /dev/null +++ b/dll/keyboard/kbdaze/kbdaze.rbuild @@ -0,0 +1,8 @@ + + + + + include + kbdaze.c + kbdaze.rc + diff --git a/dll/keyboard/kbdazel/kbdazel.rbuild b/dll/keyboard/kbdazel/kbdazel.rbuild new file mode 100644 index 00000000000..bce7694060b --- /dev/null +++ b/dll/keyboard/kbdazel/kbdazel.rbuild @@ -0,0 +1,8 @@ + + + + + include + kbdazel.c + kbdazel.rc + diff --git a/dll/keyboard/kbdbe/kbdbe.rbuild b/dll/keyboard/kbdbe/kbdbe.rbuild new file mode 100644 index 00000000000..7e5eb929eef --- /dev/null +++ b/dll/keyboard/kbdbe/kbdbe.rbuild @@ -0,0 +1,8 @@ + + + + + include + kbdbe.c + kbdbe.rc + diff --git a/dll/keyboard/kbdbga/kbdbga.rbuild b/dll/keyboard/kbdbga/kbdbga.rbuild new file mode 100644 index 00000000000..544bb45d3c1 --- /dev/null +++ b/dll/keyboard/kbdbga/kbdbga.rbuild @@ -0,0 +1,8 @@ + + + + + include + kbdbga.c + kbdbga.rc + diff --git a/dll/keyboard/kbdbgm/kbdbgm.rbuild b/dll/keyboard/kbdbgm/kbdbgm.rbuild new file mode 100644 index 00000000000..8b55a01f338 --- /dev/null +++ b/dll/keyboard/kbdbgm/kbdbgm.rbuild @@ -0,0 +1,8 @@ + + + + + include + kbdbgm.c + kbdbgm.rc + diff --git a/dll/keyboard/kbdbgt/kbdbgt.rbuild b/dll/keyboard/kbdbgt/kbdbgt.rbuild new file mode 100644 index 00000000000..63592e5071f --- /dev/null +++ b/dll/keyboard/kbdbgt/kbdbgt.rbuild @@ -0,0 +1,8 @@ + + + + + include + kbdbgt.c + kbdbgt.rc + diff --git a/dll/keyboard/kbdblr/kbdblr.rbuild b/dll/keyboard/kbdblr/kbdblr.rbuild new file mode 100644 index 00000000000..21815ed16d8 --- /dev/null +++ b/dll/keyboard/kbdblr/kbdblr.rbuild @@ -0,0 +1,8 @@ + + + + + include + kbdblr.c + kbdblr.rc + diff --git a/dll/keyboard/kbdbr/kbdbr.rbuild b/dll/keyboard/kbdbr/kbdbr.rbuild new file mode 100644 index 00000000000..72ff9aba4bf --- /dev/null +++ b/dll/keyboard/kbdbr/kbdbr.rbuild @@ -0,0 +1,8 @@ + + + + + include + kbdbr.c + kbdbr.rc + diff --git a/dll/keyboard/kbdbur/kbdbur.rbuild b/dll/keyboard/kbdbur/kbdbur.rbuild new file mode 100644 index 00000000000..a452a072baf --- /dev/null +++ b/dll/keyboard/kbdbur/kbdbur.rbuild @@ -0,0 +1,8 @@ + + + + + include + kbdbur.c + kbdbur.rc + diff --git a/dll/keyboard/kbdcan/kbdcan.rbuild b/dll/keyboard/kbdcan/kbdcan.rbuild new file mode 100644 index 00000000000..31a1183dbd1 --- /dev/null +++ b/dll/keyboard/kbdcan/kbdcan.rbuild @@ -0,0 +1,8 @@ + + + + + include + kbdcan.c + kbdcan.rc + diff --git a/dll/keyboard/kbdcr/kbdcr.rbuild b/dll/keyboard/kbdcr/kbdcr.rbuild new file mode 100644 index 00000000000..32784f9fcc7 --- /dev/null +++ b/dll/keyboard/kbdcr/kbdcr.rbuild @@ -0,0 +1,8 @@ + + + + + include + kbdcr.c + kbdcr.rc + diff --git a/dll/keyboard/kbdcz/kbdcz.rbuild b/dll/keyboard/kbdcz/kbdcz.rbuild new file mode 100644 index 00000000000..639fbc85650 --- /dev/null +++ b/dll/keyboard/kbdcz/kbdcz.rbuild @@ -0,0 +1,8 @@ + + + + + include + kbdcz.c + kbdcz.rc + diff --git a/dll/keyboard/kbdcz1/kbdcz1.rbuild b/dll/keyboard/kbdcz1/kbdcz1.rbuild new file mode 100644 index 00000000000..01a3ed1c5e4 --- /dev/null +++ b/dll/keyboard/kbdcz1/kbdcz1.rbuild @@ -0,0 +1,8 @@ + + + + + include + kbdcz1.c + kbdcz1.rc + diff --git a/dll/keyboard/kbdda/kbdda.rbuild b/dll/keyboard/kbdda/kbdda.rbuild new file mode 100644 index 00000000000..4c6337a199a --- /dev/null +++ b/dll/keyboard/kbdda/kbdda.rbuild @@ -0,0 +1,8 @@ + + + + + include + kbdda.c + kbdda.rc + diff --git a/dll/keyboard/kbddv/kbddv.rbuild b/dll/keyboard/kbddv/kbddv.rbuild new file mode 100644 index 00000000000..5acfd24e375 --- /dev/null +++ b/dll/keyboard/kbddv/kbddv.rbuild @@ -0,0 +1,8 @@ + + + + + include + kbddv.c + kbddv.rc + diff --git a/dll/keyboard/kbdes/kbdes.rbuild b/dll/keyboard/kbdes/kbdes.rbuild new file mode 100644 index 00000000000..b580af90812 --- /dev/null +++ b/dll/keyboard/kbdes/kbdes.rbuild @@ -0,0 +1,8 @@ + + + + + include + kbdes.c + kbdes.rc + diff --git a/dll/keyboard/kbdest/kbdest.rbuild b/dll/keyboard/kbdest/kbdest.rbuild new file mode 100644 index 00000000000..b979a0c1683 --- /dev/null +++ b/dll/keyboard/kbdest/kbdest.rbuild @@ -0,0 +1,8 @@ + + + + + include + kbdest.c + kbdest.rc + diff --git a/dll/keyboard/kbdfc/kbdfc.rbuild b/dll/keyboard/kbdfc/kbdfc.rbuild new file mode 100644 index 00000000000..9459811080e --- /dev/null +++ b/dll/keyboard/kbdfc/kbdfc.rbuild @@ -0,0 +1,8 @@ + + + + + include + kbdfc.c + kbdfc.rc + diff --git a/dll/keyboard/kbdfi/kbdfi.rbuild b/dll/keyboard/kbdfi/kbdfi.rbuild new file mode 100644 index 00000000000..1089de6ec74 --- /dev/null +++ b/dll/keyboard/kbdfi/kbdfi.rbuild @@ -0,0 +1,8 @@ + + + + + include + kbdfi.c + kbdfi.rc + diff --git a/dll/keyboard/kbdfr/kbdfr.rbuild b/dll/keyboard/kbdfr/kbdfr.rbuild new file mode 100644 index 00000000000..f6319af96de --- /dev/null +++ b/dll/keyboard/kbdfr/kbdfr.rbuild @@ -0,0 +1,8 @@ + + + + + include + kbdfr.c + kbdfr.rc + diff --git a/dll/keyboard/kbdgeo/kbdgeo.rbuild b/dll/keyboard/kbdgeo/kbdgeo.rbuild new file mode 100644 index 00000000000..853dbb48fd6 --- /dev/null +++ b/dll/keyboard/kbdgeo/kbdgeo.rbuild @@ -0,0 +1,8 @@ + + + + + include + kbdgeo.c + kbdgeo.rc + diff --git a/dll/keyboard/kbdgerg/kbdgerg.rbuild b/dll/keyboard/kbdgerg/kbdgerg.rbuild new file mode 100644 index 00000000000..684cdcee39f --- /dev/null +++ b/dll/keyboard/kbdgerg/kbdgerg.rbuild @@ -0,0 +1,8 @@ + + + + + include + kbdgerg.c + kbdgerg.rc + diff --git a/dll/keyboard/kbdgneo/kbdgneo.rbuild b/dll/keyboard/kbdgneo/kbdgneo.rbuild new file mode 100644 index 00000000000..4b43e916f32 --- /dev/null +++ b/dll/keyboard/kbdgneo/kbdgneo.rbuild @@ -0,0 +1,8 @@ + + + + + include + kbdgneo.c + kbdgneo.rc + diff --git a/dll/keyboard/kbdgr/kbdgr.rbuild b/dll/keyboard/kbdgr/kbdgr.rbuild new file mode 100644 index 00000000000..246cfb386df --- /dev/null +++ b/dll/keyboard/kbdgr/kbdgr.rbuild @@ -0,0 +1,8 @@ + + + + + include + kbdgr.c + kbdgr.rc + diff --git a/dll/keyboard/kbdgrist/kbdgrist.rbuild b/dll/keyboard/kbdgrist/kbdgrist.rbuild new file mode 100644 index 00000000000..e8978cf7a2f --- /dev/null +++ b/dll/keyboard/kbdgrist/kbdgrist.rbuild @@ -0,0 +1,8 @@ + + + + + include + kbdgrist.c + kbdgrist.rc + diff --git a/dll/keyboard/kbdhe/kbdhe.rbuild b/dll/keyboard/kbdhe/kbdhe.rbuild new file mode 100644 index 00000000000..32f2b711484 --- /dev/null +++ b/dll/keyboard/kbdhe/kbdhe.rbuild @@ -0,0 +1,8 @@ + + + + + include + kbdhe.c + kbdhe.rc + diff --git a/dll/keyboard/kbdheb/kbdheb.rbuild b/dll/keyboard/kbdheb/kbdheb.rbuild new file mode 100644 index 00000000000..8320aa495ab --- /dev/null +++ b/dll/keyboard/kbdheb/kbdheb.rbuild @@ -0,0 +1,8 @@ + + + + + include + kbdheb.c + kbdheb.rc + diff --git a/dll/keyboard/kbdhu/kbdhu.rbuild b/dll/keyboard/kbdhu/kbdhu.rbuild new file mode 100644 index 00000000000..dd1a3b69a65 --- /dev/null +++ b/dll/keyboard/kbdhu/kbdhu.rbuild @@ -0,0 +1,8 @@ + + + + + include + kbdhu.c + kbdhu.rc + diff --git a/dll/keyboard/kbdic/kbdic.rbuild b/dll/keyboard/kbdic/kbdic.rbuild new file mode 100644 index 00000000000..c784c17dace --- /dev/null +++ b/dll/keyboard/kbdic/kbdic.rbuild @@ -0,0 +1,8 @@ + + + + + include + kbdic.c + kbdic.rc + diff --git a/dll/keyboard/kbdinasa/kbdinasa.rbuild b/dll/keyboard/kbdinasa/kbdinasa.rbuild new file mode 100644 index 00000000000..bf312f1a57c --- /dev/null +++ b/dll/keyboard/kbdinasa/kbdinasa.rbuild @@ -0,0 +1,8 @@ + + + + + include + kbdinasa.c + kbdinasa.rc + diff --git a/dll/keyboard/kbdinben/kbdinben.rbuild b/dll/keyboard/kbdinben/kbdinben.rbuild new file mode 100644 index 00000000000..72bd07de614 --- /dev/null +++ b/dll/keyboard/kbdinben/kbdinben.rbuild @@ -0,0 +1,8 @@ + + + + + include + kbdinben.c + kbdinben.rc + diff --git a/dll/keyboard/kbdindev/kbdindev.rbuild b/dll/keyboard/kbdindev/kbdindev.rbuild new file mode 100644 index 00000000000..67b110409bc --- /dev/null +++ b/dll/keyboard/kbdindev/kbdindev.rbuild @@ -0,0 +1,8 @@ + + + + + include + kbdindev.c + kbdindev.rc + diff --git a/dll/keyboard/kbdinguj/kbdinguj.rbuild b/dll/keyboard/kbdinguj/kbdinguj.rbuild new file mode 100644 index 00000000000..c584273dfc2 --- /dev/null +++ b/dll/keyboard/kbdinguj/kbdinguj.rbuild @@ -0,0 +1,8 @@ + + + + + include + kbdinguj.c + kbdinguj.rc + diff --git a/dll/keyboard/kbdinmal/kbdinmal.rbuild b/dll/keyboard/kbdinmal/kbdinmal.rbuild new file mode 100644 index 00000000000..48304136ee0 --- /dev/null +++ b/dll/keyboard/kbdinmal/kbdinmal.rbuild @@ -0,0 +1,8 @@ + + + + + include + kbdinmal.c + kbdinmal.rc + diff --git a/dll/keyboard/kbdir/kbdir.rbuild b/dll/keyboard/kbdir/kbdir.rbuild new file mode 100644 index 00000000000..787f7d58e6f --- /dev/null +++ b/dll/keyboard/kbdir/kbdir.rbuild @@ -0,0 +1,8 @@ + + + + + include + kbdir.c + kbdir.rc + diff --git a/dll/keyboard/kbdit/kbdit.rbuild b/dll/keyboard/kbdit/kbdit.rbuild new file mode 100644 index 00000000000..136233af040 --- /dev/null +++ b/dll/keyboard/kbdit/kbdit.rbuild @@ -0,0 +1,8 @@ + + + + + include + kbdit.c + kbdit.rc + diff --git a/dll/keyboard/kbdja/kbdja.rbuild b/dll/keyboard/kbdja/kbdja.rbuild new file mode 100644 index 00000000000..40e6b663adc --- /dev/null +++ b/dll/keyboard/kbdja/kbdja.rbuild @@ -0,0 +1,8 @@ + + + + + include + kbdja.c + kbdja.rc + diff --git a/dll/keyboard/kbdkaz/kbdkaz.rbuild b/dll/keyboard/kbdkaz/kbdkaz.rbuild new file mode 100644 index 00000000000..3aba85c86c5 --- /dev/null +++ b/dll/keyboard/kbdkaz/kbdkaz.rbuild @@ -0,0 +1,8 @@ + + + + + include + kbdkaz.c + kbdkaz.rc + diff --git a/dll/keyboard/kbdko/kbdko.rbuild b/dll/keyboard/kbdko/kbdko.rbuild new file mode 100644 index 00000000000..a448d4fb8a5 --- /dev/null +++ b/dll/keyboard/kbdko/kbdko.rbuild @@ -0,0 +1,8 @@ + + + + + include + kbdko.c + kbdko.rc + diff --git a/dll/keyboard/kbdla/kbdla.rbuild b/dll/keyboard/kbdla/kbdla.rbuild new file mode 100644 index 00000000000..543e4c23669 --- /dev/null +++ b/dll/keyboard/kbdla/kbdla.rbuild @@ -0,0 +1,8 @@ + + + + + include + kbdla.c + kbdla.rc + diff --git a/dll/keyboard/kbdlt1/kbdlt1.rbuild b/dll/keyboard/kbdlt1/kbdlt1.rbuild new file mode 100644 index 00000000000..e65ce45c29e --- /dev/null +++ b/dll/keyboard/kbdlt1/kbdlt1.rbuild @@ -0,0 +1,8 @@ + + + + + include + kbdlt1.c + kbdlt1.rc + diff --git a/dll/keyboard/kbdlv/kbdlv.rbuild b/dll/keyboard/kbdlv/kbdlv.rbuild new file mode 100644 index 00000000000..20e5c90abf8 --- /dev/null +++ b/dll/keyboard/kbdlv/kbdlv.rbuild @@ -0,0 +1,8 @@ + + + + + include + kbdlv.c + kbdlv.rc + diff --git a/dll/keyboard/kbdmac/kbdmac.rbuild b/dll/keyboard/kbdmac/kbdmac.rbuild new file mode 100644 index 00000000000..f6d2ed58ead --- /dev/null +++ b/dll/keyboard/kbdmac/kbdmac.rbuild @@ -0,0 +1,8 @@ + + + + + include + kbdmac.c + kbdmac.rc + diff --git a/dll/keyboard/kbdne/kbdne.rbuild b/dll/keyboard/kbdne/kbdne.rbuild new file mode 100644 index 00000000000..6eab2d336d2 --- /dev/null +++ b/dll/keyboard/kbdne/kbdne.rbuild @@ -0,0 +1,8 @@ + + + + + include + kbdne.c + kbdne.rc + diff --git a/dll/keyboard/kbdno/kbdno.rbuild b/dll/keyboard/kbdno/kbdno.rbuild new file mode 100644 index 00000000000..49e0b73be9a --- /dev/null +++ b/dll/keyboard/kbdno/kbdno.rbuild @@ -0,0 +1,8 @@ + + + + + include + kbdno.c + kbdno.rc + diff --git a/dll/keyboard/kbdpl1/kbdpl1.rbuild b/dll/keyboard/kbdpl1/kbdpl1.rbuild new file mode 100644 index 00000000000..36b4b2e4bbd --- /dev/null +++ b/dll/keyboard/kbdpl1/kbdpl1.rbuild @@ -0,0 +1,8 @@ + + + + + include + kbdpl1.c + kbdpl1.rc + diff --git a/dll/keyboard/kbdpo/kbdpo.rbuild b/dll/keyboard/kbdpo/kbdpo.rbuild new file mode 100644 index 00000000000..c8c4002c694 --- /dev/null +++ b/dll/keyboard/kbdpo/kbdpo.rbuild @@ -0,0 +1,8 @@ + + + + + include + kbdpo.c + kbdpo.rc + diff --git a/dll/keyboard/kbdro/kbdro.rbuild b/dll/keyboard/kbdro/kbdro.rbuild new file mode 100644 index 00000000000..f8e7af61dab --- /dev/null +++ b/dll/keyboard/kbdro/kbdro.rbuild @@ -0,0 +1,8 @@ + + + + + include + kbdro.c + kbdro.rc + diff --git a/dll/keyboard/kbdru/kbdru.rbuild b/dll/keyboard/kbdru/kbdru.rbuild new file mode 100644 index 00000000000..95a66419919 --- /dev/null +++ b/dll/keyboard/kbdru/kbdru.rbuild @@ -0,0 +1,8 @@ + + + + + include + kbdru.c + kbdru.rc + diff --git a/dll/keyboard/kbdru1/kbdru1.rbuild b/dll/keyboard/kbdru1/kbdru1.rbuild new file mode 100644 index 00000000000..150ebaf717c --- /dev/null +++ b/dll/keyboard/kbdru1/kbdru1.rbuild @@ -0,0 +1,8 @@ + + + + + include + kbdru1.c + kbdru1.rc + diff --git a/dll/keyboard/kbdsg/kbdsg.rbuild b/dll/keyboard/kbdsg/kbdsg.rbuild new file mode 100644 index 00000000000..4c5ac0c6f44 --- /dev/null +++ b/dll/keyboard/kbdsg/kbdsg.rbuild @@ -0,0 +1,8 @@ + + + + + include + kbdsg.c + kbdsg.rc + diff --git a/dll/keyboard/kbdsk/kbdsk.rbuild b/dll/keyboard/kbdsk/kbdsk.rbuild new file mode 100644 index 00000000000..fb0a45c982b --- /dev/null +++ b/dll/keyboard/kbdsk/kbdsk.rbuild @@ -0,0 +1,8 @@ + + + + + include + kbdsk.c + kbdsk.rc + diff --git a/dll/keyboard/kbdsk1/kbdsk1.rbuild b/dll/keyboard/kbdsk1/kbdsk1.rbuild new file mode 100644 index 00000000000..8ff34acbfe5 --- /dev/null +++ b/dll/keyboard/kbdsk1/kbdsk1.rbuild @@ -0,0 +1,8 @@ + + + + + include + kbdsk1.c + kbdsk1.rc + diff --git a/dll/keyboard/kbdsw/kbdsw.rbuild b/dll/keyboard/kbdsw/kbdsw.rbuild new file mode 100644 index 00000000000..137fff9a3b9 --- /dev/null +++ b/dll/keyboard/kbdsw/kbdsw.rbuild @@ -0,0 +1,8 @@ + + + + + include + kbdsw.c + kbdsw.rc + diff --git a/dll/keyboard/kbdtat/kbdtat.rbuild b/dll/keyboard/kbdtat/kbdtat.rbuild new file mode 100644 index 00000000000..e6f23cdd4bb --- /dev/null +++ b/dll/keyboard/kbdtat/kbdtat.rbuild @@ -0,0 +1,8 @@ + + + + + include + kbdtat.c + kbdtat.rc + diff --git a/dll/keyboard/kbdth0/kbdth0.rbuild b/dll/keyboard/kbdth0/kbdth0.rbuild new file mode 100644 index 00000000000..af6bbfe3a4f --- /dev/null +++ b/dll/keyboard/kbdth0/kbdth0.rbuild @@ -0,0 +1,8 @@ + + + + + include + kbdth0.c + kbdth0.rc + diff --git a/dll/keyboard/kbdth1/kbdth1.rbuild b/dll/keyboard/kbdth1/kbdth1.rbuild new file mode 100644 index 00000000000..50a76792692 --- /dev/null +++ b/dll/keyboard/kbdth1/kbdth1.rbuild @@ -0,0 +1,8 @@ + + + + + include + kbdth1.c + kbdth1.rc + diff --git a/dll/keyboard/kbdth2/kbdth2.rbuild b/dll/keyboard/kbdth2/kbdth2.rbuild new file mode 100644 index 00000000000..b86aa31e287 --- /dev/null +++ b/dll/keyboard/kbdth2/kbdth2.rbuild @@ -0,0 +1,8 @@ + + + + + include + kbdth2.c + kbdth2.rc + diff --git a/dll/keyboard/kbdth3/kbdth3.rbuild b/dll/keyboard/kbdth3/kbdth3.rbuild new file mode 100644 index 00000000000..e166f086a7b --- /dev/null +++ b/dll/keyboard/kbdth3/kbdth3.rbuild @@ -0,0 +1,8 @@ + + + + + include + kbdth3.c + kbdth3.rc + diff --git a/dll/keyboard/kbdtuf/kbdtuf.rbuild b/dll/keyboard/kbdtuf/kbdtuf.rbuild new file mode 100644 index 00000000000..56efedbfa26 --- /dev/null +++ b/dll/keyboard/kbdtuf/kbdtuf.rbuild @@ -0,0 +1,8 @@ + + + + + include + kbdtuf.c + kbdtuf.rc + diff --git a/dll/keyboard/kbdtuq/kbdtuq.rbuild b/dll/keyboard/kbdtuq/kbdtuq.rbuild new file mode 100644 index 00000000000..58281d92cb2 --- /dev/null +++ b/dll/keyboard/kbdtuq/kbdtuq.rbuild @@ -0,0 +1,8 @@ + + + + + include + kbdtuq.c + kbdtuq.rc + diff --git a/dll/keyboard/kbduk/kbduk.rbuild b/dll/keyboard/kbduk/kbduk.rbuild new file mode 100644 index 00000000000..ac8308b98b5 --- /dev/null +++ b/dll/keyboard/kbduk/kbduk.rbuild @@ -0,0 +1,8 @@ + + + + + include + kbduk.c + kbduk.rc + diff --git a/dll/keyboard/kbdur/kbdur.rbuild b/dll/keyboard/kbdur/kbdur.rbuild new file mode 100644 index 00000000000..3de98772b7a --- /dev/null +++ b/dll/keyboard/kbdur/kbdur.rbuild @@ -0,0 +1,8 @@ + + + + + include + kbdur.c + kbdur.rc + diff --git a/dll/keyboard/kbdurs/kbdurs.rbuild b/dll/keyboard/kbdurs/kbdurs.rbuild new file mode 100644 index 00000000000..e92e36929dd --- /dev/null +++ b/dll/keyboard/kbdurs/kbdurs.rbuild @@ -0,0 +1,8 @@ + + + + + include + kbdurs.c + kbdurs.rc + diff --git a/dll/keyboard/kbdus/kbdus.rbuild b/dll/keyboard/kbdus/kbdus.rbuild new file mode 100644 index 00000000000..88b0f3cc717 --- /dev/null +++ b/dll/keyboard/kbdus/kbdus.rbuild @@ -0,0 +1,8 @@ + + + + + include + kbdus.c + kbdus.rc + diff --git a/dll/keyboard/kbdusa/kbdusa.rbuild b/dll/keyboard/kbdusa/kbdusa.rbuild new file mode 100644 index 00000000000..74af4683131 --- /dev/null +++ b/dll/keyboard/kbdusa/kbdusa.rbuild @@ -0,0 +1,8 @@ + + + + + include + kbdusa.c + kbdusa.rc + diff --git a/dll/keyboard/kbdusl/kbdusl.rbuild b/dll/keyboard/kbdusl/kbdusl.rbuild new file mode 100644 index 00000000000..5cab9fa3c69 --- /dev/null +++ b/dll/keyboard/kbdusl/kbdusl.rbuild @@ -0,0 +1,8 @@ + + + + + include + kbdusl.c + kbdusl.rc + diff --git a/dll/keyboard/kbdusr/kbdusr.rbuild b/dll/keyboard/kbdusr/kbdusr.rbuild new file mode 100644 index 00000000000..5be90099a4f --- /dev/null +++ b/dll/keyboard/kbdusr/kbdusr.rbuild @@ -0,0 +1,8 @@ + + + + + include + kbdusr.c + kbdusr.rc + diff --git a/dll/keyboard/kbdusx/kbdusx.rbuild b/dll/keyboard/kbdusx/kbdusx.rbuild new file mode 100644 index 00000000000..1cc3aa2ae50 --- /dev/null +++ b/dll/keyboard/kbdusx/kbdusx.rbuild @@ -0,0 +1,8 @@ + + + + + include + kbdusx.c + kbdusx.rc + diff --git a/dll/keyboard/kbduzb/kbduzb.rbuild b/dll/keyboard/kbduzb/kbduzb.rbuild new file mode 100644 index 00000000000..90a11665813 --- /dev/null +++ b/dll/keyboard/kbduzb/kbduzb.rbuild @@ -0,0 +1,8 @@ + + + + + include + kbduzb.c + kbduzb.rc + diff --git a/dll/keyboard/kbdvntc/kbdvntc.rbuild b/dll/keyboard/kbdvntc/kbdvntc.rbuild new file mode 100644 index 00000000000..65566f9c2a9 --- /dev/null +++ b/dll/keyboard/kbdvntc/kbdvntc.rbuild @@ -0,0 +1,8 @@ + + + + + include + kbdvntc.c + kbdvntc.rc + diff --git a/dll/keyboard/kbdycc/kbdycc.rbuild b/dll/keyboard/kbdycc/kbdycc.rbuild new file mode 100644 index 00000000000..36fe9bf4a80 --- /dev/null +++ b/dll/keyboard/kbdycc/kbdycc.rbuild @@ -0,0 +1,8 @@ + + + + + include + kbdycc.c + kbdycc.rc + diff --git a/dll/keyboard/kbdycl/kbdycl.rbuild b/dll/keyboard/kbdycl/kbdycl.rbuild new file mode 100644 index 00000000000..f188c314195 --- /dev/null +++ b/dll/keyboard/kbdycl/kbdycl.rbuild @@ -0,0 +1,8 @@ + + + + + include + kbdycl.c + kbdycl.rc + diff --git a/dll/keyboard/keyboard.rbuild b/dll/keyboard/keyboard.rbuild new file mode 100644 index 00000000000..dbe5cb13626 --- /dev/null +++ b/dll/keyboard/keyboard.rbuild @@ -0,0 +1,241 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/dll/nls/idndl/idndl.rbuild b/dll/nls/idndl/idndl.rbuild new file mode 100644 index 00000000000..e1303771eab --- /dev/null +++ b/dll/nls/idndl/idndl.rbuild @@ -0,0 +1,11 @@ + + + + + -fno-exceptions + -fno-rtti + + 0x600 + idndl.cpp + + diff --git a/dll/nls/idndl_redist/idndl_redist.rbuild b/dll/nls/idndl_redist/idndl_redist.rbuild new file mode 100644 index 00000000000..2991abd22de --- /dev/null +++ b/dll/nls/idndl_redist/idndl_redist.rbuild @@ -0,0 +1,15 @@ + + + + scripts + + -fno-exceptions + -fno-rtti + + --entry=0 + icu/source/common + . + + idndl.cpp + stubs.cpp + diff --git a/dll/nls/nls.rbuild b/dll/nls/nls.rbuild new file mode 100644 index 00000000000..f5fdfe32190 --- /dev/null +++ b/dll/nls/nls.rbuild @@ -0,0 +1,16 @@ + + + + + + + + + + diff --git a/dll/nls/normaliz/normaliz.rbuild b/dll/nls/normaliz/normaliz.rbuild new file mode 100644 index 00000000000..7a73f0d93bf --- /dev/null +++ b/dll/nls/normaliz/normaliz.rbuild @@ -0,0 +1,6 @@ + + + + + dummy.c + diff --git a/dll/nls/normaliz_redist/normaliz_redist.rbuild b/dll/nls/normaliz_redist/normaliz_redist.rbuild new file mode 100644 index 00000000000..47d3958a939 --- /dev/null +++ b/dll/nls/normaliz_redist/normaliz_redist.rbuild @@ -0,0 +1,20 @@ + + + + + icu/source/common + icudt38.c + + + normalize + idna + normaliz_redist_data + + -fno-exceptions + -fno-rtti + + icu/source/common + + normaliz.cpp + + diff --git a/dll/ntdll/def/ntdll.pspec b/dll/ntdll/def/ntdll.pspec new file mode 100644 index 00000000000..d9ca50edbcf --- /dev/null +++ b/dll/ntdll/def/ntdll.pspec @@ -0,0 +1,1432 @@ + +#undef i386 + +//@ stdcall A_SHAFinal // 6.0 and higher +//@ stdcall A_SHAInit // 6.0 and higher +//@ stdcall A_SHAUpdate // 6.0 and higher +//@ stdcall AitFireParentUsageEvent // 6.1 and higher +//@ stdcall AitLogFeatureUsageByApp // 6.1 and higher +//@ stdcall AlpcAdjustCompletionListConcurrencyCount // 6.0 and higher +//@ stdcall AlpcFreeCompletionListMessage // 6.0 and higher +//@ stdcall AlpcGetCompletionListLastMessageInformation // 6.0 and higher +//@ stdcall AlpcGetCompletionListMessageAttributes // 6.0 and higher +//@ stdcall AlpcGetHeaderSize // 6.0 and higher +//@ stdcall AlpcGetMessageAttribute // 6.0 and higher +//@ stdcall AlpcGetMessageFromCompletionList // 6.0 and higher +//@ stdcall AlpcGetOutstandingCompletionListMessageCount // 6.0 and higher +//@ stdcall AlpcInitializeMessageAttribute // 6.0 and higher +//@ stdcall AlpcMaxAllowedMessageLength // 6.0 and higher +//@ stdcall AlpcRegisterCompletionList // 6.0 and higher +//@ stdcall AlpcRegisterCompletionListWorkerThread // 6.0 and higher +//@ stdcall AlpcRundownCompletionList // 6.1 and higher +//@ stdcall AlpcUnregisterCompletionList // 6.0 and higher +//@ stdcall AlpcUnregisterCompletionListWorkerThread // 6.0 and higher +@ stdcall CsrAllocateCaptureBuffer(long long) +//@ stdcall CsrAllocateCapturePointer // NT3, NT4 only +@ stdcall CsrAllocateMessagePointer(ptr long ptr) +@ stdcall CsrCaptureMessageBuffer(ptr ptr long ptr) +@ stdcall CsrCaptureMessageMultiUnicodeStringsInPlace(ptr long ptr) +@ stdcall CsrCaptureMessageString(ptr str long long ptr) +@ stdcall CsrCaptureTimeout(long ptr) +@ stdcall CsrClientCallServer(ptr ptr long long) +@ stdcall CsrClientConnectToServer(str long ptr ptr ptr) +//@ stdcall CsrClientMaxMessage // NT3 only +//@ stdcall CsrClientSendMessage // NT3 only +//@ stdcall CsrClientThreadConnect // NT3 only +@ stdcall CsrFreeCaptureBuffer(ptr) +@ stdcall CsrGetProcessId() +@ stdcall CsrIdentifyAlertableThread() +@ stdcall CsrNewThread() +@ stdcall CsrProbeForRead(ptr long long) +@ stdcall CsrProbeForWrite(ptr long long) +@ stdcall CsrSetPriorityClass(ptr ptr) +//@ stdcall CsrpProcessCallbackRequest // 3.51 only +@ stdcall DbgBreakPoint() +@ varargs DbgPrint(str) +@ varargs DbgPrintEx(long long str) +@ varargs DbgPrintReturnControlC(str) +@ stdcall DbgPrompt(ptr ptr long) +@ stdcall DbgQueryDebugFilterState(long long) +@ stdcall DbgSetDebugFilterState(long long long) +@ stdcall DbgUiConnectToDbg() +@ stdcall DbgUiContinue(ptr long) +@ stdcall DbgUiConvertStateChangeStructure(ptr ptr) +@ stdcall DbgUiDebugActiveProcess(ptr) +@ stdcall DbgUiGetThreadDebugObject() +@ stdcall DbgUiIssueRemoteBreakin(ptr) +@ stdcall DbgUiRemoteBreakin() +@ stdcall DbgUiSetThreadDebugObject(ptr) +@ stdcall DbgUiStopDebugging(ptr) +@ stdcall DbgUiWaitStateChange(ptr ptr) +@ stdcall DbgUserBreakPoint() +@ stdcall -arch=i386 KiFastSystemCall() +@ stdcall -arch=i386 KiFastSystemCallRet() +@ stdcall -arch=i386 KiIntSystemCall() +@ stdcall -arch=i386 ExpInterlockedPopEntrySListEnd() +@ stdcall -arch=i386 ExpInterlockedPopEntrySListFault() +@ stdcall -arch=i386 ExpInterlockedPopEntrySListResume() +@ stdcall KiRaiseUserExceptionDispatcher() +@ stdcall KiUserApcDispatcher(ptr ptr ptr ptr) +@ stdcall KiUserCallbackDispatcher(ptr ptr long) // CHECKME +@ stdcall KiUserExceptionDispatcher(ptr ptr) +//@ stdcall LdrAccessOutOfProcessResource +@ stdcall LdrAccessResource(long ptr ptr ptr) +@ stdcall LdrAddRefDll(long ptr) +//@ stdcall LdrAlternateResourcesEnabled +//@ stdcall LdrCreateOutOfProcessImage +//@ stdcall LdrDestroyOutOfProcessImage +@ stdcall LdrDisableThreadCalloutsForDll(long) +@ stdcall LdrEnumResources(ptr ptr long ptr ptr) +@ stdcall LdrEnumerateLoadedModules(long ptr long) +//@ stdcall LdrFindCreateProcessManifest // 5.1 and 5.2 only +@ stdcall LdrFindEntryForAddress(ptr ptr) +@ stdcall LdrFindResourceDirectory_U(long ptr long ptr) +//@ stdcall LdrFindResourceEx_U // 5.1 and higher +@ stdcall LdrFindResource_U(long ptr long ptr) +//@ stdcall LdrFlushAlternateResourceModules +@ stdcall LdrGetDllHandle(wstr long ptr ptr) +//@ stdcall LdrGetDllHandleEx +@ stdcall LdrGetProcedureAddress(ptr ptr long ptr) +//@ stdcall LdrHotPatchRoutine +//@ stdcall LdrInitShimEngineDynamic +@ stdcall LdrInitializeThunk(long long long long) +//@ stdcall LdrLoadAlternateResourceModule +@ stdcall LdrLoadDll(wstr long ptr ptr) +@ stdcall LdrLockLoaderLock(long ptr ptr) +//@ stdcall LdrOpenImageFileOptionsKey // 5.2 SP1 and higher +@ stdcall LdrProcessRelocationBlock(ptr long ptr long) +@ stdcall LdrQueryImageFileExecutionOptions(ptr str long ptr long ptr) +@ stdcall LdrQueryProcessModuleInformation(ptr long ptr) +//@ stdcall LdrSetAppCompatDllRedirectionCallback +//@ stdcall LdrSetDllManifestProber +@ stdcall LdrShutdownProcess() +@ stdcall LdrShutdownThread() +@ stdcall LdrUnloadAlternateResourceModule(ptr) +@ stdcall LdrUnloadDll(ptr) +@ stdcall LdrUnlockLoaderLock(long long) +@ stdcall LdrVerifyImageMatchesChecksum(ptr long long long) +@ extern NlsAnsiCodePage +@ extern NlsMbCodePageTag +@ extern NlsMbOemCodePageTag +@ stdcall NtAcceptConnectPort(ptr long ptr long long ptr) +@ stdcall NtAccessCheck(ptr long long ptr ptr ptr ptr ptr) +@ stdcall NtAccessCheckAndAuditAlarm(ptr long ptr ptr ptr long ptr long ptr ptr ptr) +@ stdcall NtAccessCheckByType(ptr ptr ptr long ptr long ptr ptr long ptr ptr) +@ stdcall NtAccessCheckByTypeAndAuditAlarm(ptr ptr ptr ptr ptr ptr long long long ptr long ptr long ptr ptr ptr) +@ stdcall NtAccessCheckByTypeResultList(ptr ptr ptr long ptr long ptr ptr long ptr ptr) +@ stdcall NtAccessCheckByTypeResultListAndAuditAlarm(ptr ptr ptr ptr ptr ptr long long long ptr long ptr long ptr ptr ptr) +@ stdcall NtAccessCheckByTypeResultListAndAuditAlarmByHandle(ptr ptr ptr ptr ptr ptr ptr long long long ptr long ptr long ptr ptr ptr) +@ stdcall NtAddAtom(ptr long ptr) +@ stdcall NtAddBootEntry(ptr long) +@ stdcall NtAddDriverEntry(ptr long) // 5.2 and higher +@ stdcall NtAdjustGroupsToken(long long ptr long ptr ptr) +@ stdcall NtAdjustPrivilegesToken(long long long long long long) +@ stdcall NtAlertResumeThread(long ptr) +@ stdcall NtAlertThread(long) +@ stdcall NtAllocateLocallyUniqueId(ptr) +@ stdcall NtAllocateUserPhysicalPages(ptr ptr ptr) +@ stdcall NtAllocateUuids(ptr ptr ptr ptr) +@ stdcall NtAllocateVirtualMemory(long ptr ptr ptr long long) +@ stdcall NtApphelpCacheControl(long ptr) +@ stdcall NtAreMappedFilesTheSame(ptr ptr) +@ stdcall NtAssignProcessToJobObject(long long) +@ stdcall NtCallbackReturn(ptr long long) +@ stdcall NtCancelDeviceWakeupRequest(ptr) +@ stdcall NtCancelIoFile(long ptr) +//@ stdcall NtCancelIoFileEx(long ptr ptr) // 6.0 and higher +@ stdcall NtCancelTimer(long ptr) +@ stdcall NtClearEvent(long) +@ stdcall NtClose(long) +@ stdcall NtCloseObjectAuditAlarm(ptr ptr long) +@ stdcall NtCompactKeys(long ptr) +@ stdcall NtCompareTokens(ptr ptr ptr) +@ stdcall NtCompleteConnectPort(ptr) +@ stdcall NtCompressKey(ptr) +@ stdcall NtConnectPort(ptr ptr ptr ptr ptr ptr ptr ptr) +@ stdcall NtContinue(ptr long) +@ stdcall NtCreateDebugObject(ptr long ptr long) +@ stdcall NtCreateDirectoryObject(long long long) +@ stdcall NtCreateEvent(long long long long long) +@ stdcall NtCreateEventPair(ptr long ptr) +@ stdcall NtCreateFile(ptr long ptr ptr long long long ptr long long ptr) +@ stdcall NtCreateIoCompletion(ptr long ptr long) +@ stdcall NtCreateJobObject(ptr long ptr) +@ stdcall NtCreateJobSet(long ptr long) +@ stdcall NtCreateKey(ptr long ptr long ptr long long) +@ stdcall NtCreateKeyedEvent(ptr long ptr long) +@ stdcall NtCreateMailslotFile(long long long long long long long long) +@ stdcall NtCreateMutant(ptr long ptr long) +@ stdcall NtCreateNamedPipeFile(ptr long ptr ptr long long long long long long long long long ptr) +@ stdcall NtCreatePagingFile(long long long long) +@ stdcall NtCreatePort(ptr ptr long long ptr) +@ stdcall NtCreateProcess(ptr long ptr ptr long ptr ptr ptr) +@ stdcall NtCreateProcessEx(ptr long ptr ptr long ptr ptr ptr long) +@ stdcall NtCreateProfile(ptr ptr ptr long long ptr long long long) // CHECKME +@ stdcall NtCreateSection(ptr long ptr ptr long long long) +@ stdcall NtCreateSemaphore(ptr long ptr long long) +@ stdcall NtCreateSymbolicLinkObject(ptr long ptr ptr) +@ stdcall NtCreateThread(ptr long ptr ptr ptr ptr ptr long) +@ stdcall NtCreateTimer(ptr long ptr long) +@ stdcall NtCreateToken(ptr long ptr long ptr ptr ptr ptr ptr ptr ptr ptr ptr) +@ stdcall NtCreateWaitablePort(ptr ptr long long long) +@ stdcall -arch=win32 NtCurrentTeb() _NtCurrentTeb +@ stdcall NtDebugActiveProcess(ptr ptr) +@ stdcall NtDebugContinue(ptr ptr long) +@ stdcall NtDelayExecution(long ptr) +@ stdcall NtDeleteAtom(long) +@ stdcall NtDeleteBootEntry(long) +@ stdcall NtDeleteFile(ptr) +@ stdcall NtDeleteKey(long) +@ stdcall NtDeleteObjectAuditAlarm(ptr ptr long) +@ stdcall NtDeleteValueKey(long ptr) +@ stdcall NtDeviceIoControlFile(long long long long long long long long long long) +@ stdcall NtDisplayString(ptr) +@ stdcall NtDuplicateObject(long long long ptr long long long) +@ stdcall NtDuplicateToken(long long long long long long) +@ stdcall NtEnumerateBootEntries(ptr ptr) +//@ stdcall NtEnumerateBus // 3.51 only +@ stdcall NtEnumerateKey (long long long long long long) +@ stdcall NtEnumerateSystemEnvironmentValuesEx(long ptr long) +@ stdcall NtEnumerateValueKey(long long long long long long) +@ stdcall NtExtendSection(ptr ptr) +@ stdcall NtFilterToken(ptr long ptr ptr ptr ptr) +@ stdcall NtFindAtom(ptr long ptr) +@ stdcall NtFlushBuffersFile(long ptr) +@ stdcall NtFlushInstructionCache(long ptr long) +@ stdcall NtFlushKey(long) +@ stdcall NtFlushVirtualMemory(long ptr ptr long) +@ stdcall NtFlushWriteBuffer() +@ stdcall NtFreeUserPhysicalPages(ptr ptr ptr) +@ stdcall NtFreeVirtualMemory(long ptr ptr long) +@ stdcall NtFsControlFile(long long long long long long long long long long) +@ stdcall NtGetContextThread(long ptr) +@ stdcall NtGetCurrentProcessorNumber() // 5.2 and higher +@ stdcall NtGetDevicePowerState(ptr ptr) +@ stdcall NtGetPlugPlayEvent(long long ptr long) +//@ stdcall NtGetTickCount() +@ stdcall NtGetWriteWatch(long long ptr long ptr ptr ptr) +@ stdcall NtImpersonateAnonymousToken(ptr) +@ stdcall NtImpersonateClientOfPort(ptr ptr) +@ stdcall NtImpersonateThread(ptr ptr ptr) +@ stdcall NtInitializeRegistry(long) +@ stdcall NtInitiatePowerAction (long long long long) +@ stdcall NtIsProcessInJob(long long) +@ stdcall NtIsSystemResumeAutomatic() +@ stdcall NtListenPort(ptr ptr) +@ stdcall NtLoadDriver(ptr) +@ stdcall NtLoadKey2(ptr ptr long) +@ stdcall NtLoadKey(ptr ptr) +@ stdcall NtLockFile(long long ptr ptr ptr ptr ptr ptr long long) +@ stdcall NtLockProductActivationKeys(ptr ptr) +@ stdcall NtLockRegistryKey(ptr) +@ stdcall NtLockVirtualMemory(long ptr ptr long) +@ stdcall NtMakePermanentObject(ptr) +@ stdcall NtMakeTemporaryObject(long) +@ stdcall NtMapUserPhysicalPages(ptr ptr ptr) +@ stdcall NtMapUserPhysicalPagesScatter(ptr ptr ptr) +@ stdcall NtMapViewOfSection(long long ptr long long ptr ptr long long long) +@ stdcall NtModifyBootEntry(ptr) +@ stdcall NtNotifyChangeDirectoryFile(long long ptr ptr ptr ptr long long long) +@ stdcall NtNotifyChangeKey(long long ptr ptr ptr long long ptr long long) +@ stdcall NtNotifyChangeMultipleKeys(ptr long ptr ptr ptr ptr ptr long long ptr long long) +@ stdcall NtOpenDirectoryObject(long long long) +@ stdcall NtOpenEvent(long long long) +@ stdcall NtOpenEventPair(ptr long ptr) +@ stdcall NtOpenFile(ptr long ptr ptr long long) +@ stdcall NtOpenIoCompletion(ptr long ptr) +@ stdcall NtOpenJobObject(ptr long ptr) +@ stdcall NtOpenKey(ptr long ptr) +@ stdcall NtOpenKeyedEvent(ptr long ptr) +@ stdcall NtOpenMutant(ptr long ptr) +@ stdcall NtOpenObjectAuditAlarm(ptr ptr ptr ptr ptr ptr long long ptr long long ptr) +@ stdcall NtOpenProcess(ptr long ptr ptr) +@ stdcall NtOpenProcessToken(long long ptr) +@ stdcall NtOpenProcessTokenEx(long long long ptr) +@ stdcall NtOpenSection(ptr long ptr) +@ stdcall NtOpenSemaphore(long long ptr) +@ stdcall NtOpenSymbolicLinkObject (ptr long ptr) +@ stdcall NtOpenThread(ptr long ptr ptr) +@ stdcall NtOpenThreadToken(long long long ptr) +@ stdcall NtOpenThreadTokenEx(long long long long ptr) +@ stdcall NtOpenTimer(ptr long ptr) +@ stdcall NtPlugPlayControl(ptr ptr long) +@ stdcall NtPowerInformation(long ptr long ptr long) +@ stdcall NtPrivilegeCheck(ptr ptr ptr) +@ stdcall NtPrivilegeObjectAuditAlarm(ptr ptr ptr long ptr long) +@ stdcall NtPrivilegedServiceAuditAlarm(ptr ptr ptr ptr long) +@ stdcall NtProtectVirtualMemory(long ptr ptr long ptr) +@ stdcall NtPulseEvent(long ptr) +@ stdcall NtQueryAttributesFile(ptr ptr) +@ stdcall NtQueryBootEntryOrder(ptr ptr) +@ stdcall NtQueryBootOptions(ptr ptr) +@ stdcall NtQueryDebugFilterState(long long) +@ stdcall NtQueryDefaultLocale(long ptr) +@ stdcall NtQueryDefaultUILanguage(ptr) +@ stdcall NtQueryDirectoryFile(long long ptr ptr ptr ptr long long long ptr long) +@ stdcall NtQueryDirectoryObject(long ptr long long long ptr ptr) +@ stdcall NtQueryEaFile(long ptr ptr long long ptr long ptr long) +@ stdcall NtQueryEvent(long long ptr long ptr) +@ stdcall NtQueryFullAttributesFile(ptr ptr) +@ stdcall NtQueryInformationAtom(long long ptr long ptr) +@ stdcall NtQueryInformationFile(long ptr ptr long long) +@ stdcall NtQueryInformationJobObject(long long ptr long ptr) +@ stdcall NtQueryInformationPort(ptr long ptr long ptr) +@ stdcall NtQueryInformationProcess(long long ptr long ptr) +@ stdcall NtQueryInformationThread(long long ptr long ptr) +@ stdcall NtQueryInformationToken(long long ptr long ptr) +@ stdcall NtQueryInstallUILanguage(ptr) +@ stdcall NtQueryIntervalProfile(long ptr) +@ stdcall NtQueryIoCompletion(long long ptr long ptr) +@ stdcall NtQueryKey (long long ptr long ptr) +@ stdcall NtQueryMultipleValueKey(long ptr long ptr long ptr) +@ stdcall NtQueryMutant(long long ptr long ptr) +@ stdcall NtQueryObject(long long long long long) +@ stdcall NtQueryOpenSubKeys(ptr ptr) +@ stdcall NtQueryPerformanceCounter(ptr ptr) +@ stdcall NtQueryPortInformationProcess() +@ stdcall NtQueryQuotaInformationFile(ptr ptr ptr long long ptr long ptr long) +@ stdcall NtQuerySection (long long long long long) +@ stdcall NtQuerySecurityObject (long long long long long) +@ stdcall NtQuerySemaphore (long long ptr long ptr) +@ stdcall NtQuerySymbolicLinkObject(long ptr ptr) +@ stdcall NtQuerySystemEnvironmentValue(ptr ptr long ptr) +@ stdcall NtQuerySystemEnvironmentValueEx(ptr ptr ptr ptr ptr) +@ stdcall NtQuerySystemInformation(long long long long) +@ stdcall NtQuerySystemTime(ptr) +@ stdcall NtQueryTimer(ptr long ptr long ptr) +@ stdcall NtQueryTimerResolution(long long long) +@ stdcall NtQueryValueKey(long long long long long long) +@ stdcall NtQueryVirtualMemory(long ptr long ptr long ptr) +@ stdcall NtQueryVolumeInformationFile(long ptr ptr long long) +@ stdcall NtQueueApcThread(long ptr long long long) +@ stdcall NtRaiseException(ptr ptr long) +@ stdcall NtRaiseHardError(long long long ptr long ptr) +@ stdcall NtReadFile(long long ptr ptr ptr ptr long ptr ptr) +@ stdcall NtReadFileScatter(long long ptr ptr ptr ptr long ptr ptr) +@ stdcall NtReadRequestData(ptr ptr long ptr long ptr) +@ stdcall NtReadVirtualMemory(long ptr ptr long ptr) +//@ stdcall NtRegisterNewDevice // 3.51 only +@ stdcall NtRegisterThreadTerminatePort(ptr) +@ stdcall NtReleaseKeyedEvent(ptr ptr long ptr) +@ stdcall NtReleaseMutant(long ptr) +//@ stdcall NtReleaseProcessMutant // 3.51 only +@ stdcall NtReleaseSemaphore(long long ptr) +@ stdcall NtRemoveIoCompletion(ptr ptr ptr ptr ptr) +@ stdcall NtRemoveProcessDebug(ptr ptr) +@ stdcall NtRenameKey(ptr ptr) +@ stdcall NtReplaceKey(ptr long ptr) +@ stdcall NtReplyPort(ptr ptr) +@ stdcall NtReplyWaitReceivePort(ptr ptr ptr ptr) +@ stdcall NtReplyWaitReceivePortEx(ptr ptr ptr ptr ptr) +@ stdcall NtReplyWaitReplyPort(ptr ptr) +@ stdcall NtRequestDeviceWakeup(ptr) +@ stdcall NtRequestPort(ptr ptr) +@ stdcall NtRequestWaitReplyPort(ptr ptr ptr) +@ stdcall NtRequestWakeupLatency(long) +@ stdcall NtResetEvent(long ptr) +@ stdcall NtResetWriteWatch(long ptr long) +@ stdcall NtRestoreKey(long long long) +@ stdcall NtResumeProcess(ptr) +@ stdcall NtResumeThread(long long) +@ stdcall NtSaveKey(long long) +@ stdcall NtSaveKeyEx(ptr ptr long) +@ stdcall NtSaveMergedKeys(ptr ptr ptr) +@ stdcall NtSecureConnectPort(ptr ptr ptr ptr ptr ptr ptr ptr ptr) +@ stdcall NtSetBootEntryOrder(ptr ptr) +@ stdcall NtSetBootOptions(ptr long) +@ stdcall NtSetContextThread(long ptr) +@ stdcall NtSetDebugFilterState(long long long) +@ stdcall NtSetDefaultHardErrorPort(ptr) +@ stdcall NtSetDefaultLocale(long long) +@ stdcall NtSetDefaultUILanguage(long) +@ stdcall NtSetEaFile(long ptr ptr long) +@ stdcall NtSetEvent(long long) +@ stdcall NtSetEventBoostPriority(ptr) +@ stdcall NtSetHighEventPair(ptr) +@ stdcall NtSetHighWaitLowEventPair(ptr) +//@ stdcall NtSetHighWaitLowThread // 3.51 and 4.0 only +@ stdcall NtSetInformationDebugObject(ptr long ptr long ptr) +@ stdcall NtSetInformationFile(long long long long long) +@ stdcall NtSetInformationJobObject(long long ptr long) +@ stdcall NtSetInformationKey(long long ptr long) +@ stdcall NtSetInformationObject(long long ptr long) +@ stdcall NtSetInformationProcess(long long long long) +@ stdcall NtSetInformationThread(long long ptr long) +@ stdcall NtSetInformationToken(long long ptr long) +@ stdcall NtSetIntervalProfile(long long) +@ stdcall NtSetIoCompletion(ptr long ptr long long) +@ stdcall NtSetLdtEntries(long double long double) // CHECKME +@ stdcall NtSetLowEventPair(ptr) +@ stdcall NtSetLowWaitHighEventPair(ptr) +//@ stdcall NtSetLowWaitHighThread // 3.51 and 4.0 only +@ stdcall NtSetQuotaInformationFile(ptr ptr ptr long) +@ stdcall NtSetSecurityObject(long long ptr) +@ stdcall NtSetSystemEnvironmentValue(ptr ptr) +@ stdcall NtSetSystemEnvironmentValueEx(ptr ptr) +@ stdcall NtSetSystemInformation(long ptr long) +@ stdcall NtSetSystemPowerState(long long long) +@ stdcall NtSetSystemTime(ptr ptr) +@ stdcall NtSetThreadExecutionState(long ptr) +@ stdcall NtSetTimer(long ptr ptr ptr long long ptr) +@ stdcall NtSetTimerResolution(long long ptr) +@ stdcall NtSetUuidSeed(ptr) +@ stdcall NtSetValueKey(long long long long long long) +@ stdcall NtSetVolumeInformationFile(long ptr ptr long long) +@ stdcall NtShutdownSystem(long) +@ stdcall NtSignalAndWaitForSingleObject(long long long ptr) +@ stdcall NtStartProfile(ptr) +@ stdcall NtStopProfile(ptr) +@ stdcall NtSuspendProcess(ptr) +@ stdcall NtSuspendThread(long ptr) +@ stdcall NtSystemDebugControl(long ptr long ptr long ptr) +@ stdcall NtTerminateJobObject(long long) +@ stdcall NtTerminateProcess(long long) +@ stdcall NtTerminateThread(long long) +@ stdcall NtTestAlert() +@ stdcall NtTraceEvent(long long long ptr) +@ stdcall NtTranslateFilePath(ptr long ptr long) +@ stdcall NtUnloadDriver(ptr) +@ stdcall NtUnloadKey(long) +@ stdcall NtUnloadKeyEx(ptr ptr) +@ stdcall NtUnlockFile(long ptr ptr ptr ptr) +@ stdcall NtUnlockVirtualMemory(long ptr ptr long) +@ stdcall NtUnmapViewOfSection(long ptr) +@ stdcall NtVdmControl(long ptr) +//@ stdcall NtW32Call(long ptr long ptr ptr) +@ stdcall NtWaitForDebugEvent(ptr long ptr ptr) +@ stdcall NtWaitForKeyedEvent(ptr ptr long ptr) +@ stdcall NtWaitForMultipleObjects(long ptr long long ptr) +//@ stdcall NtWaitForProcessMutant // 3.51 only +@ stdcall NtWaitForSingleObject(long long long) +@ stdcall NtWaitHighEventPair(ptr) +@ stdcall NtWaitLowEventPair(ptr) +@ stdcall NtWriteFile(long long ptr ptr ptr ptr long ptr ptr) +@ stdcall NtWriteFileGather(long long ptr ptr ptr ptr long ptr ptr) +@ stdcall NtWriteRequestData(ptr ptr long ptr long ptr) +@ stdcall NtWriteVirtualMemory(long ptr ptr long ptr) +@ stdcall NtYieldExecution() +//@ stdcall PfxFindPrefix +//@ stdcall PfxInitialize +//@ stdcall PfxInsertPrefix +//@ stdcall PfxRemovePrefix +//@ stdcall PropertyLengthAsVariant +//@ stdcall RtlAbortRXact +@ stdcall RtlAbsoluteToSelfRelativeSD(ptr ptr ptr) +@ stdcall RtlAcquirePebLock() +@ stdcall RtlAcquireResourceExclusive(ptr long) +@ stdcall RtlAcquireResourceShared(ptr long) +@ stdcall RtlAcquireSRWLockExclusive(ptr) +@ stdcall RtlAcquireSRWLockShared(ptr) +@ stdcall RtlActivateActivationContext(long ptr ptr) +//@ stdcall RtlActivateActivationContextEx +@ fastcall RtlActivateActivationContextUnsafeFast(ptr ptr) +@ stdcall RtlAddAccessAllowedAce(ptr long long ptr) +@ stdcall RtlAddAccessAllowedAceEx(ptr long long long ptr) +@ stdcall RtlAddAccessAllowedObjectAce(ptr long long long ptr ptr ptr) +@ stdcall RtlAddAccessDeniedAce(ptr long long ptr) +@ stdcall RtlAddAccessDeniedAceEx(ptr long long long ptr) +@ stdcall RtlAddAccessDeniedObjectAce(ptr long long long ptr ptr ptr) +@ stdcall RtlAddAce(ptr long long ptr long) +//@ stdcall RtlAddActionToRXact +@ stdcall RtlAddAtomToAtomTable(ptr wstr ptr) +//@ stdcall RtlAddAttributeActionToRXact +@ stdcall RtlAddAuditAccessAce(ptr long long ptr long long) +@ stdcall RtlAddAuditAccessAceEx(ptr long long long ptr long long) +@ stdcall RtlAddAuditAccessObjectAce(ptr long long long ptr ptr ptr long long) +//@ stdcall RtlAddCompoundAce +//@ stdcall RtlAddRange // 5.0 and 5.1 only +@ stdcall -arch=x86_64 RtlAddFunctionTable(ptr long long) +@ stdcall RtlAddMandatoryAce(ptr long long long long ptr) +@ stdcall RtlAddRefActivationContext(ptr) +//@ stdcall RtlAddRefMemoryStream +//@ stdcall RtlAddVectoredContinueHandler +@ stdcall RtlAddVectoredExceptionHandler(long ptr) +//@ stdcall RtlAddressInSectionTable +@ stdcall RtlAdjustPrivilege(long long long ptr) +@ stdcall RtlAllocateActivationContextStack(ptr) // CHEKME +@ stdcall RtlAllocateAndInitializeSid(ptr long long long long long long long long long ptr) +@ stdcall RtlAllocateHandle(ptr ptr) +@ stdcall RtlAllocateHeap(ptr long ptr) +@ stdcall RtlAnsiCharToUnicodeChar(ptr) +@ stdcall RtlAnsiStringToUnicodeSize(ptr) RtlxAnsiStringToUnicodeSize +@ stdcall RtlAnsiStringToUnicodeString(ptr ptr long) +@ stdcall RtlAppendAsciizToString(ptr str) +//@ stdcall RtlAppendPathElement +@ stdcall RtlAppendStringToString(ptr ptr) +@ stdcall RtlAppendUnicodeStringToString(ptr ptr) +@ stdcall RtlAppendUnicodeToString(ptr wstr) +//@ stdcall RtlApplicationVerifierStop +//@ stdcall RtlApplyRXact +//@ stdcall RtlApplyRXactNoFlush +@ stdcall RtlAreAllAccessesGranted(long long) +@ stdcall RtlAreAnyAccessesGranted(long long) +@ stdcall RtlAreBitsClear(ptr long long) +@ stdcall RtlAreBitsSet(ptr long long) +//@ stdcall RtlAssert2 +@ stdcall RtlAssert(ptr ptr long ptr) +//@ stdcall RtlCancelTimer +@ stdcall -register RtlCaptureContext(ptr) +@ stdcall RtlCaptureStackBackTrace(long long ptr ptr) +//@ stdcall RtlCaptureStackContext +@ stdcall RtlCharToInteger(ptr long ptr) +//@ stdcall RtlCheckForOrphanedCriticalSections +//@ stdcall RtlCheckProcessParameters +@ stdcall RtlCheckRegistryKey(long ptr) +@ stdcall RtlClearAllBits(ptr) +@ stdcall RtlClearBits(ptr long long) +//@ stdcall RtlCloneMemoryStream +//@ stdcall RtlClosePropertySet // NT 4.0 only +//@ stdcall RtlCommitMemoryStream +@ stdcall RtlCompactHeap(long long) +@ stdcall RtlCompareMemory(ptr ptr long) +@ stdcall RtlCompareMemoryUlong(ptr long long) +@ stdcall RtlCompareString(ptr ptr long) +@ stdcall RtlCompareUnicodeString (ptr ptr long) +@ stdcall RtlCompressBuffer(long ptr long ptr long long ptr ptr) +@ stdcall RtlComputeCrc32(long ptr long) +//@ stdcall RtlComputeImportTableHash +//@ stdcall RtlComputePrivatizedDllName_U +//@ stdcall RtlConsoleMultiByteToUnicodeN +@ stdcall RtlConvertExclusiveToShared(ptr) +@ stdcall -arch=win32 -ret64 RtlConvertLongToLargeInteger(long) +//@ stdcall RtlConvertPropertyToVariant +@ stdcall RtlConvertSharedToExclusive(ptr) +@ stdcall RtlConvertSidToUnicodeString(ptr ptr long) +//@ stdcall RtlConvertToAutoInheritSecurityObject +//@ stdcall RtlConvertUiListToApiList +@ stdcall -arch=win32 -ret64 RtlConvertUlongToLargeInteger(long) +//@ stdcall RtlConvertVariantToProperty +@ stdcall RtlCopyLuid(ptr ptr) +@ stdcall RtlCopyLuidAndAttributesArray(long ptr ptr) +//@ stdcall RtlCopyMappedMemory +//@ stdcall RtlCopyMemoryStreamTo +//@ stdcall RtlCopyOutOfProcessMemoryStreamTo +//@ stdcall RtlCopyRangeList // 5.0 and 5.1 only +@ stdcall RtlCopySecurityDescriptor(ptr ptr) +@ stdcall RtlCopySid(long ptr ptr) +@ stdcall RtlCopySidAndAttributesArray(long ptr long ptr ptr ptr ptr) +@ stdcall RtlCopyString(ptr ptr) +@ stdcall RtlCopyUnicodeString(ptr ptr) +@ stdcall RtlCreateAcl(ptr long long) +@ stdcall RtlCreateActivationContext(ptr ptr) +//@ stdcall RtlCreateAndSetSD +@ stdcall RtlCreateAtomTable(long ptr) +@ stdcall RtlCreateBootStatusDataFile() +@ stdcall RtlCreateEnvironment(long ptr) +@ stdcall RtlCreateHeap(long ptr long long ptr ptr) +@ stdcall RtlCreateProcessParameters(ptr ptr ptr ptr ptr ptr ptr ptr ptr ptr) +//@ stdcall RtlCreatePropertySet // 4.0 only +@ stdcall RtlCreateQueryDebugBuffer(long long) +@ stdcall RtlCreateRegistryKey(long wstr) +@ stdcall RtlCreateSecurityDescriptor(ptr long) +@ stdcall RtlCreateSystemVolumeInformationFolder(ptr) +@ stdcall RtlCreateTagHeap(ptr long str str) +@ stdcall RtlCreateTimer(ptr ptr ptr ptr long long long) +@ stdcall RtlCreateTimerQueue(ptr) +@ stdcall RtlCreateUnicodeString(ptr wstr) +@ stdcall RtlCreateUnicodeStringFromAsciiz(ptr str) +@ stdcall RtlCreateUserProcess(ptr long ptr ptr ptr ptr long ptr ptr ptr) +//@ stdcall RtlCreateUserSecurityObject +@ stdcall RtlCreateUserThread(long ptr long ptr long long ptr ptr ptr ptr) +@ stdcall RtlCustomCPToUnicodeN(ptr wstr long ptr str long) +@ stdcall RtlCutoverTimeToSystemTime(ptr ptr ptr long) +@ stdcall RtlDeNormalizeProcessParams(ptr) +@ stdcall RtlDeactivateActivationContext(long long) +@ fastcall RtlDeactivateActivationContextUnsafeFast(ptr) +//@ stdcall RtlDebugPrintTimes +@ stdcall RtlDecodePointer(ptr) +@ stdcall RtlDecodeSystemPointer(ptr) RtlEncodeSystemPointer +@ stdcall RtlDecompressBuffer(long ptr long ptr long ptr) +@ stdcall RtlDecompressFragment(long ptr long ptr long long ptr ptr) +//@ stdcall RtlDefaultNpAcl +@ stdcall RtlDelete(ptr) +@ stdcall RtlDeleteAce(ptr long) +@ stdcall RtlDeleteAtomFromAtomTable(ptr long) +@ stdcall RtlDeleteCriticalSection(ptr) +@ stdcall RtlDeleteElementGenericTable(ptr ptr) +@ stdcall RtlDeleteElementGenericTableAvl(ptr ptr) +@ cdecl -arch=x86_64 RtlDeleteFunctionTable(ptr) +@ stdcall RtlDeleteNoSplay(ptr ptr) +@ stdcall RtlDeleteOwnersRanges(ptr ptr) +@ stdcall RtlDeleteRange(ptr long long long long ptr) +@ stdcall RtlDeleteRegistryValue(long ptr ptr) +@ stdcall RtlDeleteResource(ptr) +@ stdcall RtlDeleteSecurityObject(ptr) +@ stdcall RtlDeleteTimer(ptr ptr ptr) +@ stdcall RtlDeleteTimerQueue(ptr) +@ stdcall RtlDeleteTimerQueueEx(ptr ptr) +@ stdcall RtlDeregisterWait(ptr) +@ stdcall RtlDeregisterWaitEx(ptr ptr) +@ stdcall RtlDestroyAtomTable(ptr) +@ stdcall RtlDestroyEnvironment(ptr) +@ stdcall RtlDestroyHandleTable(ptr) +@ stdcall RtlDestroyHeap(long) +@ stdcall RtlDestroyProcessParameters(ptr) +@ stdcall RtlDestroyQueryDebugBuffer(ptr) +@ stdcall RtlDetermineDosPathNameType_U(wstr) +@ stdcall RtlDllShutdownInProgress() +@ stdcall RtlDnsHostNameToComputerName(ptr ptr long) +@ stdcall RtlDoesFileExists_U(wstr) +//@ stdcall RtlDosApplyFileIsolationRedirection_Ustr +@ stdcall RtlDosPathNameToNtPathName_U(wstr ptr ptr ptr) +//@ stdcall RtlDosPathNameToNtPathName_U_WithStatus // 5.2 SP1, and higher +@ stdcall RtlDosPathNameToRelativeNtPathName_U(ptr ptr ptr ptr) // CHECKME +//@ stdcall RtlDosPathNameToRelativeNtPathName_U_WithStatus +@ stdcall RtlDosSearchPath_U(wstr wstr wstr long ptr ptr) +//@ stdcall RtlDosSearchPath_Ustr +@ stdcall RtlDowncaseUnicodeChar(long) +@ stdcall RtlDowncaseUnicodeString(ptr ptr long) +@ stdcall RtlDumpResource(ptr) +@ stdcall RtlDuplicateUnicodeString(long ptr ptr) +@ stdcall RtlEmptyAtomTable(ptr long) +//@ stdcall RtlEnableEarlyCriticalSectionEventCreation +@ stdcall RtlEncodePointer(ptr) +@ stdcall RtlEncodeSystemPointer(ptr) +@ stdcall -arch=win32 -ret64 RtlEnlargedIntegerMultiply(long long) +@ stdcall -arch=win32 RtlEnlargedUnsignedDivide(double long ptr) +@ stdcall -arch=win32 -ret64 RtlEnlargedUnsignedMultiply(long long) +@ stdcall RtlEnterCriticalSection(ptr) +@ stdcall RtlEnumProcessHeaps(ptr ptr) +@ stdcall RtlEnumerateGenericTable(ptr long) +@ stdcall RtlEnumerateGenericTableAvl(ptr long) +@ stdcall RtlEnumerateGenericTableLikeADirectory(ptr ptr ptr long ptr ptr ptr) +@ stdcall RtlEnumerateGenericTableWithoutSplaying(ptr ptr) +@ stdcall RtlEnumerateGenericTableWithoutSplayingAvl(ptr ptr) +//@ stdcall RtlEnumerateProperties // 4.0 only +@ stdcall RtlEqualComputerName(ptr ptr) +@ stdcall RtlEqualDomainName(ptr ptr) +@ stdcall RtlEqualLuid(ptr ptr) +@ stdcall RtlEqualPrefixSid(ptr ptr) +@ stdcall RtlEqualSid(long long) +@ stdcall RtlEqualString(ptr ptr long) +@ stdcall RtlEqualUnicodeString(ptr ptr long) +@ stdcall RtlEraseUnicodeString(ptr) +@ stdcall RtlExitUserThread(long) +@ stdcall RtlExpandEnvironmentStrings_U(ptr ptr ptr ptr) +@ stdcall RtlExtendHeap(ptr long ptr ptr) +@ stdcall -arch=win32 -ret64 RtlExtendedIntegerMultiply(double long) +@ stdcall -arch=win32 -ret64 RtlExtendedLargeIntegerDivide(double long ptr) +@ stdcall -arch=win32 -ret64 RtlExtendedMagicDivide(double double long) +@ stdcall RtlFillMemory(ptr long long) +@ stdcall RtlFillMemoryUlong(ptr long long) +//@ stdcall RtlFinalReleaseOutOfProcessMemoryStream +//@ stdcall RtlFindActivationContextSectionGuid +@ stdcall RtlFindActivationContextSectionString(long ptr long ptr ptr) +@ stdcall RtlFindCharInUnicodeString(long ptr ptr ptr) +@ stdcall RtlFindClearBits(ptr long long) +@ stdcall RtlFindClearBitsAndSet(ptr long long) +@ stdcall RtlFindClearRuns(ptr ptr long long) +@ stdcall RtlFindLastBackwardRunClear(ptr long ptr) +//@ stdcall RtlFindLastBackwardRunSet(ptr long ptr) +@ stdcall RtlFindLeastSignificantBit(double) +@ stdcall RtlFindLongestRunClear(ptr long) +@ stdcall RtlFindLongestRunSet(ptr long) +@ stdcall RtlFindMessage(long long long long ptr) +@ stdcall RtlFindMostSignificantBit(double) +@ stdcall RtlFindNextForwardRunClear(ptr long ptr) +//@ stdcall RtlFindNextForwardRunSet(ptr long ptr) +@ stdcall RtlFindRange(ptr long long long long long long long long ptr ptr ptr) +@ stdcall RtlFindSetBits(ptr long long) +@ stdcall RtlFindSetBitsAndClear(ptr long long) +//@ stdcall RtlFindSetRuns(ptr ptr long long) +@ stdcall RtlFirstEntrySList(ptr) +@ stdcall RtlFirstFreeAce(ptr ptr) +//@ stdcall RtlFlushPropertySet // 4.0 only +@ stdcall RtlFlushSecureMemoryCache(ptr ptr) +@ stdcall RtlFormatCurrentUserKeyPath(ptr) +@ stdcall RtlFormatMessage(ptr long long long long ptr ptr long) +//@ stdcall RtlFormatMessageEx +//@ stdcall RtlFreeActivationContextStack +@ stdcall RtlFreeAnsiString(long) +@ stdcall RtlFreeHandle(ptr ptr) +@ stdcall RtlFreeHeap(long long long) +@ stdcall RtlFreeOemString(ptr) +@ stdcall RtlFreeRangeList(ptr) +@ stdcall RtlFreeSid(long) +@ stdcall RtlFreeThreadActivationContextStack() +@ stdcall RtlFreeUnicodeString(ptr) +@ stdcall RtlFreeUserThreadStack(ptr ptr) // 4.0 to 5.2 only +@ stdcall RtlGUIDFromString(ptr ptr) +@ stdcall RtlGenerate8dot3Name(ptr ptr long ptr) +@ stdcall RtlGetAce(ptr long ptr) +@ stdcall RtlGetActiveActivationContext(ptr) +@ stdcall RtlGetCallersAddress(ptr ptr) +@ stdcall RtlGetCompressionWorkSpaceSize(long ptr ptr) +@ stdcall RtlGetControlSecurityDescriptor(ptr ptr ptr) +//@ stdcall RtlGetCriticalSectionRecursionCount +@ stdcall RtlGetCurrentDirectory_U(long ptr) +@ stdcall RtlGetCurrentPeb() +@ stdcall RtlGetCurrentProcessorNumber() // 5.2 SP1 and higher +@ stdcall RtlGetDaclSecurityDescriptor(ptr ptr ptr ptr) +@ stdcall RtlGetElementGenericTable(ptr long) +@ stdcall RtlGetElementGenericTableAvl(ptr long) +@ stdcall RtlGetFirstRange(ptr ptr ptr) +//@ stdcall RtlGetFrame +@ stdcall RtlGetFullPathName_U(wstr long ptr ptr) +//@ stdcall RtlGetFullPathName_UstrEx +@ stdcall RtlGetGroupSecurityDescriptor(ptr ptr ptr) +@ stdcall RtlGetLastNtStatus() +@ stdcall RtlGetLastWin32Error() +//@ stdcall RtlGetLengthWithoutLastFullDosOrNtPathElement +// Yes, Microsoft really misspelled this one! +//@ stdcall RtlGetLengthWithoutTrailingPathSeperators +@ stdcall RtlGetLongestNtPathLength() +//@ stdcall RtlGetNativeSystemInformation +@ stdcall RtlGetNextRange(ptr ptr long) +@ stdcall RtlGetNtGlobalFlags() +@ stdcall RtlGetNtProductType(ptr) +@ stdcall RtlGetNtVersionNumbers(ptr ptr ptr) +@ stdcall RtlGetOwnerSecurityDescriptor(ptr ptr ptr) +//@ stdcall RtlGetProductInfo(long long long long ptr) +@ stdcall RtlGetProcessHeaps(long ptr) +@ stdcall RtlGetSaclSecurityDescriptor(ptr ptr ptr ptr) +@ stdcall RtlGetSecurityDescriptorRMControl(ptr ptr) +@ stdcall RtlGetSetBootStatusData(ptr long long ptr long long) +//@ stdcall RtlGetThreadErrorMode +//@ stdcall RtlGetUnloadEventTrace +@ stdcall RtlGetUserInfoHeap(ptr long ptr ptr ptr) +@ stdcall RtlGetVersion(ptr) +//@ stdcall RtlGuidToPropertySetName // 4.0 only +@ stdcall RtlHashUnicodeString(ptr long long ptr) +@ stdcall RtlIdentifierAuthoritySid(ptr) +@ stdcall RtlImageDirectoryEntryToData(long long long ptr) +@ stdcall RtlImageNtHeader(long) +@ stdcall RtlImageNtHeaderEx(long ptr double ptr) +@ stdcall RtlImageRvaToSection(ptr long long) +@ stdcall RtlImageRvaToVa(ptr long long ptr) +@ stdcall RtlImpersonateSelf(long) +@ stdcall RtlInitAnsiString(ptr str) +@ stdcall RtlInitAnsiStringEx(ptr str) +@ stdcall RtlInitCodePageTable(ptr ptr) +//@ stdcall RtlInitMemoryStream +@ stdcall RtlInitNlsTables(ptr ptr ptr ptr) +//@ stdcall RtlInitOutOfProcessMemoryStream +@ stdcall RtlInitString(ptr str) +@ stdcall RtlInitUnicodeString(ptr wstr) +@ stdcall RtlInitUnicodeStringEx(ptr wstr) +//@ stdcall RtlInitializeAtomPackage +@ stdcall RtlInitializeBitMap(ptr long long) +@ stdcall RtlInitializeContext(ptr ptr ptr ptr ptr) +@ stdcall RtlInitializeCriticalSection(ptr) +@ stdcall RtlInitializeCriticalSectionAndSpinCount(ptr long) +//@ stdcall RtlInitializeCriticalSectionEx(ptr long long) +@ stdcall RtlInitializeGenericTable(ptr ptr ptr ptr ptr) +@ stdcall RtlInitializeGenericTableAvl(ptr ptr ptr ptr ptr) +@ stdcall RtlInitializeHandleTable(long long ptr) +//@ stdcall RtlInitializeRXact +@ stdcall RtlInitializeRangeList(ptr) +@ stdcall RtlInitializeResource(ptr) +@ stdcall RtlInitializeSListHead(ptr) +@ stdcall RtlInitializeSid(ptr ptr long) +@ stdcall RtlInitializeSRWLock(ptr) +//@ stdcall RtlInitializeStackTraceDataBase // 5.1 SP2 and SP3, and 5.2 only +@ stdcall RtlInsertElementGenericTable(ptr ptr long ptr) +@ stdcall RtlInsertElementGenericTableAvl(ptr ptr long ptr) +@ stdcall RtlInt64ToUnicodeString(double long ptr) +@ stdcall RtlIntegerToChar(long long long ptr) +@ stdcall RtlIntegerToUnicodeString(long long ptr) +@ stdcall -arch=i386,x86_64 RtlInterlockedFlushSList(ptr) +@ stdcall -arch=i386,x86_64 RtlInterlockedPopEntrySList(ptr) +@ stdcall -arch=i386,x86_64 RtlInterlockedPushEntrySList(ptr ptr) +@ stdcall RtlInterlockedPushListSList(ptr ptr ptr long) +@ stdcall RtlInvertRangeList(ptr ptr) +@ stdcall RtlIpv4AddressToStringA(ptr ptr) +@ stdcall RtlIpv4AddressToStringExA(ptr long ptr ptr) +@ stdcall RtlIpv4AddressToStringExW(ptr long ptr ptr) +@ stdcall RtlIpv4AddressToStringW(ptr ptr) +@ stdcall RtlIpv4StringToAddressA(str long ptr ptr) +@ stdcall RtlIpv4StringToAddressExA(str long ptr ptr) +@ stdcall RtlIpv4StringToAddressExW(wstr long ptr ptr) +@ stdcall RtlIpv4StringToAddressW(wstr long ptr ptr) +@ stdcall RtlIpv6AddressToStringA(ptr ptr) +@ stdcall RtlIpv6AddressToStringExA(ptr long long ptr ptr) +@ stdcall RtlIpv6AddressToStringExW(ptr long long ptr ptr) +@ stdcall RtlIpv6AddressToStringW(ptr ptr) +@ stdcall RtlIpv6StringToAddressA(str ptr ptr) +@ stdcall RtlIpv6StringToAddressExA(str ptr ptr ptr) +@ stdcall RtlIpv6StringToAddressExW(wstr ptr ptr ptr) +@ stdcall RtlIpv6StringToAddressW(wstr ptr ptr) +@ stdcall RtlIsActivationContextActive(ptr) +//@ stdcall RtlIsCriticalSectionLocked +//@ stdcall RtlIsCriticalSectionLockedByThread +@ stdcall RtlIsDosDeviceName_U(wstr) +@ stdcall RtlIsGenericTableEmpty(ptr) +@ stdcall RtlIsGenericTableEmptyAvl(ptr) +@ stdcall RtlIsNameLegalDOS8Dot3(ptr ptr ptr) +@ stdcall RtlIsRangeAvailable(ptr long long long long long long ptr ptr ptr) +@ stdcall RtlIsTextUnicode(ptr long ptr) +@ stdcall RtlIsThreadWithinLoaderCallout() +@ stdcall RtlIsValidHandle(ptr ptr) +@ stdcall RtlIsValidIndexHandle(ptr long ptr) +@ stdcall -arch=win32 -ret64 RtlLargeIntegerAdd(double double) +@ stdcall -arch=win32 -ret64 RtlLargeIntegerArithmeticShift(double long) +@ stdcall -arch=win32 -ret64 RtlLargeIntegerDivide(double double ptr) +@ stdcall -arch=win32 -ret64 RtlLargeIntegerNegate(double) +@ stdcall -arch=win32 -ret64 RtlLargeIntegerShiftLeft(double long) +@ stdcall -arch=win32 -ret64 RtlLargeIntegerShiftRight(double long) +@ stdcall -arch=win32 -ret64 RtlLargeIntegerSubtract(double double) +@ stdcall RtlLargeIntegerToChar(ptr long long ptr) +@ stdcall RtlLeaveCriticalSection(ptr) +@ stdcall RtlLengthRequiredSid(long) +@ stdcall RtlLengthSecurityDescriptor(ptr) +@ stdcall RtlLengthSid(ptr) +@ stdcall RtlLocalTimeToSystemTime(ptr ptr) +@ stdcall RtlLockBootStatusData(ptr) +@ stdcall RtlLockHeap(long) +//@ stdcall RtlLockMemoryStreamRegion +//@ stdcall RtlLogStackBackTrace +@ stdcall RtlLookupAtomInAtomTable(ptr wstr ptr) +@ stdcall RtlLookupElementGenericTable(ptr ptr) +@ stdcall RtlLookupElementGenericTableAvl(ptr ptr) +@ stdcall -arch=x86_64 RtlLookupFunctionEntry(long ptr ptr) +@ stdcall RtlMakeSelfRelativeSD(ptr ptr ptr) +@ stdcall RtlMapGenericMask(long ptr) +//@ stdcall RtlMapSecurityErrorToNtStatus +@ stdcall RtlMergeRangeLists(ptr ptr ptr long) +@ stdcall RtlMoveMemory(ptr ptr long) +//@ stdcall RtlMultiAppendUnicodeStringBuffer +@ stdcall RtlMultiByteToUnicodeN(ptr long ptr ptr long) +@ stdcall RtlMultiByteToUnicodeSize(ptr str long) +//@ stdcall RtlNewInstanceSecurityObject +//@ stdcall RtlNewSecurityGrantedAccess +@ stdcall RtlNewSecurityObject(ptr ptr ptr long ptr ptr) +//@ stdcall RtlNewSecurityObjectEx +//@ stdcall RtlNewSecurityObjectWithMultipleInheritance +@ stdcall RtlNormalizeProcessParams(ptr) +@ stdcall RtlNtPathNameToDosPathName(ptr ptr ptr ptr) // CHECKME +@ stdcall RtlNtStatusToDosError(long) +@ stdcall RtlNtStatusToDosErrorNoTeb(long) +@ stdcall RtlNumberGenericTableElements(ptr) +@ stdcall RtlNumberGenericTableElementsAvl(ptr) +@ stdcall RtlNumberOfClearBits(ptr) +@ stdcall RtlNumberOfSetBits(ptr) +//@ stdcall RtlOemStringToUnicodeSize(ptr) +@ stdcall RtlOemStringToUnicodeString(ptr ptr long) +@ stdcall RtlOemToUnicodeN(ptr long ptr ptr long) +@ stdcall RtlOpenCurrentUser(long ptr) +@ stdcall RtlPcToFileHeader(ptr ptr) +@ stdcall RtlPinAtomInAtomTable(ptr long) +//@ stdcall RtlPopFrame +@ stdcall RtlPrefixString(ptr ptr long) +@ stdcall RtlPrefixUnicodeString(ptr ptr long) +//@ stdcall RtlPropertySetNameToGuid // 4.0 only +@ stdcall RtlProtectHeap(ptr long) +//@ stdcall RtlPushFrame +@ stdcall RtlQueryAtomInAtomTable(ptr long ptr ptr ptr ptr) +@ stdcall RtlQueryDepthSList(ptr) +@ stdcall RtlQueryEnvironmentVariable_U(ptr ptr ptr) +@ stdcall RtlQueryHeapInformation(long long ptr long ptr) +@ stdcall RtlQueryInformationAcl(ptr ptr long long) +@ stdcall RtlQueryInformationActivationContext(long long ptr long ptr long ptr) +//@ stdcall RtlQueryInformationActiveActivationContext +//@ stdcall RtlQueryInterfaceMemoryStream +//@ stdcall RtlQueryProcessBackTraceInformation +@ stdcall RtlQueryProcessDebugInformation(long long ptr) +//@ stdcall RtlQueryProcessHeapInformation +//@ stdcall RtlQueryProcessLockInformation +//@ stdcall RtlQueryProperties // 4.0 only +//@ stdcall RtlQueryPropertyNames // 4.0 only +//@ stdcall RtlQueryPropertySet // 4.0 only +@ stdcall RtlQueryRegistryValues(long ptr ptr ptr ptr) +@ stdcall RtlQuerySecurityObject(ptr long ptr long ptr) +@ stdcall RtlQueryTagHeap(ptr long long long ptr) +@ stdcall RtlQueryTimeZoneInformation(ptr) +//@ stdcall RtlQueueApcWow64Thread +@ stdcall RtlQueueWorkItem(ptr ptr long) +@ stdcall -register RtlRaiseException(ptr) +@ stdcall RtlRaiseStatus(long) +@ stdcall RtlRandom(ptr) +@ stdcall RtlRandomEx(ptr) +@ stdcall RtlReAllocateHeap(long long ptr long) +//@ stdcall RtlReadMemoryStream +//@ stdcall RtlReadOutOfProcessMemoryStream +@ stdcall RtlRealPredecessor(ptr) +@ stdcall RtlRealSuccessor(ptr) +@ stdcall RtlRegisterSecureMemoryCacheCallback(ptr) +@ stdcall RtlRegisterWait(ptr ptr ptr ptr long long) +@ stdcall RtlReleaseActivationContext(ptr) +//@ stdcall RtlReleaseMemoryStream +@ stdcall RtlReleasePebLock() +@ stdcall RtlReleaseResource(ptr) +@ stdcall RtlReleaseSRWLockExclusive(ptr) +@ stdcall RtlReleaseSRWLockShared(ptr) +@ stdcall RtlRemoteCall(ptr ptr ptr long ptr long long) +//@ stdcall RtlRemoveVectoredContinueHandler +@ stdcall RtlRemoveVectoredExceptionHandler(ptr) +@ stdcall RtlResetRtlTranslations(ptr) +@ stdcall RtlRestoreLastWin32Error(long) RtlSetLastWin32Error +//@ stdcall RtlRevertMemoryStream +@ stdcall RtlRunDecodeUnicodeString(long ptr) +@ stdcall RtlRunEncodeUnicodeString(long ptr) +@ stdcall RtlSecondsSince1970ToTime(long ptr) +@ stdcall RtlSecondsSince1980ToTime(long ptr) +//@ stdcall RtlSeekMemoryStream +@ stdcall RtlSelfRelativeToAbsoluteSD2(ptr ptr) +@ stdcall RtlSelfRelativeToAbsoluteSD(ptr ptr ptr ptr ptr ptr ptr ptr ptr ptr ptr) +@ stdcall RtlSetAllBits(ptr) +@ stdcall RtlSetAttributesSecurityDescriptor(ptr long ptr) +@ stdcall RtlSetBits(ptr long long) +@ stdcall RtlSetControlSecurityDescriptor(ptr long long) +@ stdcall RtlSetCriticalSectionSpinCount(ptr long) +@ stdcall RtlSetCurrentDirectory_U(ptr) +@ stdcall RtlSetCurrentEnvironment(wstr ptr) +@ stdcall RtlSetDaclSecurityDescriptor(ptr long ptr long) +//@ stdcall RtlSetEnvironmentStrings +@ stdcall RtlSetEnvironmentVariable(ptr ptr ptr) +@ stdcall RtlSetGroupSecurityDescriptor(ptr ptr long) +@ stdcall RtlSetHeapInformation(ptr long ptr ptr) +@ stdcall RtlSetInformationAcl(ptr ptr long long) +@ stdcall RtlSetIoCompletionCallback(long ptr long) +@ stdcall RtlSetLastWin32Error(long) +@ stdcall RtlSetLastWin32ErrorAndNtStatusFromNtStatus(long) +//@ stdcall RtlSetMemoryStreamSize +@ stdcall RtlSetOwnerSecurityDescriptor(ptr ptr long) +@ stdcall RtlSetProcessIsCritical(long ptr long) +//@ stdcall RtlSetProperties // RtlSetProperties +//@ stdcall RtlSetPropertyClassId // 4.0 only +//@ stdcall RtlSetPropertyNames // 4.0 only +//@ stdcall RtlSetPropertySetClassId // 4.0 only +@ stdcall RtlSetSaclSecurityDescriptor(ptr long ptr long) +@ stdcall RtlSetSecurityDescriptorRMControl(ptr ptr) +@ stdcall RtlSetSecurityObject(long ptr ptr ptr ptr) +//@ stdcall RtlSetSecurityObjectEx +//@ stdcall RtlSetThreadErrorMode +//@ stdcall RtlSetThreadIsCritical +//@ stdcall RtlSetThreadPoolStartFunc +@ stdcall RtlSetTimeZoneInformation(ptr) +//@ stdcall RtlSetTimer +@ stdcall RtlSetUnhandledExceptionFilter(ptr) +//@ stdcall RtlSetUnicodeCallouts +@ stdcall RtlSetUserFlagsHeap(ptr long ptr long long) +@ stdcall RtlSetUserValueHeap(ptr long ptr ptr) +@ stdcall RtlSizeHeap(long long ptr) +@ stdcall RtlSleepConditionVariableCS(ptr ptr ptr) +@ stdcall RtlSleepConditionVariableSRW(ptr ptr ptr long) +@ stdcall RtlSplay(ptr) +//@ stdcall RtlStartRXact +//@ stdcall RtlStatMemoryStream +@ stdcall RtlStringFromGUID(ptr ptr) +@ stdcall RtlSubAuthorityCountSid(ptr) +@ stdcall RtlSubAuthoritySid(ptr long) +@ stdcall RtlSubtreePredecessor(ptr) +@ stdcall RtlSubtreeSuccessor(ptr) +@ stdcall RtlSystemTimeToLocalTime(ptr ptr) +@ stdcall RtlTimeFieldsToTime(ptr ptr) +@ stdcall RtlTimeToElapsedTimeFields(long long) +@ stdcall RtlTimeToSecondsSince1970(ptr ptr) +@ stdcall RtlTimeToSecondsSince1980(ptr ptr) +@ stdcall RtlTimeToTimeFields (long long) +//@ stdcall RtlTraceDatabaseAdd +//@ stdcall RtlTraceDatabaseCreate +//@ stdcall RtlTraceDatabaseDestroy +//@ stdcall RtlTraceDatabaseEnumerate +//@ stdcall RtlTraceDatabaseFind +//@ stdcall RtlTraceDatabaseLock +//@ stdcall RtlTraceDatabaseUnlock +//@ stdcall RtlTraceDatabaseValidate +@ stdcall RtlTryEnterCriticalSection(ptr) +@ fastcall -i386 RtlUlongByteSwap(long) +@ fastcall -ret64 RtlUlonglongByteSwap(double) +//@ stdcall RtlUnhandledExceptionFilter2 +@ stdcall RtlUnhandledExceptionFilter(ptr) +//@ stdcall RtlUnicodeStringToAnsiSize(ptr) +@ stdcall RtlUnicodeStringToAnsiString(ptr ptr long) +@ stdcall RtlUnicodeStringToCountedOemString(ptr ptr long) +@ stdcall RtlUnicodeStringToInteger(ptr long ptr) +//@ stdcall RtlUnicodeStringToOemSize(ptr) +@ stdcall RtlUnicodeStringToOemString(ptr ptr long) +@ stdcall RtlUnicodeToCustomCPN(ptr ptr long ptr wstr long) +@ stdcall RtlUnicodeToMultiByteN(ptr long ptr ptr long) +@ stdcall RtlUnicodeToMultiByteSize(ptr ptr long) +@ stdcall RtlUnicodeToOemN(ptr long ptr ptr long) +@ stdcall RtlUniform(ptr) +@ stdcall RtlUnlockBootStatusData(ptr) +@ stdcall RtlUnlockHeap(long) +//@ stdcall RtlUnlockMemoryStreamRegion +@ stdcall -register RtlUnwind(ptr ptr ptr ptr) +@ stdcall -arch=x86_64 RtlUnwindEx(long long ptr long ptr) +@ stdcall RtlUpcaseUnicodeChar(long) +@ stdcall RtlUpcaseUnicodeString(ptr ptr long) +@ stdcall RtlUpcaseUnicodeStringToAnsiString(ptr ptr long) +@ stdcall RtlUpcaseUnicodeStringToCountedOemString(ptr ptr long) +@ stdcall RtlUpcaseUnicodeStringToOemString(ptr ptr long) +@ stdcall RtlUpcaseUnicodeToCustomCPN(ptr ptr long ptr wstr long) +@ stdcall RtlUpcaseUnicodeToMultiByteN(ptr long ptr ptr long) +@ stdcall RtlUpcaseUnicodeToOemN(ptr long ptr ptr long) +@ stdcall RtlUpdateTimer(ptr ptr long long) +@ stdcall RtlUpperChar(long) +@ stdcall RtlUpperString(ptr ptr) +@ stdcall RtlUsageHeap(ptr long ptr) +@ fastcall -i386 RtlUshortByteSwap(long) +@ stdcall RtlValidAcl(ptr) +@ stdcall RtlValidRelativeSecurityDescriptor(ptr long long) +@ stdcall RtlValidSecurityDescriptor(ptr) +@ stdcall RtlValidSid(ptr) +@ stdcall RtlValidateHeap(long long ptr) +@ stdcall RtlValidateProcessHeaps() +@ stdcall RtlValidateUnicodeString(long ptr) +@ stdcall RtlVerifyVersionInfo(ptr long double) +@ stdcall -arch=x86_64 RtlVirtualUnwind(long long long ptr ptr ptr ptr ptr) +@ stdcall RtlWalkFrameChain(ptr long long) +@ stdcall RtlWalkHeap(long ptr) +//@ stdcall RtlWow64EnableFsRedirection(long) +//@ stdcall RtlWow64EnableFsRedirectionEx(long ptr) +@ stdcall RtlWakeAllConditionVariable(ptr) +@ stdcall RtlWakeConditionVariable(ptr) +//@ stdcall RtlWriteMemoryStream +@ stdcall RtlWriteRegistryValue(long ptr ptr long ptr long) +@ stdcall RtlZeroHeap(ptr long) +@ stdcall RtlZeroMemory(ptr long) +@ stdcall RtlZombifyActivationContext(ptr) +//@ stdcall RtlpApplyLengthFunction +@ stdcall RtlpEnsureBufferSize(ptr ptr ptr) // CHECKME +//@ stdcall RtlpNotOwnerCriticalSection +@ stdcall RtlpNtCreateKey(ptr long ptr long ptr ptr) +@ stdcall RtlpNtEnumerateSubKey(ptr ptr long long) +@ stdcall RtlpNtMakeTemporaryKey(ptr) +@ stdcall RtlpNtOpenKey(ptr long ptr long) +@ stdcall RtlpNtQueryValueKey(ptr ptr ptr ptr long) +@ stdcall RtlpNtSetValueKey(ptr long ptr long) +@ stdcall RtlpUnWaitCriticalSection(ptr) +@ stdcall RtlpWaitForCriticalSection(ptr) +@ stdcall RtlxAnsiStringToUnicodeSize(ptr) +@ stdcall RtlxOemStringToUnicodeSize(ptr) +@ stdcall RtlxUnicodeStringToAnsiSize(ptr) +@ stdcall RtlxUnicodeStringToOemSize(ptr) // RtlUnicodeStringToOemSize +@ stdcall -ret64 VerSetConditionMask(double long long) +@ stdcall ZwAcceptConnectPort(ptr long ptr long long ptr) NtAcceptConnectPort +@ stdcall ZwAccessCheck(ptr long long ptr ptr ptr ptr ptr) NtAccessCheck +@ stdcall ZwAccessCheckAndAuditAlarm(ptr long ptr ptr ptr long ptr long ptr ptr ptr) NtAccessCheckAndAuditAlarm +@ stdcall ZwAccessCheckByType(ptr ptr ptr long ptr long ptr ptr long ptr ptr) NtAccessCheckByType +@ stdcall ZwAccessCheckByTypeAndAuditAlarm(ptr ptr ptr ptr ptr ptr long long long ptr long ptr long ptr ptr ptr) NtAccessCheckByTypeAndAuditAlarm +@ stdcall ZwAccessCheckByTypeResultList(ptr ptr ptr long ptr long ptr ptr long ptr ptr) NtAccessCheckByTypeResultList +@ stdcall ZwAccessCheckByTypeResultListAndAuditAlarm(ptr ptr ptr ptr ptr ptr long long long ptr long ptr long ptr ptr ptr) NtAccessCheckByTypeResultListAndAuditAlarm +@ stdcall ZwAccessCheckByTypeResultListAndAuditAlarmByHandle(ptr ptr ptr ptr ptr ptr ptr long long long ptr long ptr long ptr ptr ptr) NtAccessCheckByTypeResultListAndAuditAlarmByHandle +@ stdcall ZwAddAtom(ptr long ptr) NtAddAtom +@ stdcall ZwAddBootEntry(ptr long) +@ stdcall ZwAdjustGroupsToken(long long long long long long) NtAdjustGroupsToken +@ stdcall ZwAdjustPrivilegesToken(long long long long long long) NtAdjustPrivilegesToken +@ stdcall ZwAlertResumeThread(long ptr) NtAlertResumeThread +@ stdcall ZwAlertThread(long) NtAlertThread +@ stdcall ZwAllocateLocallyUniqueId(ptr) NtAllocateLocallyUniqueId +@ stdcall ZwAllocateUserPhysicalPages(ptr ptr ptr) +@ stdcall ZwAllocateUuids(ptr ptr ptr ptr) NtAllocateUuids +@ stdcall ZwAllocateVirtualMemory(long ptr ptr ptr long long) NtAllocateVirtualMemory +@ stdcall ZwAreMappedFilesTheSame(ptr ptr) NtAreMappedFilesTheSame +@ stdcall ZwAssignProcessToJobObject(long long) NtAssignProcessToJobObject +@ stdcall ZwCallbackReturn(ptr long long) +@ stdcall ZwCancelDeviceWakeupRequest(ptr) +@ stdcall ZwCancelIoFile(long ptr) NtCancelIoFile +//@ stdcall ZwCancelIoFileEx(long ptr ptr) NtCancelIoFileEx +@ stdcall ZwCancelTimer(long ptr) NtCancelTimer +@ stdcall ZwClearEvent(long) NtClearEvent +@ stdcall ZwClose(long) NtClose +@ stdcall ZwCloseObjectAuditAlarm(ptr ptr long) +@ stdcall ZwCompactKeys(long ptr) NtCompactKeys +@ stdcall ZwCompareTokens(ptr ptr ptr) NtCompareTokens +@ stdcall ZwCompleteConnectPort(ptr) NtCompleteConnectPort +@ stdcall ZwCompressKey(ptr) NtCompressKey +@ stdcall ZwConnectPort(ptr ptr ptr ptr ptr ptr ptr ptr) NtConnectPort +@ stdcall ZwContinue(ptr long) NtContinue +@ stdcall ZwCreateDebugObject(ptr long ptr long) NtCreateDebugObject +@ stdcall ZwCreateDirectoryObject(long long long) NtCreateDirectoryObject +@ stdcall ZwCreateEvent(long long long long long) NtCreateEvent +@ stdcall ZwCreateEventPair(ptr long ptr) NtCreateEventPair +@ stdcall ZwCreateFile(ptr long ptr ptr long long long ptr long long ptr) NtCreateFile +@ stdcall ZwCreateIoCompletion(ptr long ptr long) NtCreateIoCompletion +@ stdcall ZwCreateJobObject(ptr long ptr) NtCreateJobObject +@ stdcall ZwCreateJobSet(long ptr long) NtCreateJobSet +@ stdcall ZwCreateKey(ptr long ptr long ptr long long) NtCreateKey +@ stdcall ZwCreateKeyedEvent(ptr long ptr long) NtCreateKeyedEvent +@ stdcall ZwCreateMailslotFile(long long long long long long long long) NtCreateMailslotFile +@ stdcall ZwCreateMutant(ptr long ptr long) NtCreateMutant +@ stdcall ZwCreateNamedPipeFile(ptr long ptr ptr long long long long long long long long long ptr) NtCreateNamedPipeFile +@ stdcall ZwCreatePagingFile(long long long long) NtCreatePagingFile +@ stdcall ZwCreatePort(ptr ptr long long long) NtCreatePort +@ stdcall ZwCreateProcess(ptr long ptr ptr long ptr ptr ptr) +@ stdcall ZwCreateProcessEx(ptr long ptr ptr long ptr ptr ptr long) NtCreateProcessEx +@ stdcall ZwCreateProfile(ptr ptr ptr long long ptr long long long) NtCreateProfile // CHECKME +@ stdcall ZwCreateSection(ptr long ptr ptr long long long) NtCreateSection +@ stdcall ZwCreateSemaphore(ptr long ptr long long) NtCreateSemaphore +@ stdcall ZwCreateSymbolicLinkObject(ptr long ptr ptr) NtCreateSymbolicLinkObject +@ stdcall ZwCreateThread(ptr long ptr ptr ptr ptr ptr long) +@ stdcall ZwCreateTimer(ptr long ptr long) NtCreateTimer +@ stdcall ZwCreateToken(ptr long ptr long ptr ptr ptr ptr ptr ptr ptr ptr ptr) +@ stdcall ZwCreateWaitablePort(ptr ptr long long long) NtCreateWaitablePort +@ stdcall ZwDebugActiveProcess(ptr ptr) NtDebugActiveProcess +@ stdcall ZwDebugContinue(ptr ptr long) NtDebugContinue +@ stdcall ZwDelayExecution(long ptr) NtDelayExecution +@ stdcall ZwDeleteAtom(long) NtDeleteAtom +@ stdcall ZwDeleteBootEntry(long) NtDeleteBootEntry +@ stdcall ZwDeleteFile(ptr) NtDeleteFile +@ stdcall ZwDeleteKey(long) NtDeleteKey +@ stdcall ZwDeleteObjectAuditAlarm(ptr ptr long) +@ stdcall ZwDeleteValueKey(long ptr) NtDeleteValueKey +@ stdcall ZwDeviceIoControlFile(long long long long long long long long long long) NtDeviceIoControlFile +@ stdcall ZwDisplayString(ptr) NtDisplayString +@ stdcall ZwDuplicateObject(long long long ptr long long long) NtDuplicateObject +@ stdcall ZwDuplicateToken(long long long long long long) NtDuplicateToken +@ stdcall ZwEnumerateBootEntries(ptr ptr) +//@ stdcall ZwEnumerateBus // 3.51 only +@ stdcall ZwEnumerateKey(long long long ptr long ptr) NtEnumerateKey +@ stdcall ZwEnumerateSystemEnvironmentValuesEx(long ptr long) NtEnumerateSystemEnvironmentValuesEx +@ stdcall ZwEnumerateValueKey(long long long ptr long ptr) NtEnumerateValueKey +@ stdcall ZwExtendSection(ptr ptr) NtExtendSection +@ stdcall ZwFilterToken(ptr long ptr ptr ptr ptr) NtFilterToken +@ stdcall ZwFindAtom(ptr long ptr) NtFindAtom +@ stdcall ZwFlushBuffersFile(long ptr) NtFlushBuffersFile +@ stdcall ZwFlushInstructionCache(long ptr long) NtFlushInstructionCache +@ stdcall ZwFlushKey(long) NtFlushKey +@ stdcall ZwFlushVirtualMemory(long ptr ptr long) NtFlushVirtualMemory +@ stdcall ZwFlushWriteBuffer() +@ stdcall ZwFreeUserPhysicalPages(ptr ptr ptr) +@ stdcall ZwFreeVirtualMemory(long ptr ptr long) NtFreeVirtualMemory +@ stdcall ZwFsControlFile(long long long long long long long long long long) NtFsControlFile +@ stdcall ZwGetContextThread(long ptr) NtGetContextThread +@ stdcall ZwGetCurrentProcessorNumber() +@ stdcall ZwGetDevicePowerState(ptr ptr) +@ stdcall ZwGetPlugPlayEvent(long long ptr long) +//@ stdcall ZwGetTickCount() NtGetTickCount +@ stdcall ZwGetWriteWatch(long long ptr long ptr ptr ptr) NtGetWriteWatch +@ stdcall ZwImpersonateAnonymousToken(ptr) +@ stdcall ZwImpersonateClientOfPort(ptr ptr) NtImpersonateClientOfPort +@ stdcall ZwImpersonateThread(ptr ptr ptr) NtImpersonateThread +@ stdcall ZwInitializeRegistry(long) +@ stdcall ZwInitiatePowerAction(long long long long) NtInitiatePowerAction +@ stdcall ZwIsProcessInJob(long long) NtIsProcessInJob +@ stdcall ZwIsSystemResumeAutomatic() +@ stdcall ZwListenPort(ptr ptr) NtListenPort +@ stdcall ZwLoadDriver(ptr) NtLoadDriver +@ stdcall ZwLoadKey2(ptr ptr long) NtLoadKey2 +@ stdcall ZwLoadKey(ptr ptr) NtLoadKey +@ stdcall ZwLockFile(long long ptr ptr ptr ptr ptr ptr long long) NtLockFile +@ stdcall ZwLockProductActivationKeys(ptr ptr) NtLockProductActivationKeys +@ stdcall ZwLockRegistryKey(ptr) NtLockRegistryKey +@ stdcall ZwLockVirtualMemory(long ptr ptr long) NtLockVirtualMemory +@ stdcall ZwMakePermanentObject(ptr) NtMakePermanentObject +@ stdcall ZwMakeTemporaryObject(long) NtMakeTemporaryObject +@ stdcall ZwMapUserPhysicalPages(ptr ptr ptr) +@ stdcall ZwMapUserPhysicalPagesScatter(ptr ptr ptr) +@ stdcall ZwMapViewOfSection(long long ptr long long ptr ptr long long long) NtMapViewOfSection +@ stdcall ZwModifyBootEntry(ptr) NtModifyBootEntry +@ stdcall ZwNotifyChangeDirectoryFile(long long ptr ptr ptr ptr long long long) NtNotifyChangeDirectoryFile +@ stdcall ZwNotifyChangeKey(long long ptr ptr ptr long long ptr long long) NtNotifyChangeKey +@ stdcall ZwNotifyChangeMultipleKeys(ptr long ptr ptr ptr ptr ptr long long ptr long long) NtNotifyChangeMultipleKeys +@ stdcall ZwOpenDirectoryObject(long long long) NtOpenDirectoryObject +@ stdcall ZwOpenEvent(long long long) NtOpenEvent +@ stdcall ZwOpenEventPair(ptr long ptr) NtOpenEventPair +@ stdcall ZwOpenFile(ptr long ptr ptr long long) NtOpenFile +@ stdcall ZwOpenIoCompletion(ptr long ptr) NtOpenIoCompletion +@ stdcall ZwOpenJobObject(ptr long ptr) NtOpenJobObject +@ stdcall ZwOpenKey(ptr long ptr) NtOpenKey +@ stdcall ZwOpenKeyedEvent(ptr long ptr) NtOpenKeyedEvent +@ stdcall ZwOpenMutant(ptr long ptr) NtOpenMutant +@ stdcall ZwOpenObjectAuditAlarm(ptr ptr ptr ptr ptr ptr long long ptr long long ptr) +@ stdcall ZwOpenProcess(ptr long ptr ptr) NtOpenProcess +@ stdcall ZwOpenProcessToken(long long ptr) NtOpenProcessToken +@ stdcall ZwOpenProcessTokenEx(long long long ptr) NtOpenProcessTokenEx +@ stdcall ZwOpenSection(ptr long ptr) NtOpenSection +@ stdcall ZwOpenSemaphore(long long ptr) NtOpenSemaphore +@ stdcall ZwOpenSymbolicLinkObject (ptr long ptr) NtOpenSymbolicLinkObject +@ stdcall ZwOpenThread(ptr long ptr ptr) NtOpenThread +@ stdcall ZwOpenThreadToken(long long long ptr) NtOpenThreadToken +@ stdcall ZwOpenThreadTokenEx(long long long long ptr) NtOpenThreadTokenEx +@ stdcall ZwOpenTimer(ptr long ptr) NtOpenTimer +@ stdcall ZwPlugPlayControl(ptr ptr long) +@ stdcall ZwPowerInformation(long ptr long ptr long) NtPowerInformation +@ stdcall ZwPrivilegeCheck(ptr ptr ptr) NtPrivilegeCheck +@ stdcall ZwPrivilegeObjectAuditAlarm(ptr ptr ptr long ptr long) +@ stdcall ZwPrivilegedServiceAuditAlarm(ptr ptr ptr ptr long) +@ stdcall ZwProtectVirtualMemory(long ptr ptr long ptr) NtProtectVirtualMemory +@ stdcall ZwPulseEvent(long ptr) NtPulseEvent +@ stdcall ZwQueryAttributesFile(ptr ptr) NtQueryAttributesFile +@ stdcall ZwQueryBootEntryOrder(ptr ptr) NtQueryBootEntryOrder +@ stdcall ZwQueryBootOptions(ptr ptr) NtQueryBootOptions +@ stdcall ZwQueryDebugFilterState(long long) NtQueryDebugFilterState +@ stdcall ZwQueryDefaultLocale(long ptr) NtQueryDefaultLocale +@ stdcall ZwQueryDefaultUILanguage(ptr) NtQueryDefaultUILanguage +@ stdcall ZwQueryDirectoryFile(long long ptr ptr ptr ptr long long long ptr long) NtQueryDirectoryFile +@ stdcall ZwQueryDirectoryObject(long ptr long long long ptr ptr) NtQueryDirectoryObject +@ stdcall ZwQueryEaFile(long ptr ptr long long ptr long ptr long) NtQueryEaFile +@ stdcall ZwQueryEvent(long long ptr long ptr) NtQueryEvent +@ stdcall ZwQueryFullAttributesFile(ptr ptr) NtQueryFullAttributesFile +@ stdcall ZwQueryInformationAtom(long long ptr long ptr) NtQueryInformationAtom +@ stdcall ZwQueryInformationFile(long ptr ptr long long) NtQueryInformationFile +@ stdcall ZwQueryInformationJobObject(long long ptr long ptr) NtQueryInformationJobObject +@ stdcall ZwQueryInformationPort(ptr long ptr long ptr) NtQueryInformationPort +@ stdcall ZwQueryInformationProcess(long long ptr long ptr) NtQueryInformationProcess +@ stdcall ZwQueryInformationThread(long long ptr long ptr) NtQueryInformationThread +@ stdcall ZwQueryInformationToken(long long ptr long ptr) NtQueryInformationToken +@ stdcall ZwQueryInstallUILanguage(ptr) NtQueryInstallUILanguage +@ stdcall ZwQueryIntervalProfile(long ptr) NtQueryIntervalProfile +@ stdcall ZwQueryIoCompletion(long long ptr long ptr) NtQueryIoCompletion +@ stdcall ZwQueryKey(long long ptr long ptr) NtQueryKey +@ stdcall ZwQueryMultipleValueKey(long ptr long ptr long ptr) NtQueryMultipleValueKey +@ stdcall ZwQueryMutant(long long ptr long ptr) NtQueryMutant +@ stdcall ZwQueryObject(long long long long long) NtQueryObject +@ stdcall ZwQueryOpenSubKeys(ptr ptr) NtQueryOpenSubKeys +@ stdcall ZwQueryPerformanceCounter (long long) NtQueryPerformanceCounter +@ stdcall ZwQueryPortInformationProcess() NtQueryPortInformationProcess +@ stdcall ZwQueryQuotaInformationFile(ptr ptr ptr long long ptr long ptr long) NtQueryQuotaInformationFile +@ stdcall ZwQuerySection (long long long long long) NtQuerySection +@ stdcall ZwQuerySecurityObject (long long long long long) NtQuerySecurityObject +@ stdcall ZwQuerySemaphore (long long long long long) NtQuerySemaphore +@ stdcall ZwQuerySymbolicLinkObject(long ptr ptr) NtQuerySymbolicLinkObject +@ stdcall ZwQuerySystemEnvironmentValue(ptr ptr long ptr) NtQuerySystemEnvironmentValue +@ stdcall ZwQuerySystemEnvironmentValueEx(ptr ptr ptr ptr ptr) NtQuerySystemEnvironmentValueEx +@ stdcall ZwQuerySystemInformation(long long long long) NtQuerySystemInformation +@ stdcall ZwQuerySystemTime(ptr) NtQuerySystemTime +@ stdcall ZwQueryTimer(ptr long ptr long ptr) NtQueryTimer +@ stdcall ZwQueryTimerResolution(long long long) NtQueryTimerResolution +@ stdcall ZwQueryValueKey(long ptr long ptr long ptr) NtQueryValueKey +@ stdcall ZwQueryVirtualMemory(long ptr long ptr long ptr) NtQueryVirtualMemory +@ stdcall ZwQueryVolumeInformationFile(long ptr ptr long long) NtQueryVolumeInformationFile +@ stdcall ZwQueueApcThread(long ptr long long long) NtQueueApcThread +@ stdcall ZwRaiseException(ptr ptr long) NtRaiseException +@ stdcall ZwRaiseHardError(long long long ptr long ptr) NtRaiseHardError +@ stdcall ZwReadFile(long long ptr ptr ptr ptr long ptr ptr) NtReadFile +@ stdcall ZwReadFileScatter(long long ptr ptr ptr ptr long ptr ptr) NtReadFileScatter +@ stdcall ZwReadRequestData(ptr ptr long ptr long ptr) NtReadRequestData +@ stdcall ZwReadVirtualMemory(long ptr ptr long ptr) NtReadVirtualMemory +//@ stdcall ZwRegisterNewDevice // 3.51 only +@ stdcall ZwRegisterThreadTerminatePort(ptr) NtRegisterThreadTerminatePort +@ stdcall ZwReleaseKeyedEvent(ptr ptr long ptr) NtReleaseKeyedEvent +@ stdcall ZwReleaseMutant(long ptr) NtReleaseMutant +//@ stdcall ZwReleaseProcessMutant // 3.51 only +@ stdcall ZwReleaseSemaphore(long long ptr) NtReleaseSemaphore +@ stdcall ZwRemoveIoCompletion(ptr ptr ptr ptr ptr) NtRemoveIoCompletion +@ stdcall ZwRemoveProcessDebug(ptr ptr) NtRemoveProcessDebug +@ stdcall ZwRenameKey(ptr ptr) NtRenameKey +@ stdcall ZwReplaceKey(ptr long ptr) NtReplaceKey +@ stdcall ZwReplyPort(ptr ptr) NtReplyPort +@ stdcall ZwReplyWaitReceivePort(ptr ptr ptr ptr) NtReplyWaitReceivePort +@ stdcall ZwReplyWaitReceivePortEx(ptr ptr ptr ptr ptr) +@ stdcall ZwReplyWaitReplyPort(ptr ptr) +@ stdcall ZwRequestDeviceWakeup(ptr) +@ stdcall ZwRequestPort(ptr ptr) +@ stdcall ZwRequestWaitReplyPort(ptr ptr ptr) +@ stdcall ZwRequestWakeupLatency(long) +@ stdcall ZwResetEvent(long ptr) +@ stdcall ZwResetWriteWatch(long ptr long) +@ stdcall ZwRestoreKey(long long long) +@ stdcall ZwResumeProcess(ptr) +@ stdcall ZwResumeThread(long long) +@ stdcall ZwSaveKey(long long) +@ stdcall ZwSaveKeyEx(ptr ptr long) +@ stdcall ZwSaveMergedKeys(ptr ptr ptr) +@ stdcall ZwSecureConnectPort(ptr ptr ptr ptr ptr ptr ptr ptr ptr) +@ stdcall ZwSetBootEntryOrder(ptr ptr) +@ stdcall ZwSetBootOptions(ptr long) +@ stdcall ZwSetContextThread(long ptr) +@ stdcall ZwSetDebugFilterState(long long long) +@ stdcall ZwSetDefaultHardErrorPort(ptr) +@ stdcall ZwSetDefaultLocale(long long) +@ stdcall ZwSetDefaultUILanguage(long) +@ stdcall ZwSetEaFile(long ptr ptr long) +@ stdcall ZwSetEvent(long long) +@ stdcall ZwSetEventBoostPriority(ptr) +@ stdcall ZwSetHighEventPair(ptr) +@ stdcall ZwSetHighWaitLowEventPair(ptr) +//@ stdcall ZwSetHighWaitLowThread // 3.51 and 4.0 only +@ stdcall ZwSetInformationDebugObject(ptr long ptr long ptr) +@ stdcall ZwSetInformationFile(long long long long long) +@ stdcall ZwSetInformationJobObject(long long ptr long) +@ stdcall ZwSetInformationKey(long long ptr long) +@ stdcall ZwSetInformationObject(long long ptr long) +@ stdcall ZwSetInformationProcess(long long long long) +@ stdcall ZwSetInformationThread(long long ptr long) +@ stdcall ZwSetInformationToken(long long ptr long) +@ stdcall ZwSetIntervalProfile(long long) +@ stdcall ZwSetIoCompletion(ptr long ptr long long) +@ stdcall ZwSetLdtEntries(long double long double) // CHECKME +@ stdcall ZwSetLowEventPair(ptr) +@ stdcall ZwSetLowWaitHighEventPair(ptr) +//@ stdcall ZwSetLowWaitHighThread // 3.51 and 4.0 only +@ stdcall ZwSetQuotaInformationFile(ptr ptr ptr long) +@ stdcall ZwSetSecurityObject(long long ptr) +@ stdcall ZwSetSystemEnvironmentValue(ptr ptr) +@ stdcall ZwSetSystemEnvironmentValueEx(ptr ptr) +@ stdcall ZwSetSystemInformation(long ptr long) +@ stdcall ZwSetSystemPowerState(long long long) +@ stdcall ZwSetSystemTime(ptr ptr) +@ stdcall ZwSetThreadExecutionState(long ptr) +@ stdcall ZwSetTimer(long ptr ptr ptr long long ptr) +@ stdcall ZwSetTimerResolution(long long ptr) +@ stdcall ZwSetUuidSeed(ptr) +@ stdcall ZwSetValueKey(long long long long long long) +@ stdcall ZwSetVolumeInformationFile(long ptr ptr long long) +@ stdcall ZwShutdownSystem(long) +@ stdcall ZwSignalAndWaitForSingleObject(long long long ptr) +@ stdcall ZwStartProfile(ptr) +@ stdcall ZwStopProfile(ptr) +@ stdcall ZwSuspendProcess(ptr) +@ stdcall ZwSuspendThread(long ptr) +@ stdcall ZwSystemDebugControl(long ptr long ptr long ptr) +@ stdcall ZwTerminateJobObject(long long) +@ stdcall ZwTerminateProcess(long long) +@ stdcall ZwTerminateThread(long long) +@ stdcall ZwTestAlert() +@ stdcall ZwTraceEvent(long long long ptr) +@ stdcall ZwTranslateFilePath(ptr long ptr long) +@ stdcall ZwUnloadDriver(ptr) +@ stdcall ZwUnloadKey(long) +@ stdcall ZwUnloadKeyEx(ptr ptr) +@ stdcall ZwUnlockFile(long ptr ptr ptr ptr) +@ stdcall ZwUnlockVirtualMemory(long ptr ptr long) +@ stdcall ZwUnmapViewOfSection(long ptr) +@ stdcall ZwVdmControl(long ptr) +//@ stdcall ZwW32Call(long ptr long ptr ptr) +@ stdcall ZwWaitForDebugEvent(ptr long ptr ptr) +@ stdcall ZwWaitForKeyedEvent(ptr ptr long ptr) +@ stdcall ZwWaitForMultipleObjects(long ptr long long ptr) +//@ stdcall ZwWaitForProcessMutant // 3.51 only +@ stdcall ZwWaitForSingleObject(long long long) +@ stdcall ZwWaitHighEventPair(ptr) +@ stdcall ZwWaitLowEventPair(ptr) +@ stdcall ZwWriteFile(long long ptr ptr ptr ptr long ptr ptr) +@ stdcall ZwWriteFileGather(long long ptr ptr ptr ptr long ptr ptr) +@ stdcall ZwWriteRequestData(ptr ptr long ptr long ptr) +@ stdcall ZwWriteVirtualMemory(long ptr ptr long ptr) +@ stdcall ZwYieldExecution() +//@ cdecl _CIcos +//@ cdecl _CIlog +//@ cdecl -private -arch=i386 _CIpow() +//@ cdecl _CIsin +//@ cdecl _CIsqrt +//@ stdcall -arch=x86_64 __C_specific_handler(ptr long ptr ptr) +@ cdecl __isascii(long) +@ cdecl __iscsym(long) +@ cdecl __iscsymf(long) +@ cdecl __toascii(long) +@ cdecl -arch=i386 -ret64 _alldiv(double double) +@ cdecl -arch=i386 _alldvrm() +@ cdecl -arch=i386 -ret64 _allmul(double double) +@ cdecl -arch=i386 -norelay _alloca_probe() +@ cdecl -arch=i386 -ret64 _allrem(double double) +@ cdecl -arch=i386 _allshl() +@ cdecl -arch=i386 _allshr() +@ cdecl -ret64 _atoi64(str) +@ cdecl -arch=i386 -ret64 _aulldiv(double double) +@ cdecl -arch=i386 _aulldvrm() +@ cdecl -arch=i386 -ret64 _aullrem(double double) +@ cdecl -arch=i386 _aullshr() +@ cdecl -arch=i386 -norelay _chkstk() +@ cdecl -arch=i386,x86_64 _fltused() +@ cdecl -arch=i386 -ret64 _ftol() +@ cdecl _i64toa(double ptr long) +@ cdecl _i64tow(double ptr long) +@ cdecl _itoa(long ptr long) +@ cdecl _itow(long ptr long) +@ cdecl _lfind(ptr ptr ptr long ptr) +@ cdecl _ltoa(long ptr long) +@ cdecl _ltow(long ptr long) +@ cdecl _memccpy(ptr ptr long long) +@ cdecl _memicmp(str str long) +@ cdecl -arch=x86_64 _setjmp(ptr ptr) +@ cdecl -arch=x86_64 _setjmpex(ptr ptr) +@ varargs _snprintf(ptr long str) +@ varargs _snwprintf(ptr long wstr) +@ cdecl _splitpath(str ptr ptr ptr ptr) +@ cdecl _strcmpi(str str) _stricmp +@ cdecl _stricmp(str str) +@ cdecl _strlwr(str) +@ cdecl _strnicmp(str str long) +@ cdecl _strupr(str) +@ cdecl _tolower(long) +@ cdecl _toupper(long) +@ cdecl _ui64toa(double ptr long) +@ cdecl _ui64tow(double ptr long) +@ cdecl _ultoa(long ptr long) +@ cdecl _ultow(long ptr long) +//@ cdecl _vscwprintf +@ cdecl _vsnprintf(ptr long str ptr) +@ cdecl _vsnwprintf(ptr long wstr ptr) +@ cdecl _wcsicmp(wstr wstr) +@ cdecl _wcslwr(wstr) +@ cdecl _wcsnicmp(wstr wstr long) +@ cdecl _wcsupr(wstr) +@ cdecl _wtoi(wstr) +@ cdecl _wtoi64(wstr) +@ cdecl _wtol(wstr) +@ cdecl abs(long) +@ cdecl -arch=i386,x86_64 atan(double) +@ cdecl atoi(str) +@ cdecl atol(str) +@ cdecl bsearch(ptr ptr long long ptr) +@ cdecl -arch=i386,x86_64 ceil(double) +@ cdecl -arch=i386,x86_64 cos(double) +@ cdecl -arch=i386,x86_64 fabs(double) +@ cdecl -arch=i386,x86_64 floor(double) +@ cdecl isalnum(long) +@ cdecl isalpha(long) +@ cdecl iscntrl(long) +@ cdecl isdigit(long) +@ cdecl isgraph(long) +@ cdecl islower(long) +@ cdecl isprint(long) +@ cdecl ispunct(long) +@ cdecl isspace(long) +@ cdecl isupper(long) +@ cdecl iswalpha(long) +@ cdecl iswctype(long long) +@ cdecl iswdigit(long) +@ cdecl iswlower(long) +@ cdecl iswspace(long) +@ cdecl iswxdigit(long) +@ cdecl isxdigit(long) +@ cdecl labs(long) +@ cdecl -arch=i386,x86_64 log(double) +@ cdecl -arch=x86_64 longjmp(ptr) +@ cdecl mbstowcs(ptr str long) +@ cdecl memchr(ptr long long) +@ cdecl memcmp(ptr ptr long) +@ cdecl memcpy(ptr ptr long) memmove +@ cdecl memmove(ptr ptr long) +@ cdecl memset(ptr long long) +@ cdecl -arch=i386,x86_64 pow(double double) +@ cdecl qsort(ptr long long ptr) +@ cdecl -arch=i386,x86_64 sin(double) +@ varargs sprintf(ptr str) +@ cdecl -arch=i386,x86_64 sqrt(double) +@ varargs sscanf(str str) +@ cdecl strcat(str str) +@ cdecl strchr(str long) +@ cdecl strcmp(str str) +@ cdecl strcpy(ptr str) +@ cdecl strcspn(str str) +@ cdecl strlen(str) +@ cdecl strncat(str str long) +@ cdecl strncmp(str str long) +@ cdecl strncpy(ptr str long) +@ cdecl strpbrk(str str) +@ cdecl strrchr(str long) +@ cdecl strspn(str str) +@ cdecl strstr(str str) +@ cdecl strtol(str ptr long) +@ cdecl strtoul(str ptr long) +@ varargs swprintf(ptr wstr) +@ cdecl -arch=i386,x86_64 tan(double) +@ cdecl tolower(long) +@ cdecl toupper(long) +@ cdecl towlower(long) +@ cdecl towupper(long) +@ stdcall vDbgPrintEx(long long str ptr) +@ stdcall vDbgPrintExWithPrefix(str long long str ptr) +@ cdecl vsprintf(ptr str ptr) +@ cdecl wcscat(wstr wstr) +@ cdecl wcschr(wstr long) +@ cdecl wcscmp(wstr wstr) +@ cdecl wcscpy(ptr wstr) +@ cdecl wcscspn(wstr wstr) +@ cdecl wcslen(wstr) +@ cdecl wcsncat(wstr wstr long) +@ cdecl wcsncmp(wstr wstr long) +@ cdecl wcsncpy(ptr wstr long) +@ cdecl wcspbrk(wstr wstr) +@ cdecl wcsrchr(wstr long) +@ cdecl wcsspn(wstr wstr) +@ cdecl wcsstr(wstr wstr) +//@ cdecl wcstok(wstr wstr) +@ cdecl wcstol(wstr ptr long) +@ cdecl wcstombs(ptr ptr long) +@ cdecl wcstoul(wstr ptr long) diff --git a/dll/ntdll/ntdll.rbuild b/dll/ntdll/ntdll.rbuild new file mode 100644 index 00000000000..2f219a81c98 --- /dev/null +++ b/dll/ntdll/ntdll.rbuild @@ -0,0 +1,63 @@ + + + + + + + include + + include/reactos/subsys + + + + rtl + ntdllsys + libcntpr + pseh + ntstatus + + api.c + capture.c + connect.c + + + dbgui.c + + + + + dispatch.S + + + + + stubs.c + + + + + stubs_asm.s + + + + dispatch.c + + + + ntdll.h + + + ldrapi.c + ldrinit.c + ldrpe.c + ldrutils.c + + + libsupp.c + version.c + + + ntdll.rc + + + diff --git a/dll/shellext/deskadp/deskadp.rbuild b/dll/shellext/deskadp/deskadp.rbuild new file mode 100644 index 00000000000..d668ce207bb --- /dev/null +++ b/dll/shellext/deskadp/deskadp.rbuild @@ -0,0 +1,14 @@ + + + . + ntdll + user32 + gdi32 + comctl32 + ole32 + uuid + deskadp.c + shxiface.c + deskadp.rc + precomp.h + diff --git a/dll/shellext/deskmon/deskmon.rbuild b/dll/shellext/deskmon/deskmon.rbuild new file mode 100644 index 00000000000..b0034a8dcb5 --- /dev/null +++ b/dll/shellext/deskmon/deskmon.rbuild @@ -0,0 +1,14 @@ + + + . + ntdll + user32 + gdi32 + comctl32 + ole32 + uuid + deskmon.c + shxiface.c + deskmon.rc + precomp.h + diff --git a/dll/shellext/devcpux/devcpux.rbuild b/dll/shellext/devcpux/devcpux.rbuild new file mode 100644 index 00000000000..2a9eea54511 --- /dev/null +++ b/dll/shellext/devcpux/devcpux.rbuild @@ -0,0 +1,11 @@ + + + . + include/reactos/wine + user32 + ntdll + powrprof + comctl32 + processor.c + processor.rc + diff --git a/dll/shellext/fontext/fontext.rbuild b/dll/shellext/fontext/fontext.rbuild new file mode 100644 index 00000000000..c46abf4e8a9 --- /dev/null +++ b/dll/shellext/fontext/fontext.rbuild @@ -0,0 +1,16 @@ + + + . + ntdll + user32 + gdi32 + ole32 + uuid + shlwapi + lz32 + advapi32 + setupapi + fontext.c + regsvr.c + fontext.rc + diff --git a/dll/shellext/shellext.rbuild b/dll/shellext/shellext.rbuild new file mode 100644 index 00000000000..95598f57bfc --- /dev/null +++ b/dll/shellext/shellext.rbuild @@ -0,0 +1,19 @@ + + + + + + + + + + + + + + + + + + + diff --git a/dll/shellext/slayer/slayer.rbuild b/dll/shellext/slayer/slayer.rbuild new file mode 100644 index 00000000000..0a5554fe1a9 --- /dev/null +++ b/dll/shellext/slayer/slayer.rbuild @@ -0,0 +1,13 @@ + + + . + user32 + comctl32 + advapi32 + ole32 + shell32 + uuid + slayer.c + slayer.rc + precomp.h + diff --git a/dll/win32/acledit/acledit.rbuild b/dll/win32/acledit/acledit.rbuild new file mode 100644 index 00000000000..e851138f276 --- /dev/null +++ b/dll/win32/acledit/acledit.rbuild @@ -0,0 +1,13 @@ + + + . + + + + ntdll + advapi32 + user32 + acledit.c + stubs.c + acledit.rc + diff --git a/dll/win32/aclui/aclui.rbuild b/dll/win32/aclui/aclui.rbuild new file mode 100644 index 00000000000..118317d0c62 --- /dev/null +++ b/dll/win32/aclui/aclui.rbuild @@ -0,0 +1,20 @@ + + + . + + ntdll + user32 + gdi32 + comctl32 + ole32 + oleaut32 + uxtheme + advapi32 + aclui.c + checklist.c + guid.c + misc.c + sidcache.c + aclui.rc + precomp.h + diff --git a/dll/win32/activeds/activeds.rbuild b/dll/win32/activeds/activeds.rbuild new file mode 100644 index 00000000000..c878f82048a --- /dev/null +++ b/dll/win32/activeds/activeds.rbuild @@ -0,0 +1,11 @@ + + + + . + include/reactos/wine + + wine + activeds_main.c + stubs.c + + diff --git a/dll/win32/actxprxy/actxprxy.rbuild b/dll/win32/actxprxy/actxprxy.rbuild new file mode 100644 index 00000000000..68cd919bcb4 --- /dev/null +++ b/dll/win32/actxprxy/actxprxy.rbuild @@ -0,0 +1,36 @@ + + + + + + + . + include/reactos/wine + . + + wine + actxprxy_proxy + ntdll + rpcrt4 + ole32 + oleaut32 + uuid + pseh + usrmarshal.c + + + + + + actxprxy_activscp.idl + actxprxy_comcat.idl + actxprxy_docobj.idl + actxprxy_hlink.idl + actxprxy_htiframe.idl + actxprxy_objsafe.idl + actxprxy_ocmm.idl + actxprxy_servprov.idl + actxprxy_shobjidl.idl + actxprxy_urlhist.idl + + diff --git a/dll/win32/advapi32/advapi32.rbuild b/dll/win32/advapi32/advapi32.rbuild new file mode 100644 index 00000000000..22e1a69af48 --- /dev/null +++ b/dll/win32/advapi32/advapi32.rbuild @@ -0,0 +1,63 @@ + + + + . + . + . + . + + 0x600 + + + scm_client + lsa_client + eventlog_client + rpcrt4 + wine + pseh + ntdll + advapi32.h + + crypt.c + crypt_arc4.c + crypt_des.c + crypt_lmhash.c + crypt_md4.c + crypt_md5.c + crypt_sha.c + + + dllmain.c + efs.c + hwprofiles.c + logon.c + msi.c + shutdown.c + sysfunc.c + trace.c + + + reg.c + + + ac.c + audit.c + cred.c + lsa.c + misc.c + sec.c + sid.c + trustee.c + + + eventlog.c + rpc.c + scm.c + sctrl.c + + + privilege.c + token.c + + advapi32.rc + diff --git a/dll/win32/advpack/advpack.rbuild b/dll/win32/advpack/advpack.rbuild new file mode 100644 index 00000000000..b4f3a3fbaed --- /dev/null +++ b/dll/win32/advpack/advpack.rbuild @@ -0,0 +1,20 @@ + + + + + + . + include/reactos/wine + + advpack.c + files.c + install.c + reg.c + wine + ole32 + setupapi + version + advapi32 + ntdll + + diff --git a/dll/win32/atl/atl.rbuild b/dll/win32/atl/atl.rbuild new file mode 100644 index 00000000000..85ec749ccc4 --- /dev/null +++ b/dll/win32/atl/atl.rbuild @@ -0,0 +1,30 @@ + + + + + + + . + include/reactos/wine + + 0x600 + atl_ax.c + atl_main.c + registrar.c + rsrc.rc + stubs.c + . + wine + uuid + ole32 + oleaut32 + user32 + gdi32 + advapi32 + ntdll + atl_atliface_header + + + atliface.idl + + diff --git a/dll/win32/atl/stubs.c b/dll/win32/atl/stubs.c index a35e3dc6508..01f22de9199 100644 --- a/dll/win32/atl/stubs.c +++ b/dll/win32/atl/stubs.c @@ -1,5 +1,5 @@ #include -#include +#include #define ATLAPI_(x) x WINAPI #define ATLAPI ATLAPI_(HRESULT) @@ -31,7 +31,7 @@ AtlSetErrorInfo( return E_NOTIMPL; } -ATLAPI_(LPDEVMODEA) +ATLAPI_(LPDEVMODEA) AtlDevModeW2A(LPDEVMODEA lpDevModeA, LPDEVMODEW lpDevModeW) { UNIMPLEMENTED; diff --git a/dll/win32/authz/authz.rbuild b/dll/win32/authz/authz.rbuild new file mode 100644 index 00000000000..296fd6d501a --- /dev/null +++ b/dll/win32/authz/authz.rbuild @@ -0,0 +1,11 @@ + + + . + ntdll + advapi32 + authz.c + clictx.c + resman.c + authz.rc + precomp.h + diff --git a/dll/win32/avicap32/avicap32.rbuild b/dll/win32/avicap32/avicap32.rbuild new file mode 100644 index 00000000000..2e2a0f3e8cd --- /dev/null +++ b/dll/win32/avicap32/avicap32.rbuild @@ -0,0 +1,15 @@ + + + + + . + advapi32 + msvfw32 + user32 + gdi32 + wine + winmm + version + avicap32.c + avicap32.rc + diff --git a/dll/win32/avifil32/avifil32.rbuild b/dll/win32/avifil32/avifil32.rbuild new file mode 100644 index 00000000000..da4f495711d --- /dev/null +++ b/dll/win32/avifil32/avifil32.rbuild @@ -0,0 +1,33 @@ + + + + + + + . + include/reactos/wine + + 0x600 + acmstream.c + api.c + avifile.c + editstream.c + extrachunk.c + factory.c + getframe.c + icmstream.c + regsvr.c + tmpfile.c + wavfile.c + rsrc.rc + wine + uuid + msacm32 + msvfw32 + winmm + ole32 + user32 + advapi32 + ntdll + + diff --git a/dll/win32/batt/batt.rbuild b/dll/win32/batt/batt.rbuild new file mode 100644 index 00000000000..25710cc2b3e --- /dev/null +++ b/dll/win32/batt/batt.rbuild @@ -0,0 +1,8 @@ + + + . + setupapi + ntdll + batt.c + batt.rc + diff --git a/dll/win32/bcrypt/bcrypt.rbuild b/dll/win32/bcrypt/bcrypt.rbuild new file mode 100644 index 00000000000..2a8ee9a8452 --- /dev/null +++ b/dll/win32/bcrypt/bcrypt.rbuild @@ -0,0 +1,9 @@ + + + . + include/reactos/wine + + wine + bcrypt_main.c + version.rc + diff --git a/dll/win32/beepmidi/beepmidi.rbuild b/dll/win32/beepmidi/beepmidi.rbuild new file mode 100644 index 00000000000..3c36708f84c --- /dev/null +++ b/dll/win32/beepmidi/beepmidi.rbuild @@ -0,0 +1,8 @@ + + + . + ntdll + user32 + winmm + beepmidi.c + diff --git a/dll/win32/browseui/browseui.rbuild b/dll/win32/browseui/browseui.rbuild new file mode 100644 index 00000000000..63415e6f93e --- /dev/null +++ b/dll/win32/browseui/browseui.rbuild @@ -0,0 +1,48 @@ + + + + + + . + include/reactos/wine + . + + + + + 0x600 + wine + shlwapi + shell32 + comctl32 + gdi32 + ole32 + oleaut32 + user32 + advapi32 + uuid + ntdll + atlnew + msvcrt + aclmulti.cpp + addressband.cpp + addresseditbox.cpp + bandproxy.cpp + bandsite.cpp + bandsitemenu.cpp + basebar.cpp + basebarsite.cpp + brandband.cpp + browseui.cpp + browseuiord.cpp + commonbrowser.cpp + globalfoldersettings.cpp + internettoolbar.cpp + regtreeoptions.cpp + shellbrowser.cpp + toolsband.cpp + travellog.cpp + utility.cpp + dllinstall.c + browseui.rc + diff --git a/dll/win32/cabinet/cabinet.rbuild b/dll/win32/cabinet/cabinet.rbuild new file mode 100644 index 00000000000..75c64fe1014 --- /dev/null +++ b/dll/win32/cabinet/cabinet.rbuild @@ -0,0 +1,17 @@ + + + + + + . + include/reactos/wine + + cabinet_main.c + fci.c + fdi.c + stubs.c + cabinet.rc + wine + ntdll + + diff --git a/dll/win32/cabinet/stubs.c b/dll/win32/cabinet/stubs.c index d57a544020d..e0469cb5ae4 100644 --- a/dll/win32/cabinet/stubs.c +++ b/dll/win32/cabinet/stubs.c @@ -1,5 +1,5 @@ #include -#include +#include typedef PVOID PSESSION; diff --git a/dll/win32/cards/cards.rbuild b/dll/win32/cards/cards.rbuild new file mode 100644 index 00000000000..0b331b44384 --- /dev/null +++ b/dll/win32/cards/cards.rbuild @@ -0,0 +1,12 @@ + + + . + + + + + gdi32 + user32 + cards.c + cards.rc + diff --git a/dll/win32/cfgmgr32/cfgmgr32.rbuild b/dll/win32/cfgmgr32/cfgmgr32.rbuild new file mode 100644 index 00000000000..fe1ab0930b9 --- /dev/null +++ b/dll/win32/cfgmgr32/cfgmgr32.rbuild @@ -0,0 +1,6 @@ + + + + + cfgmgr32.rc + diff --git a/dll/win32/clusapi/clusapi.rbuild b/dll/win32/clusapi/clusapi.rbuild new file mode 100644 index 00000000000..10b31ffd2f5 --- /dev/null +++ b/dll/win32/clusapi/clusapi.rbuild @@ -0,0 +1,11 @@ + + + + + . + include/reactos/wine + + wine + ntdll + clusapi.c + diff --git a/dll/win32/comcat/comcat.rbuild b/dll/win32/comcat/comcat.rbuild new file mode 100644 index 00000000000..626f49ad48b --- /dev/null +++ b/dll/win32/comcat/comcat.rbuild @@ -0,0 +1,18 @@ + + + + + + . + include/reactos/wine + + 0x600 + wine + ole32 + user32 + advapi32 + uuid + ntdll + comcat_main.c + version.rc + diff --git a/dll/win32/comctl32/comctl32.rbuild b/dll/win32/comctl32/comctl32.rbuild new file mode 100644 index 00000000000..15ed84c0602 --- /dev/null +++ b/dll/win32/comctl32/comctl32.rbuild @@ -0,0 +1,60 @@ + + + + + + + . + include/reactos/wine + + + + 0x600 + animate.c + comboex.c + comctl32undoc.c + commctrl.c + datetime.c + dpa.c + draglist.c + dsa.c + flatsb.c + header.c + hotkey.c + imagelist.c + ipaddress.c + listview.c + monthcal.c + nativefont.c + pager.c + progress.c + propsheet.c + rebar.c + smoothscroll.c + status.c + string.c + syslink.c + tab.c + theme_button.c + theme_combo.c + theme_dialog.c + theme_edit.c + theme_listbox.c + theming.c + toolbar.c + tooltips.c + trackbar.c + treeview.c + updown.c + stubs.c + rsrc.rc + uuid + wine + user32 + gdi32 + advapi32 + winmm + uxtheme + ntdll + + diff --git a/dll/win32/comdlg32/comdlg32.rbuild b/dll/win32/comdlg32/comdlg32.rbuild new file mode 100644 index 00000000000..70c0322000f --- /dev/null +++ b/dll/win32/comdlg32/comdlg32.rbuild @@ -0,0 +1,31 @@ + + + + + + . + include/reactos/wine + + + cdlg32.c + colordlg.c + filedlg.c + filedlg31.c + filedlgbrowser.c + finddlg.c + fontdlg.c + printdlg.c + rsrc.rc + wine + uuid + shell32 + shlwapi + comctl32 + winspool + user32 + gdi32 + advapi32 + ole32 + ntdll + + diff --git a/dll/win32/compstui/compstui.rbuild b/dll/win32/compstui/compstui.rbuild new file mode 100644 index 00000000000..cb8d99af4c9 --- /dev/null +++ b/dll/win32/compstui/compstui.rbuild @@ -0,0 +1,13 @@ + + + + + + . + include/reactos/wine + + compstui_main.c + wine + ntdll + + diff --git a/dll/win32/credui/credui.rbuild b/dll/win32/credui/credui.rbuild new file mode 100644 index 00000000000..d5395cdfb78 --- /dev/null +++ b/dll/win32/credui/credui.rbuild @@ -0,0 +1,17 @@ + + + + + + . + include/reactos/wine + + credui_main.c + credui.rc + wine + advapi32 + user32 + comctl32 + ntdll + + diff --git a/dll/win32/crtdll/crtdll.rbuild b/dll/win32/crtdll/crtdll.rbuild new file mode 100644 index 00000000000..9df85785956 --- /dev/null +++ b/dll/win32/crtdll/crtdll.rbuild @@ -0,0 +1,22 @@ + + + . + include + + + + + + + + + "extern __attribute__ ((dllexport))" + + crt + wine + ntdll + precomp.h + dllmain.c + crtdll.rc + diff --git a/dll/win32/crypt32/crypt32.rbuild b/dll/win32/crypt32/crypt32.rbuild new file mode 100644 index 00000000000..7884c27a317 --- /dev/null +++ b/dll/win32/crypt32/crypt32.rbuild @@ -0,0 +1,45 @@ + + + . + include/reactos/wine + + 0x600 + + + _fdopen + _open + _close + + wine + user32 + advapi32 + ntdll + imagehlp + pseh + base64.c + cert.c + chain.c + collectionstore.c + context.c + crl.c + decode.c + encode.c + filestore.c + main.c + msg.c + object.c + oid.c + proplist.c + protectdata.c + provstore.c + regstore.c + rootstore.c + serialize.c + sip.c + store.c + str.c + ctl.c + message.c + crypt32.rc + version.rc + diff --git a/dll/win32/cryptdlg/cryptdlg.rbuild b/dll/win32/cryptdlg/cryptdlg.rbuild new file mode 100644 index 00000000000..84bc688ee0f --- /dev/null +++ b/dll/win32/cryptdlg/cryptdlg.rbuild @@ -0,0 +1,18 @@ + + + + + + . + include/reactos/wine + + wine + advapi32 + user32 + crypt32 + cryptui + wintrust + ntdll + main.c + cryptdlg.rc + diff --git a/dll/win32/cryptdll/cryptdll.rbuild b/dll/win32/cryptdll/cryptdll.rbuild new file mode 100644 index 00000000000..125d364b750 --- /dev/null +++ b/dll/win32/cryptdll/cryptdll.rbuild @@ -0,0 +1,13 @@ + + + + + . + include/reactos/wine + + wine + advapi32 + ntdll + cryptdll.c + stubs.c + diff --git a/dll/win32/cryptdll/stubs.c b/dll/win32/cryptdll/stubs.c index 230ce09d74c..86bee19fa34 100644 --- a/dll/win32/cryptdll/stubs.c +++ b/dll/win32/cryptdll/stubs.c @@ -1,7 +1,7 @@ #include #define NDEBUG -#include +#include void WINAPI CDBuildIntegrityVect(DWORD Unknown1, DWORD Unknown2) diff --git a/dll/win32/cryptnet/cryptnet.rbuild b/dll/win32/cryptnet/cryptnet.rbuild new file mode 100644 index 00000000000..ff9d875f356 --- /dev/null +++ b/dll/win32/cryptnet/cryptnet.rbuild @@ -0,0 +1,16 @@ + + + + + + + . + include/reactos/wine + + wine + crypt32 + wininet + ntdll + cryptnet_main.c + + diff --git a/dll/win32/cryptui/cryptui.rbuild b/dll/win32/cryptui/cryptui.rbuild new file mode 100644 index 00000000000..3f3832e8969 --- /dev/null +++ b/dll/win32/cryptui/cryptui.rbuild @@ -0,0 +1,26 @@ + + + + + + + . + include/reactos/wine + + + main.c + cryptui.rc + wine + user32 + ole32 + crypt32 + gdi32 + advapi32 + uuid + urlmon + wintrust + comctl32 + comdlg32 + ntdll + + diff --git a/dll/win32/dbghelp/dbghelp.rbuild b/dll/win32/dbghelp/dbghelp.rbuild new file mode 100644 index 00000000000..2504aefd5e1 --- /dev/null +++ b/dll/win32/dbghelp/dbghelp.rbuild @@ -0,0 +1,50 @@ + + + + + + . + include/reactos/wine + + + + + + 0 + 1 + 2 + 3 + + _lseek + _read + coff.c + cpu_i386.c + cpu_ppc.c + cpu_x86_64.c + crc32.c + dbghelp.c + dwarf.c + elf_module.c + image.c + macho_module.c + minidump.c + module.c + msc.c + path.c + pe_module.c + regex.c + rosstubs.c + source.c + stabs.c + stack.c + storage.c + symbol.c + type.c + version.rc + wine + psapi + version + ntdll + pseh + + diff --git a/dll/win32/dciman32/dciman32.rbuild b/dll/win32/dciman32/dciman32.rbuild new file mode 100644 index 00000000000..c659d8efff2 --- /dev/null +++ b/dll/win32/dciman32/dciman32.rbuild @@ -0,0 +1,13 @@ + + + + + + . + include/reactos/wine + + dciman_main.c + wine + ntdll + + diff --git a/dll/win32/devmgr/devmgr.rbuild b/dll/win32/devmgr/devmgr.rbuild new file mode 100644 index 00000000000..fafa15fb898 --- /dev/null +++ b/dll/win32/devmgr/devmgr.rbuild @@ -0,0 +1,16 @@ + + . + + ntdll + setupapi + advapi32 + user32 + version + devmgr.rc + advprop.c + devprblm.c + hwpage.c + misc.c + stubs.c + precomp.h + diff --git a/dll/win32/dhcpcsvc/dhcpcsvc.rbuild b/dll/win32/dhcpcsvc/dhcpcsvc.rbuild new file mode 100644 index 00000000000..7afd68b4775 --- /dev/null +++ b/dll/win32/dhcpcsvc/dhcpcsvc.rbuild @@ -0,0 +1,33 @@ + + + include + ntdll + msvcrt + ws2_32 + iphlpapi + advapi32 + oldnames + + + _tzset + + + adapter.c + alloc.c + api.c + compat.c + dhclient.c + dispatch.c + hash.c + options.c + pipe.c + socket.c + tables.c + util.c + + + rosdhcp.h + + dhcpcsvc.c + dhcpcsvc.rc + diff --git a/dll/win32/dnsapi/dnsapi.rbuild b/dll/win32/dnsapi/dnsapi.rbuild new file mode 100644 index 00000000000..bda940fc642 --- /dev/null +++ b/dll/win32/dnsapi/dnsapi.rbuild @@ -0,0 +1,23 @@ + + + include + src + adns_win32 + + adns + ntdll + user32 + ws2_32 + iphlpapi + + adns.c + context.c + memory.c + names.c + query.c + record.c + stubs.c + precomp.h + + dnsapi.rc + diff --git a/dll/win32/dwmapi/dwmapi.rbuild b/dll/win32/dwmapi/dwmapi.rbuild new file mode 100644 index 00000000000..a36f697169f --- /dev/null +++ b/dll/win32/dwmapi/dwmapi.rbuild @@ -0,0 +1,14 @@ + + + + + + . + include/reactos/wine + + dwmapi_main.c + version.rc + wine + ntdll + + diff --git a/dll/win32/faultrep/faultrep.rbuild b/dll/win32/faultrep/faultrep.rbuild new file mode 100644 index 00000000000..0c886fc2038 --- /dev/null +++ b/dll/win32/faultrep/faultrep.rbuild @@ -0,0 +1,9 @@ + + + . + include/reactos/wine + + wine + advapi32 + faultrep.c + diff --git a/dll/win32/fmifs/fmifs.rbuild b/dll/win32/fmifs/fmifs.rbuild new file mode 100644 index 00000000000..1743da71d21 --- /dev/null +++ b/dll/win32/fmifs/fmifs.rbuild @@ -0,0 +1,15 @@ + + + . + ntdll + chkdsk.c + compress.c + diskcopy.c + extend.c + format.c + init.c + media.c + query.c + fmifs.rc + precomp.h + diff --git a/dll/win32/fusion/fusion.rbuild b/dll/win32/fusion/fusion.rbuild new file mode 100644 index 00000000000..6c3caa22787 --- /dev/null +++ b/dll/win32/fusion/fusion.rbuild @@ -0,0 +1,18 @@ + + + . + include/reactos/wine + + wine + version + shlwapi + advapi32 + dbghelp + user32 + asmcache.c + asmenum.c + asmname.c + assembly.c + fusion.c + fusion_main.c + diff --git a/dll/win32/gdi32/gdi32.rbuild b/dll/win32/gdi32/gdi32.rbuild new file mode 100644 index 00000000000..b8bfbbc0d21 --- /dev/null +++ b/dll/win32/gdi32/gdi32.rbuild @@ -0,0 +1,53 @@ + + + include + + user32 + advapi32 + win32ksys + pseh + dxguid + ntdll + + precomp.h + + + dllmain.c + + + heap.c + gdientry.c + hacks.c + historic.c + misc.c + stubs.c + stubsa.c + stubsw.c + wingl.c + + + arc.c + bitmap.c + brush.c + coord.c + dc.c + + efloat.c + + eng.c + enhmfile.c + font.c + icm.c + linedda.c + metafile.c + painting.c + printdrv.c + palette.c + pen.c + region.c + text.c + utils.c + path.c + + gdi32.rc + diff --git a/dll/win32/gdiplus/gdiplus.rbuild b/dll/win32/gdiplus/gdiplus.rbuild new file mode 100644 index 00000000000..eb28fd84e9f --- /dev/null +++ b/dll/win32/gdiplus/gdiplus.rbuild @@ -0,0 +1,36 @@ + + + + + + . + include/reactos/wine + + + brush.c + customlinecap.c + font.c + gdiplus.c + graphics.c + graphicspath.c + image.c + imageattributes.c + matrix.c + pathiterator.c + pen.c + region.c + stringformat.c + wine + uuid + shlwapi + oleaut32 + ole32 + user32 + gdi32 + windowscodecs + ntdll + + crt + + + diff --git a/dll/win32/getuname/getuname.rbuild b/dll/win32/getuname/getuname.rbuild new file mode 100644 index 00000000000..164140cf35d --- /dev/null +++ b/dll/win32/getuname/getuname.rbuild @@ -0,0 +1,9 @@ + + + + + . + ntdll + getuname.c + getuname.rc + diff --git a/dll/win32/glu32/glu32.rbuild b/dll/win32/glu32/glu32.rbuild new file mode 100644 index 00000000000..9c21f3ac36a --- /dev/null +++ b/dll/win32/glu32/glu32.rbuild @@ -0,0 +1,116 @@ + + + include + libnurbs/internals + libnurbs/interface + libnurbs/nurbtess + libtess + libutil + + + + ntdll + opengl32 + gdi32 + + + bezierEval.cc + bezierPatch.cc + bezierPatchMesh.cc + glcurveval.cc + glinterface.cc + glrenderer.cc + glsurfeval.cc + incurveeval.cc + insurfeval.cc + + + arc.cc + arcsorter.cc + arctess.cc + backend.cc + basiccrveval.cc + basicsurfeval.cc + bin.cc + bufpool.cc + cachingeval.cc + ccw.cc + coveandtiler.cc + curve.cc + curvelist.cc + curvesub.cc + dataTransform.cc + displaylist.cc + flist.cc + flistsorter.cc + hull.cc + intersect.cc + knotvector.cc + mapdesc.cc + mapdescv.cc + maplist.cc + mesher.cc + monoTriangulationBackend.cc + monotonizer.cc + mycode.cc + nurbsinterfac.cc + nurbstess.cc + patch.cc + patchlist.cc + quilt.cc + reader.cc + renderhints.cc + slicer.cc + sorter.cc + splitarcs.cc + subdivider.cc + tobezier.cc + trimline.cc + trimregion.cc + trimvertpool.cc + uarray.cc + varray.cc + + + directedLine.cc + gridWrap.cc + monoChain.cc + monoPolyPart.cc + monoTriangulation.cc + partitionX.cc + partitionY.cc + polyDBG.cc + polyUtil.cc + primitiveStream.cc + quicksort.cc + rectBlock.cc + sampleComp.cc + sampleCompBot.cc + sampleCompRight.cc + sampleCompTop.cc + sampleMonoPoly.cc + sampledLine.cc + searchTree.cc + + + + dict.c + geom.c + memalloc.c + mesh.c + normal.c + priorityq.c + render.c + sweep.c + tess.c + tessmono.c + + + error.c + glue.c + mipmap.c + project.c + quad.c + registry.c + + diff --git a/dll/win32/hhctrl.ocx/hhctrl.ocx.rbuild b/dll/win32/hhctrl.ocx/hhctrl.ocx.rbuild new file mode 100644 index 00000000000..9cd7d4cfdfd --- /dev/null +++ b/dll/win32/hhctrl.ocx/hhctrl.ocx.rbuild @@ -0,0 +1,34 @@ + + + + + + + . + include/reactos/wine + include/reactos + + 0x600 + wineheaders + chm.c + content.c + help.c + hhctrl.c + index.c + regsvr.c + search.c + stream.c + webbrowser.c + hhctrl.rc + wine + advapi32 + comctl32 + shlwapi + ole32 + oleaut32 + user32 + gdi32 + uuid + ntdll + + diff --git a/dll/win32/hid/hid.rbuild b/dll/win32/hid/hid.rbuild new file mode 100644 index 00000000000..8770a694379 --- /dev/null +++ b/dll/win32/hid/hid.rbuild @@ -0,0 +1,9 @@ + + + . + ntdll + hid.c + stubs.c + hid.rc + precomp.h + diff --git a/dll/win32/hlink/hlink.rbuild b/dll/win32/hlink/hlink.rbuild new file mode 100644 index 00000000000..f5753ca15a0 --- /dev/null +++ b/dll/win32/hlink/hlink.rbuild @@ -0,0 +1,22 @@ + + + + + + + . + include/reactos/wine + + browse_ctx.c + extserv.c + hlink_main.c + link.c + wine + shell32 + ole32 + advapi32 + urlmon + uuid + ntdll + + diff --git a/dll/win32/hnetcfg/hnetcfg.rbuild b/dll/win32/hnetcfg/hnetcfg.rbuild new file mode 100644 index 00000000000..91c8fcb7b81 --- /dev/null +++ b/dll/win32/hnetcfg/hnetcfg.rbuild @@ -0,0 +1,19 @@ + + + + . + include/reactos/wine + 0x600 + + wine + ole32 + advapi32 + apps.c + hnetcfg.c + manager.c + policy.c + port.c + profile.c + regsvr.c + service.c + diff --git a/dll/win32/httpapi/httpapi.rbuild b/dll/win32/httpapi/httpapi.rbuild new file mode 100644 index 00000000000..28d83587a57 --- /dev/null +++ b/dll/win32/httpapi/httpapi.rbuild @@ -0,0 +1,9 @@ + + + . + include/reactos/wine + + httpapi_main.c + wine + ntdll + diff --git a/dll/win32/iccvid/iccvid.rbuild b/dll/win32/iccvid/iccvid.rbuild new file mode 100644 index 00000000000..f27d0b02b59 --- /dev/null +++ b/dll/win32/iccvid/iccvid.rbuild @@ -0,0 +1,13 @@ + + + + + . + include/reactos/wine + + iccvid.c + rsrc.rc + wine + user32 + ntdll + diff --git a/dll/win32/icmp/icmp.rbuild b/dll/win32/icmp/icmp.rbuild new file mode 100644 index 00000000000..27ac979d7b7 --- /dev/null +++ b/dll/win32/icmp/icmp.rbuild @@ -0,0 +1,10 @@ + + + . + include/reactos/wine + wine + ws2_32 + wine + icmp_main.c + icmp.rc + diff --git a/dll/win32/imaadp32.acm/imaadp32.acm.rbuild b/dll/win32/imaadp32.acm/imaadp32.acm.rbuild new file mode 100644 index 00000000000..073f714f979 --- /dev/null +++ b/dll/win32/imaadp32.acm/imaadp32.acm.rbuild @@ -0,0 +1,11 @@ + + + . + include/reactos/wine + + imaadp32.c + wine + winmm + user32 + ntdll + diff --git a/dll/win32/imagehlp/imagehlp.rbuild b/dll/win32/imagehlp/imagehlp.rbuild new file mode 100644 index 00000000000..c6d86925e60 --- /dev/null +++ b/dll/win32/imagehlp/imagehlp.rbuild @@ -0,0 +1,14 @@ + + + . + + wine + dbghelp + ntdll + access.c + imagehlp_main.c + integrity.c + modify.c + imagehlp.rc + precomp.h + diff --git a/dll/win32/imm32/imm32.rbuild b/dll/win32/imm32/imm32.rbuild new file mode 100644 index 00000000000..d91d1e8245e --- /dev/null +++ b/dll/win32/imm32/imm32.rbuild @@ -0,0 +1,19 @@ + + + + + + . + include/reactos/wine + + 0x600 + /FIwine/typeof.h + imm.c + version.rc + wine + user32 + gdi32 + advapi32 + ntdll + + diff --git a/dll/win32/inetcomm/inetcomm.rbuild b/dll/win32/inetcomm/inetcomm.rbuild new file mode 100644 index 00000000000..3de70d54a5f --- /dev/null +++ b/dll/win32/inetcomm/inetcomm.rbuild @@ -0,0 +1,28 @@ + + + + + + + . + include/reactos/wine + + 0x600 + imaptransport.c + inetcomm_main.c + internettransport.c + mimeintl.c + mimeole.c + pop3transport.c + regsvr.c + smtptransport.c + wine + uuid + ole32 + oleaut32 + ws2_32 + user32 + advapi32 + ntdll + + diff --git a/dll/win32/inetmib1/inetmib1.rbuild b/dll/win32/inetmib1/inetmib1.rbuild new file mode 100644 index 00000000000..27079b19c05 --- /dev/null +++ b/dll/win32/inetmib1/inetmib1.rbuild @@ -0,0 +1,15 @@ + + + + + + . + include/reactos/wine + + main.c + wine + snmpapi + iphlpapi + ntdll + + diff --git a/dll/win32/initpki/initpki.rbuild b/dll/win32/initpki/initpki.rbuild new file mode 100644 index 00000000000..8e23c67bb3b --- /dev/null +++ b/dll/win32/initpki/initpki.rbuild @@ -0,0 +1,10 @@ + + + + . + include/reactos/wine + + main.c + wine + ntdll + diff --git a/dll/win32/inseng/inseng.rbuild b/dll/win32/inseng/inseng.rbuild new file mode 100644 index 00000000000..5434957a05c --- /dev/null +++ b/dll/win32/inseng/inseng.rbuild @@ -0,0 +1,15 @@ + + + + . + include/reactos/wine + + 0x600 + inseng_main.c + regsvr.c + wine + uuid + ole32 + advapi32 + ntdll + diff --git a/dll/win32/iphlpapi/iphlpapi.rbuild b/dll/win32/iphlpapi/iphlpapi.rbuild new file mode 100644 index 00000000000..ed1fe25218e --- /dev/null +++ b/dll/win32/iphlpapi/iphlpapi.rbuild @@ -0,0 +1,22 @@ + + + . + include/reactos/wine + include + . + wine + ntdll + advapi32 + ws2_32 + dhcpcsvc + tdilib + dhcp_reactos.c + ifenum_reactos.c + ipstats_reactos.c + iphlpapi_main.c + media.c + registry.c + resinfo_reactos.c + route_reactos.c + iphlpapi.rc + diff --git a/dll/win32/itircl/itircl.rbuild b/dll/win32/itircl/itircl.rbuild new file mode 100644 index 00000000000..7bd57ad575e --- /dev/null +++ b/dll/win32/itircl/itircl.rbuild @@ -0,0 +1,10 @@ + + + + . + include/reactos/wine + + itircl_main.c + wine + ntdll + diff --git a/dll/win32/itss/itss.rbuild b/dll/win32/itss/itss.rbuild new file mode 100644 index 00000000000..75b59b4a55e --- /dev/null +++ b/dll/win32/itss/itss.rbuild @@ -0,0 +1,23 @@ + + + + + . + include/reactos/wine + + wineheaders + chm_lib.c + lzx.c + itss.c + moniker.c + protocol.c + storage.c + rsrc.rc + wine + uuid + urlmon + shlwapi + ole32 + ntdll + + diff --git a/dll/win32/jscript/jscript.rbuild b/dll/win32/jscript/jscript.rbuild new file mode 100644 index 00000000000..4d31ff6f513 --- /dev/null +++ b/dll/win32/jscript/jscript.rbuild @@ -0,0 +1,44 @@ + + + + + + + . + . + include/reactos/wine + + + + jsglobal + wine + user32 + ole32 + oleaut32 + advapi32 + activex.c + date.c + dispex.c + engine.c + error.c + jscript.c + jscript_main.c + jsutils.c + lex.c + parser.tab.c + math.c + number.c + object.c + regexp.c + string.c + array.c + bool.c + function.c + global.c + rsrc.rc + + + stdole2 + jsglobal.idl + + diff --git a/dll/win32/kernel32/kernel32.pspec b/dll/win32/kernel32/kernel32.pspec new file mode 100644 index 00000000000..48eb29a0763 --- /dev/null +++ b/dll/win32/kernel32/kernel32.pspec @@ -0,0 +1,1458 @@ +#undef i386 + +@ stdcall AcquireSRWLockExclusive(ptr) ntdll.RtlAcquireSRWLockExclusive +@ stdcall AcquireSRWLockShared(ptr) ntdll.RtlAcquireSRWLockShared +@ stdcall ActivateActCtx(ptr ptr) +@ stdcall AddAtomA(str) +@ stdcall AddAtomW(wstr) +@ stdcall AddConsoleAliasA(str str str) ;check +@ stdcall AddConsoleAliasW(wstr wstr wstr) ;check +;@ stdcall -arch=x86_64 AddIntegrityLabelToBoundaryDescriptor ; Win 7 +@ stdcall AddLocalAlternateComputerNameA(str ptr) +@ stdcall AddLocalAlternateComputerNameW(wstr ptr) +@ stdcall AddRefActCtx(ptr) +;@ stdcall AddSIDToBoundaryDescriptor ; Win 7 +;@ stdcall AddSecureMemoryCacheCallback ; Win 7 +@ stdcall AddVectoredContinueHandler(long ptr) ntdll.RtlAddVectoredContinueHandler +@ stdcall AddVectoredExceptionHandler(long ptr) ntdll.RtlAddVectoredExceptionHandler +;@ stdcall AdjustCalendarDate ; Win 7 +@ stdcall AllocConsole() +@ stub AllocLSCallback ; missing in XP SP3 and 2003 R2 and Win 7 +@ stdcall AllocateUserPhysicalPages(long ptr ptr) +;@ stdcall AllocateUserPhysicalPagesNuma ; Win 7 +;@ stdcall ApplicationRecoveryFinished ; Win 7 +;@ stdcall ApplicationRecoveryInProgress ; Win 7 +@ stdcall AreFileApisANSI() +@ stdcall AssignProcessToJobObject(ptr ptr) +@ stdcall AttachConsole(long) +@ stdcall BackupRead(ptr ptr long ptr long long ptr) +@ stdcall BackupSeek(ptr long long ptr ptr ptr) +@ stdcall BackupWrite(ptr ptr long ptr long long ptr) +@ stdcall BaseCheckAppcompatCache(long long long ptr) ;check +;@ stdcall BaseCheckAppcompatCacheEx ; Win7 +@ stub BaseCheckRunApp +@ stdcall BaseCleanupAppcompatCache() ; missing in Win 7 +@ stdcall BaseCleanupAppcompatCacheSupport(ptr) +;@ stdcall BaseDllReadWriteIniFile ; Win 7 +@ stdcall BaseDumpAppcompatCache() +@ stdcall BaseFlushAppcompatCache() +;@ stdcall BaseFormatObjectAttributes ; Win 7 +;@ stdcall BaseFormatTimeOut ; Win 7 +;@ stdcall BaseGenerateAppCompatData ; Win 7 +;@ stdcall BaseGetNamedObjectDirectory ; Win 7 +@ stdcall BaseInitAppcompatCache() ; missing in Win 7 +@ stdcall BaseInitAppcompatCacheSupport() +;@ stdcall BaseIsAppcompatInfrastructureDisabled ; Win 7 +@ stdcall BaseProcessInitPostImport() ; missing in Win 7 +@ stdcall BaseQueryModuleData(str str ptr ptr ptr) ;check +;@ stdcall BaseThreadInitThunk ; Win 7 +;@ stdcall BaseSetLastNTError ; Win 7, not 64 bit (present on w2k3 but not exported) +@ stdcall BaseUpdateAppcompatCache(long long long) +;@ stdcall BaseVerifyUnicodeString ; Win 7 +;@ stdcall Basep8BitStringToDynamicUnicodeString ; Win 7 +;@ stdcall BasepAllocateActivationContextActivationBlock ; Win 7 +;@ stdcall BasepAnsiStringToDynamicUnicodeString ; Win 7 +;@ stdcall BasepCheckAppCompat ; Win 7 +;@ stdcall BasepCheckBadapp ; Win 7 +@ stub BasepCheckWinSaferRestrictions +@ stub BasepDebugDump ; missing in XP SP3 and Win 7 +;@ stdcall BasepFreeActivationContextActivationBlock ; Win 7 +;@ stdcall BasepFreeAppCompatData ; Win 7 +;@ stdcall BasepMapModuleHandle ; Win 7 +@ stdcall Beep(long long) +@ stdcall BeginUpdateResourceA(str long) +@ stdcall BeginUpdateResourceW(wstr long) +@ stdcall BindIoCompletionCallback(long ptr long) +@ stdcall BuildCommDCBA(str ptr) +@ stdcall BuildCommDCBAndTimeoutsA(str ptr ptr) +@ stdcall BuildCommDCBAndTimeoutsW(wstr ptr ptr) +@ stdcall BuildCommDCBW(wstr ptr) +@ stdcall CallNamedPipeA(str ptr long ptr long ptr long) +@ stdcall CallNamedPipeW(wstr ptr long ptr long ptr long) +;@ stdcall CallbackMayRunLong ; Win 7 +@ stdcall CancelDeviceWakeupRequest(long) +@ stdcall CancelIo(long) +@ stdcall CancelIoEx(long ptr) +@ stdcall CancelSynchronousIo(long) +;@ stdcall CancelThreadpoolIo(ptr) ntdll.TpCancelAsyncIoOperation; Win 7 +@ stdcall CancelTimerQueueTimer(long long) +@ stdcall CancelWaitableTimer(long) +@ stdcall ChangeTimerQueueTimer(ptr ptr long long) +;@ stdcall CheckElevation ; Win 7 +;@ stdcall CheckElevationEnabled ; Win 7 +;@ stdcall CheckForReadOnlyResource ; Win 7 +@ stdcall CheckNameLegalDOS8Dot3A(str str long long long) +@ stdcall CheckNameLegalDOS8Dot3W(wstr str long long long) +@ stdcall CheckRemoteDebuggerPresent(long ptr) +@ stdcall ClearCommBreak(long) +@ stdcall ClearCommError(long ptr ptr) +@ stdcall CloseConsoleHandle(long) +@ stdcall CloseHandle(long) +;@ stdcall ClosePrivateNamespace ; Win 7 +@ stdcall CloseProfileUserMapping() +@ stub CloseSystemHandle ; missing in XP SP3 and Win 7 +;@ stdcall CloseThreadpool(ptr) ntdll.TpReleasePool ; Win 7 +;@ stdcall CloseThreadpoolCleanupGroup(ptr) ntdll.TpReleaseCleanupGroup ; Win 7 +;@ stdcall CloseThreadpoolCleanupGroupMembers(ptr long ptr) ntdll.TpReleaseCleanupGroupMembers ; Win 7 +;@ stdcall CloseThreadpoolIo ntdll.TpReleaseIoCompletion ; Win 7 +;@ stdcall CloseThreadpoolTimer ntdll.TpReleaseTimer ; Win 7 +;@ stdcall CloseThreadpoolWait ntdll.TpReleaseWait ; Win 7 +;@ stdcall CloseThreadpoolWork ntdll.TpReleaseWork ; Win 7 +@ stdcall CmdBatNotification(long) +@ stdcall CommConfigDialogA(str long ptr) +@ stdcall CommConfigDialogW(wstr long ptr) +;@ stdcall CompareCalendarDates ; Win 7 +@ stdcall CompareFileTime(ptr ptr) +@ stdcall CompareStringA(long long str long str long) +;@ stdcall CompareStringEx ; Win 7 +;@ stdcall CompareStringOrdinal ; Win 7 +@ stdcall CompareStringW(long long wstr long wstr long) +@ stdcall ConnectNamedPipe(long ptr) +@ stdcall ConsoleMenuControl(long long long) +@ stub ConsoleSubst ; missing in XP SP3 and Win 7 +@ stdcall ContinueDebugEvent(long long long) +;@ stdcall ConvertCalDateTimeToSystemTime ; Win 7 +@ stdcall ConvertDefaultLocale (long) +@ stdcall ConvertFiberToThread() +;@ stdcall ConvertNLSDayOfWeekToWin32DayOfWeek ; Win 7 +;@ stdcall ConvertSystemTimeToCalDateTime ; Win 7 +@ stdcall ConvertThreadToFiber(ptr) +@ stdcall ConvertThreadToFiberEx(ptr long) +;@ stdcall CopyExtendedContext ; Win 7 +@ stdcall CopyFileA(str str long) +@ stdcall CopyFileExA (str str ptr ptr ptr long) +@ stdcall CopyFileExW (wstr wstr ptr ptr ptr long) +;@ stdcall CopyFileTransactedA ; Win 7 +;@ stdcall CopyFileTransactedW ; Win 7 +@ stdcall CopyFileW(wstr wstr long) +@ stdcall CopyLZFile(long long) LZCopy +@ stdcall CreateActCtxA(ptr) +@ stdcall CreateActCtxW(ptr) +;@ stdcall CreateBoundaryDescriptorA ; Win 7 +;@ stdcall CreateBoundaryDescriptorW ; Win 7 +@ stdcall CreateConsoleScreenBuffer(long long ptr long ptr) +@ stdcall CreateDirectoryA(str ptr) +@ stdcall CreateDirectoryExA(str str ptr) +@ stdcall CreateDirectoryExW(wstr wstr ptr) +;@ stdcall CreateDirectoryTransactedA ; Win 7 +;@ stdcall CreateDirectoryTransactedW ; Win 7 +@ stdcall CreateDirectoryW(wstr ptr) +@ stdcall CreateEventA(ptr long long str) +@ stdcall CreateEventExA(ptr str long long) +@ stdcall CreateEventExW(ptr wstr long long) +@ stdcall CreateEventW(ptr long long wstr) +@ stdcall CreateFiber(long ptr ptr) +@ stdcall CreateFiberEx(long long long ptr ptr) +@ stdcall CreateFileA(str long long ptr long long long) +@ stdcall CreateFileMappingA(long ptr long long long str) +;@ stdcall CreateFileMappingNumaA ; Win 7 +;@ stdcall CreateFileMappingNumaW ; Win 7 +@ stdcall CreateFileMappingW(long ptr long long long wstr) +;@ stdcall CreateFileTransactedA ; Win 7 +;@ stdcall CreateFileTransactedW ; Win 7 +@ stdcall CreateFileW(wstr long long ptr long long long) +@ stdcall CreateHardLinkA(str str ptr) +;@ stdcall CreateHardLinkTransactedA ; Win 7 +;@ stdcall CreateHardLinkTransactedW ; Win 7 +@ stdcall CreateHardLinkW(wstr wstr ptr) +@ stdcall CreateIoCompletionPort(long long long long) +@ stdcall CreateJobObjectA(ptr str) +@ stdcall CreateJobObjectW(ptr wstr) +@ stdcall CreateJobSet(long ptr long) +@ stub CreateKernelThread ; missing in XP SP3 and Win 7 +@ stdcall CreateMailslotA(ptr long long ptr) +@ stdcall CreateMailslotW(ptr long long ptr) +@ stdcall CreateMemoryResourceNotification(long) +@ stdcall CreateMutexA(ptr long str) +@ stdcall CreateMutexExA(ptr str long long) +@ stdcall CreateMutexExW(ptr wstr long long) +@ stdcall CreateMutexW(ptr long wstr) +@ stdcall CreateNamedPipeA(str long long long long long long ptr) +@ stdcall CreateNamedPipeW(wstr long long long long long long ptr) +@ stdcall CreateNlsSecurityDescriptor(ptr long long) ; missing in Win 7 +@ stdcall CreatePipe(ptr ptr ptr long) +;@ stdcall CreatePrivateNamespaceA ; Win 7 +;@ stdcall CreatePrivateNamespaceW ; Win 7 +@ stdcall CreateProcessA(str str ptr ptr long long ptr str ptr ptr) +;@ stdcall CreateProcessAsUserW ; Win 7 +@ stdcall CreateProcessInternalA(ptr str str ptr ptr long long ptr str ptr ptr long) +@ stdcall CreateProcessInternalW(ptr wstr wstr ptr ptr long long ptr wstr ptr ptr long) +@ stdcall CreateProcessInternalWSecure() ; missing in Win 7 +@ stdcall CreateProcessW(wstr wstr ptr ptr long long ptr wstr ptr ptr) +@ stdcall CreateRemoteThread(long ptr long ptr long long ptr) +;@ stdcall CreateRemoteThreadEx api-ms-win-core-processthreads-l1-1-0.CreateRemoteThreadEx ; Win 7 +@ stdcall CreateSemaphoreA(ptr long long str) +@ stdcall CreateSemaphoreExA(ptr long long str long long) +@ stdcall CreateSemaphoreExW(ptr long long wstr long long) +@ stdcall CreateSemaphoreW(ptr long long wstr) +@ stdcall CreateSocketHandle() +@ stdcall CreateSymbolicLinkA(str str long) +;@ stdcall CreateSymbolicLinkTransactedA ; Win 7 +;@ stdcall CreateSymbolicLinkTransactedW ; Win 7 +@ stdcall CreateSymbolicLinkW(wstr wstr long) +@ stdcall CreateTapePartition(long long long long) +@ stdcall CreateThread(ptr long ptr long long ptr) +;@ stdcall CreateThreadpool ; Win 7 +;@ stdcall CreateThreadpoolCleanupGroup ; Win 7 +;@ stdcall CreateThreadpoolIo ; Win 7 +;@ stdcall CreateThreadpoolTimer ; Win 7 +;@ stdcall CreateThreadpoolWait ; Win 7 +;@ stdcall CreateThreadpoolWork ; Win 7 +@ stdcall CreateTimerQueue () +@ stdcall CreateTimerQueueTimer(ptr long ptr ptr long long long) +@ stdcall CreateToolhelp32Snapshot(long long) +;@ stdcall arch=x86_64 CreateUmsCompletionList +;@ stdcall arch=x86_64 CreateUmsThreadContext +@ stdcall CreateVirtualBuffer(long long long) ; missing in Win 7 +@ stdcall CreateWaitableTimerA(ptr long str) +@ stdcall CreateWaitableTimerExA(ptr str long long) +@ stdcall CreateWaitableTimerExW(ptr wstr long long) +@ stdcall CreateWaitableTimerW(ptr long wstr) +@ stdcall DeactivateActCtx(long ptr) +@ stdcall DebugActiveProcess(long) +@ stdcall DebugActiveProcessStop(long) +@ stdcall DebugBreak() ntdll.DbgBreakPoint +@ stdcall DebugBreakProcess(long) +@ stdcall DebugSetProcessKillOnExit(long) +@ stdcall DecodePointer(ptr) ntdll.RtlDecodePointer +@ stdcall DecodeSystemPointer(ptr) ntdll.RtlDecodeSystemPointer +@ stdcall DefineDosDeviceA(long str str) +@ stdcall DefineDosDeviceW(long wstr wstr) +@ stdcall DelayLoadFailureHook(str str) +@ stdcall DeleteAtom(long) +;@ stdcall DeleteBoundaryDescriptor ntdll.RtlDeleteBoundaryDescriptor ; Win 7 +@ stdcall DeleteCriticalSection(ptr) ntdll.RtlDeleteCriticalSection +@ stdcall DeleteFiber(ptr) +@ stdcall DeleteFileA(str) +;@ stdcall DeleteFileTransactedA ; Win 7 +;@ stdcall DeleteFileTransactedW ; Win 7 +@ stdcall DeleteFileW(wstr) +;@ stdcall DeleteProcThreadAttributeList api-ms-win-core-processthreads-l1-1-0.DeleteProcThreadAttributeList ; Win 7 +@ stdcall DeleteTimerQueue(long) +@ stdcall DeleteTimerQueueEx (long long) +@ stdcall DeleteTimerQueueTimer(long long long) +;@ stdcall -arch=x86_64 DeleteUmsCompletionList +;@ stdcall -arch=x86_64 DeleteUmsThreadContext +@ stdcall DeleteVolumeMountPointA(str) ;check +@ stdcall DeleteVolumeMountPointW(wstr) ;check +;@ stdcall -arch=x86_64 DequeueUmsCompletionListItems +@ stdcall DeviceIoControl(long long ptr long ptr long ptr ptr) +@ stdcall DisableThreadLibraryCalls(long) +;@ stdcall DisableThreadProfiling ; Win 7 +;@ stdcall DisassociateCurrentThreadFromCallback ntdll.TpDisassociateCallback ; Win 7 +@ stdcall DisconnectNamedPipe(long) +@ stdcall DnsHostnameToComputerNameA (str ptr ptr) +@ stdcall DnsHostnameToComputerNameW (wstr ptr ptr) +@ stdcall DosDateTimeToFileTime(long long ptr) +@ stdcall DosPathToSessionPathA(long str str) +@ stdcall DosPathToSessionPathW(long wstr wstr) +@ stdcall DuplicateConsoleHandle(long long long long) +@ stdcall DuplicateHandle(long long long ptr long long long) +;@ stdcall EnableThreadProfiling ; Win 7 +@ stdcall EncodePointer(ptr) ntdll.RtlEncodePointer +@ stdcall EncodeSystemPointer(ptr) ntdll.RtlEncodeSystemPointer +@ stdcall EndUpdateResourceA(long long) +@ stdcall EndUpdateResourceW(long long) +@ stdcall EnterCriticalSection(ptr) ntdll.RtlEnterCriticalSection +;@ stdcall -arch=x86_64 EnterUmsSchedulingMode +@ stdcall EnumCalendarInfoA(ptr long long long) +@ stdcall EnumCalendarInfoExA(ptr long long long) +;@ stdcall EnumCalendarInfoExEx ; Win 7 +@ stdcall EnumCalendarInfoExW(ptr long long long) +@ stdcall EnumCalendarInfoW(ptr long long long) +@ stdcall EnumDateFormatsA(ptr long long) +@ stdcall EnumDateFormatsExA(ptr long long) +;@ stdcall EnumDateFormatsExEx ; Win 7 +@ stdcall EnumDateFormatsExW(ptr long long) +@ stdcall EnumDateFormatsW(ptr long long) +@ stdcall EnumLanguageGroupLocalesA(ptr long long ptr) +@ stdcall EnumLanguageGroupLocalesW(ptr long long ptr) +@ stdcall EnumResourceLanguagesA(long str str ptr long) +;@ stdcall EnumResourceLanguagesExA ; Win 7 +;@ stdcall EnumResourceLanguagesExW ; Win 7 +@ stdcall EnumResourceLanguagesW(long wstr wstr ptr long) +@ stdcall EnumResourceNamesA(long str ptr long) +;@ stdcall EnumResourceNamesExA ; Win 7 +;@ stdcall EnumResourceNamesExW ; Win 7 +@ stdcall EnumResourceNamesW(long wstr ptr long) +@ stdcall EnumResourceTypesA(long ptr long) +;@ stdcall EnumResourceTypesExA ; Win 7 +;@ stdcall EnumResourceTypesExW ; Win 7 +@ stdcall EnumResourceTypesW(long ptr long) +@ stdcall EnumSystemCodePagesA(ptr long) +@ stdcall EnumSystemCodePagesW(ptr long) +;@ stdcall EnumSystemFirmwareTables ; Win 7 +@ stdcall EnumSystemGeoID(long long ptr) +@ stdcall EnumSystemLanguageGroupsA(ptr long ptr) +@ stdcall EnumSystemLanguageGroupsW(ptr long ptr) +@ stdcall EnumSystemLocalesA(ptr long) +;@ stdcall EnumSystemLocalesEx ; Win 7 +@ stdcall EnumSystemLocalesW(ptr long) +@ stdcall EnumTimeFormatsA(ptr long long) +;@ stdcall EnumTimeFormatsEx ; Win 7 +@ stdcall EnumTimeFormatsW(ptr long long) +@ stdcall EnumUILanguagesA(ptr long long) +@ stdcall EnumUILanguagesW(ptr long long) +@ stdcall EnumerateLocalComputerNamesA(ptr long str ptr) +@ stdcall EnumerateLocalComputerNamesW(ptr long wstr ptr) +@ stdcall EraseTape(ptr long long) +@ stdcall EscapeCommFunction(long long) +@ stdcall ExitProcess(long) ; FIXME: ntdll.RtlExitUserProcess +@ stdcall ExitThread(long) ; FIXME: ntdll.RtlExitUserThread +@ stdcall ExitVDM(long long) +@ stdcall ExpandEnvironmentStringsA(str ptr long) +@ stdcall ExpandEnvironmentStringsW(wstr ptr long) +@ stdcall ExpungeConsoleCommandHistoryA(long) +@ stdcall ExpungeConsoleCommandHistoryW(long) +@ stdcall ExtendVirtualBuffer(long long) ; missing in Win 7 +@ stdcall FatalAppExitA(long str) +@ stdcall FatalAppExitW(long wstr) +@ stdcall FatalExit(long) +@ stdcall FileTimeToDosDateTime(ptr ptr ptr) +@ stdcall FileTimeToLocalFileTime(ptr ptr) +@ stdcall FileTimeToSystemTime(ptr ptr) +@ stdcall FillConsoleOutputAttribute(long long long long ptr) +@ stdcall FillConsoleOutputCharacterA(long long long long ptr) +@ stdcall FillConsoleOutputCharacterW(long long long long ptr) +@ stdcall FindActCtxSectionGuid(long ptr long ptr ptr) +@ stdcall FindActCtxSectionStringA(long ptr long str ptr) +@ stdcall FindActCtxSectionStringW(long ptr long wstr ptr) +@ stdcall FindAtomA(str) +@ stdcall FindAtomW(wstr) +@ stdcall FindClose(long) +@ stdcall FindCloseChangeNotification(long) +@ stdcall FindFirstChangeNotificationA(str long long) +@ stdcall FindFirstChangeNotificationW(wstr long long) +@ stdcall FindFirstFileA(str ptr) +@ stdcall FindFirstFileExA(str long ptr long ptr long) +@ stdcall FindFirstFileExW(wstr long ptr long ptr long) +;@ stdcall FindFirstFileNameTransactedW ; Win 7 +;@ stdcall FindFirstFileNameW ; Win 7 +;@ stdcall FindFirstFileTransactedA ; Win 7 +;@ stdcall FindFirstFileTransactedW ; Win 7 +@ stdcall FindFirstFileW(wstr ptr) +;@ stdcall FindFirstStreamTransactedW ; Win 7 +@ stdcall FindFirstStreamW(wstr ptr ptr long) +@ stdcall FindFirstVolumeA(ptr long) +@ stdcall FindFirstVolumeMountPointA(str ptr long) +@ stdcall FindFirstVolumeMountPointW(wstr ptr long) +@ stdcall FindFirstVolumeW(ptr long) +;@ stdcall FindNLSString ; Win 7 +;@ stdcall FindNLSStringEx ; Win 7 +@ stdcall FindNextChangeNotification(long) +@ stdcall FindNextFileA(long ptr) +;@ stdcall FindNextFileNameW ; Win 7 +@ stdcall FindNextFileW(long ptr) +;@ stdcall FindNextStreamW ; Win 7 +@ stdcall FindNextVolumeA(long ptr long) +@ stdcall FindNextVolumeMountPointA(long str long) +@ stdcall FindNextVolumeMountPointW(long wstr long) +@ stdcall FindNextVolumeW(long ptr long) +@ stdcall FindResourceA(long str str) +@ stdcall FindResourceExA(long str str long) +@ stdcall FindResourceExW(long wstr wstr long) +@ stdcall FindResourceW(long wstr wstr) +;@ stdcall FindStringOrdinal ; Win 7 +@ stdcall FindVolumeClose(ptr) +@ stdcall FindVolumeMountPointClose(ptr) +;@ stdcall FlsAlloc(ptr) ; missing in XP SP3 +;@ stdcall FlsFree(long) ; missing in XP SP3 +;@ stdcall FlsGetValue(long) ; missing in XP SP3 +;@ stdcall FlsSetValue(long ptr) ; missing in XP SP3 +@ stdcall FlushConsoleInputBuffer(long) +@ stdcall FlushFileBuffers(long) +@ stdcall FlushInstructionCache(long long long) +;@ stdcall FlushProcessWriteBuffers ntdll.NtFlushProcessWriteBuffers ; Win 7 +@ stdcall FlushViewOfFile(ptr long) +@ stdcall FoldStringA(long str long ptr long) +@ stdcall FoldStringW(long wstr long ptr long) +@ stdcall FormatMessageA(long ptr long long ptr long ptr) +@ stdcall FormatMessageW(long ptr long long ptr long ptr) +@ stdcall FreeConsole() +@ stdcall FreeEnvironmentStringsA(ptr) +@ stdcall FreeEnvironmentStringsW(ptr) +@ stdcall FreeLibrary(long) +@ stdcall FreeLibraryAndExitThread(long long) +;@ stdcall FreeLibraryWhenCallbackReturns ntdll.TpCallbackUnloadDllOnCompletion ; Win 7 +@ stdcall FreeResource(long) +@ stdcall FreeUserPhysicalPages(long long long) +@ stdcall FreeVirtualBuffer(ptr) ; missing in Win 7 +@ stdcall GenerateConsoleCtrlEvent(long long) +@ stdcall GetACP() +;@ stdcall GetActiveProcessorCount ; Win 7 +;@ stdcall GetActiveProcessorGroupCount ; Win 7 +;@ stdcall GetApplicationRecoveryCallback ; Win 7 +;@ stdcall GetApplicationRestartSettings ; Win 7 +@ stdcall GetAtomNameA(long ptr long) +@ stdcall GetAtomNameW(long ptr long) +@ stdcall GetBinaryType(str ptr) GetBinaryTypeA +@ stdcall GetBinaryTypeA(str ptr) +@ stdcall GetBinaryTypeW(wstr ptr) +@ stdcall GetCPFileNameFromRegistry(long wstr long) ;check missing in Win 7 +@ stdcall GetCPInfo(long ptr) +@ stdcall GetCPInfoExA(long long ptr) +@ stdcall GetCPInfoExW(long long ptr) +;@ stdcall GetCalendarDateFormat ; Win 7 +;@ stdcall GetCalendarDateFormatEx ; Win 7 +;@ stdcall GetCalendarDaysInMonth ; Win 7 +;@ stdcall GetCalendarDifferenceInDays ; Win 7 +@ stdcall GetCalendarInfoA(long long long ptr long ptr) +;@ stdcall GetCalendarInfoEx ; Win 7 +@ stdcall GetCalendarInfoW(long long long ptr long ptr) +;@ stdcall GetCalendarMonthsInYear ; Win 7 +;@ stdcall GetCalendarSupportedDateRange ; Win 7 +;@ stdcall GetCalendarWeekNumber ; Win 7 +@ stdcall GetComPlusPackageInstallStatus() +@ stdcall GetCommConfig(long ptr long) +@ stdcall GetCommMask(long ptr) +@ stdcall GetCommModemStatus(long ptr) +@ stdcall GetCommProperties(long ptr) +@ stdcall GetCommState(long ptr) +@ stdcall GetCommTimeouts(long ptr) +@ stdcall GetCommandLineA() +@ stdcall GetCommandLineW() +@ stdcall GetCompressedFileSizeA(long ptr) +;@ stdcall GetCompressedFileSizeTransactedA ; Win 7 +;@ stdcall GetCompressedFileSizeTransactedW ; Win 7 +@ stdcall GetCompressedFileSizeW(long ptr) +@ stdcall GetComputerNameA(ptr ptr) +@ stdcall GetComputerNameExA(long ptr ptr) +@ stdcall GetComputerNameExW(long ptr ptr) +@ stdcall GetComputerNameW(ptr ptr) +@ stdcall GetConsoleAliasA(str str long str) +@ stdcall GetConsoleAliasExesA(str long) +@ stdcall GetConsoleAliasExesLengthA() +@ stdcall GetConsoleAliasExesLengthW() +@ stdcall GetConsoleAliasExesW(wstr long) +@ stdcall GetConsoleAliasW(wstr ptr long wstr) +@ stdcall GetConsoleAliasesA(str long str) +@ stdcall GetConsoleAliasesLengthA(str) +@ stdcall GetConsoleAliasesLengthW(wstr) +@ stdcall GetConsoleAliasesW(wstr long wstr) +@ stdcall GetConsoleCP() +@ stdcall GetConsoleCharType(long long ptr) +@ stdcall GetConsoleCommandHistoryA(long long long) +@ stdcall GetConsoleCommandHistoryLengthA(long) +@ stdcall GetConsoleCommandHistoryLengthW(long) +@ stdcall GetConsoleCommandHistoryW(long long long) +@ stdcall GetConsoleCursorInfo(long ptr) +@ stdcall GetConsoleCursorMode(long ptr ptr) +@ stdcall GetConsoleDisplayMode(ptr) +@ stdcall GetConsoleFontInfo(long long long ptr) +@ stdcall GetConsoleFontSize(long long) +@ stdcall GetConsoleHardwareState(long long ptr) +@ stdcall GetConsoleHistoryInfo(ptr) +@ stdcall GetConsoleInputExeNameA(long ptr) +@ stdcall GetConsoleInputExeNameW(long ptr) +@ stdcall GetConsoleInputWaitHandle() +@ stdcall GetConsoleKeyboardLayoutNameA(ptr) +@ stdcall GetConsoleKeyboardLayoutNameW(ptr) +@ stdcall GetConsoleMode(long ptr) +@ stdcall GetConsoleNlsMode(long ptr) +;@ stdcall GetConsoleOriginalTitleA ; Win 7 +;@ stdcall GetConsoleOriginalTitleW ; Win 7 +@ stdcall GetConsoleOutputCP() +@ stdcall GetConsoleProcessList(ptr long) ; missing in XP SP3 +@ stdcall GetConsoleScreenBufferInfo(long ptr) +;@ stdcall GetConsoleScreenBufferInfoEx ; Win 7 +@ stdcall GetConsoleSelectionInfo(ptr) +@ stdcall GetConsoleTitleA(ptr long) +@ stdcall GetConsoleTitleW(ptr long) +@ stdcall GetConsoleWindow() +@ stdcall GetCurrencyFormatA(long long str ptr str long) +;@ stdcall GetCurrencyFormatEx ; Win 7 +@ stdcall GetCurrencyFormatW(long long str ptr str long) +@ stdcall GetCurrentActCtx(ptr) +@ stdcall GetCurrentConsoleFont(long long ptr) +;@ stdcall GetCurrentConsoleFontEx ; Win 7 +@ stdcall GetCurrentDirectoryA(long ptr) +@ stdcall GetCurrentDirectoryW(long ptr) +@ stdcall GetCurrentProcess() +@ stdcall GetCurrentProcessId() +@ stdcall GetCurrentProcessorNumber() ntdll.RtlGetCurrentProcessorNumber +;@ stdcall GetCurrentProcessorNumberEx ntdll.RtlGetCurrentProcessorNumberEx ; Win 7 +@ stdcall GetCurrentThread() +@ stdcall GetCurrentThreadId() +;@ stdcall GetCurrentUmsThread +@ stdcall GetDateFormatA(long long ptr str ptr long) +;@ stdcall GetDateFormatEx ; Win 7 +@ stdcall GetDateFormatW(long long ptr wstr ptr long) +@ stub GetDaylightFlag ; missing in XP SP3 and Win 7 +@ stdcall GetDefaultCommConfigA(str ptr long) +@ stdcall GetDefaultCommConfigW(wstr ptr long) +@ stdcall GetDefaultSortkeySize(ptr) ; missing in Win 7 +@ stdcall GetDevicePowerState(long ptr) +@ stdcall GetDiskFreeSpaceA(str ptr ptr ptr ptr) +@ stdcall GetDiskFreeSpaceExA (str ptr ptr ptr) +@ stdcall GetDiskFreeSpaceExW (wstr ptr ptr ptr) +@ stdcall GetDiskFreeSpaceW(wstr ptr ptr ptr ptr) +@ stdcall GetDllDirectoryA(long ptr) +@ stdcall GetDllDirectoryW(long ptr) +@ stdcall GetDriveTypeA(str) +@ stdcall GetDriveTypeW(wstr) +;@ stdcall GetDurationFormat ; Win 7 +;@ stdcall GetDurationFormatEx ; Win 7 +;@ stdcall GetDynamicTimeZoneInformation ; Win 7 +;@ stdcall GetEnabledExtendedFeatures api-ms-win-core-xstate-l1-1-0.RtlGetEnabledExtendedFeatures ; Win 7 +@ stdcall GetEnvironmentStrings() +@ stdcall GetEnvironmentStringsA() GetEnvironmentStrings +@ stdcall GetEnvironmentStringsW() +@ stdcall GetEnvironmentVariableA(str ptr long) +@ stdcall GetEnvironmentVariableW(wstr ptr long) +;@ stdcall GetEraNameCountedString ; Win 7 +@ stdcall GetErrorMode() +@ stdcall GetExitCodeProcess(long ptr) +@ stdcall GetExitCodeThread(long ptr) +@ stdcall GetExpandedNameA(str ptr) +@ stdcall GetExpandedNameW(wstr ptr) +;@ stdcall GetExtendedContextLength ; Win 7 +;@ stdcall GetExtendedFeaturesMask api-ms-win-core-xstate-l1-1-0.RtlGetExtendedFeaturesMask ; Win 7 +@ stdcall GetFileAttributesA(str) +@ stdcall GetFileAttributesByHandle(long ptr long) ; missing in Win 7 +@ stdcall GetFileAttributesExA(str long ptr) +@ stdcall GetFileAttributesExW(wstr long ptr) +;@ stdcall GetFileAttributesTransactedA ; Win 7 +;@ stdcall GetFileAttributesTransactedW ; Win 7 +@ stdcall GetFileAttributesW(wstr) +@ stdcall GetFileBandwidthReservation(long ptr ptr ptr ptr ptr) +@ stdcall GetFileInformationByHandle(long ptr) +;@ stdcall GetFileInformationByHandleEx ; Win 7 +;@ stdcall GetFileMUIInfo ; Win 7 +;@ stdcall GetFileMUIPath ; Win 7 +@ stdcall GetFileSize(long ptr) +@ stdcall GetFileSizeEx(long ptr) +@ stdcall GetFileTime(long ptr ptr ptr) +@ stdcall GetFileType(long) +@ stdcall GetFinalPathNameByHandleA(long str long long) +@ stdcall GetFinalPathNameByHandleW(long wstr long long) +@ stdcall GetFirmwareEnvironmentVariableA(str str ptr long) +@ stdcall GetFirmwareEnvironmentVariableW(wstr wstr ptr long) +@ stdcall GetFullPathNameA(str long ptr ptr) +;@ stdcall GetFullPathNameTransactedA ; Win 7 +;@ stdcall GetFullPathNameTransactedW ; Win 7 +@ stdcall GetFullPathNameW(wstr long ptr ptr) +@ stdcall GetGeoInfoA(long long ptr long long) +@ stdcall GetGeoInfoW(long long ptr long long) +@ stdcall GetHandleContext(long) ; missing on x64 +@ stdcall GetHandleInformation(long ptr) +@ stub GetSCallbackTarget ; missing in XP SP3 and Win 7 +@ stub GetSCallbackTemplate ; missing in XP SP3 and Win 7 +@ stdcall GetLargePageMinimum() +@ stdcall GetLargestConsoleWindowSize(long) +@ stdcall GetLastError() +@ stdcall GetLinguistLangSize(ptr) ; missing in Win 7 +@ stdcall GetLocalTime(ptr) +@ stdcall GetLocaleInfoA(long long ptr long) +@ stdcall GetLocaleInfoEx(wstr long wstr long) ; Vista+ +@ stdcall GetLocaleInfoW(long long ptr long) +@ stdcall GetLogicalDriveStringsA(long ptr) +@ stdcall GetLogicalDriveStringsW(long ptr) +@ stdcall GetLogicalDrives() +@ stdcall GetLogicalProcessorInformation(ptr ptr) +;@ stdcall GetLogicalProcessorInformationEx api-ms-win-core-sysinfo-l1-1-0.GetLogicalProcessorInformationEx ; Win 7 +@ stdcall GetLongPathNameA (str long long) +;@ stdcall GetLongPathNameTransactedA ; Win 7 +;@ stdcall GetLongPathNameTransactedW ; Win 7 +@ stdcall GetLongPathNameW (wstr long long) +@ stdcall GetMailslotInfo(long ptr ptr ptr ptr) +;@ stdcall GetMaximumProcessorCount ; Win 7 +;@ stdcall GetMaximumProcessorGroupCount ; Win 7 +@ stdcall GetModuleFileNameA(long ptr long) +@ stdcall GetModuleFileNameW(long ptr long) +@ stdcall GetModuleHandleA(str) +@ stdcall GetModuleHandleExA(long ptr ptr) +@ stdcall GetModuleHandleExW(long ptr ptr) +@ stdcall GetModuleHandleW(wstr) +;@ stdcall GetNLSVersion ; Win 7 +;@ stdcall GetNLSVersionEx ; Win 7 +;@ stdcall GetNamedPipeAttribute ; Win 7 +;@ stdcall GetNamedPipeClientComputerNameA ; Win 7 +;@ stdcall GetNamedPipeClientComputerNameW ; Win 7 +;@ stdcall GetNamedPipeClientProcessId ; Win 7 +;@ stdcall GetNamedPipeClientSessionId ; Win 7 +@ stdcall GetNamedPipeHandleStateA(long ptr ptr ptr ptr str long) +@ stdcall GetNamedPipeHandleStateW(long ptr ptr ptr ptr wstr long) +@ stdcall GetNamedPipeInfo(long ptr ptr ptr ptr) +;@ stdcall GetNamedPipeServerProcessId ; Win 7 +;@ stdcall GetNamedPipeServerSessionId ; Win 7 +@ stdcall GetNativeSystemInfo(ptr) +;@ stdcall -arch=x86_64 GetNextUmsListItem +@ stdcall GetNextVDMCommand(long) +@ stdcall GetNlsSectionName(long long long str str long) ; missing in Win 7 +@ stdcall GetNumaAvailableMemory(ptr long ptr) ; missing in Win 7 +@ stdcall GetNumaAvailableMemoryNode(long ptr) +;@ stdcall GetNumaAvailableMemoryNodeEx ; Win 7 +@ stdcall GetNumaHighestNodeNumber(ptr) +;@ stdcall GetNumaNodeNumberFromHandle ; Win 7 +@ stdcall GetNumaNodeProcessorMask(long ptr) +;@ stdcall GetNumaNodeProcessorMaskEx ; Win 7 +@ stdcall GetNumaProcessorMap(ptr long ptr) ; missing in Win 7 +@ stdcall GetNumaProcessorNode(long ptr) +;@ stdcall GetNumaProcessorNodeEx ; Win 7 +;@ stdcall GetNumaProximityNode ; Win 7 +;@ stdcall GetNumaProximityNodeEx ; Win 7 +@ stdcall GetNumberFormatA(long long str ptr ptr long) +;@ stdcall GetNumberFormatEx ; Win 7 +@ stdcall GetNumberFormatW(long long wstr ptr ptr long) +@ stdcall GetNumberOfConsoleFonts() +@ stdcall GetNumberOfConsoleInputEvents(long ptr) +@ stdcall GetNumberOfConsoleMouseButtons(ptr) +@ stdcall GetOEMCP() +@ stdcall GetOverlappedResult(long ptr ptr long) +;@ stdcall GetPhysicallyInstalledSystemMemory ; Win 7 +@ stdcall GetPriorityClass(long) +@ stdcall GetPrivateProfileIntA(str str long str) +@ stdcall GetPrivateProfileIntW(wstr wstr long wstr) +@ stdcall GetPrivateProfileSectionA(str ptr long str) +@ stdcall GetPrivateProfileSectionNamesA(ptr long str) +@ stdcall GetPrivateProfileSectionNamesW(ptr long wstr) +@ stdcall GetPrivateProfileSectionW(wstr ptr long wstr) +@ stdcall GetPrivateProfileStringA(str str str ptr long str) +@ stdcall GetPrivateProfileStringW(wstr wstr wstr ptr long wstr) +@ stdcall GetPrivateProfileStructA (str str ptr long str) +@ stdcall GetPrivateProfileStructW(wstr wstr ptr long wstr) +@ stdcall GetProcAddress(long str) +@ stdcall GetProcessAffinityMask(long ptr ptr) +//@ stdcall GetProcessFlags(long) +;@ stdcall GetProcessDEPPolicy ; Win 7 +;@ stdcall GetProcessGroupAffinity ; Win 7 +@ stdcall GetProcessHandleCount(long ptr) +@ stdcall GetProcessHeap() +@ stdcall GetProcessHeaps(long ptr) +@ stdcall GetProcessId(long) +;@ stdcall GetProcessIdOfThread ; Win 7 +@ stdcall GetProcessIoCounters(long ptr) +;@ stdcall GetProcessPreferredUILanguages ; Win 7 +@ stdcall GetProcessPriorityBoost(long ptr) +@ stdcall GetProcessShutdownParameters(ptr ptr) +@ stdcall GetProcessTimes(long ptr ptr ptr ptr) +@ stdcall GetProcessVersion(long) +@ stdcall GetProcessWorkingSetSize(long ptr ptr) +;@ stdcall GetProcessWorkingSetSizeEx ; Win 7 +;@ stdcall GetProcessorSystemCycleTime ; Win 7 +;@ stdcall GetProductInfo(long long long long ptr) ; Win 7 +@ stub GetProductName +@ stdcall GetProfileIntA(str str long) +@ stdcall GetProfileIntW(wstr wstr long) +@ stdcall GetProfileSectionA(str ptr long) +@ stdcall GetProfileSectionW(wstr ptr long) +@ stdcall GetProfileStringA(str str str ptr long) +@ stdcall GetProfileStringW(wstr wstr wstr ptr long) +@ stdcall GetQueuedCompletionStatus(long ptr ptr ptr long) +;@ stdcall GetQueuedCompletionStatusEx ; Win 7 +@ stub GetLSCallbackTarget ; missing in XP SP3 and Win 7 +@ stub GetLSCallbackTemplate ; missing in XP SP3 and Win 7 +@ stdcall GetShortPathNameA(str ptr long) +@ stdcall GetShortPathNameW(wstr ptr long) +@ stdcall GetStartupInfoA(ptr) +@ stdcall GetStartupInfoW(ptr) +@ stdcall GetStdHandle(long) +;@ stdcall GetStringScripts ; Win 7 +@ stdcall GetStringTypeA(long long str long ptr) +@ stdcall GetStringTypeExA(long long str long ptr) +@ stdcall GetStringTypeExW(long long wstr long ptr) +@ stdcall GetStringTypeW(long wstr long ptr) +;@ stdcall GetSystemDEPPolicy ; Win 7 +@ stdcall GetSystemDefaultLCID() +@ stdcall GetSystemDefaultLangID() +;@ stdcall GetSystemDefaultLocaleName ; Win 7 +@ stdcall GetSystemDefaultUILanguage() +@ stdcall GetSystemDirectoryA(ptr long) +@ stdcall GetSystemDirectoryW(ptr long) +;@ stdcall GetSystemFileCacheSize ; Win 7 +;@ stdcall GetSystemFirmwareTable ; Win 7 +@ stdcall GetSystemInfo(ptr) +@ stdcall GetSystemPowerStatus(ptr) +;@ stdcall GetSystemPreferredUILanguages ; Win 7 +@ stdcall GetSystemRegistryQuota(ptr ptr) +@ stdcall GetSystemTime(ptr) +@ stdcall GetSystemTimeAdjustment(ptr ptr ptr) +@ stdcall GetSystemTimeAsFileTime(ptr) +@ stdcall GetSystemTimes(ptr ptr ptr) +@ stdcall GetSystemWindowsDirectoryA(ptr long) +@ stdcall GetSystemWindowsDirectoryW(ptr long) +@ stdcall GetSystemWow64DirectoryA(ptr long) +@ stdcall GetSystemWow64DirectoryW(ptr long) +@ stdcall GetTapeParameters(ptr long ptr ptr) +@ stdcall GetTapePosition(ptr long ptr ptr ptr) +@ stdcall GetTapeStatus(ptr) +@ stdcall GetTempFileNameA(str str long ptr) +@ stdcall GetTempFileNameW(wstr wstr long ptr) +@ stdcall GetTempPathA(long ptr) +@ stdcall GetTempPathW(long ptr) +@ stdcall GetThreadContext(long ptr) +;@ stdcall GetThreadErrorMode() ; Win 7 +;@ stdcall GetThreadGroupAffinity ; Win 7 +@ stdcall GetThreadIOPendingFlag(long ptr) +@ stdcall GetThreadId(ptr) +;@ stdcall GetThreadIdealProcessorEx ; Win 7 +@ stdcall GetThreadLocale() +;@ stdcall GetThreadPreferredUILanguages ; Win 7 +@ stdcall GetThreadPriority(long) +@ stdcall GetThreadPriorityBoost(long ptr) +@ stdcall GetThreadSelectorEntry(long long ptr) +@ stdcall GetThreadTimes(long ptr ptr ptr ptr) +;@ stdcall GetThreadUILanguage ; Win 7 +@ stdcall GetTickCount() +@ stdcall -ret64 GetTickCount64() +@ stdcall GetTimeFormatA(long long ptr str ptr long) +;@ stdcall GetTimeFormatEx ; Win 7 +@ stdcall GetTimeFormatW(long long ptr wstr ptr long) +@ stdcall GetTimeZoneInformation(ptr) +;@ stdcall GetTimeZoneInformationForYear ; Win 7 +;@ stdcall GetUILanguageInfo ; Win 7 +;@ stdcall -arch=x86_64 GetUmsCompletionListEvent +@ stdcall GetUserDefaultLCID() +@ stdcall GetUserDefaultLangID() +;@ stdcall GetUserDefaultLocaleName ; Win 7 +@ stdcall GetUserDefaultUILanguage() +@ stdcall GetUserGeoID(long) +;@ stdcall GetUserPreferredUILanguages ; Win 7 +@ stdcall GetVDMCurrentDirectories(long long) +@ stdcall GetVersion() +@ stdcall GetVersionExA(ptr) +@ stdcall GetVersionExW(ptr) +@ stdcall GetVolumeInformationA(str ptr long ptr ptr ptr ptr long) +;@ stdcall GetVolumeInformationByHandleW ; Win 7 +@ stdcall GetVolumeInformationW(wstr ptr long ptr ptr ptr ptr long) +@ stdcall GetVolumeNameForVolumeMountPointA(str ptr long) +@ stdcall GetVolumeNameForVolumeMountPointW(wstr ptr long) +@ stdcall GetVolumePathNameA(str ptr long) +@ stdcall GetVolumePathNameW(wstr ptr long) +@ stdcall GetVolumePathNamesForVolumeNameA(str str long ptr) +@ stdcall GetVolumePathNamesForVolumeNameW(wstr wstr long ptr) +@ stdcall GetWindowsDirectoryA(ptr long) +@ stdcall GetWindowsDirectoryW(ptr long) +@ stdcall GetWriteWatch(long ptr long ptr ptr ptr) +@ stdcall GlobalAddAtomA(str) +@ stdcall GlobalAddAtomW(wstr) +@ stdcall GlobalAlloc(long long) +@ stdcall GlobalCompact(long) +@ stdcall GlobalDeleteAtom(long) +@ stdcall GlobalFindAtomA(str) +@ stdcall GlobalFindAtomW(wstr) +@ stdcall GlobalFix(long) +@ stdcall GlobalFlags(long) +@ stdcall GlobalFree(long) +@ stdcall GlobalGetAtomNameA(long ptr long) +@ stdcall GlobalGetAtomNameW(long ptr long) +@ stdcall GlobalHandle(ptr) +@ stdcall GlobalLock(long) +@ stdcall GlobalMemoryStatus(ptr) +@ stdcall GlobalMemoryStatusEx(ptr) +@ stdcall GlobalReAlloc(long long long) +@ stdcall GlobalSize(long) +@ stdcall GlobalUnWire(long) +@ stdcall GlobalUnfix(long) +@ stdcall GlobalUnlock(long) +@ stdcall GlobalWire(long) +@ stdcall Heap32First(ptr long long) +@ stdcall Heap32ListFirst(long ptr) +@ stdcall Heap32ListNext(long ptr) +@ stdcall Heap32Next(ptr) +@ stdcall HeapAlloc(long long long) ntdll.RtlAllocateHeap +@ stdcall HeapCompact(long long) +@ stdcall HeapCreate(long long long) +@ stdcall HeapCreateTagsW(long long wstr wstr) ; missing in Win 7 +@ stdcall HeapDestroy(long) +@ stdcall HeapExtend(long long ptr long) ; missing in Win 7 +@ stdcall HeapFree(long long long) ntdll.RtlFreeHeap +@ stdcall HeapLock(long) +@ stdcall HeapQueryInformation(long long ptr long ptr) +@ stdcall HeapQueryTagW(long long long long ptr) ; missing in Win 7 +@ stdcall HeapReAlloc(long long ptr long) ntdll.RtlReAllocateHeap +@ stub HeapSetFlags ; missing in XP SP3 and Win 7 +@ stdcall HeapSetInformation(ptr long ptr long) +@ stdcall HeapSize(long long ptr) ntdll.RtlSizeHeap +@ stdcall HeapSummary(long long ptr) +@ stdcall HeapUnlock(long) +@ stdcall HeapUsage(long long long long ptr) ; missing in Win 7 +@ stdcall HeapValidate(long long ptr) +@ stdcall HeapWalk(long ptr) +;@ stdcall IdnToAscii ; Win 7 +;@ stdcall IdnToNameprepUnicode ; Win 7 +;@ stdcall IdnToUnicode ; Win 7 +@ stdcall InitAtomTable(long) +;@ stdcall InitOnceBeginInitialize ; Win 7 +;@ stdcall InitOnceComplete ; Win 7 +;@ stdcall InitOnceExecuteOnce ; Win 7 +;@ stdcall InitOnceInitialize ntdll.RtlRunOnceInitialize ; Win 7 +;@ stdcall InitializeConditionVariable ntdll.RtlInitializeConditionVariable ; Win 7 +@ stdcall InitializeCriticalSection(ptr) ; FIXME: ntdll.RtlInitializeCriticalSection +@ stdcall InitializeCriticalSectionAndSpinCount(ptr long) +@ stdcall InitializeCriticalSectionEx(ptr long long) +;@ stdcall InitializeExtendedContext ; Win 7 +;@ stdcall InitializeProcThreadAttributeList api-ms-win-core-processthreads-l1-1-0.InitializeProcThreadAttributeList ; Win 7 +@ stdcall InitializeSListHead(ptr) ntdll.RtlInitializeSListHead +@ stdcall InitializeSRWLock(ptr) ntdll.RtlInitializeSRWLock +@ stdcall -arch=i386 InterlockedCompareExchange (ptr long long) +@ stdcall -arch=i386 -ret64 InterlockedCompareExchange64(ptr double double) ntdll.RtlInterlockedCompareExchange64 +@ stdcall -arch=i386 InterlockedDecrement(ptr) +@ stdcall -arch=i386 InterlockedExchange(ptr long) +@ stdcall -arch=i386 InterlockedExchangeAdd (ptr long ) +@ stdcall InterlockedFlushSList(ptr) ntdll.RtlInterlockedFlushSList +@ stdcall -arch=i386 InterlockedIncrement(ptr) +@ stdcall InterlockedPopEntrySList(ptr) ntdll.RtlInterlockedPopEntrySList +@ stdcall InterlockedPushEntrySList(ptr ptr) ntdll.RtlInterlockedPushEntrySList +;@ stdcall InterlockedPushListSList ntdll.RtlInterlockedPushListSList ; Win 7 +@ stdcall InvalidateConsoleDIBits(long long) +@ stub InvalidateNSCache ; missing in XP SP3 and Win 7 +@ stdcall IsBadCodePtr(ptr) +@ stdcall IsBadHugeReadPtr(ptr long) +@ stdcall IsBadHugeWritePtr(ptr long) +@ stdcall IsBadReadPtr(ptr long) +@ stdcall IsBadStringPtrA(ptr long) +@ stdcall IsBadStringPtrW(ptr long) +@ stdcall IsBadWritePtr(ptr long) +;@ stdcall IsCalendarLeapDay ; Win 7 +;@ stdcall IsCalendarLeapMonth ; Win 7 +;@ stdcall IsCalendarLeapYear ; Win 7 +@ stdcall IsDBCSLeadByte(long) +@ stdcall IsDBCSLeadByteEx(long long) +@ stdcall IsDebuggerPresent() +;@ stdcall IsNLSDefinedString ; Win 7 +;@ stdcall IsNormalizedString ; Win 7 +@ stdcall IsProcessInJob(long long ptr) +@ stdcall IsProcessorFeaturePresent(long) +@ stdcall IsSystemResumeAutomatic() +@ stdcall IsThreadAFiber() +;@ stdcall IsThreadAFiber ; Win 7 +;@ stdcall IsThreadpoolTimerSet ntdll.TpIsTimerSet ; Win 7 +;@ stdcall IsTimeZoneRedirectionEnabled ; Win 7 +;@ stdcall IsValidCalDateTime ; Win 7 +@ stdcall IsValidCodePage(long) +@ stdcall IsValidLanguageGroup(long long) +@ stdcall IsValidLocale(long long) +;@ stdcall IsValidLocaleName ; Win 7 +@ stdcall IsValidUILanguage(long) ; missing in Win 7 +@ stdcall IsWow64Process(ptr ptr) +;@ stdcall K32EmptyWorkingSet ; Win 7 +;@ stdcall K32EnumDeviceDrivers ; Win 7 +;@ stdcall K32EnumPageFilesA ; Win 7 +;@ stdcall K32EnumPageFilesW ; Win 7 +;@ stdcall K32EnumProcessModules ; Win 7 +;@ stdcall K32EnumProcessModulesEx ; Win 7 +;@ stdcall K32EnumProcesses ; Win 7 +;@ stdcall K32GetDeviceDriverBaseNameA ; Win 7 +;@ stdcall K32GetDeviceDriverBaseNameW ; Win 7 +;@ stdcall K32GetDeviceDriverFileNameA ; Win 7 +;@ stdcall K32GetDeviceDriverFileNameW ; Win 7 +;@ stdcall K32GetMappedFileNameA ; Win 7 +;@ stdcall K32GetMappedFileNameW ; Win 7 +;@ stdcall K32GetModuleBaseNameA ; Win 7 +;@ stdcall K32GetModuleBaseNameW ; Win 7 +;@ stdcall K32GetModuleFileNameExA ; Win 7 +;@ stdcall K32GetModuleFileNameExW ; Win 7 +;@ stdcall K32GetModuleInformation ; Win 7 +;@ stdcall K32GetPerformanceInfo ; Win 7 +;@ stdcall K32GetProcessImageFileNameA ; Win 7 +;@ stdcall K32GetProcessImageFileNameW ; Win 7 +;@ stdcall K32GetProcessMemoryInfo ; Win 7 +;@ stdcall K32GetWsChanges ; Win 7 +;@ stdcall K32GetWsChangesEx ; Win 7 +;@ stdcall K32InitializeProcessForWsWatch ; Win 7 +;@ stdcall K32QueryWorkingSet ; Win 7 +;@ stdcall K32QueryWorkingSetEx ; Win 7 +@ stdcall LCIDToLocaleName(long wstr long long) ; needed for wine gecko; missing in XP SP3 +@ stdcall LCMapStringA(long long str long ptr long) +;@ stdcall LCMapStringEx ; Win 7 +@ stdcall LCMapStringW(long long wstr long ptr long) +@ stdcall LZClose(long) +;@ stdcall LZCloseFile ; Win 7 +@ stdcall LZCopy(long long) +;@ stdcall LZCreateFileW ; Win 7 +@ stdcall LZDone() +@ stdcall LZInit(long) +@ stdcall LZOpenFileA(str ptr long) +@ stdcall LZOpenFileW(wstr ptr long) +@ stdcall LZRead(long str long) +@ stdcall LZSeek(long long long) +@ stdcall LZStart() +@ stdcall LeaveCriticalSection(ptr) ntdll.RtlLeaveCriticalSection +;@ stdcall LeaveCriticalSectionWhenCallbackReturns ntdll.TpCallbackLeaveCriticalSectionOnCompletion ; Win 7 +;@ stdcall LoadAppInitDlls ; Win 7 +@ stdcall LoadLibraryA(str) +@ stdcall LoadLibraryExA( str long long) +@ stdcall LoadLibraryExW(wstr long long) +@ stdcall LoadLibraryW(wstr) +@ stdcall LoadModule(str ptr) +@ stdcall LoadResource(long long) +;@ stdcall LoadStringBaseExW ; Win 7 +;@ stdcall LoadStringBaseW ; Win 7 +@ stdcall LocalAlloc(long long) +@ stdcall LocalCompact(long) +@ stdcall LocalFileTimeToFileTime(ptr ptr) +@ stdcall LocalFlags(long) +@ stdcall LocalFree(long) +@ stdcall LocalHandle(ptr) +@ stdcall LocalLock(long) +@ stdcall LocalReAlloc(long long long) +@ stdcall LocalShrink(long long) +@ stdcall LocalSize(long) +@ stdcall LocalUnlock(long) +;@ stub LocaleNameToLCID ; missing in XP SP3 +;@ stdcall LocateExtendedFeature api-ms-win-core-xstate-l1-1-0.RtlLocateExtendedFeature ; Win 7 +;@ stdcall LocateLegacyContext api-ms-win-core-xstate-l1-1-0.RtlLocateLegacyContext ; Win 7 +@ stdcall LockFile(long long long long long) +@ stdcall LockFileEx(long long long long long ptr) +@ stdcall LockResource(long) +;@ stdcall MakeCriticalSectionGlobal(ptr) // ??? +@ stdcall MapUserPhysicalPages(ptr long ptr) +@ stdcall MapUserPhysicalPagesScatter(ptr long ptr) +@ stdcall MapViewOfFile(long long long long long) +@ stdcall MapViewOfFileEx(long long long long long ptr) +;@ stdcall MapViewOfFileExNuma ; Win 7 +@ stdcall Module32First(long ptr) +@ stdcall Module32FirstW(long ptr) +@ stdcall Module32Next(long ptr) +@ stdcall Module32NextW(long ptr) +@ stdcall MoveFileA(str str) +@ stdcall MoveFileExA(str str long) +@ stdcall MoveFileExW(wstr wstr long) +;@ stdcall MoveFileTransactedA ; Win 7 +;@ stdcall MoveFileTransactedW ; Win 7 +@ stdcall MoveFileW(wstr wstr) +@ stdcall MoveFileWithProgressA(str str ptr ptr long) +@ stdcall MoveFileWithProgressW(wstr wstr ptr ptr long) +@ stdcall MulDiv(long long long) +@ stdcall MultiByteToWideChar(long long str long ptr long) +@ stdcall NeedCurrentDirectoryForExePathA(str) +@ stdcall NeedCurrentDirectoryForExePathW(wstr) +;@ stdcall NlsCheckPolicy ; Win 7 +@ stdcall NlsConvertIntegerToString(long long long wstr long) ; missing in Win 7 +;@ stdcall NlsEventDataDescCreate ; Win 7 +@ stdcall NlsGetCacheUpdateCount() +@ stub NlsResetProcessLocale ; missing in XP SP3 and Win 7 +;@ stdcall NlsUpdateLocale ; Win 7 +;@ stdcall NlsUpdateSystemLocale ; Win 7 +;@ stdcall NlsWriteEtwEvent ; Win 7 +;@ stdcall NormalizeString ; Win 7 +;@ stdcall NotifyMountMgr ; Win 7 +@ stub NotifyNLSUserCache ; missing in XP SP3 and win 7 +;@ stdcall NotifyUILanguageChange ; Win 7 +@ stdcall NumaVirtualQueryNode(long long long long) ; missing in win 7 +@ stdcall OpenConsoleW(wstr long long long) +@ stdcall OpenDataFile(long long) ; missing in Win 7 +@ stdcall OpenEventA(long long str) +@ stdcall OpenEventW(long long wstr) +@ stdcall OpenFile(str ptr long) +;@ stdcall OpenFileById ; Win 7 +@ stdcall OpenFileMappingA(long long str) +@ stdcall OpenFileMappingW(long long wstr) +@ stdcall OpenJobObjectA(long long str) +@ stdcall OpenJobObjectW(long long wstr) +@ stdcall OpenMutexA(long long str) +@ stdcall OpenMutexW(long long wstr) +;@ stdcall OpenPrivateNamespaceA ; Win 7 +;@ stdcall OpenPrivateNamespaceW ; Win 7 +@ stdcall OpenProcess(long long long) +;@ stdcall OpenProcessToken api-ms-win-core-processthreads-l1-1-0.OpenProcessToken ; Win 7 +@ stdcall OpenProfileUserMapping() +@ stdcall OpenSemaphoreA(long long str) +@ stdcall OpenSemaphoreW(long long wstr) +@ stdcall OpenThread(long long long) +;@ stdcall OpenThreadToken api-ms-win-core-processthreads-l1-1-0.OpenThreadToken ; win 7 +@ stdcall OpenWaitableTimerA(long long str) +@ stdcall OpenWaitableTimerW(long long wstr) +@ stdcall OutputDebugStringA(str) +@ stdcall OutputDebugStringW(wstr) +@ stdcall PeekConsoleInputA(ptr ptr long ptr) +@ stdcall PeekConsoleInputW(ptr ptr long ptr) +@ stdcall PeekNamedPipe(long ptr long ptr ptr ptr) +@ stdcall PostQueuedCompletionStatus(long long ptr ptr) +;@ stdcall PowerClearRequest ; Win 7 +;@ stdcall PowerCreateRequest ; Win 7 +;@ stdcall PowerSetRequest ; Win 7 +@ stdcall PrepareTape(ptr long long) +@ stdcall PrivCopyFileExW(wstr wstr ptr ptr long long) +@ stdcall PrivMoveFileIdentityW(long long long) +@ stdcall Process32First (ptr ptr) +@ stdcall Process32FirstW (ptr ptr) +@ stdcall Process32Next (ptr ptr) +@ stdcall Process32NextW (ptr ptr) +@ stdcall ProcessIdToSessionId(long ptr) +@ stdcall PulseEvent(long) +@ stdcall PurgeComm(long long) +;@ stdcall QueryActCtxSettingsW ; Win 7 +;@ stdcall QueryActCtxW(long ptr ptr long ptr long ptr) +@ stdcall QueryActCtxW(long ptr ptr long ptr long ptr) +@ stdcall QueryDepthSList(ptr) ntdll.RtlQueryDepthSList +@ stdcall QueryDosDeviceA(str ptr long) +@ stdcall QueryDosDeviceW(wstr ptr long) +@ stdcall QueryFullProcessImageNameA(ptr long str ptr) ; Vista and later +@ stdcall QueryFullProcessImageNameW(ptr long wstr ptr) ; Vista and later +;@ stdcall QueryIdleProcessorCycleTime ; Win 7 +;@ stdcall QueryIdleProcessorCycleTimeEx ; Win 7 +@ stdcall QueryInformationJobObject(long long ptr long ptr) +@ stdcall QueryMemoryResourceNotification(ptr ptr) +@ stub QueryNumberOfEventLogRecords ; missing in XP SP3 and Win 7 +@ stub QueryOldestEventLogRecord ; missing in XP SP3 and Win 7 +@ stdcall QueryPerformanceCounter(ptr) +@ stdcall QueryPerformanceFrequency(ptr) +;@ stdcall QueryProcessAffinityUpdateMode ; Win 7 +;@ stdcall QueryProcessCycleTime ; Win 7 +;@ stdcall QueryThreadCycleTime ; Win 7 +;@ stdcall QueryThreadProfiling ; Win 7 +;@ stdcall QueryThreadpoolStackInformation ; Win 7 +;@ stdcall -arch=x86_64 QueryUmsThreadInformation +;@ stdcall QueryUnbiasedInterruptTime ; Win 7 +@ stdcall QueryWin31IniFilesMappedToRegistry(long long long long) ; missing in Win 7 +@ stdcall QueueUserAPC(ptr long long) +@ stdcall QueueUserWorkItem(ptr ptr long) +@ stdcall RaiseException(long long long ptr) +;@ stdcall RaiseFailFastException ; Win 7 +@ stub ReOpenFile ;@ stdcall ReOpenFile(ptr long long long) +@ stdcall ReadConsoleA(long ptr long ptr ptr) +@ stdcall ReadConsoleInputA(long ptr long ptr) +@ stdcall ReadConsoleInputExA(long ptr long ptr long) +@ stdcall ReadConsoleInputExW(long ptr long ptr long) +@ stdcall ReadConsoleInputW(long ptr long ptr) +@ stdcall ReadConsoleOutputA(long ptr long long ptr) +@ stdcall ReadConsoleOutputAttribute(long ptr long long ptr) +@ stdcall ReadConsoleOutputCharacterA(long ptr long long ptr) +@ stdcall ReadConsoleOutputCharacterW(long ptr long long ptr) +@ stdcall ReadConsoleOutputW(long ptr long long ptr) +@ stdcall ReadConsoleW(long ptr long ptr ptr) +@ stdcall ReadDirectoryChangesW(long ptr long long long ptr ptr ptr) +@ stdcall ReadFile(long ptr long ptr ptr) +@ stdcall ReadFileEx(long ptr long ptr ptr) +@ stdcall ReadFileScatter(long ptr long ptr ptr) +@ stdcall ReadProcessMemory(long ptr ptr long ptr) +;@ stdcall ReadThreadProfilingData ; Win 7 +;@ stdcall RegCloseKey ; Win 7 +;@ stdcall RegCreateKeyExA ; Win 7 +;@ stdcall RegCreateKeyExW ; Win 7 +;@ stdcall RegDeleteKeyExA ; Win 7 +;@ stdcall RegDeleteKeyExW ; Win 7 +;@ stdcall RegDeleteTreeA ; Win 7 +;@ stdcall RegDeleteTreeW ; Win 7 +;@ stdcall RegDeleteValueA ; Win 7 +;@ stdcall RegDeleteValueW ; Win 7 +;@ stdcall RegDisablePredefinedCacheEx ; Win 7 +;@ stdcall RegEnumKeyExA ; Win 7 +;@ stdcall RegEnumKeyExW ; Win 7 +;@ stdcall RegEnumValueA ; Win 7 +;@ stdcall RegEnumValueW ; Win 7 +;@ stdcall RegFlushKey ; Win 7 +;@ stdcall RegGetKeySecurity ; Win 7 +;@ stdcall RegGetValueA ; Win 7 +;@ stdcall RegGetValueW ; Win 7 +;@ stdcall RegKrnGetGlobalState ; Win 7 +;@ stdcall RegKrnInitialize ; Win 7 +;@ stdcall RegLoadKeyA ; Win 7 +;@ stdcall RegLoadKeyW ; Win 7 +;@ stdcall RegLoadMUIStringA ; Win 7 +;@ stdcall RegLoadMUIStringW ; Win 7 +;@ stdcall RegNotifyChangeKeyValue ; Win 7 +;@ stdcall RegOpenCurrentUser ; Win 7 +;@ stdcall RegOpenKeyExA ; Win 7 +;@ stdcall RegOpenKeyExW ; Win 7 +;@ stdcall RegOpenUserClassesRoot ; Win 7 +;@ stdcall RegQueryInfoKeyA ; Win 7 +;@ stdcall RegQueryInfoKeyW ; Win 7 +;@ stdcall RegQueryValueExA ; Win 7 +;@ stdcall RegQueryValueExW ; Win 7 +;@ stdcall RegRestoreKeyA ; Win 7 +;@ stdcall RegRestoreKeyW ; Win 7 +;@ stdcall RegSaveKeyExA ; Win 7 +;@ stdcall RegSaveKeyExW ; Win 7 +;@ stdcall RegSetKeySecurity ; Win 7 +;@ stdcall RegSetValueExA ; Win 7 +;@ stdcall RegSetValueExW ; Win 7 +;@ stdcall RegUnLoadKeyA ; Win 7 +;@ stdcall RegUnLoadKeyW ; Win 7 +;@ stdcall RegisterApplicationRecoveryCallback ; Win 7 +@ stdcall RegisterApplicationRestart(wstr long) +@ stdcall RegisterConsoleIME(ptr ptr) +@ stdcall RegisterConsoleOS2(long) +@ stdcall RegisterConsoleVDM(long long long long long long long long long long long) +;@ stub RegisterServiceProcess ; missing in XP SP3 and Win 7 +@ stub RegisterSysMsgHandler ; missing in XP SP3 and win 7 +@ stdcall RegisterWaitForInputIdle(ptr) +@ stdcall RegisterWaitForSingleObject(ptr long ptr ptr long long) +@ stdcall RegisterWaitForSingleObjectEx(long ptr ptr long long) +@ stdcall RegisterWowBaseHandlers(long) +@ stdcall RegisterWowExec(long) +;@ stdcall ReinitializeCriticalSection(ptr) ; ??? +@ stdcall ReleaseActCtx(ptr) +@ stdcall ReleaseMutex(long) +;@ stdcall ReleaseMutexWhenCallbackReturns ntdll.TpCallbackReleaseMutexOnCompletion ; Win 7 +@ stdcall ReleaseSRWLockExclusive(ptr) ntdll.RtlReleaseSRWLockExclusive +@ stdcall ReleaseSRWLockShared(ptr) ntdll.RtlReleaseSRWLockShared +@ stdcall ReleaseSemaphore(long long ptr) +;@ stdcall ReleaseSemaphoreWhenCallbackReturns ntdll.TpCallbackReleaseSemaphoreOnCompletion ; Win 7 +@ stdcall RemoveDirectoryA(str) +;@ stdcall RemoveDirectoryTransactedA ; Win 7 +;@ stdcall RemoveDirectoryTransactedW ; Win 7 +@ stdcall RemoveDirectoryW(wstr) +@ stdcall RemoveLocalAlternateComputerNameA(str long) +@ stdcall RemoveLocalAlternateComputerNameW(wstr long) +;@ stdcall RemoveSecureMemoryCacheCallback ; Win 7 +@ stdcall RemoveVectoredContinueHandler(ptr) ntdll.RtlRemoveVectoredContinueHandler +@ stdcall RemoveVectoredExceptionHandler(ptr) ntdll.RtlRemoveVectoredExceptionHandler +@ stdcall ReplaceFile(wstr wstr wstr long ptr ptr) ReplaceFileW +@ stdcall ReplaceFileA(str str str long ptr ptr) +@ stdcall ReplaceFileW(wstr wstr wstr long ptr ptr) +;@ stdcall ReplacePartitionUnit ; Win 7 +@ stdcall RequestDeviceWakeup(long) +@ stdcall RequestWakeupLatency(long) +@ stdcall ResetEvent(long) +@ stdcall ResetWriteWatch(ptr long) +;@ stdcall ResolveLocaleName ; Win 7 +@ stdcall RestoreLastError(long) ntdll.RtlRestoreLastWin32Error +@ stdcall ResumeThread(long) +@ cdecl -arch=x86_64 RtlAddFunctionTable(ptr long long) ntdll.RtlAddFunctionTable +@ stdcall -register RtlCaptureContext(ptr) ntdll.RtlCaptureContext +@ stdcall RtlCaptureStackBackTrace(long long ptr ptr) ntdll.RtlCaptureStackBackTrace +@ stdcall -arch=x86_64 RtlCompareMemory(ptr ptr ptr) +@ stdcall -arch=x86_64 RtlCopyMemory(ptr ptr ptr) +@ stdcall -arch=x86_64 RtlDeleteFunctionTable(ptr) +@ stdcall RtlFillMemory(ptr long long) ntdll.RtlFillMemory +@ stdcall -arch=x86_64 RtlInstallFunctionTableCallback(double double long ptr ptr ptr) +@ stdcall -arch=x86_64 RtlLookupFunctionEntry(ptr ptr ptr) ntdll.RtlLookupFunctionEntry +@ stdcall RtlMoveMemory(ptr ptr long) ntdll.RtlMoveMemory +@ stdcall -arch=x86_64 RtlPcToFileHeader(ptr ptr) ntdll.RtlPcToFileHeader +@ stdcall -arch=x86_64 RtlRaiseException(ptr) ntdll.RtlRaiseException +@ stdcall -arch=x86_64 RtlRestoreContext(ptr ptr) ntdll.RtlRestoreContext +@ stdcall RtlUnwind(ptr ptr ptr long) ntdll.RtlUnwind +@ stdcall -arch=x86_64 RtlUnwindEx(ptr ptr ptr ptr ptr ptr) ntdll.RtlUnwindEx +@ stdcall -arch=x86_64 RtlVirtualUnwind(ptr ptr ptr long) ntdll.RtlVirtualUnwind +@ stdcall RtlZeroMemory(ptr long) ntdll.RtlZeroMemory +@ stdcall ScrollConsoleScreenBufferA(long ptr ptr ptr ptr) +@ stdcall ScrollConsoleScreenBufferW(long ptr ptr ptr ptr) +@ stdcall SearchPathA(str str str long ptr ptr) +@ stdcall SearchPathW(wstr wstr wstr long ptr ptr) +@ stdcall SetCPGlobal(long) ; missing in Win 7 +@ stdcall SetCalendarInfoA(long long long str) +@ stdcall SetCalendarInfoW(long long long wstr) +@ stdcall SetClientTimeZoneInformation(ptr) +@ stdcall SetComPlusPackageInstallStatus(ptr) +@ stdcall SetCommBreak(long) +@ stdcall SetCommConfig(long ptr long) +@ stdcall SetCommMask(long ptr) +@ stdcall SetCommState(long ptr) +@ stdcall SetCommTimeouts(long ptr) +@ stdcall SetComputerNameA(str) +@ stdcall SetComputerNameExA(long str) +@ stdcall SetComputerNameExW(long wstr) +@ stdcall SetComputerNameW(wstr) +@ stdcall SetConsoleActiveScreenBuffer(long) +@ stdcall SetConsoleCP(long) +@ stdcall SetConsoleCommandHistoryMode(long) ; missing in win 7 +@ stdcall SetConsoleCtrlHandler(ptr long) +@ stdcall SetConsoleCursor(long long) +@ stdcall SetConsoleCursorInfo(long ptr) +@ stdcall SetConsoleCursorMode(long long long) +@ stdcall SetConsoleCursorPosition(long long) +@ stdcall SetConsoleDisplayMode(long long ptr) +@ stdcall SetConsoleFont(long long) +@ stdcall SetConsoleHardwareState(long long long) +@ stdcall SetConsoleHistoryInfo(ptr) +@ stdcall SetConsoleIcon(ptr) +@ stdcall SetConsoleInputExeNameA(ptr) +@ stdcall SetConsoleInputExeNameW(ptr) +@ stdcall SetConsoleKeyShortcuts(long long long long) +@ stdcall SetConsoleLocalEUDC(long long long long) +@ stdcall SetConsoleMaximumWindowSize(long long) +@ stdcall SetConsoleMenuClose(long) +@ stdcall SetConsoleMode(long long) +@ stdcall SetConsoleNlsMode(long long) +@ stdcall SetConsoleNumberOfCommandsA(long long) +@ stdcall SetConsoleNumberOfCommandsW(long long) +@ stdcall SetConsoleOS2OemFormat(long) +@ stdcall SetConsoleOutputCP(long) +@ stdcall SetConsolePalette(long long long) +;@ stdcall SetConsoleScreenBufferInfoEx ; Win 7 +@ stdcall SetConsoleScreenBufferSize(long long) +@ stdcall SetConsoleTextAttribute(long long) +@ stdcall SetConsoleTitleA(str) +@ stdcall SetConsoleTitleW(wstr) +@ stdcall SetConsoleWindowInfo(long long ptr) +@ stdcall SetCriticalSectionSpinCount(ptr long) ntdll.RtlSetCriticalSectionSpinCount +;@ stdcall SetCurrentConsoleFontEx ; Win 7 +@ stdcall SetCurrentDirectoryA(str) +@ stdcall SetCurrentDirectoryW(wstr) +@ stub SetDaylightFlag ; missing in XP SP3 and Win 7 +@ stdcall SetDefaultCommConfigA(str ptr long) +@ stdcall SetDefaultCommConfigW(wstr ptr long) +@ stdcall SetDllDirectoryA(str) +@ stdcall SetDllDirectoryW(wstr) +;@ stdcall SetDynamicTimeZoneInformation ; Win 7 +@ stdcall SetEndOfFile(long) +;@ stdcall SetEnvironmentStringsA ; Win 7 +;@ stdcall SetEnvironmentStringsW ; Win 7 +@ stdcall SetEnvironmentVariableA(str str) +@ stdcall SetEnvironmentVariableW(wstr wstr) +@ stdcall SetErrorMode(long) +@ stdcall SetEvent(long) +;@ stdcall SetEventWhenCallbackReturns ntdll.TpCallbackSetEventOnCompletion ; Win 7 +;@ stdcall SetExtendedFeaturesMask api-ms-win-core-xstate-l1-1-0.RtlSetExtendedFeaturesMask ; Win 7 +@ stdcall SetFileApisToANSI() +@ stdcall SetFileApisToOEM() +@ stdcall SetFileAttributesA(str long) +;@ stdcall SetFileAttributesTransactedA ; Win 7 +;@ stdcall SetFileAttributesTransactedW ; Win 7 +@ stdcall SetFileAttributesW(wstr long) +;@ stdcall SetFileBandwidthReservation ; Win 7 +;@ stdcall SetFileCompletionNotificationModes ; Win 7 +;@ stdcall SetFileInformationByHandle ; Win 7 +;@ stdcall SetFileIoOverlappedRange ; Win 7 +@ stdcall SetFilePointer(long long ptr long) +@ stdcall SetFilePointerEx(long double ptr long) +@ stdcall SetFileShortNameA(long str) +@ stdcall SetFileShortNameW(long wstr) +@ stdcall SetFileTime(long ptr ptr ptr) +@ stdcall SetFileValidData(long double) +@ stdcall SetFirmwareEnvironmentVariableA(str str ptr long) +@ stdcall SetFirmwareEnvironmentVariableW(wstr wstr ptr long) +@ stdcall SetHandleContext(long long) ; missing in Win 7 x64 +@ stdcall SetHandleCount(long) +@ stdcall SetHandleInformation(long long long) +@ stdcall SetInformationJobObject(long long ptr long) +@ stub SetLastConsoleEventActive ; missing in XP SP3 +@ stdcall SetLastError(long) +@ stub SetLocalPrimaryComputerNameA ; missing in XP SP3 +@ stub SetLocalPrimaryComputerNameW ; missing in XP SP3 +@ stdcall SetLocalTime(ptr) +@ stdcall SetLocaleInfoA(long long str) +@ stdcall SetLocaleInfoW(long long wstr) +@ stdcall SetMailslotInfo(long long) +@ stdcall SetMessageWaitingIndicator(ptr long) +;@ stdcall SetNamedPipeAttribute ; Win 7 +@ stdcall SetNamedPipeHandleState(long ptr ptr ptr) +@ stdcall SetPriorityClass(long long) +@ stdcall SetProcessAffinityMask(long long) +;@ stdcall SetProcessAffinityUpdateMode ; Win 7 +;@ stdcall SetProcessDEPPolicy ; Win 7 +;@ stdcall SetProcessPreferredUILanguages ; Win 7 +@ stdcall SetProcessPriorityBoost(long long) +@ stdcall SetProcessShutdownParameters(long long) +@ stdcall SetProcessWorkingSetSize(long long long) +;@ stdcall SetProcessWorkingSetSizeEx ; Win 7 +;@ stdcall SetSearchPathMode ; Win 7 +@ stdcall SetStdHandle(long long) +;@ stdcall SetStdHandleEx ; Win 7 +;@ stdcall SetSystemFileCacheSize ; Win 7 +@ stdcall SetSystemPowerState(long long) +@ stdcall SetSystemTime(ptr) +@ stdcall SetSystemTimeAdjustment(long long) +@ stdcall SetTapeParameters(ptr long ptr) +@ stdcall SetTapePosition(ptr long long long long long) +@ stdcall SetTermsrvAppInstallMode(long) +@ stdcall SetThreadAffinityMask(long long) +@ stdcall SetThreadContext(long ptr) +;@ stdcall SetThreadErrorMode(long ptr) ; Win 7 +@ stdcall SetThreadExecutionState(long) +;@ stdcall SetThreadGroupAffinity ; Win 7 +@ stdcall SetThreadIdealProcessor(long long) +;@ stdcall SetThreadIdealProcessorEx ; Win 7 +@ stdcall SetThreadLocale(long) +;@ stdcall SetThreadPreferredUILanguages ; Win 7 +@ stdcall SetThreadPriority(long long) +@ stdcall SetThreadPriorityBoost(long long) +;@ stdcall SetThreadStackGuarantee ; Win 7 +;@ stdcall SetThreadToken api-ms-win-core-processthreads-l1-1-0.SetThreadToken ; Win 7 +@ stdcall SetThreadUILanguage(long) +;@ stdcall SetThreadpoolStackInformation ; Win 7 +;@ stdcall SetThreadpoolThreadMaximum ntdll.TpSetPoolMaxThreads ; Win 7 +;@ stdcall SetThreadpoolThreadMinimum ; Win 7 +;@ stdcall SetThreadpoolTimer ntdll.TpSetTimer ; Win 7 +;@ stdcall SetThreadpoolWait ntdll.TpSetWait ; Win 7 +@ stdcall SetTimeZoneInformation(ptr) +@ stdcall SetTimerQueueTimer(long ptr ptr long long long) +;@ stdcall -arch?x86_64 SetUmsThreadInformation +@ stdcall SetUnhandledExceptionFilter(ptr) +@ stdcall SetUserGeoID(long) +@ stdcall SetVDMCurrentDirectories(long long) +@ stdcall SetVolumeLabelA(str str) +@ stdcall SetVolumeLabelW(wstr wstr) +@ stdcall SetVolumeMountPointA(str str) +@ stdcall SetVolumeMountPointW(wstr wstr) +@ stdcall SetWaitableTimer(long ptr long ptr ptr long) +;@ stdcall SetWaitableTimerEx api-ms-win-core-threadpool-l1-1-0.SetWaitableTimerEx ; Win 7 +@ stdcall SetupComm(long long long) +@ stdcall ShowConsoleCursor(long long) +@ stdcall SignalObjectAndWait(long long long long) +@ stdcall SizeofResource(long long) +@ stdcall Sleep(long) +;@ stdcall SleepConditionVariableCS ; Win 7 +;@ stdcall SleepConditionVariableSRW ; Win 7 +@ stdcall SleepEx(long long) +;@ stdcall SortCloseHandle ; Win 7 +;@ stdcall SortGetHandle ; Win 7 +;@ stdcall StartThreadpoolIo ntdll.TpStartAsyncIoOperation ; Win 7 +;@ stdcall SubmitThreadpoolWork ntdll.TpPostWork ; Win 7 +@ stdcall SuspendThread(long) +@ stdcall SwitchToFiber(ptr) +@ stdcall SwitchToThread() +@ stdcall SystemTimeToFileTime(ptr ptr) +@ stdcall SystemTimeToTzSpecificLocalTime (ptr ptr ptr) +@ stdcall TerminateJobObject(long long) +@ stdcall TerminateProcess(long long) +@ stdcall TerminateThread(long long) +@ stdcall TermsrvAppInstallMode() +@ stdcall Thread32First(long ptr) +@ stdcall Thread32Next(long ptr) +@ stdcall TlsAlloc() +@ stub TlsAllocInternal ; missing in XP SP3 and Win 7 +@ stdcall TlsFree(long) +@ stub TlsFreeInternal ; missing in XP SP3 and Win 7 +@ stdcall TlsGetValue(long) +@ stdcall TlsSetValue(long ptr) +@ stdcall Toolhelp32ReadProcessMemory(long ptr ptr long ptr) +@ stdcall TransactNamedPipe(long ptr long ptr long ptr ptr) +@ stdcall TransmitCommChar(long long) +@ stdcall TrimVirtualBuffer(ptr) ; missing in Win 7 +;@ stdcall TryAcquireSRWLockExclusive ntdll.RtlTryAcquireSRWLockExclusive ; Win 7 +;@ stdcall TryAcquireSRWLockShared ntdll.RtlTryAcquireSRWLockShared ; Win 7 +@ stdcall TryEnterCriticalSection(ptr) ntdll.RtlTryEnterCriticalSection +;@ stdcall TrySubmitThreadpoolCallback ; Win 7 +@ stdcall TzSpecificLocalTimeToSystemTime(ptr ptr ptr) +@ stdcall UTRegister(long str str str ptr ptr ptr) +@ stdcall UTUnRegister(long) +;@ stdcall -arch=x86_64 UmsThreadYield +@ stdcall UnhandledExceptionFilter(ptr) +;@ stdcall UninitializeCriticalSection(ptr) ; ??? +@ stdcall UnlockFile(long long long long long) +@ stdcall UnlockFileEx(long long long long ptr) +@ stdcall UnmapViewOfFile(ptr) +;@ stdcall UnregisterApplicationRecoveryCallback ; Win 7 +;@ stdcall UnregisterApplicationRestart ; Win 7 +@ stdcall UnregisterConsoleIME() +@ stdcall UnregisterWait(long) +@ stdcall UnregisterWaitEx(long long) +;@ stdcall UpdateCalendarDayOfWeek ; Win 7 +;@ stdcall UpdateProcThreadAttribute api-ms-win-core-processthreads-l1-1-0.UpdateProcThreadAttribute ; Win 7 +@ stdcall UpdateResourceA(long str str long ptr long) +@ stdcall UpdateResourceW(long wstr wstr long ptr long) +@ stdcall VDMConsoleOperation(long long) +@ stdcall VDMOperationStarted(long) +@ stub ValidateCType ; missing in XP SP3 and Win 7 +@ stub ValidateLocale ; missing in XP SP3 and Win 7 +@ stdcall VerLanguageNameA(long str long) +@ stdcall VerLanguageNameW(long wstr long) +@ stdcall -ret64 VerSetConditionMask(long long long long) ntdll.VerSetConditionMask +@ stdcall VerifyConsoleIoHandle(long) +;@ stdcall VerifyScripts ; Win 7 +@ stdcall VerifyVersionInfoA(long long double) +@ stdcall VerifyVersionInfoW(long long double) +@ stdcall VirtualAlloc(ptr long long long) +@ stdcall VirtualAllocEx(long ptr long long long) +;@ stdcall VirtualAllocExNuma ; Win 7 +@ stdcall VirtualBufferExceptionHandler(long long long) ; missing in Win 7 +@ stdcall VirtualFree(ptr long long) +@ stdcall VirtualFreeEx(long ptr long long) +@ stdcall VirtualLock(ptr long) +@ stdcall VirtualProtect(ptr long long ptr) +@ stdcall VirtualProtectEx(long ptr long long ptr) +@ stdcall VirtualQuery(ptr ptr long) +@ stdcall VirtualQueryEx(long ptr ptr long) +@ stdcall VirtualUnlock(ptr long) +;@ stdcall WTSGetActiveConsoleSessionId ; Win 7 +@ stdcall WaitCommEvent(long ptr ptr) +@ stdcall WaitForDebugEvent(ptr long) +@ stdcall WaitForMultipleObjects(long ptr long long) +@ stdcall WaitForMultipleObjectsEx(long ptr long long long) +@ stdcall WaitForSingleObject(long long) +@ stdcall WaitForSingleObjectEx(long long long) +;@ stdcall WaitForThreadpoolIoCallbacks ntdll.TpWaitForIoCompletion ; Win 7 +;@ stdcall WaitForThreadpoolTimerCallbacks ntdll.TpWaitForTimer ; Win 7 +;@ stdcall WaitForThreadpoolWaitCallbacks ntdll.TpWaitForWait ; Win 7 +;@ stdcall WaitForThreadpoolWorkCallbacks ntdll.TpWaitForWork ; Win 7 +@ stdcall WaitNamedPipeA (str long) +@ stdcall WaitNamedPipeW (wstr long) +@ stdcall WakeAllConditionVariable(ptr) ntdll.RtlWakeAllConditionVariable +@ stdcall WakeConditionVariable(ptr) ntdll.RtlWakeConditionVariable +;@ stdcall WerGetFlags ; Win 7 +;@ stdcall WerRegisterFile ; Win 7 +;@ stdcall WerRegisterMemoryBlock ; Win 7 +;@ stdcall WerRegisterRuntimeExceptionModule ; Win 7 +;@ stdcall WerSetFlags ; Win 7 +;@ stdcall WerUnregisterFile ; Win 7 +;@ stdcall WerUnregisterMemoryBlock ; Win 7 +;@ stdcall WerUnregisterRuntimeExceptionModule ; Win 7 +;@ stdcall WerpCleanupMessageMapping ; Win 7 +;@ stdcall WerpInitiateRemoteRecovery ; Win 7 +;@ stdcall WerpNotifyLoadStringResource ; Win 7 +;@ stdcall WerpNotifyLoadStringResourceEx ; Win 7 +;@ stdcall WerpNotifyUseStringResource ; Win 7 +;@ stdcall WerpStringLookup ; Win 7 +@ stdcall WideCharToMultiByte(long long wstr long ptr long ptr ptr) +@ stdcall WinExec(str long) +@ stdcall Wow64DisableWow64FsRedirection(ptr) +@ stdcall Wow64EnableWow64FsRedirection(long) +;@ stdcall Wow64GetThreadContext ; Win 7 +;@ stdcall Wow64GetThreadSelectorEntry ; Win 7 +@ stdcall Wow64RevertWow64FsRedirection(ptr) +;@ stdcall Wow64SetThreadContext ; Win 7 +;@ stdcall Wow64SuspendThread ; Win 7 +@ stdcall WriteConsoleA(long ptr long ptr ptr) +@ stdcall WriteConsoleInputA(long ptr long ptr) +@ stdcall WriteConsoleInputVDMA(long long long long) +@ stdcall WriteConsoleInputVDMW(long long long long) +@ stdcall WriteConsoleInputW(long ptr long ptr) +@ stdcall WriteConsoleOutputA(long ptr long long ptr) +@ stdcall WriteConsoleOutputAttribute(long ptr long long ptr) +@ stdcall WriteConsoleOutputCharacterA(long ptr long long ptr) +@ stdcall WriteConsoleOutputCharacterW(long ptr long long ptr) +@ stdcall WriteConsoleOutputW(long ptr long long ptr) +@ stdcall WriteConsoleW(long ptr long ptr ptr) +@ stdcall WriteFile(long ptr long ptr ptr) +@ stdcall WriteFileEx(long ptr long ptr ptr) +@ stdcall WriteFileGather(long ptr long ptr ptr) +@ stdcall WritePrivateProfileSectionA(str str str) +@ stdcall WritePrivateProfileSectionW(wstr wstr wstr) +@ stdcall WritePrivateProfileStringA(str str str str) +@ stdcall WritePrivateProfileStringW(wstr wstr wstr wstr) +@ stdcall WritePrivateProfileStructA (str str ptr long str) +@ stdcall WritePrivateProfileStructW(wstr wstr ptr long wstr) +@ stdcall WriteProcessMemory(long ptr ptr long ptr) +@ stdcall WriteProfileSectionA(str str) +@ stdcall WriteProfileSectionW(str str) +@ stdcall WriteProfileStringA(str str str) +@ stdcall WriteProfileStringW(wstr wstr wstr) +@ stdcall WriteTapemark(ptr long long long) +@ stdcall WTSGetActiveConsoleSessionId() ; missing in win 7 +@ stdcall ZombifyActCtx(ptr) +;@ stdcall -arch=x86_64 __C_specific_handler ntdll.__C_specific_handler +;@ stdcall -arch=x86_64 __chkstk ntdll.__chkstk +;@ stdcall -arch=x86_64 __misaligned_access ntdll.__misaligned_access +@ stub _DebugOut ; missing in XP SP3 and Win 7 +@ stub _DebugPrintf ; missing in XP SP3 and Win 7 +@ stdcall _hread(long ptr long) +@ stdcall _hwrite(long ptr long) +@ stdcall _lclose(long) +@ stdcall _lcreat(str long) +@ stdcall _llseek(long long long) +;@ stdcall -arch=x86_64 _local_unwind ntdll._local_unwind; Win 7 +@ stdcall _lopen(str long) +@ stdcall _lread(long ptr long) _hread +@ stdcall _lwrite(long ptr long) _hwrite +@ stub dprintf ; missing in XP SP3 and Win 7 +@ stdcall lstrcat(str str) lstrcatA +@ stdcall lstrcatA(str str) +@ stdcall lstrcatW(wstr wstr) +@ stdcall lstrcmp(str str) lstrcmpA +@ stdcall lstrcmpA(str str) +@ stdcall lstrcmpW(wstr wstr) +@ stdcall lstrcmpi(str str) lstrcmpiA +@ stdcall lstrcmpiA(str str) +@ stdcall lstrcmpiW(wstr wstr) +@ stdcall lstrcpy(ptr str) lstrcpyA +@ stdcall lstrcpyA(ptr str) +@ stdcall lstrcpyW(ptr wstr) +@ stdcall lstrcpyn(ptr str long) lstrcpynA +@ stdcall lstrcpynA(ptr str long) +@ stdcall lstrcpynW(ptr wstr long) +@ stdcall lstrlen(str) lstrlenA +@ stdcall lstrlenA(str) +@ stdcall lstrlenW(wstr) +;@ stdcall -arch=x86_64 uaw_lstrcmpW ; Win 7 +;@ stdcall -arch=x86_64 uaw_lstrcmpiW ; Win 7 +;@ stdcall -arch=x86_64 uaw_lstrlenW ; Win 7 +;@ stdcall -arch=x86_64 uaw_wcschr ; Win 7 +;@ stdcall -arch=x86_64 uaw_wcscpy ; Win 7 +;@ stdcall -arch=x86_64 uaw_wcsicmp ; Win 7 +;@ stdcall -arch=x86_64 uaw_wcslen ; Win 7 +;@ stdcall -arch=x86_64 uaw_wcsrchr ; Win 7 + diff --git a/dll/win32/kernel32/kernel32.rbuild b/dll/win32/kernel32/kernel32.rbuild new file mode 100644 index 00000000000..47a79fc91b5 --- /dev/null +++ b/dll/win32/kernel32/kernel32.rbuild @@ -0,0 +1,143 @@ + + + + + . + . + include + include/reactos/subsys + pseh + normalize + ntdll + + 0x0600 + errcodes + k32.h + + -fno-exceptions + -fno-rtti + + + debugger.c + output.c + + + except.c + + + backup.c + bintype.c + cnotify.c + copy.c + create.c + curdir.c + delete.c + deviceio.c + dir.c + dosdev.c + file.c + find.c + hardlink.c + iocompl.c + lfile.c + lock.c + mailslot.c + move.c + npipe.c + pipe.c + rw.c + tape.c + volume.c + + + global.c + heap.c + isbad.c + local.c + procmem.c + resnotify.c + section.c + virtual.c + + + actctx.c + atom.c + chartype.c + collation.c + casemap.c + comm.c + commdcb.c + computername.c + console.c + dllmain.c + env.c + error.c + fold.c + format_msg.c + handle.c + lang.c + ldr.c + lzexpand.c + muldiv.c + nls.c + perfcnt.c + power.c + recovery.c + res.c + sortkey.c + stubs.c + sysinfo.c + time.c + timerqueue.c + toolhelp.c + version.c + + + cmdline.c + procsup.c + job.c + proc.c + session.c + + + lstring.c + + + condvar.c + critical.c + event.c + mutex.c + sem.c + timer.c + wait.c + + + fiber.c + fls.c + thread.c + tls.c + + + lcformat.c + profile.c + utils.c + + + + + fiber.S + thread.S + + + + + fiber.S + thread.S + + + + + icustubs.cpp + + kernel32.rc + diff --git a/dll/win32/loadperf/loadperf.rbuild b/dll/win32/loadperf/loadperf.rbuild new file mode 100644 index 00000000000..015f95fbd9d --- /dev/null +++ b/dll/win32/loadperf/loadperf.rbuild @@ -0,0 +1,13 @@ + + + + + . + include/reactos/wine + + loadperf_main.c + stubs.c + wine + ntdll + + diff --git a/dll/win32/loadperf/stubs.c b/dll/win32/loadperf/stubs.c index bd172d27924..e319f10ecfc 100644 --- a/dll/win32/loadperf/stubs.c +++ b/dll/win32/loadperf/stubs.c @@ -1,7 +1,7 @@ #include #define NDEBUG -#include +#include #define LOADPERF_FUNCTION DWORD WINAPI diff --git a/dll/win32/localspl/localspl.rbuild b/dll/win32/localspl/localspl.rbuild new file mode 100644 index 00000000000..2c3d27a565f --- /dev/null +++ b/dll/win32/localspl/localspl.rbuild @@ -0,0 +1,16 @@ + + + . + include/reactos/wine + + 0x600 + localmon.c + localspl_main.c + provider.c + localspl.rc + wine + spoolss + user32 + advapi32 + ntdll + diff --git a/dll/win32/localui/localui.rbuild b/dll/win32/localui/localui.rbuild new file mode 100644 index 00000000000..639fc713257 --- /dev/null +++ b/dll/win32/localui/localui.rbuild @@ -0,0 +1,17 @@ + + + + + + . + include/reactos/wine + + localui.c + localui.rc + wine + winspool + user32 + uuid + ntdll + + diff --git a/dll/win32/lpk/lpk.rbuild b/dll/win32/lpk/lpk.rbuild new file mode 100644 index 00000000000..5656efc4efe --- /dev/null +++ b/dll/win32/lpk/lpk.rbuild @@ -0,0 +1,13 @@ + + + include + + ntdll + user32 + usp10 + + dllmain.c + stub.c + + lpk.rc + diff --git a/dll/win32/lsasrv/lsasrv.rbuild b/dll/win32/lsasrv/lsasrv.rbuild new file mode 100644 index 00000000000..1102aa4e1be --- /dev/null +++ b/dll/win32/lsasrv/lsasrv.rbuild @@ -0,0 +1,17 @@ + + + . + . + include/reactos/subsys/lsass + lsa_server + wine + rpcrt4 + ntdll + pseh + authport.c + lsarpc.c + lsasrv.c + privileges.c + sids.c + lsasrv.rc + diff --git a/dll/win32/lz32/lz32.rbuild b/dll/win32/lz32/lz32.rbuild new file mode 100644 index 00000000000..0842bf29c82 --- /dev/null +++ b/dll/win32/lz32/lz32.rbuild @@ -0,0 +1,11 @@ + + + + + . + include/reactos/wine + + wine + ntdll + version.rc + diff --git a/dll/win32/mapi32/mapi32.rbuild b/dll/win32/mapi32/mapi32.rbuild new file mode 100644 index 00000000000..3426b46957f --- /dev/null +++ b/dll/win32/mapi32/mapi32.rbuild @@ -0,0 +1,24 @@ + + + + + + . + include/reactos/wine + + imalloc.c + mapi32_main.c + prop.c + sendmail.c + util.c + stubs.c + version.rc + wine + shlwapi + shell32 + user32 + advapi32 + uuid + ntdll + + diff --git a/dll/win32/mciavi32/mciavi32.rbuild b/dll/win32/mciavi32/mciavi32.rbuild new file mode 100644 index 00000000000..dad219a3227 --- /dev/null +++ b/dll/win32/mciavi32/mciavi32.rbuild @@ -0,0 +1,17 @@ + + + . + include/reactos/wine + + info.c + mciavi.c + mmoutput.c + wnd.c + mciavi_res.rc + wine + msvfw32 + winmm + user32 + gdi32 + ntdll + diff --git a/dll/win32/mcicda/mcicda.rbuild b/dll/win32/mcicda/mcicda.rbuild new file mode 100644 index 00000000000..72ae6304389 --- /dev/null +++ b/dll/win32/mcicda/mcicda.rbuild @@ -0,0 +1,11 @@ + + + . + include/reactos/wine + + mcicda.c + wine + winmm + user32 + ntdll + diff --git a/dll/win32/mciqtz32/mciqtz32.rbuild b/dll/win32/mciqtz32/mciqtz32.rbuild new file mode 100644 index 00000000000..29949780041 --- /dev/null +++ b/dll/win32/mciqtz32/mciqtz32.rbuild @@ -0,0 +1,16 @@ + + + . + include/reactos/wine + + mciqtz.c + version.rc + wine + oleaut32 + gdi32 + ole32 + winmm + user32 + ntdll + strmiids + diff --git a/dll/win32/mciseq/mciseq.rbuild b/dll/win32/mciseq/mciseq.rbuild new file mode 100644 index 00000000000..c761c8c2aa2 --- /dev/null +++ b/dll/win32/mciseq/mciseq.rbuild @@ -0,0 +1,11 @@ + + + . + include/reactos/wine + + mcimidi.c + wine + winmm + user32 + ntdll + diff --git a/dll/win32/mciwave/mciwave.rbuild b/dll/win32/mciwave/mciwave.rbuild new file mode 100644 index 00000000000..69e3c094388 --- /dev/null +++ b/dll/win32/mciwave/mciwave.rbuild @@ -0,0 +1,12 @@ + + + . + include/reactos/wine + + + mciwave.c + wine + winmm + user32 + ntdll + diff --git a/dll/win32/mlang/mlang.rbuild b/dll/win32/mlang/mlang.rbuild new file mode 100644 index 00000000000..168c31a664b --- /dev/null +++ b/dll/win32/mlang/mlang.rbuild @@ -0,0 +1,22 @@ + + + + + + + . + include/reactos/wine + + 0x600 + mlang.c + regsvr.c + wine + ole32 + user32 + gdi32 + advapi32 + oleaut32 + uuid + ntdll + + diff --git a/dll/win32/mmdrv/mmdrv.rbuild b/dll/win32/mmdrv/mmdrv.rbuild new file mode 100644 index 00000000000..0dff5ab0a95 --- /dev/null +++ b/dll/win32/mmdrv/mmdrv.rbuild @@ -0,0 +1,15 @@ + + + . + + ntdll + user32 + winmm + entry.c + mme.c + kernel.c + session.c + common.c + wave.c + wave_io.c + diff --git a/dll/win32/modemui/modemui.rbuild b/dll/win32/modemui/modemui.rbuild new file mode 100644 index 00000000000..da694655178 --- /dev/null +++ b/dll/win32/modemui/modemui.rbuild @@ -0,0 +1,12 @@ + + + . + ntdll + user32 + gdi32 + comctl32 + advapi32 + netapi32 + modemui.c + modemui.rc + diff --git a/dll/win32/mpr/mpr.rbuild b/dll/win32/mpr/mpr.rbuild new file mode 100644 index 00000000000..9566ee649a5 --- /dev/null +++ b/dll/win32/mpr/mpr.rbuild @@ -0,0 +1,22 @@ + + + + + + . + include/reactos/wine + + + auth.c + mpr_main.c + multinet.c + nps.c + pwcache.c + wnet.c + mpr.rc + wine + user32 + advapi32 + ntdll + + diff --git a/dll/win32/mprapi/mprapi.rbuild b/dll/win32/mprapi/mprapi.rbuild new file mode 100644 index 00000000000..dc4e927d3c4 --- /dev/null +++ b/dll/win32/mprapi/mprapi.rbuild @@ -0,0 +1,8 @@ + + + . + include/reactos/wine + + wine + mprapi.c + diff --git a/dll/win32/msacm32/msacm32.drv/msacm32.drv.rbuild b/dll/win32/msacm32/msacm32.drv/msacm32.drv.rbuild new file mode 100644 index 00000000000..db4c6ac3089 --- /dev/null +++ b/dll/win32/msacm32/msacm32.drv/msacm32.drv.rbuild @@ -0,0 +1,12 @@ + + + . + include/reactos/wine + wine + msacm32 + ntdll + user32 + winmm + wavemap.c + wavemap.rc + diff --git a/dll/win32/msacm32/msacm32.rbuild b/dll/win32/msacm32/msacm32.rbuild new file mode 100644 index 00000000000..e32845920d7 --- /dev/null +++ b/dll/win32/msacm32/msacm32.rbuild @@ -0,0 +1,24 @@ + + + + + + . + include/reactos/wine + wine + ntdll + advapi32 + user32 + winmm + driver.c + filter.c + format.c + internal.c + msacm32_main.c + pcmconverter.c + stream.c + + + + + diff --git a/dll/win32/msadp32.acm/msadp32.acm.rbuild b/dll/win32/msadp32.acm/msadp32.acm.rbuild new file mode 100644 index 00000000000..3dcc1c96085 --- /dev/null +++ b/dll/win32/msadp32.acm/msadp32.acm.rbuild @@ -0,0 +1,11 @@ + + + . + include/reactos/wine + + msadp32.c + wine + winmm + user32 + ntdll + diff --git a/dll/win32/msafd/msafd.rbuild b/dll/win32/msafd/msafd.rbuild new file mode 100644 index 00000000000..bc657128668 --- /dev/null +++ b/dll/win32/msafd/msafd.rbuild @@ -0,0 +1,17 @@ + + + . + include + include/reactos/drivers + msafd.h + ntdll + advapi32 + + dllmain.c + event.c + helpers.c + sndrcv.c + stubs.c + + msafd.rc + diff --git a/dll/win32/mscat32/mscat32.rbuild b/dll/win32/mscat32/mscat32.rbuild new file mode 100644 index 00000000000..2d7bf8ac6ef --- /dev/null +++ b/dll/win32/mscat32/mscat32.rbuild @@ -0,0 +1,13 @@ + + + + + . + include/reactos/wine + + main.c + wine + wintrust + ntdll + + diff --git a/dll/win32/mscms/mscms.rbuild b/dll/win32/mscms/mscms.rbuild new file mode 100644 index 00000000000..5afe2342938 --- /dev/null +++ b/dll/win32/mscms/mscms.rbuild @@ -0,0 +1,16 @@ + + + . + include/reactos/wine + + handle.c + icc.c + mscms_main.c + profile.c + stub.c + transform.c + version.rc + wine + advapi32 + ntdll + diff --git a/dll/win32/mscoree/mscoree.rbuild b/dll/win32/mscoree/mscoree.rbuild new file mode 100644 index 00000000000..a014334a962 --- /dev/null +++ b/dll/win32/mscoree/mscoree.rbuild @@ -0,0 +1,12 @@ + + + . + include/reactos/wine + + wine + advapi32 + shell32 + uuid + corruntimehost.c + mscoree_main.c + diff --git a/dll/win32/msctf/msctf.rbuild b/dll/win32/msctf/msctf.rbuild new file mode 100644 index 00000000000..cb072f676e7 --- /dev/null +++ b/dll/win32/msctf/msctf.rbuild @@ -0,0 +1,31 @@ + + + + + + + . + include/reactos/wine + + 0x600 + categorymgr.c + compartmentmgr.c + context.c + displayattributemgr.c + documentmgr.c + inputprocessor.c + langbarmgr.c + msctf.c + range.c + regsvr.c + threadmgr.c + version.rc + wine + uuid + ole32 + oleaut32 + user32 + advapi32 + ntdll + + diff --git a/dll/win32/msftedit/msftedit.rbuild b/dll/win32/msftedit/msftedit.rbuild new file mode 100644 index 00000000000..7a6c77fe64a --- /dev/null +++ b/dll/win32/msftedit/msftedit.rbuild @@ -0,0 +1,12 @@ + + + . + include/reactos/wine + + msftedit_main.c + version.rc + wine + uuid + riched20 + ntdll + diff --git a/dll/win32/msg711.acm/msg711.acm.rbuild b/dll/win32/msg711.acm/msg711.acm.rbuild new file mode 100644 index 00000000000..88e87f98add --- /dev/null +++ b/dll/win32/msg711.acm/msg711.acm.rbuild @@ -0,0 +1,11 @@ + + + . + include/reactos/wine + + msg711.c + wine + winmm + user32 + ntdll + diff --git a/dll/win32/msgina/msgina.rbuild b/dll/win32/msgina/msgina.rbuild new file mode 100644 index 00000000000..1f21595c6e5 --- /dev/null +++ b/dll/win32/msgina/msgina.rbuild @@ -0,0 +1,17 @@ + + + . + include + include/reactos/wine + ntdll + wine + advapi32 + user32 + gdi32 + userenv + gui.c + msgina.c + stubs.c + tui.c + msgina.rc + diff --git a/dll/win32/msgsm32.acm/msgsm32.acm.rbuild b/dll/win32/msgsm32.acm/msgsm32.acm.rbuild new file mode 100644 index 00000000000..b997e1499f0 --- /dev/null +++ b/dll/win32/msgsm32.acm/msgsm32.acm.rbuild @@ -0,0 +1,10 @@ + + + . + include/reactos/wine + + msgsm32.c + wine + winmm + user32 + diff --git a/dll/win32/mshtml.tlb/mshtml.tlb.rbuild b/dll/win32/mshtml.tlb/mshtml.tlb.rbuild new file mode 100644 index 00000000000..f4567236801 --- /dev/null +++ b/dll/win32/mshtml.tlb/mshtml.tlb.rbuild @@ -0,0 +1,15 @@ + + + + + stdole2 + mshtml_tlb.idl + + + + . + mshtml_tlb + + rsrc.rc + + diff --git a/dll/win32/mshtml/mshtml.rbuild b/dll/win32/mshtml/mshtml.rbuild new file mode 100644 index 00000000000..c3f56cd19d2 --- /dev/null +++ b/dll/win32/mshtml/mshtml.rbuild @@ -0,0 +1,96 @@ + + + + + + + . + include/reactos/wine + + 0x600 + + + _open + _close + + conpoint.c + dispex.c + editor.c + hlink.c + htmlanchor.c + htmlbody.c + htmlcomment.c + htmlcurstyle.c + htmldoc.c + htmldoc3.c + htmldoc5.c + htmlelem.c + htmlelem2.c + htmlelem3.c + htmlelemcol.c + htmlevent.c + htmlform.c + htmlframe.c + htmlframebase.c + htmlgeneric.c + htmliframe.c + htmlimg.c + htmlinput.c + htmllocation.c + htmlnode.c + htmloption.c + htmlscreen.c + htmlscript.c + htmlselect.c + htmlstyle.c + htmlstyle2.c + htmlstyle3.c + htmlstylesheet.c + htmltable.c + htmltablerow.c + htmltextarea.c + htmltextcont.c + htmltextnode.c + htmlwindow.c + install.c + loadopts.c + main.c + mutation.c + navigate.c + nsembed.c + nsevents.c + nsio.c + nsservice.c + olecmd.c + oleobj.c + olewnd.c + omnavigator.c + persist.c + protocol.c + script.c + secmgr.c + selection.c + service.c + task.c + txtrange.c + view.c + rsrc.rc + . + wine + strmiids + uuid + urlmon + shlwapi + ole32 + oleaut32 + user32 + gdi32 + advapi32 + wininet + ntdll + mshtml_nsiface_header + + + nsiface.idl + + diff --git a/dll/win32/msi/msi.rbuild b/dll/win32/msi/msi.rbuild new file mode 100644 index 00000000000..4dd17cc0655 --- /dev/null +++ b/dll/win32/msi/msi.rbuild @@ -0,0 +1,88 @@ + + + + + + + . + include/reactos/wine + + 0x600 + action.c + alter.c + appsearch.c + assembly.c + automation.c + classes.c + cond.tab.c + create.c + custom.c + database.c + delete.c + dialog.c + distinct.c + drop.c + events.c + files.c + font.c + format.c + handle.c + helpers.c + insert.c + install.c + join.c + media.c + msi.c + msi_main.c + msiquery.c + package.c + preview.c + record.c + registry.c + regsvr.c + script.c + select.c + source.c + sql.tab.c + storages.c + streams.c + string.c + suminfo.c + table.c + tokenize.c + update.c + upgrade.c + where.c + msi.rc + . + wine + uuid + urlmon + wininet + comctl32 + shell32 + shlwapi + cabinet + oleaut32 + ole32 + version + user32 + gdi32 + advapi32 + odbccp32 + ntdll + pseh + msiserver_interface + msiserver + msiheader + + + msiserver.idl + + + msiserver.idl + + + msiserver.idl + + diff --git a/dll/win32/msimg32/msimg32.rbuild b/dll/win32/msimg32/msimg32.rbuild new file mode 100644 index 00000000000..937c850523e --- /dev/null +++ b/dll/win32/msimg32/msimg32.rbuild @@ -0,0 +1,12 @@ + + + + + . + include/reactos/wine + + wine + gdi32 + ntdll + msimg32_main.c + diff --git a/dll/win32/msimtf/msimtf.rbuild b/dll/win32/msimtf/msimtf.rbuild new file mode 100644 index 00000000000..ac53d3acc5b --- /dev/null +++ b/dll/win32/msimtf/msimtf.rbuild @@ -0,0 +1,15 @@ + + + + + . + include/reactos/wine + + activeimmapp.c + main.c + rsrc.rc + wine + uuid + imm32 + + diff --git a/dll/win32/msisip/msisip.rbuild b/dll/win32/msisip/msisip.rbuild new file mode 100644 index 00000000000..58cdf7e7c4c --- /dev/null +++ b/dll/win32/msisip/msisip.rbuild @@ -0,0 +1,12 @@ + + + + . + include/reactos/wine + + main.c + wine + crypt32 + ole32 + ntdll + diff --git a/dll/win32/msisys.ocx/msisys.ocx.rbuild b/dll/win32/msisys.ocx/msisys.ocx.rbuild new file mode 100644 index 00000000000..2e7105a2264 --- /dev/null +++ b/dll/win32/msisys.ocx/msisys.ocx.rbuild @@ -0,0 +1,11 @@ + + + + . + include/reactos/wine + + msisys.c + wine + uuid + ntdll + diff --git a/dll/win32/msnet32/msnet32.rbuild b/dll/win32/msnet32/msnet32.rbuild new file mode 100644 index 00000000000..553020eaf5f --- /dev/null +++ b/dll/win32/msnet32/msnet32.rbuild @@ -0,0 +1,9 @@ + + + . + include/reactos/wine + + msnet_main.c + wine + ntdll + diff --git a/dll/win32/msrle32/msrle32.rbuild b/dll/win32/msrle32/msrle32.rbuild new file mode 100644 index 00000000000..2b8a6ca4dc6 --- /dev/null +++ b/dll/win32/msrle32/msrle32.rbuild @@ -0,0 +1,12 @@ + + + . + include/reactos/wine + + msrle32.c + rsrc.rc + wine + winmm + user32 + ntdll + diff --git a/dll/win32/mssign32/mssign32.rbuild b/dll/win32/mssign32/mssign32.rbuild new file mode 100644 index 00000000000..ff1be496483 --- /dev/null +++ b/dll/win32/mssign32/mssign32.rbuild @@ -0,0 +1,10 @@ + + + + . + include/reactos/wine + + mssign32_main.c + wine + ntdll + diff --git a/dll/win32/mssip32/mssip32.rbuild b/dll/win32/mssip32/mssip32.rbuild new file mode 100644 index 00000000000..691f8ba153d --- /dev/null +++ b/dll/win32/mssip32/mssip32.rbuild @@ -0,0 +1,10 @@ + + + + . + include/reactos/wine + + main.c + wine + ntdll + diff --git a/dll/win32/mstask/mstask.rbuild b/dll/win32/mstask/mstask.rbuild new file mode 100644 index 00000000000..f766f72f640 --- /dev/null +++ b/dll/win32/mstask/mstask.rbuild @@ -0,0 +1,27 @@ + + + + + + + . + include/reactos/wine + + 0x600 + 0x600 + factory.c + mstask_main.c + task.c + task_scheduler.c + task_trigger.c + rsrc.rc + mstask_local_interface + wine + uuid + ole32 + ntdll + + + mstask_local.idl + + diff --git a/dll/win32/msvcrt/msvcrt.rbuild b/dll/win32/msvcrt/msvcrt.rbuild new file mode 100644 index 00000000000..eef606663f6 --- /dev/null +++ b/dll/win32/msvcrt/msvcrt.rbuild @@ -0,0 +1,26 @@ + + + . + include + + + + + + + + -enable-stdcall-fixup + + + "extern __attribute__ ((dllexport))" + + crt + wine + ntdll + pseh + precomp.h + dllmain.c + stubs.c + msvcrt.rc + diff --git a/dll/win32/msvcrt20/msvcrt20.rbuild b/dll/win32/msvcrt20/msvcrt20.rbuild new file mode 100644 index 00000000000..7ed802295ad --- /dev/null +++ b/dll/win32/msvcrt20/msvcrt20.rbuild @@ -0,0 +1,15 @@ + + + + + + . + include/reactos/wine + + + msvcrt20.c + wine + msvcrt + ntdll + + diff --git a/dll/win32/msvcrt40/msvcrt40.rbuild b/dll/win32/msvcrt40/msvcrt40.rbuild new file mode 100644 index 00000000000..23b8af87bd4 --- /dev/null +++ b/dll/win32/msvcrt40/msvcrt40.rbuild @@ -0,0 +1,13 @@ + + + + + + . + include/reactos/wine + + + msvcrt40.c + wine + + diff --git a/dll/win32/msvfw32/msvfw32.rbuild b/dll/win32/msvfw32/msvfw32.rbuild new file mode 100644 index 00000000000..bd7c362caa4 --- /dev/null +++ b/dll/win32/msvfw32/msvfw32.rbuild @@ -0,0 +1,23 @@ + + + + + + . + include/reactos/wine + + + mciwnd.c + msvideo_main.c + drawdib.c + rsrc.rc + wine + winmm + version + comctl32 + user32 + gdi32 + advapi32 + ntdll + + diff --git a/dll/win32/msvidc32/msvidc32.rbuild b/dll/win32/msvidc32/msvidc32.rbuild new file mode 100644 index 00000000000..be8d9eb0036 --- /dev/null +++ b/dll/win32/msvidc32/msvidc32.rbuild @@ -0,0 +1,11 @@ + + + . + include/reactos/wine + + msvideo1.c + rsrc.rc + wine + user32 + ntdll + diff --git a/dll/win32/mswsock/mswsock.rbuild b/dll/win32/mswsock/mswsock.rbuild new file mode 100644 index 00000000000..3ff00a96f21 --- /dev/null +++ b/dll/win32/mswsock/mswsock.rbuild @@ -0,0 +1,8 @@ + + + + ws2_32 + extensions.c + stubs.c + mswsock.rc + diff --git a/dll/win32/msxml3/msxml3.rbuild b/dll/win32/msxml3/msxml3.rbuild new file mode 100644 index 00000000000..165815e47bc --- /dev/null +++ b/dll/win32/msxml3/msxml3.rbuild @@ -0,0 +1,67 @@ + + + + + + + . + include/reactos/wine + . + msxml3_v1 + + + 0x601 + + /FIwine/typeof.h + libxml2 + libxslt + wine + wineldr + urlmon + wininet + ws2_32 + comctl32 + shell32 + shlwapi + cabinet + oleaut32 + ole32 + version + user32 + gdi32 + advapi32 + uuid + ntdll + attribute.c + comment.c + domdoc.c + element.c + factory.c + main.c + httprequest.c + node.c + nodelist.c + nodemap.c + parseerror.c + pi.c + queryresult.c + regsvr.c + schema.c + text.c + uuid.c + xmldoc.c + xmlelem.c + saxreader.c + bsc.c + cdata.c + dispex.c + docfrag.c + domimpl.c + entityref.c + version.rc + + + stdole2 + msxml3_v1.idl + + diff --git a/dll/win32/nddeapi/nddeapi.rbuild b/dll/win32/nddeapi/nddeapi.rbuild new file mode 100644 index 00000000000..ffffa4844ee --- /dev/null +++ b/dll/win32/nddeapi/nddeapi.rbuild @@ -0,0 +1,9 @@ + + + . + include/reactos/wine + + wine + ntdll + nddeapi.c + diff --git a/dll/win32/netapi32/netapi32.rbuild b/dll/win32/netapi32/netapi32.rbuild new file mode 100644 index 00000000000..3bf8d57f060 --- /dev/null +++ b/dll/win32/netapi32/netapi32.rbuild @@ -0,0 +1,27 @@ + + + + + + . + include/reactos/wine + + access.c + apibuf.c + browsr.c + ds.c + local_group.c + nbcmdqueue.c + nbnamecache.c + nbt.c + netapi32.c + netbios.c + share.c + wksta.c + wine + iphlpapi + ws2_32 + advapi32 + ntdll + + diff --git a/dll/win32/netcfgx/netcfgx.rbuild b/dll/win32/netcfgx/netcfgx.rbuild new file mode 100644 index 00000000000..1ff2adb7838 --- /dev/null +++ b/dll/win32/netcfgx/netcfgx.rbuild @@ -0,0 +1,23 @@ + + + + 0x0600 + ntdll + rpcrt4 + setupapi + advapi32 + uuid + iphlpapi + iphlpapi + wine + ole32 + user32 + comctl32 + ws2_32 + netcfgx.c + classfactory.c + netcfg_iface.c + inetcfgcomp_iface.c + tcpipconf_notify.c + netcfgx.rc + diff --git a/dll/win32/netevent/netevent.rbuild b/dll/win32/netevent/netevent.rbuild new file mode 100644 index 00000000000..ac6f34013fc --- /dev/null +++ b/dll/win32/netevent/netevent.rbuild @@ -0,0 +1,6 @@ + + . + . + neteventmsg + netevt.rc + diff --git a/dll/win32/netid/netid.rbuild b/dll/win32/netid/netid.rbuild new file mode 100644 index 00000000000..b861f9aedeb --- /dev/null +++ b/dll/win32/netid/netid.rbuild @@ -0,0 +1,12 @@ + + + . + ntdll + user32 + gdi32 + comctl32 + advapi32 + netapi32 + netid.c + netid.rc + diff --git a/dll/win32/netshell/netshell.rbuild b/dll/win32/netshell/netshell.rbuild new file mode 100644 index 00000000000..a5cfbce03a7 --- /dev/null +++ b/dll/win32/netshell/netshell.rbuild @@ -0,0 +1,28 @@ + + + + . + + 0x600 + shlwapi + shell32 + version + iphlpapi + wine + ole32 + user32 + uuid + advapi32 + setupapi + ws2_32 + comctl32 + precomp.h + netshell.c + shfldr_netconnect.c + enumlist.c + netshell.rc + classfactory.c + connectmanager.c + lanconnectui.c + lanstatusui.c + diff --git a/dll/win32/newdev/newdev.rbuild b/dll/win32/newdev/newdev.rbuild new file mode 100644 index 00000000000..9d8cb9e4616 --- /dev/null +++ b/dll/win32/newdev/newdev.rbuild @@ -0,0 +1,16 @@ + + . + + newdev.c + stubs.c + wizard.c + newdev.rc + wine + gdi32 + comctl32 + ntdll + setupapi + advapi32 + user32 + shell32 + diff --git a/dll/win32/ntdsapi/ntdsapi.rbuild b/dll/win32/ntdsapi/ntdsapi.rbuild new file mode 100644 index 00000000000..9048109edf5 --- /dev/null +++ b/dll/win32/ntdsapi/ntdsapi.rbuild @@ -0,0 +1,10 @@ + + + . + include/reactos/wine + + wine + user32 + ntdll + ntdsapi.c + diff --git a/dll/win32/ntlanman/ntlanman.rbuild b/dll/win32/ntlanman/ntlanman.rbuild new file mode 100644 index 00000000000..1596633e36a --- /dev/null +++ b/dll/win32/ntlanman/ntlanman.rbuild @@ -0,0 +1,11 @@ + + + + + . + netapi32 + ntdll + wine + ntlanman.c + ntlanman.rc + diff --git a/dll/win32/ntmarta/ntmarta.rbuild b/dll/win32/ntmarta/ntmarta.rbuild new file mode 100644 index 00000000000..56696aa67d1 --- /dev/null +++ b/dll/win32/ntmarta/ntmarta.rbuild @@ -0,0 +1,12 @@ + + + . + + 0x600 + ntdll + advapi32 + user32 + ntmarta.c + ntmarta.rc + ntmarta.h + diff --git a/dll/win32/ntprint/ntprint.rbuild b/dll/win32/ntprint/ntprint.rbuild new file mode 100644 index 00000000000..8a65cd03dbc --- /dev/null +++ b/dll/win32/ntprint/ntprint.rbuild @@ -0,0 +1,13 @@ + + + + . + include/reactos/wine + + ntprint.c + ntprint.rc + wine + winspool + ntdll + + diff --git a/dll/win32/objsel/objsel.rbuild b/dll/win32/objsel/objsel.rbuild new file mode 100644 index 00000000000..f3409b38ea3 --- /dev/null +++ b/dll/win32/objsel/objsel.rbuild @@ -0,0 +1,22 @@ + + + + + + + . + include/reactos/wine + + 0x600 + wine + ole32 + user32 + advapi32 + uuid + ntdll + factory.c + objsel.c + regsvr.c + objsel.rc + + diff --git a/dll/win32/odbc32/odbc32.rbuild b/dll/win32/odbc32/odbc32.rbuild new file mode 100644 index 00000000000..30d8de7cea1 --- /dev/null +++ b/dll/win32/odbc32/odbc32.rbuild @@ -0,0 +1,13 @@ + + + + + + . + include/reactos/wine + + wine + advapi32 + proxyodbc.c + + \ No newline at end of file diff --git a/dll/win32/odbccp32/odbccp32.rbuild b/dll/win32/odbccp32/odbccp32.rbuild new file mode 100644 index 00000000000..15bb8d84bb4 --- /dev/null +++ b/dll/win32/odbccp32/odbccp32.rbuild @@ -0,0 +1,15 @@ + + + + + + . + include/reactos/wine + + wine + advapi32 + uuid + ntdll + odbccp32.c + + diff --git a/dll/win32/ole32/ole32.rbuild b/dll/win32/ole32/ole32.rbuild new file mode 100644 index 00000000000..b7ad1906e1a --- /dev/null +++ b/dll/win32/ole32/ole32.rbuild @@ -0,0 +1,85 @@ + + + + + + + . + include/reactos/wine + + 0x600 + + OLE32_ + CLSID_PSFactoryBuffer + + + wine + advapi32 + user32 + gdi32 + ole32_irot_client + ole32_proxy + rpcrt4 + ntdll + uuid + pseh + antimoniker.c + bindctx.c + classmoniker.c + clipboard.c + comcat.c + compobj.c + compositemoniker.c + datacache.c + defaulthandler.c + dictionary.c + enumx.c + errorinfo.c + filelockbytes.c + filemoniker.c + ftmarshal.c + git.c + hglobalstream.c + ifs.c + itemmoniker.c + marshal.c + memlockbytes.c + moniker.c + ole2.c + ole2stubs.c + ole2impl.c + ole32_main.c + oleobj.c + oleproxy.c + pointermoniker.c + regsvr.c + rpc.c + stg_prop.c + stg_stream.c + storage32.c + stubmanager.c + usrmarshal.c + ole32res.rc + dcom.idl + irot.idl + . + + + irot.idl + + + irot.idl + + + + + + OLE32_ + CLSID_PSFactoryBuffer + + dcom.idl + ole32_unknwn.idl + ole32_objidl.idl + ole32_oleidl.idl + + diff --git a/dll/win32/oleacc/oleacc.rbuild b/dll/win32/oleacc/oleacc.rbuild new file mode 100644 index 00000000000..47f07e87b85 --- /dev/null +++ b/dll/win32/oleacc/oleacc.rbuild @@ -0,0 +1,16 @@ + + + + + + + . + include/reactos/wine + + main.c + oleacc.rc + wine + user32 + ntdll + + diff --git a/dll/win32/oleaut32/oleaut32.rbuild b/dll/win32/oleaut32/oleaut32.rbuild new file mode 100644 index 00000000000..8f8580ebbd6 --- /dev/null +++ b/dll/win32/oleaut32/oleaut32.rbuild @@ -0,0 +1,65 @@ + + + + + + + . + include/reactos/libs/libjpeg + include/reactos/wine + + 0x600 + "{0xb196b286,0xbab4,0x101a,{0xb6,0x9c,0x00,0xaa,0x00,0x34,0x1d,0x07}}" + + + + + OLEAUTPS_ + /FIwine/typeof.h + connpt.c + dispatch.c + hash.c + oleaut.c + olefont.c + olepicture.c + recinfo.c + regsvr.c + safearray.c + stubs.c + tmarshal.c + typelib.c + typelib2.c + ungif.c + usrmarshal.c + varformat.c + variant.c + vartype.c + oleaut32.rc + oleaut32_oaidl.idl + . + oleaut32_proxy + wine + windowscodecs + wineldr + ole32 + rpcrt4 + user32 + gdi32 + advapi32 + ntdll + comctl32 + urlmon + uuid + pseh + + + + "{0xb196b286,0xbab4,0x101a,{0xb6,0x9c,0x00,0xaa,0x00,0x34,0x1d,0x07}}" + + + + OLEAUTPS_ + oleaut32_oaidl.idl + oleaut32_ocidl.idl + + diff --git a/dll/win32/olecli32/olecli32.rbuild b/dll/win32/olecli32/olecli32.rbuild new file mode 100644 index 00000000000..29e90e87fbb --- /dev/null +++ b/dll/win32/olecli32/olecli32.rbuild @@ -0,0 +1,13 @@ + + + + + . + include/reactos/wine + + olecli_main.c + wine + ole32 + gdi32 + ntdll + diff --git a/dll/win32/oledlg/oledlg.rbuild b/dll/win32/oledlg/oledlg.rbuild new file mode 100644 index 00000000000..879c0b514a0 --- /dev/null +++ b/dll/win32/oledlg/oledlg.rbuild @@ -0,0 +1,20 @@ + + + + + + . + include/reactos/wine + + wine + ole32 + comdlg32 + user32 + advapi32 + ntdll + insobjdlg.c + oledlg_main.c + pastespl.c + rsrc.rc + + diff --git a/dll/win32/olepro32/olepro32.rbuild b/dll/win32/olepro32/olepro32.rbuild new file mode 100644 index 00000000000..837097e5fb6 --- /dev/null +++ b/dll/win32/olepro32/olepro32.rbuild @@ -0,0 +1,14 @@ + + + + + + . + include/reactos/wine + + wine + oleaut32 + ntdll + olepro32stubs.c + version.rc + diff --git a/dll/win32/olesvr32/olesvr32.rbuild b/dll/win32/olesvr32/olesvr32.rbuild new file mode 100644 index 00000000000..f36db797247 --- /dev/null +++ b/dll/win32/olesvr32/olesvr32.rbuild @@ -0,0 +1,13 @@ + + + + + + . + include/reactos/wine + + olesvr_main.c + wine + ntdll + + diff --git a/dll/win32/olethk32/olethk32.rbuild b/dll/win32/olethk32/olethk32.rbuild new file mode 100644 index 00000000000..653460355c6 --- /dev/null +++ b/dll/win32/olethk32/olethk32.rbuild @@ -0,0 +1,10 @@ + + + . + include/reactos/wine + + main.c + version.rc + wine + ntdll + diff --git a/dll/win32/opengl32/opengl32.rbuild b/dll/win32/opengl32/opengl32.rbuild new file mode 100644 index 00000000000..a367804b29c --- /dev/null +++ b/dll/win32/opengl32/opengl32.rbuild @@ -0,0 +1,13 @@ + + + ntdll + gdi32 + user32 + advapi32 + glu32 + opengl32.h + font.c + gl.c + opengl32.c + wgl.c + diff --git a/dll/win32/pdh/pdh.rbuild b/dll/win32/pdh/pdh.rbuild new file mode 100644 index 00000000000..db1ea7eab09 --- /dev/null +++ b/dll/win32/pdh/pdh.rbuild @@ -0,0 +1,10 @@ + + + . + include/reactos/wine + + 0x600 + wine + ntdll + pdh_main.c + diff --git a/dll/win32/pidgen/pidgen.rbuild b/dll/win32/pidgen/pidgen.rbuild new file mode 100644 index 00000000000..504f1acb855 --- /dev/null +++ b/dll/win32/pidgen/pidgen.rbuild @@ -0,0 +1,10 @@ + + + . + include/reactos/wine + + main.c + rsrc.rc + wine + ntdll + diff --git a/dll/win32/powrprof/powrprof.rbuild b/dll/win32/powrprof/powrprof.rbuild new file mode 100644 index 00000000000..23d545071a9 --- /dev/null +++ b/dll/win32/powrprof/powrprof.rbuild @@ -0,0 +1,13 @@ + + + + + . + wine + advapi32 + ntdll + user32 + comctl32 + powrprof.c + powrprof.rc + diff --git a/dll/win32/printui/printui.rbuild b/dll/win32/printui/printui.rbuild new file mode 100644 index 00000000000..6596eb2a847 --- /dev/null +++ b/dll/win32/printui/printui.rbuild @@ -0,0 +1,11 @@ + + + . + include/reactos/wine + + wine + shell32 + ntdll + printui.c + printui.rc + diff --git a/dll/win32/psapi/psapi.rbuild b/dll/win32/psapi/psapi.rbuild new file mode 100644 index 00000000000..7c21b6cc5a3 --- /dev/null +++ b/dll/win32/psapi/psapi.rbuild @@ -0,0 +1,12 @@ + + + . + include + epsapi + pseh + ntdll + precomp.h + malloc.c + psapi.c + psapi.rc + diff --git a/dll/win32/pstorec/pstorec.rbuild b/dll/win32/pstorec/pstorec.rbuild new file mode 100644 index 00000000000..0b932b67acf --- /dev/null +++ b/dll/win32/pstorec/pstorec.rbuild @@ -0,0 +1,19 @@ + + + + + stdole2 + pstorec_tlb.idl + + + + + . + + pstorec_tlb + wine + uuid + pstorec.c + rsrc.rc + + diff --git a/dll/win32/qmgr/qmgr.rbuild b/dll/win32/qmgr/qmgr.rbuild new file mode 100644 index 00000000000..38ac841058b --- /dev/null +++ b/dll/win32/qmgr/qmgr.rbuild @@ -0,0 +1,34 @@ + + + + + . + . + include/reactos/wine + + qmgr_local_header + wine + uuid + wininet + urlmon + ole32 + advapi32 + ntdll + qmgr_local_interface + enum_files.c + enum_jobs.c + factory.c + file.c + job.c + qmgr.c + qmgr_main.c + service.c + rsrc.rc + + + qmgr_local.idl + + + qmgr_local.idl + + diff --git a/dll/win32/qmgrprxy/qmgrprxy.rbuild b/dll/win32/qmgrprxy/qmgrprxy.rbuild new file mode 100644 index 00000000000..cea10b90855 --- /dev/null +++ b/dll/win32/qmgrprxy/qmgrprxy.rbuild @@ -0,0 +1,27 @@ + + + + + + + . + include/reactos/wine + . + + wine + qmgrprxy_interface + qmgrprxy_proxy + ntdll + rpcrt4 + pseh + version.rc + + + qmgrprxy.idl + + + + + qmgrprxy.idl + + diff --git a/dll/win32/query/query.rbuild b/dll/win32/query/query.rbuild new file mode 100644 index 00000000000..a1f718a0d4d --- /dev/null +++ b/dll/win32/query/query.rbuild @@ -0,0 +1,11 @@ + + + + . + include/reactos/wine + + query_main.c + wine + uuid + ntdll + diff --git a/dll/win32/rasadhlp/rasadhlp.rbuild b/dll/win32/rasadhlp/rasadhlp.rbuild new file mode 100644 index 00000000000..e12c60d7c02 --- /dev/null +++ b/dll/win32/rasadhlp/rasadhlp.rbuild @@ -0,0 +1,12 @@ + + + + + include/reactos/winsock + . + ntdll + ws2_32 + autodial.c + init.c + winsock.c + diff --git a/dll/win32/rasapi32/rasapi32.rbuild b/dll/win32/rasapi32/rasapi32.rbuild new file mode 100644 index 00000000000..ca0896a6600 --- /dev/null +++ b/dll/win32/rasapi32/rasapi32.rbuild @@ -0,0 +1,13 @@ + + + + + + . + include/reactos/wine + + rasapi.c + wine + ntdll + + diff --git a/dll/win32/rasdlg/rasdlg.rbuild b/dll/win32/rasdlg/rasdlg.rbuild new file mode 100644 index 00000000000..8c0dc5c70fa --- /dev/null +++ b/dll/win32/rasdlg/rasdlg.rbuild @@ -0,0 +1,9 @@ + + + . + wine + ntdll + uuid + rasdlg.c + rasdlg.rc + diff --git a/dll/win32/rasman/rasman.rbuild b/dll/win32/rasman/rasman.rbuild new file mode 100644 index 00000000000..2fabb5ceb8d --- /dev/null +++ b/dll/win32/rasman/rasman.rbuild @@ -0,0 +1,9 @@ + + + . + wine + ntdll + uuid + rasman.c + rasman.rc + diff --git a/dll/win32/resutils/resutils.rbuild b/dll/win32/resutils/resutils.rbuild new file mode 100644 index 00000000000..f4c65c62012 --- /dev/null +++ b/dll/win32/resutils/resutils.rbuild @@ -0,0 +1,9 @@ + + + . + include/reactos/wine + + resutils.c + wine + ntdll + diff --git a/dll/win32/riched20/riched20.rbuild b/dll/win32/riched20/riched20.rbuild new file mode 100644 index 00000000000..b176049bb8a --- /dev/null +++ b/dll/win32/riched20/riched20.rbuild @@ -0,0 +1,40 @@ + + + + + + . + include/reactos/wine + + /FIwine/typeof.h + -enable-stdcall-fixup + caret.c + clipboard.c + context.c + editor.c + list.c + paint.c + para.c + reader.c + richole.c + row.c + run.c + string.c + style.c + table.c + txthost.c + txtsrv.c + undo.c + wrap.c + writer.c + version.rc + wine + uuid + ole32 + oleaut32 + imm32 + user32 + gdi32 + ntdll + + diff --git a/dll/win32/riched32/riched32.rbuild b/dll/win32/riched32/riched32.rbuild new file mode 100644 index 00000000000..df98770a420 --- /dev/null +++ b/dll/win32/riched32/riched32.rbuild @@ -0,0 +1,16 @@ + + + + + + . + include/reactos/wine + + richedit.c + version.rc + wine + riched20 + user32 + ntdll + + diff --git a/dll/win32/rpcrt4/rpcrt4.rbuild b/dll/win32/rpcrt4/rpcrt4.rbuild new file mode 100644 index 00000000000..10d83df2f6f --- /dev/null +++ b/dll/win32/rpcrt4/rpcrt4.rbuild @@ -0,0 +1,49 @@ + + + + + + + . + include/reactos/wine + 0x600 + + + + wine + uuid + rpcrt4_epm_client + user32 + advapi32 + secur32 + iphlpapi + ws2_32 + ntdll + pseh + cproxy.c + cpsf.c + cstub.c + ndr_contexthandle.c + ndr_clientserver.c + ndr_fullpointer.c + ndr_marshall.c + ndr_ole.c + ndr_stubless.c + rpc_assoc.c + rpc_async.c + rpc_binding.c + rpc_epmap.c + rpc_message.c + rpc_server.c + rpc_transport.c + rpcrt4_main.c + unix_func.c + ndr_es.c + rpcrt4.rc + epm.idl + . + + + epm.idl + + diff --git a/dll/win32/rsabase/rsabase.rbuild b/dll/win32/rsabase/rsabase.rbuild new file mode 100644 index 00000000000..8f530853879 --- /dev/null +++ b/dll/win32/rsabase/rsabase.rbuild @@ -0,0 +1,15 @@ + + + + + + + . + include/reactos/wine + + wine + rsaenh + ntdll + version.rc + + diff --git a/dll/win32/rsaenh/rsaenh.rbuild b/dll/win32/rsaenh/rsaenh.rbuild new file mode 100644 index 00000000000..49973032b7e --- /dev/null +++ b/dll/win32/rsaenh/rsaenh.rbuild @@ -0,0 +1,27 @@ + + + + + + + . + include/reactos/wine + + aes.c + des.c + handle.c + implglue.c + md2.c + mpi.c + rc2.c + rc4.c + rsa.c + rsaenh.c + sha2.c + version.rc + wine + crypt32 + advapi32 + ntdll + + diff --git a/dll/win32/samlib/samlib.rbuild b/dll/win32/samlib/samlib.rbuild new file mode 100644 index 00000000000..3771b94afa8 --- /dev/null +++ b/dll/win32/samlib/samlib.rbuild @@ -0,0 +1,9 @@ + + + . + ntdll + advapi32 + dllmain.c + samlib.c + samlib.rc + diff --git a/dll/win32/samsrv/samsrv.rbuild b/dll/win32/samsrv/samsrv.rbuild new file mode 100644 index 00000000000..3676ab2de2d --- /dev/null +++ b/dll/win32/samsrv/samsrv.rbuild @@ -0,0 +1,9 @@ + + + + + . + ntdll + samsrv.c + samsrv.rc + diff --git a/dll/win32/sccbase/sccbase.rbuild b/dll/win32/sccbase/sccbase.rbuild new file mode 100644 index 00000000000..dfe4f54918f --- /dev/null +++ b/dll/win32/sccbase/sccbase.rbuild @@ -0,0 +1,10 @@ + + + + . + include/reactos/wine + + main.c + wine + ntdll + diff --git a/dll/win32/schannel/schannel.rbuild b/dll/win32/schannel/schannel.rbuild new file mode 100644 index 00000000000..cfdfa8169b2 --- /dev/null +++ b/dll/win32/schannel/schannel.rbuild @@ -0,0 +1,15 @@ + + + + + . + include/reactos/wine + + wine + secur32 + ntdll + lsamode.c + schannel_main.c + usermode.c + version.rc + diff --git a/dll/win32/secur32/secur32.rbuild b/dll/win32/secur32/secur32.rbuild new file mode 100644 index 00000000000..68db02d8ea6 --- /dev/null +++ b/dll/win32/secur32/secur32.rbuild @@ -0,0 +1,15 @@ + + + . + include/reactos/subsys + + lsalib + ntdll + advapi32 + dllmain.c + secext.c + sspi.c + stubs.c + secur32.rc + precomp.h + diff --git a/dll/win32/security/security.rbuild b/dll/win32/security/security.rbuild new file mode 100644 index 00000000000..e0519dc0d69 --- /dev/null +++ b/dll/win32/security/security.rbuild @@ -0,0 +1,8 @@ + + + . + + ntdll + advapi32 + security.rc + diff --git a/dll/win32/sensapi/sensapi.rbuild b/dll/win32/sensapi/sensapi.rbuild new file mode 100644 index 00000000000..e7b686e9eaa --- /dev/null +++ b/dll/win32/sensapi/sensapi.rbuild @@ -0,0 +1,11 @@ + + + + + . + include/reactos/wine + + wine + ntdll + sensapi.c + diff --git a/dll/win32/serialui/serialui.rbuild b/dll/win32/serialui/serialui.rbuild new file mode 100644 index 00000000000..31c760b7a45 --- /dev/null +++ b/dll/win32/serialui/serialui.rbuild @@ -0,0 +1,8 @@ + + + . + user32 + shlwapi + serialui.c + serialui.rc + diff --git a/dll/win32/setupapi/setupapi.rbuild b/dll/win32/setupapi/setupapi.rbuild new file mode 100644 index 00000000000..6f2d0c2c627 --- /dev/null +++ b/dll/win32/setupapi/setupapi.rbuild @@ -0,0 +1,43 @@ + + + + + . + include/reactos/wine + . + + + _wcsnicmp + + + + pnp_client + uuid + wine + ntdll + gdi32 + comctl32 + advapi32 + user32 + rpcrt4 + version + shell32 + pseh + cfgmgr.c + devclass.c + devinst.c + dirid.c + diskspace.c + driver.c + install.c + interface.c + misc.c + parser.c + query.c + queue.c + setupcab.c + stringtable.c + stubs.c + rpc.c + setupapi.rc + diff --git a/dll/win32/sfc/sfc.rbuild b/dll/win32/sfc/sfc.rbuild new file mode 100644 index 00000000000..8bc34b450c9 --- /dev/null +++ b/dll/win32/sfc/sfc.rbuild @@ -0,0 +1,6 @@ + + + . + sfc.c + precomp.h + diff --git a/dll/win32/sfc_os/sfc_os.rbuild b/dll/win32/sfc_os/sfc_os.rbuild new file mode 100644 index 00000000000..033f4ddd9d5 --- /dev/null +++ b/dll/win32/sfc_os/sfc_os.rbuild @@ -0,0 +1,6 @@ + + + . + sfc_os.c + precomp.h + diff --git a/dll/win32/shdoclc/shdoclc.rbuild b/dll/win32/shdoclc/shdoclc.rbuild new file mode 100644 index 00000000000..a47d5f094ba --- /dev/null +++ b/dll/win32/shdoclc/shdoclc.rbuild @@ -0,0 +1,9 @@ + + + + + . + include/reactos/wine + wine + rsrc.rc + diff --git a/dll/win32/shdocvw/shdocvw.rbuild b/dll/win32/shdocvw/shdocvw.rbuild new file mode 100644 index 00000000000..c7b565269d2 --- /dev/null +++ b/dll/win32/shdocvw/shdocvw.rbuild @@ -0,0 +1,49 @@ + + + + + + + . + include/reactos/wine + . + + wine + uuid + ntdll + advapi32 + comctl32 + user32 + ole32 + oleaut32 + gdi32 + shell32 + shlwapi + version + urlmon + shdocvw_v1 + classinfo.c + client.c + dochost.c + events.c + factory.c + frame.c + ie.c + iexplore.c + intshcut.c + navigate.c + oleobject.c + persist.c + shdocvw_main.c + shlinstobj.c + taskbarlist.c + urlhist.c + view.c + webbrowser.c + shdocvw.rc + + + stdole2 + shdocvw_v1.idl + + diff --git a/dll/win32/shell32/shell32.rbuild b/dll/win32/shell32/shell32.rbuild new file mode 100644 index 00000000000..5276af049f5 --- /dev/null +++ b/dll/win32/shell32/shell32.rbuild @@ -0,0 +1,86 @@ + + + + + . + . + include/reactos/wine + + + + 0x600 + wine + uuid + recyclebin + ntdll + advapi32 + gdi32 + user32 + comctl32 + comdlg32 + shlwapi + ole32 + version + devmgr + winspool + winmm + precomp.h + authors.c + autocomplete.c + brsfolder.c + changenotify.c + classes.c + clipboard.c + control.c + dataobject.c + dde.c + debughlp.c + desktop.c + dialogs.c + dragdrophelper.c + enumidlist.c + extracticon.c + folders.c + iconcache.c + pidl.c + regsvr.c + shell32_main.c + shellitem.c + shelllink.c + shellole.c + shellord.c + shellpath.c + shellreg.c + shellstring.c + shfldr_desktop.c + shfldr_fs.c + shfldr_mycomp.c + shfldr_mydocuments.c + shfldr_printers.c + shfldr_admintools.c + shfldr_netplaces.c + shfldr_fonts.c + shfldr_cpanel.c + shfldr_recyclebin.c + shlexec.c + shlfileop.c + shlfolder.c + shlfsbind.c + shlmenu.c + shlview.c + shpolicy.c + shv_def_cmenu.c + startmenu.c + stubs.c + ros-systray.c + fprop.c + drive.c + she_ocmenu.c + shv_item_new.c + folder_options.c + shell32.rc + + + shobjidl_local.idl + + diff --git a/dll/win32/shfolder/shfolder.rbuild b/dll/win32/shfolder/shfolder.rbuild new file mode 100644 index 00000000000..02bd50cee30 --- /dev/null +++ b/dll/win32/shfolder/shfolder.rbuild @@ -0,0 +1,14 @@ + + + + + + . + include/reactos/wine + + version.rc + wine + shell32 + ntdll + + diff --git a/dll/win32/shimgvw/shimgvw.rbuild b/dll/win32/shimgvw/shimgvw.rbuild new file mode 100644 index 00000000000..2e5eea1e3e0 --- /dev/null +++ b/dll/win32/shimgvw/shimgvw.rbuild @@ -0,0 +1,12 @@ + + + . + advapi32 + comctl32 + ntdll + user32 + gdi32 + gdiplus + shimgvw.c + shimgvw.rc + diff --git a/dll/win32/shlwapi/shlwapi.rbuild b/dll/win32/shlwapi/shlwapi.rbuild new file mode 100644 index 00000000000..24d2e5c0502 --- /dev/null +++ b/dll/win32/shlwapi/shlwapi.rbuild @@ -0,0 +1,43 @@ + + + + + + . + include/reactos/wine + 0x600 + + assoc.c + clist.c + istream.c + msgbox.c + ordinal.c + path.c + reg.c + regstream.c + shlwapi_main.c + stopwatch.c + string.c + thread.c + url.c + wsprintf.c + shlwapi.rc + wine + uuid + user32 + gdi32 + advapi32 + oleaut32 + ole32 + comctl32 + comdlg32 + mpr + mlang + urlmon + shell32 + winmm + version + msvcrt + ntdll + + diff --git a/dll/win32/slbcsp/slbcsp.rbuild b/dll/win32/slbcsp/slbcsp.rbuild new file mode 100644 index 00000000000..12a4b825a91 --- /dev/null +++ b/dll/win32/slbcsp/slbcsp.rbuild @@ -0,0 +1,10 @@ + + + + . + include/reactos/wine + + main.c + wine + ntdll + diff --git a/dll/win32/smdll/smdll.rbuild b/dll/win32/smdll/smdll.rbuild new file mode 100644 index 00000000000..b4cb35e03df --- /dev/null +++ b/dll/win32/smdll/smdll.rbuild @@ -0,0 +1,10 @@ + + + . + include/reactos/subsys + smlib + ntdll + dllmain.c + query.c + smdll.rc + diff --git a/dll/win32/sndblst/sndblst.rbuild b/dll/win32/sndblst/sndblst.rbuild new file mode 100644 index 00000000000..b613c17d87a --- /dev/null +++ b/dll/win32/sndblst/sndblst.rbuild @@ -0,0 +1,17 @@ + + + + + + + include/reactos/libs/sound + . + + mment4 + mmebuddy + ntdll + user32 + winmm + advapi32 + sndblst.c + diff --git a/dll/win32/snmpapi/snmpapi.rbuild b/dll/win32/snmpapi/snmpapi.rbuild new file mode 100644 index 00000000000..b361ddf082b --- /dev/null +++ b/dll/win32/snmpapi/snmpapi.rbuild @@ -0,0 +1,11 @@ + + + . + include/reactos/wine + + 0x600 + ntdll + wine + main.c + snmpapi.rc + diff --git a/dll/win32/softpub/softpub.rbuild b/dll/win32/softpub/softpub.rbuild new file mode 100644 index 00000000000..fce15865866 --- /dev/null +++ b/dll/win32/softpub/softpub.rbuild @@ -0,0 +1,10 @@ + + + + . + include/reactos/wine + + wine + wintrust + softpub.rc + diff --git a/dll/win32/spoolss/spoolss.rbuild b/dll/win32/spoolss/spoolss.rbuild new file mode 100644 index 00000000000..85fbf39755f --- /dev/null +++ b/dll/win32/spoolss/spoolss.rbuild @@ -0,0 +1,15 @@ + + + + + + . + include/reactos/wine + + spoolss_main.c + router.c + wine + winspool + ntdll + + diff --git a/dll/win32/srclient/srclient.rbuild b/dll/win32/srclient/srclient.rbuild new file mode 100644 index 00000000000..565c45d8e15 --- /dev/null +++ b/dll/win32/srclient/srclient.rbuild @@ -0,0 +1,8 @@ + + + + + . + ntdll + srclient_main.c + diff --git a/dll/win32/stdole2.tlb/stdole2.rbuild b/dll/win32/stdole2.tlb/stdole2.rbuild new file mode 100644 index 00000000000..0b96229067f --- /dev/null +++ b/dll/win32/stdole2.tlb/stdole2.rbuild @@ -0,0 +1,17 @@ + + + . + include/reactos/wine + + std_ole_v2.idl + + + + . + . + include/reactos/wine + std_ole_v2 + + rsrc.rc + + diff --git a/dll/win32/stdole32.tlb/stdole32.rbuild b/dll/win32/stdole32.tlb/stdole32.rbuild new file mode 100644 index 00000000000..5d4c0018851 --- /dev/null +++ b/dll/win32/stdole32.tlb/stdole32.rbuild @@ -0,0 +1,19 @@ + + + + + . + include/reactos/wine + + std_ole_v1.idl + + + + . + . + include/reactos/wine + std_ole_v1 + + rsrc.rc + + diff --git a/dll/win32/sti/sti.rbuild b/dll/win32/sti/sti.rbuild new file mode 100644 index 00000000000..edce67acab8 --- /dev/null +++ b/dll/win32/sti/sti.rbuild @@ -0,0 +1,36 @@ + + + + + + + . + include/reactos/wine + 0x600 + + STI_ + + + + regsvr.c + sti.c + sti_main.c + sti_wia.idl + wine + sti_proxy + ole32 + oleaut32 + rpcrt4 + advapi32 + pseh + uuid + ntdll + + + + STI_ + + + sti_wia.idl + + diff --git a/dll/win32/sxs/sxs.rbuild b/dll/win32/sxs/sxs.rbuild new file mode 100644 index 00000000000..3e0c4b715ac --- /dev/null +++ b/dll/win32/sxs/sxs.rbuild @@ -0,0 +1,11 @@ + + + + + . + include/reactos/wine + + sxs.c + wine + ntdll + diff --git a/dll/win32/syssetup/syssetup.rbuild b/dll/win32/syssetup/syssetup.rbuild new file mode 100644 index 00000000000..4fd7e6249da --- /dev/null +++ b/dll/win32/syssetup/syssetup.rbuild @@ -0,0 +1,23 @@ + + + . + pseh + uuid + ntdll + advapi32 + gdi32 + user32 + samlib + userenv + comctl32 + setupapi + ole32 + shell32 + shlwapi + classinst.c + dllmain.c + install.c + logfile.c + wizard.c + syssetup.rc + diff --git a/dll/win32/t2embed/t2embed.rbuild b/dll/win32/t2embed/t2embed.rbuild new file mode 100644 index 00000000000..86709f67ea9 --- /dev/null +++ b/dll/win32/t2embed/t2embed.rbuild @@ -0,0 +1,14 @@ + + + + + . + include/reactos/wine + gdi32 + user32 + advapi32 + version + wine + t2embed.c + t2embed.rc + diff --git a/dll/win32/tapi32/tapi32.rbuild b/dll/win32/tapi32/tapi32.rbuild new file mode 100644 index 00000000000..cbbffb5d249 --- /dev/null +++ b/dll/win32/tapi32/tapi32.rbuild @@ -0,0 +1,17 @@ + + + + + + . + include/reactos/wine + + assisted.c + internal.c + line.c + phone.c + wine + advapi32 + ntdll + + diff --git a/dll/win32/tapiui/tapiui.rbuild b/dll/win32/tapiui/tapiui.rbuild new file mode 100644 index 00000000000..471441bec98 --- /dev/null +++ b/dll/win32/tapiui/tapiui.rbuild @@ -0,0 +1,4 @@ + + . + tapiui.rc + diff --git a/dll/win32/traffic/traffic.rbuild b/dll/win32/traffic/traffic.rbuild new file mode 100644 index 00000000000..fc72cd55aea --- /dev/null +++ b/dll/win32/traffic/traffic.rbuild @@ -0,0 +1,9 @@ + + + . + include/reactos/wine + + traffic_main.c + wine + ntdll + diff --git a/dll/win32/twain_32/twain_32.rbuild b/dll/win32/twain_32/twain_32.rbuild new file mode 100644 index 00000000000..cbcc5fedaeb --- /dev/null +++ b/dll/win32/twain_32/twain_32.rbuild @@ -0,0 +1,13 @@ + + + . + wine + ntdll + capability.c + ds_audio.c + ds_ctrl.c + ds_image.c + dsm_ctrl.c + twain32_main.c + twain_32.rc + diff --git a/dll/win32/uext2/uext2.rbuild b/dll/win32/uext2/uext2.rbuild new file mode 100644 index 00000000000..69e5f873084 --- /dev/null +++ b/dll/win32/uext2/uext2.rbuild @@ -0,0 +1,8 @@ + + + . + ext2lib + ntdll + uext2.c + uext2.rc + diff --git a/dll/win32/ufat/ufat.rbuild b/dll/win32/ufat/ufat.rbuild new file mode 100644 index 00000000000..69201c9f1a0 --- /dev/null +++ b/dll/win32/ufat/ufat.rbuild @@ -0,0 +1,8 @@ + + + . + vfatlib + ntdll + ufat.c + ufat.rc + diff --git a/dll/win32/ufatx/ufatx.rbuild b/dll/win32/ufatx/ufatx.rbuild new file mode 100644 index 00000000000..bde1b6b4ad8 --- /dev/null +++ b/dll/win32/ufatx/ufatx.rbuild @@ -0,0 +1,7 @@ + + + . + vfatxlib + ntdll + ufatx.rc + diff --git a/dll/win32/untfs/untfs.rbuild b/dll/win32/untfs/untfs.rbuild new file mode 100644 index 00000000000..43e56ae96ce --- /dev/null +++ b/dll/win32/untfs/untfs.rbuild @@ -0,0 +1,8 @@ + + + . + ntfslib + ntdll + untfs.c + untfs.rc + diff --git a/dll/win32/updspapi/updspapi.rbuild b/dll/win32/updspapi/updspapi.rbuild new file mode 100644 index 00000000000..5b2ea9defee --- /dev/null +++ b/dll/win32/updspapi/updspapi.rbuild @@ -0,0 +1,10 @@ + + + . + include/reactos/wine + + main.c + wine + setupapi + ntdll + diff --git a/dll/win32/url/url.rbuild b/dll/win32/url/url.rbuild new file mode 100644 index 00000000000..049ffad9765 --- /dev/null +++ b/dll/win32/url/url.rbuild @@ -0,0 +1,11 @@ + + + . + include/reactos/wine + + url_main.c + wine + shell32 + shlwapi + ntdll + diff --git a/dll/win32/urlmon/urlmon.rbuild b/dll/win32/urlmon/urlmon.rbuild new file mode 100644 index 00000000000..c8586894868 --- /dev/null +++ b/dll/win32/urlmon/urlmon.rbuild @@ -0,0 +1,56 @@ + + + + + + + . + include/reactos/wine + + 0x600 + bindctx.c + binding.c + bindprot.c + download.c + file.c + format.c + ftp.c + gopher.c + http.c + internet.c + mimefilter.c + mk.c + protocol.c + protproxy.c + sec_mgr.c + session.c + umon.c + umstream.c + uri.c + urlmon_main.c + usrmarshal.c + rsrc.rc + wine + uuid + rpcrt4 + ole32 + oleaut32 + shlwapi + shell32 + wininet + user32 + advapi32 + pseh + urlmon_proxy + ntdll + + + + URLMON_ + + + + "{0x79EAC9F1,0xBAF9,0x11CE,{0x8C,0x82,0x00,0xAA,0x00,0x4B,0xA9,0x0B}}" + urlmon_urlmon.idl + + diff --git a/dll/win32/user32/user32.pspec b/dll/win32/user32/user32.pspec new file mode 100644 index 00000000000..85c9e194ba9 --- /dev/null +++ b/dll/win32/user32/user32.pspec @@ -0,0 +1,787 @@ +; Functions exported by Win 2K3 R2 +@ stdcall ActivateKeyboardLayout(long long) NtUserActivateKeyboardLayout +@ stdcall AdjustWindowRect(ptr long long) +@ stdcall AdjustWindowRectEx(ptr long long long) +@ stdcall AlignRects(ptr long long long) +@ stdcall AllowForegroundActivation() +@ stdcall AllowSetForegroundWindow(long) +@ stdcall AnimateWindow(long long long) +@ stdcall AnyPopup() +@ stdcall AppendMenuA(long long long ptr) +@ stdcall AppendMenuW(long long long ptr) +@ stdcall ArrangeIconicWindows(long) +@ stdcall AttachThreadInput(long long long) NtUserAttachThreadInput +@ stdcall BeginDeferWindowPos(long) +@ stdcall BeginPaint(long ptr) NtUserBeginPaint +@ stdcall BlockInput(long) NtUserBlockInput +@ stdcall BringWindowToTop(long) +@ stdcall BroadcastSystemMessage(long ptr long long long) BroadcastSystemMessageA +@ stdcall BroadcastSystemMessageA(long ptr long long long) +@ stdcall BroadcastSystemMessageExA(long ptr long long long ptr) +@ stdcall BroadcastSystemMessageExW(long ptr long long long ptr) +@ stdcall BroadcastSystemMessageW(long ptr long long long) +@ stub BuildReasonArray +@ stub CalcMenuBar +@ stdcall CallMsgFilter(ptr long) CallMsgFilterA +@ stdcall CallMsgFilterA(ptr long) +@ stdcall CallMsgFilterW(ptr long) +@ stdcall CallNextHookEx(long long long long) +@ stdcall CallWindowProcA(ptr long long long long) +@ stdcall CallWindowProcW(ptr long long long long) +@ stdcall CascadeChildWindows(long long) +@ stdcall CascadeWindows(long long ptr long ptr) +@ stdcall ChangeClipboardChain(long long) NtUserChangeClipboardChain +@ stdcall ChangeDisplaySettingsA(ptr long) +@ stdcall ChangeDisplaySettingsExA(str ptr long long ptr) +@ stdcall ChangeDisplaySettingsExW(wstr ptr long long ptr) +@ stdcall ChangeDisplaySettingsW(ptr long) +@ stdcall ChangeMenuA(long long ptr long long) +@ stdcall ChangeMenuW(long long ptr long long) +@ stdcall CharLowerA(str) +@ stdcall CharLowerBuffA(str long) +@ stdcall CharLowerBuffW(wstr long) +@ stdcall CharLowerW(wstr) +@ stdcall CharNextA(str) +@ stdcall CharNextExA(long str long) +@ stdcall CharNextW(wstr) +@ stdcall CharPrevA(str str) +@ stdcall CharPrevExA(long str str long) +@ stdcall CharPrevW(wstr wstr) +@ stdcall CharToOemA(str ptr) +@ stdcall CharToOemBuffA(str ptr long) +@ stdcall CharToOemBuffW(wstr ptr long) +@ stdcall CharToOemW(wstr ptr) +@ stdcall CharUpperA(str) +@ stdcall CharUpperBuffA(str long) +@ stdcall CharUpperBuffW(wstr long) +@ stdcall CharUpperW(wstr) +@ stdcall CheckDlgButton(long long long) +@ stdcall CheckMenuItem(long long long) +@ stdcall CheckMenuRadioItem(long long long long long) +@ stdcall CheckRadioButton(long long long long) +@ stdcall ChildWindowFromPoint(long double) +@ stdcall ChildWindowFromPointEx(long double long) ; Direct call NtUserChildWindowFromPointEx +@ stdcall CliImmSetHotKey(long long long ptr) +@ stdcall ClientThreadSetup() +@ stdcall ClientToScreen(long ptr) +@ stdcall ClipCursor(ptr) NtUserClipCursor +@ stdcall CloseClipboard() NtUserCloseClipboard +@ stdcall CloseDesktop(long) NtUserCloseDesktop +@ stdcall CloseWindow(long) +@ stdcall CloseWindowStation(long) NtUserCloseWindowStation +@ stdcall CopyAcceleratorTableA(long ptr long) +@ stdcall CopyAcceleratorTableW(long ptr long) NtUserCopyAcceleratorTable +@ stdcall CopyIcon(long) +@ stdcall CopyImage(long long long long long) +@ stdcall CopyRect(ptr ptr) +@ stdcall CountClipboardFormats() NtUserCountClipboardFormats +@ stdcall CreateAcceleratorTableA(ptr long) +@ stdcall CreateAcceleratorTableW(ptr long) NtUserCreateAcceleratorTable +@ stdcall CreateCaret(long long long long) NtUserCreateCaret +@ stdcall CreateCursor(long long long long long ptr ptr) +@ stdcall CreateDesktopA(str str ptr long long ptr) +@ stdcall CreateDesktopW(wstr wstr ptr long long ptr) +@ stdcall CreateDialogIndirectParamA(long ptr long ptr long) +@ stdcall CreateDialogIndirectParamAorW(long ptr long ptr long long) +@ stdcall CreateDialogIndirectParamW(long ptr long ptr long) +@ stdcall CreateDialogParamA(long ptr long ptr long) +@ stdcall CreateDialogParamW(long ptr long ptr long) +@ stdcall CreateIcon(long long long long long ptr ptr) +@ stdcall CreateIconFromResource (ptr long long long) +@ stdcall CreateIconFromResourceEx(ptr long long long long long long) +@ stdcall CreateIconIndirect(ptr) +@ stdcall CreateMDIWindowA(ptr ptr long long long long long long long long) +@ stdcall CreateMDIWindowW(ptr ptr long long long long long long long long) +@ stdcall CreateMenu() +@ stdcall CreatePopupMenu() +@ stub CreateSystemThreads +@ stdcall CreateWindowExA(long str str long long long long long long long long ptr) +@ stdcall CreateWindowExW(long wstr wstr long long long long long long long long ptr) +@ stdcall CreateWindowStationA(str long long ptr) +@ stdcall CreateWindowStationW(wstr long long ptr) +@ stdcall CsrBroadcastSystemMessageExW(long ptr long long long ptr) +@ stdcall CtxInitUser32() +@ stdcall DdeAbandonTransaction(long long long) +@ stdcall DdeAccessData(long ptr) +@ stdcall DdeAddData(long ptr long long) +@ stdcall DdeClientTransaction(ptr long long long long long long ptr) +@ stdcall DdeCmpStringHandles(long long) +@ stdcall DdeConnect(long long long ptr) +@ stdcall DdeConnectList(long long long long ptr) +@ stdcall DdeCreateDataHandle(long ptr long long long long long) +@ stdcall DdeCreateStringHandleA(long str long) +@ stdcall DdeCreateStringHandleW(long wstr long) +@ stdcall DdeDisconnect(long) +@ stdcall DdeDisconnectList(long) +@ stdcall DdeEnableCallback(long long long) +@ stdcall DdeFreeDataHandle(long) +@ stdcall DdeFreeStringHandle(long long) +@ stdcall DdeGetData(long ptr long long) +@ stdcall DdeGetLastError(long) +@ stdcall DdeGetQualityOfService(long long ptr) ; Direct call NtUserDdeGetQualityOfService +@ stdcall DdeImpersonateClient(long) +@ stdcall DdeInitializeA(ptr ptr long long) +@ stdcall DdeInitializeW(ptr ptr long long) +@ stdcall DdeKeepStringHandle(long long) +@ stdcall DdeNameService(long long long long) +@ stdcall DdePostAdvise(long long long) +@ stdcall DdeQueryConvInfo(long long ptr) +@ stdcall DdeQueryNextServer(long long) +@ stdcall DdeQueryStringA(long long ptr long long) +@ stdcall DdeQueryStringW(long long ptr long long) +@ stdcall DdeReconnect(long) +@ stdcall DdeSetQualityOfService(long ptr ptr) ; Direct call NtUserDdeSetQualityOfService +@ stdcall DdeSetUserHandle (long long long) +@ stdcall DdeUnaccessData(long) +@ stdcall DdeUninitialize(long) +@ stdcall DefDlgProcA(long long long long) +@ stdcall DefDlgProcW(long long long long) +@ stdcall DefFrameProcA(long long long long long) +@ stdcall DefFrameProcW(long long long long long) +@ stdcall DefMDIChildProcA(long long long long) +@ stdcall DefMDIChildProcW(long long long long) +@ stdcall DefRawInputProc(ptr long long) +@ stdcall DefWindowProcA(long long long long) +@ stdcall DefWindowProcW(long long long long) +@ stdcall DeferWindowPos(long long long long long long long long) ; Direct call NtUserDeferWindowPos +@ stdcall DeleteMenu(long long long) NtUserDeleteMenu +@ stdcall DeregisterShellHookWindow (long) +@ stdcall DestroyAcceleratorTable(long) +@ stdcall DestroyCaret() +@ stdcall DestroyCursor(long) +@ stdcall DestroyIcon(long) +@ stdcall DestroyMenu(long) NtUserDestroyMenu +@ stub DestroyReasons +@ stdcall DestroyWindow(long) NtUserDestroyWindow +@ stub DeviceEventWorker +@ stdcall DialogBoxIndirectParamA(long ptr long ptr long) +@ stdcall DialogBoxIndirectParamAorW(long ptr long ptr long long) +@ stdcall DialogBoxIndirectParamW(long ptr long ptr long) +@ stdcall DialogBoxParamA(long str long ptr long) +@ stdcall DialogBoxParamW(long wstr long ptr long) +@ stdcall DisableProcessWindowsGhosting() +@ stdcall DispatchMessageA(ptr) +@ stdcall DispatchMessageW(ptr) +@ stdcall DisplayExitWindowsWarnings(long) +@ stdcall DlgDirListA(long str long long long) +@ stdcall DlgDirListComboBoxA(long ptr long long long) +@ stdcall DlgDirListComboBoxW(long ptr long long long) +@ stdcall DlgDirListW(long wstr long long long) +@ stdcall DlgDirSelectComboBoxExA(long ptr long long) +@ stdcall DlgDirSelectComboBoxExW(long ptr long long) +@ stdcall DlgDirSelectExA(long ptr long long) +@ stdcall DlgDirSelectExW(long ptr long long) +@ stdcall DragDetect(long double) ; Direct call NtUserDragDetect +@ stdcall DragObject(long long long long long) NtUserDragObject +@ stdcall DrawAnimatedRects(long long ptr ptr) NtUserDrawAnimatedRects +@ stdcall DrawCaption(long long ptr long) +@ stdcall DrawCaptionTempA(long long ptr long long str long) +@ stdcall DrawCaptionTempW(long long ptr long long wstr long) +@ stdcall DrawEdge(long ptr long long) +@ stdcall DrawFocusRect(long ptr) +@ stdcall DrawFrame(long ptr long long) +@ stdcall DrawFrameControl(long ptr long long) +@ stdcall DrawIcon(long long long long) +@ stdcall DrawIconEx(long long long long long long long long long) +@ stdcall DrawMenuBar(long) +@ stdcall DrawMenuBarTemp(long long long long long) +@ stdcall DrawStateA(long long ptr long long long long long long long) +@ stdcall DrawStateW(long long ptr long long long long long long long) +@ stdcall DrawTextA(long str long ptr long) +@ stdcall DrawTextExA(long str long ptr long ptr) +@ stdcall DrawTextExW(long wstr long ptr long ptr) +@ stdcall DrawTextW(long wstr long ptr long) +@ stdcall EditWndProc(long long long long) EditWndProcA +@ stdcall EmptyClipboard() NtUserEmptyClipboard +@ stdcall EnableMenuItem(long long long) +@ stdcall EnableScrollBar(long long long) +@ stdcall EnableWindow(long long) +@ stdcall EndDeferWindowPos(long) +@ stdcall EndDialog(long long) +@ stdcall EndMenu() +@ stdcall EndPaint(long ptr) NtUserEndPaint +@ stdcall EndTask(ptr long long) +@ stub EnterReaderModeHelper +@ stdcall EnumChildWindows(long ptr long) +@ stdcall EnumClipboardFormats(long) +@ stdcall EnumDesktopWindows(long ptr ptr) +@ stdcall EnumDesktopsA(ptr ptr long) +@ stdcall EnumDesktopsW(ptr ptr long) +@ stdcall EnumDisplayDevicesA(ptr long ptr long) +@ stdcall EnumDisplayDevicesW(ptr long ptr long) +@ stdcall EnumDisplayMonitors(long ptr ptr long) ; Direct call NtUserEnumDisplayMonitors +@ stdcall EnumDisplaySettingsA(str long ptr) +@ stdcall EnumDisplaySettingsExA(str long ptr long) +@ stdcall EnumDisplaySettingsExW(wstr long ptr long) +@ stdcall EnumDisplaySettingsW(wstr long ptr ) +@ stdcall EnumPropsA(long ptr) +@ stdcall EnumPropsExA(long ptr long) +@ stdcall EnumPropsExW(long ptr long) +@ stdcall EnumPropsW(long ptr) +@ stdcall EnumThreadWindows(long ptr long) +@ stdcall EnumWindowStationsA(ptr long) +@ stdcall EnumWindowStationsW(ptr long) +@ stdcall EnumWindows(ptr long) +@ stdcall EqualRect(ptr ptr) +@ stdcall ExcludeUpdateRgn(long long) NtUserExcludeUpdateRgn +@ stdcall ExitWindowsEx(long long) +@ stdcall FillRect(long ptr long) +@ stdcall FindWindowA(str str) +@ stdcall FindWindowExA(long long str str) +@ stdcall FindWindowExW(long long wstr wstr) +@ stdcall FindWindowW(wstr wstr) +@ stdcall FlashWindow(long long) +@ stdcall FlashWindowEx(ptr) NtUserFlashWindowEx +@ stdcall FrameRect(long ptr long) +@ stdcall FreeDDElParam(long long) +@ stdcall GetActiveWindow() +@ stdcall GetAltTabInfo(long long ptr ptr long) GetAltTabInfoA +@ stdcall GetAltTabInfoA(long long ptr ptr long) +@ stdcall GetAltTabInfoW(long long ptr ptr long) +@ stdcall GetAncestor(long long) ; Direct call NtUserGetAncestor +@ stdcall GetAppCompatFlags(long) +@ stdcall GetAppCompatFlags2(long) +@ stdcall GetAsyncKeyState(long) +@ stdcall GetCapture() +@ stdcall GetCaretBlinkTime() NtUserGetCaretBlinkTime +@ stdcall GetCaretPos(ptr) NtUserGetCaretPos +@ stdcall GetClassInfoA(long str ptr) +@ stdcall GetClassInfoExA(long str ptr) +@ stdcall GetClassInfoExW(long wstr ptr) +@ stdcall GetClassInfoW(long wstr ptr) +@ stdcall GetClassLongA(long long) +#ifdef _WIN64 +@ stdcall GetClassLongPtrA(ptr long) +@ stdcall GetClassLongPtrW(ptr long) +#endif +@ stdcall GetClassLongW(long long) +@ stdcall GetClassNameA(long ptr long) +@ stdcall GetClassNameW(long ptr long) +@ stdcall GetClassWord(long long) +@ stdcall GetClientRect(long long) +@ stdcall GetClipCursor(ptr) NtUserGetClipCursor +@ stdcall GetClipboardData(long) +@ stdcall GetClipboardFormatNameA(long ptr long) +@ stdcall GetClipboardFormatNameW(long ptr long) +@ stdcall GetClipboardOwner() NtUserGetClipboardOwner +@ stdcall GetClipboardSequenceNumber() NtUserGetClipboardSequenceNumber +@ stdcall GetClipboardViewer() NtUserGetClipboardViewer +@ stdcall GetComboBoxInfo(long ptr) ; Direct call NtUserGetComboBoxInfo +@ stdcall GetCursor() +@ stub GetCursorFrameInfo +@ stdcall GetCursorInfo(ptr) NtUserGetCursorInfo +@ stdcall GetCursorPos(ptr) +@ stdcall GetDC(long) NtUserGetDC +@ stdcall GetDCEx(long long long) NtUserGetDCEx +@ stdcall GetDesktopWindow() +@ stdcall GetDialogBaseUnits() +@ stdcall GetDlgCtrlID(long) +@ stdcall GetDlgItem(long long) +@ stdcall GetDlgItemInt(long long ptr long) +@ stdcall GetDlgItemTextA(long long ptr long) +@ stdcall GetDlgItemTextW(long long ptr long) +@ stdcall GetDoubleClickTime() NtUserGetDoubleClickTime +@ stdcall GetFocus() +@ stdcall GetForegroundWindow() NtUserGetForegroundWindow +@ stdcall GetGUIThreadInfo(long ptr) NtUserGetGUIThreadInfo +@ stdcall GetGuiResources(long long) NtUserGetGuiResources +@ stdcall GetIconInfo(long ptr) +@ stdcall GetInputDesktop() +@ stdcall GetInputState() +@ stdcall GetInternalWindowPos(long ptr ptr) ; direct call NtUserGetInternalWindowPos +@ stdcall GetKBCodePage() +@ stdcall GetKeyNameTextA(long ptr long) +@ stdcall GetKeyNameTextW(long ptr long) +@ stdcall GetKeyState(long) +@ stdcall GetKeyboardLayout(long) +@ stdcall GetKeyboardLayoutList(long ptr) NtUserGetKeyboardLayoutList +@ stdcall GetKeyboardLayoutNameA(ptr) +@ stdcall GetKeyboardLayoutNameW(ptr) +@ stdcall GetKeyboardState(ptr) NtUserGetKeyboardState +@ stdcall GetKeyboardType(long) +@ stdcall GetLastActivePopup(long) +@ stdcall GetLastInputInfo(ptr) +@ stdcall GetLayeredWindowAttributes(long ptr ptr ptr) NtUserGetLayeredWindowAttributes +@ stdcall GetListBoxInfo(long) NtUserGetListBoxInfo +@ stdcall GetMenu(long) +@ stdcall GetMenuBarInfo(long long long ptr) NtUserGetMenuBarInfo +@ stdcall GetMenuCheckMarkDimensions() +@ stdcall GetMenuContextHelpId(long) +@ stdcall GetMenuDefaultItem(long long long) +@ stdcall GetMenuInfo(long ptr) +@ stdcall GetMenuItemCount(long) +@ stdcall GetMenuItemID(long long) +@ stdcall GetMenuItemInfoA(long long long ptr) +@ stdcall GetMenuItemInfoW(long long long ptr) +@ stdcall GetMenuItemRect(long long long ptr) NtUserGetMenuItemRect +@ stdcall GetMenuState(long long long) +@ stdcall GetMenuStringA(long long ptr long long) +@ stdcall GetMenuStringW(long long ptr long long) +@ stdcall GetMessageA(ptr long long long) +@ stdcall GetMessageExtraInfo() +@ stdcall GetMessagePos() +@ stdcall GetMessageTime() +@ stdcall GetMessageW(ptr long long long) +@ stdcall GetMonitorInfoA(long ptr) +@ stdcall GetMonitorInfoW(long ptr) +@ stdcall GetMouseMovePointsEx(long ptr ptr long long) NtUserGetMouseMovePointsEx +@ stdcall GetNextDlgGroupItem(long long long) +@ stdcall GetNextDlgTabItem(long long long) +@ stdcall GetOpenClipboardWindow() NtUserGetOpenClipboardWindow +@ stdcall GetParent(long) +@ stdcall GetPriorityClipboardFormat(ptr long) NtUserGetPriorityClipboardFormat +@ stdcall GetProcessDefaultLayout(ptr) +@ stdcall GetProcessWindowStation() NtUserGetProcessWindowStation +@ stdcall GetProgmanWindow () +@ stdcall GetPropA(long str) +@ stdcall GetPropW(long wstr) +@ stdcall GetQueueStatus(long) +@ stdcall GetRawInputBuffer(ptr ptr long) +@ stdcall GetRawInputData(ptr long ptr ptr long) +@ stdcall GetRawInputDeviceInfoA(ptr long ptr ptr) +@ stdcall GetRawInputDeviceInfoW(ptr long ptr ptr) +@ stdcall GetRawInputDeviceList(ptr ptr long) +@ stub GetReasonTitleFromReasonCode +@ stdcall GetRegisteredRawInputDevices(ptr ptr long) +@ stdcall GetScrollBarInfo(long long ptr) NtUserGetScrollBarInfo +@ stdcall GetScrollInfo(long long ptr) +@ stdcall GetScrollPos(long long) +@ stdcall GetScrollRange(long long ptr ptr) +@ stdcall GetShellWindow() +@ stdcall GetSubMenu(long long) +@ stdcall GetSysColor(long) +@ stdcall GetSysColorBrush(long) +@ stdcall GetSystemMenu(long long) ; Direct call NtUserGetSystemMenu +@ stdcall GetSystemMetrics(long) +@ stdcall GetTabbedTextExtentA(long str long long ptr) +@ stdcall GetTabbedTextExtentW(long wstr long long ptr) +@ stdcall GetTaskmanWindow () +@ stdcall GetThreadDesktop(long) +@ stdcall GetTitleBarInfo(long ptr) NtUserGetTitleBarInfo +@ stdcall GetTopWindow(long) +@ stdcall GetUpdateRect(long ptr long) +@ stdcall GetUpdateRgn(long long long) +@ stdcall GetUserObjectInformationA(long long ptr long ptr) +@ stdcall GetUserObjectInformationW(long long ptr long ptr) NtUserGetObjectInformation +@ stdcall GetUserObjectSecurity (long ptr ptr long ptr) +; @ stub GetWinStationInfo +@ stdcall GetWindow(long long) +@ stdcall GetWindowContextHelpId(long) +@ stdcall GetWindowDC(long) NtUserGetWindowDC +@ stdcall GetWindowInfo(long ptr) +@ stdcall GetWindowLongA(long long) +#ifdef _WIN64 +@ stdcall GetWindowLongPtrA(ptr long) +@ stdcall GetWindowLongPtrW(ptr long) +#endif +@ stdcall GetWindowLongW(long long) +@ stdcall GetWindowModuleFileName(long ptr long) GetWindowModuleFileNameA +@ stdcall GetWindowModuleFileNameA(long ptr long) +@ stdcall GetWindowModuleFileNameW(long ptr long) +@ stdcall GetWindowPlacement(long ptr) NtUserGetWindowPlacement +@ stdcall GetWindowRect(long ptr) +@ stdcall GetWindowRgn(long long) +@ stdcall GetWindowRgnBox(long ptr) +@ stdcall GetWindowTextA(long ptr long) +@ stdcall GetWindowTextLengthA(long) +@ stdcall GetWindowTextLengthW(long) +@ stdcall GetWindowTextW(long ptr long) +@ stdcall GetWindowThreadProcessId(long ptr) +@ stdcall GetWindowWord(long long) +@ stdcall GrayStringA(long long ptr long long long long long long) +@ stdcall GrayStringW(long long ptr long long long long long long) +@ stdcall HideCaret(long) NtUserHideCaret +@ stdcall HiliteMenuItem(long long long long) NtUserHiliteMenuItem +@ stdcall IMPGetIMEA(long ptr) +@ stdcall IMPGetIMEW(long ptr) +@ stdcall IMPQueryIMEA(ptr) +@ stdcall IMPQueryIMEW(ptr) +@ stdcall IMPSetIMEA(long ptr) +@ stdcall IMPSetIMEW(long ptr) +@ stdcall ImpersonateDdeClientWindow(long long) ; Direct call NtUserImpersonateDdeClientWindow +@ stdcall InSendMessage() +@ stdcall InSendMessageEx(ptr) +@ stdcall InflateRect(ptr long long) +@ stdcall InitializeLpkHooks(ptr) +@ stub InitializeWin32EntryTable +@ stdcall InsertMenuA(long long long long ptr) +@ stdcall InsertMenuItemA(long long long ptr) +@ stdcall InsertMenuItemW(long long long ptr) +@ stdcall InsertMenuW(long long long long ptr) +@ stdcall InternalGetWindowText(long long long) +@ stdcall IntersectRect(ptr ptr ptr) +@ stdcall InvalidateRect(long ptr long) NtUserInvalidateRect +@ stdcall InvalidateRgn(long long long) NtUserInvalidateRgn +@ stdcall InvertRect(long ptr) +@ stdcall IsCharAlphaA(long) +@ stdcall IsCharAlphaNumericA(long) +@ stdcall IsCharAlphaNumericW(long) +@ stdcall IsCharAlphaW(long) +@ stdcall IsCharLowerA(long) +@ stdcall IsCharLowerW(long) +@ stdcall IsCharUpperA(long) +@ stdcall IsCharUpperW(long) +@ stdcall IsChild(long long) +@ stdcall IsClipboardFormatAvailable(long) NtUserIsClipboardFormatAvailable +@ stdcall IsDialogMessage(long ptr) IsDialogMessageA +@ stdcall IsDialogMessageA(long ptr) +@ stdcall IsDialogMessageW(long ptr) +@ stdcall IsDlgButtonChecked(long long) +@ stdcall IsGUIThread(long) +@ stdcall IsHungAppWindow(long) +@ stdcall IsIconic(long) +@ stdcall IsMenu(long) +@ stub IsProcess16Bit +@ stdcall IsRectEmpty(ptr) +@ stub IsSETEnabled +@ stdcall IsServerSideWindow(long) +@ stdcall IsWinEventHookInstalled(long) +@ stdcall IsWindow(long) +@ stdcall IsWindowEnabled(long) +@ stdcall IsWindowInDestroy(long) +@ stdcall IsWindowUnicode(long) +@ stdcall IsWindowVisible(long) +@ stub IsWow64Message +@ stdcall IsZoomed(long) +@ stdcall KillSystemTimer(long long) +@ stdcall KillTimer(long long) NtUserKillTimer +@ stdcall LoadAcceleratorsA(long str) +@ stdcall LoadAcceleratorsW(long wstr) +@ stdcall LoadBitmapA(long str) +@ stdcall LoadBitmapW(long wstr) +@ stdcall LoadCursorA(long str) +@ stdcall LoadCursorFromFileA(str) +@ stdcall LoadCursorFromFileW(wstr) +@ stdcall LoadCursorW(long wstr) +@ stdcall LoadIconA(long str) +@ stdcall LoadIconW(long wstr) +@ stdcall LoadImageA(long str long long long long) +@ stdcall LoadImageW(long wstr long long long long) +@ stdcall LoadKeyboardLayoutA(str long) +@ stub LoadKeyboardLayoutEx +@ stdcall LoadKeyboardLayoutW(wstr long) +@ stdcall LoadLocalFonts() +@ stdcall LoadMenuA(long str) +@ stdcall LoadMenuIndirectA(ptr) +@ stdcall LoadMenuIndirectW(ptr) +@ stdcall LoadMenuW(long wstr) +@ stdcall LoadRemoteFonts() +@ stdcall LoadStringA(long long ptr long) +@ stdcall LoadStringW(long long ptr long) +@ stdcall LockSetForegroundWindow (long) +@ stdcall LockWindowStation(long) NtUserLockWindowStation +@ stdcall LockWindowUpdate(long) NtUserLockWindowUpdate +@ stdcall LockWorkStation() NtUserLockWorkStation +@ stdcall LookupIconIdFromDirectory(ptr long) +@ stdcall LookupIconIdFromDirectoryEx(ptr long long long long) +@ stdcall MBToWCSEx(long str long wstr long long) +@ stdcall MB_GetString(ptr) +@ stdcall MapDialogRect(long ptr) +@ stdcall MapVirtualKeyA(long long) +@ stdcall MapVirtualKeyExA(long long long) +@ stdcall MapVirtualKeyExW(long long long) +@ stdcall MapVirtualKeyW(long long) +@ stdcall MapWindowPoints(long long ptr long) +@ stdcall MenuItemFromPoint(long long double) ; Direct call NtUserMenuItemFromPoint +@ stdcall MenuWindowProcA (long ptr long long long) +@ stdcall MenuWindowProcW (long ptr long long long) +@ stdcall MessageBeep(long) +@ stdcall MessageBoxA(long str str long) +@ stdcall MessageBoxExA(long str str long long) +@ stdcall MessageBoxExW(long wstr wstr long long) +@ stdcall MessageBoxIndirectA(ptr) +@ stdcall MessageBoxIndirectW(ptr) +@ stub MessageBoxTimeoutA +@ stub MessageBoxTimeoutW +@ stdcall MessageBoxW(long wstr wstr long) +@ stdcall ModifyMenuA(long long long long ptr) +@ stdcall ModifyMenuW(long long long long ptr) +@ stdcall MonitorFromPoint(double long) +@ stdcall MonitorFromRect(ptr long) +@ stdcall MonitorFromWindow(long long) +@ stdcall MoveWindow(long long long long long long) NtUserMoveWindow +@ stdcall MsgWaitForMultipleObjects(long ptr long long long) +@ stdcall MsgWaitForMultipleObjectsEx(long ptr long long long) +@ stdcall NotifyWinEvent(long long long long) +@ stdcall OemKeyScan(long) +@ stdcall OemToCharA(ptr ptr) +@ stdcall OemToCharBuffA(ptr ptr long) +@ stdcall OemToCharBuffW(ptr ptr long) +@ stdcall OemToCharW(ptr ptr) +@ stdcall OffsetRect(ptr long long) +@ stdcall OpenClipboard(long) +@ stdcall OpenDesktopA(str long long long) +@ stdcall OpenDesktopW(wstr long long long) +@ stdcall OpenIcon(long) +@ stdcall OpenInputDesktop(long long long) NtUserOpenInputDesktop +@ stdcall OpenWindowStationA(str long long) +@ stdcall OpenWindowStationW(wstr long long) +@ stdcall PackDDElParam(long long long) +@ stdcall PaintDesktop(long) NtUserPaintDesktop +@ stub PaintMenuBar +@ stdcall PeekMessageA(ptr long long long long) +@ stdcall PeekMessageW(ptr long long long long) +@ stdcall PostMessageA(long long long long) +@ stdcall PostMessageW(long long long long) +@ stdcall PostQuitMessage(long) +@ stdcall PostThreadMessageA(long long long long) +@ stdcall PostThreadMessageW(long long long long) +@ stdcall PrintWindow(ptr ptr long) NtUserPrintWindow +@ stdcall PrivateExtractIconExA(str long ptr ptr long) +@ stdcall PrivateExtractIconExW(wstr long ptr ptr long) +@ stdcall PrivateExtractIconsA(str long long long ptr ptr long long) +@ stdcall PrivateExtractIconsW(wstr long long long ptr ptr long long) +@ stdcall PtInRect(ptr double) +@ stdcall QuerySendMessage(ptr) NtUserQuerySendMessage +@ stdcall RealChildWindowFromPoint(long double) ; Direct call NtUserRealChildWindowFromPoint +@ stdcall RealGetWindowClass(long ptr long) RealGetWindowClassA +@ stdcall RealGetWindowClassA(long ptr long) +@ stdcall RealGetWindowClassW(long ptr long) +@ stub ReasonCodeNeedsBugID +@ stub ReasonCodeNeedsComment +@ stub RecordShutdownReason +@ stdcall RedrawWindow(long ptr long long) NtUserRedrawWindow +@ stdcall RegisterClassA(ptr) +@ stdcall RegisterClassExA(ptr) +@ stdcall RegisterClassExW(ptr) +@ stdcall RegisterClassW(ptr) +@ stdcall RegisterClipboardFormatA(str) +@ stdcall RegisterClipboardFormatW(wstr) +@ stdcall RegisterDeviceNotificationA(long ptr long) RegisterDeviceNotificationW +@ stdcall RegisterDeviceNotificationW(long ptr long) +@ stdcall RegisterHotKey(long long long long) NtUserRegisterHotKey +@ stdcall RegisterLogonProcess(long long) +@ stub RegisterMessagePumpHook +@ stdcall RegisterRawInputDevices(ptr long long) +@ stdcall RegisterServicesProcess(long) +@ stdcall RegisterShellHookWindow(long) +@ stdcall RegisterSystemThread(long long) +@ stdcall RegisterTasklist(long) NtUserRegisterTasklist +@ stdcall RegisterUserApiHook(ptr) +@ stdcall RegisterWindowMessageA(str) +@ stdcall RegisterWindowMessageW(wstr) +@ stdcall ReleaseCapture() +@ stdcall ReleaseDC(long long) +@ stdcall RemoveMenu(long long long) NtUserRemoveMenu +@ stdcall RemovePropA(long str) +@ stdcall RemovePropW(long wstr) +@ stdcall ReplyMessage(long) +; @ stub ResolveDesktopForWOW +@ stdcall ReuseDDElParam(long long long long long) +@ stdcall ScreenToClient(long ptr) +@ stdcall ScrollChildren(long long long long) +@ stdcall ScrollDC(long long long ptr ptr long ptr) +@ stdcall ScrollWindow(long long long ptr ptr) +@ stdcall ScrollWindowEx(long long long ptr ptr long ptr long) +@ stdcall SendDlgItemMessageA(long long long long long) +@ stdcall SendDlgItemMessageW(long long long long long) +@ stdcall SendIMEMessageExA(long long) +@ stdcall SendIMEMessageExW(long long) +@ stdcall SendInput(long ptr long) NtUserSendInput +@ stdcall SendMessageA(long long long long) +@ stdcall SendMessageCallbackA(long long long long ptr long) +@ stdcall SendMessageCallbackW(long long long long ptr long) +@ stdcall SendMessageTimeoutA(long long long long long long ptr) +@ stdcall SendMessageTimeoutW(long long long long long long ptr) +@ stdcall SendMessageW(long long long long) +@ stdcall SendNotifyMessageA(long long long long) +@ stdcall SendNotifyMessageW(long long long long) +@ stdcall SetActiveWindow(long) NtUserSetActiveWindow +@ stdcall SetCapture(long) NtUserSetCapture +@ stdcall SetCaretBlinkTime(long) +@ stdcall SetCaretPos(long long) +@ stdcall SetClassLongA(long long long) +#ifdef _WIN64 +@ stdcall SetClassLongPtrA(ptr long ptr) +@ stdcall SetClassLongPtrW(ptr long ptr) +#endif +@ stdcall SetClassLongW(long long long) +@ stdcall SetClassWord(long long long) ; Direct call NtUserSetClassWord +@ stdcall SetClipboardData(long long) +@ stdcall SetClipboardViewer(long) NtUserSetClipboardViewer +@ stub SetConsoleReserveKeys +@ stdcall SetCursor(long) NtUserSetCursor +@ stdcall SetCursorContents(ptr ptr) NtUserSetCursorContents +@ stdcall SetCursorPos(long long) +@ stdcall SetDebugErrorLevel(long) +@ stdcall SetDeskWallpaper(ptr) +@ stdcall SetDlgItemInt(long long long long) +@ stdcall SetDlgItemTextA(long long str) +@ stdcall SetDlgItemTextW(long long wstr) +@ stdcall SetDoubleClickTime(long) +@ stdcall SetFocus(long) NtUserSetFocus +@ stdcall SetForegroundWindow(long) +@ stdcall SetInternalWindowPos(long long ptr ptr) NtUserSetInternalWindowPos +@ stdcall SetKeyboardState(ptr) NtUserSetKeyboardState +@ stdcall SetLastErrorEx(long long) +@ stdcall SetLayeredWindowAttributes(ptr long long long) NtUserSetLayeredWindowAttributes +@ stdcall SetLogonNotifyWindow(long long) ; Direct call NtUserSetLogonNotifyWindow +@ stdcall SetMenu(long long) +@ stdcall SetMenuContextHelpId(long long) NtUserSetMenuContextHelpId +@ stdcall SetMenuDefaultItem(long long long) NtUserSetMenuDefaultItem +@ stdcall SetMenuInfo(long ptr) +@ stdcall SetMenuItemBitmaps(long long long long long) +@ stdcall SetMenuItemInfoA(long long long ptr) +@ stdcall SetMenuItemInfoW(long long long ptr) +@ stdcall SetMessageExtraInfo(long) +@ stdcall SetMessageQueue(long) +@ stdcall SetParent(long long) NtUserSetParent +@ stdcall SetProcessDefaultLayout(long) +@ stdcall SetProcessWindowStation(long) NtUserSetProcessWindowStation +@ stdcall SetProgmanWindow (long) +@ stdcall SetPropA(long str long) +@ stdcall SetPropW(long wstr long) +@ stdcall SetRect(ptr long long long long) +@ stdcall SetRectEmpty(ptr) +@ stdcall SetScrollInfo(long long ptr long) ; Direct call NtUserSetScrollInfo +@ stdcall SetScrollPos(long long long long) +@ stdcall SetScrollRange(long long long long long) +@ stdcall SetShellWindow(long) +@ stdcall SetShellWindowEx(long long) NtUserSetShellWindowEx +@ stdcall SetSysColors(long ptr ptr) +@ stdcall SetSysColorsTemp(ptr ptr long) +@ stdcall SetSystemCursor(long long) +@ stdcall SetSystemMenu(long long) ; Direct call NtUserSetSystemMenu +@ stdcall SetSystemTimer(long long long ptr) NtUserSetSystemTimer +@ stdcall SetTaskmanWindow (long) +@ stdcall SetThreadDesktop(long) NtUserSetThreadDesktop +@ stdcall SetTimer(long long long ptr) NtUserSetTimer +@ stdcall SetUserObjectInformationA(long long ptr long) NtUserSetObjectInformation +@ stdcall SetUserObjectInformationW(long long ptr long) NtUserSetObjectInformation +@ stdcall SetUserObjectSecurity(long ptr ptr) +@ stdcall SetWinEventHook(long long long ptr long long long) +@ stdcall SetWindowContextHelpId(long long) +@ stdcall SetWindowLongA(long long long) +#ifdef _WIN64 +@ stdcall SetWindowLongPtrA(ptr long ptr) +@ stdcall SetWindowLongPtrW(ptr long ptr) +#endif +@ stdcall SetWindowLongW(long long long) +@ stdcall SetWindowPlacement(long ptr) NtUserSetWindowPlacement +@ stdcall SetWindowPos(long long long long long long long) NtUserSetWindowPos +@ stdcall SetWindowRgn(long long long) +@ stdcall SetWindowStationUser(long long long long) +@ stdcall SetWindowTextA(long str) +@ stdcall SetWindowTextW(long wstr) +@ stdcall SetWindowWord(long long long) ; Direct call NtUserSetWindowWord +@ stdcall SetWindowsHookA(long ptr) +@ stdcall SetWindowsHookExA(long long long long) +@ stdcall SetWindowsHookExW(long long long long) +@ stdcall SetWindowsHookW(long ptr) +@ stdcall ShowCaret(long) NtUserShowCaret +@ stdcall ShowCursor(long) +@ stdcall ShowOwnedPopups(long long) +@ stdcall ShowScrollBar(long long long) NtUserShowScrollBar +@ stdcall ShowStartGlass(long) +@ stdcall ShowWindow(long long) NtUserShowWindow +@ stdcall ShowWindowAsync(long long) NtUserShowWindowAsync +@ stub SoftModalMessageBox +@ stdcall SubtractRect(ptr ptr ptr) +@ stdcall SwapMouseButton(long) +@ stdcall SwitchDesktop(long) NtUserSwitchDesktop +@ stdcall SwitchToThisWindow(long long) +@ stdcall SystemParametersInfoA(long long ptr long) +@ stdcall SystemParametersInfoW(long long ptr long) +@ stdcall TabbedTextOutA(long long long str long long ptr long) +@ stdcall TabbedTextOutW(long long long wstr long long ptr long) +@ stdcall TileChildWindows(long long) +@ stdcall TileWindows(long long ptr long ptr) +@ stdcall ToAscii(long long ptr ptr long) +@ stdcall ToAsciiEx(long long ptr ptr long long) +@ stdcall ToUnicode(long long ptr ptr long long) +@ stdcall ToUnicodeEx(long long ptr ptr long long long) +@ stdcall TrackMouseEvent(ptr) NtUserTrackMouseEvent +@ stdcall TrackPopupMenu(long long long long long long ptr) +@ stdcall TrackPopupMenuEx(long long long long long ptr) ; Direct call NtUserTrackPopupMenuEx +@ stdcall TranslateAccelerator(long long ptr) TranslateAcceleratorA +@ stdcall TranslateAcceleratorA(long long ptr) +@ stdcall TranslateAcceleratorW(long long ptr) +@ stdcall TranslateMDISysAccel(long ptr) +@ stdcall TranslateMessage(ptr) +@ stub TranslateMessageEx +@ stdcall UnhookWinEvent(long) NtUserUnhookWinEvent +@ stdcall UnhookWindowsHook(long ptr) +@ stdcall UnhookWindowsHookEx(long) NtUserUnhookWindowsHookEx +@ stdcall UnionRect(ptr ptr ptr) +@ stdcall UnloadKeyboardLayout(long) NtUserUnloadKeyboardLayout +@ stdcall UnlockWindowStation(long) NtUserUnlockWindowStation +@ stdcall UnpackDDElParam(long long ptr ptr) +@ stdcall UnregisterClassA(str long) +@ stdcall UnregisterClassW(wstr long) +@ stdcall UnregisterDeviceNotification(long) +@ stdcall UnregisterHotKey(long long) NtUserUnregisterHotKey +@ stub UnregisterMessagePumpHook +@ stdcall UnregisterUserApiHook() NtUserUnregisterUserApiHook +@ stdcall UpdateLayeredWindow(long long ptr ptr long ptr long ptr long) +@ stdcall UpdateLayeredWindowIndirect(long ptr) +@ stdcall UpdatePerUserSystemParameters(long long) +@ stdcall UpdateWindow(long) +@ stdcall User32InitializeImmEntryTable(ptr) +@ stdcall UserClientDllInitialize(long long ptr) DllMain +@ stdcall UserHandleGrantAccess(ptr ptr long) NtUserUserHandleGrantAccess +@ stub UserLpkPSMTextOut +@ stub UserLpkTabbedTextOut +@ stdcall UserRealizePalette(long) +@ stdcall UserRegisterWowHandlers(ptr ptr) +@ stdcall ValidateRect(long ptr) NtUserValidateRect +@ stdcall ValidateRgn(long long) +@ stdcall VkKeyScanA(long) +@ stdcall VkKeyScanExA(long long) +@ stdcall VkKeyScanExW(long long) +@ stdcall VkKeyScanW(long) +@ stdcall WCSToMBEx(long wstr long str long long) +@ stdcall WINNLSEnableIME(long long) +@ stdcall WINNLSGetEnableStatus(long) +@ stdcall WINNLSGetIMEHotkey(long) +@ stdcall WaitForInputIdle(long long) +@ stdcall WaitMessage() NtUserWaitMessage +@ stub Win32PoolAllocationStats +@ stdcall WinHelpA(long str long long) +@ stdcall WinHelpW(long wstr long long) +@ stdcall WindowFromDC(long) +@ stdcall WindowFromPoint(double) +@ stdcall WindowFromPhysicalPoint(double) NtUserWindowFromPhysicalPoint +@ stdcall keybd_event(long long long long) +@ stdcall mouse_event(long long long long long) +@ varargs wsprintfA(str str) +@ varargs wsprintfW(wstr wstr) +@ stdcall wvsprintfA(ptr str ptr) +@ stdcall wvsprintfW(ptr wstr ptr) + +; Functions exported by Win Vista +@ stdcall SetProcessDPIAware() + +; Unknown and undocumented functions +; @ stdcall CalcChildScroll(long long) +; @ stdcall CharNextExW(long wstr long) +; @ stdcall CharPrevExW(long wstr wstr long) +; @ stub ClientThreadConnect +; @ stub EnumDisplayDeviceModesA ;(str long ptr long) +; @ stub EnumDisplayDeviceModesW ;(wstr long ptr long) +; @ stdcall GetMenuIndex(ptr ptr) +; @ stub GetNextQueueWindow +; @ stub HasSystemSleepStarted +; @ stub InitSharedTable +; @ stub InitTask +; @ stub IsHungThread +; @ stub ModifyAccess +; @ stub PlaySoundEvent +; @ stub PrivateSetDbgTag +; @ stub PrivateSetRipFlags +; @ stub QueryUserCounters # Direct call NtUserQueryUserCounters +; @ stub RegisterNetworkCapabilities +; @ stub ResetDisplay +; @ stub ServerSetFunctionPointers +; @ stub SetDesktopBitmap +; @ stub SetWindowFullScreenState +; @ stdcall SetWindowText(long str) SetWindowTextA +; @ stub SysErrorBox +; @ stub UserIsSystemResumeAutomatic +; @ stub UserSetDeviceHoldState +; @ stdcall UserSignalProc(long long long long) +; @ stub VRipOutput +; @ stub VTagOutput +; @ stub WNDPROC_CALLBACK +; @ stub WinOldAppHackoMatic +; @ stub YieldTask +; @ stub _SetProcessDefaultLayout diff --git a/dll/win32/user32/user32.rbuild b/dll/win32/user32/user32.rbuild new file mode 100644 index 00000000000..c159be03109 --- /dev/null +++ b/dll/win32/user32/user32.rbuild @@ -0,0 +1,76 @@ + + + . + include + include/reactos/subsys + include/reactos/wine + wine + user32_wsprintf + gdi32 + advapi32 + imm32 + win32ksys + pseh + ntdll + + user32.h + + + appswitch.c + button.c + combo.c + edit.c + icontitle.c + listbox.c + regcontrol.c + scrollbar.c + static.c + + + dde.c + ddeclient.c + ddeserver.c + desktop.c + display.c + dllmain.c + exit.c + exticon.c + imm.c + misc.c + object.c + resources.c + rtlstr.c + stubs.c + timer.c + usrapihk.c + winhelp.c + winsta.c + + + accel.c + caret.c + class.c + clipboard.c + cursoricon.c + dc.c + defwnd.c + dialog.c + draw.c + font.c + hook.c + input.c + mdi.c + menu.c + message.c + messagebox.c + nonclient.c + paint.c + prop.c + rect.c + spy.c + text.c + window.c + winpos.c + + user32.rc + diff --git a/dll/win32/userenv/userenv.rbuild b/dll/win32/userenv/userenv.rbuild new file mode 100644 index 00000000000..0f6e4b58914 --- /dev/null +++ b/dll/win32/userenv/userenv.rbuild @@ -0,0 +1,19 @@ + + + . + uuid + ntdll + advapi32 + user32 + precomp.h + desktop.c + directory.c + environment.c + gpolicy.c + misc.c + profile.c + registry.c + setup.c + userenv.c + userenv.rc + diff --git a/dll/win32/usp10/usp10.rbuild b/dll/win32/usp10/usp10.rbuild new file mode 100644 index 00000000000..eda28014bbc --- /dev/null +++ b/dll/win32/usp10/usp10.rbuild @@ -0,0 +1,19 @@ + + + + + + . + include/reactos/wine + + bidi.c + usp10.c + mirror.c + shape.c + shaping.c + wine + gdi32 + ntdll + msvcrt + + diff --git a/dll/win32/uxtheme/uxtheme.rbuild b/dll/win32/uxtheme/uxtheme.rbuild new file mode 100644 index 00000000000..723f14b618b --- /dev/null +++ b/dll/win32/uxtheme/uxtheme.rbuild @@ -0,0 +1,29 @@ + + + + + + . + include/reactos/wine + + buffer.c + draw.c + main.c + metric.c + msstyles.c + ncscrollbar.c + nonclient.c + property.c + stylemap.c + system.c + themehooks.c + uxini.c + version.rc + wine + user32 + gdi32 + advapi32 + msimg32 + ntdll + + diff --git a/dll/win32/vdmdbg/vdmdbg.rbuild b/dll/win32/vdmdbg/vdmdbg.rbuild new file mode 100644 index 00000000000..525213c75a1 --- /dev/null +++ b/dll/win32/vdmdbg/vdmdbg.rbuild @@ -0,0 +1,7 @@ + + + . + ntdll + vdmdbg.c + vdmdbg.h + diff --git a/dll/win32/version/version.rbuild b/dll/win32/version/version.rbuild new file mode 100644 index 00000000000..fcc79152e41 --- /dev/null +++ b/dll/win32/version/version.rbuild @@ -0,0 +1,17 @@ + + + + + + . + include/reactos/wine + + info.c + install.c + resource.c + version.rc + wine + lz32 + ntdll + + diff --git a/dll/win32/wdmaud.drv/wdmaud.rbuild b/dll/win32/wdmaud.drv/wdmaud.rbuild new file mode 100644 index 00000000000..89269d330bb --- /dev/null +++ b/dll/win32/wdmaud.drv/wdmaud.rbuild @@ -0,0 +1,26 @@ + + + . + include/reactos/libs/sound + . + . + . + 1 + + + mmebuddy + ntdll + user32 + winmm + advapi32 + libsamplerate + msvcrt + mmixer + setupapi + ksuser + wdmaud.c + mixer.c + mmixer.c + legacy.c + wdmaud.rc + diff --git a/dll/win32/win32.rbuild b/dll/win32/win32.rbuild new file mode 100644 index 00000000000..c83f901ae55 --- /dev/null +++ b/dll/win32/win32.rbuild @@ -0,0 +1,688 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/dll/win32/windowscodecs/windowscodecs.rbuild b/dll/win32/windowscodecs/windowscodecs.rbuild new file mode 100644 index 00000000000..7c74900ee34 --- /dev/null +++ b/dll/win32/windowscodecs/windowscodecs.rbuild @@ -0,0 +1,40 @@ + + + + . + include/reactos/wine + include/reactos/libs/libjpeg + include/reactos/libs/zlib + include/reactos/libs/libpng + include/reactos/libs/libtiff + + + 0x600 + + wine + uuid + ole32 + shlwapi + advapi32 + + bmpdecode.c + bmpencode.c + clsfactory.c + converter.c + fliprotate.c + gifformat.c + icoformat.c + imgfactory.c + info.c + jpegformat.c + main.c + palette.c + pngformat.c + propertybag.c + regsvr.c + stream.c + tiffformat.c + ungif.c + + version.rc + diff --git a/dll/win32/winemp3.acm/winemp3.acm.rbuild b/dll/win32/winemp3.acm/winemp3.acm.rbuild new file mode 100644 index 00000000000..8164c4b09e5 --- /dev/null +++ b/dll/win32/winemp3.acm/winemp3.acm.rbuild @@ -0,0 +1,14 @@ + + + . + include/reactos/wine + include/reactos/libs/libmpg123 + + + mpegl3.c + wine + winmm + user32 + libmpg123 + ntdll + diff --git a/dll/win32/winfax/winfax.rbuild b/dll/win32/winfax/winfax.rbuild new file mode 100644 index 00000000000..1f99d1ee5e0 --- /dev/null +++ b/dll/win32/winfax/winfax.rbuild @@ -0,0 +1,7 @@ + + + . + ntdll + winfax.c + winfax.rc + diff --git a/dll/win32/wing32/wing32.rbuild b/dll/win32/wing32/wing32.rbuild new file mode 100644 index 00000000000..4b18189a82a --- /dev/null +++ b/dll/win32/wing32/wing32.rbuild @@ -0,0 +1,11 @@ + + + + + + user32 + gdi32 + wing32.c + --add-stdcall-alias + + diff --git a/dll/win32/winhttp/winhttp.rbuild b/dll/win32/winhttp/winhttp.rbuild new file mode 100644 index 00000000000..a812de89a41 --- /dev/null +++ b/dll/win32/winhttp/winhttp.rbuild @@ -0,0 +1,25 @@ + + + + + + + . + include/reactos/wine + + cookie.c + handle.c + main.c + net.c + request.c + session.c + url.c + wine + advapi32 + crypt32 + shlwapi + wininet + ws2_32 + ntdll + + diff --git a/dll/win32/wininet/wininet.rbuild b/dll/win32/wininet/wininet.rbuild new file mode 100644 index 00000000000..45b87b18665 --- /dev/null +++ b/dll/win32/wininet/wininet.rbuild @@ -0,0 +1,39 @@ + + + + + + + . + include/reactos/wine + + + + + _close + + wine + mpr + shlwapi + shell32 + user32 + advapi32 + ntdll + secur32 + crypt32 + ws2_32 + pseh + cookie.c + dialogs.c + ftp.c + gopher.c + http.c + internet.c + netconnection.c + urlcache.c + utility.c + wininet_main.c + rsrc.rc + version.rc + + diff --git a/dll/win32/winmm/midimap/midimap.rbuild b/dll/win32/winmm/midimap/midimap.rbuild new file mode 100644 index 00000000000..e6de9e5fb85 --- /dev/null +++ b/dll/win32/winmm/midimap/midimap.rbuild @@ -0,0 +1,13 @@ + + + . + include/wine + wine + uuid + ntdll + advapi32 + user32 + winmm + midimap.c + midimap.rc + diff --git a/dll/win32/winmm/winmm.rbuild b/dll/win32/winmm/winmm.rbuild new file mode 100644 index 00000000000..ab10fea07ea --- /dev/null +++ b/dll/win32/winmm/winmm.rbuild @@ -0,0 +1,28 @@ + + + + + + + + + . + include/reactos/wine + + wine + ntdll + advapi32 + user32 + pseh + driver.c + joystick.c + lolvldrv.c + mci.c + mmio.c + playsound.c + registry.c + time.c + winmm.c + winmm_res.rc + + diff --git a/dll/win32/winspool/winspool.rbuild b/dll/win32/winspool/winspool.rbuild new file mode 100644 index 00000000000..f5d5df57e98 --- /dev/null +++ b/dll/win32/winspool/winspool.rbuild @@ -0,0 +1,11 @@ + + + . + include/reactos/wine + ntdll + advapi32 + shlwapi + info.c + stubs.c + winspool.rc + diff --git a/dll/win32/winsta/winsta.rbuild b/dll/win32/winsta/winsta.rbuild new file mode 100644 index 00000000000..85e53c1ea53 --- /dev/null +++ b/dll/win32/winsta/winsta.rbuild @@ -0,0 +1,15 @@ + + + . + wine + ntdll + winsta.h + logon.c + main.c + misc.c + query.c + security.c + server.c + ws.c + winsta.rc + diff --git a/dll/win32/wintrust/wintrust.rbuild b/dll/win32/wintrust/wintrust.rbuild new file mode 100644 index 00000000000..bcb1c2b8304 --- /dev/null +++ b/dll/win32/wintrust/wintrust.rbuild @@ -0,0 +1,21 @@ + + + + . + include/reactos/wine + + wine + crypt32 + cryptui + user32 + advapi32 + imagehlp + ntdll + pseh + crypt.c + register.c + wintrust_main.c + asn.c + softpub.c + version.rc + diff --git a/dll/win32/wlanapi/wlanapi.rbuild b/dll/win32/wlanapi/wlanapi.rbuild new file mode 100644 index 00000000000..f17b4c263a4 --- /dev/null +++ b/dll/win32/wlanapi/wlanapi.rbuild @@ -0,0 +1,11 @@ + + + . + . + wlansvc_client + wine + rpcrt4 + pseh + ntdll + main.c + diff --git a/dll/win32/wldap32/wldap32.rbuild b/dll/win32/wldap32/wldap32.rbuild new file mode 100644 index 00000000000..d3f16b35479 --- /dev/null +++ b/dll/win32/wldap32/wldap32.rbuild @@ -0,0 +1,34 @@ + + + + + + . + include/reactos/wine + + add.c + ber.c + bind.c + compare.c + control.c + delete.c + dn.c + error.c + extended.c + init.c + main.c + misc.c + modify.c + modrdn.c + option.c + page.c + parse.c + rename.c + search.c + value.c + wldap32.rc + wine + user32 + ntdll + + diff --git a/dll/win32/wmi/wmi.rbuild b/dll/win32/wmi/wmi.rbuild new file mode 100644 index 00000000000..7bdc7767b6a --- /dev/null +++ b/dll/win32/wmi/wmi.rbuild @@ -0,0 +1,9 @@ + + + + . + advapi32 + ntdll + wmi.rc + + diff --git a/dll/win32/ws2_32/ws2_32.rbuild b/dll/win32/ws2_32/ws2_32.rbuild new file mode 100644 index 00000000000..912b339566f --- /dev/null +++ b/dll/win32/ws2_32/ws2_32.rbuild @@ -0,0 +1,29 @@ + + + include + include/reactos/wine + + DECLSPEC_EXPORT + wine + ntdll + user32 + advapi32 + dnsapi + + ws2_32.h + + + bsd.c + catalog.c + dllmain.c + event.c + handle.c + ns.c + sndrcv.c + stubs.c + upcall.c + async.c + + ws2_32.rc + + diff --git a/dll/win32/ws2_32_new/ws2_32.rbuild b/dll/win32/ws2_32_new/ws2_32.rbuild new file mode 100644 index 00000000000..2fee79c1a9e --- /dev/null +++ b/dll/win32/ws2_32_new/ws2_32.rbuild @@ -0,0 +1,52 @@ + + + inc + include/reactos/winsock + + wine + ntdll + user32 + advapi32 + dnsapi + ws2help + + addrconv.c + addrinfo.c + async.c + bhook.c + dcatalog.c + dcatitem.c + dllmain.c + dprocess.c + dprovide.c + dsocket.c + dthread.c + dupsock.c + enumprot.c + event.c + getproto.c + getxbyxx.c + ioctl.c + nscatalo.c + nscatent.c + nspinstl.c + nsprovid.c + nsquery.c + qos.c + qshelpr.c + rasdial.c + recv.c + rnr.c + scihlpr.c + select.c + send.c + sockctrl.c + socklife.c + spinstal.c + sputil.c + startup.c + wsautil.c + + ws2_32.rc + + diff --git a/dll/win32/ws2help/ws2help.rbuild b/dll/win32/ws2help/ws2help.rbuild new file mode 100644 index 00000000000..045c924e7ff --- /dev/null +++ b/dll/win32/ws2help/ws2help.rbuild @@ -0,0 +1,14 @@ + + + . + include/reactos/winsock + advapi32 + ntdll + ws2_32 + apc.c + context.c + dllmain.c + handle.c + notify.c + ws2help.rc + diff --git a/dll/win32/wshirda/wshirda.rbuild b/dll/win32/wshirda/wshirda.rbuild new file mode 100644 index 00000000000..41ca8e4ad84 --- /dev/null +++ b/dll/win32/wshirda/wshirda.rbuild @@ -0,0 +1,8 @@ + + + . + ntdll + ws2_32 + wshirda.c + wshirda.rc + diff --git a/dll/win32/wshtcpip/wshtcpip.rbuild b/dll/win32/wshtcpip/wshtcpip.rbuild new file mode 100644 index 00000000000..1ca8ec998f8 --- /dev/null +++ b/dll/win32/wshtcpip/wshtcpip.rbuild @@ -0,0 +1,12 @@ + + + + + . + . + ntdll + ws2_32 + tdilib + wshtcpip.c + wshtcpip.rc + diff --git a/dll/win32/wsock32/wsock32.rbuild b/dll/win32/wsock32/wsock32.rbuild new file mode 100644 index 00000000000..5375b531ac9 --- /dev/null +++ b/dll/win32/wsock32/wsock32.rbuild @@ -0,0 +1,8 @@ + + + . + ntdll + ws2_32 + stubs.c + wsock32.rc + diff --git a/dll/win32/wtsapi32/wtsapi32.rbuild b/dll/win32/wtsapi32/wtsapi32.rbuild new file mode 100644 index 00000000000..f538fad8fe6 --- /dev/null +++ b/dll/win32/wtsapi32/wtsapi32.rbuild @@ -0,0 +1,14 @@ + + + + + + . + include/reactos/wine + + wtsapi32.c + wine + advapi32 + ntdll + + diff --git a/dll/win32/wuapi/wuapi.rbuild b/dll/win32/wuapi/wuapi.rbuild new file mode 100644 index 00000000000..68d312c3abb --- /dev/null +++ b/dll/win32/wuapi/wuapi.rbuild @@ -0,0 +1,20 @@ + + + + . + include/reactos/wine + + 0x600 + downloader.c + installer.c + main.c + regsvr.c + searcher.c + session.c + updates.c + wine + uuid + ole32 + advapi32 + ntdll + diff --git a/dll/win32/xinput1_1/xinput1_1.rbuild b/dll/win32/xinput1_1/xinput1_1.rbuild new file mode 100644 index 00000000000..0e126933b5c --- /dev/null +++ b/dll/win32/xinput1_1/xinput1_1.rbuild @@ -0,0 +1,8 @@ + + + . + include/reactos/wine + + xinput1_1_main.c + version.rc + diff --git a/dll/win32/xinput1_2/xinput1_2.rbuild b/dll/win32/xinput1_2/xinput1_2.rbuild new file mode 100644 index 00000000000..a7aba7ad58b --- /dev/null +++ b/dll/win32/xinput1_2/xinput1_2.rbuild @@ -0,0 +1,8 @@ + + + . + include/reactos/wine + + xinput1_2_main.c + version.rc + diff --git a/dll/win32/xinput1_3/xinput1_3.rbuild b/dll/win32/xinput1_3/xinput1_3.rbuild new file mode 100644 index 00000000000..2a39cb47dfc --- /dev/null +++ b/dll/win32/xinput1_3/xinput1_3.rbuild @@ -0,0 +1,9 @@ + + + . + include/reactos/wine + + wine + xinput1_3_main.c + version.rc + diff --git a/dll/win32/xinput9_1_0/xinput9_1_0.rbuild b/dll/win32/xinput9_1_0/xinput9_1_0.rbuild new file mode 100644 index 00000000000..9db3ca210a7 --- /dev/null +++ b/dll/win32/xinput9_1_0/xinput9_1_0.rbuild @@ -0,0 +1,8 @@ + + + . + include/reactos/wine + + xinput9_1_0_main.c + version.rc + diff --git a/dll/win32/xmllite/xmllite.rbuild b/dll/win32/xmllite/xmllite.rbuild new file mode 100644 index 00000000000..c74cd88e8c5 --- /dev/null +++ b/dll/win32/xmllite/xmllite.rbuild @@ -0,0 +1,9 @@ + + + . + include/reactos/wine + + wine + reader.c + xmllite_main.c + diff --git a/drivers/base/beep/beep.rbuild b/drivers/base/beep/beep.rbuild new file mode 100644 index 00000000000..58e27f07a24 --- /dev/null +++ b/drivers/base/beep/beep.rbuild @@ -0,0 +1,8 @@ + + + + ntoskrnl + hal + beep.c + beep.rc + diff --git a/drivers/base/bootvid/bootvid.rbuild b/drivers/base/bootvid/bootvid.rbuild new file mode 100644 index 00000000000..03f62c7440d --- /dev/null +++ b/drivers/base/bootvid/bootvid.rbuild @@ -0,0 +1,24 @@ + + + + + + . + ntoskrnl + hal + + + bootvid.c + bootdata.c + vga.c + + + + + bootvid.c + bootdata.c + + + bootvid.rc + precomp.h + diff --git a/drivers/base/directory.rbuild b/drivers/base/directory.rbuild new file mode 100644 index 00000000000..697234e37a6 --- /dev/null +++ b/drivers/base/directory.rbuild @@ -0,0 +1,26 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/drivers/base/kdcom/kdcom.rbuild b/drivers/base/kdcom/kdcom.rbuild new file mode 100644 index 00000000000..888aad65dbe --- /dev/null +++ b/drivers/base/kdcom/kdcom.rbuild @@ -0,0 +1,24 @@ + + + + + + . + ntoskrnl + hal + + + kdbg.c + + + + + kdbg.c + + + + + kdbg.c + + + diff --git a/drivers/base/kddll/kddll.rbuild b/drivers/base/kddll/kddll.rbuild new file mode 100644 index 00000000000..4a368a007a1 --- /dev/null +++ b/drivers/base/kddll/kddll.rbuild @@ -0,0 +1,25 @@ + + + + + . + ntoskrnl + hal + kddll.c + + + + . + ntoskrnl + kdserial.c + + + + + + . + kdlib + kdserial + kdcom.c + + diff --git a/drivers/base/nmidebug/nmidebug.rbuild b/drivers/base/nmidebug/nmidebug.rbuild new file mode 100644 index 00000000000..02d605ce5a5 --- /dev/null +++ b/drivers/base/nmidebug/nmidebug.rbuild @@ -0,0 +1,10 @@ + + + + + . + ntoskrnl + hal + nmidebug.c + nmidebug.rc + diff --git a/drivers/base/null/null.rbuild b/drivers/base/null/null.rbuild new file mode 100644 index 00000000000..9e657655596 --- /dev/null +++ b/drivers/base/null/null.rbuild @@ -0,0 +1,10 @@ + + + + . + pseh + ntoskrnl + hal + null.c + null.rc + diff --git a/drivers/battery/battc/battc.rbuild b/drivers/battery/battc/battc.rbuild new file mode 100644 index 00000000000..5847dd401b0 --- /dev/null +++ b/drivers/battery/battc/battc.rbuild @@ -0,0 +1,11 @@ + + + + ntoskrnl + hal + + . + + battc.c + battc.rc + diff --git a/drivers/battery/directory.rbuild b/drivers/battery/directory.rbuild new file mode 100644 index 00000000000..ee79df907b5 --- /dev/null +++ b/drivers/battery/directory.rbuild @@ -0,0 +1,7 @@ + + + + + + + diff --git a/drivers/bluetooth/directory.rbuild b/drivers/bluetooth/directory.rbuild new file mode 100644 index 00000000000..8d49812e7c6 --- /dev/null +++ b/drivers/bluetooth/directory.rbuild @@ -0,0 +1,7 @@ + + + + + diff --git a/drivers/bluetooth/fbtusb/fbtusb.rbuild b/drivers/bluetooth/fbtusb/fbtusb.rbuild new file mode 100644 index 00000000000..d043b0a8ba6 --- /dev/null +++ b/drivers/bluetooth/fbtusb/fbtusb.rbuild @@ -0,0 +1,15 @@ + + + + include + ntoskrnl + hal + usbd + fbtdev.c + fbtpnp.c + fbtpwr.c + fbtrwr.c + fbtusb.c + + fbtusb.rc + diff --git a/drivers/bus/acpi/acpi.rbuild b/drivers/bus/acpi/acpi.rbuild new file mode 100644 index 00000000000..a33498acd50 --- /dev/null +++ b/drivers/bus/acpi/acpi.rbuild @@ -0,0 +1,44 @@ + + + + + + + + + + + + + + + + + + + + + + include + include + ntoskrnl + hal + wdmguid + acpica + + bus.c + button.c + power.c + utils.c + system.c + + osl.c + acpienum.c + eval.c + interface.c + pnp.c + power.c + buspdo.c + main.c + + diff --git a/drivers/bus/acpi/acpica/acpica.rbuild b/drivers/bus/acpi/acpica/acpica.rbuild new file mode 100644 index 00000000000..ce6fee8791f --- /dev/null +++ b/drivers/bus/acpi/acpica/acpica.rbuild @@ -0,0 +1,140 @@ + + + + + include + + dsfield.c + dsinit.c + dsmethod.c + dsmthdat.c + dsobject.c + dsopcode.c + dsutils.c + dswexec.c + dswload.c + dswscope.c + dswstate.c + + + evevent.c + evgpe.c + evgpeblk.c + evmisc.c + evregion.c + evrgnini.c + evsci.c + evxface.c + evxfevnt.c + evxfregn.c + + + exconfig.c + exconvrt.c + excreate.c + exdump.c + exfield.c + exfldio.c + exmisc.c + exmutex.c + exoparg1.c + exoparg2.c + exoparg3.c + exoparg6.c + exnames.c + exprep.c + exregion.c + exresnte.c + exresolv.c + exresop.c + exstore.c + exstoren.c + exstorob.c + exsystem.c + exutils.c + + + hwacpi.c + hwgpe.c + hwregs.c + hwsleep.c + hwtimer.c + hwvalid.c + hwxface.c + + + nsaccess.c + nsalloc.c + nsdump.c + nsdumpdv.c + nseval.c + nsinit.c + nsload.c + nsnames.c + nsobject.c + nsparse.c + nspredef.c + nsrepair.c + nsrepair2.c + nssearch.c + nsutils.c + nswalk.c + nsxfeval.c + nsxfname.c + nsxfobj.c + + + psargs.c + psloop.c + psopcode.c + psparse.c + psscope.c + pstree.c + psutils.c + pswalk.c + psxface.c + + + rsaddr.c + rscalc.c + rscreate.c + rsdump.c + rsinfo.c + rsio.c + rsirq.c + rslist.c + rsmemory.c + rsmisc.c + rsutils.c + rsxface.c + + + tbfadt.c + tbfind.c + tbinstal.c + tbutils.c + tbxface.c + tbxfroot.c + + + utalloc.c + utcache.c + utclib.c + utcopy.c + utdebug.c + utdelete.c + uteval.c + utglobal.c + utids.c + utinit.c + utlock.c + utmath.c + utmisc.c + utmutex.c + utobject.c + utresrc.c + utstate.c + uttrack.c + utxface.c + + diff --git a/drivers/bus/acpi/cmbatt/cmbatt.rbuild b/drivers/bus/acpi/cmbatt/cmbatt.rbuild new file mode 100644 index 00000000000..1af50b4c7a7 --- /dev/null +++ b/drivers/bus/acpi/cmbatt/cmbatt.rbuild @@ -0,0 +1,15 @@ + + + + ntoskrnl + hal + battc + wmilib + . + cmbatt.c + cmexec.c + cmbpnp.c + cmbwmi.c + cmbatt.rc + cmbatt.h + diff --git a/drivers/bus/acpi/compbatt/compbatt.rbuild b/drivers/bus/acpi/compbatt/compbatt.rbuild new file mode 100644 index 00000000000..6a92873c0e1 --- /dev/null +++ b/drivers/bus/acpi/compbatt/compbatt.rbuild @@ -0,0 +1,13 @@ + + + + ntoskrnl + hal + battc + . + compbatt.c + compmisc.c + comppnp.c + compbatt.rc + compbatt.h + diff --git a/drivers/bus/directory.rbuild b/drivers/bus/directory.rbuild new file mode 100644 index 00000000000..fc752ff4e18 --- /dev/null +++ b/drivers/bus/directory.rbuild @@ -0,0 +1,19 @@ + + + + + + + + + + + + + + + + + + + diff --git a/drivers/bus/isapnp/isapnp.rbuild b/drivers/bus/isapnp/isapnp.rbuild new file mode 100644 index 00000000000..9f31fbde9f1 --- /dev/null +++ b/drivers/bus/isapnp/isapnp.rbuild @@ -0,0 +1,13 @@ + + + + + . + ntoskrnl + hal + isapnp.c + pdo.c + fdo.c + hardware.c + isapnp.rc + diff --git a/drivers/bus/pci/pci.rbuild b/drivers/bus/pci/pci.rbuild new file mode 100644 index 00000000000..7f6ce0dd01c --- /dev/null +++ b/drivers/bus/pci/pci.rbuild @@ -0,0 +1,12 @@ + + + + + . + ntoskrnl + hal + fdo.c + pci.c + pdo.c + pci.rc + diff --git a/drivers/bus/pcix/pcix.rbuild b/drivers/bus/pcix/pcix.rbuild new file mode 100644 index 00000000000..b00225e4ee2 --- /dev/null +++ b/drivers/bus/pcix/pcix.rbuild @@ -0,0 +1,51 @@ + + + + + . + ntoskrnl + hal + pciclass + + ar_busno.c + ar_memio.c + arb_comn.c + tr_irq.c + + + agpintrf.c + busintrf.c + cardbus.c + devhere.c + ideintrf.c + intrface.c + lddintrf.c + locintrf.c + pmeintf.c + routintf.c + + + busno.c + config.c + devhere.c + id.c + ppbridge.c + romimage.c + state.c + + debug.c + device.c + dispatch.c + enum.c + fdo.c + guid.c + hookhal.c + init.c + pcivrify.c + pdo.c + power.c + usage.c + utils.c + pci.rc + pci.h + diff --git a/drivers/bus/pcmcia/pcmcia.rbuild b/drivers/bus/pcmcia/pcmcia.rbuild new file mode 100644 index 00000000000..b2fe4e30c40 --- /dev/null +++ b/drivers/bus/pcmcia/pcmcia.rbuild @@ -0,0 +1,12 @@ + + + + + . + ntoskrnl + hal + fdo.c + pcmcia.c + pdo.c + pcmcia.rc + diff --git a/drivers/directx/directory.rbuild b/drivers/directx/directory.rbuild new file mode 100644 index 00000000000..04d6ae9e340 --- /dev/null +++ b/drivers/directx/directory.rbuild @@ -0,0 +1,13 @@ + + + + + + + + + + + + + diff --git a/drivers/directx/dxapi/dxapi.rbuild b/drivers/directx/dxapi/dxapi.rbuild new file mode 100644 index 00000000000..010702c2193 --- /dev/null +++ b/drivers/directx/dxapi/dxapi.rbuild @@ -0,0 +1,13 @@ + + + + + . + + ntoskrnl + hal + videoprt + main.c + dxapi.rc + diff --git a/drivers/directx/dxg/dxg.rbuild b/drivers/directx/dxg/dxg.rbuild new file mode 100644 index 00000000000..3303dc5d488 --- /dev/null +++ b/drivers/directx/dxg/dxg.rbuild @@ -0,0 +1,14 @@ + + + + + . + include + dxgthk + ntoskrnl + main.c + ddhmg.c + eng.c + historic.c + dxg.rc + diff --git a/drivers/directx/dxgthk/dxgthk.rbuild b/drivers/directx/dxgthk/dxgthk.rbuild new file mode 100644 index 00000000000..924c3c94bde --- /dev/null +++ b/drivers/directx/dxgthk/dxgthk.rbuild @@ -0,0 +1,10 @@ + + + + + . + win32k + main.c + dxgthk.rc + diff --git a/drivers/drivers.rbuild b/drivers/drivers.rbuild new file mode 100644 index 00000000000..4e3c60fa548 --- /dev/null +++ b/drivers/drivers.rbuild @@ -0,0 +1,61 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/drivers/filesystems/cdfs/cdfs.rbuild b/drivers/filesystems/cdfs/cdfs.rbuild new file mode 100644 index 00000000000..2562d39ed4b --- /dev/null +++ b/drivers/filesystems/cdfs/cdfs.rbuild @@ -0,0 +1,23 @@ + + + + + . + ntoskrnl + hal + cdfs.c + cleanup.c + close.c + common.c + create.c + devctrl.c + dirctl.c + fcb.c + finfo.c + fsctl.c + misc.c + rw.c + volinfo.c + cdfs.rc + cdfs.h + diff --git a/drivers/filesystems/directory.rbuild b/drivers/filesystems/directory.rbuild new file mode 100644 index 00000000000..856c7ea768e --- /dev/null +++ b/drivers/filesystems/directory.rbuild @@ -0,0 +1,28 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/drivers/filesystems/ext2/ext2.rbuild b/drivers/filesystems/ext2/ext2.rbuild new file mode 100644 index 00000000000..1cc1a54b382 --- /dev/null +++ b/drivers/filesystems/ext2/ext2.rbuild @@ -0,0 +1,33 @@ + + + + + inc + /wd4003 + ntoskrnl + hal + + cleanup.c + close.c + create.c + devcntrl.c + dircntrl.c + DiskIO.c + ext2init.c + fastio.c + fileinfo.c + flush.c + fsctrl.c + io.c + metadata.c + misc.c + read.c + shutdown.c + volinfo.c + write.c + + + ext2fsd.h + + ext2fs.rc + diff --git a/drivers/filesystems/fastfat/vfatfs.rbuild b/drivers/filesystems/fastfat/vfatfs.rbuild new file mode 100644 index 00000000000..179d825a792 --- /dev/null +++ b/drivers/filesystems/fastfat/vfatfs.rbuild @@ -0,0 +1,31 @@ + + + + + . + ntoskrnl + hal + blockdev.c + cleanup.c + close.c + create.c + dir.c + direntry.c + dirwr.c + ea.c + fat.c + fastio.c + fcb.c + finfo.c + flush.c + fsctl.c + iface.c + misc.c + pnp.c + rw.c + shutdown.c + string.c + volume.c + vfatfs.rc + vfat.h + diff --git a/drivers/filesystems/fastfat_new/fastfat.rbuild b/drivers/filesystems/fastfat_new/fastfat.rbuild new file mode 100644 index 00000000000..ae73147dd47 --- /dev/null +++ b/drivers/filesystems/fastfat_new/fastfat.rbuild @@ -0,0 +1,31 @@ + + + + + . + include/reactos/libs/fullfat + fullfat + ntoskrnl + hal + pseh + cleanup.c + close.c + create.c + device.c + dir.c + ea.c + fastfat.c + fat.c + fastio.c + fcb.c + finfo.c + flush.c + fsctl.c + fullfat.c + lock.c + rw.c + shutdown.c + volume.c + fastfat.rc + fastfat.h + diff --git a/drivers/filesystems/fs_rec/fs_rec.rbuild b/drivers/filesystems/fs_rec/fs_rec.rbuild new file mode 100644 index 00000000000..35ffb1d77ca --- /dev/null +++ b/drivers/filesystems/fs_rec/fs_rec.rbuild @@ -0,0 +1,15 @@ + + + + . + ntoskrnl + hal + blockdev.c + cdfs.c + ext2.c + fat.c + fs_rec.c + ntfs.c + udfs.c + fs_rec.rc + diff --git a/drivers/filesystems/msfs/msfs.rbuild b/drivers/filesystems/msfs/msfs.rbuild new file mode 100644 index 00000000000..548468457b0 --- /dev/null +++ b/drivers/filesystems/msfs/msfs.rbuild @@ -0,0 +1,14 @@ + + + + . + ntoskrnl + hal + create.c + finfo.c + fsctrl.c + msfs.c + rw.c + msfs.rc + msfs.h + diff --git a/drivers/filesystems/mup/mup.rbuild b/drivers/filesystems/mup/mup.rbuild new file mode 100644 index 00000000000..57ccb37c0e3 --- /dev/null +++ b/drivers/filesystems/mup/mup.rbuild @@ -0,0 +1,10 @@ + + + + . + ntoskrnl + hal + create.c + mup.c + mup.rc + diff --git a/drivers/filesystems/npfs/npfs.rbuild b/drivers/filesystems/npfs/npfs.rbuild new file mode 100644 index 00000000000..945dd4cb8ce --- /dev/null +++ b/drivers/filesystems/npfs/npfs.rbuild @@ -0,0 +1,17 @@ + + + + . + ntoskrnl + hal + pseh + create.c + dirctl.c + finfo.c + fsctrl.c + npfs.c + rw.c + volume.c + npfs.rc + npfs.h + diff --git a/drivers/filesystems/ntfs/ntfs.rbuild b/drivers/filesystems/ntfs/ntfs.rbuild new file mode 100644 index 00000000000..45b8266fd32 --- /dev/null +++ b/drivers/filesystems/ntfs/ntfs.rbuild @@ -0,0 +1,25 @@ + + + + + . + ntoskrnl + hal + attrib.c + blockdev.c + close.c + create.c + dirctl.c + dispatch.c + fastio.c + fcb.c + finfo.c + fsctl.c + mft.c + misc.c + ntfs.c + rw.c + volinfo.c + ntfs.rc + ntfs.h + diff --git a/drivers/input/directory.rbuild b/drivers/input/directory.rbuild new file mode 100644 index 00000000000..20570bc8af3 --- /dev/null +++ b/drivers/input/directory.rbuild @@ -0,0 +1,16 @@ + + + + + + + + + + + + + + + + diff --git a/drivers/input/i8042prt/i8042prt.rbuild b/drivers/input/i8042prt/i8042prt.rbuild new file mode 100644 index 00000000000..5542ab5d0e2 --- /dev/null +++ b/drivers/input/i8042prt/i8042prt.rbuild @@ -0,0 +1,18 @@ + + + + + ntoskrnl + hal + createclose.c + i8042prt.c + keyboard.c + misc.c + mouse.c + pnp.c + ps2pp.c + readwrite.c + registry.c + setup.c + i8042prt.rc + diff --git a/drivers/input/kbdclass/kbdclass.rbuild b/drivers/input/kbdclass/kbdclass.rbuild new file mode 100644 index 00000000000..639e4738044 --- /dev/null +++ b/drivers/input/kbdclass/kbdclass.rbuild @@ -0,0 +1,12 @@ + + + + + pseh + ntoskrnl + hal + kbdclass.c + misc.c + setup.c + kbdclass.rc + diff --git a/drivers/input/mouclass/mouclass.rbuild b/drivers/input/mouclass/mouclass.rbuild new file mode 100644 index 00000000000..1b75a0111cd --- /dev/null +++ b/drivers/input/mouclass/mouclass.rbuild @@ -0,0 +1,11 @@ + + + + . + pseh + ntoskrnl + hal + misc.c + mouclass.c + mouclass.rc + diff --git a/drivers/input/sermouse/sermouse.rbuild b/drivers/input/sermouse/sermouse.rbuild new file mode 100644 index 00000000000..e231da9c428 --- /dev/null +++ b/drivers/input/sermouse/sermouse.rbuild @@ -0,0 +1,14 @@ + + + + ntoskrnl + hal + createclose.c + detect.c + fdo.c + internaldevctl.c + misc.c + readmouse.c + sermouse.c + sermouse.rc + diff --git a/drivers/ksfilter/directory.rbuild b/drivers/ksfilter/directory.rbuild new file mode 100644 index 00000000000..f74ff5d9226 --- /dev/null +++ b/drivers/ksfilter/directory.rbuild @@ -0,0 +1,11 @@ + + + + + + + + + + + diff --git a/drivers/ksfilter/ks/ks.rbuild b/drivers/ksfilter/ks/ks.rbuild new file mode 100644 index 00000000000..ffa517843bf --- /dev/null +++ b/drivers/ksfilter/ks/ks.rbuild @@ -0,0 +1,36 @@ + + + + . + .. + ../include + + ntoskrnl + hal + pseh + + + ks.rc + api.c + allocators.c + bag.c + device.c + deviceinterface.c + driver.c + clocks.c + connectivity.c + event.c + filter.c + filterfactory.c + image.c + irp.c + methods.c + misc.c + pin.c + property.c + topology.c + unknown.c + worker.c + kcom.c + swenum.c + diff --git a/drivers/ksfilter/swenum/swenum.rbuild b/drivers/ksfilter/swenum/swenum.rbuild new file mode 100644 index 00000000000..3f9ee3c9400 --- /dev/null +++ b/drivers/ksfilter/swenum/swenum.rbuild @@ -0,0 +1,8 @@ + + + + + ntoskrnl + ks + swenum.c + diff --git a/drivers/multimedia/audio/directory.rbuild b/drivers/multimedia/audio/directory.rbuild new file mode 100644 index 00000000000..1a05766c83d --- /dev/null +++ b/drivers/multimedia/audio/directory.rbuild @@ -0,0 +1,20 @@ + + + + + + + diff --git a/drivers/multimedia/audio/mpu401_nt4/mpu401.rbuild b/drivers/multimedia/audio/mpu401_nt4/mpu401.rbuild new file mode 100644 index 00000000000..e6a8dd3e2ff --- /dev/null +++ b/drivers/multimedia/audio/mpu401_nt4/mpu401.rbuild @@ -0,0 +1,17 @@ + + + + + + + . + ntoskrnl + hal + mpu401.c + portio.c + settings.c + mpu401.rc + diff --git a/drivers/multimedia/audio/sb16_nt4.old/sb16_nt4.rbuild b/drivers/multimedia/audio/sb16_nt4.old/sb16_nt4.rbuild new file mode 100644 index 00000000000..af028efb26d --- /dev/null +++ b/drivers/multimedia/audio/sb16_nt4.old/sb16_nt4.rbuild @@ -0,0 +1,11 @@ + + + + . + .. + ntoskrnl + hal + main.c + control.c + interrupt.c + diff --git a/drivers/multimedia/audio/sndblst.old/sndblst.rbuild b/drivers/multimedia/audio/sndblst.old/sndblst.rbuild new file mode 100644 index 00000000000..15b9337c9cd --- /dev/null +++ b/drivers/multimedia/audio/sndblst.old/sndblst.rbuild @@ -0,0 +1,14 @@ + + + + . + ntoskrnl + hal + card.c + dma.c + irq.c + portio.c + settings.c + sndblst.c + sndblst.rc + diff --git a/drivers/multimedia/audio/sndblst_sys/sndblst.rbuild b/drivers/multimedia/audio/sndblst_sys/sndblst.rbuild new file mode 100644 index 00000000000..922e2618149 --- /dev/null +++ b/drivers/multimedia/audio/sndblst_sys/sndblst.rbuild @@ -0,0 +1,9 @@ + + + + . + ntoskrnl + hal + sndblst.c + sndblst.rc + diff --git a/drivers/multimedia/audio/sound/sound.rbuild b/drivers/multimedia/audio/sound/sound.rbuild new file mode 100644 index 00000000000..66fee200d08 --- /dev/null +++ b/drivers/multimedia/audio/sound/sound.rbuild @@ -0,0 +1,14 @@ + + + + ntoskrnl + hal + .\include + dsp.c + mixer.c + sb16.c + sb_waveout.c + sound.c + wave.c + sb16.rc + diff --git a/drivers/multimedia/bdasup/bdasup.rbuild b/drivers/multimedia/bdasup/bdasup.rbuild new file mode 100644 index 00000000000..dd65a01f8ce --- /dev/null +++ b/drivers/multimedia/bdasup/bdasup.rbuild @@ -0,0 +1,10 @@ + + + + + ntoskrnl + ks + pseh + hal + bdasup.c + diff --git a/drivers/multimedia/directory.rbuild b/drivers/multimedia/directory.rbuild new file mode 100644 index 00000000000..ece2718cdbf --- /dev/null +++ b/drivers/multimedia/directory.rbuild @@ -0,0 +1,10 @@ + + + + + + + + diff --git a/drivers/network/acd/rasacd.rbuild b/drivers/network/acd/rasacd.rbuild new file mode 100644 index 00000000000..499dbe776a5 --- /dev/null +++ b/drivers/network/acd/rasacd.rbuild @@ -0,0 +1,14 @@ + + + + include + ntoskrnl + hal + + acdapi.h + + + main.c + + rasacd.rc + diff --git a/drivers/network/afd/afd.rbuild b/drivers/network/afd/afd.rbuild new file mode 100644 index 00000000000..6e56ce23b07 --- /dev/null +++ b/drivers/network/afd/afd.rbuild @@ -0,0 +1,28 @@ + + + + include + include/reactos/drivers + include/ndk + pseh + ntoskrnl + hal + + afd.h + + + bind.c + connect.c + context.c + info.c + listen.c + lock.c + main.c + read.c + select.c + tdi.c + tdiconn.c + write.c + + afd.rc + diff --git a/drivers/network/dd/directory.rbuild b/drivers/network/dd/directory.rbuild new file mode 100644 index 00000000000..f533dad8649 --- /dev/null +++ b/drivers/network/dd/directory.rbuild @@ -0,0 +1,10 @@ + + + + + + + + + + diff --git a/drivers/network/dd/ne2000/ne2000.rbuild b/drivers/network/dd/ne2000/ne2000.rbuild new file mode 100644 index 00000000000..d3b5e17405b --- /dev/null +++ b/drivers/network/dd/ne2000/ne2000.rbuild @@ -0,0 +1,13 @@ + + + + include + ndis + ntoskrnl + hal + + 8390.c + main.c + + ne2000.rc + diff --git a/drivers/network/dd/pcnet/pcnet.rbuild b/drivers/network/dd/pcnet/pcnet.rbuild new file mode 100644 index 00000000000..b2683c87a0b --- /dev/null +++ b/drivers/network/dd/pcnet/pcnet.rbuild @@ -0,0 +1,15 @@ + + + + . + + + + + ndis + ntoskrnl + hal + pcnet.c + requests.c + pcnet.rc + diff --git a/drivers/network/directory.rbuild b/drivers/network/directory.rbuild new file mode 100644 index 00000000000..2a62dbd7fbf --- /dev/null +++ b/drivers/network/directory.rbuild @@ -0,0 +1,19 @@ + + + + + + + + + + + + + + + + + + + diff --git a/drivers/network/ndis/ndis.rbuild b/drivers/network/ndis/ndis.rbuild new file mode 100644 index 00000000000..38dadeff652 --- /dev/null +++ b/drivers/network/ndis/ndis.rbuild @@ -0,0 +1,40 @@ + + + + + include + + + + + + + + ntoskrnl + hal + + ndissys.h + + + 30stubs.c + 40stubs.c + 50stubs.c + buffer.c + cl.c + cm.c + co.c + config.c + control.c + efilter.c + hardware.c + io.c + main.c + memory.c + miniport.c + misc.c + protocol.c + string.c + time.c + + ndis.rc + diff --git a/drivers/network/tcpip/tcpip.rbuild b/drivers/network/tcpip/tcpip.rbuild new file mode 100644 index 00000000000..f3c6114e568 --- /dev/null +++ b/drivers/network/tcpip/tcpip.rbuild @@ -0,0 +1,37 @@ + + + + + include + include + + + ip + oskittcp + ndis + pseh + chew + ntoskrnl + hal + + precomp.h + + + lan.c + + + ainfo.c + buffer.c + dispatch.c + fileobjs.c + iinfo.c + info.c + lock.c + main.c + ninfo.c + proto.c + tinfo.c + wait.c + + tcpip.rc + diff --git a/drivers/network/tdi/tdi.rbuild b/drivers/network/tdi/tdi.rbuild new file mode 100644 index 00000000000..718077ffe9e --- /dev/null +++ b/drivers/network/tdi/tdi.rbuild @@ -0,0 +1,23 @@ + + + + + ntoskrnl + hal + + + events.c + string.c + timer.c + + + main.c + tdi.rc + + + dereg.c + handler.c + obsolete.c + stubs.c + + diff --git a/drivers/parallel/directory.rbuild b/drivers/parallel/directory.rbuild new file mode 100644 index 00000000000..8afdbcf0199 --- /dev/null +++ b/drivers/parallel/directory.rbuild @@ -0,0 +1,7 @@ + + + + + + + diff --git a/drivers/parallel/parallel/parallel.rbuild b/drivers/parallel/parallel/parallel.rbuild new file mode 100644 index 00000000000..256ae79d87f --- /dev/null +++ b/drivers/parallel/parallel/parallel.rbuild @@ -0,0 +1,9 @@ + + + + . + ntoskrnl + hal + parallel.c + parallel.rc + diff --git a/drivers/serial/directory.rbuild b/drivers/serial/directory.rbuild new file mode 100644 index 00000000000..a7af5f96559 --- /dev/null +++ b/drivers/serial/directory.rbuild @@ -0,0 +1,10 @@ + + + + + + + + + + diff --git a/drivers/serial/serenum/serenum.rbuild b/drivers/serial/serenum/serenum.rbuild new file mode 100644 index 00000000000..00eafb1cd4c --- /dev/null +++ b/drivers/serial/serenum/serenum.rbuild @@ -0,0 +1,12 @@ + + + + ntoskrnl + hal + detect.c + fdo.c + misc.c + pdo.c + serenum.c + serenum.rc + diff --git a/drivers/serial/serial/serial.rbuild b/drivers/serial/serial/serial.rbuild new file mode 100644 index 00000000000..84c8288e07d --- /dev/null +++ b/drivers/serial/serial/serial.rbuild @@ -0,0 +1,19 @@ + + + + ntoskrnl + hal + circularbuffer.c + cleanup.c + close.c + create.c + devctrl.c + info.c + legacy.c + misc.c + pnp.c + power.c + rw.c + serial.c + serial.rc + diff --git a/drivers/setup/blue/blue.rbuild b/drivers/setup/blue/blue.rbuild new file mode 100644 index 00000000000..075a2997f7c --- /dev/null +++ b/drivers/setup/blue/blue.rbuild @@ -0,0 +1,11 @@ + + + + + include/reactos/drivers + ntoskrnl + hal + blue.c + font.c + blue.rc + diff --git a/drivers/setup/directory.rbuild b/drivers/setup/directory.rbuild new file mode 100644 index 00000000000..6a2d30a08ce --- /dev/null +++ b/drivers/setup/directory.rbuild @@ -0,0 +1,7 @@ + + + + + + + diff --git a/drivers/storage/class/cdrom/cdrom.rbuild b/drivers/storage/class/cdrom/cdrom.rbuild new file mode 100644 index 00000000000..3735a15ce93 --- /dev/null +++ b/drivers/storage/class/cdrom/cdrom.rbuild @@ -0,0 +1,13 @@ + + + + + ntoskrnl + hal + class2 + scsiport + .. + cdrom.c + findscsi.c + cdrom.rc + diff --git a/drivers/storage/class/class2/class2.rbuild b/drivers/storage/class/class2/class2.rbuild new file mode 100644 index 00000000000..423122e1db2 --- /dev/null +++ b/drivers/storage/class/class2/class2.rbuild @@ -0,0 +1,12 @@ + + + + + + ntoskrnl + hal + scsiport + .. + class2.c + class2.rc + diff --git a/drivers/storage/class/directory.rbuild b/drivers/storage/class/directory.rbuild new file mode 100644 index 00000000000..30dbef9435e --- /dev/null +++ b/drivers/storage/class/directory.rbuild @@ -0,0 +1,19 @@ + + + + + + + + + + + + + + + + + + + diff --git a/drivers/storage/class/disk/disk.rbuild b/drivers/storage/class/disk/disk.rbuild new file mode 100644 index 00000000000..543441659dd --- /dev/null +++ b/drivers/storage/class/disk/disk.rbuild @@ -0,0 +1,12 @@ + + + + + ntoskrnl + hal + class2 + scsiport + .. + disk.c + disk.rc + diff --git a/drivers/storage/class/ramdisk/ramdisk.rbuild b/drivers/storage/class/ramdisk/ramdisk.rbuild new file mode 100644 index 00000000000..6adba99282d --- /dev/null +++ b/drivers/storage/class/ramdisk/ramdisk.rbuild @@ -0,0 +1,9 @@ + + + + + ntoskrnl + hal + ramdisk.c + ramdisk.rc + diff --git a/drivers/storage/classpnp/classpnp.rbuild b/drivers/storage/classpnp/classpnp.rbuild new file mode 100644 index 00000000000..92f982e5034 --- /dev/null +++ b/drivers/storage/classpnp/classpnp.rbuild @@ -0,0 +1,37 @@ + + + + + + ntoskrnl + hal + pseh + libcntpr + ../inc + 0 + 100 + 1 + 0 + 512 + 512 + + -mrtd + -fno-builtin + -w + + autorun.c + class.c + classwmi.c + create.c + data.c + dictlib.c + lock.c + power.c + xferpkt.c + clntirp.c + retry.c + utils.c + obsolete.c + debug.c + class.rc + diff --git a/drivers/storage/directory.rbuild b/drivers/storage/directory.rbuild new file mode 100644 index 00000000000..e25b40aae9e --- /dev/null +++ b/drivers/storage/directory.rbuild @@ -0,0 +1,22 @@ + + + + + + + + + + + + + + + + + + + + + + diff --git a/drivers/storage/floppy/floppy.rbuild b/drivers/storage/floppy/floppy.rbuild new file mode 100644 index 00000000000..41bd2d39b1c --- /dev/null +++ b/drivers/storage/floppy/floppy.rbuild @@ -0,0 +1,15 @@ + + + + + . + ntoskrnl + hal + csq + csqrtns.c + floppy.c + hardware.c + ioctl.c + readwrite.c + floppy.rc + diff --git a/drivers/storage/ide/atapi/atapi.rbuild b/drivers/storage/ide/atapi/atapi.rbuild new file mode 100644 index 00000000000..6c6a680abca --- /dev/null +++ b/drivers/storage/ide/atapi/atapi.rbuild @@ -0,0 +1,10 @@ + + + + + . + scsiport + libcntpr + atapi.c + atapi.rc + diff --git a/drivers/storage/ide/directory.rbuild b/drivers/storage/ide/directory.rbuild new file mode 100644 index 00000000000..9c436eb5ba0 --- /dev/null +++ b/drivers/storage/ide/directory.rbuild @@ -0,0 +1,16 @@ + + + + + + + + + + + + + + + + diff --git a/drivers/storage/ide/pciide/pciide.rbuild b/drivers/storage/ide/pciide/pciide.rbuild new file mode 100644 index 00000000000..58e385ba3a5 --- /dev/null +++ b/drivers/storage/ide/pciide/pciide.rbuild @@ -0,0 +1,9 @@ + + + + + pciidex + ntoskrnl + pciide.c + pciide.rc + diff --git a/drivers/storage/ide/pciidex/pciidex.rbuild b/drivers/storage/ide/pciidex/pciidex.rbuild new file mode 100644 index 00000000000..70c46f8c75a --- /dev/null +++ b/drivers/storage/ide/pciidex/pciidex.rbuild @@ -0,0 +1,13 @@ + + + + + + ntoskrnl + fdo.c + miniport.c + misc.c + pciidex.c + pdo.c + pciidex.rc + diff --git a/drivers/storage/ide/uniata/uniata.rbuild b/drivers/storage/ide/uniata/uniata.rbuild new file mode 100644 index 00000000000..af1ad6b324b --- /dev/null +++ b/drivers/storage/ide/uniata/uniata.rbuild @@ -0,0 +1,27 @@ + + + + + . + inc + + -fno-exceptions + -fno-rtti + + + ntoskrnl + hal + scsiport + id_ata.cpp + id_badblock.cpp + id_dma.cpp + id_init.cpp + id_probe.cpp + id_queue.cpp + id_sata.cpp + idedma.rc + + + ros_glue.cpp + + diff --git a/drivers/storage/port/buslogic/buslogic.rbuild b/drivers/storage/port/buslogic/buslogic.rbuild new file mode 100644 index 00000000000..92f5fc69fa3 --- /dev/null +++ b/drivers/storage/port/buslogic/buslogic.rbuild @@ -0,0 +1,9 @@ + + + + + . + scsiport + BusLogic958.c + BusLogic958.rc + diff --git a/drivers/storage/port/directory.rbuild b/drivers/storage/port/directory.rbuild new file mode 100644 index 00000000000..572a5d28838 --- /dev/null +++ b/drivers/storage/port/directory.rbuild @@ -0,0 +1,7 @@ + + + + + + + diff --git a/drivers/storage/scsiport/scsiport.pspec b/drivers/storage/scsiport/scsiport.pspec new file mode 100644 index 00000000000..65c75471c4d --- /dev/null +++ b/drivers/storage/scsiport/scsiport.pspec @@ -0,0 +1,51 @@ +#ifdef __x86_64__ +#define MAYBEFWD(x) +#else +#define MAYBEFWD(x) x +#endif + +@ cdecl ScsiDebugPrint() +@ stdcall ScsiPortCompleteRequest(ptr long long long long) +@ stdcall ScsiPortConvertPhysicalAddressToUlong(long long) +@ stdcall ScsiPortConvertUlongToPhysicalAddress(long) MAYBEFWD(NTOSKRNL.RtlConvertUlongToLargeInteger) +@ stdcall ScsiPortFlushDma(ptr) +@ stdcall ScsiPortFreeDeviceBase(ptr ptr) +@ stdcall ScsiPortGetBusData(ptr long long long ptr long) +@ stdcall ScsiPortGetDeviceBase(ptr long long long long long long) +@ stdcall ScsiPortGetLogicalUnit(ptr long long long) +@ stdcall ScsiPortGetPhysicalAddress(ptr ptr ptr long) +@ stdcall ScsiPortGetSrb(ptr long long long long) +@ stdcall ScsiPortGetUncachedExtension(ptr ptr long) +@ stdcall ScsiPortGetVirtualAddress(ptr long long) +@ stdcall ScsiPortInitialize(ptr ptr ptr ptr) +@ stdcall ScsiPortIoMapTransfer(ptr ptr long long) +@ stdcall ScsiPortLogError(ptr ptr long long long long long) +@ stdcall ScsiPortMoveMemory(ptr ptr long) +@ cdecl ScsiPortNotification() +@ stdcall ScsiPortReadPortBufferUchar(ptr ptr long) MAYBEFWD(HAL.READ_PORT_BUFFER_UCHAR) +@ stdcall ScsiPortReadPortBufferUshort(ptr ptr long) MAYBEFWD(HAL.READ_PORT_BUFFER_USHORT) +@ stdcall ScsiPortReadPortBufferUlong(ptr ptr long) MAYBEFWD(HAL.READ_PORT_BUFFER_ULONG) +@ stdcall ScsiPortReadPortUchar(ptr) MAYBEFWD(HAL.READ_PORT_UCHAR) +@ stdcall ScsiPortReadPortUshort(ptr) MAYBEFWD(HAL.READ_PORT_USHORT) +@ stdcall ScsiPortReadPortUlong(ptr) MAYBEFWD(HAL.READ_PORT_ULONG) +@ stdcall ScsiPortReadRegisterBufferUchar(ptr ptr long) MAYBEFWD(NTOSKRNL.READ_REGISTER_BUFFER_UCHAR) +@ stdcall ScsiPortReadRegisterBufferUshort(ptr ptr long) MAYBEFWD(NTOSKRNL.READ_REGISTER_BUFFER_USHORT) +@ stdcall ScsiPortReadRegisterBufferUlong(ptr ptr long) MAYBEFWD(NTOSKRNL.READ_REGISTER_BUFFER_ULONG) +@ stdcall ScsiPortReadRegisterUchar(ptr) MAYBEFWD(NTOSKRNL.READ_REGISTER_UCHAR) +@ stdcall ScsiPortReadRegisterUshort(ptr) MAYBEFWD(NTOSKRNL.READ_REGISTER_USHORT) +@ stdcall ScsiPortReadRegisterUlong(ptr) MAYBEFWD(NTOSKRNL.READ_REGISTER_ULONG) +@ stdcall ScsiPortSetBusDataByOffset(ptr long long long ptr long long) +@ stdcall ScsiPortStallExecution(long) HAL.KeStallExecutionProcessor +@ stdcall ScsiPortValidateRange(ptr long long long long long long) +@ stdcall ScsiPortWritePortBufferUchar(ptr ptr long) MAYBEFWD(HAL.WRITE_PORT_BUFFER_UCHAR) +@ stdcall ScsiPortWritePortBufferUshort(ptr ptr long) MAYBEFWD(HAL.WRITE_PORT_BUFFER_USHORT) +@ stdcall ScsiPortWritePortBufferUlong(ptr ptr long) MAYBEFWD(HAL.WRITE_PORT_BUFFER_ULONG) +@ stdcall ScsiPortWritePortUchar(ptr long) MAYBEFWD(HAL.WRITE_PORT_UCHAR) +@ stdcall ScsiPortWritePortUshort(ptr long) MAYBEFWD(HAL.WRITE_PORT_USHORT) +@ stdcall ScsiPortWritePortUlong(ptr long) MAYBEFWD(HAL.WRITE_PORT_ULONG) +@ stdcall ScsiPortWriteRegisterBufferUchar(ptr ptr long) MAYBEFWD(NTOSKRNL.WRITE_REGISTER_BUFFER_UCHAR) +@ stdcall ScsiPortWriteRegisterBufferUshort(ptr ptr long) MAYBEFWD(NTOSKRNL.WRITE_REGISTER_BUFFER_USHORT) +@ stdcall ScsiPortWriteRegisterBufferUlong(ptr ptr long) MAYBEFWD(NTOSKRNL.WRITE_REGISTER_BUFFER_ULONG) +@ stdcall ScsiPortWriteRegisterUchar(ptr long) MAYBEFWD(NTOSKRNL.WRITE_REGISTER_UCHAR) +@ stdcall ScsiPortWriteRegisterUshort(ptr long) MAYBEFWD(NTOSKRNL.WRITE_REGISTER_USHORT) +@ stdcall ScsiPortWriteRegisterUlong(ptr long) MAYBEFWD(NTOSKRNL.WRITE_REGISTER_ULONG) diff --git a/drivers/storage/scsiport/scsiport.rbuild b/drivers/storage/scsiport/scsiport.rbuild new file mode 100644 index 00000000000..d56de33941a --- /dev/null +++ b/drivers/storage/scsiport/scsiport.rbuild @@ -0,0 +1,13 @@ + + + + + + + . + ntoskrnl + hal + scsiport.c + stubs.c + scsiport.rc + diff --git a/drivers/usb/directory.rbuild b/drivers/usb/directory.rbuild new file mode 100644 index 00000000000..04b926b50fd --- /dev/null +++ b/drivers/usb/directory.rbuild @@ -0,0 +1,16 @@ + + + + + + + + + diff --git a/drivers/usb/nt4compat/directory.rbuild b/drivers/usb/nt4compat/directory.rbuild new file mode 100644 index 00000000000..682ac9431c2 --- /dev/null +++ b/drivers/usb/nt4compat/directory.rbuild @@ -0,0 +1,7 @@ + + + + + + + diff --git a/drivers/usb/nt4compat/usbdriver/usbdriver.rbuild b/drivers/usb/nt4compat/usbdriver/usbdriver.rbuild new file mode 100644 index 00000000000..770e77e5434 --- /dev/null +++ b/drivers/usb/nt4compat/usbdriver/usbdriver.rbuild @@ -0,0 +1,30 @@ + + + + + + + + . + ntoskrnl + hal + ehci.c + ohci.c + uhci.c + roothub.c + hub.c + td.c + usb.c + umss.c + bulkonly.c + cbi.c + devmgr.c + dmgrdisp.c + compdrv.c + etd.c + gendrv.c + mouse.c + keyboard.c + usbdriver.rc + usbdriver.h + diff --git a/drivers/usb/usbd/usbd.rbuild b/drivers/usb/usbd/usbd.rbuild new file mode 100644 index 00000000000..c5900b5ff35 --- /dev/null +++ b/drivers/usb/usbd/usbd.rbuild @@ -0,0 +1,9 @@ + + + + + ntoskrnl + hal + usbd.c + usbd.rc + diff --git a/drivers/usb/usbehci/usbehci.rbuild b/drivers/usb/usbehci/usbehci.rbuild new file mode 100644 index 00000000000..f30b683d498 --- /dev/null +++ b/drivers/usb/usbehci/usbehci.rbuild @@ -0,0 +1,18 @@ + + + + ntoskrnl + hal + usbehci.c + hardware.c + physmem.c + hwiface.c + transfer.c + fdo.c + pdo.c + common.c + misc.c + irp.c + usbiffn.c + usbehci.rc + diff --git a/drivers/usb/usbhub/usbhub.rbuild b/drivers/usb/usbhub/usbhub.rbuild new file mode 100644 index 00000000000..c4c3bbd29a7 --- /dev/null +++ b/drivers/usb/usbhub/usbhub.rbuild @@ -0,0 +1,13 @@ + + + + ntoskrnl + hal + usbd + createclose.c + fdo.c + misc.c + pdo.c + usbhub.c + usbhub.rc + diff --git a/drivers/usb/usbstor/usbstor.rbuild b/drivers/usb/usbstor/usbstor.rbuild new file mode 100644 index 00000000000..d7215fc8e92 --- /dev/null +++ b/drivers/usb/usbstor/usbstor.rbuild @@ -0,0 +1,10 @@ + + + + + include + ntoskrnl + hal + usbstor.c + usbstor.rc + diff --git a/drivers/video/directory.rbuild b/drivers/video/directory.rbuild new file mode 100644 index 00000000000..03036110e78 --- /dev/null +++ b/drivers/video/directory.rbuild @@ -0,0 +1,16 @@ + + + + + + + + + + + + + + + + diff --git a/drivers/video/displays/directory.rbuild b/drivers/video/displays/directory.rbuild new file mode 100644 index 00000000000..37342e84499 --- /dev/null +++ b/drivers/video/displays/directory.rbuild @@ -0,0 +1,16 @@ + + + + + + + + + + + + + + + + diff --git a/drivers/video/displays/framebuf/framebuf.rbuild b/drivers/video/displays/framebuf/framebuf.rbuild new file mode 100644 index 00000000000..5dcb2f06832 --- /dev/null +++ b/drivers/video/displays/framebuf/framebuf.rbuild @@ -0,0 +1,13 @@ + + + + + . + win32k + enable.c + palette.c + pointer.c + screen.c + surface.c + framebuf.rc + diff --git a/drivers/video/displays/framebuf_new/framebuf_new.rbuild b/drivers/video/displays/framebuf_new/framebuf_new.rbuild new file mode 100644 index 00000000000..de7c4a1d3be --- /dev/null +++ b/drivers/video/displays/framebuf_new/framebuf_new.rbuild @@ -0,0 +1,21 @@ + + + + + . + win32k + debug.c + enable.c + palette.c + pointer.c + screen.c + framebuf_new.rc + + + -mrtd + -fno-builtin + -Wno-unused-variable + + + driver.h + diff --git a/drivers/video/displays/framebufacc/framebufacc.rbuild b/drivers/video/displays/framebufacc/framebufacc.rbuild new file mode 100644 index 00000000000..df893367e08 --- /dev/null +++ b/drivers/video/displays/framebufacc/framebufacc.rbuild @@ -0,0 +1,13 @@ + + + + + . + win32k + enable.c + palette.c + pointer.c + screen.c + surface.c + framebufacc.rc + diff --git a/drivers/video/displays/vga/vgaddi.rbuild b/drivers/video/displays/vga/vgaddi.rbuild new file mode 100644 index 00000000000..35479f8657e --- /dev/null +++ b/drivers/video/displays/vga/vgaddi.rbuild @@ -0,0 +1,24 @@ + + + + + . + win32k + + enable.c + + + screen.c + pointer.c + lineto.c + paint.c + bitblt.c + transblt.c + offscreen.c + copybits.c + + + vgavideo.c + + vgaddi.rc + diff --git a/drivers/video/font/bmfd/bmfd.rbuild b/drivers/video/font/bmfd/bmfd.rbuild new file mode 100644 index 00000000000..2f424df95b8 --- /dev/null +++ b/drivers/video/font/bmfd/bmfd.rbuild @@ -0,0 +1,9 @@ + + + + win32k + libcntpr + enable.c + font.c + glyph.c + diff --git a/drivers/video/font/directory.rbuild b/drivers/video/font/directory.rbuild new file mode 100644 index 00000000000..2ed97e32ca0 --- /dev/null +++ b/drivers/video/font/directory.rbuild @@ -0,0 +1,11 @@ + + + + + + + + + + + diff --git a/drivers/video/font/ftfd/ftfd.rbuild b/drivers/video/font/ftfd/ftfd.rbuild new file mode 100644 index 00000000000..34d822af2a7 --- /dev/null +++ b/drivers/video/font/ftfd/ftfd.rbuild @@ -0,0 +1,13 @@ + + + + + include + win32k + freetype + enable.c + font.c + glyph.c + rosglue.c + sprintf.c + diff --git a/drivers/video/miniport/directory.rbuild b/drivers/video/miniport/directory.rbuild new file mode 100644 index 00000000000..363c9097fee --- /dev/null +++ b/drivers/video/miniport/directory.rbuild @@ -0,0 +1,19 @@ + + + + + + + + + + + + + + + + + + + diff --git a/drivers/video/miniport/vbe/vbemp.rbuild b/drivers/video/miniport/vbe/vbemp.rbuild new file mode 100644 index 00000000000..8462a19f536 --- /dev/null +++ b/drivers/video/miniport/vbe/vbemp.rbuild @@ -0,0 +1,9 @@ + + + + . + videoprt + edid.c + vbemp.c + vbemp.rc + diff --git a/drivers/video/miniport/vga/vgamp.rbuild b/drivers/video/miniport/vga/vgamp.rbuild new file mode 100644 index 00000000000..307be0c8fab --- /dev/null +++ b/drivers/video/miniport/vga/vgamp.rbuild @@ -0,0 +1,10 @@ + + + + . + videoprt + initvga.c + vgamp.c + vgamp.rc + vgamp.h + diff --git a/drivers/video/miniport/vga_new/vga.rbuild b/drivers/video/miniport/vga_new/vga.rbuild new file mode 100644 index 00000000000..622440d4423 --- /dev/null +++ b/drivers/video/miniport/vga_new/vga.rbuild @@ -0,0 +1,18 @@ + + + + . + videoprt + libcntpr + modeset.c + vgadata.c + vga.c + vbemodes.c + vbe.c + vga.rc + vga.h + + -mrtd + -fno-builtin + + diff --git a/drivers/video/miniport/vmx_svga/vmx_svga.rbuild b/drivers/video/miniport/vmx_svga/vmx_svga.rbuild new file mode 100644 index 00000000000..2c03c8e767e --- /dev/null +++ b/drivers/video/miniport/vmx_svga/vmx_svga.rbuild @@ -0,0 +1,9 @@ + + + + . + videoprt + vmx_svga.c + vmx_svga.rc + precomp.h + diff --git a/drivers/video/miniport/xboxvmp/xboxvmp.rbuild b/drivers/video/miniport/xboxvmp/xboxvmp.rbuild new file mode 100644 index 00000000000..ac5a5232b14 --- /dev/null +++ b/drivers/video/miniport/xboxvmp/xboxvmp.rbuild @@ -0,0 +1,9 @@ + + + + . + ntoskrnl + videoprt + xboxvmp.c + xboxvmp.rc + diff --git a/drivers/video/videoprt/videoprt.rbuild b/drivers/video/videoprt/videoprt.rbuild new file mode 100644 index 00000000000..33e85561e6e --- /dev/null +++ b/drivers/video/videoprt/videoprt.rbuild @@ -0,0 +1,26 @@ + + + + + . + include + + ntoskrnl + hal + videoprt.h + agp.c + ddc.c + dispatch.c + dma.c + event.c + funclist.c + int10.c + interrupt.c + resource.c + services.c + spinlock.c + stubs.c + timer.c + videoprt.c + videoprt.rc + diff --git a/drivers/wdm/audio/backpln/audio_test/audio_test.rbuild b/drivers/wdm/audio/backpln/audio_test/audio_test.rbuild new file mode 100644 index 00000000000..fc5310819a8 --- /dev/null +++ b/drivers/wdm/audio/backpln/audio_test/audio_test.rbuild @@ -0,0 +1,13 @@ + + + + + include/reactos/libs/sound + . + . + setupapi + libsamplerate + ksuser + audio_test.c + + diff --git a/drivers/wdm/audio/backpln/directory.rbuild b/drivers/wdm/audio/backpln/directory.rbuild new file mode 100644 index 00000000000..e65bc580a61 --- /dev/null +++ b/drivers/wdm/audio/backpln/directory.rbuild @@ -0,0 +1,10 @@ + + + + + + + + + + diff --git a/drivers/wdm/audio/backpln/portcls/portcls.rbuild b/drivers/wdm/audio/backpln/portcls/portcls.rbuild new file mode 100644 index 00000000000..9b008b652d3 --- /dev/null +++ b/drivers/wdm/audio/backpln/portcls/portcls.rbuild @@ -0,0 +1,65 @@ + + + + + 0x600 + . + ntoskrnl + ks + drmk + hal + libcntpr + pseh + + + -fno-exceptions + -fno-rtti + + + + /GR- + + + adapter.cpp + api.cpp + connection.cpp + dispatcher.cpp + dll.cpp + dma_slave.cpp + drm.cpp + drm_port.cpp + filter_topology.cpp + filter_dmus.cpp + filter_wavecyclic.cpp + filter_wavepci.cpp + filter_wavert.cpp + guids.cpp + interrupt.cpp + irp.cpp + irpstream.cpp + miniport.cpp + miniport_dmus.cpp + miniport_fmsynth.cpp + pin_dmus.cpp + pin_wavecyclic.cpp + pin_wavepci.cpp + pin_wavert.cpp + pool.cpp + port.cpp + port_dmus.cpp + port_topology.cpp + port_wavecyclic.cpp + port_wavepci.cpp + port_wavert.cpp + port_wavertstream.cpp + power.cpp + propertyhandler.cpp + purecall.cpp + registry.cpp + resource.cpp + service_group.cpp + undoc.cpp + unregister.cpp + version.cpp + portcls.rc + diff --git a/drivers/wdm/audio/directory.rbuild b/drivers/wdm/audio/directory.rbuild new file mode 100644 index 00000000000..f3a2dd90827 --- /dev/null +++ b/drivers/wdm/audio/directory.rbuild @@ -0,0 +1,22 @@ + + + + + + + + + + + + + + + + + + + + + + diff --git a/drivers/wdm/audio/drivers/CMIDriver/cmidriver.rbuild b/drivers/wdm/audio/drivers/CMIDriver/cmidriver.rbuild new file mode 100644 index 00000000000..7e00b457a13 --- /dev/null +++ b/drivers/wdm/audio/drivers/CMIDriver/cmidriver.rbuild @@ -0,0 +1,24 @@ + + + + + + -fno-exceptions + -fno-rtti + + + + /GR- + + + . + ntoskrnl + portcls + hal + ks + adapter.cpp + common.cpp + mintopo.cpp + minwave.cpp + cmipci.rc + \ No newline at end of file diff --git a/drivers/wdm/audio/drivers/directory.rbuild b/drivers/wdm/audio/drivers/directory.rbuild new file mode 100644 index 00000000000..8698eb34622 --- /dev/null +++ b/drivers/wdm/audio/drivers/directory.rbuild @@ -0,0 +1,13 @@ + + + + + + + diff --git a/drivers/wdm/audio/drivers/mpu401/mpu401.rbuild b/drivers/wdm/audio/drivers/mpu401/mpu401.rbuild new file mode 100644 index 00000000000..366e3c0328b --- /dev/null +++ b/drivers/wdm/audio/drivers/mpu401/mpu401.rbuild @@ -0,0 +1,14 @@ + + + + . + .. + + -fno-exceptions + -fno-rtti + + ntoskrnl + portcls + mpu401.rc + adapter.cpp + diff --git a/drivers/wdm/audio/drivers/sb16/sb16.rbuild b/drivers/wdm/audio/drivers/sb16/sb16.rbuild new file mode 100644 index 00000000000..8c0cf84035c --- /dev/null +++ b/drivers/wdm/audio/drivers/sb16/sb16.rbuild @@ -0,0 +1,11 @@ + + + + . + .. + ntoskrnl + portcls + stdunk.cpp + adapter.cpp + main.cpp + diff --git a/drivers/wdm/audio/drm/directory.rbuild b/drivers/wdm/audio/drm/directory.rbuild new file mode 100644 index 00000000000..40b1286a2fd --- /dev/null +++ b/drivers/wdm/audio/drm/directory.rbuild @@ -0,0 +1,7 @@ + + + + + + + diff --git a/drivers/wdm/audio/drm/drmk/drmk.rbuild b/drivers/wdm/audio/drm/drmk/drmk.rbuild new file mode 100644 index 00000000000..a8f5ba1c299 --- /dev/null +++ b/drivers/wdm/audio/drm/drmk/drmk.rbuild @@ -0,0 +1,16 @@ + + + + . + .. + ../include + + -fno-exceptions + -fno-rtti + + + ntoskrnl + + stubs.cpp + drmk.rc + diff --git a/drivers/wdm/audio/filters/directory.rbuild b/drivers/wdm/audio/filters/directory.rbuild new file mode 100644 index 00000000000..6d81a975acf --- /dev/null +++ b/drivers/wdm/audio/filters/directory.rbuild @@ -0,0 +1,10 @@ + + + + + + + + diff --git a/drivers/wdm/audio/filters/kmixer/kmixer.rbuild b/drivers/wdm/audio/filters/kmixer/kmixer.rbuild new file mode 100644 index 00000000000..d5fcf8c3906 --- /dev/null +++ b/drivers/wdm/audio/filters/kmixer/kmixer.rbuild @@ -0,0 +1,14 @@ + + + + . + . + ntoskrnl + ks + hal + libcntpr + libsamplerate + kmixer.c + filter.c + pin.c + diff --git a/drivers/wdm/audio/filters/splitter/splitter.rbuild b/drivers/wdm/audio/filters/splitter/splitter.rbuild new file mode 100644 index 00000000000..299df5e68e7 --- /dev/null +++ b/drivers/wdm/audio/filters/splitter/splitter.rbuild @@ -0,0 +1,9 @@ + + + + ntoskrnl + ks + splitter.c + filter.c + pin.c + diff --git a/drivers/wdm/audio/legacy/directory.rbuild b/drivers/wdm/audio/legacy/directory.rbuild new file mode 100644 index 00000000000..ee72e83f9b8 --- /dev/null +++ b/drivers/wdm/audio/legacy/directory.rbuild @@ -0,0 +1,10 @@ + + + + + + + + diff --git a/drivers/wdm/audio/legacy/stream/stream.rbuild b/drivers/wdm/audio/legacy/stream/stream.rbuild new file mode 100644 index 00000000000..e4f632b9469 --- /dev/null +++ b/drivers/wdm/audio/legacy/stream/stream.rbuild @@ -0,0 +1,17 @@ + + + + . + + + ntoskrnl + ks + pseh + control.c + driver.c + dll.c + filter.c + helper.c + pnp.c + stream.rc + diff --git a/drivers/wdm/audio/legacy/wdmaud/wdmaud.rbuild b/drivers/wdm/audio/legacy/wdmaud/wdmaud.rbuild new file mode 100644 index 00000000000..62bd101e562 --- /dev/null +++ b/drivers/wdm/audio/legacy/wdmaud/wdmaud.rbuild @@ -0,0 +1,20 @@ + + + + . + . + include/reactos/libs/sound + + mmixer + ntoskrnl + libcntpr + ks + pseh + hal + control.c + deviface.c + entry.c + mmixer.c + sup.c + wdmaud.rc + diff --git a/drivers/wdm/audio/sysaudio/sysaudio.rbuild b/drivers/wdm/audio/sysaudio/sysaudio.rbuild new file mode 100644 index 00000000000..5f69af6effa --- /dev/null +++ b/drivers/wdm/audio/sysaudio/sysaudio.rbuild @@ -0,0 +1,16 @@ + + + + . + ntoskrnl + ks + hal + libcntpr + + control.c + deviface.c + dispatcher.c + main.c + pin.c + sysaudio.rc + diff --git a/drivers/wdm/wdm.rbuild b/drivers/wdm/wdm.rbuild new file mode 100644 index 00000000000..97fb7ac9a5d --- /dev/null +++ b/drivers/wdm/wdm.rbuild @@ -0,0 +1,7 @@ + + + + + + + diff --git a/drivers/wmi/wmilib.rbuild b/drivers/wmi/wmilib.rbuild new file mode 100644 index 00000000000..9cbb4c6400b --- /dev/null +++ b/drivers/wmi/wmilib.rbuild @@ -0,0 +1,9 @@ + + + + + . + ntoskrnl + wmilib.c + wmilib.rc + diff --git a/hal/hal.pspec b/hal/hal.pspec new file mode 100644 index 00000000000..3edf88ca595 --- /dev/null +++ b/hal/hal.pspec @@ -0,0 +1,106 @@ +#include "include/reactos/msvctarget.h" +#undef i386 + +#ifdef _M_ARM +@ fastcall ExAcquireFastMutex(ptr) +@ fastcall ExReleaseFastMutex(ptr) +#else +@ fastcall -arch=i386 ExAcquireFastMutex(ptr) ExiAcquireFastMutex +@ fastcall -arch=i386 ExReleaseFastMutex(ptr) ExiReleaseFastMutex +#endif +@ fastcall -arch=i386 ExTryToAcquireFastMutex(ptr) ntoskrnl.ExiTryToAcquireFastMutex +@ fastcall -arch=arm ExTryToAcquireFastMutex(ptr) +@ fastcall HalClearSoftwareInterrupt(long) +@ fastcall HalRequestSoftwareInterrupt(long) +@ fastcall HalSystemVectorDispatchEntry(long long long) +@ fastcall -arch=i386,arm KeAcquireInStackQueuedSpinLock(ptr ptr) +@ fastcall -arch=i386,arm KeAcquireInStackQueuedSpinLockRaiseToSynch(ptr ptr) +@ fastcall -arch=i386,arm KeAcquireSpinLockRaiseToSynch(ptr) +@ fastcall -arch=i386,arm KeAcquireQueuedSpinLock(ptr) +@ fastcall -arch=i386,arm KeAcquireQueuedSpinLockRaiseToSynch(ptr) +@ fastcall -arch=i386,arm KeReleaseInStackQueuedSpinLock(ptr) +@ fastcall -arch=i386,arm KeReleaseQueuedSpinLock(ptr long) +@ fastcall -arch=i386,arm KeTryToAcquireQueuedSpinLock(long ptr) +@ fastcall -arch=i386,arm KeTryToAcquireQueuedSpinLockRaiseToSynch(long ptr) +@ fastcall -arch=i386,arm KfAcquireSpinLock(ptr) +@ fastcall -arch=i386,arm KfLowerIrql(long) +@ fastcall -arch=i386,arm KfRaiseIrql(long) +@ fastcall -arch=i386,arm KfReleaseSpinLock(ptr long) +@ stdcall HalAcquireDisplayOwnership(ptr) +@ stdcall HalAdjustResourceList(ptr) +@ stdcall HalAllProcessorsStarted() +@ stdcall HalAllocateAdapterChannel(ptr ptr long ptr) +@ stdcall HalAllocateCommonBuffer(ptr long ptr long) +@ stdcall HalAllocateCrashDumpRegisters(ptr ptr) +@ stdcall HalAssignSlotResources(ptr ptr ptr ptr long long long ptr) +@ stdcall HalBeginSystemInterrupt(long long ptr) +@ stdcall HalCalibratePerformanceCounter(ptr long long) +@ stdcall HalDisableSystemInterrupt(long long) +@ stdcall HalDisplayString(str) +@ stdcall HalEnableSystemInterrupt(long long long) +@ stdcall HalEndSystemInterrupt(long long) +@ stdcall HalFlushCommonBuffer(long long long long long) +@ stdcall HalFreeCommonBuffer(ptr long long long ptr long) +@ stdcall HalGetAdapter(ptr ptr) +@ stdcall HalGetBusData(long long long ptr long) +@ stdcall HalGetBusDataByOffset(long long long ptr long long) +@ stdcall HalGetEnvironmentVariable(str long str) +@ fastcall -arch=arm HalGetInterruptSource() +@ stdcall HalGetInterruptVector(long long long long ptr ptr) +@ stdcall -arch=i386 HalHandleNMI(ptr) +@ stdcall HalInitSystem(long ptr) +@ stdcall HalInitializeProcessor(long ptr) +@ stdcall HalMakeBeep(long) +@ stdcall HalProcessorIdle() +@ stdcall HalPutDmaAdapter(ptr) +@ stdcall HalQueryDisplayParameters(ptr ptr ptr ptr) +@ stdcall HalQueryRealTimeClock(ptr) +@ stdcall HalReadDmaCounter(ptr) +@ stdcall HalReportResourceUsage() +@ stdcall HalRequestIpi(long) +@ stdcall HalReturnToFirmware(long) +@ stdcall HalSetBusData(long long long ptr long) +@ stdcall HalSetBusDataByOffset(long long long ptr long long) +@ stdcall HalSetDisplayParameters(long long) +@ stdcall HalSetEnvironmentVariable(str str) +@ stdcall HalSetProfileInterval(long) +@ stdcall HalSetRealTimeClock(ptr) +@ stdcall HalSetTimeIncrement(long) +@ stdcall HalStartNextProcessor(ptr ptr) +@ stdcall HalStartProfileInterrupt(long) +@ stdcall HalStopProfileInterrupt(long) +@ fastcall -arch=arm HalSweepIcache() +@ fastcall -arch=arm HalSweepDcache() +@ stdcall HalTranslateBusAddress(long long long long ptr ptr) +@ stdcall IoFlushAdapterBuffers(ptr ptr ptr ptr long long) +@ stdcall IoFreeAdapterChannel(ptr) +@ stdcall IoFreeMapRegisters(ptr ptr long) +@ stdcall IoMapTransfer(ptr ptr ptr ptr ptr long) +@ stdcall -arch=i386,x86_64 IoAssignDriveLetters(ptr str ptr ptr) HalpAssignDriveLetters +@ stdcall -arch=i386,x86_64 IoReadPartitionTable(ptr long long ptr) HalpReadPartitionTable +@ stdcall -arch=i386,x86_64 IoSetPartitionInformation(ptr long long long) HalpSetPartitionInformation +@ stdcall -arch=i386,x86_64 IoWritePartitionTable(ptr long long long ptr) HalpWritePartitionTable +@ stdcall -arch=i386,arm KeAcquireSpinLock(ptr ptr) +@ extern KdComPortInUse +@ stdcall KeFlushWriteBuffer() +@ stdcall -arch=i386,arm KeGetCurrentIrql() +@ stdcall -arch=i386,arm KeLowerIrql(long) +@ stdcall KeQueryPerformanceCounter(ptr) +@ stdcall -arch=i386,arm KeRaiseIrql(long ptr) +@ stdcall -arch=i386,arm KeRaiseIrqlToDpcLevel() +@ stdcall -arch=i386,arm KeRaiseIrqlToSynchLevel() +@ stdcall -arch=i386,arm KeReleaseSpinLock(ptr long) +@ stdcall KeStallExecutionProcessor(long) +@ stdcall -arch=i386,arm READ_PORT_BUFFER_UCHAR(ptr ptr long) +@ stdcall -arch=i386,arm READ_PORT_BUFFER_ULONG(ptr ptr long) +@ stdcall -arch=i386,arm READ_PORT_BUFFER_USHORT(ptr ptr long) +@ stdcall -arch=i386,arm READ_PORT_UCHAR(ptr) +@ stdcall -arch=i386,arm READ_PORT_ULONG(ptr) +@ stdcall -arch=i386,arm READ_PORT_USHORT(ptr) +@ stdcall -arch=i386,arm WRITE_PORT_BUFFER_UCHAR(ptr ptr long) +@ stdcall -arch=i386,arm WRITE_PORT_BUFFER_ULONG(ptr ptr long) +@ stdcall -arch=i386,arm WRITE_PORT_BUFFER_USHORT(ptr ptr long) +@ stdcall -arch=i386,arm WRITE_PORT_UCHAR(ptr long) +@ stdcall -arch=i386,arm WRITE_PORT_ULONG(ptr long) +@ stdcall -arch=i386,arm WRITE_PORT_USHORT(ptr long) +@ stdcall -arch=x86_64 HalInitializeBios(long ptr) diff --git a/hal/hal.rbuild b/hal/hal.rbuild new file mode 100644 index 00000000000..c81a61d1f22 --- /dev/null +++ b/hal/hal.rbuild @@ -0,0 +1,27 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/hal/halarm/directory.rbuild b/hal/halarm/directory.rbuild new file mode 100644 index 00000000000..4e0dfcac6a6 --- /dev/null +++ b/hal/halarm/directory.rbuild @@ -0,0 +1,18 @@ + + + + + + + + + + + + + + + + + + diff --git a/hal/halarm/hal.rbuild b/hal/halarm/hal.rbuild new file mode 100644 index 00000000000..71eb9f9b622 --- /dev/null +++ b/hal/halarm/hal.rbuild @@ -0,0 +1,18 @@ + + + + + + + include + include + + hal_generic + ntoskrnl + + + halinit_up.c + halup.rc + + + diff --git a/hal/halarm/hal_generic.rbuild b/hal/halarm/hal_generic.rbuild new file mode 100644 index 00000000000..b8619077e38 --- /dev/null +++ b/hal/halarm/hal_generic.rbuild @@ -0,0 +1,33 @@ + + + + + include + include + + + beep.c + bus.c + cache.S + dma.c + drive.c + display.c + fmutex.c + halinit.c + misc.c + pic.c + portio.c + processor.c + profil.c + reboot.c + rtc.c + spinlock.c + sysinfo.c + timer.c + usage.c + + + hal.h + + + diff --git a/hal/halarm/versa/halup.rbuild b/hal/halarm/versa/halup.rbuild new file mode 100644 index 00000000000..88db996966f --- /dev/null +++ b/hal/halarm/versa/halup.rbuild @@ -0,0 +1,16 @@ + + + + + + include + include + + hal_generic + ntoskrnl + kdcom + + halinit_up.c + halup.rc + + diff --git a/hal/halppc/directory.rbuild b/hal/halppc/directory.rbuild new file mode 100644 index 00000000000..1e0c730ba32 --- /dev/null +++ b/hal/halppc/directory.rbuild @@ -0,0 +1,10 @@ + + + + + + + + + + diff --git a/hal/halppc/generic/generic.rbuild b/hal/halppc/generic/generic.rbuild new file mode 100644 index 00000000000..e1052317d74 --- /dev/null +++ b/hal/halppc/generic/generic.rbuild @@ -0,0 +1,29 @@ + + + + ../include + include + + beep.c + bus.c + cmos.c + display.c + dma.c + drive.c + enum.c + fmutex.c + font.c + halinit.c + irql.c + isa.c + misc.c + pci.c + portio.c + processor.c + profil.c + reboot.c + spinlock.c + sysinfo.c + timer.c + ../include/hal.h + diff --git a/hal/halppc/up/halup.rbuild b/hal/halppc/up/halup.rbuild new file mode 100644 index 00000000000..d3a3ba0b5c5 --- /dev/null +++ b/hal/halppc/up/halup.rbuild @@ -0,0 +1,13 @@ + + + + + + ../include + include + + halppc_generic + ntoskrnl + halinit_up.c + halup.rc + diff --git a/hal/halx86/directory.rbuild b/hal/halx86/directory.rbuild new file mode 100644 index 00000000000..9c8c482a2c7 --- /dev/null +++ b/hal/halx86/directory.rbuild @@ -0,0 +1,25 @@ + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/hal/halx86/hal.rbuild b/hal/halx86/hal.rbuild new file mode 100644 index 00000000000..80cc50f0fe1 --- /dev/null +++ b/hal/halx86/hal.rbuild @@ -0,0 +1,21 @@ + + + + + + + include + include + + + hal_generic + hal_generic_pcat + hal_generic_up + ntoskrnl + libcntpr + + halinit_up.c + halup.rc + + + diff --git a/hal/halx86/hal_generic.rbuild b/hal/halx86/hal_generic.rbuild new file mode 100644 index 00000000000..9b697bbb094 --- /dev/null +++ b/hal/halx86/hal_generic.rbuild @@ -0,0 +1,35 @@ + + + + + include + include + + + + beep.c + cmos.c + display.c + dma.c + drive.c + memory.c + misc.c + profil.c + reboot.c + sysinfo.c + timer.c + usage.c + + bios.c + + portio.c + systimer.S + trap.S + + + + + hal.h + + + diff --git a/hal/halx86/hal_generic_acpi.rbuild b/hal/halx86/hal_generic_acpi.rbuild new file mode 100644 index 00000000000..19e2b8093b2 --- /dev/null +++ b/hal/halx86/hal_generic_acpi.rbuild @@ -0,0 +1,26 @@ + + + + + include + include + + + + + + halacpi.c + halpnpdd.c + busemul.c + + + + pcibus.c + + + + halinit.c + + + + diff --git a/hal/halx86/hal_generic_mp.rbuild b/hal/halx86/hal_generic_mp.rbuild new file mode 100644 index 00000000000..5063a045c1a --- /dev/null +++ b/hal/halx86/hal_generic_mp.rbuild @@ -0,0 +1,23 @@ + + + + + include + include + + + + + spinlock.c + + + apic.c + halinit_mp.c + ioapic.c + ipi_mp.c + mpconfig.c + processor_mp.c + halmp.rc + + + diff --git a/hal/halx86/hal_generic_pcat.rbuild b/hal/halx86/hal_generic_pcat.rbuild new file mode 100644 index 00000000000..3ae5c2a4779 --- /dev/null +++ b/hal/halx86/hal_generic_pcat.rbuild @@ -0,0 +1,27 @@ + + + + + include + include + + + + + + bushndlr.c + cmosbus.c + isabus.c + pcibus.c + pcidata.c + sysbus.c + + bussupp.c + halpcat.c + + + halinit.c + + + + diff --git a/hal/halx86/hal_generic_up.rbuild b/hal/halx86/hal_generic_up.rbuild new file mode 100644 index 00000000000..732a374b86c --- /dev/null +++ b/hal/halx86/hal_generic_up.rbuild @@ -0,0 +1,17 @@ + + + + + include + include + + + + spinlock.c + + + pic.c + processor.c + + + diff --git a/hal/halx86/hal_mini.rbuild b/hal/halx86/hal_mini.rbuild new file mode 100644 index 00000000000..b189e808190 --- /dev/null +++ b/hal/halx86/hal_mini.rbuild @@ -0,0 +1,46 @@ + + + + + include + include + + + + + + + + bushndlr.c + cmosbus.c + isabus.c + pcibus.c + sysbus.c + + bussupp.c + + beep.c + bios.c + cmos.c + dma.c + display.c + drive.c + misc.c + profil.c + reboot.c + spinlock.c + sysinfo.c + timer.c + usage.c + + portio.c + systimer.S + + + + halinit_up.c + pic.c + processor.c + + + diff --git a/hal/halx86/halacpi.rbuild b/hal/halx86/halacpi.rbuild new file mode 100644 index 00000000000..21b9f8f8384 --- /dev/null +++ b/hal/halx86/halacpi.rbuild @@ -0,0 +1,22 @@ + + + + + + + include + include + + + + hal_generic + hal_generic_acpi + hal_generic_up + ntoskrnl + libcntpr + + halinit_up.c + halup.rc + + + diff --git a/hal/halx86/halamd64.rbuild b/hal/halx86/halamd64.rbuild new file mode 100644 index 00000000000..3f443181cc4 --- /dev/null +++ b/hal/halx86/halamd64.rbuild @@ -0,0 +1,33 @@ + + + + + + + include + include + + + + + + hal_generic + hal_generic_acpi + ntoskrnl + + + + spinlock.c + + + + x86bios.c + halinit.c + stubs.c + systimer.S + processor.c + + + + + diff --git a/hal/halx86/halmps.rbuild b/hal/halx86/halmps.rbuild new file mode 100644 index 00000000000..8d949b709b5 --- /dev/null +++ b/hal/halx86/halmps.rbuild @@ -0,0 +1,27 @@ + + + + + + + include + include + + + + hal_generic + hal_generic_pcat + hal_generic_mp + ntoskrnl + libcntpr + + + + mps.S + mpsboot.asm + mpsirql.c + + + + + diff --git a/hal/halx86/halxbox.rbuild b/hal/halx86/halxbox.rbuild new file mode 100644 index 00000000000..ad13545b405 --- /dev/null +++ b/hal/halx86/halxbox.rbuild @@ -0,0 +1,23 @@ + + + + + + include + include + + + + hal_generic + hal_generic_pcat + hal_generic_up + ntoskrnl + libcntpr + + halinit_xbox.c + part_xbox.c + halxbox.rc + halxbox.h + + + diff --git a/hal/halx86/mp/i386/mps.S b/hal/halx86/mp/i386/mps.S index 250ab9c7d97..094780f4826 100644 --- a/hal/halx86/mp/i386/mps.S +++ b/hal/halx86/mp/i386/mps.S @@ -11,9 +11,7 @@ /* INCLUDES ******************************************************************/ -#include - -#include +#include /* FUNCTIONS *****************************************************************/ diff --git a/include/directory.rbuild b/include/directory.rbuild new file mode 100644 index 00000000000..2114849e43b --- /dev/null +++ b/include/directory.rbuild @@ -0,0 +1,13 @@ + + + + + + + + + + + + + diff --git a/include/dxsdk/dxsdk.rbuild b/include/dxsdk/dxsdk.rbuild new file mode 100644 index 00000000000..31648d46995 --- /dev/null +++ b/include/dxsdk/dxsdk.rbuild @@ -0,0 +1,20 @@ + + + + amvideo.idl + amstream.idl + austream.idl + bdatif.idl + ddstream.idl + dmodshow.idl + mixerocx.idl + mediaobj.idl + medparam.idl + mmstream.idl + qedit.idl + regbag.idl + tvratings.idl + vidcap.idl + videoacc.idl + strmif.idl + diff --git a/include/psdk/psdk.rbuild b/include/psdk/psdk.rbuild new file mode 100644 index 00000000000..fa5f59fd909 --- /dev/null +++ b/include/psdk/psdk.rbuild @@ -0,0 +1,88 @@ + + + + + bugcodes + activaut.idl + activdbg.idl + activscp.idl + asptlb.idl + bdaiface.idl + bits1_5.idl + bits.idl + commoncontrols.idl + control.idl + ctfutb.idl + ctxtcall.idl + dimm.idl + dispex.idl + docobj.idl + downloadmgr.idl + fusion.idl + hlink.idl + htiframe.idl + iads.idl + icftypes.idl + imnact.idl + imnxport.idl + indexsrv.idl + mimeinfo.idl + mlang.idl + msctf.idl + msdadc.idl + mshtml.idl + msinkaut.idl + mstask.idl + msxml.idl + msxml2.idl + netfw.idl + netcon.idl + oaidl.idl + objidl.idl + objsafe.idl + ocidl.idl + ocmm.idl + oleacc.idl + oledb.idl + oleidl.idl + optary.idl + perhist.idl + propidl.idl + propsys.idl + pstore.idl + richole.idl + sensevts.idl + servprov.idl + shdeprecated.idl + shldisp.idl + shobjidl.idl + shtypes.idl + strmif.idl + structuredquerycondition.idl + textstor.idl + tuner.idl + tom.idl + unknwn.idl + urlhist.idl + urlmon.idl + wincodec.idl + mimeole.idl + mscoree.idl + mshtmhst.idl + msxml6.idl + exdisp.idl + winsxs.idl + wtypes.idl + wuapi.idl + comcat.idl + xmldso.idl + xmldom.idl + xmllite.idl + wbemcli.idl + wia_lh.idl + wia_xp.idl + + + stdole2.idl + + \ No newline at end of file diff --git a/include/reactos/idl/idl.rbuild b/include/reactos/idl/idl.rbuild new file mode 100644 index 00000000000..3746bbebbab --- /dev/null +++ b/include/reactos/idl/idl.rbuild @@ -0,0 +1,36 @@ + + + + + 0x600 + pnp.idl + + + 0x600 + pnp.idl + + + svcctl.idl + + + svcctl.idl + + + eventlogrpc.idl + + + eventlogrpc.idl + + + lsa.idl + + + lsa.idl + + + wlansvc.idl + + + wlansvc.idl + + diff --git a/include/reactos/mc/mc.rbuild b/include/reactos/mc/mc.rbuild new file mode 100644 index 00000000000..bcd153e6021 --- /dev/null +++ b/include/reactos/mc/mc.rbuild @@ -0,0 +1,31 @@ + + + + + ntstatus.mc + + + + bugcodes.mc + + + + errcodes.mc + + + + pciclass.mc + + + + neteventmsg.mc + + + + ntiologc.mc + + + + sacmsg.mc + + \ No newline at end of file diff --git a/include/reactos/reactos.rbuild b/include/reactos/reactos.rbuild new file mode 100644 index 00000000000..4173d859127 --- /dev/null +++ b/include/reactos/reactos.rbuild @@ -0,0 +1,13 @@ + + + + + + + + + + + + + diff --git a/include/reactos/syscalls.inc b/include/reactos/syscalls.inc new file mode 100644 index 00000000000..a0d2832c844 --- /dev/null +++ b/include/reactos/syscalls.inc @@ -0,0 +1,94 @@ + +#ifdef _M_IX86 +#define KUSER_SHARED_SYSCALL HEX(7ffe0300) +#define KGDT_R0_CODE 8 +MACRO(STUBCODE_U, SyscallId, StackBytes) + mov eax, SyscallId + mov ecx, KUSER_SHARED_SYSCALL + call dword ptr [ecx] + ret StackBytes +ENDM +MACRO(STUBCODE_K, SyscallId, StackBytes) + mov eax, SyscallId + lea edx, [esp + 4] + pushf + push KGDT_R0_CODE + call _KiSystemService + ret StackBytes +ENDM +#elif defined(_M_AMD64) +MACRO(STUBCODE_U, SyscallId, StackBytes) + mov eax, SyscallId + mov r10, rcx + syscall + ret StackBytes +ENDM +MACRO(STUBCODE_K, SyscallId, StackBytes) + mov eax, SyscallId + call KiSystemService + ret StackBytes +ENDM +#elif defined(_M_ARM) +MACRO(STUBCODE_U, SyscallId, StackBytes) + swi #SyscallId + bx lr +ENDM +MACRO(STUBCODE_K, SyscallId, StackBytes) + mov ip, lr + swi #SyscallId + bx ip +ENDM +#elif defined(_M_PPC) +MACRO(STUBCODE_U, SyscallId, StackBytes) + stwu 1,-16(1) + mflr 0 + stw 0,0(1) + li 0, SyscallId + sc + lwz 0,0(1) + mtlr 0 + addi 1,1,16 + blr +ENDM +#define STUBCODE_K STUBCODE_U +#elif defined(_M_MIPS) +MACRO(STUBCODE_U, SyscallId, StackBytes) + li $8, KUSER_SHARED_SYSCALL + lw $8,0($8) + j $8 + nop +ENDM +MACRO(STUBCODE_K, SyscallId, StackBytes) + j KiSystemService + nop +ENDM +#else +#error unsupported architecture +#endif + +#ifdef _M_IX86 +MACRO(MAKE_LABEL, Name, Stackbytes) + PUBLIC _&Name&@&Stackbytes + _&Name&@&Stackbytes: +ENDM +#else +MACRO(MAKE_LABEL, Name, Stackbytes) + PUBLIC &Name + &Name: +ENDM +#endif + +MACRO(STUB_U, Name, ArgCount) + Stackbytes = 4 * &ArgCount + MAKE_LABEL Zw&Name, %Stackbytes + MAKE_LABEL Nt&Name, %Stackbytes + STUBCODE_U SyscallId, %Stackbytes + SyscallId = SyscallId + 1 +ENDM + +MACRO(STUB_K, Name, ArgCount) + Stackbytes = 4 * &ArgCount + MAKE_LABEL Zw&Name, %Stackbytes + STUBCODE_K SyscallId, %Stackbytes + SyscallId = SyscallId + 1 +ENDM diff --git a/include/reactos/version.h b/include/reactos/version.h new file mode 100644 index 00000000000..3a1ed1eb95d --- /dev/null +++ b/include/reactos/version.h @@ -0,0 +1,32 @@ +/* $Id: version.h 50254 2011-01-01 15:54:31Z cfinck $ + * + * COPYRIGHT: See COPYING in the top level directory + * PROJECT: ReactOS kernel + * FILE: include/internal/version.h + * PURPOSE: Defines the current version + * PROGRAMMER: David Welch (welch@mcmail.com) + * REVISIONS: + * 1999-11-06 (ea) + * Moved from include/internal in include/reactos + * to be used by buildno. + * 2002-01-17 (ea) + * KERNEL_VERSION removed. Use + * reactos/buildno.h:KERNEL_VERSION_STR instead. + */ + +#ifndef __VERSION_H +#define __VERSION_H + +#define KERNEL_VERSION_MAJOR 0 +#define KERNEL_VERSION_MINOR 4 +#define KERNEL_VERSION_PATCH_LEVEL 0 + +#define COPYRIGHT_YEAR "2011" + +/* KERNEL_VERSION_BUILD_TYPE is L"SVN", L"RC1", L"RC2" or L"" (for the release) */ +#define KERNEL_VERSION_BUILD_TYPE L"SVN" + + +#endif + +/* EOF */ diff --git a/include/reactos/wine/wineheaders.rbuild b/include/reactos/wine/wineheaders.rbuild new file mode 100644 index 00000000000..8b9a00e3855 --- /dev/null +++ b/include/reactos/wine/wineheaders.rbuild @@ -0,0 +1,5 @@ + + + + itss.idl + diff --git a/lib/3rdparty/3rdparty.rbuild b/lib/3rdparty/3rdparty.rbuild new file mode 100644 index 00000000000..17d29b951e3 --- /dev/null +++ b/lib/3rdparty/3rdparty.rbuild @@ -0,0 +1,46 @@ + + + + + -Wno-unused-value + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/lib/3rdparty/adns/adns.rbuild b/lib/3rdparty/adns/adns.rbuild new file mode 100644 index 00000000000..4a3e2c7a9df --- /dev/null +++ b/lib/3rdparty/adns/adns.rbuild @@ -0,0 +1,22 @@ + + + + src + adns_win32 + + + adns_unix_calls.c + + + check.c + event.c + general.c + parse.c + poll.c + query.c + reply.c + setup.c + transmit.c + types.c + + diff --git a/lib/3rdparty/bzip2/bzip2.rbuild b/lib/3rdparty/bzip2/bzip2.rbuild new file mode 100644 index 00000000000..f58e45dee12 --- /dev/null +++ b/lib/3rdparty/bzip2/bzip2.rbuild @@ -0,0 +1,14 @@ + + + + + + + ntoskrnl + bzlib.c + randtable.c + crctable.c + decompress.c + huffman.c + dllmain.c + diff --git a/lib/3rdparty/cardlib/cardlib.rbuild b/lib/3rdparty/cardlib/cardlib.rbuild new file mode 100644 index 00000000000..4d65605c2cd --- /dev/null +++ b/lib/3rdparty/cardlib/cardlib.rbuild @@ -0,0 +1,19 @@ + + + + advapi32 + user32 + gdi32 + comctl32 + cardbitmaps.cpp + cardbutton.cpp + cardcolor.cpp + cardcount.cpp + cardlib.cpp + cardregion.cpp + cardrgndraw.cpp + cardrgnmouse.cpp + cardstack.cpp + cardwindow.cpp + dropzone.cpp + diff --git a/lib/3rdparty/expat/expat.rbuild b/lib/3rdparty/expat/expat.rbuild new file mode 100644 index 00000000000..bfb6cbc0997 --- /dev/null +++ b/lib/3rdparty/expat/expat.rbuild @@ -0,0 +1,13 @@ + + + + . + lib + include/reactos/libs/expat + + + xmlparse.c + xmlrole.c + xmltok.c + + diff --git a/lib/3rdparty/freetype/freetype.rbuild b/lib/3rdparty/freetype/freetype.rbuild new file mode 100644 index 00000000000..081cf018a72 --- /dev/null +++ b/lib/3rdparty/freetype/freetype.rbuild @@ -0,0 +1,94 @@ + + + + include + + + + + ftbase.c + ftbbox.c + ftbdf.c + ftbitmap.c + ftdebug.c + ftgasp.c + ftglyph.c + ftgxval.c + ftinit.c + ftlcdfil.c + ftmm.c + ftotval.c + ftpatent.c + ftpfr.c + ftstroke.c + ftsynth.c + ftsystem.c + fttype1.c + ftwinfnt.c + ftxf86.c + + + autofit.c + + + bdf.c + + + ftcache.c + + + cff.c + + + type1cid.c + + + gxvalid.c + + + ftgzip.c + + + ftlzw.c + + + otvalid.c + + + pcf.c + + + pfr.c + + + psaux.c + + + pshinter.c + + + psnames.c + + + raster.c + + + sfnt.c + + + smooth.c + + + truetype.c + + + type1.c + + + type42.c + + + winfnt.c + + + diff --git a/lib/3rdparty/fullfat/fullfat.rbuild b/lib/3rdparty/fullfat/fullfat.rbuild new file mode 100644 index 00000000000..4e18e3b3c18 --- /dev/null +++ b/lib/3rdparty/fullfat/fullfat.rbuild @@ -0,0 +1,21 @@ + + + + include/reactos/libs/fullfat + + + ff_blk.c + ff_crc.c + ff_dir.c + ff_error.c + ff_fat.c + ff_file.c + ff_format.c + ff_hash.c + ff_ioman.c + ff_memory.c + ff_safety.c + ff_string.c + ff_time.c + ff_unicode.c + diff --git a/lib/3rdparty/icu4ros/icu4ros.rbuild b/lib/3rdparty/icu4ros/icu4ros.rbuild new file mode 100644 index 00000000000..4a2cc237168 --- /dev/null +++ b/lib/3rdparty/icu4ros/icu4ros.rbuild @@ -0,0 +1,57 @@ + + + + + + 1 + 1 + + -fno-exceptions + -fno-rtti + + icu/source/common + icu/source/i18n + stubs.cpp + + + + bmpset.cpp + uhash_us.cpp + uidna.cpp + uiter.cpp + unifilt.cpp + unifunct.cpp + uniset.cpp + unisetspan.cpp + unistr.cpp + unorm.cpp + uobject.cpp + uset.cpp + usprep.cpp + util.cpp + uvector.cpp + cmemory.c + cstring.c + locmap.c + punycode.c + ucln_cmn.c + ucmndata.c + ucol_swp.c + ubidi_props.c + udata.c + udatamem.c + udataswp.c + uhash.c + uinit.c + uinvchar.c + umapfile.c + umath.c + umutex.c + ustring.c + ustrtrns.c + utf_impl.c + utrie.c + + + + diff --git a/lib/3rdparty/libmpg123/libmpg123.rbuild b/lib/3rdparty/libmpg123/libmpg123.rbuild new file mode 100644 index 00000000000..ac4be2133a6 --- /dev/null +++ b/lib/3rdparty/libmpg123/libmpg123.rbuild @@ -0,0 +1,42 @@ + + + + + + + + + 75 + . + include/reactos/libs/libmpg123 + + _lseek + _read + _strdup + compat.c + dct64.c + dct64_i386.c + equalizer.c + feature.c + format.c + frame.c + icy.c + icy2utf8.c + id3.c + index.c + layer1.c + layer2.c + layer3.c + libmpg123.c + ntom.c + optimize.c + parse.c + readers.c + stringbuf.c + synth.c + synth_8bit.c + synth_real.c + synth_s32.c + tabinit.c + + diff --git a/lib/3rdparty/libsamplerate/libsamplerate.rbuild b/lib/3rdparty/libsamplerate/libsamplerate.rbuild new file mode 100644 index 00000000000..0d72ab3f339 --- /dev/null +++ b/lib/3rdparty/libsamplerate/libsamplerate.rbuild @@ -0,0 +1,9 @@ + + + + . + samplerate.c + src_linear.c + src_sinc.c + src_zoh.c + diff --git a/lib/3rdparty/libwine/libwine.rbuild b/lib/3rdparty/libwine/libwine.rbuild new file mode 100644 index 00000000000..3b139cf79ca --- /dev/null +++ b/lib/3rdparty/libwine/libwine.rbuild @@ -0,0 +1,17 @@ + + + + + include/reactos/wine + + config.c + debug_ros.c + loader.c + string.c + + + include/reactos/wine + + loader.c + + \ No newline at end of file diff --git a/lib/3rdparty/libxml2/libxml2.rbuild b/lib/3rdparty/libxml2/libxml2.rbuild new file mode 100644 index 00000000000..fab226e9bb4 --- /dev/null +++ b/lib/3rdparty/libxml2/libxml2.rbuild @@ -0,0 +1,64 @@ + + + + + + + + + + + + include + . + + + _getcwd + _close + _write + _read + _open + + c14n.c + catalog.c + chvalid.c + debugXML.c + dict.c + DOCBparser.c + encoding.c + entities.c + error.c + globals.c + hash.c + HTMLparser.c + HTMLtree.c + legacy.c + list.c + nanoftp.c + nanohttp.c + parser.c + parserInternals.c + pattern.c + relaxng.c + SAX.c + SAX2.c + threads.c + tree.c + uri.c + valid.c + xinclude.c + xlink.c + xmlIO.c + xmlmemory.c + xmlreader.c + xmlregexp.c + xmlmodule.c + xmlsave.c + xmlschemas.c + xmlschemastypes.c + xmlunicode.c + xmlwriter.c + xpath.c + xpointer.c + xmlstring.c + diff --git a/lib/3rdparty/mingw/mingw.rbuild b/lib/3rdparty/mingw/mingw.rbuild new file mode 100644 index 00000000000..737810cca13 --- /dev/null +++ b/lib/3rdparty/mingw/mingw.rbuild @@ -0,0 +1,73 @@ + + + + + oldnames + ntdll + + + + + + include/reactos/mingw-w64 + kernel32 + _newmode.c + atonexit.c + binmode.c + charmax.c + cinitexe.c + CRT_fp10.c + CRT_fp8.c + CRT_glob.c + crt_handler.c + dllentry.c + gccmain.c + gs_support.c + merr.c + mingw_helpers.c + natstart.c + pesect.c + pseudo-reloc.c + pseudo-reloc-list.c + tlsmcrt.c + tlssup.c + tlsthrd.c + txtmode.c + wildcard.c + xncommod.c + xthdloc.c + xtxtmode.c + ofmt_stub.c + cxa_pure_virtual.c + + + + include/reactos/mingw-w64 + /wd4733 + crt0_c.c + crtexe.c + dllargv.c + + + + + include/reactos/mingw-w64 + /wd4733 + crt0_w.c + crtexe.c + dllargv.c + + + + include/reactos/mingw-w64 + crtdll.c + dllargv.c + + + + + + + getopt.c + + diff --git a/lib/3rdparty/zlib/zlib.rbuild b/lib/3rdparty/zlib/zlib.rbuild new file mode 100644 index 00000000000..b58694c3d68 --- /dev/null +++ b/lib/3rdparty/zlib/zlib.rbuild @@ -0,0 +1,42 @@ + + + + + . + + adler32.c + compress.c + crc32.c + deflate.c + gzclose.c + gzlib.c + gzread.c + gzwrite.c + infback.c + inffast.c + inflate.c + inftrees.c + trees.c + uncompr.c + zutil.c + + + . + + adler32.c + compress.c + crc32.c + deflate.c + gzclose.c + gzlib.c + gzread.c + gzwrite.c + infback.c + inffast.c + inflate.c + inftrees.c + trees.c + uncompr.c + zutil.c + + diff --git a/lib/atl/atl.rbuild b/lib/atl/atl.rbuild new file mode 100644 index 00000000000..7193d4cbe4c --- /dev/null +++ b/lib/atl/atl.rbuild @@ -0,0 +1,10 @@ + + + + . + + + + atlbase.cpp + atlcore.cpp + diff --git a/lib/cmlib/cmlib.rbuild b/lib/cmlib/cmlib.rbuild new file mode 100644 index 00000000000..506eef92334 --- /dev/null +++ b/lib/cmlib/cmlib.rbuild @@ -0,0 +1,34 @@ + + + + + . + + + + cminit.c + hivebin.c + hivecell.c + hiveinit.c + hivesum.c + hivewrt.c + + + . + + + + + + -Wwrite-strings + -Wpointer-arith + + + cminit.c + hivebin.c + hivecell.c + hiveinit.c + hivesum.c + hivewrt.c + + diff --git a/lib/cportlib/cportlib.rbuild b/lib/cportlib/cportlib.rbuild new file mode 100644 index 00000000000..7a4dcd712e5 --- /dev/null +++ b/lib/cportlib/cportlib.rbuild @@ -0,0 +1,8 @@ + + + + + . + cport.c + + diff --git a/lib/debugsup/debugsup.rbuild b/lib/debugsup/debugsup.rbuild new file mode 100644 index 00000000000..4c642a5a223 --- /dev/null +++ b/lib/debugsup/debugsup.rbuild @@ -0,0 +1,10 @@ + + + + + + + + + + diff --git a/lib/dnslib/dnslib.rbuild b/lib/dnslib/dnslib.rbuild new file mode 100644 index 00000000000..6186055c04f --- /dev/null +++ b/lib/dnslib/dnslib.rbuild @@ -0,0 +1,22 @@ + + + + inc + addr.c + debug.c + dnsaddr.c + dnsutil.c + flatbuf.c + hostent.c + ip6.c + memory.c + name.c + print.c + record.c + rrprint.c + sablob.c + straddr.c + string.c + table.c + utf8.c + diff --git a/lib/drivers/chew/chew.rbuild b/lib/drivers/chew/chew.rbuild new file mode 100644 index 00000000000..cf512c6f0aa --- /dev/null +++ b/lib/drivers/chew/chew.rbuild @@ -0,0 +1,7 @@ + + + + + include + workqueue.c + diff --git a/lib/drivers/csq/csq.rbuild b/lib/drivers/csq/csq.rbuild new file mode 100644 index 00000000000..2f2545c4282 --- /dev/null +++ b/lib/drivers/csq/csq.rbuild @@ -0,0 +1,6 @@ + + + + + csq.c + diff --git a/lib/drivers/directory.rbuild b/lib/drivers/directory.rbuild new file mode 100644 index 00000000000..3f84d4447ea --- /dev/null +++ b/lib/drivers/directory.rbuild @@ -0,0 +1,19 @@ + + + + + + + + + + + + + + + + + + + diff --git a/lib/drivers/ip/ip.rbuild b/lib/drivers/ip/ip.rbuild new file mode 100644 index 00000000000..6a3e5500c30 --- /dev/null +++ b/lib/drivers/ip/ip.rbuild @@ -0,0 +1,44 @@ + + + + + include + include + + + + checksum.S + + + address.c + arp.c + checksum.c + icmp.c + interface.c + ip.c + loopback.c + neighbor.c + ports.c + receive.c + router.c + routines.c + transmit.c + + + + datagram.c + + + rawip.c + + + accept.c + event.c + if.c + tcp.c + + + udp.c + + + diff --git a/lib/drivers/oskittcp/oskittcp.rbuild b/lib/drivers/oskittcp/oskittcp.rbuild new file mode 100644 index 00000000000..c6332f252d7 --- /dev/null +++ b/lib/drivers/oskittcp/oskittcp.rbuild @@ -0,0 +1,48 @@ + + + + + + + include/freebsd + include/freebsd/sys/include + include/freebsd/src/sys + include/freebsd/dev/include + include/freebsd/net/include + include + + defaults.c + in.c + in_cksum.c + in_pcb.c + in_proto.c + in_rmx.c + inet_ntoa.c + interface.c + ip_input.c + ip_output.c + kern_clock.c + kern_subr.c + osenv.c + param.c + radix.c + random.c + raw_cb.c + raw_ip.c + raw_usrreq.c + route.c + rtsock.c + scanc.c + sleep.c + tcp_input.c + tcp_output.c + tcp_subr.c + tcp_usrreq.c + tcp_debug.c + tcp_timer.c + uipc_domain.c + uipc_mbuf.c + uipc_socket.c + uipc_socket2.c + + diff --git a/lib/drivers/sound/legacy/legacy.rbuild b/lib/drivers/sound/legacy/legacy.rbuild new file mode 100644 index 00000000000..1c83aac740e --- /dev/null +++ b/lib/drivers/sound/legacy/legacy.rbuild @@ -0,0 +1,10 @@ + + + + + + . + include/reactos/libs/sound + devname.c + hardware.c + diff --git a/lib/drivers/sound/mmebuddy/mmebuddy.rbuild b/lib/drivers/sound/mmebuddy/mmebuddy.rbuild new file mode 100644 index 00000000000..bb108747349 --- /dev/null +++ b/lib/drivers/sound/mmebuddy/mmebuddy.rbuild @@ -0,0 +1,32 @@ + + + + include/reactos/libs/sound + 1 + capabilities.c + devicelist.c + deviceinstance.c + functiontable.c + mmewrap.c + reentrancy.c + utility.c + kernel.c + thread.c + + widMessage.c + wodMessage.c + format.c + header.c + streaming.c + + + midMessage.c + modMessage.c + + + mxdMessage.c + + + auxMessage.c + + diff --git a/lib/drivers/sound/mment4/mment4.rbuild b/lib/drivers/sound/mment4/mment4.rbuild new file mode 100644 index 00000000000..dbd777e36fb --- /dev/null +++ b/lib/drivers/sound/mment4/mment4.rbuild @@ -0,0 +1,9 @@ + + + + include/reactos/libs/sound + 1 + detect.c + registry.c + control.c + diff --git a/lib/drivers/sound/mmixer/mmixer.rbuild b/lib/drivers/sound/mmixer/mmixer.rbuild new file mode 100644 index 00000000000..c2d7fdae645 --- /dev/null +++ b/lib/drivers/sound/mmixer/mmixer.rbuild @@ -0,0 +1,13 @@ + + + + include/reactos/libs/sound + 1 + controls.c + filter.c + midi.c + mixer.c + sup.c + wave.c + topology.c + diff --git a/lib/drivers/sound/shared/shared.rbuild b/lib/drivers/sound/shared/shared.rbuild new file mode 100644 index 00000000000..578f7a1cd5b --- /dev/null +++ b/lib/drivers/sound/shared/shared.rbuild @@ -0,0 +1,9 @@ + + + + + + . + include/reactos/libs/sound + time.c + diff --git a/lib/drivers/sound/sound.rbuild b/lib/drivers/sound/sound.rbuild new file mode 100644 index 00000000000..2042107c7bd --- /dev/null +++ b/lib/drivers/sound/sound.rbuild @@ -0,0 +1,25 @@ + + + + + + + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/lib/drivers/sound/soundblaster/soundblaster.rbuild b/lib/drivers/sound/soundblaster/soundblaster.rbuild new file mode 100644 index 00000000000..ab64c8c3588 --- /dev/null +++ b/lib/drivers/sound/soundblaster/soundblaster.rbuild @@ -0,0 +1,13 @@ + + + + + + . + include/reactos/libs/sound + dsp_io.c + version.c + speaker.c + rate.c + mixer.c + diff --git a/lib/drivers/sound/uartmidi/uartmidi.rbuild b/lib/drivers/sound/uartmidi/uartmidi.rbuild new file mode 100644 index 00000000000..bdfad119cb6 --- /dev/null +++ b/lib/drivers/sound/uartmidi/uartmidi.rbuild @@ -0,0 +1,9 @@ + + + + + + . + include/reactos/libs/sound + midiuart.c + diff --git a/lib/epsapi/epsapi.rbuild b/lib/epsapi/epsapi.rbuild new file mode 100644 index 00000000000..787b7161f41 --- /dev/null +++ b/lib/epsapi/epsapi.rbuild @@ -0,0 +1,9 @@ + + + + + drivers.c + modules.c + processes.c + + diff --git a/lib/fslib/directory.rbuild b/lib/fslib/directory.rbuild new file mode 100644 index 00000000000..272f5de776c --- /dev/null +++ b/lib/fslib/directory.rbuild @@ -0,0 +1,16 @@ + + + + + + + + + + + + + + + + diff --git a/lib/fslib/ext2lib/ext2lib.rbuild b/lib/fslib/ext2lib/ext2lib.rbuild new file mode 100644 index 00000000000..853d7f248f9 --- /dev/null +++ b/lib/fslib/ext2lib/ext2lib.rbuild @@ -0,0 +1,14 @@ + + + + . + Badblock.c + Bitmap.c + Disk.c + Group.c + Inode.c + Memory.c + Mke2fs.c + Super.c + Uuid.c + diff --git a/lib/fslib/ntfslib/ntfslib.rbuild b/lib/fslib/ntfslib/ntfslib.rbuild new file mode 100644 index 00000000000..40edefe4d60 --- /dev/null +++ b/lib/fslib/ntfslib/ntfslib.rbuild @@ -0,0 +1,6 @@ + + + + . + ntfslib.c + \ No newline at end of file diff --git a/lib/fslib/vfatlib/vfatlib.rbuild b/lib/fslib/vfatlib/vfatlib.rbuild new file mode 100644 index 00000000000..1d40958cdf9 --- /dev/null +++ b/lib/fslib/vfatlib/vfatlib.rbuild @@ -0,0 +1,19 @@ + + + + . + fat12.c + fat16.c + fat32.c + vfatlib.c + + + boot.c + check.c + common.c + fat.c + file.c + io.c + lfn.c + + diff --git a/lib/fslib/vfatxlib/vfatxlib.rbuild b/lib/fslib/vfatxlib/vfatxlib.rbuild new file mode 100644 index 00000000000..bc7736cd6a7 --- /dev/null +++ b/lib/fslib/vfatxlib/vfatxlib.rbuild @@ -0,0 +1,7 @@ + + + + . + fatx.c + vfatxlib.c + diff --git a/lib/inflib/inflib.rbuild b/lib/inflib/inflib.rbuild new file mode 100644 index 00000000000..1a8dad5eb6e --- /dev/null +++ b/lib/inflib/inflib.rbuild @@ -0,0 +1,30 @@ + + + + + . + infcore.c + infget.c + infput.c + infrosgen.c + infrosget.c + infrosput.c + + + . + + + -Wpointer-arith + -Wconversion + -Wstrict-prototypes + -Wmissing-prototypes + + + infcore.c + infget.c + infput.c + infhostgen.c + infhostget.c + infhostput.c + + diff --git a/lib/lib.mak b/lib/lib.mak new file mode 100644 index 00000000000..9b9b59f84e9 --- /dev/null +++ b/lib/lib.mak @@ -0,0 +1,7 @@ +LIB_BASE = lib +LIB_BASE_ = $(LIB_BASE)$(SEP) + +include lib/inflib/inflib.mak +ifeq ($(ARCH),powerpc) +include lib/ppcmmu/ppcmmu.mak +endif diff --git a/lib/lib.rbuild b/lib/lib.rbuild new file mode 100644 index 00000000000..15d0b7fb0de --- /dev/null +++ b/lib/lib.rbuild @@ -0,0 +1,67 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/lib/lsalib/lsalib.rbuild b/lib/lsalib/lsalib.rbuild new file mode 100644 index 00000000000..b917351f45e --- /dev/null +++ b/lib/lsalib/lsalib.rbuild @@ -0,0 +1,7 @@ + + + + . + include/reactos/subsys + lsa.c + diff --git a/lib/newinflib/inflib.rbuild b/lib/newinflib/inflib.rbuild new file mode 100644 index 00000000000..d43e7ec424c --- /dev/null +++ b/lib/newinflib/inflib.rbuild @@ -0,0 +1,29 @@ + + + + + . + infcore.c + infget.c + infput.c + infrosgen.c + infrosget.c + infrosput.c + + + . + + + -Wwrite-strings + -Wpointer-arith + + + infcore.c + infget.c + infput.c + infhostgen.c + infhostget.c + infhostput.c + infhostrtl.c + + diff --git a/lib/nls/idna/idna.rbuild b/lib/nls/idna/idna.rbuild new file mode 100644 index 00000000000..acfd8093c8a --- /dev/null +++ b/lib/nls/idna/idna.rbuild @@ -0,0 +1,15 @@ + + + + icu4ros + + 0x600 + + + -fno-exceptions + -fno-rtti + + icu/source/common + idna.cpp + nameprep.cpp + diff --git a/lib/nls/nls.rbuild b/lib/nls/nls.rbuild new file mode 100644 index 00000000000..c813be4af3d --- /dev/null +++ b/lib/nls/nls.rbuild @@ -0,0 +1,13 @@ + + + + + + + + + + + + + diff --git a/lib/nls/normalize/normalize.rbuild b/lib/nls/normalize/normalize.rbuild new file mode 100644 index 00000000000..87a4ee22bd0 --- /dev/null +++ b/lib/nls/normalize/normalize.rbuild @@ -0,0 +1,12 @@ + + + + icu4ros + 0x600 + + -fno-exceptions + -fno-rtti + + icu/source/common + normalize.cpp + diff --git a/lib/nls/scripts/scripts.rbuild b/lib/nls/scripts/scripts.rbuild new file mode 100644 index 00000000000..344db924f72 --- /dev/null +++ b/lib/nls/scripts/scripts.rbuild @@ -0,0 +1,12 @@ + + + + icu4ros + 0x600 + + -fno-exceptions + -fno-rtti + + icu/source/common + scripts.cpp + diff --git a/lib/ppcmmu/ppcmmu.rbuild b/lib/ppcmmu/ppcmmu.rbuild new file mode 100644 index 00000000000..d46bf832af1 --- /dev/null +++ b/lib/ppcmmu/ppcmmu.rbuild @@ -0,0 +1,9 @@ + + + + . + + mmuutil.c + + dummy.c + diff --git a/lib/pseh/pseh.rbuild b/lib/pseh/pseh.rbuild new file mode 100644 index 00000000000..3d2cbfeef4d --- /dev/null +++ b/lib/pseh/pseh.rbuild @@ -0,0 +1,25 @@ + + + + + + framebased.S + + + framebased-gcchack.c + framebased-gcchack-asm.S + + + + + + framebased.S + + + + + framebased.S + + + framebased.c + diff --git a/lib/recyclebin/recyclebin.rbuild b/lib/recyclebin/recyclebin.rbuild new file mode 100644 index 00000000000..3127c8bea8c --- /dev/null +++ b/lib/recyclebin/recyclebin.rbuild @@ -0,0 +1,10 @@ + + + + guid.c + recyclebin.c + recyclebin_generic.c + recyclebin_generic_enumerator.c + recyclebin_v5.c + recyclebin_v5_enumerator.c + diff --git a/lib/rossym/delete.c b/lib/rossym/delete.c index 1e6fe8393e2..c97e40c7799 100644 --- a/lib/rossym/delete.c +++ b/lib/rossym/delete.c @@ -10,19 +10,15 @@ #define NTOSAPI #include #include -#include +#include "rossympriv.h" #define NDEBUG #include -#include "rossympriv.h" -#include "pe.h" -#include "dwarf.h" - VOID RosSymDelete(PROSSYM_INFO RosSymInfo) { - dwarfclose(RosSymInfo); + RosSymFreeMem(RosSymInfo); } /* EOF */ diff --git a/lib/rossym/dummy.c b/lib/rossym/dummy.c index 03ded402ec3..2e4703fe528 100644 --- a/lib/rossym/dummy.c +++ b/lib/rossym/dummy.c @@ -1 +1,32 @@ -/* This file is intentionally left empty */ + +#include +#include + +#define NDEBUG +#include + +BOOLEAN +RosSymCreateFromFile(PVOID FileContext, PROSSYM_INFO *RosSymInfo) +{ + return FALSE; +} + +VOID +RosSymDelete(PROSSYM_INFO RosSymInfo) +{ +} + +BOOLEAN +RosSymGetAddressInformation(PROSSYM_INFO RosSymInfo, + ULONG_PTR RelativeAddress, + ULONG *LineNumber, + char *FileName, + char *FunctionName) +{ + return FALSE; +} + +VOID +RosSymInitKernelMode(VOID) +{ +} diff --git a/lib/rossym/find.c b/lib/rossym/find.c index 5f613dc573d..c311e3eed0a 100644 --- a/lib/rossym/find.c +++ b/lib/rossym/find.c @@ -42,9 +42,53 @@ #define NDEBUG #include -#include "rossym.h" -#include "dwarf.h" -#include "pe.h" +static PROSSYM_ENTRY +FindEntry(IN PROSSYM_INFO RosSymInfo, IN ULONG_PTR RelativeAddress) +{ + /* + * Perform a binary search. + * + * The code below is a bit sneaky. After a comparison fails, we + * divide the work in half by moving either left or right. If lim + * is odd, moving left simply involves halving lim: e.g., when lim + * is 5 we look at item 2, so we change lim to 2 so that we will + * look at items 0 & 1. If lim is even, the same applies. If lim + * is odd, moving right again involes halving lim, this time moving + * the base up one item past p: e.g., when lim is 5 we change base + * to item 3 and make lim 2 so that we will look at items 3 and 4. + * If lim is even, however, we have to shrink it by one before + * halving: e.g., when lim is 4, we still looked at item 2, so we + * have to make lim 3, then halve, obtaining 1, so that we will only + * look at item 3. + */ + PROSSYM_ENTRY Base = RosSymInfo->Symbols; + ULONG Lim; + PROSSYM_ENTRY Mid, Low; + + if (RelativeAddress < Base->Address) + { + return NULL; + } + + Low = Base; + for (Lim = RosSymInfo->SymbolsCount; Lim != 0; Lim >>= 1) + { + Mid = Base + (Lim >> 1); + if (RelativeAddress == Mid->Address) + { + return Mid; + } + if (Mid->Address < RelativeAddress) /* key > mid: move right */ + { + Low = Mid; + Base = Mid + 1; + Lim--; + } /* else move left */ + } + + return Low; +} + BOOLEAN RosSymGetAddressInformation(PROSSYM_INFO RosSymInfo, @@ -53,34 +97,52 @@ RosSymGetAddressInformation(PROSSYM_INFO RosSymInfo, char *FileName, char *FunctionName) { - char *cdir, *dir, *file, *function; - ulong line, mtime, length; - int res = dwarfpctoline - (RosSymInfo, - RelativeAddress + RosSymInfo->pe->imagebase, - &cdir, - &dir, - &file, - &function, - &line, - &mtime, - &length); - if (res != -1) { - *LineNumber = line; - FileName[0] = 0; - if (dir) { - strcpy(FileName, dir); - strcat(FileName, "/"); - } - if (file) - strcat(FileName, file); - FunctionName[0] = 0; - if (function) - strcpy(FunctionName, function); - return TRUE; - } else { - return FALSE; - } + PROSSYM_ENTRY RosSymEntry; + + DPRINT("RelativeAddress = 0x%08x\n", RelativeAddress); + + if (RosSymInfo->Symbols == NULL || RosSymInfo->SymbolsCount == 0 || + RosSymInfo->Strings == NULL || RosSymInfo->StringsLength == 0) + { + DPRINT1("Uninitialized RosSymInfo\n"); + return FALSE; + } + + ASSERT(LineNumber || FileName || FunctionName); + + /* find symbol entry for function */ + RosSymEntry = FindEntry(RosSymInfo, RelativeAddress); + + if (NULL == RosSymEntry) + { + DPRINT("None of the requested information was found!\n"); + return FALSE; + } + + if (LineNumber != NULL) + { + *LineNumber = RosSymEntry->SourceLine; + } + if (FileName != NULL) + { + PCSTR Name = ""; + if (RosSymEntry->FileOffset != 0) + { + Name = (PCHAR) RosSymInfo->Strings + RosSymEntry->FileOffset; + } + strcpy(FileName, Name); + } + if (FunctionName != NULL) + { + PCSTR Name = ""; + if (RosSymEntry->FunctionOffset != 0) + { + Name = (PCHAR) RosSymInfo->Strings + RosSymEntry->FunctionOffset; + } + strcpy(FunctionName, Name); + } + + return TRUE; } /* EOF */ diff --git a/lib/rossym/fromfile.c b/lib/rossym/fromfile.c index 00884a5a56b..21339b7ac3f 100644 --- a/lib/rossym/fromfile.c +++ b/lib/rossym/fromfile.c @@ -8,38 +8,28 @@ */ #define NTOSAPI -#include -#include +#include #include #include "rossympriv.h" -#include "pe.h" #include -#include "dwarf.h" - #define NDEBUG #include -extern NTSTATUS RosSymStatus; - BOOLEAN RosSymCreateFromFile(PVOID FileContext, PROSSYM_INFO *RosSymInfo) { IMAGE_DOS_HEADER DosHeader; IMAGE_NT_HEADERS NtHeaders; - PIMAGE_SECTION_HEADER SectionHeaders; + PIMAGE_SECTION_HEADER SectionHeaders, SectionHeader; unsigned SectionIndex; - unsigned SymbolTable, NumSymbols; + char SectionName[IMAGE_SIZEOF_SHORT_NAME]; + ROSSYM_HEADER RosSymHeader; /* Load DOS header */ - if (! RosSymSeekFile(FileContext, 0)) - { - DPRINT1("Could not rewind file\n"); - return FALSE; - } if (! RosSymReadFile(FileContext, &DosHeader, sizeof(IMAGE_DOS_HEADER))) { - DPRINT1("Failed to read DOS header %x\n", RosSymStatus); + DPRINT1("Failed to read DOS header\n"); return FALSE; } if (! ROSSYM_IS_VALID_DOS_HEADER(&DosHeader)) @@ -65,17 +55,6 @@ RosSymCreateFromFile(PVOID FileContext, PROSSYM_INFO *RosSymInfo) return FALSE; } - SymbolTable = NtHeaders.FileHeader.PointerToSymbolTable; - NumSymbols = NtHeaders.FileHeader.NumberOfSymbols; - - if (!NumSymbols) - { - DPRINT1("Image doesn't have debug symbols\n"); - return FALSE; - } - - DPRINT("SymbolTable %x NumSymbols %x\n", SymbolTable, NumSymbols); - /* Load section headers */ if (! RosSymSeekFile(FileContext, (char *) IMAGE_FIRST_SECTION(&NtHeaders) - (char *) &NtHeaders + DosHeader.e_lfanew)) @@ -83,7 +62,6 @@ RosSymCreateFromFile(PVOID FileContext, PROSSYM_INFO *RosSymInfo) DPRINT1("Failed seeking to section headers\n"); return FALSE; } - DPRINT("Alloc section headers\n"); SectionHeaders = RosSymAllocMem(NtHeaders.FileHeader.NumberOfSections * sizeof(IMAGE_SECTION_HEADER)); if (NULL == SectionHeaders) @@ -101,110 +79,69 @@ RosSymCreateFromFile(PVOID FileContext, PROSSYM_INFO *RosSymInfo) return FALSE; } - // Convert names to ANSI_STRINGs - for (SectionIndex = 0; SectionIndex < NtHeaders.FileHeader.NumberOfSections; - SectionIndex++) - { - ANSI_STRING astr; - if (SectionHeaders[SectionIndex].Name[0] != '/') { - DPRINT("Short name string %d, %s\n", SectionIndex, SectionHeaders[SectionIndex].Name); - astr.Buffer = RosSymAllocMem(IMAGE_SIZEOF_SHORT_NAME); - memcpy(astr.Buffer, SectionHeaders[SectionIndex].Name, IMAGE_SIZEOF_SHORT_NAME); - astr.MaximumLength = IMAGE_SIZEOF_SHORT_NAME; - astr.Length = GetStrnlen(astr.Buffer, IMAGE_SIZEOF_SHORT_NAME); - } else { - UNICODE_STRING intConv; - NTSTATUS Status; - ULONG StringOffset; + /* Search for the section header */ + strncpy(SectionName, ROSSYM_SECTION_NAME, IMAGE_SIZEOF_SHORT_NAME); + SectionHeader = SectionHeaders; + for (SectionIndex = 0; SectionIndex < NtHeaders.FileHeader.NumberOfSections; SectionIndex++) + { + if (0 == memcmp(SectionName, SectionHeader->Name, IMAGE_SIZEOF_SHORT_NAME)) + { + break; + } + SectionHeader++; + } + if (NtHeaders.FileHeader.NumberOfSections <= SectionIndex) + { + RosSymFreeMem(SectionHeaders); + DPRINT("No %s section found\n", ROSSYM_SECTION_NAME); + return FALSE; + } - Status = RtlCreateUnicodeStringFromAsciiz(&intConv, (PCSZ)SectionHeaders[SectionIndex].Name + 1); - if (!NT_SUCCESS(Status)) goto freeall; - Status = RtlUnicodeStringToInteger(&intConv, 10, &StringOffset); - RtlFreeUnicodeString(&intConv); - if (!NT_SUCCESS(Status)) goto freeall; - if (!RosSymSeekFile(FileContext, SymbolTable + NumSymbols * SYMBOL_SIZE + StringOffset)) - goto freeall; - astr.Buffer = RosSymAllocMem(MAXIMUM_DWARF_NAME_SIZE); - if (!RosSymReadFile(FileContext, astr.Buffer, MAXIMUM_DWARF_NAME_SIZE)) - goto freeall; - astr.Length = GetStrnlen(astr.Buffer, MAXIMUM_DWARF_NAME_SIZE); - astr.MaximumLength = MAXIMUM_DWARF_NAME_SIZE; - DPRINT("Long name %d, %s\n", SectionIndex, astr.Buffer); - } - *ANSI_NAME_STRING(&SectionHeaders[SectionIndex]) = astr; - } + /* Load rossym header */ + if (! RosSymSeekFile(FileContext, SectionHeader->PointerToRawData)) + { + RosSymFreeMem(SectionHeaders); + DPRINT1("Failed seeking to section data\n"); + return FALSE; + } + RosSymFreeMem(SectionHeaders); + if (! RosSymReadFile(FileContext, &RosSymHeader, sizeof(ROSSYM_HEADER))) + { + DPRINT1("Failed to read rossym header\n"); + return FALSE; + } + if (RosSymHeader.SymbolsOffset < sizeof(ROSSYM_HEADER) + || RosSymHeader.StringsOffset < RosSymHeader.SymbolsOffset + RosSymHeader.SymbolsLength + || 0 != (RosSymHeader.SymbolsLength % sizeof(ROSSYM_ENTRY))) + { + DPRINT1("Invalid ROSSYM_HEADER\n"); + return FALSE; + } - DPRINT("Done with sections\n"); - Pe *pe = RosSymAllocMem(sizeof(*pe)); - pe->fd = FileContext; - pe->e2 = peget2; - pe->e4 = peget4; - pe->e8 = peget8; - pe->nsections = NtHeaders.FileHeader.NumberOfSections; - pe->sect = SectionHeaders; - pe->nsymbols = NtHeaders.FileHeader.NumberOfSymbols; - pe->symtab = malloc(pe->nsymbols * sizeof(CoffSymbol)); - SYMENT SymbolData; - int i, j; - DPRINT("Getting symbol data\n"); - ASSERT(sizeof(SymbolData) == 18); - for (i = 0, j = 0; i < pe->nsymbols; i++) { - if (!RosSymSeekFile - (FileContext, - NtHeaders.FileHeader.PointerToSymbolTable + i * sizeof(SymbolData))) - goto freeall; - if (!RosSymReadFile(FileContext, &SymbolData, sizeof(SymbolData))) - goto freeall; - if ((SymbolData.e_scnum < 1) || - (SymbolData.e_sclass != C_EXT && - SymbolData.e_sclass != C_STAT)) - continue; - int section = SymbolData.e_scnum - 1; - if (SymbolData.e.e.e_zeroes) { - pe->symtab[j].name = malloc(sizeof(SymbolData.e.e_name)+1); - memcpy(pe->symtab[j].name, SymbolData.e.e_name, sizeof(SymbolData.e.e_name)); - pe->symtab[j].name[sizeof(SymbolData.e.e_name)] = 0; - } else { - if (!RosSymSeekFile - (FileContext, - NtHeaders.FileHeader.PointerToSymbolTable + - (NtHeaders.FileHeader.NumberOfSymbols * 18) + - SymbolData.e.e.e_offset)) - goto freeall; - pe->symtab[j].name = malloc(MAXIMUM_COFF_SYMBOL_LENGTH+1); - pe->symtab[j].name[MAXIMUM_COFF_SYMBOL_LENGTH] = 0; - // It's possible that we've got a string just at the end of the file - // we'll skip that symbol if needed - if (!RosSymReadFile(FileContext, pe->symtab[j].name, MAXIMUM_COFF_SYMBOL_LENGTH)) { - free(pe->symtab[j].name); - continue; - } - } - if (pe->symtab[j].name[0] == '.') { - free(pe->symtab[j].name); - continue; - } - pe->symtab[j].address = pe->sect[section].VirtualAddress + SymbolData.e_value; - j++; - } - DPRINT("%d symbols\n", j); - pe->nsymbols = j; - pe->imagebase = pe->loadbase = NtHeaders.OptionalHeader.ImageBase; - pe->imagesize = NtHeaders.OptionalHeader.SizeOfImage; - pe->loadsection = loaddisksection; - DPRINT("do dwarfopen\n"); - *RosSymInfo = dwarfopen(pe); - DPRINT("done %x\n", *RosSymInfo); + *RosSymInfo = RosSymAllocMem(sizeof(ROSSYM_INFO) - sizeof(ROSSYM_HEADER) + + RosSymHeader.StringsOffset + RosSymHeader.StringsLength + 1); + if (NULL == *RosSymInfo) + { + DPRINT1("Failed to allocate memory for rossym\n"); + return FALSE; + } + (*RosSymInfo)->Symbols = (PROSSYM_ENTRY)((char *) *RosSymInfo + sizeof(ROSSYM_INFO) + - sizeof(ROSSYM_HEADER) + RosSymHeader.SymbolsOffset); + (*RosSymInfo)->SymbolsCount = RosSymHeader.SymbolsLength / sizeof(ROSSYM_ENTRY); + (*RosSymInfo)->Strings = (PCHAR) *RosSymInfo + sizeof(ROSSYM_INFO) - sizeof(ROSSYM_HEADER) + + RosSymHeader.StringsOffset; + (*RosSymInfo)->StringsLength = RosSymHeader.StringsLength; + if (! RosSymReadFile(FileContext, *RosSymInfo + 1, + RosSymHeader.StringsOffset + RosSymHeader.StringsLength + - sizeof(ROSSYM_HEADER))) + { + DPRINT1("Failed to read rossym headers\n"); + return FALSE; + } + /* Make sure the last string is null terminated, we allocated an extra byte for that */ + (*RosSymInfo)->Strings[(*RosSymInfo)->StringsLength] = '\0'; return TRUE; - -freeall: - for (SectionIndex = 0; SectionIndex < NtHeaders.FileHeader.NumberOfSections; - SectionIndex++) - RtlFreeAnsiString(ANSI_NAME_STRING(&SectionHeaders[SectionIndex])); - RosSymFreeMem(SectionHeaders); - - return FALSE; } /* EOF */ diff --git a/lib/rossym/frommem.c b/lib/rossym/frommem.c index 2e201d27a48..f03274eb735 100644 --- a/lib/rossym/frommem.c +++ b/lib/rossym/frommem.c @@ -8,8 +8,7 @@ */ #define NTOSAPI -#include -#include +#include #include #include "rossympriv.h" #include @@ -17,144 +16,76 @@ #define NDEBUG #include -#include "dwarf.h" -#include "pe.h" - BOOLEAN RosSymCreateFromMem(PVOID ImageStart, ULONG_PTR ImageSize, PROSSYM_INFO *RosSymInfo) { - ANSI_STRING AnsiNameString = { }; - PIMAGE_DOS_HEADER DosHeader; - PIMAGE_NT_HEADERS NtHeaders; - PIMAGE_SECTION_HEADER SectionHeaders; - ULONG SectionIndex; - unsigned SymbolTable, NumSymbols; - - /* Check if MZ header is valid */ - DosHeader = (PIMAGE_DOS_HEADER) ImageStart; - if (ImageSize < sizeof(IMAGE_DOS_HEADER) - || ! ROSSYM_IS_VALID_DOS_HEADER(DosHeader)) - { - DPRINT1("Image doesn't have a valid DOS header\n"); - return FALSE; - } - - /* Locate NT header */ - NtHeaders = (PIMAGE_NT_HEADERS)((char *) ImageStart + DosHeader->e_lfanew); - if (ImageSize < DosHeader->e_lfanew + sizeof(IMAGE_NT_HEADERS) - || ! ROSSYM_IS_VALID_NT_HEADERS(NtHeaders)) - { - DPRINT1("Image doesn't have a valid PE header\n"); - return FALSE; - } - - SymbolTable = NtHeaders->FileHeader.PointerToSymbolTable; - NumSymbols = NtHeaders->FileHeader.NumberOfSymbols; - - /* Search for the section header */ - ULONG SectionHeaderSize = NtHeaders->FileHeader.NumberOfSections * sizeof(IMAGE_SECTION_HEADER); - SectionHeaders = RosSymAllocMem(SectionHeaderSize); - RtlCopyMemory(SectionHeaders, IMAGE_FIRST_SECTION(NtHeaders), SectionHeaderSize); - - // Convert names to ANSI_STRINGs - for (SectionIndex = 0; SectionIndex < NtHeaders->FileHeader.NumberOfSections; - SectionIndex++) - { - if (SectionHeaders[SectionIndex].Name[0] != '/') { - AnsiNameString.Buffer = RosSymAllocMem(IMAGE_SIZEOF_SHORT_NAME); - RtlCopyMemory(AnsiNameString.Buffer, SectionHeaders[SectionIndex].Name, IMAGE_SIZEOF_SHORT_NAME); - AnsiNameString.MaximumLength = IMAGE_SIZEOF_SHORT_NAME; - AnsiNameString.Length = GetStrnlen(AnsiNameString.Buffer, IMAGE_SIZEOF_SHORT_NAME); - } else { - UNICODE_STRING intConv; - NTSTATUS Status; - ULONG StringOffset; - - Status = RtlCreateUnicodeStringFromAsciiz(&intConv, (PCSZ)SectionHeaders[SectionIndex].Name + 1); - if (!NT_SUCCESS(Status)) goto freeall; - Status = RtlUnicodeStringToInteger(&intConv, 10, &StringOffset); - RtlFreeUnicodeString(&intConv); - if (!NT_SUCCESS(Status)) goto freeall; - ULONG VirtualOffset = pefindrva(SectionHeaders, NtHeaders->FileHeader.NumberOfSections, SymbolTable+(NumSymbols*SYMBOL_SIZE)+StringOffset); - if (!VirtualOffset) goto freeall; - AnsiNameString.Buffer = RosSymAllocMem(MAXIMUM_DWARF_NAME_SIZE); - if (!AnsiNameString.Buffer) goto freeall; - PCHAR StringTarget = ((PCHAR)ImageStart)+VirtualOffset; - PCHAR EndOfImage = ((PCHAR)ImageStart) + NtHeaders->OptionalHeader.SizeOfImage; - if (StringTarget >= EndOfImage) goto freeall; - ULONG PossibleStringLength = EndOfImage - StringTarget; - if (PossibleStringLength > MAXIMUM_DWARF_NAME_SIZE) - PossibleStringLength = MAXIMUM_DWARF_NAME_SIZE; - RtlCopyMemory(AnsiNameString.Buffer, StringTarget, PossibleStringLength); - AnsiNameString.Length = strlen(AnsiNameString.Buffer); - AnsiNameString.MaximumLength = MAXIMUM_DWARF_NAME_SIZE; - } - memcpy - (&SectionHeaders[SectionIndex], - &AnsiNameString, - sizeof(AnsiNameString)); - } - - Pe *pe = RosSymAllocMem(sizeof(*pe)); - pe->fd = ImageStart; - pe->e2 = peget2; - pe->e4 = peget4; - pe->e8 = peget8; - pe->loadbase = (ULONG)ImageStart; - pe->imagebase = NtHeaders->OptionalHeader.ImageBase; - pe->imagesize = NtHeaders->OptionalHeader.SizeOfImage; - pe->nsections = NtHeaders->FileHeader.NumberOfSections; - pe->sect = SectionHeaders; - pe->nsymbols = NtHeaders->FileHeader.NumberOfSymbols; - pe->symtab = malloc(pe->nsymbols * sizeof(CoffSymbol)); - PSYMENT SymbolData = (PSYMENT) - (((PCHAR)ImageStart) + - pefindrva - (pe->sect, - pe->nsections, - NtHeaders->FileHeader.PointerToSymbolTable)); - int i, j; - for (i = 0, j = 0; i < pe->nsymbols; i++) { - if ((SymbolData[i].e_scnum < 1) || - (SymbolData[i].e_sclass != C_EXT && - SymbolData[i].e_sclass != C_STAT)) - continue; - int section = SymbolData[i].e_scnum - 1; - if (SymbolData[i].e.e.e_zeroes) { - pe->symtab[j].name = malloc(sizeof(SymbolData[i].e.e_name)+1); - strcpy(pe->symtab[j].name, SymbolData[i].e.e_name); - } else { - PCHAR SymbolName = ((PCHAR)ImageStart) + - pefindrva - (pe->sect, - pe->nsections, - NtHeaders->FileHeader.PointerToSymbolTable + - (NtHeaders->FileHeader.NumberOfSymbols * 18) + - SymbolData[i].e.e.e_offset); - pe->symtab[j].name = malloc(strlen(SymbolName)+1); - strcpy(pe->symtab[j].name, SymbolName); - } - if (pe->symtab[j].name[0] == '.') { - free(pe->symtab[j].name); - continue; - } - pe->symtab[j].address = pe->sect[section].VirtualAddress + SymbolData[i].e_value; - j++; - } - pe->nsymbols = j; - pe->loadsection = loadmemsection; - *RosSymInfo = dwarfopen(pe); + PIMAGE_DOS_HEADER DosHeader; + PIMAGE_NT_HEADERS NtHeaders; + PIMAGE_SECTION_HEADER SectionHeader; + ULONG SectionIndex; + BOOLEAN RosSymSectionFound = FALSE; + CHAR SectionName[IMAGE_SIZEOF_SHORT_NAME]; - return !!*RosSymInfo; - -freeall: - if (AnsiNameString.Buffer) RosSymFreeMem(AnsiNameString.Buffer); - for (SectionIndex = 0; SectionIndex < NtHeaders->FileHeader.NumberOfSections; - SectionIndex++) - RtlFreeAnsiString(ANSI_NAME_STRING(&SectionHeaders[SectionIndex])); - RosSymFreeMem(SectionHeaders); - - return FALSE; + /* Check if MZ header is valid */ + DosHeader = (PIMAGE_DOS_HEADER) ImageStart; + if (ImageSize < sizeof(IMAGE_DOS_HEADER) + || ! ROSSYM_IS_VALID_DOS_HEADER(DosHeader)) + { + DPRINT1("Image doesn't have a valid DOS header\n"); + return FALSE; + } + + /* Locate NT header */ + NtHeaders = (PIMAGE_NT_HEADERS)((char *) ImageStart + DosHeader->e_lfanew); + if (ImageSize < DosHeader->e_lfanew + sizeof(IMAGE_NT_HEADERS) + || ! ROSSYM_IS_VALID_NT_HEADERS(NtHeaders)) + { + DPRINT1("Image doesn't have a valid PE header\n"); + return FALSE; + } + + /* Search for the section header */ + SectionHeader = IMAGE_FIRST_SECTION(NtHeaders); + if (ImageSize < (ULONG_PTR)((char *) (SectionHeader + NtHeaders->FileHeader.NumberOfSections) + - (char *) ImageStart)) + { + DPRINT1("Image doesn't have valid section headers\n"); + return FALSE; + } + strncpy(SectionName, ROSSYM_SECTION_NAME, IMAGE_SIZEOF_SHORT_NAME); + for (SectionIndex = 0; SectionIndex < NtHeaders->FileHeader.NumberOfSections; SectionIndex++) + { + if (0 == memcmp(SectionName, SectionHeader->Name, IMAGE_SIZEOF_SHORT_NAME)) + { + RosSymSectionFound = TRUE; + break; + } + SectionHeader++; + } + + if (!RosSymSectionFound) + { + DPRINT("No %s section found\n", ROSSYM_SECTION_NAME); + return FALSE; + } + + /* Locate the section itself */ + if (ImageSize < SectionHeader->PointerToRawData + SectionHeader->SizeOfRawData + || SectionHeader->SizeOfRawData < sizeof(ROSSYM_HEADER)) + { + DPRINT("Invalid %s section\n", ROSSYM_SECTION_NAME); + return FALSE; + } + + if (SectionHeader->VirtualAddress + SectionHeader->Misc.VirtualSize > ImageSize) + { + DPRINT("Bad %s section virtual size!\n", ROSSYM_SECTION_NAME); + return FALSE; + } + + /* Load it */ + return RosSymCreateFromRaw((char *) ImageStart + SectionHeader->VirtualAddress, + SectionHeader->SizeOfRawData, RosSymInfo); } /* EOF */ diff --git a/lib/rossym/initum.c b/lib/rossym/initum.c index 5a80fd37eef..c00a13a1e09 100644 --- a/lib/rossym/initum.c +++ b/lib/rossym/initum.c @@ -7,12 +7,9 @@ * PROGRAMMERS: Ge van Geldorp (gvg@reactos.com) */ -#define WIN32_NO_STATUS #include #include #include "rossympriv.h" -#define NTOS_MODE_USER -#include #define NDEBUG #include @@ -20,13 +17,13 @@ static PVOID RosSymAllocMemUM(ULONG_PTR Size) { - return RtlAllocateHeap(RtlGetProcessHeap(), 0, Size); + return HeapAlloc(GetProcessHeap(), 0, Size); } static VOID RosSymFreeMemUM(PVOID Area) { - RtlFreeHeap(RtlGetProcessHeap(), 0, Area); + HeapFree(GetProcessHeap(), 0, Area); } VOID diff --git a/lib/rossym/rossym.rbuild b/lib/rossym/rossym.rbuild new file mode 100644 index 00000000000..2a9f87be27a --- /dev/null +++ b/lib/rossym/rossym.rbuild @@ -0,0 +1,15 @@ + + + + + delete.c + find.c + fromfile.c + frommem.c + fromraw.c + getraw.c + init.c + initkm.c + initum.c + zwfile.c + diff --git a/lib/rossym/rossympriv.h b/lib/rossym/rossympriv.h index fb97019710a..cc3f8ff2ff9 100644 --- a/lib/rossym/rossympriv.h +++ b/lib/rossym/rossympriv.h @@ -9,6 +9,13 @@ #pragma once +typedef struct _ROSSYM_INFO { + PROSSYM_ENTRY Symbols; + ULONG SymbolsCount; + PCHAR Strings; + ULONG StringsLength; +} ROSSYM_INFO; + extern ROSSYM_CALLBACKS RosSymCallbacks; #define RosSymAllocMem(Size) (*RosSymCallbacks.AllocMemProc)(Size) diff --git a/lib/rossym/zwfile.c b/lib/rossym/zwfile.c index a6ce196c632..dc89c3e3157 100644 --- a/lib/rossym/zwfile.c +++ b/lib/rossym/zwfile.c @@ -15,40 +15,38 @@ #define NDEBUG #include -NTSTATUS RosSymStatus; - BOOLEAN RosSymZwReadFile(PVOID FileContext, PVOID Buffer, ULONG Size) { - //NTSTATUS Status; + NTSTATUS Status; IO_STATUS_BLOCK IoStatusBlock; - RosSymStatus = ZwReadFile(*((HANDLE *) FileContext), + Status = ZwReadFile(*((HANDLE *) FileContext), 0, 0, 0, &IoStatusBlock, Buffer, Size, 0, 0); - return NT_SUCCESS(RosSymStatus) && IoStatusBlock.Information == Size; + return NT_SUCCESS(Status) && IoStatusBlock.Information == Size; } BOOLEAN RosSymZwSeekFile(PVOID FileContext, ULONG_PTR Position) { - //NTSTATUS Status; + NTSTATUS Status; IO_STATUS_BLOCK IoStatusBlock; FILE_POSITION_INFORMATION NewPosition; NewPosition.CurrentByteOffset.u.HighPart = 0; NewPosition.CurrentByteOffset.u.LowPart = Position; - RosSymStatus = ZwSetInformationFile(*((HANDLE *) FileContext), + Status = ZwSetInformationFile(*((HANDLE *) FileContext), &IoStatusBlock, (PVOID) &NewPosition, sizeof(FILE_POSITION_INFORMATION), FilePositionInformation); - return NT_SUCCESS(RosSymStatus); + return NT_SUCCESS(Status); } /* EOF */ diff --git a/lib/rtl/i386/rtlswap.S b/lib/rtl/i386/rtlswap.S new file mode 100644 index 00000000000..6ded910eb85 --- /dev/null +++ b/lib/rtl/i386/rtlswap.S @@ -0,0 +1,53 @@ +/* + * COPYRIGHT: See COPYING in the top level directory + * PROJECT: ReactOS Run-Time Library + * PURPOSE: Byte swap functions + * FILE: lib/rtl/i386/rtlswap.S + * PROGRAMER: Alex Ionescu (alex.ionescu@reactos.org) + */ + +.intel_syntax noprefix + +.globl @RtlUshortByteSwap@4 +.globl @RtlUlongByteSwap@4 +.globl @RtlUlonglongByteSwap@8 + +/* FUNCTIONS ***************************************************************/ + +.func @RtlUshortByteSwap@4, @RtlUshortByteSwap@4 +@RtlUshortByteSwap@4: + + /* Swap high and low bits */ + mov ah, cl + mov al, ch + ret +.endfunc + +.func @RtlUlongByteSwap@4, @RtlUlongByteSwap@4 +@RtlUlongByteSwap@4: + + /* Swap high and low bits */ + mov eax, ecx + bswap eax + ret +.endfunc + +.func @RtlUlonglongByteSwap@8, @RtlUlonglongByteSwap@8 +@RtlUlonglongByteSwap@8: + + /* Get 64-bit integer */ + mov edx, [esp+8] + mov eax, [esp+4] + + /* Swap it */ + bswap edx + bswap eax + + /* Return it */ + mov ecx, eax + mov eax, edx + mov edx, ecx + ret +.endfunc + + diff --git a/lib/rtl/rtl.rbuild b/lib/rtl/rtl.rbuild new file mode 100644 index 00000000000..e567221cf06 --- /dev/null +++ b/lib/rtl/rtl.rbuild @@ -0,0 +1,112 @@ + + + + + + + + . + + + + + + + + debug_asm.S + except_asm.s + except.c + interlck.S + rtlswap.S + rtlmem.s + res_asm.s + thread.c + + + + + debug.c + except.c + interlocked.c + rtlmem.s + rtlswap.s + thread.c + + + + + debug_asm.S + + mem.c + memgen.c + + + + debug_asm.S + except_asm.S + slist.S + unwind.c + stubs.c + + mem.c + memgen.c + + access.c + acl.c + actctx.c + assert.c + atom.c + avltable.c + bitmap.c + bootdata.c + compress.c + condvar.c + crc32.c + critical.c + dbgbuffer.c + debug.c + dos8dot3.c + encode.c + env.c + error.c + exception.c + generictable.c + handle.c + heap.c + heapdbg.c + heappage.c + image.c + interlck.c + message.c + largeint.c + luid.c + network.c + nls.c + path.c + ppb.c + process.c + propvar.c + qsort.c + random.c + rangelist.c + registry.c + res.c + resource.c + sd.c + security.c + slist.c + sid.c + srw.c + splaytree.c + thread.c + time.c + timezone.c + timerqueue.c + unicode.c + unicodeprefix.c + vectoreh.c + version.c + wait.c + workitem.c + rtl.h + diff --git a/lib/sdk/crt/crt.rbuild b/lib/sdk/crt/crt.rbuild new file mode 100644 index 00000000000..eb4a65895ab --- /dev/null +++ b/lib/sdk/crt/crt.rbuild @@ -0,0 +1,575 @@ + + + + + + + + chkstk_asm.s + chkstk_ms.s + + + + + chkstk_asm.s + + + + + + + chkstk + . + include + extern + + + + + + + + _cprintf.c + _snprintf.c + _snwprintf.c + _vcprintf.c + _vsnprintf.c + _vsnwprintf.c + fprintf.c + fwprintf.c + printf.c + sprintf.c + streamout.c + swprintf.c + vfprintf.c + vfwprintf.c + vprintf.c + vsprintf.c + vswprintf.c + vwprintf.c + wprintf.c + wstreamout.c + + + + cgets.c + cputs.c + getch.c + getche.c + kbhit.c + putch.c + ungetch.c + + + chdir.c + chdrive.c + getcwd.c + getdcwd.c + getdfree.c + getdrive.c + mkdir.c + rmdir.c + wchdir.c + wgetcwd.c + wgetdcwd.c + wmkdir.c + wrmdir.c + + + abnorter.c + checkesp.c + cpp.c + cppexcept.c + except.c + matherr.c + + + prolog.s + seh.s + unwind.c + + + + + seh.s + + + + + seh.s + chkstk_asm.s + + + xcptfil.c + + + chgsign.c + copysign.c + fpclass.c + fpecode.c + isnan.c + nafter.c + scalb.c + + + clearfp.c + cntrlfp.c + fpreset.c + logb.c + statfp.c + + + + + clearfp.c + cntrlfp.c + fpreset.c + logb.c + statfp.c + + + + + locale.c + + + acos.c + adjust.c + asin.c + cabs.c + cosf.c + cosh.c + div.c + fdivbug.c + frexp.c + huge_val.c + hypot.c + ldiv.c + logf.c + modf.c + powf.c + rand.c + s_modf.c + sinf.c + sinh.c + tanh.c + powl.c + + + + alldiv_asm.s + alldvrm_asm.s + allmul_asm.s + allrem_asm.s + allshl_asm.s + allshr_asm.s + atan_asm.s + aulldiv_asm.s + aulldvrm_asm.s + aullrem_asm.s + aullshr_asm.s + ceil_asm.s + ceilf.S + cos_asm.s + fabs_asm.s + floor_asm.s + floorf.S + ftol_asm.s + log_asm.s + log10_asm.s + pow_asm.s + sin_asm.s + sqrt_asm.s + tan_asm.s + + atan2.c + ci.c + exp.c + fmod.c + fmodf.c + ldexp.c + sqrtf.c + + + + + + cos.c + sin.c + + alldiv.S + atan.S + atan2.S + ceil.S + ceilf.S + exp.S + fabs.S + floor.S + floorf.S + fmod.S + fmodf.S + ldexp.S + log.S + log10.S + pow.S + sqrt.S + sqrtf.S + tan.S + + + + + + stubs.c + + + + + hanzen.c + ischira.c + iskana.c + iskmoji.c + iskpun.c + islead.c + islwr.c + ismbal.c + ismbaln.c + ismbc.c + ismbgra.c + ismbkaln.c + ismblead.c + ismbpri.c + ismbpun.c + ismbtrl.c + isuppr.c + jistojms.c + jmstojis.c + mbbtype.c + mbccpy.c + mbclen.c + mbscat.c + mbschr.c + mbscmp.c + mbscoll.c + mbscpy.c + mbscspn.c + mbsdec.c + mbsdup.c + mbsicmp.c + mbsicoll.c + mbsinc.c + mbslen.c + mbslwr.c + mbsncat.c + mbsnccnt.c + mbsncmp.c + mbsncoll.c + mbsncpy.c + mbsnextc.c + mbsnicmp.c + mbsnicoll.c + mbsninc.c + mbsnset.c + mbspbrk.c + mbsrchr.c + mbsrev.c + mbsset.c + mbsspn.c + mbsspnp.c + mbsstr.c + mbstok.c + mbstrlen.c + mbsupr.c + + + + + + memchr_asm.s + memcpy_asm.s + memmove_asm.s + memset_asm.s + + + + memchr.c + memcpy.c + memmove.c + memset.c + + memcmp.c + memccpy.c + memicmp.c + + + + amsg.c + assert.c + environ.c + getargs.c + i10output.c + initterm.c + lock.c + purecall.c + stubs.c + tls.c + + + _cwait.c + _system.c + dll.c + process.c + procid.c + thread.c + threadid.c + threadx.c + wprocess.c + + + bsearch.c + lfind.c + lsearch.c + + + + + setjmp.s + + + + + setjmp.s + + + + + signal.c + xcptinfo.c + + + _flsbuf.c + _flswbuf.c + access.c + file.c + find.c + find64.c + findi64.c + fmode.c + perror.c + popen.c + stat.c + stat64.c + waccess.c + wfind.c + wfind64.c + wfindi64.c + wpopen.c + wstat.c + wstat64.c + lock_file.c + + + _exit.c + abort.c + atexit.c + ecvt.c + errno.c + fcvt.c + fcvtbuf.c + fullpath.c + gcvt.c + getenv.c + makepath.c + makepath_s.c + mbtowc.c + mbstowcs.c + obsol.c + putenv.c + qsort.c + rot.c + senv.c + swab.c + wfulpath.c + wputenv.c + wsenv.c + wmakpath.c + wmakpath_s.c + + + + + strcat_asm.s + strchr_asm.s + strcmp_asm.s + strcpy_asm.s + strlen_asm.s + strncat_asm.s + strncmp_asm.s + strncpy_asm.s + strnlen_asm.s + strrchr_asm.s + wcscat_asm.s + wcschr_asm.s + wcscmp_asm.s + wcscpy_asm.s + wcslen_asm.s + wcsncat_asm.s + wcsncmp_asm.s + wcsncpy_asm.s + wcsnlen_asm.s + wcsrchr_asm.s + + + + strcat.c + strchr.c + strcmp.c + strcpy.c + strlen.c + strncat.c + strncmp.c + strncpy.c + strnlen.c + strrchr.c + wcscat.c + wcschr.c + wcscmp.c + wcscpy.c + wcslen.c + wcsncat.c + wcsncmp.c + wcsncpy.c + wcsnlen.c + wcsrchr.c + + atof.c + atoi.c + atoi64.c + atol.c + ctype.c + itoa.c + itow.c + lasttok.c + scanf.c + splitp.c + strcoll.c + strcspn.c + strdup.c + strerror.c + stricmp.c + string.c + strlwr.c + strncoll.c + strnicmp.c + strpbrk.c + strrev.c + strset.c + strspn.c + strstr.c + strtod.c + strtoi64.c + strtok.c + strtol.c + strtoul.c + strtoull.c + strupr.c + strxfrm.c + wcs.c + wcstol.c + wcstoul.c + wsplitp.c + wtoi.c + wtoi64.c + wtol.c + + + systime.c + + + asctime.c + clock.c + ctime32.c + ctime64.c + ctime.c + difftime32.c + difftime64.c + difftime.c + ftime32.c + ftime64.c + ftime.c + futime32.c + futime64.c + futime.c + gmtime.c + localtime32.c + localtime64.c + localtime.c + mktime.c + strdate.c + strftime.c + strtime.c + time32.c + time64.c + time.c + timezone.c + tzname.c + utime32.c + utime64.c + utime.c + wasctime.c + wcsftime.c + wctime32.c + wctime64.c + wctime.c + wstrdate.c + wstrtime.c + wutime32.c + wutime64.c + wutime.c + + + wcscoll.c + wcscspn.c + wcsicmp.c + wcslwr.c + wcsnicmp.c + wcsspn.c + wcsstr.c + wcstok.c + wcsupr.c + wcsxfrm.c + wlasttok.c + + + heap.c + undname.c + + + + + chkstk + . + include + + + + streamout.c + wstreamout.c + wsprintfA.c + wsprintfW.c + wvsprintfA.c + wvsprintfW.c + wvsnprintfA.c + wvsnprintfW.c + + + mbstowcs_nt.c + wcstombs_nt.c + + + + diff --git a/lib/sdk/crt/libcntpr.rbuild b/lib/sdk/crt/libcntpr.rbuild new file mode 100644 index 00000000000..ca472b54487 --- /dev/null +++ b/lib/sdk/crt/libcntpr.rbuild @@ -0,0 +1,244 @@ + + + + . + include + + + + + + + + + _snprintf.c + _snwprintf.c + _vcprintf.c + _vsnprintf.c + _vsnwprintf.c + sprintf.c + streamout.c + swprintf.c + vprintf.c + vsprintf.c + vswprintf.c + wstreamout.c + + + + "extern __attribute__ ((dllexport))" + + + + + + chkstk_asm.s + chkstk_ms.s + seh.s + + + + + chkstk_asm.s + seh.s + + + + + chkstk_asm.s + seh.s + + + + + isnan.c + + + + + alldiv_asm.s + alldvrm_asm.s + allmul_asm.s + allrem_asm.s + allshl_asm.s + allshr_asm.s + atan_asm.s + aulldiv_asm.s + aulldvrm_asm.s + aullrem_asm.s + aullshr_asm.s + ci.c + ceil_asm.s + cos_asm.s + fabs_asm.s + floor_asm.s + ftol_asm.s + log_asm.s + log10_asm.s + pow_asm.s + sin_asm.s + sqrt_asm.s + tan_asm.s + + + + cos.c + sin.c + + alldiv.S + atan.S + atan2.S + ceil.S + exp.S + fabs.S + floor.S + fmod.S + ldexp.S + log.S + log10.S + pow.S + sqrt.S + tan.S + + + abs.c + div.c + labs.c + rand_nt.c + + + + + + memchr_asm.s + memcpy_asm.s + memmove_asm.s + memset_asm.s + + + + memchr.c + memcpy.c + memmove.c + memset.c + + memccpy.c + memcmp.c + memicmp.c + + + + bsearch.c + lfind.c + + + + + + setjmp.s + + + + + setjmp.s + + + + + + qsort.c + + + + + + strcat_asm.s + strchr_asm.s + strcmp_asm.s + strcpy_asm.s + strlen_asm.s + strncat_asm.s + strncmp_asm.s + strncpy_asm.s + strnlen_asm.s + strrchr_asm.s + wcscat_asm.s + wcschr_asm.s + wcscmp_asm.s + wcscpy_asm.s + wcslen_asm.s + wcsncat_asm.s + wcsncmp_asm.s + wcsncpy_asm.s + wcsnlen_asm.s + wcsrchr_asm.s + + + + strcat.c + strchr.c + strcmp.c + strcpy.c + strlen.c + strncat.c + strncmp.c + strncpy.c + strnlen.c + strrchr.c + wcscat.c + wcschr.c + wcscmp.c + wcscpy.c + wcslen.c + wcsncat.c + wcsncmp.c + wcsncpy.c + wcsnlen.c + wcsrchr.c + + ctype.c + scanf.c + strcspn.c + stricmp.c + strnicmp.c + strlwr.c + strrev.c + strset.c + strstr.c + strupr.c + strpbrk.c + strspn.c + atoi64.c + atoi.c + atol.c + itoa.c + itow.c + mbstowcs_nt.c + splitp.c + strtol.c + strtoul.c + strtoull.c + wcs.c + wcstol.c + wcstombs_nt.c + wcstoul.c + wsplitp.c + wtoi64.c + wtoi.c + wtol.c + + + + mbstrlen.c + + + + wcsicmp.c + wcslwr.c + wcsnicmp.c + wcsupr.c + wcscspn.c + wcsspn.c + wcsstr.c + + diff --git a/lib/sdk/crt/math/i386/atan2.c b/lib/sdk/crt/math/i386/atan2.c new file mode 100644 index 00000000000..7b7ebac8a22 --- /dev/null +++ b/lib/sdk/crt/math/i386/atan2.c @@ -0,0 +1,27 @@ + +#include + +double atan2 (double __y, double __x); + +/* + * @implemented + */ +double atan2 (double __y, double __x) +{ + register double __val; +#ifdef __GNUC__ + __asm __volatile__ + ("fpatan\n\t" + "fld %%st(0)" + : "=t" (__val) : "0" (__x), "u" (__y)); +#else + __asm + { + fld __y + fld __x + fpatan + fstp __val + } +#endif /*__GNUC__*/ + return __val; +} diff --git a/lib/sdk/crt/math/i386/exp.c b/lib/sdk/crt/math/i386/exp.c new file mode 100644 index 00000000000..727a1cb5419 --- /dev/null +++ b/lib/sdk/crt/math/i386/exp.c @@ -0,0 +1,64 @@ +/* Math functions for i387. + Copyright (C) 1995, 1996, 1997 Free Software Foundation, Inc. + This file is part of the GNU C Library. + Contributed by John C. Bowman , 1995. + + The GNU C 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. + + The GNU C 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 the GNU C Library; if not, write to the Free + Software Foundation, Inc., 51 Franklin Street, Fifth Floor, + Boston, MA 02110-1301, USA. +*/ + +#include + +double exp (double __x); + +double exp (double __x) +{ +#ifdef __GNUC__ + register double __value, __exponent; + __asm __volatile__ + ("fldl2e # e^x = 2^(x * log2(e))\n\t" + "fmul %%st(1) # x * log2(e)\n\t" + "fst %%st(1)\n\t" + "frndint # int(x * log2(e))\n\t" + "fxch\n\t" + "fsub %%st(1) # fract(x * log2(e))\n\t" + "f2xm1 # 2^(fract(x * log2(e))) - 1\n\t" + : "=t" (__value), "=u" (__exponent) : "0" (__x)); + __value += 1.0; + __asm __volatile__ + ("fscale" + : "=t" (__value) : "0" (__value), "u" (__exponent)); + + return __value; +#else + register double __val; + __asm + { + fld1 // store 1.0 for later use + fld __x + fldl2e // e^x = 2^(x * log2(e)) + fmul st,st(1) // x * log2(e) + fld st(0) + frndint // int(x * log2(e)) + fsub st,st(1) // fract(x * log2(e)) + fxch + f2xm1 // 2^(fract(x * log2(e))) - 1 + fadd st,st(3) // + 1.0 + fscale + fstp __val + } + return __val; +#endif /*__GNUC__*/ +} diff --git a/lib/sdk/crt/math/i386/fmod.c b/lib/sdk/crt/math/i386/fmod.c new file mode 100644 index 00000000000..fe74aa5e4d1 --- /dev/null +++ b/lib/sdk/crt/math/i386/fmod.c @@ -0,0 +1,49 @@ +/* Math functions for i387. + Copyright (C) 1995, 1996, 1997 Free Software Foundation, Inc. + This file is part of the GNU C Library. + Contributed by John C. Bowman , 1995. + + The GNU C 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. + + The GNU C 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 the GNU C Library; if not, write to the Free + Software Foundation, Inc., 51 Franklin Street, Fifth Floor, + Boston, MA 02110-1301, USA. +*/ + +#include + +double fmod (double __x, double __y); + +double fmod (double __x, double __y) +{ + register double __val; +#ifdef __GNUC__ + __asm __volatile__ + ("1: fprem\n\t" + "fstsw %%ax\n\t" + "sahf\n\t" + "jp 1b" + : "=t" (__val) : "0" (__x), "u" (__y) : "ax", "cc"); +#else + __asm + { + fld __y + fld __x +L1: fprem1 + fstsw ax + sahf + jp L1 + fstp __val + } +#endif /*__GNUC__*/ + return __val; +} diff --git a/lib/sdk/crt/math/i386/fmodf.c b/lib/sdk/crt/math/i386/fmodf.c new file mode 100644 index 00000000000..761f56c043e --- /dev/null +++ b/lib/sdk/crt/math/i386/fmodf.c @@ -0,0 +1,28 @@ +/** + * This file has no copyright assigned and is placed in the Public Domain. + * This file is part of the w64 mingw-runtime package. + * No warranty is given; refer to the file DISCLAIMER.PD within this package. + */ +/* + * Written by J.T. Conklin . + * Public domain. + * + * Adapted for float type by Danny Smith + * . + */ + +#include + +float +fmodf (float x, float y) +{ + float res = 0.0F; + + asm ("1:\tfprem\n\t" + "fstsw %%ax\n\t" + "sahf\n\t" + "jp 1b\n\t" + "fstp %%st(1)" + : "=t" (res) : "0" (x), "u" (y) : "ax", "st(1)"); + return res; +} diff --git a/lib/sdk/crt/math/i386/sqrtf.c b/lib/sdk/crt/math/i386/sqrtf.c new file mode 100644 index 00000000000..ff36a345b6d --- /dev/null +++ b/lib/sdk/crt/math/i386/sqrtf.c @@ -0,0 +1,12 @@ +/** + * This file has no copyright assigned and is placed in the Public Domain. + * This file is part of the w64 mingw-runtime package. + * No warranty is given; refer to the file DISCLAIMER.PD within this package. + */ +#include + +float +sqrtf(float x) +{ + return ((float)sqrt((double)x)); +} diff --git a/lib/sdk/crt/mem/i386/memcpy_asm.s b/lib/sdk/crt/mem/i386/memcpy_asm.s new file mode 100644 index 00000000000..e69de29bb2d diff --git a/lib/sdk/delayimp/delayimp.rbuild b/lib/sdk/delayimp/delayimp.rbuild new file mode 100644 index 00000000000..ad7b7df6dcd --- /dev/null +++ b/lib/sdk/delayimp/delayimp.rbuild @@ -0,0 +1,7 @@ + + + + + delayimp.c + + diff --git a/lib/sdk/dxguid/dxguid.rbuild b/lib/sdk/dxguid/dxguid.rbuild new file mode 100644 index 00000000000..9a6a6c46c0a --- /dev/null +++ b/lib/sdk/dxguid/dxguid.rbuild @@ -0,0 +1,5 @@ + + + + dxguid-mingw.c + diff --git a/lib/sdk/ioevent/ioevent.rbuild b/lib/sdk/ioevent/ioevent.rbuild new file mode 100644 index 00000000000..51618cc1fb1 --- /dev/null +++ b/lib/sdk/ioevent/ioevent.rbuild @@ -0,0 +1,5 @@ + + + + ioevent.c + diff --git a/lib/sdk/nt/nt.rbuild b/lib/sdk/nt/nt.rbuild new file mode 100644 index 00000000000..5a8ed051f55 --- /dev/null +++ b/lib/sdk/nt/nt.rbuild @@ -0,0 +1,5 @@ + + + + entry_point.c + diff --git a/lib/sdk/scrnsave/scrnsave.rbuild b/lib/sdk/scrnsave/scrnsave.rbuild new file mode 100644 index 00000000000..503f9f26c82 --- /dev/null +++ b/lib/sdk/scrnsave/scrnsave.rbuild @@ -0,0 +1,7 @@ + + + + + scrnsave.c + + \ No newline at end of file diff --git a/lib/sdk/sdk.rbuild b/lib/sdk/sdk.rbuild new file mode 100644 index 00000000000..978933fb8db --- /dev/null +++ b/lib/sdk/sdk.rbuild @@ -0,0 +1,32 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/lib/sdk/strmiids/strmiids.rbuild b/lib/sdk/strmiids/strmiids.rbuild new file mode 100644 index 00000000000..046ff2a8d7f --- /dev/null +++ b/lib/sdk/strmiids/strmiids.rbuild @@ -0,0 +1,5 @@ + + + + strmiids.c + diff --git a/lib/sdk/uuid/uuid.c b/lib/sdk/uuid/uuid.c new file mode 100644 index 00000000000..afa9847af62 --- /dev/null +++ b/lib/sdk/uuid/uuid.c @@ -0,0 +1,176 @@ +/* + * GUID definitions + * + * Copyright 2000 Alexandre Julliard + * Copyright 2000 Francois Gouget + * + * 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 + */ + +#include + +#define COM_NO_WINDOWS_H +#include "windef.h" +#include "initguid.h" + +/* GUIDs defined in uuids.lib */ + +DEFINE_GUID(GUID_NULL,0,0,0,0,0,0,0,0,0,0,0); + +#include "winbase.h" +#include "wingdi.h" +#include "winuser.h" + +#define USE_COM_CONTEXT_DEF +#include "objbase.h" +#include "servprov.h" + +#include "oleauto.h" +#include "oleidl.h" +#include "objidl.h" +#include "olectl.h" + +#include "ocidl.h" +#include "ctxtcall.h" + +#include "docobj.h" +#include "exdisp.h" + +#include "shdeprecated.h" +#include "shlguid.h" +#include "shlguid_undoc.h" +#include "shlobj.h" +#include "shldisp.h" +#include "comcat.h" +#include "urlmon.h" +#define _NO_AUTHOR_GUIDS +#include "activaut.h" +#include "activdbg.h" +#define _NO_SCRIPT_GUIDS +#include "activscp.h" +#include "dispex.h" +#include "mlang.h" +#include "mshtml.h" +#include "mshtmhst.h" +#include "richole.h" +#include "xmldom.h" +#include "xmldso.h" +#include "downloadmgr.h" +#include "objsel.h" +#include "hlink.h" +#include "optary.h" +#include "indexsrv.h" +#include "htiframe.h" +#include "urlhist.h" +#include "hlguids.h" +#include "dimm.h" +#include "isguids.h" +#include "objsafe.h" +#include "perhist.h" +#include "netcon.h" +#include "netfw.h" +#include "msctf.h" +#include "sensevts.h" +#include "ocmm.h" +#include "commoncontrols.h" + +/* FIXME: cguids declares GUIDs but does not define their values */ + +/* other GUIDs */ + +#if 0 /* FIXME */ +#include "uuids.h" +#endif + +/* the GUID for these interfaces are already defined by dxguid.c */ +#define __IReferenceClock_INTERFACE_DEFINED__ +#define __IKsPropertySet_INTERFACE_DEFINED__ +#if 0 /* FIXME */ +#include "strmif.h" +#endif +#if 0 /* FIXME */ +#include "control.h" +#endif + +/* GUIDs not declared in an exported header file */ +DEFINE_GUID(IID_IDirectPlaySP, 0x0c9f6360,0xcc61,0x11cf,0xac,0xec,0x00,0xaa,0x00,0x68,0x86,0xe3); +DEFINE_GUID(IID_ISFHelper, 0x1fe68efb,0x1874,0x9812,0x56,0xdc,0x00,0x00,0x00,0x00,0x00,0x00); +DEFINE_GUID(IID_IDPLobbySP, 0x5a4e5a20,0x2ced,0x11d0,0xa8,0x89,0x00,0xa0,0xc9,0x05,0x43,0x3c); +DEFINE_GUID(IID_IProxyManager, 0x00000008,0x0000,0x0000,0xc0,0x00,0x00,0x00,0x00,0x00,0x00,0x46); +DEFINE_GUID(IID_IBindStatusCallbackHolder,0x79eac9cc,0xbaf9,0x11ce,0x8c,0x82,0x00,0xaa,0x00,0x4b,0xa9,0x0b); +DEFINE_GUID(IID_IEnumNetConnection, 0xC08956A0,0x1CD3,0x11D1,0xB1,0xC5,0x00,0x80,0x5F,0xC1,0x27,0x0E); +DEFINE_GUID(IID_INetConnection, 0xC08956A1,0x1CD3,0x11D1,0xB1,0xC5,0x00,0x80,0x5F,0xC1,0x27,0x0E); +DEFINE_GUID(IID_INetConnectionManager, 0xC08956A2,0x1CD3,0x11D1,0xB1,0xC5,0x00,0x80,0x5F,0xC1,0x27,0x0E); +DEFINE_GUID(IID_INetConnectionConnectUi, 0xC08956A3,0x1CD3,0x11D1,0xB1,0xC5,0x00,0x80,0x5F,0xC1,0x27,0x0E); +DEFINE_GUID(IID_INetConnectionPropertyUi, 0xC08956A4,0x1CD3,0x11D1,0xB1,0xC5,0x00,0x80,0x5F,0xC1,0x27,0x0E); +DEFINE_GUID(IID_INetLanConnectionUiInfo, 0xC08956A6,0x1CD3,0x11D1,0xB1,0xC5,0x00,0x80,0x5F,0xC1,0x27,0x0E); +DEFINE_GUID(IID_IEnumNetCfgComponent, 0xC0E8AE92,0x306E,0x11D1,0xAA,0xCF,0x00,0x80,0x5F,0xC1,0x27,0x0E); +DEFINE_GUID(IID_INetCfg, 0xC0E8AE93,0x306E,0x11D1,0xAA,0xCF,0x00,0x80,0x5F,0xC1,0x27,0x0E); +DEFINE_GUID(IID_INetCfgComponent, 0xC0E8AE99,0x306E,0x11D1,0xAA,0xCF,0x00,0x80,0x5F,0xC1,0x27,0x0E); +DEFINE_GUID(IID_INetCfgComponentBindings, 0xC0E8AE9E,0x306E,0x11D1,0xAA,0xCF,0x00,0x80,0x5F,0xC1,0x27,0x0E); +DEFINE_GUID(IID_INetCfgLock, 0xC0E8AE9F,0x306E,0x11D1,0xAA,0xCF,0x00,0x80,0x5F,0xC1,0x27,0x0E); +DEFINE_GUID(IID_INetConnectionPropertyUi2, 0xC08956B9,0x1CD3,0x11D1,0xB1,0xC5,0x00,0x80,0x5F,0xC1,0x27,0x0E); +DEFINE_GUID(IID_INetCfgPnpReconfigCallback,0x8D84BD35,0xE227,0x11D2,0xB7,0x00,0x00,0xA0,0xC9,0x8A,0x6A,0x85); +DEFINE_GUID(IID_INetCfgComponentPropertyUi,0x932238E0,0xBEA1,0x11D0,0x92,0x98,0x00,0xC0,0x4f,0xC9,0x9D,0xCF); +DEFINE_GUID(IID_INetCfgComponentControl, 0x932238DF,0xBEA1,0x11D0,0x92,0x98,0x00,0xC0,0x4f,0xC9,0x9D,0xCF); + +DEFINE_GUID(FMTID_SummaryInformation,0xF29F85E0,0x4FF9,0x1068,0xAB,0x91,0x08,0x00,0x2B,0x27,0xB3,0xD9); +DEFINE_GUID(FMTID_DocSummaryInformation,0xD5CDD502,0x2E9C,0x101B,0x93,0x97,0x08,0x00,0x2B,0x2C,0xF9,0xAE); +DEFINE_GUID(FMTID_UserDefinedProperties,0xD5CDD505,0x2E9C,0x101B,0x93,0x97,0x08,0x00,0x2B,0x2C,0xF9,0xAE); + +/* COM CLSIDs not declared in an exported header file */ +DEFINE_GUID(CLSID_StdMarshal, 0x00000017,0x0000,0x0000,0xc0,0x00,0x00,0x00,0x00,0x00,0x00,0x46); +DEFINE_GUID(CLSID_IdentityUnmarshal, 0x0000001b,0x0000,0x0000,0xc0,0x00,0x00,0x00,0x00,0x00,0x00,0x46); +DEFINE_GUID(CLSID_PSGenObject, 0x0000030c,0x0000,0x0000,0xc0,0x00,0x00,0x00,0x00,0x00,0x00,0x46); +DEFINE_GUID(CLSID_PSClientSite, 0x0000030d,0x0000,0x0000,0xc0,0x00,0x00,0x00,0x00,0x00,0x00,0x46); +DEFINE_GUID(CLSID_PSClassObject, 0x0000030e,0x0000,0x0000,0xc0,0x00,0x00,0x00,0x00,0x00,0x00,0x46); +DEFINE_GUID(CLSID_PSInPlaceActive, 0x0000030f,0x0000,0x0000,0xc0,0x00,0x00,0x00,0x00,0x00,0x00,0x46); +DEFINE_GUID(CLSID_PSInPlaceFrame, 0x00000310,0x0000,0x0000,0xc0,0x00,0x00,0x00,0x00,0x00,0x00,0x46); +DEFINE_GUID(CLSID_PSDragDrop, 0x00000311,0x0000,0x0000,0xc0,0x00,0x00,0x00,0x00,0x00,0x00,0x46); +DEFINE_GUID(CLSID_PSBindCtx, 0x00000312,0x0000,0x0000,0xc0,0x00,0x00,0x00,0x00,0x00,0x00,0x46); +DEFINE_GUID(CLSID_PSEnumerators, 0x00000313,0x0000,0x0000,0xc0,0x00,0x00,0x00,0x00,0x00,0x00,0x46); +DEFINE_GUID(CLSID_Picture_Metafile, 0x00000315,0x0000,0x0000,0xc0,0x00,0x00,0x00,0x00,0x00,0x00,0x46); +DEFINE_GUID(CLSID_StaticMetafile, 0x00000315,0x0000,0x0000,0xc0,0x00,0x00,0x00,0x00,0x00,0x00,0x46); +DEFINE_GUID(CLSID_Picture_Dib, 0x00000316,0x0000,0x0000,0xc0,0x00,0x00,0x00,0x00,0x00,0x00,0x46); +DEFINE_GUID(CLSID_StaticDib, 0x00000316,0x0000,0x0000,0xc0,0x00,0x00,0x00,0x00,0x00,0x00,0x46); +DEFINE_GUID(CLSID_Picture_EnhMetafile, 0x00000319,0x0000,0x0000,0xc0,0x00,0x00,0x00,0x00,0x00,0x00,0x46); +DEFINE_GUID(CLSID_DCOMAccessControl, 0x0000031d,0x0000,0x0000,0xc0,0x00,0x00,0x00,0x00,0x00,0x00,0x46); +DEFINE_GUID(CLSID_StdGlobalInterfaceTable,0x00000323,0x0000,0x0000,0xc0,0x00,0x00,0x00,0x00,0x00,0x00,0x46); +DEFINE_GUID(CLSID_ComBinding, 0x00000328,0x0000,0x0000,0xc0,0x00,0x00,0x00,0x00,0x00,0x00,0x46); +DEFINE_GUID(CLSID_StdEvent, 0x0000032b,0x0000,0x0000,0xc0,0x00,0x00,0x00,0x00,0x00,0x00,0x46); +DEFINE_GUID(CLSID_ManualResetEvent, 0x0000032c,0x0000,0x0000,0xc0,0x00,0x00,0x00,0x00,0x00,0x00,0x46); +DEFINE_GUID(CLSID_SynchronizeContainer, 0x0000032d,0x0000,0x0000,0xc0,0x00,0x00,0x00,0x00,0x00,0x00,0x46); +DEFINE_GUID(CLSID_InProcFreeMarshaler, 0x0000033a,0x0000,0x0000,0xc0,0x00,0x00,0x00,0x00,0x00,0x00,0x46); +DEFINE_GUID(CLSID_TF_ThreadMgr, 0x529a9e6b,0x6587,0x4f23,0xab,0x9e,0x9c,0x7d,0x68,0x3e,0x3c,0x50); +DEFINE_GUID(CLSID_TF_InputProcessorProfiles, 0x33c53a50,0xf456,0x4884,0xb0,0x49,0x85,0xfd,0x64,0x3e,0xcf,0xed); +DEFINE_GUID(CLSID_TF_CategoryMgr, 0xA4B544A1,0x438D,0x4B41,0x93,0x25,0x86,0x95,0x23,0xE2,0xD6,0xC7); +DEFINE_GUID(CLSID_TF_LangBarMgr, 0xebb08c45,0x6c4a,0x4fdc,0xae,0x53,0x4e,0xb8,0xc4,0xc7,0xdb,0x8e); +DEFINE_GUID(CLSID_TF_DisplayAttributeMgr, 0x3ce74de4,0x53d3,0x4d74,0x8b,0x83,0x43,0x1b,0x38,0x28,0xba,0x53); +DEFINE_GUID(CLSID_TaskbarList, 0x56fdf344,0xfd6d,0x11d0,0x95,0x8a,0x00,0x60,0x97,0xc9,0xa0,0x90); +DEFINE_GUID(GUID_TFCAT_TIP_KEYBOARD, 0x34745c63,0xb2f0,0x4784,0x8b,0x67,0x5e,0x12,0xc8,0x70,0x1a,0x31); +DEFINE_GUID(GUID_TFCAT_TIP_SPEECH, 0xB5A73CD1,0x8355,0x426B,0xA1,0x61,0x25,0x98,0x08,0xF2,0x6B,0x14); +DEFINE_GUID(GUID_TFCAT_TIP_HANDWRITING, 0x246ecb87,0xc2f2,0x4abe,0x90,0x5b,0xc8,0xb3,0x8a,0xdd,0x2c,0x43); +DEFINE_GUID(CLSID_ConnectionManager, 0xBA126AD1,0x2166,0x11D1,0xB1,0xD0,0x0,0x80,0x5F,0xC1,0x27,0x0E); +DEFINE_GUID(CLSID_CNetCfg, 0x5B035261,0x40F9,0x11D1,0xAA,0xEC,0x00,0x80,0x5F,0xC1,0x27,0x0E); +DEFINE_GUID(GUID_TFCAT_DISPLAYATTRIBUTEPROVIDER, 0x046B8C80,0x1647,0x40F7,0x9B,0x21,0xB9,0x3B,0x81,0xAA,0xBC,0x1B); +DEFINE_GUID(GUID_COMPARTMENT_KEYBOARD_DISABLED, 0x71a5b253,0x1951,0x466b,0x9f,0xbc,0x9c,0x88,0x08,0xfa,0x84,0xf2); +DEFINE_GUID(GUID_COMPARTMENT_KEYBOARD_OPENCLOSE, 0x58273aad,0x01bb,0x4164,0x95,0xc6,0x75,0x5b,0xa0,0xb5,0x16,0x2d); +DEFINE_GUID(GUID_COMPARTMENT_HANDWRITING_OPENCLOSE, 0xf9ae2c6b,0x1866,0x4361,0xaf,0x72,0x7a,0xa3,0x09,0x48,0x89,0x0e); +DEFINE_GUID(GUID_COMPARTMENT_SPEECH_DISABLED, 0x56c5c607,0x0703,0x4e59,0x8e,0x52,0xcb,0xc8,0x4e,0x8b,0xbe,0x35); +DEFINE_GUID(GUID_COMPARTMENT_SPEECH_OPENCLOSE, 0x544d6a63,0xe2e8,0x4752,0xbb,0xd1,0x00,0x09,0x60,0xbc,0xa0,0x83); +DEFINE_GUID(GUID_COMPARTMENT_SPEECH_GLOBALSTATE, 0x2a54fe8e,0x0d08,0x460c,0xa7,0x5d,0x87,0x03,0x5f,0xf4,0x36,0xc5); +DEFINE_GUID(GUID_COMPARTMENT_PERSISTMENUENABLED, 0x575f3783,0x70c8,0x47c8,0xae,0x5d,0x91,0xa0,0x1a,0x1f,0x75,0x92); +DEFINE_GUID(GUID_COMPARTMENT_EMPTYCONTEXT, 0xd7487dbf,0x804e,0x41c5,0x89,0x4d,0xad,0x96,0xfd,0x4e,0xea,0x13); +DEFINE_GUID(GUID_COMPARTMENT_TIPUISTATUS, 0x148ca3ec,0x0366,0x401c,0x8d,0x75,0xed,0x97,0x8d,0x85,0xfb,0xc9); diff --git a/lib/sdk/uuid/uuid.rbuild b/lib/sdk/uuid/uuid.rbuild new file mode 100644 index 00000000000..b699d2f7f70 --- /dev/null +++ b/lib/sdk/uuid/uuid.rbuild @@ -0,0 +1,5 @@ + + + + uuid.c + diff --git a/lib/sdk/wdmguid/wdmguid.rbuild b/lib/sdk/wdmguid/wdmguid.rbuild new file mode 100644 index 00000000000..40bf735873e --- /dev/null +++ b/lib/sdk/wdmguid/wdmguid.rbuild @@ -0,0 +1,5 @@ + + + + wdmguid.c + diff --git a/lib/smlib/smlib.rbuild b/lib/smlib/smlib.rbuild new file mode 100644 index 00000000000..733ff2f7dc4 --- /dev/null +++ b/lib/smlib/smlib.rbuild @@ -0,0 +1,11 @@ + + + + . + include/reactos/subsys + connect.c + execpgm.c + compses.c + lookupss.c + precomp.h + diff --git a/lib/tdilib/tdilib.rbuild b/lib/tdilib/tdilib.rbuild new file mode 100644 index 00000000000..ec06f02285e --- /dev/null +++ b/lib/tdilib/tdilib.rbuild @@ -0,0 +1,9 @@ + + + + . + . + ntdll + enum.c + handle.c + diff --git a/media/drivers/drivers.rbuild b/media/drivers/drivers.rbuild new file mode 100644 index 00000000000..0bc708f8066 --- /dev/null +++ b/media/drivers/drivers.rbuild @@ -0,0 +1,7 @@ + + + + + + + diff --git a/media/drivers/etc/etc.rbuild b/media/drivers/etc/etc.rbuild new file mode 100644 index 00000000000..1ed562ed2ba --- /dev/null +++ b/media/drivers/etc/etc.rbuild @@ -0,0 +1,12 @@ + + + + hosts + hosts + services + services + + KDBinit + KDBinit + + diff --git a/media/fonts/fonts.rbuild b/media/fonts/fonts.rbuild new file mode 100644 index 00000000000..59a3d36c59c --- /dev/null +++ b/media/fonts/fonts.rbuild @@ -0,0 +1,36 @@ + + + + DejaVuSans.ttf + DejaVuSans-Bold.ttf + DejaVuSans-BoldOblique.ttf + DejaVuSansMono.ttf + DejaVuSansMono-Bold.ttf + DejaVuSansMono-BoldOblique.ttf + DejaVuSansMono-Oblique.ttf + DejaVuSans-Oblique.ttf + DejaVuSerif.ttf + DejaVuSerif-Bold.ttf + DejaVuSerif-BoldItalic.ttf + DejaVuSerif-Italic.ttf + FreeMono.ttf + FreeMonoBold.ttf + FreeMonoBoldOblique.ttf + FreeMonoOblique.ttf + LiberationMono-Bold.ttf + LiberationMono-BoldItalic.ttf + LiberationMono-Italic.ttf + LiberationMono-Regular.ttf + LiberationSans-Bold.ttf + LiberationSans-BoldItalic.ttf + LiberationSans-Italic.ttf + LiberationSans-Regular.ttf + LiberationSerif-Bold.ttf + LiberationSerif-BoldItalic.ttf + LiberationSerif-Italic.ttf + LiberationSerif-Regular.ttf + Marlett.ttf + symbol.ttf + tahoma.ttf + tahomabd.ttf + diff --git a/media/inf/inf.rbuild b/media/inf/inf.rbuild new file mode 100644 index 00000000000..faf0a19d5c1 --- /dev/null +++ b/media/inf/inf.rbuild @@ -0,0 +1,35 @@ + + + + acpi.inf + audio.inf + battery.inf + bda.inf + cdrom.inf + cpu.inf + disk.inf + display.inf + fdc.inf + font.inf + hdc.inf + intl.inf + keyboard.inf + ks.inf + kscaptur.inf + layout.inf + machine.inf + msmouse.inf + NET_NIC.inf + netamd.inf + netisa.inf + netrtpnt.inf + nettcpip.inf + ports.inf + scsi.inf + syssetup.inf + unknown.inf + usb.inf + usbport.inf + usbstor.inf + xboxdisp.inf + diff --git a/media/media.rbuild b/media/media.rbuild new file mode 100644 index 00000000000..9e6a342eaac --- /dev/null +++ b/media/media.rbuild @@ -0,0 +1,22 @@ + + + + + + + + + + + + + + + + + + + + + + diff --git a/media/nls/nls.rbuild b/media/nls/nls.rbuild new file mode 100644 index 00000000000..023416f1bf6 --- /dev/null +++ b/media/nls/nls.rbuild @@ -0,0 +1,68 @@ + + + + c_437.nls + c_1252.nls + l_intl.nls + + c_037.nls + c_424.nls + c_437.nls + c_500.nls + c_737.nls + c_775.nls + c_850.nls + c_852.nls + c_855.nls + c_856.nls + c_857.nls + c_860.nls + c_861.nls + c_862.nls + c_863.nls + c_864.nls + c_865.nls + c_866.nls + c_869.nls + c_874.nls + c_875.nls + c_878.nls + c_932.nls + c_936.nls + c_949.nls + c_950.nls + c_1006.nls + c_1026.nls + c_1250.nls + c_1251.nls + c_1252.nls + c_1253.nls + c_1254.nls + c_1255.nls + c_1256.nls + c_1257.nls + c_1258.nls + c_10000.nls + c_10006.nls + c_10007.nls + c_10029.nls + c_10079.nls + c_10081.nls + c_20866.nls + c_21866.nls + c_28591.nls + c_28592.nls + c_28593.nls + c_28594.nls + c_28595.nls + c_28596.nls + c_28597.nls + c_28598.nls + c_28599.nls + c_28600.nls + c_28603.nls + c_28604.nls + c_28605.nls + c_28606.nls + l_intl.nls + diff --git a/media/sounds/sounds.rbuild b/media/sounds/sounds.rbuild new file mode 100644 index 00000000000..2896704463d --- /dev/null +++ b/media/sounds/sounds.rbuild @@ -0,0 +1,7 @@ + + + + error.mp3 + notice.mp3 + ReactOS_LogOn.wav + diff --git a/media/vgafonts/vgafonts.rbuild b/media/vgafonts/vgafonts.rbuild new file mode 100644 index 00000000000..cae138aa26f --- /dev/null +++ b/media/vgafonts/vgafonts.rbuild @@ -0,0 +1,13 @@ + + + + + 437-8x8.bin + 737-8x8.bin + 775-8x8.bin + 850-8x8.bin + 852-8x8.bin + 865-8x8.bin + 866-8x8.bin + 932-8x8.bin + diff --git a/modules/directory.rbuild b/modules/directory.rbuild new file mode 100644 index 00000000000..7c33c54cb7c --- /dev/null +++ b/modules/directory.rbuild @@ -0,0 +1,25 @@ + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/modules/empty.rbuild b/modules/empty.rbuild new file mode 100644 index 00000000000..4be0c39e2b4 --- /dev/null +++ b/modules/empty.rbuild @@ -0,0 +1,3 @@ + + + diff --git a/ntoskrnl/kdbg/i386/longjmp.S b/ntoskrnl/kdbg/i386/longjmp.S new file mode 100644 index 00000000000..99ac3b22ed8 --- /dev/null +++ b/ntoskrnl/kdbg/i386/longjmp.S @@ -0,0 +1,70 @@ + .file "longjmp.S" +/* + * Copyright (C) 1998, 1999, Jonathan S. Shapiro. + * + * This file is part of the EROS Operating System. + * + * This program is free software; you can redistribute it and/or + * modify it under the terms of the GNU General Public License + * as published by the Free Software Foundation; either version 2, + * or (at your option) any later version. + * + * This program 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 General Public License for more details. + * + * You should have received a copy of the GNU General Public License along + * with this program; if not, write to the Free Software Foundation, Inc., + * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. + */ + + /* + * typedef struct { + * unsigned long ebx, esi, edi; + * unsigned long ebp; + * unsigned long sp; + * unsigned long pc; + * } jmp_buf[1]; + */ + + /* + * On entry, the stack to longjmp looks like: + * + * value + * ptr to jmp_buf + * return PC + */ + +.globl _longjmp +_longjmp: + pushl %ebp + movl %esp,%ebp + + movl 8(%ebp),%ecx /* address of jmp_buf to ecx */ + movl 12(%ebp),%eax /* return value to %eax */ + testl %eax,%eax + jne 1f + incl %eax /* return 1 if handed 0 */ + +1: + movl (%ecx),%ebx /* restore %ebx */ + movl 4(%ecx),%esi /* restore %esi */ + movl 8(%ecx),%edi /* restore %edi */ + + /* + * From this instant on we are not running in a valid frame + */ + + movl 12(%ecx),%ebp /* restore %ebp */ + movl 16(%ecx),%esp /* restore %esp */ + /* movl 20(%ecx),%eax return PC */ + + /* + * Since we are abandoning the stack in any case, + * there isn't much point in doing the usual return + * discipline. + */ + + jmpl *20(%ecx) + diff --git a/ntoskrnl/kdbg/i386/setjmp.S b/ntoskrnl/kdbg/i386/setjmp.S new file mode 100644 index 00000000000..d407b3d2cc4 --- /dev/null +++ b/ntoskrnl/kdbg/i386/setjmp.S @@ -0,0 +1,61 @@ + .file "setjmp.S" +/* + * Copyright (C) 1998, 1999, Jonathan S. Shapiro. + * + * This file is part of the EROS Operating System. + * + * This program is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation; either version 2 of the License, or + * (at your option) any later version. + * + * This program 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 General Public License for more details. + * + * You should have received a copy of the GNU General Public License along + * with this program; if not, write to the Free Software Foundation, Inc., + * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. + */ + +/* #include */ + + + /* + * typedef struct { + * unsigned long ebx, esi, edi; + * unsigned long ebp; + * unsigned long sp; + * unsigned long pc; + * } jmp_buf[1]; + */ + + /* + * On entry, the stack to setjmp looks like: + * + * ptr to jmp_buf + * return PC + */ +.globl _setjmp +.globl __setjmp +_setjmp: +__setjmp: + pushl %ebp + movl %esp,%ebp + + movl 0x8(%ebp),%eax /* address of jmp_buf to eax */ + movl %ebx,(%eax) /* save %ebx */ + movl %esi,4(%eax) /* save %esi */ + movl %edi,8(%eax) /* save %edi */ + leal 8(%ebp),%edx /* calling proc's esp, not ours! */ + movl %edx,16(%eax) + movl 4(%ebp), %edx /* save return PC */ + movl %edx,20(%eax) + movl 0(%ebp),%edx /* calling proc's ebp, not ours! */ + movl %edx,12(%eax) + + xorl %eax,%eax /* return 0 the first time */ + leave + ret + diff --git a/ntoskrnl/kdbg/kdb_symbols.c b/ntoskrnl/kdbg/kdb_symbols.c index 4fac74c9d2a..f54f1cc14c1 100644 --- a/ntoskrnl/kdbg/kdb_symbols.c +++ b/ntoskrnl/kdbg/kdb_symbols.c @@ -29,8 +29,6 @@ IMAGE_SYMBOL_INFO_CACHE, *PIMAGE_SYMBOL_INFO_CACHE; static BOOLEAN LoadSymbols; static LIST_ENTRY SymbolFileListHead; static KSPIN_LOCK SymbolFileListLock; -static PROSSYM_INFO KdbpRosSymInfo; -static ULONG_PTR KdbpImageBase; BOOLEAN KdbpSymbolsInitialized = FALSE; /* FUNCTIONS ****************************************************************/ @@ -127,13 +125,7 @@ KdbSymPrintAddress( IN PVOID Address, IN PKTRAP_FRAME Context) { - PMEMORY_AREA MemoryArea = NULL; - HANDLE FileHandle = NULL; - PROS_SECTION_OBJECT SectionObject; PLDR_DATA_TABLE_ENTRY LdrEntry; - OBJECT_ATTRIBUTES ObjectAttributes; - IO_STATUS_BLOCK IoStatusBlock; - UNICODE_STRING ModuleFileName; ULONG_PTR RelativeAddress; NTSTATUS Status; ULONG LineNumber; @@ -153,79 +145,11 @@ KdbSymPrintAddress( { DbgPrint("<%wZ:%x (%s:%d (%s))>", &LdrEntry->BaseDllName, RelativeAddress, FileName, LineNumber, FunctionName); - return TRUE; } - else if (Address < MmSystemRangeStart) - { - MemoryArea = MmLocateMemoryAreaByAddress(&PsGetCurrentProcess()->Vm, Address); - if (!MemoryArea || MemoryArea->Type != MEMORY_AREA_SECTION_VIEW) - { - goto end; - } - SectionObject = MemoryArea->Data.SectionData.Section; - if (!(SectionObject->AllocationAttributes & SEC_IMAGE)) goto end; - if (SectionObject->ImageSection->ImageBase != KdbpImageBase) - { - if (KdbpRosSymInfo) - { - RosSymDelete(KdbpRosSymInfo); - KdbpRosSymInfo = NULL; - } - - Status = MmGetFileNameForAddress(Address, &ModuleFileName); - if (!NT_SUCCESS(Status)) - goto end; - - InitializeObjectAttributes - (&ObjectAttributes, - &ModuleFileName, - OBJ_CASE_INSENSITIVE, - NULL, - NULL); - - if (!NT_SUCCESS - (ZwOpenFile - (&FileHandle, - FILE_READ_ACCESS, - &ObjectAttributes, - &IoStatusBlock, - FILE_SHARE_READ, - FILE_SYNCHRONOUS_IO_NONALERT))) - { - goto end; - } - - if (!RosSymCreateFromFile(&FileHandle, &KdbpRosSymInfo)) - { - KdbpRosSymInfo = NULL; - } - - ZwClose(FileHandle); - KdbpImageBase = SectionObject->ImageSection->ImageBase; - } - - if (KdbpRosSymInfo) - { - RelativeAddress = (ULONG_PTR)Address - KdbpImageBase; - Status = KdbSymGetAddressInformation - (KdbpRosSymInfo, - RelativeAddress, - &LineNumber, - FileName, - FunctionName); - if (NT_SUCCESS(Status)) - { - DbgPrint - ("<%wZ:%x (%s:%d (%s))>", - &SectionObject->FileObject->FileName, - RelativeAddress, FileName, LineNumber, FunctionName); - return TRUE; - } - } - } - -end: - DbgPrint("<%wZ:%x>", &LdrEntry->BaseDllName, RelativeAddress); + else + { + DbgPrint("<%wZ:%x>", &LdrEntry->BaseDllName, RelativeAddress); + } return TRUE; } @@ -285,6 +209,8 @@ KdbpSymFindCachedFile( PLIST_ENTRY CurrentEntry; KIRQL Irql; + DPRINT("Looking for cached symbol file %wZ\n", FileName); + KeAcquireSpinLock(&SymbolFileListLock, &Irql); CurrentEntry = SymbolFileListHead.Flink; @@ -292,6 +218,7 @@ KdbpSymFindCachedFile( { Current = CONTAINING_RECORD(CurrentEntry, IMAGE_SYMBOL_INFO_CACHE, ListEntry); + DPRINT("Current->FileName %wZ FileName %wZ\n", &Current->FileName, FileName); if (RtlEqualUnicodeString(&Current->FileName, FileName, TRUE)) { Current->RefCount++; @@ -388,6 +315,7 @@ KdbpSymRemoveCachedFile( } KeReleaseSpinLock(&SymbolFileListLock, Irql); + DPRINT1("Warning: Removing unknown symbol file: RosSymInfo = %p\n", RosSymInfo); } /*! \brief Loads a symbol file. @@ -477,16 +405,29 @@ KdbSymProcessSymbols( if (LdrEntry->PatchInformation) KdbpSymRemoveCachedFile(LdrEntry->PatchInformation); - /* Error loading symbol info, try to load it from file */ - KdbpSymLoadModuleSymbols(&LdrEntry->FullDllName, + /* Load new symbol information */ + if (! RosSymCreateFromMem(LdrEntry->DllBase, + LdrEntry->SizeOfImage, + (PROSSYM_INFO*)&LdrEntry->PatchInformation)) + { + /* Error loading symbol info, try to load it from file */ + KdbpSymLoadModuleSymbols(&LdrEntry->FullDllName, (PROSSYM_INFO*)&LdrEntry->PatchInformation); - /* It already added symbols to cache */ + /* It already added symbols to cache */ + } + else + { + /* Add file to cache */ + KdbpSymAddCachedFile(&LdrEntry->FullDllName, LdrEntry->PatchInformation); + } + DPRINT("Installed symbols: %wZ@%p-%p %p\n", &LdrEntry->BaseDllName, LdrEntry->DllBase, (PVOID)(LdrEntry->SizeOfImage + (ULONG_PTR)LdrEntry->DllBase), LdrEntry->PatchInformation); + } VOID @@ -585,7 +526,7 @@ KdbInitialize( RosSymInitKernelMode(); } - else if (BootPhase == 3) + else if (BootPhase == 1) { /* Load symbols for NTOSKRNL.EXE. It is always the first module in PsLoadedModuleList. KeLoaderBlock can't be used here as its content is just temporary. */ diff --git a/ntoskrnl/ntkrnlmp.rbuild b/ntoskrnl/ntkrnlmp.rbuild new file mode 100644 index 00000000000..a0e90e7391f --- /dev/null +++ b/ntoskrnl/ntkrnlmp.rbuild @@ -0,0 +1,9 @@ + + + + + + + + + \ No newline at end of file diff --git a/ntoskrnl/ntoskrnl-generic.rbuild b/ntoskrnl/ntoskrnl-generic.rbuild new file mode 100644 index 00000000000..c380c738b72 --- /dev/null +++ b/ntoskrnl/ntoskrnl-generic.rbuild @@ -0,0 +1,590 @@ + + + + + + + + + + 0x05020400 + + + + + + + + + + . + include + + include + include/internal + include/reactos/drivers + csq + hal + pseh + cmlib + rtl + rossym + libcntpr + kdcom + bootvid + wdmguid + ioevent + cportlib + bugcodes + + ntoskrnl.h + + + + + abios.c + cpu.c + context.c + ctxswitch.S + exp.c + irqobj.c + kiinit.c + ldt.c + mtrr.c + patpge.c + thrdini.c + trap.s + traphdlr.c + usercall_asm.S + usercall.c + v86vdm.c + + + + + boot.s + cpu.c + ctxswtch.s + exp.c + kiinit.c + stubs_asm.s + thrdini.c + trap.s + trapc.c + usercall.c + + + + + main_asm.S + cpu.c + exp.c + kiinit.c + ppc_irq.c + stubs.c + systimer.c + thrdini.c + ctxswitch.c + ctxhelp.S + + + + + boot.S + context.c + cpu.c + ctxswitch.S + except.c + interrupt.c + irql.c + kiinit.c + spinlock.c + stubs.c + thrdini.c + trap.S + + + apc.c + balmgr.c + bug.c + clock.c + config.c + devqueue.c + dpc.c + eventobj.c + except.c + freeze.c + gate.c + gmutex.c + ipi.c + krnlinit.c + mutex.c + procobj.c + profobj.c + queue.c + semphobj.c + spinlock.c + time.c + thrdschd.c + thrdobj.c + timerobj.c + wait.c + + + + cacheman.c + copy.c + fs.c + mdl.c + pin.c + view.c + + + + + cachesub.c + copysup.c + fssup.c + lazyrite.c + logsup.c + mdlsup.c + pinsup.c + + data.c + fault.c + io.c + reqtools.c + sptab.c + swapout.c + + + + + + + cmhardwr.c + + + + + cmhardwr.c + + + + + cmhardwr.c + + + + + cmhardwr.c + + + cmalloc.c + cmapi.c + cmboot.c + cmcheck.c + cmcontrl.c + cmconfig.c + cmdata.c + cmdelay.c + cmindex.c + cminit.c + cmhvlist.c + cmhook.c + cmkcbncb.c + cmkeydel.c + cmlazy.c + cmmapvw.c + cmname.c + cmnotify.c + cmparse.c + cmquota.c + cmse.c + cmsecach.c + cmsysini.c + cmvalue.c + cmvalche.c + cmwraprs.c + ntapi.c + + + dbgkutil.c + dbgkobj.c + + + zw.S + + + + + interlck_asm.S + fastinterlck_asm.S + ioport.S + + + + + fastinterlck.c + + + atom.c + callback.c + dbgctrl.c + efi.c + event.c + evtpair.c + exintrin.c + fastinterlck.c + fmutex.c + handle.c + harderr.c + hdlsterm.c + init.c + keyedevt.c + locale.c + lookas.c + mutant.c + pushlock.c + profile.c + resource.c + rundown.c + sem.c + shutdown.c + sysinfo.c + time.c + timer.c + uuid.c + win32k.c + work.c + xipdisp.c + zone.c + + + dbcsname.c + fastio.c + faulttol.c + filelock.c + filter.c + filtrctx.c + fsfilter.c + fsrtlpc.c + largemcb.c + name.c + notify.c + oplock.c + pnp.c + stackovf.c + tunnel.c + unc.c + + + disksup.c + fstubex.c + halstub.c + translate.c + + + inbv.c + inbvport.c + + + + adapter.c + arcname.c + bootlog.c + controller.c + device.c + deviface.c + driver.c + error.c + file.c + iocomp.c + ioevent.c + iofunc.c + iomdl.c + iomgr.c + iorsrce.c + iotimer.c + iowork.c + irp.c + irq.c + ramdisk.c + rawfs.c + remlock.c + util.c + symlink.c + volume.c + + + plugplay.c + pnpdma.c + pnpinit.c + pnpmgr.c + pnpnotify.c + pnpreport.c + pnpres.c + pnproot.c + pnputil.c + + + + + + + kdmemsup.c + + + + + + + + + + + i386-dis.c + kdb_help.S + longjmp.S + setjmp.S + + + + + + + + + i386-dis.c + kdb_help.S + kdb.c + + + + + + kdb.c + kdb_cli.c + kdb_expr.c + kdb_keyboard.c + kdb_serial.c + + + kdb_symbols.c + + + + + bochs.c + + gdbstub.c + + + gdbstub_powerpc.c + + kdbg.c + + + + kd.c + kdmemsup.c + + + kdinit.c + kdio.c + kdmain.c + + + + + + + kdx86.c + + + + + kdx64.c + + + + + kdarm.c + + + kdapi.c + kdbreak.c + kddata.c + kdinit.c + kdlock.c + kdprint.c + kdtrap.c + + + + close.c + complete.c + connect.c + create.c + listen.c + port.c + reply.c + send.c + + + + + page.c + + + + + page.c + + + + + pfault.c + page.c + + + + + init.c + page.c + + + + + + init.c + + + + + init.c + + + contmem.c + drvmgmt.c + dynamic.c + expool.c + hypermap.c + iosup.c + largepag.c + mdlsup.c + mmdbg.c + mminit.c + mmsup.c + ncache.c + pagfault.c + pfnlist.c + pool.c + procsup.c + section.c + sysldr.c + syspte.c + vadnode.c + virtual.c + zeropage.c + + anonmem.c + balance.c + freelist.c + marea.c + mmfault.c + mminit.c + pagefile.c + pageop.c + region.c + rmap.c + section.c + + + obdir.c + obinit.c + obhandle.c + obname.c + oblife.c + obref.c + obsdcach.c + obsecure.c + oblink.c + obwait.c + + + events.c + power.c + poshtdwn.c + povolume.c + + + + + psctx.c + psldt.c + + + + + psctx.c + + + + + psctx.c + + + debug.c + job.c + kill.c + psnotify.c + process.c + psmgr.c + query.c + quota.c + security.c + state.c + thread.c + win32.c + + + + + rtlexcpt.c + + + + + stack.S + + + libsupp.c + misc.c + + + access.c + acl.c + audit.c + lsa.c + priv.c + sd.c + semgr.c + sid.c + token.c + + + + vdmmain.c + vdmexec.c + + + + wmi.c + + + driver.c + + ntoskrnl.rc + ntoskrnl_$(ARCH).lnk + diff --git a/ntoskrnl/ntoskrnl.pspec b/ntoskrnl/ntoskrnl.pspec new file mode 100644 index 00000000000..81a43664101 --- /dev/null +++ b/ntoskrnl/ntoskrnl.pspec @@ -0,0 +1,1644 @@ +#include +#undef i386 +#ifndef __x86_64__ +#define FASTCALL fastcall +#else +#define FASTCALL stdcall +#endif + +@ stdcall CcCanIWrite(ptr long long long) +@ stdcall CcCopyRead(ptr ptr long long ptr ptr) +@ stdcall CcCopyWrite(ptr ptr long long ptr) +@ stdcall CcDeferWrite(ptr ptr ptr ptr long long) +@ stdcall CcFastCopyRead(ptr long long long ptr ptr) +@ stdcall CcFastCopyWrite(ptr long long ptr) +@ extern CcFastMdlReadWait +@ extern CcFastReadNotPossible +@ extern CcFastReadWait +@ stdcall CcFlushCache(ptr ptr long ptr) +@ stdcall CcGetDirtyPages(ptr ptr ptr ptr) +@ stdcall CcGetFileObjectFromBcb(ptr) +@ stdcall CcGetFileObjectFromSectionPtrs(ptr) +@ stdcall CcGetFlushedValidData(ptr long) +@ stdcall CcGetLsnForFileObject(ptr ptr) +@ stdcall CcInitializeCacheMap(ptr ptr long ptr ptr) +@ stdcall CcIsThereDirtyData(ptr) +@ stdcall CcMapData(ptr ptr long long ptr ptr) +@ stdcall CcMdlRead(ptr ptr long ptr ptr) +@ stdcall CcMdlReadComplete(ptr ptr) +@ stdcall CcMdlWriteAbort(ptr ptr) +@ stdcall CcMdlWriteComplete(ptr ptr ptr) +@ stdcall CcPinMappedData(ptr ptr long long ptr) +@ stdcall CcPinRead(ptr ptr long long ptr ptr) +@ stdcall CcPrepareMdlWrite(ptr ptr long ptr ptr) +@ stdcall CcPreparePinWrite(ptr ptr long long long ptr ptr) +@ stdcall CcPurgeCacheSection(ptr ptr long long) +@ stdcall CcRemapBcb(ptr) +@ stdcall CcRepinBcb(ptr) +@ stdcall CcScheduleReadAhead(ptr ptr long) +@ stdcall CcSetAdditionalCacheAttributes(ptr long long) +@ stdcall CcSetBcbOwnerPointer(ptr ptr) +@ stdcall CcSetDirtyPageThreshold(ptr long) +@ stdcall CcSetDirtyPinnedData(ptr ptr) +@ stdcall CcSetFileSizes(ptr ptr) +@ stdcall CcSetLogHandleForFile(ptr ptr ptr) +@ stdcall CcSetReadAheadGranularity(ptr long) +@ stdcall CcUninitializeCacheMap(ptr ptr ptr) +@ stdcall CcUnpinData(ptr) +@ stdcall CcUnpinDataForThread(ptr ptr) +@ stdcall CcUnpinRepinnedBcb(ptr long ptr) +@ stdcall CcWaitForCurrentLazyWriterActivity() +@ stdcall CcZeroData(ptr ptr ptr long) +@ stdcall CmRegisterCallback(ptr ptr ptr) +@ stdcall CmUnRegisterCallback(long long) +@ stdcall DbgBreakPoint() +@ stdcall DbgBreakPointWithStatus(long) +@ stdcall DbgCommandString(ptr ptr) +@ stdcall DbgLoadImageSymbols(ptr ptr long) +@ cdecl DbgPrint(str) +@ cdecl DbgPrintEx(long long str) +@ cdecl DbgPrintReturnControlC(str) +@ stdcall DbgPrompt(str ptr long) +@ stdcall DbgQueryDebugFilterState(long long) +@ stdcall DbgSetDebugFilterState(long long long) +@ stdcall -arch=x86_64 ExAcquireFastMutex(ptr) +@ FASTCALL ExAcquireFastMutexUnsafe(ptr) +@ stdcall ExAcquireResourceExclusiveLite(ptr long) +@ stdcall ExAcquireResourceSharedLite(ptr long) +@ FASTCALL ExAcquireRundownProtection(ptr) ExfAcquireRundownProtection +@ FASTCALL ExAcquireRundownProtectionCacheAware(ptr) ExfAcquireRundownProtectionCacheAware +@ FASTCALL ExAcquireRundownProtectionCacheAwareEx(ptr long) ExfAcquireRundownProtectionCacheAwareEx +@ FASTCALL ExAcquireRundownProtectionEx(ptr long) ExfAcquireRundownProtectionEx +@ stdcall ExAcquireSharedStarveExclusive(ptr long) +@ stdcall ExAcquireSharedWaitForExclusive(ptr long) +@ stdcall ExAllocateCacheAwareRundownProtection(long long) +@ stdcall ExAllocateFromPagedLookasideList(ptr) ExiAllocateFromPagedLookasideList +@ stdcall ExAllocatePool(long long) +@ stdcall ExAllocatePoolWithQuota(long long) +@ stdcall ExAllocatePoolWithQuotaTag(long long long) +@ stdcall ExAllocatePoolWithTag(long long long) +@ stdcall ExAllocatePoolWithTagPriority(long long long long) +@ stdcall ExConvertExclusiveToSharedLite(ptr) +@ stdcall ExCreateCallback(ptr ptr long long) +@ stdcall ExDeleteNPagedLookasideList(ptr) +@ stdcall ExDeletePagedLookasideList(ptr) +@ stdcall ExDeleteResourceLite(ptr) +@ extern ExDesktopObjectType +@ stdcall ExDisableResourceBoostLite(ptr) +@ FASTCALL ExEnterCriticalRegionAndAcquireFastMutexUnsafe(ptr) +@ stdcall ExEnterCriticalRegionAndAcquireResourceExclusive(ptr) +@ stdcall ExEnterCriticalRegionAndAcquireResourceShared(ptr) +@ stdcall ExEnterCriticalRegionAndAcquireSharedWaitForExclusive(ptr) +@ stdcall ExEnumHandleTable(ptr ptr ptr ptr) +@ extern ExEventObjectType _ExEventObjectType +@ stdcall ExExtendZone(ptr ptr long) +@ stdcall ExFreeCacheAwareRundownProtection(ptr) +@ stdcall ExFreePool(ptr) +@ stdcall ExFreePoolWithTag(ptr long) +@ stdcall ExFreeToPagedLookasideList(ptr ptr) ExiFreeToPagedLookasideList +@ stdcall ExGetCurrentProcessorCounts(ptr ptr ptr) +@ stdcall ExGetCurrentProcessorCpuUsage(ptr) +@ stdcall ExGetExclusiveWaiterCount(ptr) +@ stdcall ExGetPreviousMode() +@ stdcall ExGetSharedWaiterCount(ptr) +@ stdcall ExInitializeNPagedLookasideList(ptr ptr ptr long long long long) +@ stdcall ExInitializePagedLookasideList(ptr ptr ptr long long long long) +@ stdcall ExInitializeResourceLite(ptr) +@ FASTCALL ExInitializeRundownProtection(ptr) ExfInitializeRundownProtection +@ stdcall ExInitializeRundownProtectionCacheAware(ptr long) +@ stdcall ExInitializeZone(ptr long ptr long) +@ stdcall ExInterlockedAddLargeInteger(ptr long long ptr) +#ifndef __x86_64__ +@ FASTCALL ExInterlockedAddLargeStatistic(ptr long) +#endif +@ stdcall ExInterlockedAddUlong(ptr long ptr) +#ifdef __x86__ +@ FASTCALL ExInterlockedCompareExchange64(ptr ptr ptr ptr) +@ stdcall ExInterlockedDecrementLong(ptr ptr) +@ stdcall ExInterlockedExchangeUlong(ptr long ptr) +#endif +@ stdcall ExInterlockedExtendZone(ptr ptr long ptr) +#ifndef __x86_64__ +@ FASTCALL ExInterlockedFlushSList(ptr) +@ stdcall ExInterlockedIncrementLong(ptr ptr) +#endif +@ stdcall ExInterlockedInsertHeadList(ptr ptr ptr) +@ stdcall ExInterlockedInsertTailList(ptr ptr ptr) +@ stdcall ExInterlockedPopEntryList(ptr ptr) +#ifndef __x86_64__ +@ FASTCALL ExInterlockedPopEntrySList(ptr ptr) +#endif +@ stdcall ExInterlockedPushEntryList(ptr ptr ptr) +#ifndef __x86_64__ +@ FASTCALL ExInterlockedPushEntrySList(ptr ptr ptr) +#endif +@ stdcall ExInterlockedRemoveHeadList(ptr ptr) +@ stdcall ExIsProcessorFeaturePresent(long) +@ stdcall ExIsResourceAcquiredExclusiveLite(ptr) +@ stdcall ExIsResourceAcquiredSharedLite(ptr) +@ stdcall ExLocalTimeToSystemTime(ptr ptr) +@ stdcall ExNotifyCallback(ptr ptr ptr) +@ stdcall -arch=x86_64 ExQueryDepthSList(ptr) +@ stdcall ExQueryPoolBlockSize(ptr ptr) +@ stdcall ExQueueWorkItem(ptr long) +@ stdcall ExRaiseAccessViolation() +@ stdcall ExRaiseDatatypeMisalignment() +@ stdcall ExRaiseException(ptr) RtlRaiseException +@ stdcall ExRaiseHardError(long long long ptr long ptr) +@ stdcall ExRaiseStatus(long) RtlRaiseStatus +@ FASTCALL ExReInitializeRundownProtection(ptr) ExfReInitializeRundownProtection +@ FASTCALL ExReInitializeRundownProtectionCacheAware(ptr) ExfReInitializeRundownProtectionCacheAware +@ stdcall ExRegisterCallback(ptr ptr ptr) +@ stdcall ExReinitializeResourceLite(ptr) +@ stdcall -arch=x86_64 ExReleaseFastMutex(ptr) +@ FASTCALL ExReleaseFastMutexUnsafe(ptr) +@ FASTCALL ExReleaseFastMutexUnsafeAndLeaveCriticalRegion(ptr) +@ FASTCALL ExReleaseResourceAndLeaveCriticalRegion(ptr) +@ stdcall ExReleaseResourceForThreadLite(ptr long) +@ FASTCALL ExReleaseResourceLite(ptr) +@ FASTCALL ExReleaseRundownProtection(ptr) ExfReleaseRundownProtection +@ FASTCALL ExReleaseRundownProtectionCacheAware(ptr) ExfReleaseRundownProtectionCacheAware +@ FASTCALL ExReleaseRundownProtectionCacheAwareEx(ptr long) ExfReleaseRundownProtectionCacheAwareEx +@ FASTCALL ExReleaseRundownProtectionEx(ptr long) ExfReleaseRundownProtectionEx +@ FASTCALL ExRundownCompleted(ptr) ExfRundownCompleted +@ FASTCALL ExRundownCompletedCacheAware(ptr) ExfRundownCompletedCacheAware +@ extern ExSemaphoreObjectType _ExSemaphoreObjectType +@ stdcall ExSetResourceOwnerPointer(ptr ptr) +@ stdcall ExSetTimerResolution(long long) +@ stdcall ExSizeOfRundownProtectionCacheAware() +@ stdcall ExSystemExceptionFilter() +@ stdcall ExSystemTimeToLocalTime(ptr ptr) +@ stdcall -arch=x86_64 ExTryToAcquireFastMutex(ptr) +@ stdcall ExUnregisterCallback(ptr) +@ stdcall ExUuidCreate(ptr) +@ stdcall ExVerifySuite(long) +@ FASTCALL ExWaitForRundownProtectionRelease(ptr) ExfWaitForRundownProtectionRelease +@ FASTCALL ExWaitForRundownProtectionReleaseCacheAware(ptr) ExfWaitForRundownProtectionReleaseCacheAware +@ extern ExWindowStationObjectType +@ FASTCALL ExfAcquirePushLockExclusive(ptr) +@ FASTCALL ExfAcquirePushLockShared(ptr) +#ifndef __x86_64__ +@ FASTCALL ExfInterlockedAddUlong(ptr long ptr) +@ FASTCALL ExfInterlockedCompareExchange64(ptr ptr ptr) +@ FASTCALL ExfInterlockedInsertHeadList(ptr ptr ptr) +@ FASTCALL ExfInterlockedInsertTailList(ptr ptr ptr) +@ FASTCALL ExfInterlockedPopEntryList(ptr ptr) +@ FASTCALL ExfInterlockedPushEntryList(ptr ptr ptr) +@ FASTCALL ExfInterlockedRemoveHeadList(ptr ptr) +#endif +@ FASTCALL ExfReleasePushLock(ptr) +@ FASTCALL ExfReleasePushLockExclusive(ptr) +@ FASTCALL ExfReleasePushLockShared(ptr) +@ FASTCALL ExfTryToWakePushLock(ptr) +@ FASTCALL ExfUnblockPushLock(ptr ptr) +@ stdcall -arch=x86_64 ExpInterlockedFlushSList(ptr) +@ stdcall -arch=x86_64 ExpInterlockedPopEntrySList(ptr ptr) +@ stdcall -arch=x86_64 ExpInterlockedPushEntrySList(ptr ptr) +@ FASTCALL -arch=i386 Exfi386InterlockedDecrementLong(ptr) +@ FASTCALL -arch=i386 Exfi386InterlockedExchangeUlong(ptr long) +@ FASTCALL -arch=i386 Exfi386InterlockedIncrementLong(ptr) +@ stdcall -arch=i386 Exi386InterlockedDecrementLong(ptr) +@ stdcall -arch=i386 Exi386InterlockedExchangeUlong(ptr long long) +@ stdcall -arch=i386 Exi386InterlockedIncrementLong(ptr) +@ FASTCALL -arch=i386 ExiAcquireFastMutex(ptr) ExAcquireFastMutex +@ FASTCALL -arch=i386 ExiReleaseFastMutex(ptr) ExReleaseFastMutex +@ FASTCALL -arch=i386 ExiTryToAcquireFastMutex(ptr) ExTryToAcquireFastMutex +@ stdcall FsRtlAcquireFileExclusive(ptr) +;FsRtlAddBaseMcbEntry +@ stdcall FsRtlAddLargeMcbEntry(ptr long long long long long long) +@ stdcall FsRtlAddMcbEntry(ptr long long long) +@ stdcall FsRtlAddToTunnelCache(ptr long long ptr ptr long long ptr) +@ stdcall FsRtlAllocateFileLock(ptr ptr) +@ stdcall FsRtlAllocatePool(long long) +@ stdcall FsRtlAllocatePoolWithQuota(long long) +@ stdcall FsRtlAllocatePoolWithQuotaTag(long long long) +@ stdcall FsRtlAllocatePoolWithTag(long long long) +@ stdcall FsRtlAllocateResource() +@ stdcall FsRtlAreNamesEqual(ptr ptr long wstr) +@ stdcall FsRtlBalanceReads(ptr) +@ stdcall FsRtlCheckLockForReadAccess(ptr ptr) +@ stdcall FsRtlCheckLockForWriteAccess(ptr ptr) +@ stdcall FsRtlCheckOplock(ptr ptr ptr ptr ptr) +@ stdcall FsRtlCopyRead(ptr ptr long long long ptr ptr ptr) +@ stdcall FsRtlCopyWrite(ptr ptr long long long ptr ptr ptr) +@ stdcall FsRtlCreateSectionForDataScan(ptr ptr ptr ptr long ptr ptr long long long) +@ stdcall FsRtlCurrentBatchOplock(ptr) +@ stdcall FsRtlDeleteKeyFromTunnelCache(ptr long long) +@ stdcall FsRtlDeleteTunnelCache(ptr) +@ stdcall FsRtlDeregisterUncProvider(ptr) +@ stdcall FsRtlDissectDbcs(long ptr ptr ptr) +@ stdcall FsRtlDissectName(long ptr ptr ptr) +@ stdcall FsRtlDoesDbcsContainWildCards(ptr) +@ stdcall FsRtlDoesNameContainWildCards(ptr) +@ stdcall FsRtlFastCheckLockForRead(ptr ptr ptr long ptr ptr) +@ stdcall FsRtlFastCheckLockForWrite(ptr ptr ptr long ptr ptr) +@ stdcall FsRtlFastUnlockAll(ptr ptr ptr ptr) +@ stdcall FsRtlFastUnlockAllByKey(ptr ptr ptr long ptr) +@ stdcall FsRtlFastUnlockSingle(ptr ptr ptr ptr ptr long ptr long) +@ stdcall FsRtlFindInTunnelCache(ptr long long ptr ptr ptr ptr ptr) +@ stdcall FsRtlFreeFileLock(ptr) +@ stdcall FsRtlGetFileSize(ptr ptr) +;FsRtlGetNextBaseMcbEntry +@ stdcall FsRtlGetNextFileLock(ptr long) +@ stdcall FsRtlGetNextLargeMcbEntry(ptr long ptr ptr ptr) +@ stdcall FsRtlGetNextMcbEntry(ptr long ptr ptr ptr) +@ stdcall FsRtlIncrementCcFastReadNoWait() +@ stdcall FsRtlIncrementCcFastReadNotPossible() +@ stdcall FsRtlIncrementCcFastReadResourceMiss() +@ stdcall FsRtlIncrementCcFastReadWait() +;FsRtlInitializeBaseMcb +@ stdcall FsRtlInitializeFileLock(ptr ptr ptr) +@ stdcall FsRtlInitializeLargeMcb(ptr long) +@ stdcall FsRtlInitializeMcb(ptr long) +@ stdcall FsRtlInitializeOplock(ptr) +@ stdcall FsRtlInitializeTunnelCache(ptr) +@ stdcall FsRtlInsertPerFileObjectContext(ptr ptr) +@ stdcall FsRtlInsertPerStreamContext(ptr ptr) +@ stdcall FsRtlIsDbcsInExpression(ptr ptr) +@ stdcall FsRtlIsFatDbcsLegal(long ptr long long long) +@ stdcall FsRtlIsHpfsDbcsLegal(long ptr long long long) +@ stdcall FsRtlIsNameInExpression(ptr ptr long wstr) +@ stdcall FsRtlIsNtstatusExpected(long) +@ stdcall FsRtlIsPagingFile(ptr) +@ stdcall FsRtlIsTotalDeviceFailure(ptr) +@ extern FsRtlLegalAnsiCharacterArray _FsRtlLegalAnsiCharacterArray +;FsRtlLookupBaseMcbEntry +@ stdcall FsRtlLookupLargeMcbEntry(ptr long long ptr ptr ptr ptr ptr) +;FsRtlLookupLastBaseMcbEntry +;FsRtlLookupLastBaseMcbEntryAndIndex +@ stdcall FsRtlLookupLastLargeMcbEntry(ptr ptr ptr) +@ stdcall FsRtlLookupLastLargeMcbEntryAndIndex(ptr ptr ptr ptr) +@ stdcall FsRtlLookupLastMcbEntry(ptr ptr ptr) +@ stdcall FsRtlLookupMcbEntry(ptr long ptr ptr ptr) +@ stdcall FsRtlLookupPerFileObjectContext(ptr ptr ptr) +@ stdcall FsRtlLookupPerStreamContextInternal(ptr ptr ptr) +@ stdcall FsRtlMdlRead(ptr ptr long long ptr ptr) +@ stdcall FsRtlMdlReadComplete(ptr ptr) +@ stdcall FsRtlMdlReadCompleteDev(ptr ptr ptr) +@ stdcall FsRtlMdlReadDev(ptr ptr long long ptr ptr ptr) +@ stdcall FsRtlMdlWriteComplete(ptr ptr ptr) +@ stdcall FsRtlMdlWriteCompleteDev(ptr ptr ptr ptr) +@ stdcall FsRtlNormalizeNtstatus(long long) +@ stdcall FsRtlNotifyChangeDirectory(ptr ptr ptr ptr long long ptr) +@ stdcall FsRtlNotifyCleanup(ptr ptr ptr) +@ stdcall FsRtlNotifyFilterChangeDirectory(ptr ptr ptr ptr long long long ptr ptr ptr ptr) +@ stdcall FsRtlNotifyFilterReportChange(ptr ptr ptr long ptr ptr long long ptr ptr) +@ stdcall FsRtlNotifyFullChangeDirectory(ptr ptr ptr ptr long long long ptr ptr ptr) +@ stdcall FsRtlNotifyFullReportChange(ptr ptr ptr long ptr ptr long long ptr) +@ stdcall FsRtlNotifyInitializeSync(ptr) +@ stdcall FsRtlNotifyReportChange(ptr ptr ptr ptr long) +@ stdcall FsRtlNotifyUninitializeSync(ptr) +@ stdcall FsRtlNotifyVolumeEvent(ptr long) +;FsRtlNumberOfRunsInBaseMcb +@ stdcall FsRtlNumberOfRunsInLargeMcb(ptr) +@ stdcall FsRtlNumberOfRunsInMcb(ptr) +@ stdcall FsRtlOplockFsctrl(ptr ptr long) +@ stdcall FsRtlOplockIsFastIoPossible(ptr) +@ stdcall FsRtlPostPagingFileStackOverflow(ptr ptr ptr) +@ stdcall FsRtlPostStackOverflow(ptr ptr ptr) +@ stdcall FsRtlPrepareMdlWrite(ptr ptr long long ptr ptr) +@ stdcall FsRtlPrepareMdlWriteDev(ptr ptr long long ptr ptr ptr) +@ stdcall FsRtlPrivateLock(ptr ptr ptr ptr ptr long long long ptr ptr ptr long) +@ stdcall FsRtlProcessFileLock(ptr ptr ptr) +@ stdcall FsRtlRegisterFileSystemFilterCallbacks(ptr ptr) +@ stdcall FsRtlRegisterUncProvider(ptr ptr long) +@ stdcall FsRtlReleaseFile(ptr) +;FsRtlRemoveBaseMcbEntry +@ stdcall FsRtlRemoveLargeMcbEntry(ptr long long long long) +@ stdcall FsRtlRemoveMcbEntry(ptr long long) +@ stdcall FsRtlRemovePerFileObjectContext(ptr ptr ptr) +@ stdcall FsRtlRemovePerStreamContext(ptr ptr ptr) +;FsRtlResetBaseMcb +@ stdcall FsRtlResetLargeMcb(ptr long) +;FsRtlSplitBaseMcb +@ stdcall FsRtlSplitLargeMcb(ptr long long long long) +@ stdcall FsRtlSyncVolumes(long long long) +@ stdcall FsRtlTeardownPerStreamContexts(ptr) +;FsRtlTruncateBaseMcb +@ stdcall FsRtlTruncateLargeMcb(ptr long long) +@ stdcall FsRtlTruncateMcb(ptr long) +;FsRtlUninitializeBaseMcb +@ stdcall FsRtlUninitializeFileLock(ptr) +@ stdcall FsRtlUninitializeLargeMcb(ptr) +@ stdcall FsRtlUninitializeMcb(ptr) +@ stdcall FsRtlUninitializeOplock(ptr) +@ extern HalDispatchTable _HalDispatchTable +@ FASTCALL HalExamineMBR(ptr long long ptr) +@ extern HalPrivateDispatchTable +@ stdcall HeadlessDispatch(long ptr long ptr ptr) +@ stdcall InbvAcquireDisplayOwnership() +@ stdcall InbvCheckDisplayOwnership() +@ stdcall InbvDisplayString(str) +@ stdcall InbvEnableBootDriver(long) +@ stdcall InbvEnableDisplayString(long) +@ stdcall InbvInstallDisplayStringFilter(ptr) +@ stdcall InbvIsBootDriverInstalled() +@ stdcall InbvNotifyDisplayOwnershipLost(ptr) +@ stdcall InbvResetDisplay() +@ stdcall InbvSetScrollRegion(long long long long) +@ stdcall InbvSetTextColor(long) +@ stdcall InbvSolidColorFill(long long long long long) +@ extern InitSafeBootMode +#ifndef __x86_64__ +@ FASTCALL InterlockedCompareExchange(ptr long long) +@ FASTCALL InterlockedDecrement(ptr) +@ FASTCALL InterlockedExchange(ptr long) +@ FASTCALL InterlockedExchangeAdd(ptr long) +@ FASTCALL InterlockedIncrement(ptr) +@ FASTCALL InterlockedPopEntrySList(ptr) +@ FASTCALL InterlockedPushEntrySList(ptr ptr) +#else +@ stdcall InitializeSListHead(ptr) RtlInitializeSListHead +#endif +@ stdcall IoAcquireCancelSpinLock(ptr) +@ stdcall IoAcquireRemoveLockEx(ptr ptr str long long) +@ stdcall IoAcquireVpbSpinLock(ptr) +@ extern IoAdapterObjectType +@ stdcall IoAllocateAdapterChannel(ptr ptr long ptr ptr) +@ stdcall IoAllocateController(ptr ptr ptr ptr) +@ stdcall IoAllocateDriverObjectExtension(ptr ptr long ptr) +@ stdcall IoAllocateErrorLogEntry(ptr long) +@ stdcall IoAllocateIrp(long long) +@ stdcall IoAllocateMdl(ptr long long long ptr) +@ stdcall IoAllocateWorkItem(ptr) +@ FASTCALL IoAssignDriveLetters(ptr ptr ptr ptr) +@ stdcall IoAssignResources(ptr ptr ptr ptr ptr ptr) +@ stdcall IoAttachDevice(ptr ptr ptr) +@ stdcall IoAttachDeviceByPointer(ptr ptr) +@ stdcall IoAttachDeviceToDeviceStack(ptr ptr) +@ stdcall IoAttachDeviceToDeviceStackSafe(ptr ptr ptr) +@ stdcall IoBuildAsynchronousFsdRequest(long ptr ptr long ptr ptr) +@ stdcall IoBuildDeviceIoControlRequest(long ptr ptr long ptr long long ptr ptr) +@ stdcall IoBuildPartialMdl(ptr ptr ptr long) +@ stdcall IoBuildSynchronousFsdRequest(long ptr ptr long ptr ptr ptr) +@ stdcall IoCallDriver(ptr ptr) +@ stdcall IoCancelFileOpen(ptr ptr) +@ stdcall IoCancelIrp(ptr) +@ stdcall IoCheckDesiredAccess(ptr long) +@ stdcall IoCheckEaBufferValidity(ptr long ptr) +@ stdcall IoCheckFunctionAccess(long long long long ptr ptr) +@ stdcall IoCheckQuerySetFileInformation(long long long) +@ stdcall IoCheckQuerySetVolumeInformation(long long long) +@ stdcall IoCheckQuotaBufferValidity(ptr long ptr) +@ stdcall IoCheckShareAccess(long long ptr ptr long) +@ stdcall IoCompleteRequest(ptr long) +@ stdcall IoConnectInterrupt(ptr ptr ptr ptr long long long long long long long) +@ stdcall IoCreateController(long) +@ stdcall IoCreateDevice(ptr long ptr long long long ptr) +@ stdcall IoCreateDisk(ptr ptr) +@ stdcall IoCreateDriver(ptr ptr) +@ stdcall IoCreateFile(ptr long ptr ptr ptr long long long long ptr long long ptr long) +@ stdcall IoCreateFileSpecifyDeviceObjectHint(ptr long ptr ptr ptr long long long long ptr long long ptr long ptr) +@ stdcall IoCreateNotificationEvent(ptr ptr) +@ stdcall IoCreateStreamFileObject(ptr ptr) +@ stdcall IoCreateStreamFileObjectEx(ptr ptr ptr) +@ stdcall IoCreateStreamFileObjectLite(ptr ptr) +@ stdcall IoCreateSymbolicLink(ptr ptr) +@ stdcall IoCreateSynchronizationEvent(ptr ptr) +@ stdcall IoCreateUnprotectedSymbolicLink(ptr ptr) +@ stdcall IoCsqInitialize(ptr ptr ptr ptr ptr ptr ptr) +@ stdcall IoCsqInitializeEx(ptr ptr ptr ptr ptr ptr ptr) +@ stdcall IoCsqInsertIrp(ptr ptr ptr) +@ stdcall IoCsqInsertIrpEx(ptr ptr ptr ptr) +@ stdcall IoCsqRemoveIrp(ptr ptr) +@ stdcall IoCsqRemoveNextIrp(ptr ptr) +@ stdcall IoDeleteController(ptr) +@ stdcall IoDeleteDevice(ptr) +@ stdcall IoDeleteDriver(ptr) +@ stdcall IoDeleteSymbolicLink(ptr) +@ stdcall IoDetachDevice(ptr) +@ extern IoDeviceHandlerObjectSize +@ extern IoDeviceHandlerObjectType +@ extern IoDeviceObjectType +@ stdcall IoDisconnectInterrupt(ptr) +@ extern IoDriverObjectType +@ stdcall IoEnqueueIrp(ptr) +@ stdcall IoEnumerateDeviceObjectList(ptr ptr long ptr) +@ stdcall IoEnumerateRegisteredFiltersList(ptr long ptr) +@ stdcall IoFastQueryNetworkAttributes(ptr long long ptr ptr) +@ extern IoFileObjectType _IoFileObjectType +@ stdcall IoForwardAndCatchIrp(ptr ptr) IoForwardIrpSynchronously +@ stdcall IoForwardIrpSynchronously(ptr ptr) +@ stdcall IoFreeController(ptr) +@ stdcall IoFreeErrorLogEntry(ptr) +@ stdcall IoFreeIrp(ptr) +@ stdcall IoFreeMdl(ptr) +@ stdcall IoFreeWorkItem(ptr) +@ stdcall IoGetAttachedDevice(ptr) +@ stdcall IoGetAttachedDeviceReference(ptr) +@ stdcall IoGetBaseFileSystemDeviceObject(ptr) +@ stdcall IoGetBootDiskInformation(ptr long) +@ stdcall IoGetConfigurationInformation() +@ stdcall IoGetCurrentProcess() +@ stdcall IoGetDeviceAttachmentBaseRef(ptr) +@ stdcall IoGetDeviceInterfaceAlias(ptr ptr ptr) +@ stdcall IoGetDeviceInterfaces(ptr ptr long ptr) +@ stdcall IoGetDeviceObjectPointer(ptr long ptr ptr) +@ stdcall IoGetDeviceProperty(ptr long long ptr ptr) +@ stdcall IoGetDeviceToVerify(ptr) +@ stdcall IoGetDiskDeviceObject(ptr ptr) +@ stdcall IoGetDmaAdapter(ptr ptr ptr) +@ stdcall IoGetDriverObjectExtension(ptr ptr) +@ stdcall IoGetFileObjectGenericMapping() +@ stdcall IoGetInitialStack() +@ stdcall IoGetLowerDeviceObject(ptr) +@ FASTCALL IoGetPagingIoPriority(ptr) +@ stdcall IoGetRelatedDeviceObject(ptr) +@ stdcall IoGetRequestorProcess(ptr) +@ stdcall IoGetRequestorProcessId(ptr) +@ stdcall IoGetRequestorSessionId(ptr ptr) +@ stdcall IoGetStackLimits(ptr ptr) +@ stdcall IoGetTopLevelIrp() +@ stdcall IoInitializeIrp(ptr long long) +@ stdcall IoInitializeRemoveLockEx(ptr long long long long) +@ stdcall IoInitializeTimer(ptr ptr ptr) +@ stdcall IoInvalidateDeviceRelations(ptr long) +@ stdcall IoInvalidateDeviceState(ptr) +@ stdcall -arch=x86_64 IoIs32bitProcess(ptr) +@ stdcall IoIsFileOriginRemote(ptr) +@ stdcall IoIsOperationSynchronous(ptr) +@ stdcall IoIsSystemThread(ptr) +@ stdcall IoIsValidNameGraftingBuffer(ptr ptr) +@ stdcall IoIsWdmVersionAvailable(long long) +@ stdcall IoMakeAssociatedIrp(ptr long) +@ stdcall IoOpenDeviceInterfaceRegistryKey(ptr long ptr) +@ stdcall IoOpenDeviceRegistryKey(ptr long long ptr) +@ stdcall IoPageRead(ptr ptr ptr ptr ptr) +@ stdcall IoPnPDeliverServicePowerNotification(long long long long) +@ stdcall IoQueryDeviceDescription(ptr ptr ptr ptr ptr ptr ptr ptr) +@ stdcall IoQueryFileDosDeviceName(ptr ptr) +@ stdcall IoQueryFileInformation(ptr long long ptr ptr) +@ stdcall IoQueryVolumeInformation(ptr long long ptr ptr) +@ stdcall IoQueueThreadIrp(ptr) +@ stdcall IoQueueWorkItem(ptr ptr long ptr) +@ stdcall IoRaiseHardError(ptr ptr ptr) +@ stdcall IoRaiseInformationalHardError(long ptr ptr) +@ stdcall IoReadDiskSignature(ptr long ptr) +@ extern IoReadOperationCount +@ FASTCALL IoReadPartitionTable(ptr long long ptr) +@ stdcall IoReadPartitionTableEx(ptr ptr) +@ extern IoReadTransferCount +@ stdcall IoRegisterBootDriverReinitialization(ptr ptr ptr) +@ stdcall IoRegisterDeviceInterface(ptr ptr ptr ptr) +@ stdcall IoRegisterDriverReinitialization(ptr ptr ptr) +@ stdcall IoRegisterFileSystem(ptr) +@ stdcall IoRegisterFsRegistrationChange(ptr ptr) +@ stdcall IoRegisterLastChanceShutdownNotification(ptr) +@ stdcall IoRegisterPlugPlayNotification(long long ptr ptr ptr ptr ptr) +@ stdcall IoRegisterShutdownNotification(ptr) +@ stdcall IoReleaseCancelSpinLock(long) +@ stdcall IoReleaseRemoveLockAndWaitEx(ptr ptr long) +@ stdcall IoReleaseRemoveLockEx(ptr ptr long) +@ stdcall IoReleaseVpbSpinLock(long) +@ stdcall IoRemoveShareAccess(ptr ptr) +@ stdcall IoReportDetectedDevice(ptr long long long ptr ptr long ptr) +@ stdcall IoReportHalResourceUsage(ptr ptr ptr long) +@ stdcall IoReportResourceForDetection(ptr ptr long ptr ptr long ptr) +@ stdcall IoReportResourceUsage(ptr ptr ptr long ptr ptr long long ptr) +@ stdcall IoReportTargetDeviceChange(ptr ptr) +@ stdcall IoReportTargetDeviceChangeAsynchronous(ptr ptr ptr ptr) +@ stdcall IoRequestDeviceEject(ptr) +@ stdcall IoReuseIrp(ptr long) +@ stdcall IoSetCompletionRoutineEx(ptr ptr ptr ptr long long long) +@ stdcall IoSetDeviceInterfaceState(ptr long) +@ stdcall IoSetDeviceToVerify(ptr ptr) +@ stdcall IoSetFileOrigin(ptr long) +@ stdcall IoSetHardErrorOrVerifyDevice(ptr ptr) +@ stdcall IoSetInformation(ptr ptr long ptr) +@ stdcall IoSetIoCompletion(ptr ptr ptr long ptr long) +@ FASTCALL IoSetPartitionInformation(ptr long long long) +@ stdcall IoSetPartitionInformationEx(ptr long ptr) +@ stdcall IoSetShareAccess(long long ptr ptr) +@ stdcall IoSetStartIoAttributes(ptr long long) +@ stdcall IoSetSystemPartition(ptr) +@ stdcall IoSetThreadHardErrorMode(long) +@ stdcall IoSetTopLevelIrp(ptr) +@ stdcall IoStartNextPacket(ptr long) +@ stdcall IoStartNextPacketByKey(ptr long long) +@ stdcall IoStartPacket(ptr ptr ptr ptr) +@ stdcall IoStartTimer(ptr) +@ extern IoStatisticsLock +@ stdcall IoStopTimer(ptr) +@ stdcall IoSynchronousInvalidateDeviceRelations(ptr long) +@ stdcall IoSynchronousPageWrite(ptr ptr ptr ptr ptr) +@ stdcall IoThreadToProcess(ptr) +@ stdcall IoTranslateBusAddress(long long long long ptr ptr) +@ stdcall IoUnregisterFileSystem(ptr) +@ stdcall IoUnregisterFsRegistrationChange(ptr ptr) +@ stdcall IoUnregisterPlugPlayNotification(ptr) +@ stdcall IoUnregisterShutdownNotification(ptr) +@ stdcall IoUpdateShareAccess(ptr ptr) +@ stdcall IoValidateDeviceIoControlAccess(ptr long) +@ stdcall IoVerifyPartitionTable(ptr long) +@ stdcall IoVerifyVolume(ptr long) +@ stdcall IoVolumeDeviceToDosName(ptr ptr) +@ stdcall IoWMIAllocateInstanceIds(ptr long ptr) +@ stdcall IoWMIDeviceObjectToInstanceName(ptr ptr ptr) +@ stdcall -arch=x86_64 IoWMIDeviceObjectToProviderId(ptr) +@ stdcall IoWMIExecuteMethod(ptr ptr long long ptr ptr) +@ stdcall IoWMIHandleToInstanceName(ptr ptr ptr) +@ stdcall IoWMIOpenBlock(ptr long ptr) +@ stdcall IoWMIQueryAllData(ptr ptr ptr) +@ stdcall IoWMIQueryAllDataMultiple(ptr long ptr ptr) +@ stdcall IoWMIQuerySingleInstance(ptr ptr ptr ptr) +@ stdcall IoWMIQuerySingleInstanceMultiple(ptr ptr long ptr ptr) +@ stdcall IoWMIRegistrationControl(ptr long) +@ stdcall IoWMISetNotificationCallback(ptr ptr ptr) +@ stdcall IoWMISetSingleInstance(ptr ptr long long ptr) +@ stdcall IoWMISetSingleItem(ptr ptr long long long ptr) +@ stdcall IoWMISuggestInstanceName(ptr ptr long ptr) +@ stdcall IoWMIWriteEvent(ptr) +@ stdcall IoWriteErrorLogEntry(ptr) +@ extern IoWriteOperationCount +@ FASTCALL IoWritePartitionTable(ptr long long long ptr) +@ stdcall IoWritePartitionTableEx(ptr ptr) +@ extern IoWriteTransferCount +@ FASTCALL IofCallDriver(ptr ptr) +@ FASTCALL IofCompleteRequest(ptr long) +@ stdcall KdChangeOption(long long ptr long ptr ptr) +@ extern KdDebuggerEnabled _KdDebuggerEnabled +@ extern KdDebuggerNotPresent _KdDebuggerNotPresent +@ stdcall KdDisableDebugger() +@ stdcall KdEnableDebugger() +@ extern KdEnteredDebugger +@ stdcall KdPollBreakIn() +@ stdcall KdPowerTransition(long) +@ stdcall KdRefreshDebuggerNotPresent() +@ stdcall KdSystemDebugControl(long ptr long ptr long ptr long) +@ stdcall -arch=i386 Ke386CallBios(long ptr) +@ stdcall -arch=i386 Ke386IoSetAccessProcess(ptr long) +@ stdcall -arch=i386 Ke386QueryIoAccessMap(long ptr) +@ stdcall -arch=i386 Ke386SetIoAccessMap(long ptr) +@ FASTCALL KeAcquireGuardedMutex(ptr) +@ FASTCALL KeAcquireGuardedMutexUnsafe(ptr) +@ FASTCALL KeAcquireInStackQueuedSpinLockAtDpcLevel(ptr ptr) +@ FASTCALL KeAcquireInStackQueuedSpinLockForDpc(ptr ptr) +@ stdcall KeAcquireInterruptSpinLock(ptr) +@ stdcall KeAcquireSpinLockAtDpcLevel(ptr) +@ FASTCALL KeAcquireSpinLockForDpc(ptr) +@ stdcall -arch=x86_64 KeAcquireSpinLockRaiseToDpc(ptr) +@ stdcall KeAddSystemServiceTable(ptr ptr long ptr long) +@ stdcall KeAreAllApcsDisabled() +@ stdcall KeAreApcsDisabled() +@ stdcall KeAttachProcess(ptr) +@ stdcall KeBugCheck(long) +@ stdcall KeBugCheckEx(long ptr ptr ptr ptr) +@ stdcall KeCancelTimer(ptr) +@ stdcall KeCapturePersistentThreadState(ptr long long long long long ptr) +@ stdcall KeClearEvent(ptr) +@ stdcall KeConnectInterrupt(ptr) +@ stdcall KeDelayExecutionThread(long long ptr) +@ stdcall KeDeregisterBugCheckCallback(ptr) +@ stdcall KeDeregisterBugCheckReasonCallback(ptr) +@ stdcall KeDeregisterNmiCallback(ptr) +@ stdcall KeDetachProcess() +@ stdcall KeDisconnectInterrupt(ptr) +@ stdcall KeEnterCriticalRegion() _KeEnterCriticalRegion +@ stdcall KeEnterGuardedRegion() _KeEnterGuardedRegion +@ stdcall KeEnterKernelDebugger() +@ stdcall KeFindConfigurationEntry(ptr long long ptr) +@ stdcall KeFindConfigurationNextEntry(ptr long long ptr ptr) +@ stdcall KeFlushEntireTb(long long) +@ stdcall KeFlushQueuedDpcs() +;KeGenericCallDpc +@ stdcall KeGetCurrentThread() +@ stdcall KeGetPreviousMode() +@ stdcall KeGetRecommendedSharedDataAlignment() +;KeI386AbiosCall +@ stdcall -arch=i386 KeI386AllocateGdtSelectors(ptr long) +; -arch=i386 KeI386Call16BitCStyleFunction +; -arch=i386 KeI386Call16BitFunction +@ stdcall -arch=i386 KeI386FlatToGdtSelector(long long long) +; -arch=i386 KeI386GetLid +@ extern -arch=i386 KeI386MachineType +@ stdcall -arch=i386 KeI386ReleaseGdtSelectors(ptr long) +; -arch=i386 KeI386ReleaseLid +; -arch=i386 KeI386SetGdtSelector +@ stdcall KeInitializeApc(ptr ptr long ptr ptr ptr long ptr) +@ stdcall KeInitializeCrashDumpHeader(long long ptr long ptr) +@ stdcall KeInitializeDeviceQueue(ptr) +@ stdcall KeInitializeDpc(ptr ptr ptr) +@ stdcall KeInitializeEvent(ptr long long) +@ FASTCALL KeInitializeGuardedMutex(ptr) +@ stdcall KeInitializeInterrupt(ptr ptr ptr ptr long long long long long long long) +@ stdcall KeInitializeMutant(ptr long) +@ stdcall KeInitializeMutex(ptr long) +@ stdcall KeInitializeQueue(ptr long) +@ stdcall KeInitializeSemaphore(ptr long long) +#ifndef __x86_64__ +@ stdcall KeInitializeSpinLock(ptr) _KeInitializeSpinLock +#endif +@ stdcall KeInitializeThreadedDpc(ptr ptr ptr) +@ stdcall KeInitializeTimer(ptr) +@ stdcall KeInitializeTimerEx(ptr long) +@ stdcall KeInsertByKeyDeviceQueue(ptr ptr long) +@ stdcall KeInsertDeviceQueue(ptr ptr) +@ stdcall KeInsertHeadQueue(ptr ptr) +@ stdcall KeInsertQueue(ptr ptr) +@ stdcall KeInsertQueueApc(ptr ptr ptr long) +@ stdcall KeInsertQueueDpc(ptr ptr ptr) +@ stdcall KeInvalidateAllCaches() +@ stdcall KeIpiGenericCall(ptr ptr) +@ stdcall KeIsAttachedProcess() +@ stdcall KeIsExecutingDpc() +;KeIsWaitListEmpty +@ stdcall KeLeaveCriticalRegion() _KeLeaveCriticalRegion +@ stdcall KeLeaveGuardedRegion() _KeLeaveGuardedRegion +@ extern KeLoaderBlock +@ extern KeNumberProcessors +@ stdcall KeProfileInterrupt(ptr) +@ stdcall KeProfileInterruptWithSource(ptr long) +@ stdcall KePulseEvent(ptr long long) +@ stdcall KeQueryActiveProcessors() +#ifndef __x86_64__ +@ stdcall KeQueryInterruptTime() +#endif +@ stdcall KeQueryPriorityThread(ptr) +@ stdcall KeQueryRuntimeThread(ptr ptr) +#ifndef __x86_64__ +@ stdcall KeQuerySystemTime(ptr) +#endif +@ stdcall KeQueryTickCount(ptr) +@ stdcall KeQueryTimeIncrement() +@ stdcall KeRaiseUserException(long) +@ stdcall KeReadStateEvent(ptr) +@ stdcall KeReadStateMutant(ptr) +@ stdcall KeReadStateMutex(ptr) KeReadStateMutant +@ stdcall KeReadStateQueue(ptr) +@ stdcall KeReadStateSemaphore(ptr) +@ stdcall KeReadStateTimer(ptr) +@ stdcall KeRegisterBugCheckCallback(ptr ptr ptr long ptr) +@ stdcall KeRegisterBugCheckReasonCallback(ptr ptr ptr ptr) +@ stdcall KeRegisterNmiCallback(ptr ptr) +@ FASTCALL KeReleaseGuardedMutex(ptr) +@ FASTCALL KeReleaseGuardedMutexUnsafe(ptr) +@ FASTCALL KeReleaseInStackQueuedSpinLockForDpc(ptr) +@ FASTCALL KeReleaseInStackQueuedSpinLockFromDpcLevel(ptr) +@ stdcall KeReleaseInterruptSpinLock(ptr long) +@ stdcall KeReleaseMutant(ptr long long long) +@ stdcall KeReleaseMutex(ptr long) +@ stdcall KeReleaseSemaphore(ptr long long long) +#ifdef __x86_64__ +@ stdcall KeReleaseSpinLock(ptr long) +#endif +@ FASTCALL KeReleaseSpinLockForDpc(ptr long) +@ stdcall KeReleaseSpinLockFromDpcLevel(ptr) +@ stdcall KeRemoveByKeyDeviceQueue(ptr long) +@ stdcall KeRemoveByKeyDeviceQueueIfBusy(ptr long) +@ stdcall KeRemoveDeviceQueue(ptr) +@ stdcall KeRemoveEntryDeviceQueue(ptr ptr) +@ stdcall KeRemoveQueue(ptr long ptr) +@ stdcall KeRemoveQueueDpc(ptr) +@ stdcall KeRemoveSystemServiceTable(long) +@ stdcall KeResetEvent(ptr) +@ stdcall KeRestoreFloatingPointState(ptr) +@ stdcall KeRevertToUserAffinityThread() +@ stdcall KeRundownQueue(ptr) +@ stdcall KeSaveFloatingPointState(ptr) +@ cdecl KeSaveStateForHibernate(ptr) +@ extern KeServiceDescriptorTable +@ stdcall KeSetAffinityThread(ptr long) +@ stdcall KeSetBasePriorityThread(ptr long) +@ stdcall KeSetDmaIoCoherency(long) +@ stdcall KeSetEvent(ptr long long) +@ stdcall KeSetEventBoostPriority(ptr ptr) +@ stdcall KeSetIdealProcessorThread(ptr long) +@ stdcall KeSetImportanceDpc(ptr long) +@ stdcall KeSetKernelStackSwapEnable(long) +@ stdcall KeSetPriorityThread(ptr long) +@ stdcall KeSetProfileIrql(long) +@ stdcall KeSetSystemAffinityThread(long) +@ stdcall KeSetTargetProcessorDpc(ptr long) +@ stdcall KeSetTimeIncrement(long long) +@ stdcall KeSetTimer(ptr long long ptr) +@ stdcall KeSetTimerEx(ptr long long long ptr) +;KeSignalCallDpcDone +;KeSignalCallDpcSynchronize +@ stdcall KeStackAttachProcess(ptr ptr) +@ stdcall KeSynchronizeExecution(ptr ptr ptr) +@ stdcall KeTerminateThread(long) +@ FASTCALL KeTestSpinLock(ptr) +@ extern KeTickCount +@ FASTCALL KeTryToAcquireGuardedMutex(ptr) +@ FASTCALL KeTryToAcquireSpinLockAtDpcLevel(ptr) +@ stdcall KeUnstackDetachProcess(ptr) +@ stdcall KeUpdateRunTime(ptr long) +@ fastcall KeUpdateSystemTime(ptr long long) +@ stdcall KeUserModeCallback(long ptr long ptr ptr) +@ stdcall KeWaitForMultipleObjects(long ptr long long long long ptr ptr) +@ stdcall KeWaitForMutexObject(ptr long long long ptr) KeWaitForSingleObject +@ stdcall KeWaitForSingleObject(ptr long long long ptr) +@ FASTCALL KefAcquireSpinLockAtDpcLevel(ptr) +@ FASTCALL KefReleaseSpinLockFromDpcLevel(ptr) +@ stdcall -arch=i386 Kei386EoiHelper() +@ fastcall -arch=i386 KiEoiHelper(ptr) /* FIXME: Evaluate decision */ +@ FASTCALL KiAcquireSpinLock(ptr) +@ extern KiBugCheckData +@ stdcall KiCheckForKernelApcDelivery() +;KiCheckForSListAddress +@ stdcall -arch=i386 KiCoprocessorError() +@ stdcall KiDeliverApc(long ptr ptr) +@ stdcall -arch=i386 KiDispatchInterrupt() +@ extern KiEnableTimerWatchdog +@ stdcall KiIpiServiceRoutine(ptr ptr) +@ FASTCALL KiReleaseSpinLock(ptr) +@ cdecl KiUnexpectedInterrupt() +#ifdef _M_IX86 +@ stdcall Kii386SpinOnSpinLock(ptr long) +#endif +@ stdcall LdrAccessResource(ptr ptr ptr ptr) +@ stdcall LdrEnumResources(ptr ptr long ptr ptr) +@ stdcall LdrFindResourceDirectory_U(ptr ptr long ptr) +@ stdcall LdrFindResource_U(ptr ptr long ptr) +@ extern LpcPortObjectType +@ stdcall LpcRequestPort(ptr ptr) +@ stdcall LpcRequestWaitReplyPort(ptr ptr ptr) +@ stdcall LsaCallAuthenticationPackage(long long long long long long long) +@ stdcall LsaDeregisterLogonProcess(long long) +@ stdcall LsaFreeReturnBuffer(ptr) +@ stdcall LsaLogonUser(ptr ptr long long ptr long ptr ptr ptr ptr ptr ptr ptr ptr) +@ stdcall LsaLookupAuthenticationPackage(long long long) +@ stdcall LsaRegisterLogonProcess(ptr ptr ptr) +@ extern Mm64BitPhysicalAddress +@ stdcall MmAddPhysicalMemory(ptr ptr) +@ stdcall MmAddVerifierThunks(ptr long) +@ stdcall MmAdjustWorkingSetSize(long long long long) +@ stdcall MmAdvanceMdl(ptr long) +@ stdcall MmAllocateContiguousMemory(long long long) +@ stdcall MmAllocateContiguousMemorySpecifyCache(long long long long long long long long) +@ stdcall MmAllocateMappingAddress(long long) +@ stdcall MmAllocateNonCachedMemory(long) +@ stdcall MmAllocatePagesForMdl(ptr ptr ptr ptr ptr ptr ptr) +@ stdcall MmAllocatePagesForMdlEx(long long long long long long long long long) +@ stdcall MmBuildMdlForNonPagedPool(ptr) +@ stdcall MmCanFileBeTruncated(ptr ptr) +;MmCommitSessionMappedView +@ stdcall MmCreateMdl(ptr ptr long) +;MmCreateMirror +@ stdcall MmCreateSection(ptr long ptr ptr long long ptr ptr) +@ stdcall MmDisableModifiedWriteOfSection(long) +@ stdcall MmFlushImageSection(ptr long) +@ stdcall MmForceSectionClosed(ptr long) +@ stdcall MmFreeContiguousMemory(ptr) +@ stdcall MmFreeContiguousMemorySpecifyCache(ptr long long) +@ stdcall MmFreeMappingAddress(ptr long) +@ stdcall MmFreeNonCachedMemory(ptr long) +@ stdcall MmFreePagesFromMdl(ptr) +@ stdcall MmGetPhysicalAddress(ptr) +@ stdcall MmGetPhysicalMemoryRanges() +@ stdcall MmGetSystemRoutineAddress(ptr) +@ stdcall MmGetVirtualForPhysical(long long) +@ stdcall MmGrowKernelStack(ptr) +@ extern MmHighestUserAddress +@ stdcall MmIsAddressValid(ptr) +@ stdcall MmIsDriverVerifying(ptr) +;MmIsIoSpaceActive +@ stdcall MmIsNonPagedSystemAddressValid(ptr) +@ stdcall MmIsRecursiveIoFault() +@ stdcall MmIsThisAnNtAsSystem() +@ stdcall MmIsVerifierEnabled(ptr) +@ stdcall MmLockPagableDataSection(ptr) MmLockPageableDataSection +@ stdcall MmLockPagableImageSection(ptr) MmLockPageableDataSection +@ stdcall MmLockPagableSectionByHandle(ptr) MmLockPageableSectionByHandle +@ stdcall MmMapIoSpace(long long long long) +@ stdcall MmMapLockedPages(ptr long) +@ stdcall MmMapLockedPagesSpecifyCache(ptr long long ptr long long) +@ stdcall MmMapLockedPagesWithReservedMapping(ptr long ptr long) +@ stdcall MmMapMemoryDumpMdl(ptr) +@ stdcall MmMapUserAddressesToPage(ptr long ptr) +@ stdcall MmMapVideoDisplay(long long long long) +@ stdcall MmMapViewInSessionSpace(ptr ptr ptr) +@ stdcall MmMapViewInSystemSpace(ptr ptr ptr) +@ stdcall MmMapViewOfSection(ptr ptr ptr long long ptr ptr long long long) +@ stdcall MmMarkPhysicalMemoryAsBad(ptr ptr) +@ stdcall MmMarkPhysicalMemoryAsGood(ptr ptr) +@ stdcall MmPageEntireDriver(ptr) +@ stdcall MmPrefetchPages(long ptr) +@ stdcall MmProbeAndLockPages(ptr long long) +@ stdcall MmProbeAndLockProcessPages(ptr ptr long long) +@ stdcall MmProbeAndLockSelectedPages(ptr ptr long long) +@ stdcall MmProtectMdlSystemAddress(ptr long) +@ stdcall MmQuerySystemSize() +@ stdcall MmRemovePhysicalMemory(ptr ptr) +@ stdcall MmResetDriverPaging(ptr) +@ extern MmSectionObjectType +@ stdcall MmSecureVirtualMemory(ptr long long) +@ stdcall MmSetAddressRangeModified(ptr long) +@ stdcall MmSetBankedSection(long long long long long long) +@ stdcall MmSizeOfMdl(ptr long) +@ extern MmSystemRangeStart +@ stdcall MmTrimAllSystemPagableMemory(long) MmTrimAllSystemPageableMemory +@ stdcall MmUnlockPagableImageSection(ptr) MmUnlockPageableImageSection +@ stdcall MmUnlockPages(ptr) +@ stdcall MmUnmapIoSpace(ptr long) +@ stdcall MmUnmapLockedPages(ptr ptr) +@ stdcall MmUnmapReservedMapping(ptr long ptr) +@ stdcall MmUnmapVideoDisplay(ptr long) +@ stdcall MmUnmapViewInSessionSpace(ptr) +@ stdcall MmUnmapViewInSystemSpace(ptr) +@ stdcall MmUnmapViewOfSection(ptr ptr) +@ stdcall MmUnsecureVirtualMemory(ptr) +@ extern MmUserProbeAddress +@ extern NlsAnsiCodePage +@ extern NlsLeadByteInfo +@ extern NlsMbCodePageTag +@ extern NlsMbOemCodePageTag +@ extern NlsOemCodePage +@ extern NlsOemLeadByteInfo _NlsOemLeadByteInfo +@ stdcall NtAddAtom(wstr long ptr) +@ stdcall NtAdjustPrivilegesToken(ptr long ptr long ptr ptr) +@ stdcall NtAlertThread(ptr) +@ stdcall NtAllocateLocallyUniqueId(ptr) +@ stdcall NtAllocateUuids(ptr ptr ptr ptr) +@ stdcall NtAllocateVirtualMemory(ptr ptr long ptr long long) +@ extern NtBuildNumber +@ stdcall NtClose(ptr) +@ stdcall NtConnectPort(ptr ptr ptr ptr ptr ptr ptr ptr) +@ stdcall NtCreateEvent(ptr long ptr long long) +@ stdcall NtCreateFile(ptr long ptr ptr ptr long long long long ptr long) +@ stdcall NtCreateSection(ptr long ptr ptr long long ptr) +@ stdcall NtCreateTimer(ptr long ptr long) +@ stdcall NtDeleteAtom(ptr) +@ stdcall NtDeleteFile(ptr) +@ stdcall NtDeviceIoControlFile(ptr ptr ptr ptr ptr long ptr long ptr long) +@ stdcall NtDuplicateObject(ptr ptr ptr ptr long long long) +@ stdcall NtDuplicateToken(ptr long ptr long long ptr) +@ stdcall NtFindAtom(wstr long ptr) +@ stdcall NtFreeVirtualMemory(ptr ptr ptr long) +@ stdcall NtFsControlFile(ptr ptr ptr ptr ptr long ptr long ptr long) +@ extern NtGlobalFlag +@ stdcall NtLockFile(ptr ptr ptr ptr ptr ptr ptr long long long) +@ stdcall NtMakePermanentObject(ptr) +@ stdcall NtMapViewOfSection(ptr ptr ptr long long ptr ptr long long long) +@ stdcall NtNotifyChangeDirectoryFile(ptr ptr ptr ptr ptr ptr long long long) +@ stdcall NtOpenEvent(ptr long ptr) +@ stdcall NtOpenFile(ptr long ptr ptr long long) +@ stdcall NtOpenProcess(ptr long ptr ptr) +@ stdcall NtOpenProcessToken(ptr long ptr) +@ stdcall NtOpenProcessTokenEx(ptr long long ptr) +@ stdcall NtOpenThread(ptr long ptr ptr) +@ stdcall NtOpenThreadToken(ptr long long ptr) +@ stdcall NtOpenThreadTokenEx(ptr long long long ptr) +@ stdcall NtQueryDirectoryFile(ptr ptr ptr ptr ptr ptr long long long ptr long) +@ stdcall NtQueryEaFile(ptr ptr ptr long long ptr long ptr long) +@ stdcall NtQueryInformationAtom(ptr long ptr long ptr) +@ stdcall NtQueryInformationFile(ptr ptr ptr long long) +@ stdcall NtQueryInformationProcess(ptr ptr ptr long ptr) +@ stdcall NtQueryInformationThread(ptr long ptr long ptr) +@ stdcall NtQueryInformationToken(ptr long ptr long ptr) +@ stdcall NtQueryQuotaInformationFile(ptr ptr ptr long long ptr long ptr long) +@ stdcall NtQuerySecurityObject(ptr long ptr long ptr) +@ stdcall NtQuerySystemInformation(long ptr long ptr) +@ stdcall NtQueryVolumeInformationFile(ptr ptr ptr long long) +@ stdcall NtReadFile(ptr ptr ptr ptr ptr ptr long ptr ptr) +@ stdcall NtRequestPort(ptr ptr) +@ stdcall NtRequestWaitReplyPort(ptr ptr ptr) +@ stdcall NtSetEaFile(ptr ptr ptr long) +@ stdcall NtSetEvent(ptr ptr) +@ stdcall NtSetInformationFile(ptr ptr ptr long long) +@ stdcall NtSetInformationProcess(ptr ptr ptr long) +@ stdcall NtSetInformationThread(ptr long ptr long) +@ stdcall NtSetQuotaInformationFile(ptr ptr ptr long) +@ stdcall NtSetSecurityObject(ptr long ptr) +@ stdcall NtSetVolumeInformationFile(ptr ptr ptr long long) +@ stdcall NtShutdownSystem(long) +@ stdcall NtTraceEvent(long long long ptr) +@ stdcall NtUnlockFile(ptr ptr ptr ptr long) +@ stdcall NtVdmControl(long ptr) +@ stdcall NtWaitForSingleObject(ptr long ptr) +@ stdcall NtWriteFile(ptr ptr ptr ptr ptr ptr long ptr ptr) +@ stdcall ObAssignSecurity(ptr ptr ptr ptr) +@ stdcall ObCheckCreateObjectAccess(ptr long ptr ptr long long ptr) +@ stdcall ObCheckObjectAccess(ptr ptr long long ptr) +@ stdcall ObCloseHandle(ptr long) +@ stdcall ObCreateObject(long ptr ptr long ptr long long long ptr) +@ stdcall ObCreateObjectType(ptr ptr ptr ptr) +;ObDeleteCapturedInsertInfo +@ stdcall ObDereferenceObject(ptr) +@ stdcall ObDereferenceObjectDeferDelete(ptr) +@ stdcall ObDereferenceSecurityDescriptor(ptr long) +@ stdcall ObFindHandleForObject(ptr ptr ptr ptr ptr) +@ stdcall ObGetObjectSecurity(ptr ptr ptr) +@ stdcall ObInsertObject(ptr ptr long long ptr ptr) +@ stdcall ObIsKernelHandle(ptr) +@ stdcall ObLogSecurityDescriptor(ptr ptr long) +@ stdcall ObMakeTemporaryObject(ptr) +@ stdcall ObOpenObjectByName(ptr ptr long ptr long ptr ptr) +@ stdcall ObOpenObjectByPointer(ptr long ptr long ptr long ptr) +@ stdcall ObQueryNameString(ptr ptr long ptr) +@ stdcall ObQueryObjectAuditingByHandle(ptr ptr) +@ stdcall ObReferenceObjectByHandle(ptr long ptr long ptr ptr) +@ stdcall ObReferenceObjectByName(ptr long ptr long ptr long ptr ptr) +@ stdcall ObReferenceObjectByPointer(ptr long ptr long) +@ stdcall ObReferenceSecurityDescriptor(ptr long) +@ stdcall ObReleaseObjectSecurity(ptr long) +;ObSetHandleAttributes@12 +@ stdcall ObSetSecurityDescriptorInfo(ptr ptr ptr ptr long ptr) +@ stdcall ObSetSecurityObjectByPointer(ptr long ptr) +@ FASTCALL ObfDereferenceObject(ptr) +@ FASTCALL ObfReferenceObject(ptr) +;PfxFindPrefix +;PfxInitialize +;PfxInsertPrefix +;PfxRemovePrefix +@ stdcall PoCallDriver(ptr ptr) +@ stdcall PoCancelDeviceNotify(ptr) +@ stdcall PoQueueShutdownWorkItem(ptr) +@ stdcall PoRegisterDeviceForIdleDetection(ptr long long long) +@ stdcall PoRegisterDeviceNotify(ptr long long long ptr ptr) +@ stdcall PoRegisterSystemState(ptr long) +@ stdcall PoRequestPowerIrp(ptr long long ptr ptr ptr) +@ stdcall PoRequestShutdownEvent(ptr) +@ stdcall PoSetHiberRange(ptr long ptr long long) +@ stdcall PoSetPowerState(ptr long long) +@ stdcall PoSetSystemState(long) +@ stdcall PoShutdownBugCheck(long long ptr ptr ptr ptr) +@ stdcall PoStartNextPowerIrp(ptr) +@ stdcall PoUnregisterSystemState(ptr) +@ stdcall ProbeForRead(ptr long long) +@ stdcall ProbeForWrite(ptr long long) +@ stdcall PsAssignImpersonationToken(ptr ptr) +@ stdcall PsChargePoolQuota(ptr long long) +@ stdcall PsChargeProcessNonPagedPoolQuota(ptr long) +@ stdcall PsChargeProcessPagedPoolQuota(ptr long) +@ stdcall PsChargeProcessPoolQuota(ptr long long) +@ stdcall PsCreateSystemProcess(ptr long ptr) +@ stdcall PsCreateSystemThread(ptr long ptr ptr ptr ptr ptr) +@ stdcall PsDereferenceImpersonationToken(ptr) PsDereferencePrimaryToken +@ stdcall PsDereferencePrimaryToken(ptr) +@ stdcall PsDisableImpersonation(ptr ptr) +@ stdcall PsEstablishWin32Callouts(ptr) +@ stdcall PsGetContextThread(ptr ptr long) +@ stdcall PsGetCurrentProcess() IoGetCurrentProcess +@ stdcall PsGetCurrentProcessId() +@ stdcall PsGetCurrentProcessSessionId() +@ stdcall PsGetCurrentProcessWin32Process() +@ stdcall PsGetCurrentThread() KeGetCurrentThread +@ stdcall PsGetCurrentThreadId() +@ stdcall PsGetCurrentThreadPreviousMode() +;PsGetCurrentThreadProcess +;PsGetCurrentThreadProcessId +@ stdcall PsGetCurrentThreadStackBase() +@ stdcall PsGetCurrentThreadStackLimit() +;PsGetCurrentThreadTeb +@ stdcall PsGetCurrentThreadWin32Thread() +;PsGetCurrentThreadWin32ThreadAndEnterCriticalRegion +@ stdcall PsGetJobLock(ptr) +@ stdcall PsGetJobSessionId(ptr) +@ stdcall PsGetJobUIRestrictionsClass(ptr) +@ stdcall PsGetProcessCreateTimeQuadPart(ptr) +@ stdcall PsGetProcessDebugPort(ptr) +@ stdcall PsGetProcessExitProcessCalled(ptr) +@ stdcall PsGetProcessExitStatus(ptr) +@ stdcall PsGetProcessExitTime() +@ stdcall PsGetProcessId(ptr) +@ stdcall PsGetProcessImageFileName(ptr) +@ stdcall PsGetProcessInheritedFromUniqueProcessId(ptr) +@ stdcall PsGetProcessJob(ptr) +@ stdcall PsGetProcessPeb(ptr) +@ stdcall PsGetProcessPriorityClass(ptr) +@ stdcall PsGetProcessSectionBaseAddress(ptr) +@ stdcall PsGetProcessSecurityPort(ptr) +@ stdcall PsGetProcessSessionId(ptr) +;PsGetProcessSessionIdEx +@ stdcall PsGetProcessWin32Process(ptr) +@ stdcall PsGetProcessWin32WindowStation(ptr) +@ stdcall PsGetThreadFreezeCount(ptr) +@ stdcall PsGetThreadHardErrorsAreDisabled(ptr) +@ stdcall PsGetThreadId(ptr) +@ stdcall PsGetThreadProcess(ptr) +@ stdcall PsGetThreadProcessId(ptr) +@ stdcall PsGetThreadSessionId(ptr) +@ stdcall PsGetThreadTeb(ptr) +@ stdcall PsGetThreadWin32Thread(ptr) +@ stdcall PsGetVersion(ptr ptr ptr ptr) +@ stdcall PsImpersonateClient(ptr ptr long long long) +@ extern PsInitialSystemProcess +@ stdcall PsIsProcessBeingDebugged(ptr) +@ stdcall PsIsSystemProcess(ptr) +@ stdcall PsIsSystemThread(ptr) +@ stdcall PsIsThreadImpersonating(ptr) +@ stdcall PsIsThreadTerminating(ptr) +@ extern PsJobType +@ stdcall PsLookupProcessByProcessId(ptr ptr) +@ stdcall PsLookupProcessThreadByCid(ptr ptr ptr) +@ stdcall PsLookupThreadByThreadId(ptr ptr) +@ extern PsProcessType _PsProcessType +@ stdcall PsReferenceImpersonationToken(ptr ptr ptr ptr) +@ stdcall PsReferencePrimaryToken(ptr) +@ stdcall PsRemoveCreateThreadNotifyRoutine(ptr) +@ stdcall PsRemoveLoadImageNotifyRoutine(ptr) +@ stdcall PsRestoreImpersonation(ptr ptr) +@ stdcall PsReturnPoolQuota(ptr long long) +@ stdcall PsReturnProcessNonPagedPoolQuota(ptr long) +@ stdcall PsReturnProcessPagedPoolQuota(ptr long) +@ stdcall PsRevertThreadToSelf(ptr) +@ stdcall PsRevertToSelf() +@ stdcall PsSetContextThread(ptr ptr long) +@ stdcall PsSetCreateProcessNotifyRoutine(ptr long) +@ stdcall PsSetCreateThreadNotifyRoutine(ptr) +@ stdcall PsSetJobUIRestrictionsClass(ptr long) +@ stdcall PsSetLegoNotifyRoutine(ptr) +@ stdcall PsSetLoadImageNotifyRoutine(ptr) +@ stdcall PsSetProcessPriorityByClass(ptr ptr) +@ stdcall PsSetProcessPriorityClass(ptr long) +@ stdcall PsSetProcessSecurityPort(ptr ptr) +@ stdcall PsSetProcessWin32Process(ptr ptr) +@ stdcall PsSetProcessWindowStation(ptr ptr) +@ stdcall PsSetThreadHardErrorsAreDisabled(ptr long) +@ stdcall PsSetThreadWin32Thread(ptr ptr) +@ stdcall PsTerminateSystemThread(long) +@ extern PsThreadType _PsThreadType +;PsWrapApcWow64Thread +#ifndef __x86_64__ +@ stdcall READ_REGISTER_BUFFER_UCHAR(ptr ptr long) +@ stdcall READ_REGISTER_BUFFER_ULONG(ptr ptr long) +@ stdcall READ_REGISTER_BUFFER_USHORT(ptr ptr long) +@ stdcall READ_REGISTER_UCHAR(ptr) +@ stdcall READ_REGISTER_ULONG(ptr) +@ stdcall READ_REGISTER_USHORT(ptr) +#endif +@ stdcall RtlAbsoluteToSelfRelativeSD(ptr ptr ptr) +@ stdcall RtlAddAccessAllowedAce(ptr long long ptr) +@ stdcall RtlAddAccessAllowedAceEx(ptr long long long ptr) +@ stdcall RtlAddAce(ptr long long ptr long) +@ stdcall RtlAddAtomToAtomTable(ptr wstr ptr) +@ stdcall RtlAddRange(ptr long long long long long long ptr ptr) +@ stdcall RtlAllocateAndInitializeSid(ptr long long long long long long long long long ptr) +@ stdcall RtlAllocateHeap(ptr long long) +@ stdcall RtlAnsiCharToUnicodeChar(ptr) +@ stdcall RtlAnsiStringToUnicodeSize(ptr) RtlxAnsiStringToUnicodeSize +@ stdcall RtlAnsiStringToUnicodeString(ptr ptr long) +@ stdcall RtlAppendAsciizToString(ptr str) +@ stdcall RtlAppendStringToString(ptr ptr) +@ stdcall RtlAppendUnicodeStringToString(ptr ptr) +@ stdcall RtlAppendUnicodeToString(ptr wstr) +@ stdcall RtlAreAllAccessesGranted(long long) +@ stdcall RtlAreAnyAccessesGranted(long long) +@ stdcall RtlAreBitsClear(ptr long long) +@ stdcall RtlAreBitsSet(ptr long long) +@ stdcall RtlAssert(str str long str) +@ stdcall RtlCaptureContext(ptr) +@ stdcall RtlCaptureStackBackTrace(long long ptr ptr) +@ stdcall RtlCharToInteger(str long ptr) +@ stdcall RtlCheckRegistryKey(long wstr) +@ stdcall RtlClearAllBits(ptr) +@ stdcall RtlClearBit(ptr long) +@ stdcall RtlClearBits(ptr long long) +@ stdcall RtlCompareMemory(ptr ptr long) +@ stdcall RtlCompareMemoryUlong(ptr long long) +@ stdcall RtlCompareString(ptr ptr long) +@ stdcall RtlCompareUnicodeString(ptr ptr long) +@ stdcall RtlCompressBuffer(long ptr long ptr long long ptr ptr) +@ stdcall RtlCompressChunks(ptr long ptr long ptr long ptr) +@ stdcall RtlConvertLongToLargeInteger(long) +@ stdcall RtlConvertSidToUnicodeString(ptr ptr long) +@ stdcall RtlConvertUlongToLargeInteger(long) +@ stdcall RtlCopyLuid(ptr ptr) +@ stdcall RtlCopyRangeList(ptr ptr) +@ stdcall RtlCopySid(long ptr ptr) +@ stdcall RtlCopyString(ptr ptr) +@ stdcall RtlCopyUnicodeString(ptr ptr) +@ stdcall RtlCreateAcl(ptr long long) +@ stdcall RtlCreateAtomTable(long ptr) +@ stdcall RtlCreateHeap(long ptr long long ptr ptr) +@ stdcall RtlCreateRegistryKey(long wstr) +@ stdcall RtlCreateSecurityDescriptor(ptr long) +@ stdcall RtlCreateSystemVolumeInformationFolder(ptr) +@ stdcall RtlCreateUnicodeString(ptr wstr) +@ stdcall RtlCustomCPToUnicodeN(ptr wstr long ptr ptr long) +@ stdcall RtlDecompressBuffer(long ptr long ptr long ptr) +@ stdcall RtlDecompressChunks(ptr long ptr long ptr long ptr) +@ stdcall RtlDecompressFragment(long ptr long ptr long long ptr ptr) +@ stdcall RtlDelete(ptr) +@ stdcall RtlDeleteAce(ptr long) +@ stdcall RtlDeleteAtomFromAtomTable(ptr ptr) +@ stdcall RtlDeleteElementGenericTable(ptr ptr) +@ stdcall RtlDeleteElementGenericTableAvl(ptr ptr) +@ stdcall RtlDeleteNoSplay(ptr ptr) +@ stdcall RtlDeleteOwnersRanges(ptr ptr) +@ stdcall RtlDeleteRange(ptr long long long long ptr) +@ stdcall RtlDeleteRegistryValue(long wstr wstr) +@ stdcall RtlDescribeChunk(long ptr ptr ptr ptr) +@ stdcall RtlDestroyAtomTable(ptr) +@ stdcall RtlDestroyHeap(ptr) +@ stdcall RtlDowncaseUnicodeString(ptr ptr long) +@ stdcall RtlEmptyAtomTable(ptr long) +@ stdcall RtlEnlargedIntegerMultiply(long long) +@ stdcall RtlEnlargedUnsignedDivide(long long long ptr) +@ stdcall RtlEnlargedUnsignedMultiply(long long) +@ stdcall RtlEnumerateGenericTable(ptr long) +@ stdcall RtlEnumerateGenericTableAvl(ptr long) +@ stdcall RtlEnumerateGenericTableLikeADirectory(ptr ptr ptr long ptr ptr ptr) +@ stdcall RtlEnumerateGenericTableWithoutSplaying(ptr ptr) +@ stdcall RtlEnumerateGenericTableWithoutSplayingAvl(ptr ptr) +@ stdcall RtlEqualLuid(ptr ptr) +@ stdcall RtlEqualSid(ptr ptr) +@ stdcall RtlEqualString(ptr ptr long) +@ stdcall RtlEqualUnicodeString(ptr ptr long) +@ stdcall RtlExtendedIntegerMultiply(long long long) +@ stdcall RtlExtendedLargeIntegerDivide(long long long ptr) +@ stdcall RtlExtendedMagicDivide(long long long long long) +@ stdcall RtlFillMemory(ptr long long) +@ stdcall RtlFillMemoryUlong(ptr long long) +@ stdcall RtlFindClearBits(ptr long long) +@ stdcall RtlFindClearBitsAndSet(ptr long long) +@ stdcall RtlFindClearRuns(ptr ptr long long) +@ stdcall RtlFindFirstRunClear(ptr ptr) +@ stdcall RtlFindLastBackwardRunClear(ptr long ptr) +@ stdcall RtlFindLeastSignificantBit(long long) +@ stdcall RtlFindLongestRunClear(ptr ptr) +@ stdcall RtlFindMessage(ptr long long long ptr) +@ stdcall RtlFindMostSignificantBit(long long) +@ stdcall RtlFindNextForwardRunClear(ptr long ptr) +@ stdcall RtlFindRange(ptr long long long long long long long long ptr ptr ptr) +@ stdcall RtlFindSetBits(ptr long long) +@ stdcall RtlFindSetBitsAndClear(ptr long long) +@ stdcall RtlFindUnicodePrefix(ptr ptr long) +@ stdcall RtlFormatCurrentUserKeyPath(ptr) +@ stdcall RtlFreeAnsiString(ptr) +@ stdcall RtlFreeHeap(ptr long ptr) +@ stdcall RtlFreeOemString(ptr) +@ stdcall RtlFreeRangeList(ptr) +@ stdcall RtlFreeUnicodeString(ptr) +@ stdcall RtlGUIDFromString(ptr ptr) +@ stdcall RtlGenerate8dot3Name(ptr ptr long ptr) +@ stdcall RtlGetAce(ptr long ptr) +@ stdcall RtlGetCallersAddress(ptr ptr) +@ stdcall RtlGetCompressionWorkSpaceSize(long ptr ptr) +@ stdcall RtlGetDaclSecurityDescriptor(ptr ptr ptr ptr) +@ stdcall RtlGetDefaultCodePage(ptr ptr) +@ stdcall RtlGetElementGenericTable(ptr long) +@ stdcall RtlGetElementGenericTableAvl(ptr long) +@ stdcall RtlGetFirstRange(ptr ptr ptr) +@ stdcall RtlGetGroupSecurityDescriptor(ptr ptr ptr) +@ stdcall RtlGetNextRange(ptr ptr long) +@ stdcall RtlGetNtGlobalFlags() +@ stdcall RtlGetOwnerSecurityDescriptor(ptr ptr ptr) +@ stdcall RtlGetSaclSecurityDescriptor(ptr ptr ptr ptr) +@ stdcall RtlGetSetBootStatusData(ptr long long ptr long long) +@ stdcall RtlGetVersion(ptr) +@ stdcall RtlHashUnicodeString(ptr long long ptr) +@ stdcall RtlImageDirectoryEntryToData(ptr long long ptr) +@ stdcall RtlImageNtHeader(ptr) +@ stdcall RtlInitAnsiString(ptr str) +@ stdcall RtlInitAnsiStringEx(ptr str) +@ stdcall RtlInitCodePageTable(ptr ptr) +@ stdcall RtlInitString(ptr str) +@ stdcall RtlInitUnicodeString(ptr wstr) +@ stdcall RtlInitUnicodeStringEx(ptr wstr) +@ stdcall RtlInitializeBitMap(ptr ptr long) +@ stdcall RtlInitializeGenericTable(ptr ptr ptr ptr ptr) +@ stdcall RtlInitializeGenericTableAvl(ptr ptr ptr ptr ptr) +@ stdcall RtlInitializeRangeList(ptr) +@ stdcall RtlInitializeSid(ptr ptr long) +@ stdcall RtlInitializeUnicodePrefix(ptr) +@ stdcall RtlInsertElementGenericTable(ptr ptr long ptr) +@ stdcall RtlInsertElementGenericTableAvl(ptr ptr long ptr) +@ stdcall RtlInsertElementGenericTableFull(ptr ptr long ptr ptr long) +@ stdcall RtlInsertElementGenericTableFullAvl(ptr ptr long ptr ptr ptr) +@ stdcall RtlInsertUnicodePrefix(ptr ptr ptr) +@ stdcall RtlInt64ToUnicodeString(long long long ptr) +@ stdcall RtlIntegerToChar(long long long ptr) +@ stdcall RtlIntegerToUnicode(long long long ptr) +@ stdcall RtlIntegerToUnicodeString(long long ptr) +@ stdcall RtlInvertRangeList(ptr ptr) +@ stdcall RtlIpv4AddressToStringA(ptr ptr) +@ stdcall RtlIpv4AddressToStringExA(ptr long ptr ptr) +@ stdcall RtlIpv4AddressToStringExW(ptr long ptr ptr) +@ stdcall RtlIpv4AddressToStringW(ptr ptr) +@ stdcall RtlIpv4StringToAddressA(str long ptr ptr) +@ stdcall RtlIpv4StringToAddressExA(str long ptr ptr) +@ stdcall RtlIpv4StringToAddressExW(wstr long ptr ptr) +@ stdcall RtlIpv4StringToAddressW(wstr long ptr ptr) +@ stdcall RtlIpv6AddressToStringA(ptr ptr) +@ stdcall RtlIpv6AddressToStringExA(ptr long long ptr ptr) +@ stdcall RtlIpv6AddressToStringExW(ptr long long ptr ptr) +@ stdcall RtlIpv6AddressToStringW(ptr ptr) +@ stdcall RtlIpv6StringToAddressA(str ptr ptr) +@ stdcall RtlIpv6StringToAddressExA(str ptr ptr ptr) +@ stdcall RtlIpv6StringToAddressExW(wstr ptr ptr ptr) +@ stdcall RtlIpv6StringToAddressW(wstr ptr ptr) +@ stdcall RtlIsGenericTableEmpty(ptr) +@ stdcall RtlIsGenericTableEmptyAvl(ptr) +@ stdcall RtlIsNameLegalDOS8Dot3(ptr ptr ptr) +@ stdcall RtlIsRangeAvailable(ptr long long long long long long ptr ptr ptr) +@ stdcall RtlIsValidOemCharacter(ptr) +@ stdcall RtlLargeIntegerAdd(long long long long) +@ stdcall RtlLargeIntegerArithmeticShift(long long long) +@ stdcall RtlLargeIntegerDivide(long long long long ptr) +@ stdcall RtlLargeIntegerNegate(long long) +@ stdcall RtlLargeIntegerShiftLeft(long long long) +@ stdcall RtlLargeIntegerShiftRight(long long long) +@ stdcall RtlLargeIntegerSubtract(long long long long) +@ stdcall RtlLengthRequiredSid(long) +@ stdcall RtlLengthSecurityDescriptor(ptr) +@ stdcall RtlLengthSid(ptr) +@ stdcall RtlLockBootStatusData(ptr) +@ stdcall RtlLookupAtomInAtomTable(ptr wstr ptr) +@ stdcall RtlLookupElementGenericTable(ptr ptr) +@ stdcall RtlLookupElementGenericTableAvl(ptr ptr) +@ stdcall RtlLookupElementGenericTableFull(ptr ptr ptr ptr) +@ stdcall RtlLookupElementGenericTableFullAvl(ptr ptr ptr ptr) +@ stdcall RtlMapGenericMask(ptr ptr) +@ stdcall RtlMapSecurityErrorToNtStatus(long) +@ stdcall RtlMergeRangeLists(ptr ptr ptr long) +@ stdcall RtlMoveMemory(ptr ptr long) +@ stdcall RtlMultiByteToUnicodeN(ptr long ptr str long) +@ stdcall RtlMultiByteToUnicodeSize(ptr str long) +@ stdcall RtlNextUnicodePrefix(ptr long) +@ stdcall RtlNtStatusToDosError(long) +@ stdcall RtlNtStatusToDosErrorNoTeb(long) +@ stdcall RtlNumberGenericTableElements(ptr) +@ stdcall RtlNumberGenericTableElementsAvl(ptr) +@ stdcall RtlNumberOfClearBits(ptr) +@ stdcall RtlNumberOfSetBits(ptr) +@ stdcall RtlOemStringToCountedUnicodeString(ptr ptr long) +@ stdcall RtlOemStringToUnicodeSize(ptr) RtlxOemStringToUnicodeSize +@ stdcall RtlOemStringToUnicodeString(ptr ptr long) +@ stdcall RtlOemToUnicodeN(wstr long ptr ptr long) +@ stdcall RtlPinAtomInAtomTable(ptr ptr) +@ FASTCALL RtlPrefetchMemoryNonTemporal(ptr long) +@ stdcall RtlPrefixString(ptr ptr long) +@ stdcall RtlPrefixUnicodeString(ptr ptr long) +@ stdcall RtlQueryAtomInAtomTable(ptr ptr ptr ptr ptr ptr) +@ stdcall RtlQueryRegistryValues(long wstr ptr ptr ptr) +@ stdcall RtlQueryTimeZoneInformation(ptr) +@ stdcall RtlRaiseException(ptr) +@ stdcall RtlRandom(ptr) +@ stdcall RtlRandomEx(ptr) +@ stdcall RtlRealPredecessor(ptr) +@ stdcall RtlRealSuccessor(ptr) +@ stdcall RtlRemoveUnicodePrefix(ptr ptr) +@ stdcall RtlReserveChunk(long ptr ptr ptr long) +@ stdcall RtlSecondsSince1970ToTime(long ptr) +@ stdcall RtlSecondsSince1980ToTime(long ptr) +@ stdcall RtlSelfRelativeToAbsoluteSD(ptr ptr ptr ptr ptr ptr ptr ptr ptr ptr ptr) +@ stdcall RtlSelfRelativeToAbsoluteSD2(ptr long) +@ stdcall RtlSetAllBits(ptr) +@ stdcall RtlSetBit(ptr long) +@ stdcall RtlSetBits(ptr long long) +@ stdcall RtlSetDaclSecurityDescriptor(ptr long ptr long) +@ stdcall RtlSetGroupSecurityDescriptor(ptr ptr long) +@ stdcall RtlSetOwnerSecurityDescriptor(ptr ptr long) +@ stdcall RtlSetSaclSecurityDescriptor(ptr long ptr long) +@ stdcall RtlSetTimeZoneInformation(ptr) +@ stdcall RtlSizeHeap(ptr long ptr) +@ stdcall RtlSplay(ptr) +@ stdcall RtlStringFromGUID(ptr ptr) +@ stdcall RtlSubAuthorityCountSid(ptr) +@ stdcall RtlSubAuthoritySid(ptr long) +@ stdcall RtlSubtreePredecessor(ptr) +@ stdcall RtlSubtreeSuccessor(ptr) +@ stdcall RtlTestBit(ptr long) +@ stdcall RtlTimeFieldsToTime(ptr ptr) +@ stdcall RtlTimeToElapsedTimeFields(ptr ptr) +@ stdcall RtlTimeToSecondsSince1970(ptr ptr) +@ stdcall RtlTimeToSecondsSince1980(ptr ptr) +@ stdcall RtlTimeToTimeFields(ptr ptr) +;RtlTraceDatabaseAdd +;RtlTraceDatabaseCreate +;RtlTraceDatabaseDestroy +;RtlTraceDatabaseEnumerate +;RtlTraceDatabaseFind +;RtlTraceDatabaseLock +;RtlTraceDatabaseUnlock +;RtlTraceDatabaseValidate +#ifndef __x86_64__ +@ FASTCALL RtlUlongByteSwap(long) +@ FASTCALL RtlUlonglongByteSwap(long long) +#endif +@ stdcall RtlUnicodeStringToAnsiSize(ptr) RtlxUnicodeStringToAnsiSize +@ stdcall RtlUnicodeStringToAnsiString(ptr ptr long) +@ stdcall RtlUnicodeStringToCountedOemString(ptr ptr long) +@ stdcall RtlUnicodeStringToInteger(ptr long ptr) +@ stdcall RtlUnicodeStringToOemSize(ptr) RtlxUnicodeStringToOemSize +@ stdcall RtlUnicodeStringToOemString(ptr ptr long) +@ stdcall RtlUnicodeToCustomCPN(ptr ptr long ptr wstr long) +@ stdcall RtlUnicodeToMultiByteN(ptr long ptr wstr long) +@ stdcall RtlUnicodeToMultiByteSize(ptr wstr long) +@ stdcall RtlUnicodeToOemN(ptr long ptr wstr long) +@ stdcall RtlUnlockBootStatusData(ptr) +@ stdcall RtlUnwind(ptr ptr ptr ptr) +@ stdcall RtlUpcaseUnicodeChar(long) +@ stdcall RtlUpcaseUnicodeString(ptr ptr long) +@ stdcall RtlUpcaseUnicodeStringToAnsiString(ptr ptr long) +@ stdcall RtlUpcaseUnicodeStringToCountedOemString(ptr ptr long) +@ stdcall RtlUpcaseUnicodeStringToOemString(ptr ptr long) +@ stdcall RtlUpcaseUnicodeToCustomCPN(ptr ptr long ptr wstr long) +@ stdcall RtlUpcaseUnicodeToMultiByteN(ptr long ptr wstr long) +@ stdcall RtlUpcaseUnicodeToOemN(ptr long ptr wstr long) +@ stdcall RtlUpperChar(long) +@ stdcall RtlUpperString(ptr ptr) +#ifndef __x86_64__ +@ FASTCALL RtlUshortByteSwap(long) +#endif +@ stdcall RtlValidRelativeSecurityDescriptor(ptr long long) +@ stdcall RtlValidSecurityDescriptor(ptr) +@ stdcall RtlValidSid(ptr) +@ stdcall RtlVerifyVersionInfo(ptr long long long) +@ stdcall RtlVolumeDeviceToDosName(ptr ptr) +@ stdcall RtlWalkFrameChain(ptr long long) +@ stdcall RtlWriteRegistryValue(long wstr wstr long ptr long) +@ stdcall RtlZeroHeap(ptr long) +@ stdcall RtlZeroMemory(ptr long) +@ stdcall RtlxAnsiStringToUnicodeSize(ptr) +@ stdcall RtlxOemStringToUnicodeSize(ptr) +@ stdcall RtlxUnicodeStringToAnsiSize(ptr) +@ stdcall RtlxUnicodeStringToOemSize(ptr) +@ stdcall SeAccessCheck(ptr ptr ptr long long ptr ptr long ptr ptr) +@ stdcall SeAppendPrivileges(ptr ptr) +@ stdcall SeAssignSecurity(ptr ptr ptr long ptr ptr ptr) +@ stdcall SeAssignSecurityEx(ptr ptr ptr ptr long long ptr ptr ptr) +@ stdcall SeAuditHardLinkCreation(ptr ptr long) +@ stdcall SeAuditingFileEvents(long ptr) +@ stdcall SeAuditingFileEventsWithContext(long ptr ptr) +@ stdcall SeAuditingFileOrGlobalEvents(long ptr ptr) +@ stdcall SeAuditingHardLinkEvents(long ptr) +@ stdcall SeAuditingHardLinkEventsWithContext(long ptr ptr) +@ stdcall SeCaptureSecurityDescriptor(ptr long long long ptr) +@ stdcall SeCaptureSubjectContext(ptr) +@ stdcall SeCloseObjectAuditAlarm(ptr ptr long) +@ stdcall SeCreateAccessState(ptr ptr long ptr) +@ stdcall SeCreateClientSecurity(ptr ptr long ptr) +@ stdcall SeCreateClientSecurityFromSubjectContext(ptr ptr long ptr) +@ stdcall SeDeassignSecurity(ptr) +@ stdcall SeDeleteAccessState(ptr) +@ stdcall SeDeleteObjectAuditAlarm(ptr ptr) +@ extern SeExports +@ stdcall SeFilterToken(ptr long ptr ptr ptr ptr) +@ stdcall SeFreePrivileges(ptr) +@ stdcall SeImpersonateClient(ptr ptr) +@ stdcall SeImpersonateClientEx(ptr ptr) +@ stdcall SeLockSubjectContext(ptr) +@ stdcall SeMarkLogonSessionForTerminationNotification(ptr) +@ stdcall SeOpenObjectAuditAlarm(ptr ptr ptr ptr ptr long long long ptr) +@ stdcall SeOpenObjectForDeleteAuditAlarm(ptr ptr ptr ptr ptr long long long ptr) +@ stdcall SePrivilegeCheck(ptr ptr long) +@ stdcall SePrivilegeObjectAuditAlarm(ptr ptr long ptr long long) +@ extern SePublicDefaultDacl +@ stdcall SeQueryAuthenticationIdToken(ptr ptr) +@ stdcall SeQueryInformationToken(ptr long ptr) +@ stdcall SeQuerySecurityDescriptorInfo(ptr ptr ptr ptr) +@ stdcall SeQuerySessionIdToken(ptr ptr) +@ stdcall SeRegisterLogonSessionTerminatedRoutine(ptr) +@ stdcall SeReleaseSecurityDescriptor(ptr long long) +@ stdcall SeReleaseSubjectContext(ptr) +@ stdcall SeSetAccessStateGenericMapping(ptr ptr) +;SeSetAuditParameter +@ stdcall SeSetSecurityDescriptorInfo(ptr ptr ptr ptr long ptr) +@ stdcall SeSetSecurityDescriptorInfoEx(ptr ptr ptr ptr long long ptr) +@ stdcall SeSinglePrivilegeCheck(long long long) +@ extern SeSystemDefaultDacl +@ stdcall SeTokenImpersonationLevel(ptr) +@ stdcall SeTokenIsAdmin(ptr) +@ stdcall SeTokenIsRestricted(ptr) +@ stdcall SeTokenIsWriteRestricted(ptr) +@ stdcall SeTokenType(ptr) +@ stdcall SeUnlockSubjectContext(ptr) +@ stdcall SeUnregisterLogonSessionTerminatedRoutine(ptr) +@ stdcall SeValidSecurityDescriptor(long ptr) +@ stdcall VerSetConditionMask(long long long long) +@ cdecl VfFailDeviceNode(ptr long long long ptr ptr ptr) +;VfFailDriver +@ cdecl VfFailSystemBIOS(long long long ptr ptr ptr) +@ stdcall VfIsVerificationEnabled(long ptr) +#ifndef __x86_64__ +@ stdcall WRITE_REGISTER_BUFFER_UCHAR(ptr ptr long) +@ stdcall WRITE_REGISTER_BUFFER_ULONG(ptr ptr long) +@ stdcall WRITE_REGISTER_BUFFER_USHORT(ptr ptr long) +@ stdcall WRITE_REGISTER_UCHAR(ptr long) +@ stdcall WRITE_REGISTER_ULONG(ptr long) +@ stdcall WRITE_REGISTER_USHORT(ptr long) +#endif +;WmiFlushTrace +;WmiGetClock +;WmiQueryTrace +@ stdcall WmiQueryTraceInformation(long ptr long ptr ptr) +;WmiStartTrace +;WmiStopTrace +;WmiTraceFastEvent +@ cdecl WmiTraceMessage() +@ stdcall WmiTraceMessageVa(double long ptr long long) +;WmiUpdateTrace +;XIPDispatch +@ stdcall ZwAccessCheckAndAuditAlarm(ptr ptr ptr ptr ptr long ptr long ptr ptr ptr) +@ stdcall ZwAddBootEntry(ptr long) +@ stdcall ZwAddDriverEntry(ptr long) +@ stdcall ZwAdjustPrivilegesToken(ptr long ptr long ptr ptr) +@ stdcall ZwAlertThread(ptr) +@ stdcall ZwAllocateVirtualMemory(ptr ptr long ptr long long) +@ stdcall ZwAssignProcessToJobObject(ptr ptr) +@ stdcall ZwCancelIoFile(ptr ptr) +@ stdcall ZwCancelTimer(ptr ptr) +@ stdcall ZwClearEvent(ptr) +@ stdcall ZwClose(ptr) +@ stdcall ZwCloseObjectAuditAlarm(ptr ptr long) +@ stdcall ZwConnectPort(ptr ptr ptr ptr ptr ptr ptr ptr) +@ stdcall ZwCreateDirectoryObject(ptr long ptr) +@ stdcall ZwCreateEvent(ptr long ptr long long) +@ stdcall ZwCreateFile(ptr long ptr ptr ptr long long long long ptr long) +@ stdcall ZwCreateJobObject(ptr long ptr) +@ stdcall ZwCreateKey(ptr long ptr long ptr long ptr) +@ stdcall ZwCreateSection(ptr long ptr ptr long long ptr) +@ stdcall ZwCreateSymbolicLinkObject(ptr long ptr ptr) +@ stdcall ZwCreateTimer(ptr long ptr long) +@ stdcall ZwDeleteBootEntry(long) +@ stdcall ZwDeleteDriverEntry(long) +@ stdcall ZwDeleteFile(ptr) +@ stdcall ZwDeleteKey(ptr) +@ stdcall ZwDeleteValueKey(ptr ptr) +@ stdcall ZwDeviceIoControlFile(ptr ptr ptr ptr ptr long ptr long ptr long) +@ stdcall ZwDisplayString(ptr) +@ stdcall ZwDuplicateObject(ptr ptr ptr ptr long long long) +@ stdcall ZwDuplicateToken(ptr long ptr long long ptr) +@ stdcall ZwEnumerateBootEntries(ptr ptr) +@ stdcall ZwEnumerateDriverEntries(ptr ptr) +@ stdcall ZwEnumerateKey(ptr long long ptr long ptr) +@ stdcall ZwEnumerateValueKey(ptr long long ptr long ptr) +@ stdcall ZwFlushInstructionCache(ptr ptr long) +@ stdcall ZwFlushKey(ptr) +@ stdcall ZwFlushVirtualMemory(ptr ptr ptr ptr) +@ stdcall ZwFreeVirtualMemory(ptr ptr ptr long) +@ stdcall ZwFsControlFile(ptr ptr ptr ptr ptr long ptr long ptr long) +@ stdcall ZwInitiatePowerAction(long long long long) +@ stdcall ZwIsProcessInJob(ptr ptr) +@ stdcall ZwLoadDriver(ptr) +@ stdcall ZwLoadKey(ptr ptr) +@ stdcall ZwMakeTemporaryObject(ptr) +@ stdcall ZwMapViewOfSection(ptr ptr ptr long long ptr ptr long long long) +@ stdcall ZwModifyBootEntry(ptr) +@ stdcall ZwModifyDriverEntry(ptr) +@ stdcall ZwNotifyChangeKey(ptr ptr ptr ptr ptr long long ptr long long) +@ stdcall ZwOpenDirectoryObject(ptr long ptr) +@ stdcall ZwOpenEvent(ptr long ptr) +@ stdcall ZwOpenFile(ptr long ptr ptr long long) +@ stdcall ZwOpenJobObject(ptr long ptr) +@ stdcall ZwOpenKey(ptr long ptr) +@ stdcall ZwOpenProcess(ptr long ptr ptr) +@ stdcall ZwOpenProcessToken(ptr long ptr) +@ stdcall ZwOpenProcessTokenEx(ptr long long ptr) +@ stdcall ZwOpenSection(ptr long ptr) +@ stdcall ZwOpenSymbolicLinkObject(ptr long ptr) +@ stdcall ZwOpenThread(ptr long ptr ptr) +@ stdcall ZwOpenThreadToken(ptr long long ptr) +@ stdcall ZwOpenThreadTokenEx(ptr long long long ptr) +@ stdcall ZwOpenTimer(ptr long ptr) +@ stdcall ZwPowerInformation(long ptr long ptr long) +@ stdcall ZwPulseEvent(ptr ptr) +@ stdcall ZwQueryBootEntryOrder(ptr ptr) +@ stdcall ZwQueryBootOptions(ptr ptr) +@ stdcall ZwQueryDefaultLocale(long ptr) +@ stdcall ZwQueryDefaultUILanguage(ptr) +@ stdcall ZwQueryDirectoryFile(ptr ptr ptr ptr ptr ptr long long long ptr long) +@ stdcall ZwQueryDirectoryObject(ptr ptr long long long ptr ptr) +@ stdcall ZwQueryDriverEntryOrder(ptr ptr) +@ stdcall ZwQueryEaFile(ptr ptr ptr long long ptr long ptr long) +@ stdcall ZwQueryFullAttributesFile(ptr ptr) +@ stdcall ZwQueryInformationAtom(ptr long ptr long ptr) +@ stdcall ZwQueryInformationFile(ptr ptr ptr long long) +@ stdcall ZwQueryInformationJobObject(ptr long ptr long ptr) +@ stdcall ZwQueryInformationProcess(ptr long ptr long ptr) +@ stdcall ZwQueryInformationThread(ptr long ptr long ptr) +@ stdcall ZwQueryInformationToken(ptr long long long ptr) +@ stdcall ZwQueryInstallUILanguage(ptr) +@ stdcall ZwQueryKey(ptr long ptr long ptr) +@ stdcall ZwQueryObject(ptr long ptr long ptr) +@ stdcall ZwQuerySection(ptr long ptr long ptr) +@ stdcall ZwQuerySecurityObject(ptr long ptr long ptr) +@ stdcall ZwQuerySymbolicLinkObject(ptr ptr ptr) +@ stdcall ZwQuerySystemInformation(long ptr long ptr) +@ stdcall ZwQueryValueKey(ptr ptr long ptr long ptr) +@ stdcall ZwQueryVolumeInformationFile(ptr ptr ptr long long) +@ stdcall ZwReadFile(ptr ptr ptr ptr ptr ptr long ptr ptr) +@ stdcall ZwReplaceKey(ptr ptr ptr) +@ stdcall ZwRequestWaitReplyPort(ptr ptr ptr) +@ stdcall ZwResetEvent(ptr ptr) +@ stdcall ZwRestoreKey(ptr ptr long) +@ stdcall ZwSaveKey(ptr ptr) +@ stdcall ZwSaveKeyEx(ptr ptr long) +@ stdcall ZwSecureConnectPort(ptr ptr ptr ptr ptr ptr ptr ptr ptr) +@ stdcall ZwSetBootEntryOrder(ptr ptr) +@ stdcall ZwSetBootOptions(ptr long) +@ stdcall ZwSetDefaultLocale(long long) +@ stdcall ZwSetDefaultUILanguage(long) +@ stdcall ZwSetDriverEntryOrder(ptr ptr) +@ stdcall ZwSetEaFile(ptr ptr ptr long) +@ stdcall ZwSetEvent(ptr ptr) +@ stdcall ZwSetInformationFile(ptr ptr ptr long long) +@ stdcall ZwSetInformationJobObject(ptr long ptr long) +@ stdcall ZwSetInformationObject(ptr long ptr long) +@ stdcall ZwSetInformationProcess(ptr long ptr long) +@ stdcall ZwSetInformationThread(ptr long ptr long) +@ stdcall ZwSetSecurityObject(ptr long ptr) +@ stdcall ZwSetSystemInformation(long ptr long) +@ stdcall ZwSetSystemTime(ptr ptr) +@ stdcall ZwSetTimer(ptr ptr ptr ptr long long ptr) +@ stdcall ZwSetValueKey(ptr ptr long long ptr long) +@ stdcall ZwSetVolumeInformationFile(ptr ptr ptr long long) +@ stdcall ZwTerminateJobObject(ptr long) +@ stdcall ZwTerminateProcess(ptr long) +@ stdcall ZwTranslateFilePath(ptr long ptr long) +@ stdcall ZwUnloadDriver(ptr) +@ stdcall ZwUnloadKey(ptr) +@ stdcall ZwUnmapViewOfSection(ptr ptr) +@ stdcall ZwWaitForMultipleObjects(long ptr long long ptr) +@ stdcall ZwWaitForSingleObject(ptr long ptr) +@ stdcall ZwWriteFile(ptr ptr ptr ptr ptr ptr long ptr ptr) +@ stdcall ZwYieldExecution() +;_CIcos +;_CIsin +;_CIsqrt +#ifndef __x86_64 +@ cdecl _abnormal_termination() +#endif +@ cdecl -arch=i386 _alldiv() +@ cdecl -arch=i386 _alldvrm() +@ cdecl -arch=i386 _allmul() +@ cdecl -arch=i386 _alloca_probe() +@ cdecl -arch=i386 _allrem() +@ cdecl -arch=i386 _allshl() +@ cdecl -arch=i386 _allshr() +@ cdecl -arch=i386 _aulldiv() +@ cdecl -arch=i386 _aulldvrm() +@ cdecl -arch=i386 _aullrem() +@ cdecl -arch=i386 _aullshr() +#ifndef __x86_64 +@ cdecl _except_handler2() +@ cdecl _except_handler3() +@ cdecl _global_unwind2() +#endif +@ cdecl _itoa() +@ cdecl _itow() +#ifndef __x86_64 +@ cdecl _local_unwind2() +#endif +@ cdecl _purecall() +@ cdecl _snprintf() +@ cdecl _snwprintf() +@ cdecl _stricmp() +@ cdecl _strlwr() +@ cdecl _strnicmp() +@ cdecl _strnset() +@ cdecl _strrev() +@ cdecl _strset() +@ cdecl _strupr() +@ cdecl _vsnprintf() +@ cdecl _vsnwprintf() +@ cdecl _wcsicmp() +@ cdecl _wcslwr() +@ cdecl _wcsnicmp() +@ cdecl _wcsnset() +@ cdecl _wcsrev() +@ cdecl _wcsupr() +@ cdecl atoi() +@ cdecl atol() +@ cdecl isdigit() +@ cdecl islower() +@ cdecl isprint() +@ cdecl isspace() +@ cdecl isupper() +@ cdecl isxdigit() +@ cdecl mbstowcs() +@ cdecl mbtowc() +@ cdecl memchr() +@ cdecl memcpy() +@ cdecl memmove() +@ cdecl memset() +@ cdecl qsort() +@ cdecl rand() +@ cdecl sprintf() +@ cdecl srand() +@ cdecl strcat() +@ cdecl strchr() +@ cdecl strcmp() +@ cdecl strcpy() +@ cdecl strlen() +@ cdecl strncat() +@ cdecl strncmp() +@ cdecl strncpy() +@ cdecl strrchr() +@ cdecl strspn() +@ cdecl strstr() +@ cdecl swprintf() +@ cdecl tolower() +@ cdecl toupper() +@ cdecl towlower() +@ cdecl towupper() +@ stdcall vDbgPrintEx(long long str ptr) +@ stdcall vDbgPrintExWithPrefix(str long long str ptr) +@ cdecl vsprintf() +@ cdecl wcscat() +@ cdecl wcschr() +@ cdecl wcscmp() +@ cdecl wcscpy() +@ cdecl wcscspn() +@ cdecl wcslen() +@ cdecl wcsncat() +@ cdecl wcsncmp() +@ cdecl wcsncpy() +@ cdecl wcsrchr() +@ cdecl wcsspn() +@ cdecl wcsstr() +@ cdecl wcstombs() +@ cdecl wctomb() diff --git a/ntoskrnl/ntoskrnl.rbuild b/ntoskrnl/ntoskrnl.rbuild new file mode 100644 index 00000000000..0de9334ffc2 --- /dev/null +++ b/ntoskrnl/ntoskrnl.rbuild @@ -0,0 +1,11 @@ + + + + + + + + include + ntdll.S + + diff --git a/ntoskrnl/ntoskrnl.spec b/ntoskrnl/ntoskrnl.spec index 021abac3809..c60c30cbb40 100644 --- a/ntoskrnl/ntoskrnl.spec +++ b/ntoskrnl/ntoskrnl.spec @@ -305,7 +305,7 @@ @ extern HalDispatchTable _HalDispatchTable @ fastcall HalExamineMBR(ptr long long ptr) @ extern HalPrivateDispatchTable -;HeadlessDispatch +@ stdcall HeadlessDispatch(long ptr long ptr ptr) @ stdcall InbvAcquireDisplayOwnership() @ stdcall InbvCheckDisplayOwnership() @ stdcall InbvDisplayString(str) diff --git a/ntoskrnl/ntoskrnl_i386.lnk b/ntoskrnl/ntoskrnl_i386.lnk index 8dac6c10fc1..788cda743c1 100644 --- a/ntoskrnl/ntoskrnl_i386.lnk +++ b/ntoskrnl/ntoskrnl_i386.lnk @@ -44,6 +44,13 @@ SECTIONS { *(.edata) } + /DISCARD/ : + { + *(.debug$S) + *(.debug$T) + *(.debug$F) + *(.drectve) + } .idata BLOCK(__section_alignment__) : { @@ -80,41 +87,13 @@ SECTIONS /* These zeroes mark the end of the reloc section. */ LONG (0); LONG (0); LONG (0); LONG (0); LONG (0); } - .debug_aranges BLOCK(__section_alignment__) : + .stab BLOCK(__section_alignment__) (NOLOAD) : { - *(.debug_aranges) + [ .stab ] } - .debug_abbrev BLOCK(__section_alignment__) : + .stabstr BLOCK(__section_alignment__) (NOLOAD) : { - *(.debug_abbrev) - } - .debug_frame BLOCK(__section_alignment__) : - { - *(.debug_frame) - } - .debug_info BLOCK(__section_alignment__) : - { - *(.debug_info) - } - .debug_line BLOCK(__section_alignment__) : - { - *(.debug_line) - } - .debug_loc BLOCK(__section_alignment__) : - { - *(.debug_loc) - } - .debug_pubnames BLOCK(__section_alignment__) : - { - *(.debug_pubnames) - } - .debug_ranges BLOCK(__section_alignment__) : - { - *(.debug_ranges) - } - .debug_str BLOCK(__section_alignment__) : - { - *(.debug_str) + [ .stabstr ] } INIT BLOCK(__section_alignment__) : { diff --git a/proxy.mak b/proxy.mak new file mode 100644 index 00000000000..fe9ce809f80 --- /dev/null +++ b/proxy.mak @@ -0,0 +1,21 @@ +MAKEFLAGS += --no-print-directory + +$(DEFAULT): + @$(MAKE) -C $(TOP) $(DEFAULT) + +all: + @$(MAKE) -C $(TOP) all + +depends: + @$(MAKE) -C $(TOP) $(DEFAULT)_depends + +install: + @$(MAKE) -C $(TOP) $(DEFAULT)_install + +clean: + @$(MAKE) -C $(TOP) $(DEFAULT)_clean + +test: + @$(MAKE) -C $(TOP) $(DEFAULT)_test + +$(DEFAULT)_clean: clean diff --git a/subsystems/csr/csr.rbuild b/subsystems/csr/csr.rbuild new file mode 100644 index 00000000000..aec8f30fbab --- /dev/null +++ b/subsystems/csr/csr.rbuild @@ -0,0 +1,15 @@ + + + + + . + include/reactos/subsys + nt + ntdll + csrsrv + main.c + + + + + diff --git a/subsystems/csr/csrsrv/csrsrv.rbuild b/subsystems/csr/csrsrv/csrsrv.rbuild new file mode 100644 index 00000000000..3a215fda8a8 --- /dev/null +++ b/subsystems/csr/csrsrv/csrsrv.rbuild @@ -0,0 +1,18 @@ + + + + + . + . + include/reactos/subsys + ntdll + pseh + api.c + init.c + process.c + server.c + session.c + thread.c + wait.c + srv.h + diff --git a/subsystems/ntvdm/ntvdm.rbuild b/subsystems/ntvdm/ntvdm.rbuild new file mode 100644 index 00000000000..24cd31e358c --- /dev/null +++ b/subsystems/ntvdm/ntvdm.rbuild @@ -0,0 +1,11 @@ + + + + . + ntdll + user32 + gdi32 + advapi32 + ntvdm.c + ntvdm.rc + diff --git a/subsystems/subsystems.rbuild b/subsystems/subsystems.rbuild new file mode 100644 index 00000000000..ad9def61d63 --- /dev/null +++ b/subsystems/subsystems.rbuild @@ -0,0 +1,12 @@ + + + + + + + + + + + + diff --git a/subsystems/win/basesrv/basesrv.rbuild b/subsystems/win/basesrv/basesrv.rbuild new file mode 100644 index 00000000000..92ea53c2e87 --- /dev/null +++ b/subsystems/win/basesrv/basesrv.rbuild @@ -0,0 +1,13 @@ + + + + + . + include + ntdll + csrsrv + main.c + init.c + server.c + basesrv.rc + diff --git a/subsystems/win/directory.rbuild b/subsystems/win/directory.rbuild new file mode 100644 index 00000000000..d7db9ccd360 --- /dev/null +++ b/subsystems/win/directory.rbuild @@ -0,0 +1,10 @@ + + + + + + + + + + diff --git a/subsystems/win/winsrv/winsrv.rbuild b/subsystems/win/winsrv/winsrv.rbuild new file mode 100644 index 00000000000..7d681c98f73 --- /dev/null +++ b/subsystems/win/winsrv/winsrv.rbuild @@ -0,0 +1,15 @@ + + + + + . + include + ntdll + csrsrv + user32 + gdi32 + dllmain.c + init.c + server.c + winsrv.rc + diff --git a/subsystems/win32/csrss/csrsrv/csrsrv.rbuild b/subsystems/win32/csrss/csrsrv/csrsrv.rbuild new file mode 100644 index 00000000000..c7b9b53acff --- /dev/null +++ b/subsystems/win32/csrss/csrsrv/csrsrv.rbuild @@ -0,0 +1,21 @@ + + + + + . + . + include + include/reactos/subsys + ntdll + pseh + smdll + + process.c + user.c + wapi.c + + procsup.c + thredsup.c + init.c + srv.h + diff --git a/subsystems/win32/csrss/csrss.rbuild b/subsystems/win32/csrss/csrss.rbuild new file mode 100644 index 00000000000..43f87773d8d --- /dev/null +++ b/subsystems/win32/csrss/csrss.rbuild @@ -0,0 +1,21 @@ + + + + + . + include + include/reactos/subsys + include/reactos/drivers + nt + ntdll + csrsrv + csrss.c + csrss.rc + + + + + + + + diff --git a/subsystems/win32/csrss/win32csr/win32csr.rbuild b/subsystems/win32/csrss/win32csr/win32csr.rbuild new file mode 100644 index 00000000000..783ebed027f --- /dev/null +++ b/subsystems/win32/csrss/win32csr/win32csr.rbuild @@ -0,0 +1,33 @@ + + + + + . + include + include/reactos/subsys + include/reactos/drivers + . + ntdll + user32 + gdi32 + advapi32 + delayimp + win32ksys + psapi + pseh + w32csr.h + alias.c + coninput.c + conoutput.c + console.c + desktopbg.c + dllmain.c + exitros.c + file.c + guiconsole.c + handle.c + harderror.c + lineinput.c + tuiconsole.c + win32csr.rc + diff --git a/subsystems/win32/win32.rbuild b/subsystems/win32/win32.rbuild new file mode 100644 index 00000000000..7dc498f28dd --- /dev/null +++ b/subsystems/win32/win32.rbuild @@ -0,0 +1,10 @@ + + + + + + + + + + diff --git a/subsystems/win32/win32k/win32k.pspec b/subsystems/win32/win32k/win32k.pspec new file mode 100644 index 00000000000..89a895e48ac --- /dev/null +++ b/subsystems/win32/win32k/win32k.pspec @@ -0,0 +1,229 @@ +#include "include/reactos/msvctarget.h" +#undef i386 + +@ stdcall -arch=i386 FLOATOBJ_AddFloatObj(ptr ptr) FLOATOBJ_Add +@ stdcall -arch=i386 FLOATOBJ_DivFloatObj(ptr ptr) FLOATOBJ_Div +@ stdcall -arch=i386 FLOATOBJ_MulFloatObj(ptr ptr) FLOATOBJ_Mul +@ stdcall -arch=i386 FLOATOBJ_SubFloatObj(ptr ptr) FLOATOBJ_Sub +@ stdcall BRUSHOBJ_hGetColorTransform(ptr) +@ stdcall BRUSHOBJ_pvAllocRbrush(ptr long) +@ stdcall BRUSHOBJ_pvGetRbrush(ptr) +@ stdcall BRUSHOBJ_ulGetBrushColor(ptr) +@ stdcall CLIPOBJ_bEnum(ptr long ptr) +@ stdcall CLIPOBJ_cEnumStart(ptr long long long long) +@ stdcall CLIPOBJ_ppoGetPath(ptr) +@ stdcall EngAcquireSemaphore(ptr) +@ stdcall EngAllocMem(long long long) +@ stdcall EngAllocPrivateUserMem(ptr ptr long) +@ stdcall EngAllocSectionMem(ptr long ptr long) +@ stdcall EngAllocUserMem(ptr long) +@ stdcall EngAlphaBlend(ptr ptr ptr ptr ptr ptr ptr) +@ stdcall EngAssociateSurface(ptr ptr long) +@ stdcall EngBitBlt(ptr ptr ptr ptr ptr ptr ptr ptr ptr ptr long) +@ stdcall EngBugCheckEx(long ptr ptr ptr ptr) NTOSKRNL.KeBugCheckEx +@ stdcall EngCheckAbort(ptr) +@ stdcall EngClearEvent(ptr) +@ stdcall EngComputeGlyphSet(long long long) +@ stdcall EngControlSprites(ptr long) +@ stdcall EngCopyBits(ptr ptr ptr ptr ptr ptr) +@ stdcall EngCreateBitmap(long long long long long ptr) +@ stdcall EngCreateClip() +@ stdcall EngCreateDeviceBitmap(ptr long long long) +@ stdcall EngCreateDeviceSurface(ptr long long long) +@ stdcall EngCreateDriverObj(ptr ptr ptr) +@ stdcall EngCreateEvent(ptr) +@ stdcall EngCreatePalette(long long long long long long) +@ stdcall EngCreatePath() +@ stdcall EngCreateSemaphore() +@ stdcall EngCreateWnd(ptr ptr ptr long long) +@ stdcall EngDebugBreak() NTOSKRNL.DbgBreakPoint +@ stdcall EngDebugPrint(ptr ptr ptr) +@ stdcall EngDeleteClip(ptr) +@ stdcall EngDeleteDriverObj(ptr long long) +@ stdcall EngDeleteEvent(ptr) +@ stdcall EngDeleteFile(ptr) +@ stdcall EngDeletePalette(ptr) +@ stdcall EngDeletePath(ptr) +@ stdcall EngDeleteSafeSemaphore(ptr) +@ stdcall EngDeleteSemaphore(ptr) +@ stdcall EngDeleteSurface(ptr) +@ stdcall EngDeleteWnd(ptr) +@ stdcall EngDeviceIoControl(ptr long ptr long ptr long ptr) +@ stdcall EngDitherColor(ptr long long long) +@ stdcall EngDxIoctl(long ptr long) +@ stdcall EngEnumForms(ptr long ptr long ptr ptr) +@ stdcall EngEraseSurface(ptr ptr long) +@ stdcall EngFileIoControl(ptr long ptr ptr ptr ptr ptr) +@ stdcall EngFileWrite(ptr ptr ptr ptr) +@ stdcall EngFillPath(ptr ptr ptr ptr ptr long long) +@ stdcall EngFindImageProcAddress(ptr ptr) +@ stdcall EngFindResource(ptr long long ptr) +@ stdcall EngFntCacheAlloc(long long) +@ stdcall EngFntCacheFault(long long) +@ stdcall EngFntCacheLookUp(long ptr) +@ stdcall EngFreeMem(ptr) +@ stdcall EngFreeModule(ptr) +@ stdcall EngFreePrivateUserMem(ptr ptr) +@ stdcall EngFreeSectionMem(ptr ptr) +@ stdcall EngFreeUserMem(ptr) +@ stdcall EngGetCurrentCodePage(ptr ptr) +@ stdcall EngGetCurrentProcessId() NTOSKRNL.PsGetCurrentProcessId +@ stdcall EngGetCurrentThreadId() NTOSKRNL.PsGetCurrentThreadId +@ stdcall EngGetDriverName(ptr) +@ stdcall EngGetFileChangeTime(ptr ptr) +@ stdcall EngGetFilePath(ptr ptr) +@ stdcall EngGetForm(ptr ptr long ptr long ptr) +@ stdcall EngGetLastError() +@ stdcall EngGetPrinter(ptr long ptr long ptr) +@ stdcall EngGetPrinterData(ptr ptr ptr ptr long ptr) +@ stdcall EngGetPrinterDataFileName(ptr) +@ stdcall EngGetPrinterDriver(ptr ptr long ptr long ptr) +@ stdcall EngGetProcessHandle() +@ stdcall EngGetTickCount() +@ stdcall EngGetType1FontList(ptr ptr long ptr ptr ptr) +@ stdcall EngGradientFill(ptr ptr ptr ptr long ptr long ptr ptr long) +@ stdcall EngHangNotification(ptr ptr) +@ stdcall EngInitializeSafeSemaphore(ptr) +@ stdcall EngIsSemaphoreOwned(ptr) +@ stdcall EngIsSemaphoreOwnedByCurrentThread(ptr) +@ stdcall EngLineTo(ptr ptr ptr long long long long ptr long) +@ stdcall EngLoadImage(ptr) +@ stdcall EngLoadModule(ptr) +@ stdcall EngLoadModuleForWrite(ptr long) +@ stdcall EngLockDirectDrawSurface(ptr) +@ stdcall EngLockDriverObj(ptr) +@ stdcall EngLockSurface(ptr) +@ stdcall EngLpkInstalled() +@ stdcall EngMapEvent(ptr ptr ptr ptr ptr) +@ stdcall EngMapFile(ptr long ptr) +@ stdcall EngMapFontFile(ptr ptr ptr) +@ stdcall EngMapFontFileFD(ptr ptr ptr) +@ stdcall EngMapModule(ptr ptr) +@ stdcall EngMapSection(ptr long ptr ptr) +@ stdcall EngMarkBandingSurface(ptr) +@ stdcall EngModifySurface(ptr ptr long long ptr ptr long ptr) +@ stdcall EngMovePointer(ptr long long ptr) +@ stdcall EngMulDiv(long long long) +@ stdcall EngMultiByteToUnicodeN(ptr long ptr ptr long) NTOSKRNL.RtlMultiByteToUnicodeN +@ stdcall EngMultiByteToWideChar(long ptr long ptr long) +@ stdcall EngNineGrid(ptr ptr ptr ptr ptr ptr ptr ptr ptr) +@ stdcall EngPaint(ptr ptr ptr ptr long) +@ stdcall EngPlgBlt(ptr ptr ptr ptr ptr ptr ptr ptr ptr ptr long) +@ stdcall EngProbeForRead(ptr long long) NTOSKRNL.ProbeForRead +@ stdcall EngProbeForReadAndWrite(ptr long long) NTOSKRNL.ProbeForWrite +@ stdcall EngQueryDeviceAttribute(ptr long ptr long ptr long) +@ stdcall EngQueryFileTimeStamp(ptr) +@ stdcall EngQueryLocalTime(ptr) +@ stdcall EngQueryPalette(ptr ptr long ptr) +@ stdcall EngQueryPerformanceCounter(ptr) +@ stdcall EngQueryPerformanceFrequency(ptr) +@ stdcall EngQuerySystemAttribute(long ptr) +@ stdcall EngReadStateEvent(ptr) +@ stdcall EngReleaseSemaphore(ptr) +@ stdcall EngRestoreFloatingPointState(ptr) +@ stdcall EngSaveFloatingPointState(ptr long) +@ stdcall EngSecureMem(ptr long) +@ stdcall EngSetEvent(ptr) +@ stdcall EngSetLastError(long) +@ stdcall EngSetPointerShape(ptr ptr ptr ptr long long long long ptr long) +@ stdcall EngSetPointerTag(ptr ptr ptr ptr long) +@ stdcall EngSetPrinterData(ptr ptr long ptr long) +@ stdcall EngSort(ptr long long ptr) +@ stdcall EngStretchBlt(ptr ptr ptr ptr ptr long long ptr ptr ptr long) +@ stdcall EngStretchBltROP(ptr ptr ptr ptr ptr long long ptr ptr ptr long ptr long) +@ stdcall EngStrokeAndFillPath(ptr ptr ptr ptr ptr ptr ptr ptr long long) +@ stdcall EngStrokePath(ptr ptr ptr ptr ptr ptr ptr long) +@ stdcall EngTextOut(ptr ptr ptr ptr ptr ptr ptr ptr ptr long) +@ stdcall EngTransparentBlt(ptr ptr ptr ptr ptr ptr long long) +@ stdcall EngUnicodeToMultiByteN(ptr long ptr ptr long) NTOSKRNL.RtlUnicodeToMultiByteN +@ stdcall EngUnloadImage(ptr) +@ stdcall EngUnlockDirectDrawSurface(ptr) +@ stdcall EngUnlockDriverObj(ptr) +@ stdcall EngUnlockSurface(ptr) +@ stdcall EngUnmapEvent(ptr) +@ stdcall EngUnmapFile(ptr) +@ stdcall EngUnmapFontFile(ptr) +@ stdcall EngUnmapFontFileFD(ptr) +@ stdcall EngUnsecureMem(ptr) +@ stdcall EngWaitForSingleObject(ptr ptr) +@ stdcall EngWideCharToMultiByte(long ptr long ptr long) +@ stdcall EngWritePrinter(ptr ptr long ptr) +@ stdcall -arch=i386 FLOATOBJ_Add(ptr ptr) +@ stdcall -arch=i386 FLOATOBJ_AddFloat(ptr long) +@ stdcall -arch=i386 FLOATOBJ_AddLong(ptr long) +@ stdcall -arch=i386 FLOATOBJ_Div(ptr ptr) +@ stdcall -arch=i386 FLOATOBJ_DivFloat(ptr long) +@ stdcall -arch=i386 FLOATOBJ_DivLong(ptr long) +@ stdcall -arch=i386 FLOATOBJ_Equal(ptr ptr) +@ stdcall -arch=i386 FLOATOBJ_EqualLong(ptr long) +@ stdcall -arch=i386 FLOATOBJ_GetFloat(ptr) +@ stdcall -arch=i386 FLOATOBJ_GetLong(ptr) +@ stdcall -arch=i386 FLOATOBJ_GreaterThan(ptr ptr) +@ stdcall -arch=i386 FLOATOBJ_GreaterThanLong(ptr long) +@ stdcall -arch=i386 FLOATOBJ_LessThan(ptr ptr) +@ stdcall -arch=i386 FLOATOBJ_LessThanLong(ptr long) +@ stdcall -arch=i386 FLOATOBJ_Mul(ptr ptr) +@ stdcall -arch=i386 FLOATOBJ_MulFloat(ptr long) +@ stdcall -arch=i386 FLOATOBJ_MulLong(ptr long) +@ stdcall -arch=i386 FLOATOBJ_Neg(ptr) +@ stdcall -arch=i386 FLOATOBJ_SetFloat(ptr long) +@ stdcall -arch=i386 FLOATOBJ_SetLong(ptr long) +@ stdcall -arch=i386 FLOATOBJ_Sub(ptr ptr) +@ stdcall -arch=i386 FLOATOBJ_SubFloat(ptr long) +@ stdcall -arch=i386 FLOATOBJ_SubLong(ptr long) +@ stdcall FONTOBJ_cGetAllGlyphHandles(ptr ptr) +@ stdcall FONTOBJ_cGetGlyphs(ptr long long ptr ptr) +@ stdcall FONTOBJ_pQueryGlyphAttrs(ptr long) +@ stdcall FONTOBJ_pfdg(ptr) +@ stdcall FONTOBJ_pifi(ptr) +@ stdcall FONTOBJ_pjOpenTypeTablePointer(ptr long ptr) +@ stdcall FONTOBJ_pvTrueTypeFontFile(ptr ptr) +@ stdcall FONTOBJ_pwszFontFilePaths(ptr ptr) +@ stdcall FONTOBJ_pxoGetXform(ptr) +@ stdcall FONTOBJ_vGetInfo(ptr long ptr) +@ stdcall HT_ComputeRGBGammaTable(long long long long long ptr) +@ stdcall HT_Get8BPPFormatPalette(ptr long long long) +@ stdcall HT_Get8BPPMaskPalette(ptr long long long long long) +@ stdcall HeapVidMemAllocAligned(ptr long long ptr ptr) +@ stdcall PALOBJ_cGetColors(ptr long long ptr) +@ stdcall PATHOBJ_bCloseFigure(ptr) +@ stdcall PATHOBJ_bEnum(ptr ptr) +@ stdcall PATHOBJ_bEnumClipLines(ptr long ptr) +@ stdcall PATHOBJ_bMoveTo(ptr long long) +@ stdcall PATHOBJ_bPolyBezierTo(ptr ptr long) +@ stdcall PATHOBJ_bPolyLineTo(ptr ptr long) +@ stdcall PATHOBJ_vEnumStart(ptr) +@ stdcall PATHOBJ_vEnumStartClipLines(ptr ptr ptr ptr) +@ stdcall PATHOBJ_vGetBounds(ptr ptr) +@ stdcall RtlAnsiCharToUnicodeChar(ptr) NTOSKRNL.RtlAnsiCharToUnicodeChar +@ stdcall RtlMultiByteToUnicodeN(ptr long ptr ptr long) NTOSKRNL.RtlMultiByteToUnicodeN +@ stdcall RtlRaiseException(ptr) NTOSKRNL.RtlRaiseException +@ stdcall RtlUnicodeToMultiByteN(ptr long ptr ptr long) NTOSKRNL.RtlUnicodeToMultiByteN +@ stdcall RtlUnicodeToMultiByteSize(ptr ptr long) NTOSKRNL.RtlUnicodeToMultiByteSize +@ stdcall RtlUnwind(ptr ptr ptr ptr) NTOSKRNL.RtlUnwind +@ stdcall RtlUpcaseUnicodeChar(long) NTOSKRNL.RtlUpcaseUnicodeChar +@ stdcall RtlUpcaseUnicodeToMultiByteN(ptr long ptr ptr long) NTOSKRNL.RtlUpcaseUnicodeToMultiByteN +@ stdcall STROBJ_bEnum(ptr ptr ptr) +@ stdcall STROBJ_bEnumPositionsOnly(ptr ptr ptr) +@ stdcall STROBJ_bGetAdvanceWidths(ptr long long ptr) +@ stdcall STROBJ_dwGetCodePage(ptr) +@ stdcall STROBJ_fxBreakExtra(ptr) +@ stdcall STROBJ_fxCharacterExtra(ptr) +@ stdcall STROBJ_vEnumStart(ptr) +@ stdcall VidMemFree(ptr ptr) +@ stdcall WNDOBJ_bEnum(ptr long ptr) +@ stdcall WNDOBJ_cEnumStart(ptr long long long) +@ stdcall WNDOBJ_vSetConsumer(ptr ptr) +@ stdcall XFORMOBJ_bApplyXform(ptr long long ptr ptr) EXFORMOBJ_bApplyXform +@ stdcall XFORMOBJ_iGetFloatObjXform(ptr ptr) EXFORMOBJ_iGetFloatObjXform +@ stdcall XFORMOBJ_iGetXform(ptr ptr) EXFORMOBJ_iGetXform +@ stdcall XLATEOBJ_cGetPalette(ptr long long ptr) +@ stdcall XLATEOBJ_hGetColorTransform(ptr) +@ stdcall XLATEOBJ_iXlate(ptr long) +@ stdcall XLATEOBJ_piVector(ptr) +@ cdecl _abnormal_termination() NTOSKRNL._abnormal_termination +@ cdecl _except_handler2() NTOSKRNL._except_handler2 +@ cdecl _global_unwind2() NTOSKRNL._global_unwind2 +@ cdecl _itoa() NTOSKRNL._itoa +@ cdecl _itow() NTOSKRNL._itow +@ cdecl _local_unwind2() NTOSKRNL._local_unwind2 diff --git a/subsystems/win32/win32k/win32k.rbuild b/subsystems/win32/win32k/win32k.rbuild new file mode 100644 index 00000000000..5be2e9422c4 --- /dev/null +++ b/subsystems/win32/win32k/win32k.rbuild @@ -0,0 +1,212 @@ + + + + + + pseh + ntoskrnl + hal + ftfd + dxguid + win32k.rc + . + include + . + include + include + include/reactos/subsys + include/reactos/drivers + /wd4276 + + + pch.h + + + dib8gen.c + dib16gen.c + dib32gen.c + + + + dib1bpp.c + dib4bpp.c + dib8bpp.c + dib16bpp.c + dib24bpp.c + dib32bpp.c + dib.c + floodfill.c + stretchblt.c + alphablend.c + + + + dib24bpp_hline.s + dib32bpp_hline.s + dib32bpp_colorfill.s + + + + dib24bppc.c + dib32bppc.c + + + + alphablend.c + bitblt.c + engbrush.c + engevent.c + clip.c + copybits.c + debug.c + device.c + driverobj.c + error.c + float.c + + + floatobj.S + + + gradient.c + ldevobj.c + lineto.c + mapping.c + mem.c + engmisc.c + mouse.c + paint.c + pdevobj.c + perfcnt.c + rlecomp.c + semaphor.c + sort.c + string.c + stretchblt.c + surface.c + transblt.c + engwindow.c + xlate.c + + + dllmain.c + + + driver.c + file.c + math.c + rtlstr.c + copy.c + registry.c + usrheap.c + + + cos_asm.s + sin_asm.s + atan2_asm.s + floor_asm.s + ceil_asm.s + + + + + ddraw.c + dd.c + ddsurf.c + d3d.c + dvp.c + mocomp.c + eng.c + dxeng.c + + + accelerator.c + callback.c + callproc.c + caret.c + class.c + clipboard.c + csr.c + cursoricon.c + defwnd.c + desktop.c + display.c + event.c + focus.c + guicheck.c + hook.c + hotkey.c + input.c + keyboard.c + kbdlayout.c + menu.c + message.c + metric.c + misc.c + monitor.c + msgqueue.c + ntstubs.c + ntuser.c + painting.c + prop.c + scrollbar.c + session.c + simplecall.c + sysparams.c + timer.c + useratom.c + vis.c + windc.c + window.c + winpos.c + winsta.c + object.c + + + arc.c + bezier.c + bitblt.c + bitmaps.c + brush.c + cliprgn.c + coord.c + dcattr.c + dclife.c + dcobjs.c + dcstate.c + dcutil.c + device.c + dibobj.c + drawing.c + fillshap.c + font.c + freetype.c + gdibatch.c + gdidbg.c + gdiobj.c + gdipool.c + icm.c + line.c + metafile.c + palette.c + path.c + pen.c + polyfill.c + print.c + rect.c + region.c + stockobj.c + text.c + wingl.c + xformobj.c + + + stubs.c + umpdstubs.c + + + + include/reactos + sys-stubs.S + + diff --git a/tools/bin2c.mak b/tools/bin2c.mak new file mode 100644 index 00000000000..2236efe89df --- /dev/null +++ b/tools/bin2c.mak @@ -0,0 +1,36 @@ +BIN2C_BASE = $(TOOLS_BASE) +BIN2C_BASE_ = $(BIN2C_BASE)$(SEP) + +BIN2C_INT = $(INTERMEDIATE_)$(BIN2C_BASE) +BIN2C_INT_ = $(BIN2C_INT)$(SEP) +BIN2C_OUT = $(OUTPUT_)$(BIN2C_BASE) +BIN2C_OUT_ = $(BIN2C_OUT)$(SEP) + +BIN2C_TARGET = \ + $(BIN2C_OUT_)bin2c$(EXEPOSTFIX) + +BIN2C_SOURCES = \ + $(BIN2C_BASE_)bin2c.c + +BIN2C_OBJECTS = \ + $(addprefix $(INTERMEDIATE_), $(BIN2C_SOURCES:.c=.o)) + +BIN2C_HOST_CFLAGS = $(TOOLS_CFLAGS) + +BIN2C_HOST_LFLAGS = $(TOOLS_LFLAGS) + +.PHONY: bin2c +bin2c: $(BIN2C_TARGET) + +$(BIN2C_TARGET): $(BIN2C_OBJECTS) | $(BIN2C_OUT) + $(ECHO_HOSTLD) + ${host_gcc} $(BIN2C_OBJECTS) $(BIN2C_HOST_LFLAGS) -o $@ + +$(BIN2C_INT_)bin2c.o: $(BIN2C_BASE_)bin2c.c | $(BIN2C_INT) + $(ECHO_HOSTCC) + ${host_gcc} $(BIN2C_HOST_CFLAGS) -c $< -o $@ + +.PHONY: bin2c_clean +bin2c_clean: + -@$(rm) $(BIN2C_TARGET) $(BIN2C_OBJECTS) 2>$(NUL) +clean: bin2c_clean diff --git a/tools/buildno/buildno.cpp b/tools/buildno/buildno.cpp new file mode 100644 index 00000000000..f211163b437 --- /dev/null +++ b/tools/buildno/buildno.cpp @@ -0,0 +1,421 @@ +/* + * buildno - Generate the build number for ReactOS + * + * Copyright (c) 1999,2000 Emanuele Aliberti + * Copyright (c) 2006 Christoph von Wittich + * Copyright (c) 2008 Hervé Poussineau + * + * The build number is the day on which the build took + * place, as YYYYMMDD + * + * The build number is stored in the output file as a set of macros + * + * REVISIONS + * --------- + * 2008-01-12 (hpoussin) + * Add -t option to change the build tag + * 2006-09-09 (cwittich) + * Read binary entries files from SVN 1.4.x + * 2000-01-22 (ea) + * Fixed bugs: tm_year is (current_year - 1900), + * tm_month is 0-11 not 1-12 and code ignored TZ. + * 2000-12-10 (ea) + * Added -p option to make it simply print the + * version number, but skip buildno.h generation. + */ +#include +#include +#include +#include +#include "version.h" +#include "xml.h" + +#define FALSE 0 +#define TRUE 1 + +static const char * argv0 = ""; +static char * filename = NULL; +static char * build_tag = NULL; + +int count_wide_string( const wchar_t *str ) +{ + int i; + for( i = 0; str[i]; i++ ) + ; + return i; +} + +long +GetRev(char *Revision, size_t length) +{ + long revno = 0; + char *p; + + FILE *fp = NULL; + fp = fopen(".svn/entries", "r"); + if (fp != NULL) + { + if (fgets(Revision, length, fp) != NULL) + { + /* If the first character of the file is not a digit, + then it is probably in XML format. */ + if (isdigit(Revision[0])) + { + while (fgets(Revision, length, fp) != NULL) + { + revno = strtol(Revision, &p, 10); + if (revno != 0) + { + *p = '\0'; + fclose(fp); + return revno; + } + } + } + } + fclose(fp); + } + + try + { + XMLElement *head; + + try + { + head = XMLLoadFile(".svn/entries"); + } + catch(XMLFileNotFoundException) + { + head = XMLLoadFile("_svn/entries"); + } + XMLElement *entries = head->subElements[0]; + for (size_t i = 0; i < entries->subElements.size(); i++) + { + XMLElement *entry = entries->subElements[i]; + if ("entry" == entry->name) + { + bool GotName = false; + bool GotKind = false; + bool GotRevision = false; + for (size_t j = 0; j < entry->attributes.size(); j++) + { + XMLAttribute *Attribute = entry->attributes[j]; + if ("name" == Attribute->name && "" == Attribute->value) + { + GotName = true; + } + if ("kind" == Attribute->name && "dir" == Attribute->value) + { + GotKind = true; + } + if ("revision" == Attribute->name) + { + if (length <= Attribute->value.length() + 1) + { + strcpy(Revision, "revtoobig"); + } + else + { + strcpy(Revision, Attribute->value.c_str()); + revno = strtol(Revision, NULL, 10); + } + GotRevision = true; + } + if (GotName && GotKind && GotRevision) + { + delete head; + return revno; + } + } + } + } + + delete head; + } + catch(...) + { + ; + } + + strcpy(Revision, "UNKNOWN"); + return revno; +} + +void +write_h (int build, char *buildstr, long revno) +{ + FILE *h = NULL; + char* s; + char* s1; + unsigned int length; + int dllversion = KERNEL_VERSION_MAJOR + 42; + + s1 = s = (char *) malloc(256 * 1024); + + s = s + sprintf (s, "/* Do not edit - Machine generated */\n"); + + s = s + sprintf (s, "#ifndef _INC_REACTOS_BUILDNO\n" ); + s = s + sprintf (s, "#define _INC_REACTOS_BUILDNO\n" ); + + s = s + sprintf (s, "#define KERNEL_VERSION_BUILD\t%d\n", build); + s = s + sprintf (s, "#define KERNEL_VERSION_BUILD_HEX\t0x%lx\n", revno); + s = s + sprintf (s, "#define KERNEL_VERSION_BUILD_STR\t\"%s\"\n", buildstr); + s = s + sprintf (s, "#define KERNEL_VERSION_BUILD_RC\t\"%s\\0\"\n", buildstr); + s = s + sprintf (s, "#define KERNEL_RELEASE_RC\t\"%d.%d", + KERNEL_VERSION_MAJOR, KERNEL_VERSION_MINOR); + if (0 != KERNEL_VERSION_PATCH_LEVEL) + { + s = s + sprintf (s, ".%d", KERNEL_VERSION_PATCH_LEVEL); + } + s = s + sprintf (s, "%s\\0\"\n", build_tag); + s = s + sprintf (s, "#define KERNEL_RELEASE_STR\t\"%d.%d", + KERNEL_VERSION_MAJOR, + KERNEL_VERSION_MINOR); + if (0 != KERNEL_VERSION_PATCH_LEVEL) + { + s = s + sprintf (s, ".%d", KERNEL_VERSION_PATCH_LEVEL); + } + s = s + sprintf (s, "%s\"\n", build_tag); + s = s + sprintf (s, "#define KERNEL_VERSION_RC\t\"%d.%d", + KERNEL_VERSION_MAJOR, + KERNEL_VERSION_MINOR); + if (0 != KERNEL_VERSION_PATCH_LEVEL) + { + s = s + sprintf (s, ".%d", KERNEL_VERSION_PATCH_LEVEL); + } + s = s + sprintf (s, "%s\\0\"\n", build_tag); + s = s + sprintf (s, "#define KERNEL_VERSION_STR\t\"%d.%d", + KERNEL_VERSION_MAJOR, + KERNEL_VERSION_MINOR); + if (0 != KERNEL_VERSION_PATCH_LEVEL) + { + s = s + sprintf (s, ".%d", KERNEL_VERSION_PATCH_LEVEL); + } + s = s + sprintf (s, "%s\"\n", build_tag); + s = s + sprintf (s, "#define REACTOS_DLL_VERSION_MAJOR\t%d\n", dllversion); + s = s + sprintf (s, "#define REACTOS_DLL_RELEASE_RC\t\"%d.%d", + dllversion, KERNEL_VERSION_MINOR); + if (0 != KERNEL_VERSION_PATCH_LEVEL) + { + s = s + sprintf (s, ".%d", KERNEL_VERSION_PATCH_LEVEL); + } + s = s + sprintf (s, "%s\\0\"\n", build_tag); + s = s + sprintf (s, "#define REACTOS_DLL_RELEASE_STR\t\"%d.%d", + dllversion, + KERNEL_VERSION_MINOR); + if (0 != KERNEL_VERSION_PATCH_LEVEL) + { + s = s + sprintf (s, ".%d", KERNEL_VERSION_PATCH_LEVEL); + } + s = s + sprintf (s, "%s\"\n", build_tag); + s = s + sprintf (s, "#define REACTOS_DLL_VERSION_RC\t\"%d.%d", + dllversion, + KERNEL_VERSION_MINOR); + if (0 != KERNEL_VERSION_PATCH_LEVEL) + { + s = s + sprintf (s, ".%d", KERNEL_VERSION_PATCH_LEVEL); + } + s = s + sprintf (s, "%s\\0\"\n", build_tag); + s = s + sprintf (s, "#define REACTOS_DLL_VERSION_STR\t\"%d.%d", + dllversion, + KERNEL_VERSION_MINOR); + if (0 != KERNEL_VERSION_PATCH_LEVEL) + { + s = s + sprintf (s, ".%d", KERNEL_VERSION_PATCH_LEVEL); + } + s = s + sprintf (s, "%s\"\n", build_tag); + s = s + sprintf (s, "#endif\n/* EOF */\n"); + + h = fopen (filename, "rb"); + if (h != NULL) + { + fseek(h, 0, SEEK_END); + length = ftell(h); + if (length == strlen(s1)) + { + char* orig; + + orig = (char *) malloc(length); + if (orig == NULL) + { + fclose(h); + free(s1); + return; + } + fseek(h, 0, SEEK_SET); + fread(orig, 1, length, h); + if (memcmp(s1, orig, length) == 0) + { + fclose(h); + free(s1); + free(orig); + return; + } + free(orig); + } + fclose(h); + } + + h = fopen (filename, "wb"); + if (!h) + { + fprintf (stderr, + "%s: can not create file \"%s\"!\n", + argv0, + filename); + free(s1); + return; + } + fwrite(s1, 1, strlen(s1), h); + fclose(h); +} + +void +usage (void) +{ + fprintf ( + stderr, + "Usage: %s [-{p|q}] [-t tag] path-to-header\n\n" + " -p print version number and exit\n" + " -q run in quiet mode\n" + " -t specify a build tag\n", + argv0); + exit (EXIT_SUCCESS); +} + + +int +main (int argc, char * argv []) +{ + int i, length; + int print_only = FALSE; + int quiet = FALSE; + + int build = 0; + long revno; + char buildstr[64], revision[10]; + + time_t t1 = 0; + struct tm * t1_tm = NULL; + + argv0 = argv[0]; + + /* Check arguments */ + for (i = 1; i < argc; i++) + { + if (*argv[i] == '-') + { + switch (argv[i][1]) + { + case 'p': + print_only = TRUE; + break; + case 'q': + quiet = TRUE; + break; + case 't': + if (i + 1 != argc) + { + build_tag = argv[++i]; + break; + } + /* fall through */ + default: + usage(); + return EXIT_SUCCESS; + } + } + else if (!filename) + filename = argv[i]; + else + { + usage(); + return EXIT_SUCCESS; + } + } + if (!filename) + { + usage(); + return EXIT_SUCCESS; + } + + /* Set TZ information. */ + tzset (); + /* We are building TODAY! */ + if (! quiet) + { + printf ( "\nReactOS Build Number Generator\n\n"); + } + + time (& t1); /* current build time */ + t1_tm = gmtime (& t1); + + t1_tm->tm_year += 1900; + if (! quiet) + { + printf ( + "Current date: %4d-%02d-%02d\n\n", + t1_tm->tm_year, + (t1_tm->tm_mon + 1), + t1_tm->tm_mday); + } + + /* Compute build number. */ + build = t1_tm->tm_year * 10000 + (t1_tm->tm_mon + 1) * 100 + t1_tm->tm_mday; + + if (!build_tag) + { + /* Create default build tag */ + length = count_wide_string(KERNEL_VERSION_BUILD_TYPE); + build_tag = (char *)malloc(length+2); + if (length > 0) + { + build_tag[0] = '-'; + for (i = 0; KERNEL_VERSION_BUILD_TYPE[i]; i++) + { + build_tag[i + 1] = KERNEL_VERSION_BUILD_TYPE[i]; + } + build_tag[i+1] = 0; + } + else + build_tag[0] = 0; + } + else if (*build_tag) + { + /* Prepend '-' */ + length = strlen(build_tag); + char *new_build_tag = (char *)malloc(length + 2); + strcpy(new_build_tag, "-"); + strcat(new_build_tag, build_tag); + build_tag = new_build_tag; + } + + revno = GetRev(revision, sizeof(revision)); + sprintf(buildstr, "%d-r%s", build, revision); + + if (! quiet) + { + printf ( + "ROS Version : %d.%d", + KERNEL_VERSION_MAJOR, + KERNEL_VERSION_MINOR); + if (0 != KERNEL_VERSION_PATCH_LEVEL) + { + printf(".%d", KERNEL_VERSION_PATCH_LEVEL); + } + printf("%s (Build %s)\n\n", build_tag, buildstr); + } + /* (Over)write the include file, unless the user switched on -p. */ + if (! print_only) + { + write_h (build, buildstr, revno); + } + else + { + printf ("%s: no code generated", argv [0]); + } + + return EXIT_SUCCESS; +} + +/* EOF */ diff --git a/tools/buildno/buildno.mak b/tools/buildno/buildno.mak new file mode 100644 index 00000000000..e24d218b97d --- /dev/null +++ b/tools/buildno/buildno.mak @@ -0,0 +1,57 @@ +BUILDNO_BASE = $(TOOLS_BASE_)buildno +BUILDNO_BASE_ = $(BUILDNO_BASE)$(SEP) +BUILDNO_INT = $(INTERMEDIATE_)$(BUILDNO_BASE) +BUILDNO_INT_ = $(BUILDNO_INT)$(SEP) +BUILDNO_OUT = $(OUTPUT_)$(BUILDNO_BASE) +BUILDNO_OUT_ = $(BUILDNO_OUT)$(SEP) + +$(BUILDNO_INT): | $(TOOLS_INT) + $(ECHO_MKDIR) + ${mkdir} $@ + +ifneq ($(INTERMEDIATE),$(OUTPUT)) +$(BUILDNO_OUT): | $(TOOLS_OUT) + $(ECHO_MKDIR) + ${mkdir} $@ +endif + +BUILDNO_TARGET = \ + $(BUILDNO_OUT_)buildno$(EXEPOSTFIX) + +BUILDNO_SOURCES = $(addprefix $(BUILDNO_BASE_), \ + buildno.cpp \ + ) + +BUILDNO_OBJECTS = \ + $(addprefix $(INTERMEDIATE_), $(BUILDNO_SOURCES:.cpp=.o)) + +BUILDNO_HOST_CXXFLAGS = -I$(TOOLS_BASE) -Iinclude/reactos $(TOOLS_CPPFLAGS) + +BUILDNO_HOST_LFLAGS = $(TOOLS_LFLAGS) + +BUILDNO_VERSION = include$(SEP)reactos$(SEP)version.h + +.PHONY: buildno +buildno: $(BUILDNO_TARGET) + +$(BUILDNO_TARGET): $(BUILDNO_OBJECTS) $(XML_SSPRINTF_OBJECTS) | $(BUILDNO_OUT) + $(ECHO_HOSTLD) + ${host_gpp} $^ $(BUILDNO_HOST_LFLAGS) -o $@ + +$(BUILDNO_INT_)buildno.o: $(BUILDNO_BASE_)buildno.cpp $(BUILDNO_VERSION) | $(BUILDNO_INT) + $(ECHO_HOSTCC) + ${host_gpp} $(BUILDNO_HOST_CXXFLAGS) -c $< -o $@ + +.PHONY: buildno_clean +buildno_clean: + -@$(rm) $(BUILDNO_TARGET) $(BUILDNO_OBJECTS) 2>$(NUL) +clean: buildno_clean + +# Uncomment the following line if you want to automatically +# update build number after SVN update +#.PHONY: $(BUILDNO_TARGET) + +$(BUILDNO_H): $(BUILDNO_TARGET) + ${mkdir} $(INTERMEDIATE_)include$(SEP)reactos 2>$(NUL) + $(ECHO_BUILDNO) + $(Q)$(BUILDNO_TARGET) $(BUILDNO_QUIET) $(BUILDNO_H) diff --git a/tools/buildno/pch.h b/tools/buildno/pch.h new file mode 100644 index 00000000000..1ffb3dfd38f --- /dev/null +++ b/tools/buildno/pch.h @@ -0,0 +1,44 @@ +// pre-compiled header stuff + +#pragma once + +#ifdef _MSC_VER +#pragma warning ( disable : 4786 ) // identifier was truncated to '255' characters in the debug information +#endif//_MSC_VER + +#include +#include +#include +#include + +#include +#ifndef RBUILD +#include +#include +#endif + +#ifdef _MSC_VER +#define MAX_PATH _MAX_PATH +#endif + +#ifndef WIN32 +#include +#include + +inline char * strlwr(char *x) +{ + char *y=x; + + while (*y) { + *y=tolower(*y); + y++; + } + return x; +} + +#define _finite __finite +#define _isnan __isnan +#define stricmp strcasecmp +#define MAX_PATH PATH_MAX +#define _MAX_PATH PATH_MAX +#endif diff --git a/tools/cabman/cabman.rbuild b/tools/cabman/cabman.rbuild new file mode 100644 index 00000000000..ef058bbbb92 --- /dev/null +++ b/tools/cabman/cabman.rbuild @@ -0,0 +1,11 @@ + + + + . + zlibhost + cabinet.cxx + dfp.cxx + main.cxx + mszip.cxx + raw.cxx + diff --git a/tools/cdmake/cdmake.rbuild b/tools/cdmake/cdmake.rbuild new file mode 100644 index 00000000000..49fb45312ff --- /dev/null +++ b/tools/cdmake/cdmake.rbuild @@ -0,0 +1,6 @@ + + + + cdmake.c + llmosrt.c + diff --git a/tools/gendib/gendib.mak b/tools/gendib/gendib.mak new file mode 100644 index 00000000000..0f625325792 --- /dev/null +++ b/tools/gendib/gendib.mak @@ -0,0 +1,57 @@ +GENDIB_BASE = $(TOOLS_BASE_)gendib +GENDIB_BASE_ = $(GENDIB_BASE)$(SEP) +GENDIB_INT = $(INTERMEDIATE_)$(GENDIB_BASE) +GENDIB_INT_ = $(GENDIB_INT)$(SEP) +GENDIB_OUT = $(OUTPUT_)$(GENDIB_BASE) +GENDIB_OUT_ = $(GENDIB_OUT)$(SEP) + +$(GENDIB_INT): | $(TOOLS_INT) + $(ECHO_MKDIR) + ${mkdir} $@ + +ifneq ($(INTERMEDIATE),$(OUTPUT)) +$(GENDIB_OUT): | $(TOOLS_OUT) + $(ECHO_MKDIR) + ${mkdir} $@ +endif + +GENDIB_TARGET = \ + $(GENDIB_OUT_)gendib$(EXEPOSTFIX) + +GENDIB_SOURCES = \ + $(GENDIB_BASE_)gendib.c + +GENDIB_OBJECTS = \ + $(addprefix $(INTERMEDIATE_), $(GENDIB_SOURCES:.c=.o)) + +GENDIB_HOST_CFLAGS = $(TOOLS_CFLAGS) + +GENDIB_HOST_LFLAGS = $(TOOLS_LFLAGS) + +$(GENDIB_TARGET): $(GENDIB_OBJECTS) | $(GENDIB_OUT) + $(ECHO_HOSTLD) + ${host_gcc} $(GENDIB_OBJECTS) $(GENDIB_HOST_LFLAGS) -o $@ + +$(GENDIB_INT_)gendib.o: $(GENDIB_BASE_)gendib.c | $(GENDIB_INT) + $(ECHO_HOSTCC) + ${host_gcc} $(GENDIB_HOST_CFLAGS) -c $< -o $@ + +.PHONY: gendib +gendib: $(GENDIB_TARGET) + +.PHONY: gendib_clean +gendib_clean: + -@$(rm) $(GENDIB_TARGET) $(GENDIB_OBJECTS) 2>$(NUL) +clean: gendib_clean + +GENDIB_DIB_DIR = $(INTERMEDIATE_)subsystems$(SEP)win32$(SEP)win32k$(SEP)dib + +GENDIB_DIB_FILES = \ + $(GENDIB_DIB_DIR)$(SEP)dib32gen.c \ + $(GENDIB_DIB_DIR)$(SEP)dib16gen.c \ + $(GENDIB_DIB_DIR)$(SEP)dib8gen.c + +$(GENDIB_DIB_FILES): $(GENDIB_TARGET) + ${mkdir} $(GENDIB_DIB_DIR) 2>$(NUL) + $(ECHO_GENDIB) + $(Q)$(GENDIB_TARGET) $(GENDIB_DIB_DIR) diff --git a/tools/geninc/data.c b/tools/geninc/data.c new file mode 100644 index 00000000000..b53807109d3 --- /dev/null +++ b/tools/geninc/data.c @@ -0,0 +1,1567 @@ +#undef __MSVCRT__ +#include + +/* DDK/IFS/NDK Headers */ +#include +#include +#include +#include +#include +#include + +/* KD Support */ +#define NOEXTAPI +#include +#include +#include + +typedef struct +{ + UCHAR Type; + CHAR Name[60]; + ULONGLONG Value; +} ASMGENDATA; + +#define RAW(x) {0, #x, 0} +#define CONSTANT(name) {1, #name, name} +#define OFFSET(name, struct, member) {1, #name, FIELD_OFFSET(struct, member)} +#define RELOFFSET(name, struct, member, to) {1, #name, FIELD_OFFSET(struct, member) - FIELD_OFFSET(struct, to)} +#define SIZE(name, struct) {1, #name, sizeof(struct)} +#define HEADER(x) {2, x, 0} + +ASMGENDATA Table[] = +{ + +/* PORTABLE CONSTANTS ********************************************************/ + + HEADER("Pointer size"), + SIZE(SizeofPointer, PVOID), + + HEADER("Breakpoints"), + CONSTANT(BREAKPOINT_BREAK), + CONSTANT(BREAKPOINT_PRINT), + CONSTANT(BREAKPOINT_PROMPT), + CONSTANT(BREAKPOINT_LOAD_SYMBOLS), + CONSTANT(BREAKPOINT_UNLOAD_SYMBOLS), + CONSTANT(BREAKPOINT_COMMAND_STRING), + + HEADER("Context Frame Flags"), + CONSTANT(CONTEXT_FULL), + CONSTANT(CONTEXT_CONTROL), + CONSTANT(CONTEXT_INTEGER), + CONSTANT(CONTEXT_SEGMENTS), + CONSTANT(CONTEXT_FLOATING_POINT), + CONSTANT(CONTEXT_DEBUG_REGISTERS), + + HEADER("Exception flags"), + CONSTANT(EXCEPTION_NONCONTINUABLE), + CONSTANT(EXCEPTION_UNWINDING), + CONSTANT(EXCEPTION_EXIT_UNWIND), + CONSTANT(EXCEPTION_STACK_INVALID), + CONSTANT(EXCEPTION_NESTED_CALL), + CONSTANT(EXCEPTION_TARGET_UNWIND), + CONSTANT(EXCEPTION_COLLIDED_UNWIND), + CONSTANT(EXCEPTION_UNWIND), + CONSTANT(EXCEPTION_EXECUTE_HANDLER), + CONSTANT(EXCEPTION_CONTINUE_SEARCH), + CONSTANT(EXCEPTION_CONTINUE_EXECUTION), +#ifdef _X86_ + //CONSTANT(EXCEPTION_CHAIN_END), + //CONSTANT(FIXED_NTVDMSTATE_LINEAR), +#endif + + HEADER("Exception types"), + CONSTANT(ExceptionContinueExecution), + CONSTANT(ExceptionContinueSearch), + CONSTANT(ExceptionNestedException), + CONSTANT(ExceptionCollidedUnwind), + + HEADER("Lock Queue"), + CONSTANT(LOCK_QUEUE_WAIT), + CONSTANT(LOCK_QUEUE_OWNER), + CONSTANT(LockQueueDispatcherLock), + + HEADER("Performance Definitions"), +// CONSTANT(PERF_CONTEXTSWAP_OFFSET), +// CONSTANT(PERF_CONTEXTSWAP_FLAG), +// CONSTANT(PERF_INTERRUPT_OFFSET), +// CONSTANT(PERF_INTERRUPT_FLAG), +// CONSTANT(PERF_PROFILE_OFFSET), +// CONSTANT(PERF_PROFILE_FLAG), +// CONSTANT(PERF_SYSCALL_OFFSET), +// CONSTANT(PERF_SYSCALL_FLAG), +// CONSTANT(PERF_SPINLOCK_OFFSET), +// CONSTANT(PERF_SPINLOCK_FLAG), +// CONSTANT(NTOS_YIELD_MACRO), + + HEADER("Process states"), + CONSTANT(ProcessInMemory), + CONSTANT(ProcessOutOfMemory), + CONSTANT(ProcessInTransition), + + HEADER("Processor mode"), + CONSTANT(KernelMode), + CONSTANT(UserMode), + + HEADER("Status codes"), + CONSTANT(STATUS_ACCESS_VIOLATION), + CONSTANT(STATUS_ASSERTION_FAILURE), + CONSTANT(STATUS_ARRAY_BOUNDS_EXCEEDED), + CONSTANT(STATUS_BAD_COMPRESSION_BUFFER), + CONSTANT(STATUS_BREAKPOINT), + CONSTANT(STATUS_CALLBACK_POP_STACK), + CONSTANT(STATUS_DATATYPE_MISALIGNMENT), + CONSTANT(STATUS_FLOAT_DENORMAL_OPERAND), + CONSTANT(STATUS_FLOAT_DIVIDE_BY_ZERO), + CONSTANT(STATUS_FLOAT_INEXACT_RESULT), + CONSTANT(STATUS_FLOAT_INVALID_OPERATION), + CONSTANT(STATUS_FLOAT_OVERFLOW), + CONSTANT(STATUS_FLOAT_STACK_CHECK), + CONSTANT(STATUS_FLOAT_UNDERFLOW), + CONSTANT(STATUS_FLOAT_MULTIPLE_FAULTS), + CONSTANT(STATUS_FLOAT_MULTIPLE_TRAPS), + CONSTANT(STATUS_GUARD_PAGE_VIOLATION), + CONSTANT(STATUS_ILLEGAL_FLOAT_CONTEXT), + CONSTANT(STATUS_ILLEGAL_INSTRUCTION), + CONSTANT(STATUS_INSTRUCTION_MISALIGNMENT), + CONSTANT(STATUS_INVALID_HANDLE), + CONSTANT(STATUS_INVALID_LOCK_SEQUENCE), + CONSTANT(STATUS_INVALID_OWNER), + CONSTANT(STATUS_INVALID_PARAMETER), + CONSTANT(STATUS_INVALID_PARAMETER_1), + CONSTANT(STATUS_INVALID_SYSTEM_SERVICE), +// CONSTANT(STATUS_INVALID_THREAD), + CONSTANT(STATUS_INTEGER_DIVIDE_BY_ZERO), + CONSTANT(STATUS_INTEGER_OVERFLOW), + CONSTANT(STATUS_IN_PAGE_ERROR), + CONSTANT(STATUS_KERNEL_APC), + CONSTANT(STATUS_LONGJUMP), + CONSTANT(STATUS_NO_CALLBACK_ACTIVE), + CONSTANT(STATUS_NO_EVENT_PAIR), + CONSTANT(STATUS_PRIVILEGED_INSTRUCTION), + CONSTANT(STATUS_SINGLE_STEP), + CONSTANT(STATUS_STACK_BUFFER_OVERRUN), + CONSTANT(STATUS_STACK_OVERFLOW), + CONSTANT(STATUS_SUCCESS), + CONSTANT(STATUS_THREAD_IS_TERMINATING), + CONSTANT(STATUS_TIMEOUT), + CONSTANT(STATUS_UNWIND), + CONSTANT(STATUS_UNWIND_CONSOLIDATE), + CONSTANT(STATUS_USER_APC), + CONSTANT(STATUS_WAKE_SYSTEM_DEBUGGER), + + HEADER("TLS defines"), + CONSTANT(TLS_MINIMUM_AVAILABLE), + CONSTANT(TLS_EXPANSION_SLOTS), + + HEADER("Thread states"), + CONSTANT(Initialized), + CONSTANT(Ready), + CONSTANT(Running), + CONSTANT(Standby), + CONSTANT(Terminated), + CONSTANT(Waiting), + + HEADER("Wait type / reason"), + CONSTANT(WrExecutive), + CONSTANT(WrMutex), + CONSTANT(WrDispatchInt), + CONSTANT(WrQuantumEnd), + CONSTANT(WrEventPair), + CONSTANT(WaitAny), + CONSTANT(WaitAll), + + HEADER("Interrupt object types"), +// CONSTANT(InLevelSensitive), +// CONSTANT(InLatched), + + HEADER("Bug Check Codes"), + CONSTANT(APC_INDEX_MISMATCH), + CONSTANT(INVALID_AFFINITY_SET), + CONSTANT(INVALID_DATA_ACCESS_TRAP), + CONSTANT(IRQL_NOT_GREATER_OR_EQUAL), + CONSTANT(IRQL_NOT_LESS_OR_EQUAL), + CONSTANT(NO_USER_MODE_CONTEXT), + CONSTANT(SPIN_LOCK_ALREADY_OWNED), + CONSTANT(SPIN_LOCK_NOT_OWNED), + CONSTANT(THREAD_NOT_MUTEX_OWNER), + CONSTANT(TRAP_CAUSE_UNKNOWN), + CONSTANT(KMODE_EXCEPTION_NOT_HANDLED), + CONSTANT(KERNEL_APC_PENDING_DURING_EXIT), + CONSTANT(PANIC_STACK_SWITCH), + CONSTANT(DATA_BUS_ERROR), + CONSTANT(INSTRUCTION_BUS_ERROR), + CONSTANT(SYSTEM_EXIT_OWNED_MUTEX), +// CONSTANT(SYSTEM_UNWIND_PREVIOUS_USER), +// CONSTANT(SYSTEM_SERVICE_EXCEPTION), +// CONSTANT(INTERRUPT_UNWIND_ATTEMPTED), +// CONSTANT(INTERRUPT_EXCEPTION_NOT_HANDLED), + CONSTANT(PAGE_FAULT_WITH_INTERRUPTS_OFF), + CONSTANT(IRQL_GT_ZERO_AT_SYSTEM_SERVICE), + CONSTANT(DATA_COHERENCY_EXCEPTION), + CONSTANT(INSTRUCTION_COHERENCY_EXCEPTION), + CONSTANT(HAL1_INITIALIZATION_FAILED), + CONSTANT(UNEXPECTED_KERNEL_MODE_TRAP), + CONSTANT(NMI_HARDWARE_FAILURE), + CONSTANT(SPIN_LOCK_INIT_FAILURE), + CONSTANT(ATTEMPTED_SWITCH_FROM_DPC), +// CONSTANT(MUTEX_ALREADY_OWNED), +// CONSTANT(HARDWARE_INTERRUPT_STORM), +// CONSTANT(RECURSIVE_MACHINE_CHECK), +// CONSTANT(RECURSIVE_NMI), + + HEADER("IRQL"), + CONSTANT(PASSIVE_LEVEL), + CONSTANT(APC_LEVEL), + CONSTANT(DISPATCH_LEVEL), +#ifdef _M_AMD64 + CONSTANT(CLOCK_LEVEL), +#else + CONSTANT(CLOCK1_LEVEL), + CONSTANT(CLOCK2_LEVEL), +#endif + CONSTANT(IPI_LEVEL), + CONSTANT(POWER_LEVEL), + CONSTANT(PROFILE_LEVEL), + CONSTANT(HIGH_LEVEL), + RAW("#ifdef NT_UP"), + {1, "SYNCH_LEVEL", DISPATCH_LEVEL}, + RAW("#else"), + {1, "SYNCH_LEVEL", (IPI_LEVEL - 2)}, + RAW("#endif"), + + HEADER("Stack sizes"), + CONSTANT(KERNEL_STACK_SIZE), + CONSTANT(KERNEL_LARGE_STACK_SIZE), + CONSTANT(KERNEL_LARGE_STACK_COMMIT), +// CONSTANT(DOUBLE_FAULT_STACK_SIZE), +#ifdef _M_AMD64 + CONSTANT(KERNEL_MCA_EXCEPTION_STACK_SIZE), + CONSTANT(NMI_STACK_SIZE), +#endif + + HEADER("Thread flags"), +// CONSTANT(THREAD_FLAGS_CYCLE_PROFILING), +// CONSTANT(THREAD_FLAGS_CYCLE_PROFILING_LOCK_BIT), +// CONSTANT(THREAD_FLAGS_CYCLE_PROFILING_LOCK), +// CONSTANT(THREAD_FLAGS_COUNTER_PROFILING), +// CONSTANT(THREAD_FLAGS_COUNTER_PROFILING_LOCK_BIT), +// CONSTANT(THREAD_FLAGS_COUNTER_PROFILING_LOCK), +// CONSTANT(THREAD_FLAGS_CPU_THROTTLED), +// CONSTANT(THREAD_FLAGS_CPU_THROTTLED_BIT), +// CONSTANT(THREAD_FLAGS_ACCOUNTING_ANY), + + HEADER("Miscellaneous Definitions"), +// CONSTANT(BASE_PRIORITY_THRESHOLD), +// CONSTANT(EVENT_PAIR_INCREMENT), + CONSTANT(LOW_REALTIME_PRIORITY), + CONSTANT(CLOCK_QUANTUM_DECREMENT), +// CONSTANT(READY_SKIP_QUANTUM), +// CONSTANT(THREAD_QUANTUM), + CONSTANT(WAIT_QUANTUM_DECREMENT), +// CONSTANT(ROUND_TRIP_DECREMENT_COUNT), + CONSTANT(MAXIMUM_PROCESSORS), + CONSTANT(INITIAL_STALL_COUNT), + CONSTANT(EXCEPTION_EXECUTE_FAULT), +// CONSTANT(KCACHE_ERRATA_MONITOR_FLAGS), +// CONSTANT(KI_EXCEPTION_GP_FAULT), +// CONSTANT(KI_EXCEPTION_INVALID_OP), +// CONSTANT(KI_EXCEPTION_INTEGER_DIVIDE_BY_ZERO), + CONSTANT(KI_EXCEPTION_ACCESS_VIOLATION), +// CONSTANT(TARGET_FREEZE), +// CONSTANT(BlackHole), + CONSTANT(Executive), + CONSTANT(FALSE), + CONSTANT(TRUE), + CONSTANT(DBG_STATUS_CONTROL_C), + CONSTANT(USER_SHARED_DATA), +// CONSTANT(MM_SHARED_USER_DATA_VA), + CONSTANT(PAGE_SIZE), +// CONSTANT(KERNEL_STACK_CONTROL_LARGE_STACK), +// CONSTANT(KI_DPC_ALL_FLAGS), +// CONSTANT(DISPATCH_LENGTH), + CONSTANT(MAXIMUM_IDTVECTOR), +// CONSTANT(MAXIMUM_PRIMARY_VECTOR), + CONSTANT(PRIMARY_VECTOR_BASE), + CONSTANT(RPL_MASK), + CONSTANT(MODE_MASK), +// CONSTANT(KTHREAD_AUTO_ALIGNMENT_BIT), +// CONSTANT(KTHREAD_GUI_THREAD_MASK), +// CONSTANT(KI_SLIST_FAULT_COUNT_MAXIMUM), + CONSTANT(NUMBER_SERVICE_TABLES), + CONSTANT(SERVICE_NUMBER_MASK), + CONSTANT(SERVICE_TABLE_SHIFT), + CONSTANT(SERVICE_TABLE_MASK), + CONSTANT(SERVICE_TABLE_TEST), + +/* ARCHITECTURE SPECIFIC CONTSTANTS ******************************************/ + +#if defined(_M_AMD64) || defined(_M_IX86) + + HEADER("CR0 flags"), + CONSTANT(CR0_PE), + CONSTANT(CR0_MP), + CONSTANT(CR0_EM), + CONSTANT(CR0_TS), + CONSTANT(CR0_ET), + CONSTANT(CR0_NE), + CONSTANT(CR0_WP), + CONSTANT(CR0_AM), + CONSTANT(CR0_NW), + CONSTANT(CR0_CD), + CONSTANT(CR0_PG), + + HEADER("CR4 flags"), + CONSTANT(CR4_VME), + CONSTANT(CR4_PVI), + CONSTANT(CR4_TSD), + CONSTANT(CR4_DE), + CONSTANT(CR4_PSE), + CONSTANT(CR4_PAE), + CONSTANT(CR4_MCE), + CONSTANT(CR4_PGE), + CONSTANT(CR4_FXSR), + CONSTANT(CR4_XMMEXCPT), +#if defined(_M_IX86) +// CONSTANT(CR4_PGE_V), +// CONSTANT(CR4_XSAVE), +#elif defined(_M_AMD64) + CONSTANT(CR4_CHANNELS), +#endif + + HEADER("KeFeatureBits flags"), + CONSTANT(KF_RDTSC), + CONSTANT(KF_CR4), + CONSTANT(KF_GLOBAL_PAGE), + CONSTANT(KF_LARGE_PAGE), + CONSTANT(KF_CMPXCHG8B), + CONSTANT(KF_FAST_SYSCALL), +#ifdef _M_IX86 + CONSTANT(KF_V86_VIS), +// CONSTANT(KF_XSTATE), +#endif + + HEADER("Machine type definitions"), + CONSTANT(MACHINE_TYPE_ISA), + CONSTANT(MACHINE_TYPE_EISA), + CONSTANT(MACHINE_TYPE_MCA), + +#endif + +#ifdef _M_IX86 + + HEADER("EFLAGS"), + CONSTANT(EFLAGS_TF), + CONSTANT(EFLAGS_INTERRUPT_MASK), + CONSTANT(EFLAGS_V86_MASK), + CONSTANT(EFLAGS_ALIGN_CHECK), + CONSTANT(EFLAGS_VIF), + CONSTANT(EFLAGS_VIP), + CONSTANT(EFLAGS_USER_SANITIZE), + + HEADER("KDGT selectors"), + CONSTANT(KGDT_R3_DATA), + CONSTANT(KGDT_R3_CODE), + CONSTANT(KGDT_R0_CODE), + CONSTANT(KGDT_R0_DATA), + CONSTANT(KGDT_R0_PCR), +// CONSTANT(KGDT_STACK16), +// CONSTANT(KGDT_CODE16), + CONSTANT(KGDT_TSS), + CONSTANT(KGDT_R3_TEB), + CONSTANT(KGDT_DF_TSS), + CONSTANT(KGDT_NMI_TSS), + CONSTANT(KGDT_LDT), + + CONSTANT(NPX_STATE_NOT_LOADED), + CONSTANT(NPX_STATE_LOADED), +// CONSTANT(NPX_MASK_LAZY), + +/* + HEADER("VDM constants"), + CONSTANT(VDM_INDEX_Invalid), + CONSTANT(VDM_INDEX_0F), + CONSTANT(VDM_INDEX_ESPrefix), + CONSTANT(VDM_INDEX_CSPrefix), + CONSTANT(VDM_INDEX_SSPrefix), + CONSTANT(VDM_INDEX_DSPrefix), + CONSTANT(VDM_INDEX_FSPrefix), + CONSTANT(VDM_INDEX_GSPrefix), + CONSTANT(VDM_INDEX_OPER32Prefix), + CONSTANT(VDM_INDEX_ADDR32Prefix), + CONSTANT(VDM_INDEX_INSB), + CONSTANT(VDM_INDEX_INSW), + CONSTANT(VDM_INDEX_OUTSB), + CONSTANT(VDM_INDEX_OUTSW), + CONSTANT(VDM_INDEX_PUSHF), + CONSTANT(VDM_INDEX_POPF), + CONSTANT(VDM_INDEX_INTnn), + CONSTANT(VDM_INDEX_INTO), + CONSTANT(VDM_INDEX_IRET), + CONSTANT(VDM_INDEX_NPX), + CONSTANT(VDM_INDEX_INBimm), + CONSTANT(VDM_INDEX_INWimm), + CONSTANT(VDM_INDEX_OUTBimm), + CONSTANT(VDM_INDEX_OUTWimm), + CONSTANT(VDM_INDEX_INB), + CONSTANT(VDM_INDEX_INW), + CONSTANT(VDM_INDEX_OUTB), + CONSTANT(VDM_INDEX_OUTW), + CONSTANT(VDM_INDEX_LOCKPrefix), + CONSTANT(VDM_INDEX_REPNEPrefix), + CONSTANT(VDM_INDEX_REPPrefix), + CONSTANT(VDM_INDEX_CLI), + CONSTANT(VDM_INDEX_STI), + CONSTANT(VDM_INDEX_HLT), + CONSTANT(MAX_VDM_INDEX), +*/ + CONSTANT(PF_XMMI_INSTRUCTIONS_AVAILABLE), + CONSTANT(EFLAG_SELECT), +// CONSTANT(IPI_FREEZE), +// CONSTANT(XSAVE_PRESENT), + +#elif defined(_M_AMD64) + + HEADER("EFLAGS"), + CONSTANT(EFLAGS_TF_MASK), + CONSTANT(EFLAGS_TF_SHIFT), + CONSTANT(EFLAGS_IF_MASK), + CONSTANT(EFLAGS_IF_SHIFT), + CONSTANT(EFLAGS_ID_MASK), + + HEADER("Hypervisor Enlightenment Definitions"), + CONSTANT(HV_MMU_USE_HYPERCALL_FOR_ADDRESS_SWITCH), + CONSTANT(HV_MMU_USE_HYPERCALL_FOR_LOCAL_FLUSH), + CONSTANT(HV_MMU_USE_HYPERCALL_FOR_REMOTE_FLUSH), + CONSTANT(HV_X64_MSR_APIC_EOI), + CONSTANT(HV_APIC_ENLIGHTENED), + CONSTANT(HV_KE_USE_HYPERCALL_FOR_LONG_SPIN_WAIT), + CONSTANT(HV_VIRTUAL_APIC_NO_EOI_REQUIRED_V), + CONSTANT(HvApicFlags), + + HEADER("KDGT selectors"), + CONSTANT(KGDT64_NULL), + CONSTANT(KGDT64_R0_CODE), + CONSTANT(KGDT64_R0_DATA), + CONSTANT(KGDT64_R3_CMCODE), + CONSTANT(KGDT64_R3_DATA), + CONSTANT(KGDT64_R3_CODE), + CONSTANT(KGDT64_SYS_TSS), + CONSTANT(KGDT64_R3_CMTEB), + + HEADER("Machine Specific Register Numbers"), + CONSTANT(MSR_EFER), + CONSTANT(MSR_STAR), + CONSTANT(MSR_LSTAR), + CONSTANT(MSR_CSTAR), + CONSTANT(MSR_SYSCALL_MASK), + CONSTANT(MSR_FS_BASE), + CONSTANT(MSR_GS_BASE), + CONSTANT(MSR_GS_SWAP), + CONSTANT(MSR_MCG_STATUS), + CONSTANT(MSR_AMD_ACCESS), + + HEADER("Flags for MSR_EFER"), + CONSTANT(MSR_LMA), + CONSTANT(MSR_LME), + CONSTANT(MSR_SCE), + CONSTANT(MSR_NXE), + CONSTANT(MSR_PAT), + CONSTANT(MSR_DEGUG_CTL), + CONSTANT(MSR_LAST_BRANCH_FROM), + CONSTANT(MSR_LAST_BRANCH_TO), + CONSTANT(MSR_LAST_EXCEPTION_FROM), + CONSTANT(MSR_LAST_EXCEPTION_TO), + + HEADER("Flags for MSR_DEGUG_CTL"), + CONSTANT(MSR_DEBUG_CTL_LBR), + CONSTANT(MSR_DEBUG_CRL_BTF), + +#endif + +#if 0 + HEADER("Fatal exception codes"), + CONSTANT(EXCEPTION_DIVIDED_BY_ZERO), + CONSTANT(EXCEPTION_DEBUG), + CONSTANT(EXCEPTION_NMI), + CONSTANT(EXCEPTION_INT3), + CONSTANT(EXCEPTION_BOUND_CHECK), + CONSTANT(EXCEPTION_INVALID_OPCODE), + CONSTANT(EXCEPTION_NPX_NOT_AVAILABLE), + CONSTANT(EXCEPTION_DOUBLE_FAULT), + CONSTANT(EXCEPTION_NPX_OVERRUN), + CONSTANT(EXCEPTION_INVALID_TSS), + CONSTANT(EXCEPTION_SEGMENT_NOT_PRESENT), + CONSTANT(EXCEPTION_STACK_FAULT), + CONSTANT(EXCEPTION_GP_FAULT), + CONSTANT(EXCEPTION_RESERVED_TRAP), + CONSTANT(EXCEPTION_NPX_ERROR), + CONSTANT(EXCEPTION_ALIGNMENT_CHECK), +#endif + + +/* STRUCTURE OFFSETS *********************************************************/ + + HEADER("KAFFINITY_EX"), +// OFFSET(AfBitmap, KAFFINITY_EX, Bitmap), + + HEADER("Aligned Affinity"), +// OFFSET(AfsCpuSet, ???, CpuSet), + + HEADER("KAPC"), + OFFSET(ApType, KAPC, Type), + OFFSET(ApSize, KAPC, Size), + OFFSET(ApThread, KAPC, Thread), + OFFSET(ApApcListEntry, KAPC, ApcListEntry), + OFFSET(ApKernelRoutine, KAPC, KernelRoutine), + OFFSET(ApRundownRoutine, KAPC, RundownRoutine), + OFFSET(ApNormalRoutine, KAPC, NormalRoutine), + OFFSET(ApNormalContext, KAPC, NormalContext), + OFFSET(ApSystemArgument1, KAPC, SystemArgument1), + OFFSET(ApSystemArgument2, KAPC, SystemArgument2), + OFFSET(ApApcStateIndex, KAPC, ApcStateIndex), + OFFSET(ApApcMode, KAPC, ApcMode), + OFFSET(ApInserted, KAPC, Inserted), + SIZE(ApcObjectLength, KAPC), + + HEADER("KAPC_STATE"), + OFFSET(AsApcListHead, KAPC_STATE, ApcListHead), + OFFSET(AsProcess, KAPC_STATE, Process), + OFFSET(AsKernelApcInProgress, KAPC_STATE, KernelApcInProgress), + OFFSET(AsKernelApcPending, KAPC_STATE, KernelApcPending), + OFFSET(AsUserApcPending, KAPC_STATE, UserApcPending), + + HEADER("CLIENT_ID"), + OFFSET(CidUniqueProcess, CLIENT_ID, UniqueProcess), + OFFSET(CidUniqueThread, CLIENT_ID, UniqueThread), + + HEADER("RTL_CRITICAL_SECTION"), + OFFSET(CsDebugInfo, RTL_CRITICAL_SECTION, DebugInfo), + OFFSET(CsLockCount, RTL_CRITICAL_SECTION, LockCount), + OFFSET(CsRecursionCount, RTL_CRITICAL_SECTION, RecursionCount), + OFFSET(CsOwningThread, RTL_CRITICAL_SECTION, OwningThread), + OFFSET(CsLockSemaphore, RTL_CRITICAL_SECTION, LockSemaphore), + OFFSET(CsSpinCount, RTL_CRITICAL_SECTION, SpinCount), + + HEADER("RTL_CRITICAL_SECTION_DEBUG"), + OFFSET(CsType, RTL_CRITICAL_SECTION_DEBUG, Type), + OFFSET(CsCreatorBackTraceIndex, RTL_CRITICAL_SECTION_DEBUG, CreatorBackTraceIndex), + OFFSET(CsCriticalSection, RTL_CRITICAL_SECTION_DEBUG, CriticalSection), + OFFSET(CsProcessLocksList, RTL_CRITICAL_SECTION_DEBUG, ProcessLocksList), + OFFSET(CsEntryCount, RTL_CRITICAL_SECTION_DEBUG, EntryCount), + OFFSET(CsContentionCount, RTL_CRITICAL_SECTION_DEBUG, ContentionCount), + + HEADER("KDEVICE_QUEUE_ENTRY"), + OFFSET(DeDeviceListEntry, KDEVICE_QUEUE_ENTRY, DeviceListEntry), + OFFSET(DeSortKey, KDEVICE_QUEUE_ENTRY, SortKey), + OFFSET(DeInserted, KDEVICE_QUEUE_ENTRY, Inserted), + SIZE(DeviceQueueEntryLength, KDEVICE_QUEUE_ENTRY), + + HEADER("KDPC"), + OFFSET(DpType, KDPC, Type), + OFFSET(DpImportance, KDPC, Importance), + OFFSET(DpNumber, KDPC, Number), + OFFSET(DpDpcListEntry, KDPC, DpcListEntry), + OFFSET(DpDeferredRoutine, KDPC, DeferredRoutine), + OFFSET(DpDeferredContext, KDPC, DeferredContext), + OFFSET(DpSystemArgument1, KDPC, SystemArgument1), + OFFSET(DpSystemArgument2, KDPC, SystemArgument2), + OFFSET(DpDpcData, KDPC, DpcData), + SIZE(DpcObjectLength, KDPC), + + HEADER("KDEVICE_QUEUE"), + OFFSET(DvType, KDEVICE_QUEUE, Type), + OFFSET(DvSize, KDEVICE_QUEUE, Size), + OFFSET(DvDeviceListHead, KDEVICE_QUEUE, DeviceListHead), + OFFSET(DvSpinLock, KDEVICE_QUEUE, Lock), + OFFSET(DvBusy, KDEVICE_QUEUE, Busy), + SIZE(DeviceQueueObjectLength, KDEVICE_QUEUE), + + HEADER("EXCEPTION_RECORD"), + OFFSET(ErExceptionCode, EXCEPTION_RECORD, ExceptionCode), + OFFSET(ErExceptionFlags, EXCEPTION_RECORD, ExceptionFlags), + OFFSET(ErExceptionRecord, EXCEPTION_RECORD, ExceptionRecord), + OFFSET(ErExceptionAddress, EXCEPTION_RECORD, ExceptionAddress), + OFFSET(ErNumberParameters, EXCEPTION_RECORD, NumberParameters), + OFFSET(ErExceptionInformation, EXCEPTION_RECORD, ExceptionInformation), + SIZE(ExceptionRecordLength, EXCEPTION_RECORD), + SIZE(EXCEPTION_RECORD_LENGTH, EXCEPTION_RECORD), + + HEADER("EPROCESS"), + OFFSET(EpDebugPort, EPROCESS, DebugPort), + OFFSET(EpVdmObjects, EPROCESS, VdmObjects), + SIZE(ExecutiveProcessObjectLength, EPROCESS), + + HEADER("KEVENT"), + OFFSET(EvType, KEVENT, Header.Type), + OFFSET(EvSize, KEVENT, Header.Size), + OFFSET(EvSignalState, KEVENT, Header.SignalState), + OFFSET(EvWaitListHead, KEVENT, Header.WaitListHead), + SIZE(EventObjectLength, KEVENT), + + HEADER("FAST_MUTEX"), + OFFSET(FmCount, FAST_MUTEX, Count), + OFFSET(FmOwner, FAST_MUTEX, Owner), + OFFSET(FmContention, FAST_MUTEX, Contention), + OFFSET(FmGate, FAST_MUTEX, Gate), + OFFSET(FmOldIrql, FAST_MUTEX, OldIrql), + + HEADER("KINTERRUPT"), + OFFSET(InType, KINTERRUPT, Type), + OFFSET(InSize, KINTERRUPT, Size), + OFFSET(InInterruptListEntry, KINTERRUPT, InterruptListEntry), + OFFSET(InServiceRoutine, KINTERRUPT, ServiceRoutine), + OFFSET(InServiceContext, KINTERRUPT, ServiceContext), + OFFSET(InSpinLock, KINTERRUPT, SpinLock), + OFFSET(InTickCount, KINTERRUPT, TickCount), + OFFSET(InActualLock, KINTERRUPT, ActualLock), + OFFSET(InDispatchAddress, KINTERRUPT, DispatchAddress), + OFFSET(InVector, KINTERRUPT, Vector), + OFFSET(InIrql, KINTERRUPT, Irql), + OFFSET(InSynchronizeIrql, KINTERRUPT, SynchronizeIrql), + OFFSET(InFloatingSave, KINTERRUPT, FloatingSave), + OFFSET(InConnected, KINTERRUPT, Connected), + OFFSET(InNumber, KINTERRUPT, Number), + OFFSET(InShareVector, KINTERRUPT, ShareVector), + OFFSET(InMode, KINTERRUPT, Mode), + OFFSET(InServiceCount, KINTERRUPT, ServiceCount), + OFFSET(InDispatchCount, KINTERRUPT, DispatchCount), +// OFFSET(InTrapFrame, KINTERRUPT, TrapFrame), + OFFSET(InDispatchCode, KINTERRUPT, DispatchCode), + SIZE(InterruptObjectLength, KINTERRUPT), + + HEADER("IO_STATUS_BLOCK"), + OFFSET(IoStatus, IO_STATUS_BLOCK, Status), + OFFSET(IoPointer, IO_STATUS_BLOCK, Pointer), + OFFSET(IoInformation, IO_STATUS_BLOCK, Information), + +#ifdef _M_IX86 +// Kernel Stack Control Structure Offset (relative to initial stack pointer) Definitions +// RELOFFSET(KcPreviousBase, KERNEL_STACK_CONTROL, PreviousBase, ???), +// RELOFFSET(KcPreviousLimit, KERNEL_STACK_CONTROL, PreviousBase, ???), +// RELOFFSET(KcPreviousKernel, KERNEL_STACK_CONTROL, PreviousBase, ???), +// RELOFFSET(KcPreviousInitial, KERNEL_STACK_CONTROL, PreviousBase, ???), +#else + HEADER("KERNEL_STACK_CONTROL"), +// OFFSET(KcPreviousBase, KERNEL_STACK_CONTROL, PreviousBase), +// OFFSET(KcPreviousLimit, KERNEL_STACK_CONTROL, PreviousLimit), +// OFFSET(KcPreviousKernel, KERNEL_STACK_CONTROL, PreviousKernel), +// OFFSET(KcPreviousInitial, KERNEL_STACK_CONTROL, PreviousInitial), +// SIZE(KERNEL_STACK_CONTROL_LENGTH, KERNEL_STACK_CONTROL), +#endif + + HEADER("KNODE"), +// OFFSET(KnRight, KNODE, Right), +// OFFSET(KnLeft, KNODE, Left), + OFFSET(KnPfnDereferenceSListHead, KNODE, PfnDereferenceSListHead), + OFFSET(KnProcessorMask, KNODE, ProcessorMask), + OFFSET(KnColor, KNODE, Color), + OFFSET(KnSeed, KNODE, Seed), + OFFSET(KnNodeNumber, KNODE, NodeNumber), + OFFSET(KnFlags, KNODE, Flags), + OFFSET(knMmShiftedColor, KNODE, MmShiftedColor), + OFFSET(KnFreeCount, KNODE, FreeCount), + OFFSET(KnPfnDeferredList, KNODE, PfnDeferredList), + SIZE(KNODE_SIZE, KNODE), + + HEADER("KSPIN_LOCK_QUEUE"), + OFFSET(LqNext, KSPIN_LOCK_QUEUE, Next), + OFFSET(LqLock, KSPIN_LOCK_QUEUE, Lock), + + HEADER("KLOCK_QUEUE_HANDLE"), + OFFSET(LqhNext, KLOCK_QUEUE_HANDLE, LockQueue.Next), + OFFSET(LqhLock, KLOCK_QUEUE_HANDLE, LockQueue.Lock), + OFFSET(LqhOldIrql, KLOCK_QUEUE_HANDLE, OldIrql), + SIZE(LOCK_QUEUE_HEADER_SIZE, KLOCK_QUEUE_HANDLE), + + HEADER("LARGE_INTEGER"), + OFFSET(LiLowPart, LARGE_INTEGER, LowPart), + OFFSET(LiHighPart, LARGE_INTEGER, HighPart), +#if 0 + HEADER("LOADER_PARAMETER_BLOCK (rel. to LoadOrderListHead)"), + RELOFFSET(LpbLoadOrderListHead, LOADER_PARAMETER_BLOCK, LoadOrderListHead, LoadOrderListHead), + RELOFFSET(LpbMemoryDescriptorListHead, LOADER_PARAMETER_BLOCK, MemoryDescriptorListHead, LoadOrderListHead), + RELOFFSET(LpbKernelStack, LOADER_PARAMETER_BLOCK, KernelStack, LoadOrderListHead), + RELOFFSET(LpbPrcb, LOADER_PARAMETER_BLOCK, Prcb, LoadOrderListHead), + RELOFFSET(LpbProcess, LOADER_PARAMETER_BLOCK, Process, LoadOrderListHead), + RELOFFSET(LpbThread, LOADER_PARAMETER_BLOCK, Thread, LoadOrderListHead), + RELOFFSET(LpbI386, LOADER_PARAMETER_BLOCK, u.I386, LoadOrderListHead), + RELOFFSET(LpbRegistryLength, LOADER_PARAMETER_BLOCK, RegistryLength, LoadOrderListHead), + RELOFFSET(LpbRegistryBase, LOADER_PARAMETER_BLOCK, RegistryBase, LoadOrderListHead), + RELOFFSET(LpbConfigurationRoot, LOADER_PARAMETER_BLOCK, ConfigurationRoot, LoadOrderListHead), + RELOFFSET(LpbArcBootDeviceName, LOADER_PARAMETER_BLOCK, ArcBootDeviceName, LoadOrderListHead), + RELOFFSET(LpbArcHalDeviceName, LOADER_PARAMETER_BLOCK, ArcHalDeviceName, LoadOrderListHead), + RELOFFSET(LpbLoadOptions, LOADER_PARAMETER_BLOCK, LoadOptions, LoadOrderListHead), + RELOFFSET(LpbExtension, LOADER_PARAMETER_BLOCK, Extension, LoadOrderListHead), +#endif + + HEADER("LIST_ENTRY"), + OFFSET(LsFlink, LIST_ENTRY, Flink), + OFFSET(LsBlink, LIST_ENTRY, Blink), + + HEADER("PEB"), + OFFSET(PeKernelCallbackTable, PEB, KernelCallbackTable), + SIZE(ProcessEnvironmentBlockLength, PEB), + + HEADER("KPROFILE"), + OFFSET(PfType, KPROFILE, Type), + OFFSET(PfSize, KPROFILE, Size), + OFFSET(PfProfileListEntry, KPROFILE, ProfileListEntry), + OFFSET(PfProcess, KPROFILE, Process), + OFFSET(PfRangeBase, KPROFILE, RangeBase), + OFFSET(PfRangeLimit, KPROFILE, RangeLimit), + OFFSET(PfBucketShift, KPROFILE, BucketShift), + OFFSET(PfBuffer, KPROFILE, Buffer), + OFFSET(PfSegment, KPROFILE, Segment), + OFFSET(PfAffinity, KPROFILE, Affinity), + OFFSET(PfSource, KPROFILE, Source), + OFFSET(PfStarted, KPROFILE, Started), + SIZE(ProfileObjectLength, KPROFILE), + + HEADER("PORT_MESSAGE"), + OFFSET(PmLength, PORT_MESSAGE, u1.Length), + OFFSET(PmZeroInit, PORT_MESSAGE, u2.ZeroInit), + OFFSET(PmClientId, PORT_MESSAGE, ClientId), + OFFSET(PmProcess, PORT_MESSAGE, ClientId.UniqueProcess), + OFFSET(PmThread, PORT_MESSAGE, ClientId.UniqueThread), + OFFSET(PmMessageId, PORT_MESSAGE, MessageId), + OFFSET(PmClientViewSize, PORT_MESSAGE, ClientViewSize), + SIZE(PortMessageLength, PORT_MESSAGE), + + HEADER("KPROCESS"), + OFFSET(PrType, KPROCESS, Header.Type), + OFFSET(PrSize, KPROCESS, Header.Size), + OFFSET(PrSignalState, KPROCESS, Header.SignalState), + OFFSET(PrProfileListHead, KPROCESS, ProfileListHead), + OFFSET(PrDirectoryTableBase, KPROCESS, DirectoryTableBase), +#ifdef _M_IX86 + OFFSET(PrLdtDescriptor, KPROCESS, LdtDescriptor), +#endif + OFFSET(PrIopmOffset, KPROCESS, IopmOffset), +#ifdef _M_IX86 + OFFSET(PrInt21Descriptor, KPROCESS, Int21Descriptor), + OFFSET(PrVdmTrapcHandler, KPROCESS, VdmTrapcHandler), +// OFFSET(PrVdmObjects, KPROCESS, VdmObjects), + OFFSET(PrFlags, KPROCESS, Flags), +#endif +// OFFSET(PrInstrumentationCallback, KPROCESS, InstrumentationCallback), + OFFSET(PrActiveProcessors, KPROCESS, ActiveProcessors), + OFFSET(PrKernelTime, KPROCESS, KernelTime), + OFFSET(PrUserTime, KPROCESS, UserTime), + OFFSET(PrReadyListHead, KPROCESS, ReadyListHead), + OFFSET(PrSwapListEntry, KPROCESS, SwapListEntry), + OFFSET(PrThreadListHead, KPROCESS, ThreadListHead), + OFFSET(PrProcessLock, KPROCESS, ProcessLock), + OFFSET(PrAffinity, KPROCESS, Affinity), + OFFSET(PrProcessFlags, KPROCESS, ProcessFlags), + OFFSET(PrBasePriority, KPROCESS, BasePriority), + OFFSET(PrQuantumReset, KPROCESS, QuantumReset), + OFFSET(PrState, KPROCESS, State), + OFFSET(PrStackCount, KPROCESS, StackCount), +#if (NTDDI_VERSION >= NTDDI_LONGHORN) + OFFSET(PrCycleTime, KPROCESS, CycleTime), +#endif + SIZE(KernelProcessObjectLength, KPROCESS), + + HEADER("KQUEUE"), + OFFSET(QuType, KQUEUE, Header.Type), + OFFSET(QuSize, KQUEUE, Header.Size), + OFFSET(QuSignalState, KQUEUE, Header.SignalState), + OFFSET(QuEntryListHead, KQUEUE, EntryListHead), + OFFSET(QuCurrentCount, KQUEUE, CurrentCount), + OFFSET(QuMaximumCount, KQUEUE, MaximumCount), + OFFSET(QuThreadListHead, KQUEUE, ThreadListHead), + SIZE(QueueObjectLength, KQUEUE), + + HEADER("STRING"), + OFFSET(StrLength, STRING, Length), + OFFSET(StrMaximumLength, STRING, MaximumLength), + OFFSET(StrBuffer, STRING, Buffer), + + HEADER("TEB"), + OFFSET(TeCmTeb, TEB, Tib), +#ifdef _M_IX86 + OFFSET(TeExceptionList, TEB, Tib.ExceptionList), +#endif + OFFSET(TeStackBase, TEB, Tib.StackBase), + OFFSET(TeStackLimit, TEB, Tib.StackLimit), + OFFSET(TeFiberData, TEB, Tib.FiberData), + OFFSET(TeSelf, TEB, Tib.Self), + OFFSET(TeEnvironmentPointer, TEB, EnvironmentPointer), + OFFSET(TeClientId, TEB, ClientId), + OFFSET(TeActiveRpcHandle, TEB, ActiveRpcHandle), + OFFSET(TeThreadLocalStoragePointer, TEB, ThreadLocalStoragePointer), + OFFSET(TeCountOfOwnedCriticalSections, TEB, CountOfOwnedCriticalSections), + OFFSET(TePeb, TEB, ProcessEnvironmentBlock), + OFFSET(TeCsrClientThread, TEB, CsrClientThread), + OFFSET(TeWOW32Reserved, TEB, WOW32Reserved), +// OFFSET(TeSoftFpcr, TEB, SoftFpcr), + OFFSET(TeExceptionCode, TEB, ExceptionCode), + OFFSET(TeActivationContextStackPointer, TEB, ActivationContextStackPointer), + OFFSET(TeGdiClientPID, TEB, GdiClientPID), + OFFSET(TeGdiClientTID, TEB, GdiClientTID), + OFFSET(TeGdiThreadLocalInfo, TEB, GdiThreadLocalInfo), + OFFSET(TeglDispatchTable, TEB, glDispatchTable), + OFFSET(TeglReserved1, TEB, glReserved1), + OFFSET(TeglReserved2, TEB, glReserved2), + OFFSET(TeglSectionInfo, TEB, glSectionInfo), + OFFSET(TeglSection, TEB, glSection), + OFFSET(TeglTable, TEB, glTable), + OFFSET(TeglCurrentRC, TEB, glCurrentRC), + OFFSET(TeglContext, TEB, glContext), + OFFSET(TeDeallocationStack, TEB, DeallocationStack), + OFFSET(TeTlsSlots, TEB, TlsSlots), + OFFSET(TeTlsExpansionSlots, TEB, TlsExpansionSlots), + OFFSET(TeLastErrorValue, TEB, LastErrorValue), + OFFSET(TeVdm, TEB, Vdm), + OFFSET(TeInstrumentation, TEB, Instrumentation), + OFFSET(TeGdiBatchCount, TEB, GdiBatchCount), + OFFSET(TeGuaranteedStackBytes, TEB, GuaranteedStackBytes), + OFFSET(TeFlsData, TEB, FlsData), +// OFFSET(TeProcessRundown, TEB, ProcessRundown), + SIZE(ThreadEnvironmentBlockLength, TEB), + + HEADER("TIME_FIELDS"), + OFFSET(TfSecond, TIME_FIELDS, Second), + OFFSET(TfMinute, TIME_FIELDS, Minute), + OFFSET(TfHour, TIME_FIELDS, Hour), + OFFSET(TfWeekday, TIME_FIELDS, Weekday), + OFFSET(TfDay, TIME_FIELDS, Day), + OFFSET(TfMonth, TIME_FIELDS, Month), + OFFSET(TfYear, TIME_FIELDS, Year), + OFFSET(TfMilliseconds, TIME_FIELDS, Milliseconds), + + HEADER("KTHREAD"), + OFFSET(ThType, KTHREAD, DispatcherHeader.Type), +// OFFSET(ThNpxIrql, KTHREAD, NpxIrql), + OFFSET(ThSize, KTHREAD, DispatcherHeader.Size), + OFFSET(ThLock, KTHREAD, DispatcherHeader.Lock), + OFFSET(ThDebugActive, KTHREAD, DispatcherHeader.DebugActive), +// OFFSET(ThThreadControlFlags, KTHREAD, DispatcherHeader.ThreadControlFlags), + OFFSET(ThSignalState, KTHREAD, DispatcherHeader.SignalState), +#if (NTDDI_VERSION >= NTDDI_LONGHORN) + OFFSET(ThCycleTime, KTHREAD, CycleTime), + OFFSET(ThHighCycleTime, KTHREAD, HighCycleTime), +#endif + OFFSET(ThInitialStack, KTHREAD, InitialStack), + OFFSET(ThStackLimit, KTHREAD, StackLimit), + OFFSET(ThKernelStack, KTHREAD, KernelStack), + OFFSET(ThThreadLock, KTHREAD, ThreadLock), +// OFFSET(ThRunning, KTHREAD, Running), + OFFSET(ThAlerted, KTHREAD, Alerted), +// OFFSET(ThMiscFlags, KTHREAD, MiscFlags), + OFFSET(ThApcState, KTHREAD, ApcState), + OFFSET(ThPriority, KTHREAD, Priority), + OFFSET(ThSwapBusy, KTHREAD, SwapBusy), + OFFSET(ThNextProcessor, KTHREAD, NextProcessor), + OFFSET(ThDeferredProcessor, KTHREAD, DeferredProcessor), + OFFSET(ThApcQueueLock, KTHREAD, ApcQueueLock), + OFFSET(ThContextSwitches, KTHREAD, ContextSwitches), + OFFSET(ThState, KTHREAD, State), + OFFSET(ThNpxState, KTHREAD, NpxState), + OFFSET(ThWaitIrql, KTHREAD, WaitIrql), + OFFSET(ThWaitMode, KTHREAD, WaitMode), + OFFSET(ThWaitStatus, KTHREAD, WaitStatus), + OFFSET(ThWaitBlockList, KTHREAD, WaitBlockList), + OFFSET(ThGateObject, KTHREAD, GateObject), + OFFSET(ThWaitListEntry, KTHREAD, WaitListEntry), + OFFSET(ThSwapListEntry, KTHREAD, SwapListEntry), + OFFSET(ThQueue, KTHREAD, Queue), + OFFSET(ThWaitTime, KTHREAD, WaitTime), + OFFSET(ThCombinedApcDisable, KTHREAD, CombinedApcDisable), + OFFSET(ThKernelApcDisable, KTHREAD, KernelApcDisable), + OFFSET(ThSpecialApcDisable, KTHREAD, SpecialApcDisable), + OFFSET(ThTeb, KTHREAD, Teb), + OFFSET(ThTimer, KTHREAD, Timer), + OFFSET(ThThreadFlags, KTHREAD, ThreadFlags), + OFFSET(ThServiceTable, KTHREAD, ServiceTable), + OFFSET(ThWaitBlock, KTHREAD, WaitBlock), + OFFSET(ThResourceIndex, KTHREAD, ResourceIndex), + OFFSET(ThQueueListEntry, KTHREAD, QueueListEntry), + OFFSET(ThTrapFrame, KTHREAD, TrapFrame), +#if (NTDDI_VERSION >= NTDDI_LONGHORN) + OFFSET(ThFirstArgument, KTHREAD, FirstArgument), +#endif + OFFSET(ThCallbackStack, KTHREAD, CallbackStack), +// OFFSET(ThCallbackDepth, KTHREAD, CallbackDepth), + OFFSET(ThApcStateIndex, KTHREAD, ApcStateIndex), + OFFSET(ThIdealProcessor, KTHREAD, IdealProcessor), + OFFSET(ThBasePriority, KTHREAD, BasePriority), + OFFSET(ThPriorityDecrement, KTHREAD, PriorityDecrement), + OFFSET(ThAdjustReason, KTHREAD, AdjustReason), + OFFSET(ThAdjustIncrement, KTHREAD, AdjustIncrement), + OFFSET(ThPreviousMode, KTHREAD, PreviousMode), + OFFSET(ThSaturation, KTHREAD, Saturation), +#if (NTDDI_VERSION >= NTDDI_LONGHORN) + OFFSET(ThSystemCallNumber, KTHREAD, SystemCallNumber), +#endif + OFFSET(ThFreezeCount, KTHREAD, FreezeCount), + OFFSET(ThUserAffinity, KTHREAD, UserAffinity), + OFFSET(ThProcess, KTHREAD, Process), + OFFSET(ThAffinity, KTHREAD, Affinity), + OFFSET(ThUserIdealProcessor, KTHREAD, UserIdealProcessor), + OFFSET(ThApcStatePointer, KTHREAD, ApcStatePointer), + OFFSET(ThSavedApcState, KTHREAD, SavedApcState), + OFFSET(ThWaitReason, KTHREAD, WaitReason), + OFFSET(ThSuspendCount, KTHREAD, SuspendCount), +// OFFSET(ThCodePatchInProgress, KTHREAD, CodePatchInProgress), + OFFSET(ThWin32Thread, KTHREAD, Win32Thread), + OFFSET(ThStackBase, KTHREAD, StackBase), + OFFSET(ThSuspendApc, KTHREAD, SuspendApc), + OFFSET(ThPowerState, KTHREAD, PowerState), + OFFSET(ThKernelTime, KTHREAD, KernelTime), + OFFSET(ThLegoData, KTHREAD, LegoData), + OFFSET(ThLargeStack, KTHREAD, LargeStack), + OFFSET(ThUserTime, KTHREAD, UserTime), + OFFSET(ThSuspendSemaphore, KTHREAD, SuspendSemaphore), + OFFSET(ThSListFaultCount, KTHREAD, SListFaultCount), + OFFSET(ThThreadListEntry, KTHREAD, ThreadListEntry), + OFFSET(ThMutantListHead, KTHREAD, MutantListHead), + OFFSET(ThSListFaultAddress, KTHREAD, SListFaultAddress), + SIZE(KernelThreadObjectLength, KTHREAD), + SIZE(ExecutiveThreadObjectLength, ETHREAD), + + HEADER("KTIMER"), + OFFSET(TiType, KTIMER, Header.Type), + OFFSET(TiSize, KTIMER, Header.Size), + OFFSET(TiInserted, KTIMER, Header.Inserted), + OFFSET(TiSignalState, KTIMER, Header.SignalState), + OFFSET(TiDueTime, KTIMER, DueTime), + OFFSET(TiTimerListEntry, KTIMER, TimerListEntry), + OFFSET(TiDpc, KTIMER, Dpc), + OFFSET(TiPeriod, KTIMER, Period), + SIZE(TimerObjectLength, KTIMER), + + HEADER("TIME"), +// OFFSET(TmLowTime, TIME, LowTime), +// OFFSET(TmHighTime, TIME, HighTime), + +#if 0 + HEADER("SYSTEM_CONTEXT_SWITCH_INFORMATION (relative to FindAny)"), + RELOFFSET(TwFindAny, SYSTEM_CONTEXT_SWITCH_INFORMATION, FindAny, FindAny), + RELOFFSET(TwFindIdeal, SYSTEM_CONTEXT_SWITCH_INFORMATION, FindIdeal, FindAny), + RELOFFSET(TwFindLast, SYSTEM_CONTEXT_SWITCH_INFORMATION, FindLast, FindAny), + RELOFFSET(TwIdleAny, SYSTEM_CONTEXT_SWITCH_INFORMATION, IdleAny, FindAny), + RELOFFSET(TwIdleCurrent, SYSTEM_CONTEXT_SWITCH_INFORMATION, IdleCurrent, FindAny), + RELOFFSET(TwIdleIdeal, SYSTEM_CONTEXT_SWITCH_INFORMATION, IdleIdeal, FindAny), + RELOFFSET(TwIdleLast, SYSTEM_CONTEXT_SWITCH_INFORMATION, IdleLast, FindAny), + RELOFFSET(TwPreemptAny, SYSTEM_CONTEXT_SWITCH_INFORMATION, PreemptAny, FindAny), + RELOFFSET(TwPreemptCurrent, SYSTEM_CONTEXT_SWITCH_INFORMATION, PreemptCurrent, FindAny), + RELOFFSET(TwPreemptLast, SYSTEM_CONTEXT_SWITCH_INFORMATION, PreemptLast, FindAny), + RELOFFSET(TwSwitchToIdle, SYSTEM_CONTEXT_SWITCH_INFORMATION, SwitchToIdle, FindAny), +#endif + + HEADER("KUSER_SHARED_DATA"), + OFFSET(UsTickCountMultiplier, KUSER_SHARED_DATA, TickCountMultiplier), + OFFSET(UsInterruptTime, KUSER_SHARED_DATA, InterruptTime), + OFFSET(UsSystemTime, KUSER_SHARED_DATA, SystemTime), + OFFSET(UsTimeZoneBias, KUSER_SHARED_DATA, TimeZoneBias), + OFFSET(UsImageNumberLow, KUSER_SHARED_DATA, ImageNumberLow), + OFFSET(UsImageNumberHigh, KUSER_SHARED_DATA, ImageNumberHigh), + OFFSET(UsNtSystemRoot, KUSER_SHARED_DATA, NtSystemRoot), + OFFSET(UsMaxStackTraceDepth, KUSER_SHARED_DATA, MaxStackTraceDepth), + OFFSET(UsCryptoExponent, KUSER_SHARED_DATA, CryptoExponent), + OFFSET(UsTimeZoneId, KUSER_SHARED_DATA, TimeZoneId), + OFFSET(UsLargePageMinimum, KUSER_SHARED_DATA, LargePageMinimum), + OFFSET(UsReserved2, KUSER_SHARED_DATA, Reserved2), + OFFSET(UsNtProductType, KUSER_SHARED_DATA, NtProductType), + OFFSET(UsProductTypeIsValid, KUSER_SHARED_DATA, ProductTypeIsValid), + OFFSET(UsNtMajorVersion, KUSER_SHARED_DATA, NtMajorVersion), + OFFSET(UsNtMinorVersion, KUSER_SHARED_DATA, NtMinorVersion), + OFFSET(UsProcessorFeatures, KUSER_SHARED_DATA, ProcessorFeatures), + OFFSET(UsReserved1, KUSER_SHARED_DATA, Reserved1), + OFFSET(UsReserved3, KUSER_SHARED_DATA, Reserved3), + OFFSET(UsTimeSlip, KUSER_SHARED_DATA, TimeSlip), + OFFSET(UsAlternativeArchitecture, KUSER_SHARED_DATA, AlternativeArchitecture), + OFFSET(UsSystemExpirationDate, KUSER_SHARED_DATA, SystemExpirationDate), + OFFSET(UsSuiteMask, KUSER_SHARED_DATA, SuiteMask), + OFFSET(UsKdDebuggerEnabled, KUSER_SHARED_DATA, KdDebuggerEnabled), + OFFSET(UsActiveConsoleId, KUSER_SHARED_DATA, ActiveConsoleId), + OFFSET(UsDismountCount, KUSER_SHARED_DATA, DismountCount), + OFFSET(UsComPlusPackage, KUSER_SHARED_DATA, ComPlusPackage), + OFFSET(UsLastSystemRITEventTickCount, KUSER_SHARED_DATA, LastSystemRITEventTickCount), + OFFSET(UsNumberOfPhysicalPages, KUSER_SHARED_DATA, NumberOfPhysicalPages), + OFFSET(UsSafeBootMode, KUSER_SHARED_DATA, SafeBootMode), +// OFFSET(UsTscQpcData, KUSER_SHARED_DATA, TscQpcData), + OFFSET(UsTestRetInstruction, KUSER_SHARED_DATA, TestRetInstruction), + OFFSET(UsSystemCall, KUSER_SHARED_DATA, SystemCall), + OFFSET(UsSystemCallReturn, KUSER_SHARED_DATA, SystemCallReturn), + OFFSET(UsSystemCallPad, KUSER_SHARED_DATA, SystemCallPad), + OFFSET(UsTickCount, KUSER_SHARED_DATA, TickCount), + OFFSET(UsTickCountQuad, KUSER_SHARED_DATA, TickCountQuad), + OFFSET(UsWow64SharedInformation, KUSER_SHARED_DATA, Wow64SharedInformation), + + HEADER("KWAIT_BLOCK"), + OFFSET(WbWaitListEntry, KWAIT_BLOCK, WaitListEntry), + OFFSET(WbThread, KWAIT_BLOCK, Thread), + OFFSET(WbObject, KWAIT_BLOCK, Object), + OFFSET(WbNextWaitBlock, KWAIT_BLOCK, NextWaitBlock), + OFFSET(WbWaitKey, KWAIT_BLOCK, WaitKey), + OFFSET(WbWaitType, KWAIT_BLOCK, WaitType), + +#if defined(_M_IX86) + + HEADER("CONTEXT"), + OFFSET(CsContextFlags, CONTEXT, ContextFlags), + OFFSET(CsDr0, CONTEXT, Dr0), + OFFSET(CsDr1, CONTEXT, Dr1), + OFFSET(CsDr2, CONTEXT, Dr2), + OFFSET(CsDr3, CONTEXT, Dr3), + OFFSET(CsDr6, CONTEXT, Dr6), + OFFSET(CsDr7, CONTEXT, Dr7), + OFFSET(CsFloatSave, CONTEXT, FloatSave), + OFFSET(CsSegGs, CONTEXT, SegGs), + OFFSET(CsSegFs, CONTEXT, SegFs), + OFFSET(CsSegEs, CONTEXT, SegEs), + OFFSET(CsSegDs, CONTEXT, SegDs), + OFFSET(CsEdi, CONTEXT, Edi), + OFFSET(CsEsi, CONTEXT, Esi), + OFFSET(CsEbx, CONTEXT, Ebx), + OFFSET(CsEdx, CONTEXT, Edx), + OFFSET(CsEcx, CONTEXT, Ecx), + OFFSET(CsEax, CONTEXT, Eax), + OFFSET(CsEbp, CONTEXT, Ebp), + OFFSET(CsEip, CONTEXT, Eip), + OFFSET(CsSegCs, CONTEXT, SegCs), + OFFSET(CsEflags, CONTEXT, EFlags), + OFFSET(CsEsp, CONTEXT, Esp), + OFFSET(CsSegSs, CONTEXT, SegSs), + OFFSET(CsExtendedRegisters, CONTEXT, ExtendedRegisters), + SIZE(ContextFrameLength, CONTEXT), + SIZE(CONTEXT_LENGTH, CONTEXT), + + HEADER("KGDTENTRY"), + OFFSET(KgdtBaseLow, KGDTENTRY, BaseLow), + OFFSET(KgdtBaseMid, KGDTENTRY, HighWord.Bytes.BaseMid), + OFFSET(KgdtBaseHi, KGDTENTRY, HighWord.Bytes.BaseHi), + OFFSET(KgdtLimitHi, KGDTENTRY, HighWord.Bytes.Flags2), + OFFSET(KgdtLimitLow, KGDTENTRY, LimitLow), + + HEADER("KTRAP_FRAME"), + OFFSET(TsExceptionList, KTRAP_FRAME, ExceptionList), + OFFSET(TsPreviousPreviousMode, KTRAP_FRAME, PreviousPreviousMode), + OFFSET(TsSegGs, KTRAP_FRAME, SegGs), + OFFSET(TsSegFs, KTRAP_FRAME, SegFs), + OFFSET(TsSegEs, KTRAP_FRAME, SegEs), + OFFSET(TsSegDs, KTRAP_FRAME, SegDs), + OFFSET(TsEdi, KTRAP_FRAME, Edi), + OFFSET(TsEsi, KTRAP_FRAME, Esi), + OFFSET(TsEbp, KTRAP_FRAME, Ebp), + OFFSET(TsEbx, KTRAP_FRAME, Ebx), + OFFSET(TsEdx, KTRAP_FRAME, Edx), + OFFSET(TsEcx, KTRAP_FRAME, Ecx), + OFFSET(TsEax, KTRAP_FRAME, Eax), + OFFSET(TsErrCode, KTRAP_FRAME, ErrCode), + OFFSET(TsEip, KTRAP_FRAME, Eip), + OFFSET(TsSegCs, KTRAP_FRAME, SegCs), + OFFSET(TsEflags, KTRAP_FRAME, EFlags), + OFFSET(TsHardwareEsp, KTRAP_FRAME, HardwareEsp), + OFFSET(TsHardwareSegSs, KTRAP_FRAME, HardwareSegSs), + OFFSET(TsTempSegCs, KTRAP_FRAME, TempSegCs), +// OFFSET(TsLogging, KTRAP_FRAME, Logging), + OFFSET(TsTempEsp, KTRAP_FRAME, TempEsp), + OFFSET(TsDbgEbp, KTRAP_FRAME, DbgEbp), + OFFSET(TsDbgEip, KTRAP_FRAME, DbgEip), + OFFSET(TsDbgArgMark, KTRAP_FRAME, DbgArgMark), + OFFSET(TsDbgArgPointer, KTRAP_FRAME, DbgArgPointer), + OFFSET(TsDr0, KTRAP_FRAME, Dr0), + OFFSET(TsDr1, KTRAP_FRAME, Dr1), + OFFSET(TsDr2, KTRAP_FRAME, Dr2), + OFFSET(TsDr3, KTRAP_FRAME, Dr3), + OFFSET(TsDr6, KTRAP_FRAME, Dr6), + OFFSET(TsDr7, KTRAP_FRAME, Dr7), + OFFSET(TsV86Es, KTRAP_FRAME, V86Es), + OFFSET(TsV86Ds, KTRAP_FRAME, V86Ds), + OFFSET(TsV86Fs, KTRAP_FRAME, V86Fs), + OFFSET(TsV86Gs, KTRAP_FRAME, V86Gs), + SIZE(KTRAP_FRAME_LENGTH, KTRAP_FRAME), + CONSTANT(KTRAP_FRAME_ALIGN), + CONSTANT(FRAME_EDITED), + + HEADER("KTSS"), + OFFSET(TssEsp0, KTSS, Esp0), + OFFSET(TssCR3, KTSS, CR3), + OFFSET(TssEip, KTSS, Eip), + OFFSET(TssEFlags, KTSS, EFlags), + OFFSET(TssEax, KTSS, Eax), + OFFSET(TssEbx, KTSS, Ebx), + OFFSET(TssEcx, KTSS, Ecx), + OFFSET(TssEdx, KTSS, Edx), + OFFSET(TssEsp, KTSS, Esp), + OFFSET(TssEbp, KTSS, Ebp), + OFFSET(TssEsi, KTSS, Esi), + OFFSET(TssEdi, KTSS, Edi), + OFFSET(TssEs, KTSS, Es), + OFFSET(TssCs, KTSS, Cs), + OFFSET(TssSs, KTSS, Ss), + OFFSET(TssDs, KTSS, Ds), + OFFSET(TssFs, KTSS, Fs), + OFFSET(TssGs, KTSS, Gs), + OFFSET(TssLDT, KTSS, LDT), + OFFSET(TssIoMapBase, KTSS, IoMapBase), + OFFSET(TssIoMaps, KTSS, IoMaps), + SIZE(TssLength, KTSS), + +#elif defined(_M_AMD64) + + HEADER("Argument Home Address"), + OFFSET(P1Home, CONTEXT, P1Home), + OFFSET(P2Home, CONTEXT, P1Home), + OFFSET(P3Home, CONTEXT, P1Home), + OFFSET(P4Home, CONTEXT, P1Home), + + HEADER("CONTEXT"), + OFFSET(CxP1Home, CONTEXT, P1Home), + OFFSET(CxP2Home, CONTEXT, P2Home), + OFFSET(CxP3Home, CONTEXT, P3Home), + OFFSET(CxP4Home, CONTEXT, P4Home), + OFFSET(CxP5Home, CONTEXT, P5Home), + OFFSET(CxP6Home, CONTEXT, P6Home), + OFFSET(CxContextFlags, CONTEXT, ContextFlags), + OFFSET(CxMxCsr, CONTEXT, MxCsr), + OFFSET(CxSegCs, CONTEXT, SegCs), + OFFSET(CxSegDs, CONTEXT, SegDs), + OFFSET(CxSegEs, CONTEXT, SegEs), + OFFSET(CxSegFs, CONTEXT, SegFs), + OFFSET(CxSegGs, CONTEXT, SegGs), + OFFSET(CxSegSs, CONTEXT, SegSs), + OFFSET(CxEFlags, CONTEXT, EFlags), + OFFSET(CxDr0, CONTEXT, Dr0), + OFFSET(CxDr1, CONTEXT, Dr1), + OFFSET(CxDr2, CONTEXT, Dr2), + OFFSET(CxDr3, CONTEXT, Dr3), + OFFSET(CxDr6, CONTEXT, Dr6), + OFFSET(CxDr7, CONTEXT, Dr7), + OFFSET(CxRax, CONTEXT, Rax), + OFFSET(CxRcx, CONTEXT, Rcx), + OFFSET(CxRdx, CONTEXT, Rdx), + OFFSET(CxRbx, CONTEXT, Rbx), + OFFSET(CxRsp, CONTEXT, Rsp), + OFFSET(CxRbp, CONTEXT, Rbp), + OFFSET(CxRsi, CONTEXT, Rsi), + OFFSET(CxRdi, CONTEXT, Rdi), + OFFSET(CxR8, CONTEXT, R8), + OFFSET(CxR9, CONTEXT, R9), + OFFSET(CxR10, CONTEXT, R10), + OFFSET(CxR11, CONTEXT, R11), + OFFSET(CxR12, CONTEXT, R12), + OFFSET(CxR13, CONTEXT, R13), + OFFSET(CxR14, CONTEXT, R14), + OFFSET(CxR15, CONTEXT, R15), + OFFSET(CxRip, CONTEXT, Rip), + OFFSET(CxFltSave, CONTEXT, FltSave), + OFFSET(CxXmm0, CONTEXT, Xmm0), + OFFSET(CxXmm1, CONTEXT, Xmm1), + OFFSET(CxXmm2, CONTEXT, Xmm2), + OFFSET(CxXmm3, CONTEXT, Xmm3), + OFFSET(CxXmm4, CONTEXT, Xmm4), + OFFSET(CxXmm5, CONTEXT, Xmm5), + OFFSET(CxXmm6, CONTEXT, Xmm6), + OFFSET(CxXmm7, CONTEXT, Xmm7), + OFFSET(CxXmm8, CONTEXT, Xmm8), + OFFSET(CxXmm9, CONTEXT, Xmm9), + OFFSET(CxXmm10, CONTEXT, Xmm10), + OFFSET(CxXmm11, CONTEXT, Xmm11), + OFFSET(CxXmm12, CONTEXT, Xmm12), + OFFSET(CxXmm13, CONTEXT, Xmm13), + OFFSET(CxXmm14, CONTEXT, Xmm14), + OFFSET(CxXmm15, CONTEXT, Xmm15), + OFFSET(CxDebugControl, CONTEXT, DebugControl), + OFFSET(CxLastBranchToRip, CONTEXT, LastBranchToRip), + OFFSET(CxLastBranchFromRip, CONTEXT, LastBranchFromRip), + OFFSET(CxLastExceptionToRip, CONTEXT, LastExceptionToRip), + OFFSET(CxLastExceptionFromRip, CONTEXT, LastExceptionFromRip), + OFFSET(CxVectorControl, CONTEXT, VectorControl), + OFFSET(CxVectorRegister, CONTEXT, VectorRegister), + SIZE(CONTEXT_FRAME_LENGTH, CONTEXT), + + HEADER("DISPATCHER_CONTEXT"), + OFFSET(DcControlPc, TYPE, ControlPc), + OFFSET(DcImageBase, TYPE, ImageBase), + OFFSET(DcFunctionEntry, TYPE, FunctionEntry), + OFFSET(DcEstablisherFrame, TYPE, EstablisherFrame), + OFFSET(DcTargetIp, TYPE, TargetIp), + OFFSET(DcContextRecord, TYPE, ContextRecord), + OFFSET(DcLanguageHandler, TYPE, LanguageHandler), + OFFSET(DcHandlerData, TYPE, HandlerData), + OFFSET(DcHistoryTable, TYPE, HistoryTable), + OFFSET(DcScopeIndex, TYPE, ScopeIndex), + + HEADER("KEXCEPTION_FRAME"), + OFFSET(ExP1Home, KEXCEPTION_FRAME, P1Home), + OFFSET(ExP2Home, KEXCEPTION_FRAME, P2Home), + OFFSET(ExP3Home, KEXCEPTION_FRAME, P3Home), + OFFSET(ExP4Home, KEXCEPTION_FRAME, P4Home), + OFFSET(ExP5, KEXCEPTION_FRAME, P5), + OFFSET(ExXmm6, KEXCEPTION_FRAME, Xmm6), + OFFSET(ExXmm7, KEXCEPTION_FRAME, Xmm7), + OFFSET(ExXmm8, KEXCEPTION_FRAME, Xmm8), + OFFSET(ExXmm9, KEXCEPTION_FRAME, Xmm9), + OFFSET(ExXmm10, KEXCEPTION_FRAME, Xmm10), + OFFSET(ExXmm11, KEXCEPTION_FRAME, Xmm11), + OFFSET(ExXmm12, KEXCEPTION_FRAME, Xmm12), + OFFSET(ExXmm13, KEXCEPTION_FRAME, Xmm13), + OFFSET(ExXmm14, KEXCEPTION_FRAME, Xmm14), + OFFSET(ExXmm15, KEXCEPTION_FRAME, Xmm15), + OFFSET(ExMxCsr, KEXCEPTION_FRAME, MxCsr), + OFFSET(ExRbp, KEXCEPTION_FRAME, Rbp), + OFFSET(ExRbx, KEXCEPTION_FRAME, Rbx), + OFFSET(ExRdi, KEXCEPTION_FRAME, Rdi), + OFFSET(ExRsi, KEXCEPTION_FRAME, Rsi), + OFFSET(ExR12, KEXCEPTION_FRAME, R12), + OFFSET(ExR13, KEXCEPTION_FRAME, R13), + OFFSET(ExR14, KEXCEPTION_FRAME, R14), + OFFSET(ExR15, KEXCEPTION_FRAME, R15), + OFFSET(ExReturn, KEXCEPTION_FRAME, Return), + OFFSET(CuInitialStack, KEXCEPTION_FRAME, InitialStack), + OFFSET(CuTrapFrame, KEXCEPTION_FRAME, TrapFrame), + OFFSET(CuCallbackStack, KEXCEPTION_FRAME, CallbackStack), + OFFSET(CuOutputBuffer, KEXCEPTION_FRAME, OutputBuffer), + OFFSET(CuOutputLength, KEXCEPTION_FRAME, OutputLength), + SIZE(KEXCEPTION_FRAME_LENGTH, KEXCEPTION_FRAME), + + HEADER("JUMP_BUFFER"), + OFFSET(JbFrame, JUMP_BUFFER, Frame), + OFFSET(JbRbx, JUMP_BUFFER, Rbx), + OFFSET(JbRsp, JUMP_BUFFER, Rsp), + OFFSET(JbRbp, JUMP_BUFFER, Rbp), + OFFSET(JbRsi, JUMP_BUFFER, Rsi), + OFFSET(JbRdi, JUMP_BUFFER, Rdi), + OFFSET(JbR12, JUMP_BUFFER, R12), + OFFSET(JbR13, JUMP_BUFFER, R13), + OFFSET(JbR14, JUMP_BUFFER, R14), + OFFSET(JbR15, JUMP_BUFFER, R15), + OFFSET(JbRip, JUMP_BUFFER, Rip), + OFFSET(JbMxCsr, JUMP_BUFFER, MxCsr), + OFFSET(JbFpCsr, JUMP_BUFFER, FpCsr), + OFFSET(JbXmm6, JUMP_BUFFER, Xmm6), + OFFSET(JbXmm7, JUMP_BUFFER, Xmm7), + OFFSET(JbXmm8, JUMP_BUFFER, Xmm8), + OFFSET(JbXmm9, JUMP_BUFFER, Xmm9), + OFFSET(JbXmm10, JUMP_BUFFER, Xmm10), + OFFSET(JbXmm11, JUMP_BUFFER, Xmm11), + OFFSET(JbXmm12, JUMP_BUFFER, Xmm12), + OFFSET(JbXmm13, JUMP_BUFFER, Xmm13), + OFFSET(JbXmm14, JUMP_BUFFER, Xmm14), + OFFSET(JbXmm15, JUMP_BUFFER, Xmm15), + + HEADER("KGDT64"), + OFFSET(KgdtBaseLow, KGDT64, BaseLow), + OFFSET(KgdtBaseMiddle, KGDT64, BaseMiddle), + OFFSET(KgdtBaseHigh, KGDT64, BaseHigh), + OFFSET(KgdtBaseUpper, KGDT64, BaseUpper), + OFFSET(KgdtLimitHigh, KGDT64, LimitHigh), + OFFSET(KgdtLimitLow, KGDT64, LimitLow), + CONSTANT(KGDT_LIMIT_ENCODE_MASK), + + HEADER("KPRCB"), + OFFSET(PbMxCsr, KPRCB, MxCsr), + OFFSET(PbNumber, KPRCB, Number), + OFFSET(PbInterruptRequest, KPRCB, InterruptRequest), + OFFSET(PbIdleHalt, KPRCB, IdleHalt), + OFFSET(PbCurrentThread, KPRCB, CurrentThread), + OFFSET(PbNextThread, KPRCB, NextThread), + OFFSET(PbIdleThread, KPRCB, IdleThread), + OFFSET(PbNestingLevel, KPRCB, NestingLevel), + OFFSET(PbRspBase, KPRCB, RspBase), + OFFSET(PbPrcbLock, KPRCB, PrcbLock), + OFFSET(PbSetMember, KPRCB, SetMember), + OFFSET(PbProcessorState, KPRCB, ProcessorState), + OFFSET(PbCpuType, KPRCB, CpuType), + OFFSET(PbCpuID, KPRCB, CpuID), + OFFSET(PbCpuStep, KPRCB, CpuStep), + OFFSET(PbHalReserved, KPRCB, HalReserved), + OFFSET(PbMinorVersion, KPRCB, MinorVersion), + OFFSET(PbMajorVersion, KPRCB, MajorVersion), + OFFSET(PbBuildType, KPRCB, BuildType), + OFFSET(PbCpuVendor, KPRCB, CpuVendor), + OFFSET(PbCoresPerPhysicalProcessor, KPRCB, CoresPerPhysicalProcessor), + OFFSET(PbLogicalProcessorsPerCore, KPRCB, LogicalProcessorsPerCore), + OFFSET(PbApicMask, KPRCB, ApicMask), + OFFSET(PbCFlushSize, KPRCB, CFlushSize), + OFFSET(PbAcpiReserved, KPRCB, AcpiReserved), + OFFSET(PbInitialApicId, KPRCB, InitialApicId), + OFFSET(PbStride, KPRCB, Stride), + OFFSET(PbLockQueue, KPRCB, LockQueue), + OFFSET(PbPPLookasideList, KPRCB, PPLookasideList), + OFFSET(PbPPNPagedLookasideList, KPRCB, PPNPagedLookasideList), + OFFSET(PbPPPagedLookasideList, KPRCB, PPPagedLookasideList), + OFFSET(PbPacketBarrier, KPRCB, PacketBarrier), + OFFSET(PbDeferredReadyListHead, KPRCB, DeferredReadyListHead), + OFFSET(PbLookasideIrpFloat, KPRCB, LookasideIrpFloat), + OFFSET(PbSystemCalls, KPRCB, SystemCalls), + OFFSET(PbReadOperationCount, KPRCB, ReadOperationCount), + OFFSET(PbWriteOperationCount, KPRCB, WriteOperationCount), + OFFSET(PbOtherOperationCount, KPRCB, OtherOperationCount), + OFFSET(PbReadTransferCount, KPRCB, ReadTransferCount), + OFFSET(PbWriteTransferCount, KPRCB, WriteTransferCount), + OFFSET(PbOtherTransferCount, KPRCB, OtherTransferCount), + OFFSET(PbContextSwitches, KPRCB, ContextSwitches), + OFFSET(PbTargetSet, KPRCB, TargetSet), + OFFSET(PbIpiFrozen, KPRCB, IpiFrozen), + OFFSET(PbRequestMailbox, KPRCB, RequestMailbox), + OFFSET(PbSenderSummary, KPRCB, SenderSummary), + OFFSET(PbDpcListHead, KPRCB, DpcListHead), + OFFSET(PbDpcLock, KPRCB, DpcLock), + OFFSET(PbDpcQueueDepth, KPRCB, DpcQueueDepth), + OFFSET(PbDpcCount, KPRCB, DpcCount), + OFFSET(PbDpcStack, KPRCB, DpcStack), + OFFSET(PbMaximumDpcQueueDepth, KPRCB, MaximumDpcQueueDepth), + OFFSET(PbDpcRequestRate, KPRCB, DpcRequestRate), + OFFSET(PbMinimumDpcRate, KPRCB, MinimumDpcRate), + OFFSET(PbDpcInterruptRequested, KPRCB, DpcInterruptRequested), + OFFSET(PbDpcThreadRequested, KPRCB, DpcThreadRequested), + OFFSET(PbDpcRoutineActive, KPRCB, DpcRoutineActive), + OFFSET(PbDpcThreadActive, KPRCB, DpcThreadActive), + OFFSET(PbTimerHand, KPRCB, TimerHand), + OFFSET(PbTimerRequest, KPRCB, TimerRequest), + OFFSET(PbTickOffset, KPRCB, TickOffset), + OFFSET(PbMasterOffset, KPRCB, MasterOffset), + OFFSET(PbDpcLastCount, KPRCB, DpcLastCount), + OFFSET(PbQuantumEnd, KPRCB, QuantumEnd), + OFFSET(PbDpcSetEventRequest, KPRCB, DpcSetEventRequest), + OFFSET(PbIdleSchedule, KPRCB, IdleSchedule), + OFFSET(PbReadySummary, KPRCB, ReadySummary), + OFFSET(PbDispatcherReadyListHead, KPRCB, DispatcherReadyListHead), + OFFSET(PbInterruptCount, KPRCB, InterruptCount), + OFFSET(PbKernelTime, KPRCB, KernelTime), + OFFSET(PbUserTime, KPRCB, UserTime), + OFFSET(PbDpcTime, KPRCB, DpcTime), + OFFSET(PbInterruptTime, KPRCB, InterruptTime), + OFFSET(PbAdjustDpcThreshold, KPRCB, AdjustDpcThreshold), + OFFSET(PbSkipTick, KPRCB, SkipTick), + OFFSET(PbPollSlot, KPRCB, PollSlot), + OFFSET(PbParentNode, KPRCB, ParentNode), + OFFSET(PbMultiThreadProcessorSet, KPRCB, MultiThreadProcessorSet), + OFFSET(PbMultiThreadSetMaster, KPRCB, MultiThreadSetMaster), + OFFSET(PbStartCycles, KPRCB, StartCycles), + OFFSET(PbPageColor, KPRCB, PageColor), + OFFSET(PbNodeColor, KPRCB, NodeColor), + OFFSET(PbNodeShiftedColor, KPRCB,NodeShiftedColor), + OFFSET(PbSecondaryColorMask, KPRCB, SecondaryColorMask), + OFFSET(PbSleeping, KPRCB, Sleeping), + OFFSET(PbCycleTime, KPRCB, CycleTime), + OFFSET(PbFastReadNoWait, KPRCB, FastReadNoWait), + OFFSET(PbFastReadWait, KPRCB, FastReadWait), + OFFSET(PbFastReadNotPossible, KPRCB, FastReadNotPossible), + OFFSET(PbCopyReadNoWait, KPRCB, CopyReadNoWait), + OFFSET(PbCopyReadWait, KPRCB, CopyReadWait), + OFFSET(PbCopyReadNoWaitMiss, KPRCB, CopyReadNoWaitMiss), + OFFSET(PbAlignmentFixupCount, KPRCB, AlignmentFixupCount), + OFFSET(PbExceptionDispatchCount, KPRCB, ExceptionDispatchCount), + OFFSET(PbVendorString, KPRCB, VendorString), + OFFSET(PbPowerState, KPRCB, PowerState), + SIZE(ProcessorBlockLength, KPRCB), + + HEADER("KPCR"), + OFFSET(PcGdt, KPCR, Gdt), + OFFSET(PcTss, KPCR, Tss), + OFFSET(PcUserRsp, KPCR, UserRsp), + OFFSET(PcSelf, KPCR, Self), + OFFSET(PcCurrentPrcb, KPCR, CurrentPrcb), + OFFSET(PcLockArray, KPCR, LockArray), + OFFSET(PcTeb, KPCR, Teb), + OFFSET(PcIdt, KPCR, Idt), + OFFSET(PcIrql, KPCR, Irql), + OFFSET(PcStallScaleFactor, KPCR, StallScaleFactor), + OFFSET(PcHalReserved, KPCR, HalReserved), + OFFSET(PcPrcb, KPCR, Prcb), + OFFSET(PcMxCsr, KPCR, MxCsr), + OFFSET(PcNumber, KPCR, Number), + OFFSET(PcInterruptRequest, KPCR, InterruptRequest), + OFFSET(PcIdleHalt, KPCR, IdleHalt), + OFFSET(PcCurrentThread, KPCR, CurrentThread), + OFFSET(PcNextThread, KPCR, NextThread), + OFFSET(PcIdleThread, KPCR, IdleThread), + OFFSET(PcIpiFrozen, KPCR, IpiFrozen), + OFFSET(PcNestingLevel, KPCR, NestingLevel), + OFFSET(PcRspBase, KPCR, RspBase), + OFFSET(PcPrcbLock, KPCR, PrcbLock), + OFFSET(PcSetMember, KPCR, SetMember), + OFFSET(PcCr0, KPCR, Cr0), + OFFSET(PcCr2, KPCR, Cr2), + OFFSET(PcCr3, KPCR, Cr3), + OFFSET(PcCr4, KPCR, Cr4), + OFFSET(PcKernelDr0, KPCR, KernelDr0), + OFFSET(PcKernelDr1, KPCR, KernelDr1), + OFFSET(PcKernelDr2, KPCR, KernelDr2), + OFFSET(PcKernelDr3, KPCR, KernelDr3), + OFFSET(PcKernelDr7, KPCR, KernelDr7), + OFFSET(PcGdtrLimit, KPCR, GdtrLimit), + OFFSET(PcGdtrBase, KPCR, GdtrBase), + OFFSET(PcIdtrLimit, KPCR, IdtrLimit), + OFFSET(PcIdtrBase, KPCR, IdtrBase), + OFFSET(PcTr, KPCR, Tr), + OFFSET(PcLdtr, KPCR, Ldtr), + OFFSET(PcDebugControl, KPCR, DebugControl), + OFFSET(PcLastBranchToRip, KPCR, LastBranchToRip), + OFFSET(PcLastBranchFromRip, KPCR, LastBranchFromRip), + OFFSET(PcLastExceptionToRip, KPCR, LastExceptionToRip), + OFFSET(PcLastExceptionFromRip, KPCR, LastExceptionFromRip), + OFFSET(PcCr8, KPCR, Cr8), + OFFSET(PcCpuType, KPCR, CpuType), + OFFSET(PcCpuID, KPCR, CpuID), + OFFSET(PcCpuStep, KPCR, CpuStep), + OFFSET(PcCpuVendor, KPCR, CpuVendor), + OFFSET(PcVirtualApicAssist, KPCR, VirtualApicAssist), + OFFSET(PcCFlushSize, KPCR, CFlushSize), + OFFSET(PcDeferredReadyListHead, KPCR, DeferredReadyListHead), + OFFSET(PcSystemCalls, KPCR, SystemCalls), + OFFSET(PcDpcRoutineActive, KPCR, DpcRoutineActive), + OFFSET(PcInterruptCount, KPCR, InterruptCount), + OFFSET(PcDebuggerSavedIRQL, KPCR, DebuggerSavedIRQL), + OFFSET(PcTickOffset, KPCR, TickOffset), + OFFSET(PcMasterOffset, KPCR, MasterOffset), + OFFSET(PcSkipTick, KPCR, SkipTick), + OFFSET(PcStartCycles, KPCR, StartCycles), + SIZE(ProcessorControlRegisterLength, KPCR), + + HEADER("KPROCESSOR_STATE"), + OFFSET(PsSpecialRegisters, KPROCESSOR_STATE, SpecialRegisters), + OFFSET(PsCr0, KPROCESSOR_STATE, Cr0), + OFFSET(PsCr2, KPROCESSOR_STATE, Cr2), + OFFSET(PsCr3, KPROCESSOR_STATE, Cr3), + OFFSET(PsCr4, KPROCESSOR_STATE, Cr4), + OFFSET(PsKernelDr0, KPROCESSOR_STATE, KernelDr0), + OFFSET(PsKernelDr1, KPROCESSOR_STATE, KernelDr1), + OFFSET(PsKernelDr2, KPROCESSOR_STATE, KernelDr2), + OFFSET(PsKernelDr3, KPROCESSOR_STATE, KernelDr3), + OFFSET(PsKernelDr6, KPROCESSOR_STATE, KernelDr6), + OFFSET(PsKernelDr7, KPROCESSOR_STATE, KernelDr7), + OFFSET(PsGdtr, KPROCESSOR_STATE, Gdtr), + OFFSET(PsIdtr, KPROCESSOR_STATE, Idtr), + OFFSET(PsTr, KPROCESSOR_STATE, Tr), + OFFSET(PsLdtr, KPROCESSOR_STATE, Ldtr), + OFFSET(PsMxCsr, KPROCESSOR_STATE, MxCsr), + OFFSET(PsContextFrame, KPROCESSOR_STATE, ContextFrame), + OFFSET(PsDebugControl, KPROCESSOR_STATE, DebugControl), + OFFSET(PsLastBranchToRip, KPROCESSOR_STATE, LastBranchToRip), + OFFSET(PsLastBranchFromRip, KPROCESSOR_STATE, LastBranchFromRip), + OFFSET(PsLastExceptionToRip, KPROCESSOR_STATE, LastExceptionToRip), + OFFSET(PsLastExceptionFromRip, KPROCESSOR_STATE, LastExceptionFromRip), + OFFSET(PsCr8, KPROCESSOR_STATE, Cr8), + SIZE(ProcessorStateLength, KPROCESSOR_STATE), + + HEADER("KSTART_FRAME"), + OFFSET(SfP1Home, KSTART_FRAME, P1Home), + OFFSET(SfP2Home, KSTART_FRAME, P2Home), + OFFSET(SfP3Home, KSTART_FRAME, P3Home), + OFFSET(SfP4Home, KSTART_FRAME, P4Home), + OFFSET(SfReturn, KSTART_FRAME, Return), + SIZE(KSTART_FRAME_LENGTH, KSTART_FRAME), + + HEADER("KSPECIAL_REGISTERS"), + OFFSET(SrKernelDr0, KSPECIAL_REGISTERS, KernelDr0), + OFFSET(SrKernelDr1, KSPECIAL_REGISTERS, KernelDr1), + OFFSET(SrKernelDr2, KSPECIAL_REGISTERS, KernelDr2), + OFFSET(SrKernelDr3, KSPECIAL_REGISTERS, KernelDr3), + OFFSET(SrKernelDr6, KSPECIAL_REGISTERS, KernelDr6), + OFFSET(SrKernelDr7, KSPECIAL_REGISTERS, KernelDr7), + OFFSET(SrGdtr, KSPECIAL_REGISTERS, Gdtr), + OFFSET(SrIdtr, KSPECIAL_REGISTERS, Idtr), + OFFSET(SrTr, KSPECIAL_REGISTERS, Tr), + OFFSET(SrMxCsr, KSPECIAL_REGISTERS, MxCsr), + OFFSET(SrMsrGsBase, KSPECIAL_REGISTERS, MsrGsBase), + OFFSET(SrMsrGsSwap, KSPECIAL_REGISTERS, MsrGsSwap), + OFFSET(SrMsrStar, KSPECIAL_REGISTERS, MsrStar), + OFFSET(SrMsrLStar, KSPECIAL_REGISTERS, MsrLStar), + OFFSET(SrMsrCStar, KSPECIAL_REGISTERS, MsrCStar), + OFFSET(SrMsrSyscallMask, KSPECIAL_REGISTERS, MsrSyscallMask), + + HEADER("KSYSTEM_TIME"), + OFFSET(StLowTime, KSYSTEM_TIME, LowTime), + OFFSET(StHigh1Time, KSYSTEM_TIME, High1Time), + OFFSET(StHigh2Time, KSYSTEM_TIME, High2Time), + + HEADER("KSWITCH_FRAME"), + OFFSET(SwP5Home, KSWITCH_FRAME, P5Home), + OFFSET(SwApcBypass, KSWITCH_FRAME, ApcBypass), + OFFSET(SwRbp, KSWITCH_FRAME, Rbp), + OFFSET(SwReturn, KSWITCH_FRAME, Return), + SIZE(SwitchFrameLength, KSWITCH_FRAME), + SIZE(KSWITCH_FRAME_LENGTH, KSWITCH_FRAME), + + HEADER("KTRAP_FRAME"), + OFFSET(TrP1Home, KTRAP_FRAME, P1Home), + OFFSET(TrP2Home, KTRAP_FRAME, P2Home), + OFFSET(TrP3Home, KTRAP_FRAME, P3Home), + OFFSET(TrP4Home, KTRAP_FRAME, P4Home), + OFFSET(TrP5, KTRAP_FRAME, P5), + OFFSET(TrPreviousMode, KTRAP_FRAME, PreviousMode), + OFFSET(TrPreviousIrql, KTRAP_FRAME, PreviousIrql), + OFFSET(TrFaultIndicator, KTRAP_FRAME, FaultIndicator), + OFFSET(TrExceptionActive, KTRAP_FRAME, ExceptionActive), + OFFSET(TrMxCsr, KTRAP_FRAME, MxCsr), + OFFSET(TrRax, KTRAP_FRAME, Rax), + OFFSET(TrRcx, KTRAP_FRAME, Rcx), + OFFSET(TrRdx, KTRAP_FRAME, Rdx), + OFFSET(TrR8, KTRAP_FRAME, R8), + OFFSET(TrR9, KTRAP_FRAME, R9), + OFFSET(TrR10, KTRAP_FRAME, R10), + OFFSET(TrR11, KTRAP_FRAME, R11), + OFFSET(TrGsBase, KTRAP_FRAME, GsBase), + OFFSET(TrGsSwap, KTRAP_FRAME,GsSwap), + OFFSET(TrXmm0, KTRAP_FRAME, Xmm0), + OFFSET(TrXmm1, KTRAP_FRAME, Xmm1), + OFFSET(TrXmm2, KTRAP_FRAME, Xmm2), + OFFSET(TrXmm3, KTRAP_FRAME, Xmm3), + OFFSET(TrXmm4, KTRAP_FRAME, Xmm4), + OFFSET(TrXmm5, KTRAP_FRAME, Xmm5), + OFFSET(TrFaultAddress, KTRAP_FRAME, FaultAddress), + OFFSET(TrTimeStampCKCL, KTRAP_FRAME, TimeStampCKCL), + OFFSET(TrDr0, KTRAP_FRAME, Dr0), + OFFSET(TrDr1, KTRAP_FRAME, Dr1), + OFFSET(TrDr2, KTRAP_FRAME, Dr2), + OFFSET(TrDr3, KTRAP_FRAME, Dr3), + OFFSET(TrDr6, KTRAP_FRAME, Dr6), + OFFSET(TrDr7, KTRAP_FRAME, Dr7), + OFFSET(TrDebugControl, KTRAP_FRAME, DebugControl), + OFFSET(TrLastBranchToRip, KTRAP_FRAME, LastBranchToRip), + OFFSET(TrLastBranchFromRip, KTRAP_FRAME, LastBranchFromRip), + OFFSET(TrLastExceptionToRip, KTRAP_FRAME, LastExceptionToRip), + OFFSET(TrLastExceptionFromRip, KTRAP_FRAME, LastExceptionFromRip), + OFFSET(TrLastBranchControl, KTRAP_FRAME, LastBranchControl), + OFFSET(TrLastBranchMSR, KTRAP_FRAME, LastBranchMSR), + OFFSET(TrSegDs, KTRAP_FRAME, SegDs), + OFFSET(TrSegEs, KTRAP_FRAME, SegEs), + OFFSET(TrSegFs, KTRAP_FRAME, SegFs), + OFFSET(TrSegGs, KTRAP_FRAME, SegGs), + OFFSET(TrTrapFrame, KTRAP_FRAME, TrapFrame), + OFFSET(TrRbx, KTRAP_FRAME, Rbx), + OFFSET(TrRdi, KTRAP_FRAME, Rdi), + OFFSET(TrRsi, KTRAP_FRAME, Rsi), + OFFSET(TrRbp, KTRAP_FRAME, Rbp), + OFFSET(TrErrorCode, KTRAP_FRAME, ErrorCode), + OFFSET(TrTimeStampKlog, KTRAP_FRAME, TimeStampKlog), + OFFSET(TrRip, KTRAP_FRAME, Rip), + OFFSET(TrSegCs, KTRAP_FRAME, SegCs), + OFFSET(TrLogging, KTRAP_FRAME, Logging), + OFFSET(TrEFlags, KTRAP_FRAME, EFlags), + OFFSET(TrRsp, KTRAP_FRAME, Rsp), + OFFSET(TrSegSs, KTRAP_FRAME, SegSs), + OFFSET(TrCodePatchCycle, KTRAP_FRAME, CodePatchCycle), + SIZE(KTRAP_FRAME_LENGTH, KTRAP_FRAME), + + HEADER("KTIMER_TABLE"), + OFFSET(TtEntry, KTIMER_TABLE, TimerEntries), + OFFSET(TtTime, KTIMER_TABLE, Time), + SIZE(TIMER_ENTRY_SIZE, KTIMER_ENTRY), + SIZE(TIMER_TABLE_SIZE, KTIMER_TABLE), + SIZE(KTIMER_TABLE_SIZE, KTIMER_TABLE), + + HEADER("KTSS"), + OFFSET(TssRsp0, TYPE, Rsp0), + OFFSET(TssRsp1, TYPE, Rsp1), + OFFSET(TssRsp2, TYPE, Rsp2), + OFFSET(TssPanicStack, TYPE, PanicStack), + OFFSET(TssMcaStack, TYPE, McaStack), + OFFSET(TssNmiStack, TYPE, NmiStack), + OFFSET(TssIoMapBase, TYPE, IoMapBase), + SIZE(TssLength, TYPE), + +#endif + + /* End of list */ + {-1, "", 0} +}; + diff --git a/tools/geninc/geninc.rbuild b/tools/geninc/geninc.rbuild new file mode 100644 index 00000000000..9d2be75348d --- /dev/null +++ b/tools/geninc/geninc.rbuild @@ -0,0 +1,10 @@ + + + + + geninc.c + + + data.c + + diff --git a/tools/hpp/hpp.rbuild b/tools/hpp/hpp.rbuild new file mode 100644 index 00000000000..165dd0c3d11 --- /dev/null +++ b/tools/hpp/hpp.rbuild @@ -0,0 +1,6 @@ + + + + . + hpp.c + diff --git a/tools/kbdtool/kbdtool.rbuild b/tools/kbdtool/kbdtool.rbuild new file mode 100644 index 00000000000..ac715ddac17 --- /dev/null +++ b/tools/kbdtool/kbdtool.rbuild @@ -0,0 +1,8 @@ + + + + data.c + main.c + output.c + parser.c + \ No newline at end of file diff --git a/tools/log2lines/log2lines.mak b/tools/log2lines/log2lines.mak new file mode 100644 index 00000000000..d19d6c09a9a --- /dev/null +++ b/tools/log2lines/log2lines.mak @@ -0,0 +1,99 @@ +RSYM_BASE = $(TOOLS_BASE)$(SEP)rsym +RSYM_BASE_ = $(RSYM_BASE)$(SEP) +LOG2LINES_BASE = $(TOOLS_BASE_)log2lines +LOG2LINES_BASE_ = $(LOG2LINES_BASE)$(SEP) + +LOG2LINES_INT = $(INTERMEDIATE_)$(LOG2LINES_BASE) +LOG2LINES_INT_ = $(LOG2LINES_INT)$(SEP) +LOG2LINES_OUT = $(OUTPUT_)$(LOG2LINES_BASE) +LOG2LINES_OUT_ = $(LOG2LINES_OUT)$(SEP) + +$(LOG2LINES_INT): | $(TOOLS_INT) + $(ECHO_MKDIR) + ${mkdir} $@ + +ifneq ($(INTERMEDIATE),$(OUTPUT)) +$(LOG2LINES_OUT): | $(TOOLS_OUT) + $(ECHO_MKDIR) + ${mkdir} $@ +endif + +LOG2LINES_TARGET = \ + $(LOG2LINES_OUT_)log2lines$(EXEPOSTFIX) + +LOG2LINES_SOURCES = \ + $(LOG2LINES_BASE_)list.c \ + $(LOG2LINES_BASE_)util.c \ + $(LOG2LINES_BASE_)options.c \ + $(LOG2LINES_BASE_)help.c \ + $(LOG2LINES_BASE_)cache.c \ + $(LOG2LINES_BASE_)image.c \ + $(LOG2LINES_BASE_)stat.c \ + $(LOG2LINES_BASE_)revision.c \ + $(LOG2LINES_BASE_)cmd.c \ + $(LOG2LINES_BASE_)match.c \ + $(LOG2LINES_BASE_)log2lines.c \ + $(RSYM_BASE_)rsym_common.c + +LOG2LINES_OBJECTS = \ + $(addprefix $(INTERMEDIATE_), $(LOG2LINES_SOURCES:.c=.o)) + +LOG2LINES_HOST_CFLAGS = $(TOOLS_CFLAGS) -I $(RSYM_BASE) + +LOG2LINES_HOST_LFLAGS = $(TOOLS_LFLAGS) + +.PHONY: log2lines +log2lines: $(LOG2LINES_TARGET) + +$(LOG2LINES_TARGET): $(LOG2LINES_OBJECTS) | $(LOG2LINES_OUT) + $(ECHO_HOSTLD) + ${host_gcc} $(LOG2LINES_OBJECTS) $(LOG2LINES_HOST_LFLAGS) -o $@ + +$(LOG2LINES_INT_)log2lines.o: $(LOG2LINES_BASE_)log2lines.c | $(LOG2LINES_INT) + $(ECHO_HOSTCC) + ${host_gcc} $(LOG2LINES_HOST_CFLAGS) -c $< -o $@ + +$(LOG2LINES_INT_)util.o: $(LOG2LINES_BASE_)util.c | $(LOG2LINES_INT) + $(ECHO_HOSTCC) + ${host_gcc} $(LOG2LINES_HOST_CFLAGS) -c $< -o $@ + +$(LOG2LINES_INT_)list.o: $(LOG2LINES_BASE_)list.c | $(LOG2LINES_INT) + $(ECHO_HOSTCC) + ${host_gcc} $(LOG2LINES_HOST_CFLAGS) -c $< -o $@ + +$(LOG2LINES_INT_)options.o: $(LOG2LINES_BASE_)options.c | $(LOG2LINES_INT) + $(ECHO_HOSTCC) + ${host_gcc} $(LOG2LINES_HOST_CFLAGS) -c $< -o $@ + +$(LOG2LINES_INT_)help.o: $(LOG2LINES_BASE_)help.c | $(LOG2LINES_INT) + $(ECHO_HOSTCC) + ${host_gcc} $(LOG2LINES_HOST_CFLAGS) -c $< -o $@ + +$(LOG2LINES_INT_)cache.o: $(LOG2LINES_BASE_)cache.c | $(LOG2LINES_INT) + $(ECHO_HOSTCC) + ${host_gcc} $(LOG2LINES_HOST_CFLAGS) -c $< -o $@ + +$(LOG2LINES_INT_)image.o: $(LOG2LINES_BASE_)image.c | $(LOG2LINES_INT) + $(ECHO_HOSTCC) + ${host_gcc} $(LOG2LINES_HOST_CFLAGS) -c $< -o $@ + +$(LOG2LINES_INT_)stat.o: $(LOG2LINES_BASE_)stat.c | $(LOG2LINES_INT) + $(ECHO_HOSTCC) + ${host_gcc} $(LOG2LINES_HOST_CFLAGS) -c $< -o $@ + +$(LOG2LINES_INT_)revision.o: $(LOG2LINES_BASE_)revision.c | $(LOG2LINES_INT) + $(ECHO_HOSTCC) + ${host_gcc} $(LOG2LINES_HOST_CFLAGS) -c $< -o $@ + +$(LOG2LINES_INT_)cmd.o: $(LOG2LINES_BASE_)cmd.c | $(LOG2LINES_INT) + $(ECHO_HOSTCC) + ${host_gcc} $(LOG2LINES_HOST_CFLAGS) -c $< -o $@ + +$(LOG2LINES_INT_)match.o: $(LOG2LINES_BASE_)match.c | $(LOG2LINES_INT) + $(ECHO_HOSTCC) + ${host_gcc} $(LOG2LINES_HOST_CFLAGS) -c $< -o $@ + +.PHONY: log2lines_clean +log2lines_clean: + -@$(rm) $(LOG2LINES_TARGET) $(LOG2LINES_OBJECTS) 2>$(NUL) +clean: log2lines_clean diff --git a/tools/mkhive/mkhive.rbuild b/tools/mkhive/mkhive.rbuild new file mode 100644 index 00000000000..26a95fa232c --- /dev/null +++ b/tools/mkhive/mkhive.rbuild @@ -0,0 +1,19 @@ + + + + . + . + . + . + + -fshort-wchar + newinflibhost + cmlibhost + unicode + binhive.c + cmi.c + mkhive.c + reginf.c + registry.c + rtl.c + diff --git a/tools/nandflash/nandflash.rbuild b/tools/nandflash/nandflash.rbuild new file mode 100644 index 00000000000..b8529b7c846 --- /dev/null +++ b/tools/nandflash/nandflash.rbuild @@ -0,0 +1,5 @@ + + + + main.c + diff --git a/tools/ofw_interface/ofw_interface.mak b/tools/ofw_interface/ofw_interface.mak new file mode 100644 index 00000000000..a6b2f8698fd --- /dev/null +++ b/tools/ofw_interface/ofw_interface.mak @@ -0,0 +1,63 @@ +OFW_INTERFACE_BASE = $(TOOLS_BASE_)ofw_interface +OFW_INTERFACE_BASE_ = $(OFW_INTERFACE_BASE)$(SEP) +OFW_INTERFACE_INT = $(INTERMEDIATE_)$(OFW_INTERFACE_BASE) +OFW_INTERFACE_INT_ = $(OFW_INTERFACE_INT)$(SEP) +OFW_INTERFACE_OUT = $(OUTPUT_)$(OFW_INTERFACE_BASE) +OFW_INTERFACE_OUT_ = $(OFW_INTERFACE_OUT)$(SEP) + +OFW_INTERFACE_OUTPUT = boot/freeldr/freeldr/arch/powerpc/ofw_calls.s +OFW_INTERFACE_SOURCE = boot/freeldr/freeldr/arch/powerpc/ofw.c +OFW_INTERFACE_HEADER = boot/freeldr/freeldr/include/of_call.h +OFW_INTERFACE_INPUT = $(OFW_INTERFACE_BASE_)calls.ofw +OFW_INTERFACE_SERVICE_FILES = \ + $(OFW_INTERFACE_OUTPUT) \ + $(OFW_INTERFACE_SOURCE) \ + $(OFW_INTERFACE_HEADER) + +$(OFW_INTERFACE_INT): | $(TOOLS_INT) + $(ECHO_MKDIR) + ${mkdir} $@ + +ifneq ($(INTERMEDIATE),$(OUTPUT)) +$(OFW_INTERFACE_OUT): | $(TOOLS_OUT) + $(ECHO_MKDIR) + ${mkdir} $@ +endif + +OFW_INTERFACE_TARGET = \ + $(OFW_INTERFACE_OUT_)ofw_interface$(EXEPOSTFIX) + +OFW_INTERFACE_SOURCES = $(addprefix $(OFW_INTERFACE_BASE_), \ + ofw_interface.cpp \ + ) + +OFW_INTERFACE_OBJECTS = \ + $(addprefix $(INTERMEDIATE_), $(OFW_INTERFACE_SOURCES:.cpp=.o)) + +OFW_INTERFACE_HOST_CFLAGS = $(TOOLS_CFLAGS) + +OFW_INTERFACE_HOST_LFLAGS = $(TOOLS_LFLAGS) + +$(OFW_INTERFACE_TARGET): $(OFW_INTERFACE_OBJECTS) | $(OFW_INTERFACE_OUT) + $(ECHO_HOSTLD) + ${host_gpp} $(OFW_INTERFACE_OBJECTS) $(OFW_INTERFACE_HOST_LFLAGS) -o $@ + +$(OFW_INTERFACE_INT_)ofw_interface.o: $(OFW_INTERFACE_BASE_)ofw_interface.cpp | $(OFW_INTERFACE_INT) + $(ECHO_HOSTCC) + ${host_gpp} $(OFW_INTERFACE_HOST_CFLAGS) -c $< -o $@ + +$(OFW_INTERFACE_SERVICE_FILES): $(OFW_INTERFACE_TARGET) $(OFW_INTERFACE_INPUT) + $(ECHO_OFW) + $(Q)$(OFW_INTERFACE_TARGET) \ + $(OFW_INTERFACE_INPUT) \ + $(OFW_INTERFACE_OUTPUT) \ + $(OFW_INTERFACE_SOURCE) \ + $(OFW_INTERFACE_HEADER) + +.PHONY: ofw_interface +ofw_interface: $(OFW_INTERFACE_TARGET) + +.PHONY: ofw_interface_clean +ofw_interface_clean: + -@$(rm) $(OFW_INTERFACE_TARGET) $(OFW_INTERFACE_OBJECTS) 2>$(NUL) +clean: ofw_interface_clean diff --git a/tools/pefixup.mak b/tools/pefixup.mak new file mode 100644 index 00000000000..aae563adb42 --- /dev/null +++ b/tools/pefixup.mak @@ -0,0 +1,36 @@ +PEFIXUP_BASE = $(TOOLS_BASE) +PEFIXUP_BASE_ = $(PEFIXUP_BASE)$(SEP) + +PEFIXUP_INT = $(INTERMEDIATE_)$(PEFIXUP_BASE) +PEFIXUP_INT_ = $(PEFIXUP_INT)$(SEP) +PEFIXUP_OUT = $(OUTPUT_)$(PEFIXUP_BASE) +PEFIXUP_OUT_ = $(PEFIXUP_OUT)$(SEP) + +PEFIXUP_TARGET = \ + $(PEFIXUP_OUT_)pefixup$(EXEPOSTFIX) + +PEFIXUP_SOURCES = \ + $(PEFIXUP_BASE_)pefixup.c + +PEFIXUP_OBJECTS = \ + $(addprefix $(INTERMEDIATE_), $(PEFIXUP_SOURCES:.c=.o)) + +PEFIXUP_HOST_CFLAGS = $(TOOLS_CFLAGS) + +PEFIXUP_HOST_LFLAGS = $(TOOLS_LFLAGS) + +.PHONY: pefixup +pefixup: $(PEFIXUP_TARGET) + +$(PEFIXUP_TARGET): $(PEFIXUP_OBJECTS) | $(PEFIXUP_OUT) + $(ECHO_HOSTLD) + ${host_gcc} $(PEFIXUP_OBJECTS) $(PEFIXUP_HOST_LFLAGS) -o $@ + +$(PEFIXUP_INT_)pefixup.o: $(PEFIXUP_BASE_)pefixup.c | $(PEFIXUP_INT) + $(ECHO_HOSTCC) + ${host_gcc} $(PEFIXUP_HOST_CFLAGS) -c $< -o $@ + +.PHONY: pefixup_clean +pefixup_clean: + -@$(rm) $(PEFIXUP_TARGET) $(PEFIXUP_OBJECTS) 2>$(NUL) +clean: pefixup_clean diff --git a/tools/pipetools/pipetools.mak b/tools/pipetools/pipetools.mak new file mode 100644 index 00000000000..22eca3d6cbf --- /dev/null +++ b/tools/pipetools/pipetools.mak @@ -0,0 +1,47 @@ +PIPETOOLS_BASE = $(TOOLS_BASE)$(SEP)pipetools +PIPETOOLS_BASE_ = $(PIPETOOLS_BASE)$(SEP) +PIPETOOLS_INT = $(INTERMEDIATE_)$(PIPETOOLS_BASE) +PIPETOOLS_INT_ = $(PIPETOOLS_INT)$(SEP) +PIPETOOLS_OUT = $(OUTPUT_)$(PIPETOOLS_BASE) +PIPETOOLS_OUT_ = $(PIPETOOLS_OUT)$(SEP) + +$(PIPETOOLS_INT): | $(TOOLS_INT) + $(ECHO_MKDIR) + ${mkdir} $@ + +ifneq ($(INTERMEDIATE),$(OUTPUT)) +$(PIPETOOLS_OUT): | $(TOOLS_OUT) + $(ECHO_MKDIR) + ${mkdir} $@ +endif + + +PIPETOOLS_TARGET = \ + $(PIPETOOLS_OUT_)piperead$(EXEPOSTFIX) + +PIPETOOLS_SOURCES = \ + $(PIPETOOLS_BASE_)piperead.cpp + +PIPETOOLS_OBJECTS = \ + $(addprefix $(INTERMEDIATE_), $(PIPETOOLS_SOURCES:.cpp=.o)) + +PIPETOOLS_HOST_CFLAGS = $(TOOLS_CFLAGS) + +PIPETOOLS_HOST_LFLAGS = $(TOOLS_LFLAGS) + +.PHONY: pipetools +pipetools: $(PIPETOOLS_TARGET) + +$(PIPETOOLS_TARGET): $(PIPETOOLS_OBJECTS) | $(PIPETOOLS_OUT) + $(ECHO_HOSTLD) + ${host_gcc} $(PIPETOOLS_OBJECTS) $(PIPETOOLS_HOST_LFLAGS) -o $@ + +$(PIPETOOLS_INT_)piperead.o: $(PIPETOOLS_BASE_)piperead.cpp | $(PIPETOOLS_INT) + $(ECHO_HOSTCC) + ${host_gcc} $(PIPETOOLS_HOST_CFLAGS) -c $< -o $@ + + +.PHONY: pipetools_clean +pipetools_clean: + -@$(rm) $(PIPETOOLS_TARGET) $(PIPETOOLS_OBJECTS) 2>$(NUL) +clean: pipetools_clean diff --git a/tools/rbuild/automaticdependency.cpp b/tools/rbuild/automaticdependency.cpp new file mode 100644 index 00000000000..65b5f0165f5 --- /dev/null +++ b/tools/rbuild/automaticdependency.cpp @@ -0,0 +1,560 @@ +/* + * Copyright (C) 2005 Casper S. Hornstrup + * Copyright (C) 2007 Hervé Poussineau + * + * This program is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation; either version 2 of the License, or + * (at your option) any later version. + * + * This program 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 General Public License for more details. + * + * You should have received a copy of the GNU General Public License along + * with this program; if not, write to the Free Software Foundation, Inc., + * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. + */ +#include "pch.h" +#include +#include + +#include "rbuild.h" + +/* Read at most this amount of bytes from each file and assume that all #includes are located within this block */ +#define MAX_BYTES_TO_READ 4096 + +using std::string; +using std::vector; +using std::map; + +SourceFile::SourceFile ( AutomaticDependency* automaticDependency, + const Module& module, + const File& file, + SourceFile* parent ) + : file ( file ), + automaticDependency ( automaticDependency), + module ( module ), + youngestLastWriteTime ( 0 ) +{ + if (parent != NULL ) + parents.push_back ( parent ); +} + +void +SourceFile::Close () +{ + buf.resize ( 0 ); + p = end = NULL; +} + +void +SourceFile::Open () +{ + struct stat statbuf; + string filename = file.GetFullPath (); + + Close (); + FILE* f = fopen ( filename.c_str (), "rb" ); + if ( !f ) + throw FileNotFoundException ( filename ); + + if ( fstat ( fileno ( f ), &statbuf ) != 0 ) + { + fclose ( f ); + throw AccessDeniedException ( filename ); + } + lastWriteTime = statbuf.st_mtime; + + unsigned long len = (unsigned long) filelen ( f ); + if ( len > MAX_BYTES_TO_READ ) + len = MAX_BYTES_TO_READ; + buf.resize ( len ); + fread ( &buf[0], 1, len, f ); + fclose ( f ); + p = buf.c_str (); + end = p + len; +} + +void +SourceFile::SkipWhitespace () +{ + while ( p < end && isspace ( *p )) + p++; +} + +bool +SourceFile::ReadInclude ( string& filename, + bool& searchCurrentDirectory, + bool& includeNext) +{ + while ( p < end ) + { + if ( p != buf.c_str () ) + { + /* Go to end of line */ + while ( *p != '\n' && p < end ) + p++; + SkipWhitespace (); + } + if ( ( end - p > 13 ) && ( *p == '#') ) + { + bool include = false; + p++; + SkipWhitespace (); + if ( *p == 'i' ) + { + if ( strncmp ( p, "include ", 8 ) == 0 ) + { + p += 8; + includeNext = false; + include = true; + } + if ( strncmp ( p, "include_next ", 13 ) == 0 ) + { + p += 13; + includeNext = true; + include = true; + } + + if ( include ) + { + SkipWhitespace (); + if ( p < end ) + { + register char ch = *p; + if ( ch == '<' || ch == '"' ) + { + searchCurrentDirectory = (ch == '"'); + p++; + filename.resize ( MAX_PATH ); + int i = 0; + ch = *p; + while ( p < end && ch != '>' && ch != '"' && ch != '\n' ) + { + filename[i++] = *p; + p++; + if ( p < end ) + ch = *p; + } + filename.resize ( i ); + return true; + } + } + } + } + } + p++; + } + filename = ""; + searchCurrentDirectory = false; + includeNext = false; + return false; +} + +bool +SourceFile::IsParentOf ( const SourceFile* parent, + const SourceFile* child ) +{ + size_t i; + for ( i = 0; i < child->parents.size (); i++ ) + { + if ( child->parents[i] != NULL ) + { + if ( child->parents[i] == parent ) + return true; + } + } + for ( i = 0; i < child->parents.size (); i++ ) + { + if ( child->parents[i] != NULL ) + { + if ( IsParentOf ( parent, + child->parents[i] ) ) + return true; + } + } + return false; +} + +bool +SourceFile::IsIncludedFrom ( const File& file ) +{ + SourceFile* sourceFile = automaticDependency->RetrieveFromCache ( file ); + if ( sourceFile == NULL ) + return false; + + if ( sourceFile == this ) + return true; + + return IsParentOf ( sourceFile, + this ); +} + +bool +SourceFile::CanProcessFile ( const File& file ) +{ + string extension = GetExtension ( file.file ); + std::transform ( extension.begin (), extension.end (), extension.begin (), tolower ); + if ( extension == ".h" ) + return true; + if ( extension == ".c" ) + return true; + if ( extension == ".cpp" ) + return true; + if ( extension == ".rc" ) + return true; + if ( extension == ".s" ) + return true; + if ( extension == ".nls" ) + return true; + if ( extension == ".idl" ) + return true; + if ( automaticDependency->project.configuration.Verbose ) + printf ( "Skipping file %s, as its extension is not recognized\n", file.file.name.c_str () ); + return false; +} + +SourceFile* +SourceFile::ParseFile ( const File& file ) +{ + if ( !CanProcessFile ( file ) ) + return NULL; + + if ( IsIncludedFrom ( file ) ) + return NULL; + + SourceFile* sourceFile = automaticDependency->RetrieveFromCacheOrParse ( module, + file, + this ); + return sourceFile; +} + +void +SourceFile::Parse () +{ + Open (); + while ( p < end ) + { + string includedFilename; + + bool searchCurrentDirectory; + bool includeNext; + while ( ReadInclude ( includedFilename, + searchCurrentDirectory, + includeNext ) ) + { + File resolvedFile ( SourceDirectory, "", "", false, "", false ) ; + bool locatedFile = automaticDependency->LocateIncludedFile ( this, + module, + includedFilename, + searchCurrentDirectory, + includeNext, + resolvedFile ); + if ( locatedFile ) + { + SourceFile* sourceFile = ParseFile ( *new File ( resolvedFile ) ); + if ( sourceFile != NULL ) + files.push_back ( sourceFile ); + } else if ( automaticDependency->project.configuration.Verbose ) + printf ( "Unable to find %c%s%c, included in %s%c%s\n", + searchCurrentDirectory ? '\"' : '<', + includedFilename.c_str (), + searchCurrentDirectory ? '\"' : '>', + this->file.file.relative_path.c_str (), + cSep, + this->file.file.name.c_str () ); + } + p++; + } + Close (); +} + +AutomaticDependency::AutomaticDependency ( const Project& project ) + : project ( project ) +{ +} + +AutomaticDependency::~AutomaticDependency () +{ + std::map::iterator theIterator; + for ( theIterator = sourcefile_map.begin (); theIterator != sourcefile_map.end (); theIterator++ ) + delete theIterator->second; +} + +void +AutomaticDependency::ParseFiles () +{ + for( std::map::const_iterator p = project.modules.begin(); p != project.modules.end(); ++ p ) + ParseFiles ( *p->second ); +} + +void +AutomaticDependency::GetModuleFiles ( const Module& module, + vector& files ) const +{ + for ( size_t i = 0; i < module.non_if_data.files.size (); i++ ) + files.push_back ( module.non_if_data.files[i] ); + + /* FIXME: Collect files in IFs here */ + + if ( module.pch != NULL ) + { + const FileLocation& pch = *module.pch->file; + File *file = new File ( pch.directory, pch.relative_path, pch.name , false, "", true ); + files.push_back ( file ); + } +} + +void +AutomaticDependency::ParseFiles ( const Module& module ) +{ + vector files; + GetModuleFiles ( module, files ); + for ( size_t i = 0; i < files.size (); i++ ) + ParseFile ( module, *files[i] ); +} + +void +AutomaticDependency::ParseFile ( const Module& module, + const File& file ) +{ + RetrieveFromCacheOrParse ( module, + file, + NULL ); +} + +bool +AutomaticDependency::LocateIncludedFile ( const FileLocation& directory, + const string& includedFilename ) +{ + string path; + switch ( directory.directory ) + { + case SourceDirectory: + path = ""; + break; + case IntermediateDirectory: + path = Environment::GetIntermediatePath (); + break; + case OutputDirectory: + path = Environment::GetOutputPath (); + break; + default: + throw InvalidOperationException ( __FILE__, + __LINE__, + "Invalid directory %d.", + directory.directory ); + } + if ( directory.relative_path.length () > 0 ) + { + if ( path.length () > 0 ) + path += sSep; + path += directory.relative_path; + } + + string normalizedFilename = NormalizeFilename ( path + sSep + includedFilename ); + FILE* f = fopen ( normalizedFilename.c_str (), "rb" ); + if ( f != NULL ) + { + fclose ( f ); + return true; + } + return false; +} + +void +AutomaticDependency::GetIncludeDirectories ( vector& includes, + const Module& module ) +{ + size_t i; + for ( i = 0; i < module.non_if_data.includes.size (); i++ ) + includes.push_back( module.non_if_data.includes[i] ); + for ( i = 0; i < module.project.non_if_data.includes.size (); i++ ) + includes.push_back( module.project.non_if_data.includes[i] ); +} + +bool +AutomaticDependency::LocateIncludedFile ( SourceFile* sourceFile, + const Module& module, + const string& includedFilename, + bool searchCurrentDirectory, + bool includeNext, + File& resolvedFile ) +{ + vector includes; + string includedFileDir; + Include currentDirectory ( module.project, SourceDirectory, sourceFile->file.file.relative_path ); + if ( searchCurrentDirectory ) + includes.push_back ( ¤tDirectory ); + GetIncludeDirectories ( includes, module ); + + for ( size_t j = 0; j < includes.size (); j++ ) + { + Include& include = *includes[j]; + if ( LocateIncludedFile ( *include.directory, + includedFilename ) ) + { + if ( includeNext && + include.directory->directory == sourceFile->file.file.directory && + include.directory->relative_path == sourceFile->file.file.relative_path ) + { + includeNext = false; + continue; + } + resolvedFile.file.directory = include.directory->directory; + size_t index = includedFilename.find_last_of ( "/\\" ); + if ( index == string::npos ) + { + resolvedFile.file.name = includedFilename; + resolvedFile.file.relative_path = include.directory->relative_path; + } + else + { + resolvedFile.file.relative_path = NormalizeFilename ( + include.directory->relative_path + sSep + + includedFilename.substr ( 0, index ) ); + resolvedFile.file.name = includedFilename.substr ( index + 1 ); + } + return true; + } + } + return false; +} + +SourceFile* +AutomaticDependency::RetrieveFromCacheOrParse ( const Module& module, + const File& file, + SourceFile* parentSourceFile ) +{ + string filename = file.GetFullPath(); + SourceFile* sourceFile = sourcefile_map[filename]; + if ( sourceFile == NULL ) + { + sourceFile = new SourceFile ( this, + module, + file, + parentSourceFile ); + sourcefile_map[filename] = sourceFile; + sourceFile->Parse (); + } + else if ( parentSourceFile != NULL ) + sourceFile->parents.push_back ( parentSourceFile ); + return sourceFile; +} + +SourceFile* +AutomaticDependency::RetrieveFromCache ( const File& file ) +{ + string filename = file.GetFullPath(); + return sourcefile_map[filename]; +} + +void +AutomaticDependency::CheckAutomaticDependencies ( bool verbose ) +{ + ParseFiles (); + for( std::map::const_iterator p = project.modules.begin(); p != project.modules.end(); ++ p ) + { + Module& module = *p->second; + CheckAutomaticDependencies ( module, verbose ); + } +} + +void +AutomaticDependency::GetModulesToCheck ( Module& module, vector& modules ) +{ + modules.push_back ( &module ); + for ( size_t i = 0; i < module.non_if_data.libraries.size (); i++ ) + { + Library& library = *module.non_if_data.libraries[i]; + if ( library.importedModule->type != ObjectLibrary ) + break; + modules.push_back ( library.importedModule ); + } + + /* FIXME: Collect libraries in IFs here */ +} + +void +AutomaticDependency::CheckAutomaticDependenciesForModule ( Module& module, + bool verbose ) +{ + size_t mi; + vector modules; + GetModulesToCheck ( module, modules ); + for ( mi = 0; mi < modules.size (); mi++ ) + ParseFiles ( *modules[mi] ); + for ( mi = 0; mi < modules.size (); mi++ ) + CheckAutomaticDependencies ( *modules[mi], verbose ); +} + +void +AutomaticDependency::CheckAutomaticDependencies ( const Module& module, + bool verbose ) +{ + struct utimbuf timebuf; + vector files; + GetModuleFiles ( module, files ); + for ( size_t fi = 0; fi < files.size (); fi++ ) + { + File& file = *files[fi]; + SourceFile* sourceFile = RetrieveFromCache ( file ); + if ( sourceFile != NULL ) + { + CheckAutomaticDependenciesForFile ( sourceFile ); + assert ( sourceFile->youngestLastWriteTime != 0 ); + if ( sourceFile->youngestLastWriteTime > sourceFile->lastWriteTime ) + { + if ( verbose ) + { + printf ( "Marking %s%c%s for rebuild due to younger file %s%c%s\n", + sourceFile->file.file.relative_path.c_str (), + cSep, sourceFile->file.file.name.c_str (), + sourceFile->youngestFile->file.file.relative_path.c_str (), + cSep, sourceFile->youngestFile->file.file.name.c_str () ); + } + timebuf.actime = sourceFile->youngestLastWriteTime; + timebuf.modtime = sourceFile->youngestLastWriteTime; + utime ( sourceFile->file.GetFullPath ().c_str (), + &timebuf ); + } + } + } +} + +void +AutomaticDependency::CheckAutomaticDependenciesForFile ( SourceFile* sourceFile ) +{ + if ( sourceFile->youngestLastWriteTime > 0 ) + return; + + if ( sourceFile->files.size () == 0 ) + { + sourceFile->youngestLastWriteTime = sourceFile->lastWriteTime; + sourceFile->youngestFile = sourceFile; + return; + } + + for ( size_t i = 0; i < sourceFile->files.size (); i++ ) + { + SourceFile* childSourceFile = sourceFile->files[i]; + + CheckAutomaticDependenciesForFile ( childSourceFile ); + if ( ( childSourceFile->youngestLastWriteTime > sourceFile->youngestLastWriteTime ) || + ( childSourceFile->lastWriteTime > sourceFile->youngestLastWriteTime ) ) + { + if ( childSourceFile->youngestLastWriteTime > childSourceFile->lastWriteTime ) + { + sourceFile->youngestLastWriteTime = childSourceFile->youngestLastWriteTime; + sourceFile->youngestFile = childSourceFile->youngestFile; + } + else + { + sourceFile->youngestLastWriteTime = childSourceFile->lastWriteTime; + sourceFile->youngestFile = childSourceFile; + } + } + } +} diff --git a/tools/rbuild/autoregister.cpp b/tools/rbuild/autoregister.cpp new file mode 100644 index 00000000000..2a5bdc436f2 --- /dev/null +++ b/tools/rbuild/autoregister.cpp @@ -0,0 +1,88 @@ +/* + * Copyright (C) 2005 Casper S. Hornstrup + * + * This program is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation; either version 2 of the License, or + * (at your option) any later version. + * + * This program 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 General Public License for more details. + * + * You should have received a copy of the GNU General Public License along + * with this program; if not, write to the Free Software Foundation, Inc., + * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. + */ +#include "pch.h" + +#include "rbuild.h" + +using std::string; + +AutoRegister::AutoRegister ( const Project& project_, + const Module* module_, + const XMLElement& node_ ) + : XmlNode(project_, node_), + module(module_) +{ + Initialize(); +} + +bool +AutoRegister::IsSupportedModuleType ( ModuleType type ) +{ + if ( type == Win32DLL || + type == Win32OCX ) + { + return true; + } + else + { + return false; + } +} + +AutoRegisterType +AutoRegister::GetAutoRegisterType( const string& type ) +{ + if ( type == "DllRegisterServer" ) + return DllRegisterServer; + if ( type == "DllInstall" ) + return DllInstall; + if ( type == "Both" ) + return Both; + throw XMLInvalidBuildFileException ( + node.location, + " type attribute must be DllRegisterServer, DllInstall or Both." ); +} + +void +AutoRegister::Initialize () +{ + if ( !IsSupportedModuleType ( module->type ) ) + { + throw XMLInvalidBuildFileException ( + node.location, + " is not applicable for this module type." ); + } + + const XMLAttribute* att = node.GetAttribute ( "infsection", true ); + if ( !att ) + { + throw XMLInvalidBuildFileException ( + node.location, + " must have a 'infsection' attribute." ); + } + infSection = att->value; + + att = node.GetAttribute ( "type", true ); + if ( !att ) + { + throw XMLInvalidBuildFileException ( + node.location, + " must have a 'type' attribute." ); + } + type = GetAutoRegisterType ( att->value ); +} diff --git a/tools/rbuild/backend/backend.cpp b/tools/rbuild/backend/backend.cpp new file mode 100644 index 00000000000..61d467ecf55 --- /dev/null +++ b/tools/rbuild/backend/backend.cpp @@ -0,0 +1,126 @@ +/* + * Copyright (C) 2005 Casper S. Hornstrup + * + * This program is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation; either version 2 of the License, or + * (at your option) any later version. + * + * This program 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 General Public License for more details. + * + * You should have received a copy of the GNU General Public License along + * with this program; if not, write to the Free Software Foundation, Inc., + * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. + */ +#include "../pch.h" + +#include "../rbuild.h" +#include "backend.h" + +using std::string; +using std::vector; +using std::map; + +map* +Backend::Factory::factories = NULL; +int +Backend::Factory::ref = 0; + +Backend::Factory::Factory ( const std::string& name_, const std::string& description_ ) +{ + string name(name_); + strlwr ( &name[0] ); + if ( !ref++ ) + factories = new map; + (*factories)[name] = this; + m_name = name; + m_description = description_; +} + +Backend::Factory::~Factory () +{ + if ( !--ref ) + { + delete factories; + factories = NULL; + } +} + +/*static*/ Backend* +Backend::Factory::Create ( const string& name, + Project& project, + Configuration& configuration ) +{ + string sname ( name ); + strlwr ( &sname[0] ); + if ( !factories || !factories->size () ) + throw InvalidOperationException ( __FILE__, + __LINE__, + "No registered factories" ); + Backend::Factory* f = (*factories)[sname]; + if ( !f ) + { + throw UnknownBackendException ( sname ); + return NULL; + } + return (*f) ( project, configuration ); +} + +Backend::Backend ( Project& project, + Configuration& configuration ) + : ProjectNode ( project ), + configuration ( configuration ) +{ +} + +Backend::~Backend() +{ +} + +string +Backend::GetFullPath ( const FileLocation& file ) const +{ + string directory; + switch ( file.directory ) + { + case SourceDirectory: + directory = ""; + break; + case IntermediateDirectory: + directory = Environment::GetIntermediatePath (); + break; + case OutputDirectory: + directory = Environment::GetOutputPath (); + break; + case InstallDirectory: + directory = Environment::GetInstallPath (); + break; + default: + throw InvalidOperationException ( __FILE__, + __LINE__, + "Invalid directory %d.", + file.directory ); + } + + if ( file.relative_path.length () > 0 ) + { + if ( directory.length () > 0 ) + directory += sSep; + directory += file.relative_path; + } + return directory; +} + +string +Backend::GetFullName ( const FileLocation& file ) const +{ + string directory = GetFullPath ( file ); + + if ( directory.length () > 0 ) + directory += sSep; + + return directory + file.name; +} diff --git a/tools/rbuild/backend/backend.h b/tools/rbuild/backend/backend.h new file mode 100644 index 00000000000..7e9da13ed1d --- /dev/null +++ b/tools/rbuild/backend/backend.h @@ -0,0 +1,77 @@ +/* + * Copyright (C) 2005 Casper S. Hornstrup + * + * This program is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation; either version 2 of the License, or + * (at your option) any later version. + * + * This program 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 General Public License for more details. + * + * You should have received a copy of the GNU General Public License along + * with this program; if not, write to the Free Software Foundation, Inc., + * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. + */ + +#pragma once + +#include "../rbuild.h" + +class Backend; + +typedef Backend* BackendFactory ( Project& project, + Configuration& configuration ); + +class Backend +{ +public: + class Factory + { + static std::map* factories; + static int ref; + std::string m_name; + std::string m_description; + + protected: + + Factory ( const std::string& name_, const std::string& description_ ); + virtual ~Factory(); + + virtual Backend* operator() ( Project&, + Configuration& configuration ) = 0; + + public: + static Backend* Create ( const std::string& name, + Project& project, + Configuration& configuration ); + + static std::map::iterator map_begin(void) + { + return factories->begin(); + } + + static std::map::iterator map_end(void) + { + return factories->end(); + } + + const char *Name(void) { return m_name.c_str(); } + const char *Description(void) { return m_description.c_str(); } + }; + +protected: + Backend ( Project& project, + Configuration& configuration ); + +public: + virtual ~Backend(); + + virtual std::string GetFullName ( const FileLocation& file ) const; + virtual std::string GetFullPath ( const FileLocation& file ) const; + virtual void Process () = 0; + Project& ProjectNode; + Configuration& configuration; +}; diff --git a/tools/rbuild/backend/dependencymap/dependencymap.cpp b/tools/rbuild/backend/dependencymap/dependencymap.cpp new file mode 100644 index 00000000000..f12fa77b7d6 --- /dev/null +++ b/tools/rbuild/backend/dependencymap/dependencymap.cpp @@ -0,0 +1,204 @@ +/* + * Copyright (C) 2007 Christoph von Wittich + * + * This program is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation; either version 2 of the License, or + * (at your option) any later version. + * + * This program 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 General Public License for more details. + * + * You should have received a copy of the GNU General Public License along + * with this program; if not, write to the Free Software Foundation, Inc., + * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. + */ +#ifdef _MSC_VER +#pragma warning ( disable : 4786 ) +#endif//_MSC_VER + +#include +#include +#include +#include +#include + +#include + +#include "dependencymap.h" +#include "../mingw/mingw.h" + +using std::string; +using std::vector; +using std::map; +using std::ifstream; + +#ifdef OUT +#undef OUT +#endif//OUT + + +static class DepMapFactory : public Backend::Factory +{ + public: + + DepMapFactory() : Factory("DepMap", "Dependency Map") {} + Backend *operator() (Project &project, + Configuration& configuration) + { + return new DepMapBackend(project, configuration); + } + +} factory; + + +DepMapBackend::DepMapBackend(Project &project, + Configuration& configuration) : Backend(project, configuration) +{ + +} + +void DepMapBackend::Process() +{ + string filename_depmap ( "dependencymap.xml" ); + printf ( "Creating dependecy map: %s\n", filename_depmap.c_str() ); + + m_DepMapFile = fopen ( filename_depmap.c_str(), "wb" ); + + if ( !m_DepMapFile ) + { + printf ( "Could not create file '%s'.\n", filename_depmap.c_str() ); + return; + } + + _generate_depmap ( m_DepMapFile ); + + fclose ( m_DepMapFile ); + printf ( "Done.\n" ); +} + +void +DepMapBackend::_clean_project_files ( void ) +{ + remove ( "dependencymap.xml" ); +} + + +void +DepMapBackend::_generate_depmap ( FILE* OUT ) +{ + /* add dependencies */ + + typedef map ModuleMap; + ModuleMap module_map; + + for( std::map::const_iterator p = ProjectNode.modules.begin(); p != ProjectNode.modules.end(); ++ p ) + { + Module& module = *p->second; + if ((module.type != Iso) && + (module.type != LiveIso)) + { + vector ifs_list; + ifs_list.push_back ( &module.project.non_if_data ); + ifs_list.push_back ( &module.non_if_data ); + + module_data * current_data; + ModuleMap::iterator mod_it = module_map.find ( module.name ); + if (mod_it != module_map.end ()) + { + current_data = mod_it->second; + } + else + { + current_data = new module_data(); + if (current_data) + { + module_map.insert (std::make_pair(module.name, current_data)); + } + } + while ( ifs_list.size() ) + { + const IfableData& data = *ifs_list.back(); + ifs_list.pop_back(); + const vector& libs = data.libraries; + for ( size_t j = 0; j < libs.size(); j++ ) + { + ModuleMap::iterator it = module_map.find ( libs[j]->name ); + + if ( it != module_map.end ()) + { + module_data * data = it->second; + data->references.push_back ( module.name ); + } + else + { + module_data * data = new module_data(); + if ( data ) + { + data->references.push_back ( module.name ); + } + module_map.insert ( std::make_pair( libs[j]->name, data ) ); + } + current_data->libraries.push_back ( libs[j]->name ); + } + } + } + } + + fprintf ( m_DepMapFile, "\r\n" ); + fprintf ( m_DepMapFile, "\r\n" ); + fprintf ( m_DepMapFile, "\r\n" ); + + for( std::map::const_iterator p = ProjectNode.modules.begin(); p != ProjectNode.modules.end(); ++ p ) + { + Module& module = *p->second; + + ModuleMap::iterator it = module_map.find ( module.name ); + if ( it != module_map.end () ) + { + module_data * data = it->second; + + + + fprintf ( m_DepMapFile, "\t\r\n" ); + fprintf ( m_DepMapFile, "\t\t%s\r\n", module.name.c_str () ); + fprintf ( m_DepMapFile, "\t\t%s\r\n", module.output->relative_path.c_str () ); + fprintf ( m_DepMapFile, "\t\t%u\r\n", (unsigned int)data->references.size () ); + fprintf ( m_DepMapFile, "\t\t%u\r\n", (unsigned int)data->libraries.size () ); +#if 0 + if ( data->references.size () ) + { + fprintf ( m_DepMapFile, "\t\r\n" ); + for ( size_t j = 0; j < data->references.size (); j++ ) + { + fprintf ( m_DepMapFile, "\t\t\r\n", data->references[j].c_str () ); + } + fprintf ( m_DepMapFile, "\t\r\n" ); + } + + if ( data->libraries.size () ) + { + fprintf ( m_DepMapFile, "\t\r\n" ); + for ( size_t j = 0; j < data->libraries.size (); j++ ) + { + fprintf ( m_DepMapFile, "\t\t\r\n", data->libraries[j].c_str () ); + } + fprintf ( m_DepMapFile, "\t\r\n" ); + } +#endif + fprintf ( m_DepMapFile, "\t\r\n" ); + } + } + + fprintf ( m_DepMapFile, "" ); +} + + +DepMapConfiguration::DepMapConfiguration ( const std::string &name ) +{ + /* nothing to do here */ +} + + diff --git a/tools/rbuild/backend/dependencymap/dependencymap.h b/tools/rbuild/backend/dependencymap/dependencymap.h new file mode 100644 index 00000000000..96114f514fd --- /dev/null +++ b/tools/rbuild/backend/dependencymap/dependencymap.h @@ -0,0 +1,64 @@ +/* + * Copyright (C) 2007 Christoph von Wittich + * + * This program is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation; either version 2 of the License, or + * (at your option) any later version. + * + * This program 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 General Public License for more details. + * + * You should have received a copy of the GNU General Public License along + * with this program; if not, write to the Free Software Foundation, Inc., + * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. + */ + +#pragma once + +#include +#include +#include + +#include "../backend.h" + +class DepMapConfiguration +{ + public: + DepMapConfiguration(const std::string &name = ""); + virtual ~DepMapConfiguration() {} + std::string name; +}; + +class DepMapBackend : public Backend +{ + public: + + DepMapBackend(Project &project, + Configuration& configuration); + virtual ~DepMapBackend() {} + + virtual void Process(); + + private: + + FILE* m_DepMapFile; + + std::vector m_configurations; + void _generate_depmap ( FILE* OUT ); + void _clean_project_files ( void ); + + struct module_data + { + std::vector libraries; + std::vector references; + + module_data() + {} + ~module_data() + {} + }; + +}; diff --git a/tools/rbuild/backend/mingw/compilers/gcc.mak b/tools/rbuild/backend/mingw/compilers/gcc.mak new file mode 100644 index 00000000000..074d107a262 --- /dev/null +++ b/tools/rbuild/backend/mingw/compilers/gcc.mak @@ -0,0 +1,158 @@ +CFLAG_WERROR:=-Werror +CFLAG_CRTDLL:=-D_DLL -D__USE_CRTIMP + +CXXFLAG_WERROR:=-Werror +CXXFLAG_CRTDLL:=-D_DLL -D__USE_CRTIMP + +CPPFLAG_WERROR:=-Werror +CPPFLAG_UNICODE:=-DUNICODE -D_UNICODE + +# FIXME: disabled until RosBE stops sucking +# BUILTIN_CPPFLAGS+= -nostdinc + +#(module, source, dependencies, cflags, output) +define RBUILD_DEPENDS + +$(5): $(2) $(3) | ${call RBUILD_dir,$(5)} + $$(ECHO_DEPENDS) + $${gcc} -xc -MF $$@ $(4) -M -MP -MT $$@ $$< + +endef + +#(module, source, dependencies, cflags, output) +define RBUILD_CXX_DEPENDS + +$(5): $(2) $(3) | ${call RBUILD_dir,$(5)} + $$(ECHO_DEPENDS) + $${gpp} -MF $$@ $(4) -M -MP -MT $$@ $$< + +endef + +#(source, cflags) +RBUILD_PIPE_CPP=$${gcc} $(2) -xc -E $(1) +RBUILD_PIPE_CXX_CPP=$${gpp} $(2) -E $(1) + +#(module, source, dependencies, cflags, output) +define RBUILD_CPP + +$(5): $(2) $(3) | ${call RBUILD_dir,$(5)} + $$(ECHO_CPP) + ${call RBUILD_PIPE_CPP,$$<,$(4)} > $$@ + +endef + +#(module, source, dependencies, cflags, output) +define RBUILD_CXX_CPP + +$(5): $(2) $(3) | ${call RBUILD_dir,$(5)} + $$(ECHO_CPP) + ${call RBUILD_PIPE_CXX_CPP,$$<,$(4)} > $$@ + +endef + +#(module, source, dependencies, cflags, output) +define RBUILD_CC + +$(2): $${$(1)_precondition} + +ifeq ($(ROS_BUILDDEPS),full) + +${call RBUILD_DEPENDS,$(1),$(2),,${call RBUILD_cflags,$(1),$(4)},$(5).d} +-include $(5).d + +$(5): $(2) $(5).d $(3) | ${call RBUILD_dir,$(5)} + $$(ECHO_CC) + $${gcc} -o $$@ ${call RBUILD_cflags,$(1),$(4)} -c $$< + +else + +$(5): $(2) $(3) | ${call RBUILD_dir,$(5)} + $$(ECHO_CC) + $${gcc} -o $$@ ${call RBUILD_cflags,$(1),$(4)} -c $$< + +endif + +endef + +#(module, source, dependencies, cflags, output) +define RBUILD_CXX + +$(2): $${$(1)_precondition} + +ifeq ($(ROS_BUILDDEPS),full) + +${call RBUILD_CXX_DEPENDS,$(1),$(2),,${call RBUILD_cxxflags,$(1),$(4)},$(5).d} +-include $(5).d + +$(5): $(2) $(5).d $(3) | ${call RBUILD_dir,$(5)} + $$(ECHO_CC) + $${gpp} -o $$@ ${call RBUILD_cxxflags,$(1),$(4)} -c $$< + +else + +$(5): $(2) $(3) | ${call RBUILD_dir,$(5)} + $$(ECHO_CC) + $${gpp} -o $$@ ${call RBUILD_cxxflags,$(1),$(4)} -c $$< + +endif + +endef + +#(module, source, dependencies, cflags) +RBUILD_CC_RULE=${call RBUILD_CC,$(1),$(2),$(3),$(4),${call RBUILD_intermediate_path_unique,$(1),$(2)}.o} +RBUILD_CXX_RULE=${call RBUILD_CXX,$(1),$(2),$(3),$(4),${call RBUILD_intermediate_path_unique,$(1),$(2)}.o} + +#(module, source, dependencies, cflags) +define RBUILD_CC_PCH_RULE + +$(2): $${$(1)_precondition} + +ifeq ($$(ROS_BUILDDEPS),full) + +${call RBUILD_intermediate_dir,$(2)}$$(SEP).gch_$(1)$$(SEP)$(notdir $(2)).gch.d: $(2) | ${call RBUILD_intermediate_dir,$(2)} + $$(ECHO_DEPENDS) + $${gcc} -MF $$@ ${call RBUILD_cflags,$(1),$(4)} -x c-header -M -MP -MT $$@ $$< + +-include $$(intermediate_dir)$$(SEP).gch_$$(module_name)$$(SEP)$(notdir $(2)).gch.d + +${call RBUILD_intermediate_dir,$(2)}$$(SEP).gch_$(1)$$(SEP)$(notdir $(2)).gch: $(2) ${call RBUILD_intermediate_dir,$(2)}$$(SEP).gch_$(1)$$(SEP)$(notdir $(2)).gch.d $(3) | ${call RBUILD_intermediate_dir,$(2)}$$(SEP).gch_$(1) + $$(ECHO_PCH) + $${gcc} -o $$@ ${call RBUILD_cflags,$(1),$(4)} -x c-header $$< + +else + +${call RBUILD_intermediate_dir,$(2)}$$(SEP).gch_$(1)$$(SEP)$(notdir $(2)).gch: $(2) $(3) | ${call RBUILD_intermediate_dir,$(2)}$$(SEP).gch_$(1) + $$(ECHO_PCH) + $${gcc} -o $$@ ${call RBUILD_cflags,$(1),$(4)} -x c-header $$< + +endif + +endef + +#(module, source, dependencies, cflags) +define RBUILD_CXX_PCH_RULE + +$(2): $${$(1)_precondition} + +ifeq ($$(ROS_BUILDDEPS),full) + +${call RBUILD_intermediate_dir,$(2)}$$(SEP).gch_$(1)$$(SEP)$(notdir $(2)).gch.d: $(2) | ${call RBUILD_intermediate_dir,$(2)} + $$(ECHO_DEPENDS) + $${gpp} -MF $$@ ${call RBUILD_cxxflags,$(1),$(4)} -x c++-header -M -MP -MT $$@ $$< + +-include $$(intermediate_dir)$$(SEP).gch_$$(module_name)$$(SEP)$(notdir $(2)).gch.d + +${call RBUILD_intermediate_dir,$(2)}$$(SEP).gch_$(1)$$(SEP)$(notdir $(2)).gch: $(2) ${call RBUILD_intermediate_dir,$(2)}$$(SEP).gch_$(1)$$(SEP)$(notdir $(2)).gch.d $(3) | ${call RBUILD_intermediate_dir,$(2)}$$(SEP).gch_$(1) + $$(ECHO_PCH) + $${gpp} -o $$@ ${call RBUILD_cxxflags,$(1),$(4)} -x c++-header $$< + +else + +${call RBUILD_intermediate_dir,$(2)}$$(SEP).gch_$(1)$$(SEP)$(notdir $(2)).gch: $(2) $(3) | ${call RBUILD_intermediate_dir,$(2)}$$(SEP).gch_$(1) + $$(ECHO_PCH) + $${gpp} -o $$@ ${call RBUILD_cxxflags,$(1),$(4)} -x c++-header $$< + +endif + +endef + diff --git a/tools/rbuild/backend/mingw/compilers/msc.mak b/tools/rbuild/backend/mingw/compilers/msc.mak new file mode 100644 index 00000000000..53d520553a5 --- /dev/null +++ b/tools/rbuild/backend/mingw/compilers/msc.mak @@ -0,0 +1,101 @@ +CFLAGS+= $(_CL_) +_CL_= + +CINCLUDES:=$(INCLUDE) $(CINCLUDES) +INCLUDE= + +CFLAG_WERROR:=/WX +CFLAG_CRTDLL:=/D_DLL /D__USE_CRTIMP /MD + +CXXFLAG_WERROR:=/WX +CXXFLAG_CRTDLL:=/D_DLL /D__USE_CRTIMP /MD + +CPPFLAG_WERROR:=/WX +CPPFLAG_UNICODE:=/DUNICODE /D_UNICODE + +BUILTIN_CPPFLAGS+= /X + +cl=$(Q)$(rbuild_helper_TARGET) "RBUILD_CL_" "$(notdir $<)" cl /nologo + +#(module, source, dependencies, cflags, output) +#TODO +RBUILD_CL_DEPENDS=$$(error Full dependencies are not implemented for Microsoft C/C++ Compiler yet) +RBUILD_DEPENDS=${call RBUILD_CL_DEPENDS,$(1),$(2),$(3),$(4) /TC,$(5)} +RBUILD_CXX_DEPENDS=${call RBUILD_CL_DEPENDS,$(1),$(2),$(3),$(4) /TP,$(5)} + +#(source, cflags) +RBUILD_PIPE_CL_CPP=$${cl} $(2) /E $(1) +RBUILD_PIPE_CPP=${call RBUILD_PIPE_CL_CPP,$(1),$(2) /TC} +RBUILD_PIPE_CXX_CPP=${call RBUILD_PIPE_CL_CPP,$(1),$(2) /TP} + +#(module, source, dependencies, cflags, output) +define RBUILD_CL_CPP + +$(5): $(2) $(3) $$(rbuild_helper_TARGET) | ${call RBUILD_dir,$(5)} + $$(ECHO_CPP) + ${call RBUILD_PIPE_CL_CPP,$$<,$(4)} > $$@ + +endef + +RBUILD_CPP=${call RBUILD_CL_CPP,$(1),$(2),$(3),$(4) /TC,$(5)} +RBUILD_CXX_CPP=${call RBUILD_CL_CPP,$(1),$(2),$(3),$(4) /TP,$(5)} + +#(module, source, dependencies, cflags, output) +define RBUILD_CC + +$(2): $${$(1)_precondition} + +ifeq ($(ROS_BUILDDEPS),full) + +${call RBUILD_DEPENDS,$(1),$(2),,${call RBUILD_cflags,$(1),$(4)},$(5).d} +-include $(5).d + +$(5): $(2) $(5).d $(3) $$(rbuild_helper_TARGET) | ${call RBUILD_dir,$(5)} + $$(ECHO_CC) + $${cl} /TC /Fo$$@ /Fd$(basename $$@).pdb ${call RBUILD_cflags,$(1),$(4)} /c $$< + +else + +$(5): $(2) $(3) $$(rbuild_helper_TARGET) | ${call RBUILD_dir,$(5)} + $$(ECHO_CC) + $${cl} /TC /Fo$$@ /Fd$(basename $$@).pdb ${call RBUILD_cflags,$(1),$(4)} /c $$< + +endif + +endef + +#(module, source, dependencies, cflags, output) +define RBUILD_CXX + +$(2): $${$(1)_precondition} + +ifeq ($(ROS_BUILDDEPS),full) + +${call RBUILD_CXX_DEPENDS,$(1),$(2),,${call RBUILD_cflags,$(1),$(4)},$(5).d} +-include $(5).d + +$(5): $(2) $(5).d $(3) $$(rbuild_helper_TARGET) | ${call RBUILD_dir,$(5)} + $$(ECHO_CC) + $${cl} /TP /Fo$$@ /Fd$(basename $$@).pdb ${call RBUILD_cxxflags,$(1),$(4)} /c $$< + +else + +$(5): $(2) $(3) $$(rbuild_helper_TARGET) | ${call RBUILD_dir,$(5)} + $$(ECHO_CC) + $${cl} /TP /Fo$$@ /Fd$(basename $$@).pdb ${call RBUILD_cxxflags,$(1),$(4)} /c $$< + +endif + +endef + +#(module, source, dependencies, cflags) +RBUILD_CC_RULE=${call RBUILD_CC,$(1),$(2),$(3),$(4),${call RBUILD_intermediate_path_unique,$(1),$(2)}.o} +RBUILD_CXX_RULE=${call RBUILD_CXX,$(1),$(2),$(3),$(4),${call RBUILD_intermediate_path_unique,$(1),$(2)}.o} + +#(module, source, dependencies, cflags) +#TODO +RBUILD_CC_PCH_RULE=$$(error Precompiled headers are not implemented for Microsoft C/C++ Compiler yet) + +#(module, source, dependencies, cflags) +#TODO +RBUILD_CXX_PCH_RULE=$$(error Precompiled headers are not implemented for Microsoft C/C++ Compiler yet) diff --git a/tools/rbuild/backend/mingw/linkers/ld.mak b/tools/rbuild/backend/mingw/linkers/ld.mak new file mode 100644 index 00000000000..d7fc3b78e40 --- /dev/null +++ b/tools/rbuild/backend/mingw/linkers/ld.mak @@ -0,0 +1,90 @@ +# -exclude-all-symbols disables autoexporting all symbols *if none were found* (either in a DEF file or using __declspec(dllexport) +LDFLAG_DLL:=--shared --exclude-all-symbols +LDFLAG_DRIVER:=--shared --subsystem=native --exclude-all-symbols +LDFLAG_NOSTDLIB:=--nostartfiles --nostdlib +LDFLAG_CONSOLE:=--subsystem=console +LDFLAG_WINDOWS:=--subsystem=windows +LDFLAG_NATIVE:=--subsystem=native + +LDFLAG_EXCLUDE_ALL_SYMBOLS=--exclude-all-symbols +DLLTOOL_FLAGS=--kill-at +ifeq ($(ARCH),amd64) + DLLTOOL_FLAGS= --no-leading-underscore +endif + +#~ #(module, objs, deps, ldflags, output, def, libs, entry, base) +#(module, objs, deps, ldflags, output, def, libs, entry, base, extralibs) +define RBUILD_LINK + +ifneq ($(6),) +${call RBUILD_intermediate_dir,$(5)}$$(SEP)lib${call RBUILD_name,$(5)}.a: $(6) | ${call RBUILD_intermediate_path,$(5)} + $$(ECHO_IMPLIB) + $${dlltool} --def $(6) $(DLLTOOL_FLAGS) --output-lib=$$@ + +${call RBUILD_intermediate_dir,$(5)}$$(SEP)lib${call RBUILD_name,$(5)}.delayimp.a: $(6) | ${call RBUILD_intermediate_path,$(5)} + $$(ECHO_IMPLIB) + $${dlltool} --def $(6) $(DLLTOOL_FLAGS) --output-delaylib=$$@ + +${call RBUILD_intermediate_path_noext,$(5)}.exp: $(6) | ${call RBUILD_intermediate_path,$(5)} + $$(ECHO_IMPLIB) + $${dlltool} --def $(6) $(DLLTOOL_FLAGS) --output-exp=$$@ + +$(1)_CLEANFILES+=\ + ${call RBUILD_intermediate_dir,$(5)}$$(SEP)lib$(notdir $(5)).a \ + ${call RBUILD_intermediate_dir,$(5)}$$(SEP)lib$(notdir $(5)).delayimp.a \ + ${call RBUILD_intermediate_path_noext,$(5)}.exp +endif + +# TODO: refactor this out of here and into rules.mak +${call RBUILD_intermediate_dir,$(5)}$$(SEP)$(1)_objs.rsp: $(2) $$(if $(6),${call RBUILD_intermediate_path_noext,$(5)}.exp) $(3) | ${call RBUILD_intermediate_dir,$(5)} + $$(ECHO_RSP) + -@$${rm} $$@ 2>$$(NUL) + $${cp} $$(NUL) $$@ >$$(NUL) + $$(foreach obj,$(2) $$(if $(6),${call RBUILD_intermediate_path_noext,$(5)}.exp),$$(Q)echo $$(QUOTE)$$(subst \,\\,$$(obj))$$(QUOTE)>>$$@$$(NL)) + +$(1)_CLEANFILES+=${call RBUILD_intermediate_dir,$(5)}$$(SEP)$(1)_objs.rsp + +$(5): ${call RBUILD_intermediate_dir,$(5)}$$(SEP)$(1)_objs.rsp $(7) $(3) $$(RSYM_TARGET) $$(PEFIXUP_TARGET) | ${call RBUILD_dir,$(5)} + $$(ECHO_LD) +#~ $${ld} --entry=$(8) --image-base=$(9) @${call RBUILD_intermediate_dir,$(5)}$$(SEP)$(1)_objs.rsp $(7) ${call RBUILD_ldflags,$(1),$(4)} -o $$@ + $${ld} --entry=$(8) --image-base=$(9) @${call RBUILD_intermediate_dir,$(5)}$$(SEP)$(1)_objs.rsp --start-group $(10) $(7) --end-group ${call RBUILD_ldflags,$(1),$(4)} -o $$@ +ifneq ($(or $(6),$$(MODULETYPE$$($(1)_TYPE)_KMODE)),) + $$(ECHO_PEFIXUP) + $$(Q)$$(PEFIXUP_TARGET) $$@ $(if $(6),-exports) $$(if $$(MODULETYPE$($(1)_TYPE)_KMODE),-sections) +endif +ifeq ($(ROS_BUILDMAP),full) + $$(ECHO_OBJDUMP) + $${objdump} -d -S $$@ > ${call RBUILD_output_path_noext,$(5)}.map +else +ifeq ($(ROS_BUILDMAP),yes) + $$(ECHO_NM) + $${nm} --numeric-sort $$@ > ${call RBUILD_output_path_noext,$(5)}.map +endif +endif +ifeq ($(ROS_BUILDNOSTRIP),yes) + $$(ECHO_CP) + $${cp} $(5) $(basename $(5)).nostrip$(suffix $(5)) 1>$(NUL) +endif +ifneq ($(ROS_GENERATE_RSYM),no) + $$(ECHO_RSYM) + $$(Q)$$(RSYM_TARGET) $$@ $$@ +endif +ifeq ($(ROS_LEAN_AND_MEAN),yes) + $$(ECHO_STRIP) + $${strip} -s -x -X $$@ +endif + +ifneq ($(ROS_BUILDMAP),) +$(1)_CLEANFILES+=${call RBUILD_output_path_noext,$(5)}.map +endif + +ifeq ($(ROS_BUILDNOSTRIP),yes) +$(1)_CLEANFILES+=$(basename $(5)).nostrip$(suffix $(5)) +endif + +endef + +#~ #(module, def, deps, ldflags, libs, entry, base) +#~ RBUILD_LINK_RULE=${call RBUILD_LINK,$(1),$(value $(1)_OBJS),$(3),$(4),$(value $(1)_TARGET),$(2),$(5) $(value $(1)_LIBS) $(5),$(6),$(7)} +#(module, def, deps, ldflags, libs, entry, base, extralibs) +RBUILD_LINK_RULE=${call RBUILD_LINK,$(1),$(value $(1)_OBJS),$(3),$(4),$(value $(1)_TARGET),$(2),$(value $(1)_LIBS),$(6),$(7),$(5)} diff --git a/tools/rbuild/backend/mingw/linkers/mslink.mak b/tools/rbuild/backend/mingw/linkers/mslink.mak new file mode 100644 index 00000000000..464090415c4 --- /dev/null +++ b/tools/rbuild/backend/mingw/linkers/mslink.mak @@ -0,0 +1 @@ +# TODO diff --git a/tools/rbuild/backend/mingw/mingw.cpp b/tools/rbuild/backend/mingw/mingw.cpp new file mode 100644 index 00000000000..98bed1fb873 --- /dev/null +++ b/tools/rbuild/backend/mingw/mingw.cpp @@ -0,0 +1,1358 @@ +/* + * Copyright (C) 2005 Casper S. Hornstrup + * 2006 Christoph von Wittich + * + * This program is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation; either version 2 of the License, or + * (at your option) any later version. + * + * This program 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 General Public License for more details. + * + * You should have received a copy of the GNU General Public License along + * with this program; if not, write to the Free Software Foundation, Inc., + * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. + */ +#include "../../pch.h" + +#include "mingw.h" +#include +#include "modulehandler.h" + +#ifdef _MSC_VER +#define popen _popen +#define pclose _pclose +#endif//_MSC_VER + +using std::string; +using std::vector; +using std::set; +using std::map; + +typedef set set_string; + +const struct ModuleHandlerInformations ModuleHandlerInformations[] = { + { HostTrue, "", "", "" }, // BuildTool + { HostFalse, "", "", "" }, // StaticLibrary + { HostFalse, "", "", "" }, // ObjectLibrary + { HostFalse, "", "", "$(LDFLAG_DRIVER)" }, // Kernel + { HostFalse, "", "", "$(LDFLAG_DRIVER)" }, // KernelModeDLL + { HostFalse, "-D__NTDRIVER__", "", "$(LDFLAG_DRIVER)" }, // KernelModeDriver + { HostFalse, "", "", "$(LDFLAG_DLL)" }, // NativeDLL + { HostFalse, "-D__NTAPP__", "", "$(LDFLAG_NATIVE)" }, // NativeCUI + { HostFalse, "", "", "$(LDFLAG_DLL)" }, // Win32DLL + { HostFalse, "", "", "$(LDFLAG_DLL)" }, // Win32OCX + { HostFalse, "", "", "$(LDFLAG_CONSOLE)" }, // Win32CUI + { HostFalse, "", "", "$(LDFLAG_WINDOWS)" }, // Win32GUI + { HostFalse, "", "", "$(LDFLAG_DRIVER)" }, // BootLoader + { HostFalse, "", "-f bin", "" }, // BootSector + { HostFalse, "", "", "" }, // Iso + { HostFalse, "", "", "" }, // LiveIso + { HostFalse, "", "", "" }, // Test + { HostFalse, "", "", "" }, // RpcServer + { HostFalse, "", "", "" }, // RpcClient + { HostFalse, "", "", "" }, // Alias + { HostFalse, "", "", "" }, // BootProgram + { HostFalse, "", "", "$(LDFLAG_WINDOWS)" }, // Win32SCR + { HostFalse, "", "", "" }, // IdlHeader + { HostFalse, "", "", "" }, // IdlInterface + { HostFalse, "", "", "" }, // EmbeddedTypeLib + { HostFalse, "", "", "" }, // ElfExecutable + { HostFalse, "", "", "" }, // RpcProxy + { HostTrue, "", "", "" }, // HostStaticLibrary + { HostFalse, "", "", "" }, // Cabinet + { HostFalse, "", "", "$(LDFLAG_DLL)" }, // KeyboardLayout + { HostFalse, "", "", "" }, // MessageHeader +}; + +static std::string mscPath; +static std::string mslinkPath; + +string +MingwBackend::GetFullPath ( const FileLocation& file ) const +{ + MingwModuleHandler::PassThruCacheDirectory ( &file ); + + string directory; + switch ( file.directory ) + { + case SourceDirectory: + directory = ""; + break; + case IntermediateDirectory: + directory = "$(INTERMEDIATE)"; + break; + case OutputDirectory: + directory = "$(OUTPUT)"; + break; + case InstallDirectory: + directory = "$(INSTALL)"; + break; + case TemporaryDirectory: + directory = "$(TEMPORARY)"; + break; + default: + throw InvalidOperationException ( __FILE__, + __LINE__, + "Invalid directory %d.", + file.directory ); + } + + if ( file.relative_path.length () > 0 ) + { + if ( directory.length () > 0 ) + directory += sSep; + directory += file.relative_path; + } + return directory; +} + +string +MingwBackend::GetFullName ( const FileLocation& file ) const +{ + string directory; + switch ( file.directory ) + { + case SourceDirectory: + directory = ""; + break; + case IntermediateDirectory: + directory = "$(INTERMEDIATE)"; + break; + case OutputDirectory: + directory = "$(OUTPUT)"; + break; + case InstallDirectory: + directory = "$(INSTALL)"; + break; + case TemporaryDirectory: + directory = "$(TEMPORARY)"; + break; + default: + throw InvalidOperationException ( __FILE__, + __LINE__, + "Invalid directory %d.", + file.directory ); + } + + if ( file.relative_path.length () > 0 ) + { + if ( directory.length () > 0 ) + directory += sSep; + directory += file.relative_path; + } + + if ( directory.length () > 0 ) + directory += sSep; + + return directory + file.name; +} + +string +v2s ( const Backend* backend, const vector& files, int wrap_at ) +{ + if ( !files.size() ) + return ""; + string s; + int wrap_count = 0; + for ( size_t i = 0; i < files.size(); i++ ) + { + const FileLocation& file = files[i]; + if ( wrap_at > 0 && wrap_count++ == wrap_at ) + { + s += " \\\n\t\t"; + wrap_count = 1; + } + else if ( s.size() ) + s += " "; + s += backend->GetFullName ( file ); + } + return s; +} + + +string +v2s ( const string_list& v, int wrap_at ) +{ + if ( !v.size() ) + return ""; + string s; + int wrap_count = 0; + for ( size_t i = 0; i < v.size(); i++ ) + { + if ( !v[i].size() ) + continue; + if ( wrap_at > 0 && wrap_count++ == wrap_at ) + { + s += " \\\n\t\t"; + wrap_count = 1; + } + else if ( s.size() ) + s += " "; + s += v[i]; + } + return s; +} + + +static class MingwFactory : public Backend::Factory +{ +public: + MingwFactory() : Factory ( "mingw", "Minimalist GNU Win32" ) {} + Backend* operator() ( Project& project, + Configuration& configuration ) + { + return new MingwBackend ( project, + configuration ); + } +} factory; + + +MingwBackend::MingwBackend ( Project& project, + Configuration& configuration ) + : Backend ( project, configuration ), + manualBinutilsSetting( false ), + intermediateDirectory ( new Directory ( "" ) ), + outputDirectory ( new Directory ( "" ) ), + installDirectory ( new Directory ( "" ) ) +{ + compilerPrefix = ""; +} + +MingwBackend::~MingwBackend() +{ + delete intermediateDirectory; + delete outputDirectory; + delete installDirectory; +} + +string +MingwBackend::AddDirectoryTarget ( const string& directory, + Directory* directoryTree ) +{ + if ( directory.length () > 0) + directoryTree->Add ( directory.c_str() ); + return directoryTree->name; +} + +bool +MingwBackend::CanEnablePreCompiledHeaderSupportForModule ( const Module& module ) +{ + if ( !configuration.CompilationUnitsEnabled ) + return true; + + const vector& compilationUnits = module.non_if_data.compilationUnits; + size_t i; + for ( i = 0; i < compilationUnits.size (); i++ ) + { + CompilationUnit& compilationUnit = *compilationUnits[i]; + if ( compilationUnit.GetFiles ().size () != 1 ) + return false; + } + return true; +} + +void +MingwBackend::ProcessModules () +{ + printf ( "Processing modules..." ); + + vector v; + size_t i; + + for ( std::map::iterator p = ProjectNode.modules.begin (); p != ProjectNode.modules.end (); ++ p ) + fprintf ( fMakefile, "%s_TYPE:=%u\n", p->second->name.c_str(), p->second->type ); + + for ( std::map::iterator p = ProjectNode.modules.begin (); p != ProjectNode.modules.end (); ++ p ) + { + Module& module = *p->second; + if ( !module.enabled ) + continue; + MingwModuleHandler* h = MingwModuleHandler::InstanciateHandler ( + module, + this ); + h->AddImplicitLibraries ( module ); + if ( use_pch && CanEnablePreCompiledHeaderSupportForModule ( module ) ) + h->EnablePreCompiledHeaderSupport (); + v.push_back ( h ); + } + + size_t iend = v.size (); + + for ( i = 0; i < iend; i++ ) + v[i]->GenerateSourceMacro(); + for ( i = 0; i < iend; i++ ) + v[i]->GenerateObjectMacro(); + fprintf ( fMakefile, "\n" ); + for ( i = 0; i < iend; i++ ) + v[i]->GenerateTargetMacro(); + fprintf ( fMakefile, "\n" ); + + GenerateAllTarget ( v ); + GenerateRegTestsRunTarget (); + + for ( i = 0; i < iend; i++ ) + v[i]->GenerateOtherMacros(); + + for ( i = 0; i < iend; i++ ) + { + MingwModuleHandler& h = *v[i]; + h.GeneratePreconditionDependencies (); + h.Process (); + h.GenerateInvocations (); + h.GenerateCleanTarget (); + h.GenerateInstallTarget (); + h.GenerateDependsTarget (); + delete v[i]; + } + + printf ( "done\n" ); +} + +void +MingwBackend::Process () +{ + if ( configuration.CheckDependenciesForModuleOnly ) + CheckAutomaticDependenciesForModuleOnly (); + else + ProcessNormal (); +} + +void +MingwBackend::CheckAutomaticDependenciesForModuleOnly () +{ + if ( configuration.Dependencies == AutomaticDependencies ) + { + Module* module = ProjectNode.LocateModule ( configuration.CheckDependenciesForModuleOnlyModule ); + if ( module == NULL ) + { + printf ( "Module '%s' does not exist\n", + configuration.CheckDependenciesForModuleOnlyModule.c_str () ); + return; + } + + printf ( "Checking automatic dependencies for module '%s'...", + module->name.c_str () ); + AutomaticDependency automaticDependency ( ProjectNode ); + automaticDependency.CheckAutomaticDependenciesForModule ( *module, + configuration.Verbose ); + printf ( "done\n" ); + } +} + +void +MingwBackend::ProcessNormal () +{ + assert(sizeof(ModuleHandlerInformations)/sizeof(ModuleHandlerInformations[0]) == TypeDontCare); + + DetectCompiler (); + DetectBinutils (); + DetectNetwideAssembler (); + DetectPipeSupport (); + DetectPCHSupport (); + CreateMakefile (); + GenerateHeader (); + GenerateGlobalVariables (); + GenerateXmlBuildFilesMacro (); + ProcessModules (); + GenerateInstallTarget (); + GenerateTestTarget (); + GenerateDirectoryTargets (); + GenerateDirectories (); + GenerateTestSupportCode (); + GenerateCompilationUnitSupportCode (); + GenerateSysSetup (); + GenerateProxyMakefiles (); + CheckAutomaticDependencies (); + CloseMakefile (); +} + +void +MingwBackend::CreateMakefile () +{ + fMakefile = fopen ( ProjectNode.makefile.c_str (), "w" ); + if ( !fMakefile ) + throw AccessDeniedException ( ProjectNode.makefile ); + MingwModuleHandler::SetBackend ( this ); + MingwModuleHandler::SetMakefile ( fMakefile ); +} + +void +MingwBackend::CloseMakefile () const +{ + if (fMakefile) + fclose ( fMakefile ); +} + +void +MingwBackend::GenerateHeader () const +{ + fprintf ( fMakefile, "# THIS FILE IS AUTOMATICALLY GENERATED, EDIT '%s' INSTEAD\n\n", + ProjectNode.GetProjectFilename ().c_str () ); +} + +void +MingwBackend::GenerateGlobalProperties ( + const char* assignmentOperation, + const IfableData& data ) const +{ + for ( std::map::const_iterator p = data.properties.begin(); p != data.properties.end(); ++ p ) + { + Property& prop = *p->second; + + if (!prop.isInternal) + { + fprintf ( fMakefile, "%s := %s\n", + prop.name.c_str(), + prop.value.c_str() ); + } + } +} + +string +MingwBackend::GenerateProjectLDFLAGS () const +{ + string ldflags; + for ( size_t i = 0; i < ProjectNode.linkerFlags.size (); i++ ) + { + LinkerFlag& linkerFlag = *ProjectNode.linkerFlags[i]; + if ( ldflags.length () > 0 ) + ldflags += " "; + ldflags += linkerFlag.flag; + } + return ldflags; +} + +void +MingwBackend::GenerateGlobalVariables () const +{ + fputs ( "include tools$(SEP)rbuild$(SEP)backend$(SEP)mingw$(SEP)rules.mak\n", fMakefile ); + fprintf ( fMakefile, "include tools$(SEP)rbuild$(SEP)backend$(SEP)mingw$(SEP)linkers$(SEP)%s.mak\n", ProjectNode.GetLinkerSet ().c_str () ); + fprintf ( fMakefile, "include tools$(SEP)rbuild$(SEP)backend$(SEP)mingw$(SEP)compilers$(SEP)%s.mak\n", ProjectNode.GetCompilerSet ().c_str () ); + + if ( mscPath.length() ) + fprintf ( fMakefile, "export RBUILD_CL_PATH=%s\n", mscPath.c_str () ); + + if ( mslinkPath.length() ) + fprintf ( fMakefile, "export RBUILD_LINK_PATH=%s\n", mslinkPath.c_str () ); + + if ( configuration.Dependencies == FullDependencies ) + { + fprintf ( fMakefile, + "ifeq ($(ROS_BUILDDEPS),)\n" + "ROS_BUILDDEPS:=%s\n" + "endif\n", + "full" ); + } + + fprintf ( fMakefile, + "PREFIX := %s\n", + compilerPrefix.c_str () ); + fprintf ( fMakefile, + "nasm := $(Q)%s\n", + nasmCommand.c_str () ); + + GenerateGlobalProperties ( "=", ProjectNode.non_if_data ); + + if ( ProjectNode.configuration.Compiler == GnuGcc ) + { + fprintf ( fMakefile, "ifneq ($(OARCH),)\n" ); + fprintf ( fMakefile, "PROJECT_ASFLAGS += -march=$(OARCH)\n" ); + fprintf ( fMakefile, "PROJECT_CFLAGS += -march=$(OARCH)\n" ); + fprintf ( fMakefile, "PROJECT_CXXFLAGS += -march=$(OARCH)\n" ); + fprintf ( fMakefile, "endif\n" ); + fprintf ( fMakefile, "ifneq ($(TUNE),)\n" ); + fprintf ( fMakefile, "PROJECT_CFLAGS += -mtune=$(TUNE)\n" ); + fprintf ( fMakefile, "PROJECT_CXXFLAGS += -mtune=$(TUNE)\n" ); + fprintf ( fMakefile, "endif\n" ); + + if ( usePipe ) + { + fprintf ( fMakefile, "PROJECT_CFLAGS += -pipe\n" ); + fprintf ( fMakefile, "PROJECT_CXXFLAGS += -pipe\n" ); + fprintf ( fMakefile, "PROJECT_ASFLAGS += -pipe\n" ); + } + + // Would be nice to have our own C++ runtime + fputs ( "BUILTIN_CXXINCLUDES+= $(TARGET_CPPFLAGS)\n", fMakefile ); + + fprintf ( fMakefile, "PROJECT_CCLIBS := \"$(shell ${TARGET_CC} -print-libgcc-file-name)\"\n" ); + + fprintf ( fMakefile, "PROJECT_CXXLIBS := \"$(shell ${TARGET_CPP} -print-file-name=libsupc++.a)\" \"$(shell ${TARGET_CPP} -print-file-name=libstdc++.a)\" \"$(shell ${TARGET_CPP} -print-libgcc-file-name)\" \"$(shell ${TARGET_CPP} -print-file-name=libmingw32.a)\" \"$(shell ${TARGET_CPP} -print-file-name=libmingwex.a)\"" ); + + /* hack to get _get_output_format, needed by libmingwex */ + if (Environment::GetArch() == "i386") + fprintf ( fMakefile, " \"$(shell ${TARGET_CPP} -print-file-name=libcoldname.a)\" "); + fprintf ( fMakefile,"\n"); + } + MingwModuleHandler::GenerateParameters ( "PROJECT", "+=", ProjectNode.non_if_data ); + MingwModuleHandler::GenerateParameters ( "PROJECT_HOST", "+=", ProjectNode.host_non_if_data ); + + fprintf ( fMakefile, "PROJECT_LDFLAGS := %s\n", GenerateProjectLDFLAGS ().c_str () ); + + // TODO: use symbolic names for module types + for ( size_t i = 0; i < sizeof(ModuleHandlerInformations) / sizeof(ModuleHandlerInformations[0]); ++ i ) + { + if ( ModuleHandlerInformations[i].cflags && ModuleHandlerInformations[i].cflags[0] ) + { + fprintf ( fMakefile, + "MODULETYPE%d_%sFLAGS:=%s\n", + (int)i, + "C", + ModuleHandlerInformations[i].cflags ); + } + + if ( ModuleHandlerInformations[i].nasmflags && ModuleHandlerInformations[i].nasmflags[0] ) + { + fprintf ( fMakefile, + "MODULETYPE%d_%sFLAGS:=%s\n", + (int)i, + "NASM", + ModuleHandlerInformations[i].nasmflags ); + } + + if ( ModuleHandlerInformations[i].linkerflags && ModuleHandlerInformations[i].linkerflags[0] ) + { + fprintf ( fMakefile, + "MODULETYPE%d_%sFLAGS:=%s\n", + (int)i, + "LD", + ModuleHandlerInformations[i].linkerflags ); + } + } + + fprintf ( fMakefile, + "MODULETYPE%d_KMODE:=yes\n", + (int)Kernel ); + + fprintf ( fMakefile, + "MODULETYPE%d_KMODE:=yes\n", + (int)KernelModeDLL ); + + fprintf ( fMakefile, + "MODULETYPE%d_KMODE:=yes\n", + (int)KernelModeDriver ); + + fprintf ( fMakefile, "\n" ); +} + +bool +MingwBackend::IncludeInAllTarget ( const Module& module ) const +{ + if ( MingwModuleHandler::ReferenceObjects ( module ) ) + return false; + if ( module.type == BootSector ) + return false; + if ( module.type == Iso ) + return false; + if ( module.type == LiveIso ) + return false; + if ( module.type == Test ) + return false; + if ( module.type == Alias ) + return false; + return true; +} + +void +MingwBackend::GenerateAllTarget ( const vector& handlers ) const +{ + fprintf ( fMakefile, "all:" ); + int wrap_count = 0; + size_t iend = handlers.size (); + for ( size_t i = 0; i < iend; i++ ) + { + const Module& module = handlers[i]->module; + if ( IncludeInAllTarget ( module ) ) + { + if ( wrap_count++ == 5 ) + fprintf ( fMakefile, " \\\n\t\t" ), wrap_count = 0; + fprintf ( fMakefile, + " %s", + GetTargetMacro(module).c_str () ); + } + } + fprintf ( fMakefile, "\n\t\n\n" ); +} + +void +MingwBackend::GenerateRegTestsRunTarget () const +{ + fprintf ( fMakefile, + "REGTESTS_RUN_TARGET = regtests.dll\n" ); + fprintf ( fMakefile, + "$(REGTESTS_RUN_TARGET): $(REGTESTS_TARGET)\n" ); + fprintf ( fMakefile, + "\t$(cp) $(REGTESTS_TARGET) $(REGTESTS_RUN_TARGET)\n" ); + fprintf ( fMakefile, "\n" ); +} + +void +MingwBackend::GenerateXmlBuildFilesMacro() const +{ + fprintf ( fMakefile, + "XMLBUILDFILES = %s \\\n", + ProjectNode.GetProjectFilename ().c_str () ); + string xmlbuildFilenames; + int numberOfExistingFiles = 0; + struct stat statbuf; + time_t SystemTime, lastWriteTime; + + for ( size_t i = 0; i < ProjectNode.xmlbuildfiles.size (); i++ ) + { + XMLInclude& xmlbuildfile = *ProjectNode.xmlbuildfiles[i]; + if ( !xmlbuildfile.fileExists ) + continue; + numberOfExistingFiles++; + if ( xmlbuildFilenames.length () > 0 ) + xmlbuildFilenames += " "; + + FILE* f = fopen ( xmlbuildfile.topIncludeFilename.c_str (), "rb" ); + if ( !f ) + throw FileNotFoundException ( NormalizeFilename ( xmlbuildfile.topIncludeFilename ) ); + + if ( fstat ( fileno ( f ), &statbuf ) != 0 ) + { + fclose ( f ); + throw AccessDeniedException ( NormalizeFilename ( xmlbuildfile.topIncludeFilename ) ); + } + + lastWriteTime = statbuf.st_mtime; + SystemTime = time(NULL); + + if (SystemTime != -1) + { + if (difftime (lastWriteTime, SystemTime) > 0) + throw InvalidDateException ( NormalizeFilename ( xmlbuildfile.topIncludeFilename ) ); + } + + fclose ( f ); + + xmlbuildFilenames += NormalizeFilename ( xmlbuildfile.topIncludeFilename ); + if ( numberOfExistingFiles % 5 == 4 || i == ProjectNode.xmlbuildfiles.size () - 1 ) + { + fprintf ( fMakefile, + "\t%s", + xmlbuildFilenames.c_str ()); + if ( i == ProjectNode.xmlbuildfiles.size () - 1 ) + { + fprintf ( fMakefile, "\n" ); + } + else + { + fprintf ( fMakefile, + " \\\n" ); + } + xmlbuildFilenames.resize ( 0 ); + } + numberOfExistingFiles++; + } + fprintf ( fMakefile, "\n" ); +} + +void +MingwBackend::GenerateTestSupportCode () +{ + printf ( "Generating test support code..." ); + TestSupportCode testSupportCode ( ProjectNode ); + testSupportCode.GenerateTestSupportCode ( configuration.Verbose ); + printf ( "done\n" ); +} + +void +MingwBackend::GenerateCompilationUnitSupportCode () +{ + if ( configuration.CompilationUnitsEnabled ) + { + printf ( "Generating compilation unit support code..." ); + CompilationUnitSupportCode compilationUnitSupportCode ( ProjectNode ); + compilationUnitSupportCode.Generate ( configuration.Verbose ); + printf ( "done\n" ); + } +} + +void +MingwBackend::GenerateSysSetup () +{ + printf ( "Generating syssetup.inf..." ); + SysSetupGenerator sysSetupGenerator ( ProjectNode ); + sysSetupGenerator.Generate (); + printf ( "done\n" ); +} + +string +MingwBackend::GetProxyMakefileTree () const +{ + if ( configuration.GenerateProxyMakefilesInSourceTree ) + return ""; + else + return Environment::GetOutputPath (); +} + +void +MingwBackend::GenerateProxyMakefiles () +{ + printf ( "Generating proxy makefiles..." ); + ProxyMakefile proxyMakefile ( ProjectNode ); + proxyMakefile.GenerateProxyMakefiles ( configuration.Verbose, + GetProxyMakefileTree () ); + printf ( "done\n" ); +} + +void +MingwBackend::CheckAutomaticDependencies () +{ + if ( configuration.Dependencies == AutomaticDependencies ) + { + printf ( "Checking automatic dependencies..." ); + AutomaticDependency automaticDependency ( ProjectNode ); + automaticDependency.CheckAutomaticDependencies ( configuration.Verbose ); + printf ( "done\n" ); + } +} + +void +MingwBackend::GenerateDirectories () +{ + printf ( "Creating directories..." ); + intermediateDirectory->GenerateTree ( IntermediateDirectory, configuration.Verbose ); + outputDirectory->GenerateTree ( OutputDirectory, configuration.Verbose ); + if ( !configuration.MakeHandlesInstallDirectories ) + installDirectory->GenerateTree ( InstallDirectory, configuration.Verbose ); + printf ( "done\n" ); +} + +bool +MingwBackend::TryToDetectThisCompiler ( const string& compiler ) +{ + string command = ssprintf ( + "%s -v 1>%s 2>%s", + FixSeparatorForSystemCommand(compiler).c_str (), + NUL, + NUL ); + int exitcode = system ( command.c_str () ); + return (bool) (exitcode == 0); +} + +void +MingwBackend::DetectCompiler () +{ + printf ( "Detecting compiler..." ); + + bool detectedCompiler = false; + bool supportedCompiler = false; + string compilerVersion; + + if ( ProjectNode.configuration.Compiler == GnuGcc ) + { + const string& TARGET_CCValue = Environment::GetVariable ( "TARGET_CC" ); + const string& ROS_PREFIXValue = Environment::GetVariable ( "ROS_PREFIX" ); + + if ( TARGET_CCValue.length () > 0 ) + { + compilerPrefix = ""; + compilerCommand = TARGET_CCValue; + detectedCompiler = TryToDetectThisCompiler ( compilerCommand ); + } + + if ( !detectedCompiler ) + { + if ( ROS_PREFIXValue.length () > 0 ) + { + compilerPrefix = ROS_PREFIXValue; + compilerCommand = compilerPrefix + "-gcc"; + detectedCompiler = TryToDetectThisCompiler ( compilerCommand ); + } + } +#if defined(WIN32) + if ( !detectedCompiler ) + { + compilerPrefix = ""; + compilerCommand = "gcc"; + detectedCompiler = TryToDetectThisCompiler ( compilerCommand ); + } +#endif + if ( !detectedCompiler ) + { + compilerPrefix = "mingw32"; + compilerCommand = compilerPrefix + "-gcc"; + detectedCompiler = TryToDetectThisCompiler ( compilerCommand ); + } + + if ( detectedCompiler ) + compilerVersion = GetCompilerVersion ( compilerCommand ); + + supportedCompiler = IsSupportedCompilerVersion ( compilerVersion ); + } + else if ( ProjectNode.configuration.Compiler == MicrosoftC ) + { + compilerCommand = "cl"; + detectedCompiler = DetectMicrosoftCompiler ( compilerVersion, mscPath ); + supportedCompiler = true; // TODO + } + + if ( detectedCompiler ) + { + if ( supportedCompiler ) + printf ( "detected (%s %s)\n", compilerCommand.c_str (), compilerVersion.c_str() ); + else + { + printf ( "detected (%s), but with unsupported version (%s)\n", + compilerCommand.c_str (), + compilerVersion.c_str () ); + throw UnsupportedBuildToolException ( compilerCommand, compilerVersion ); + } + } + else + printf ( "not detected\n" ); + +} + +bool +MingwBackend::TryToDetectThisNetwideAssembler ( const string& assembler ) +{ + string command = ssprintf ( + "%s -h 1>%s 2>%s", + FixSeparatorForSystemCommand(assembler).c_str (), + NUL, + NUL ); + int exitcode = system ( command.c_str () ); + return (bool) (exitcode == 0); +} + +string +MingwBackend::GetVersionString ( const string& versionCommand ) +{ + FILE *fp; + int ch, i; + size_t newline; + char buffer[81]; + + fp = popen ( versionCommand.c_str () , "r" ); + for( i = 0; + ( i < 80 ) && + ( feof ( fp ) == 0 && + ( ( ch = fgetc( fp ) ) != -1 ) ); + i++ ) + { + buffer[i] = (char) ch; + } + buffer[i] = '\0'; + pclose ( fp ); + + char separators[] = " ()\n"; + char *token; + char *prevtoken = NULL; + + string version; + + token = strtok ( buffer, separators ); + while ( token != NULL ) + { + prevtoken = token; + version = string( prevtoken ); + if ( (newline = version.find('\n')) != std::string::npos ) + version.erase(newline, 1); + if ( version.find('.') != std::string::npos ) + break; + token = strtok ( NULL, separators ); + } + return version; +} + +string +MingwBackend::GetNetwideAssemblerVersion ( const string& nasmCommand ) +{ + string versionCommand; + if ( nasmCommand.find("yasm") != std::string::npos ) + { + versionCommand = ssprintf ( "%s --version", + nasmCommand.c_str (), + NUL, + NUL ); + } + else + { + versionCommand = ssprintf ( "%s -v", + nasmCommand.c_str (), + NUL, + NUL ); + } + return GetVersionString( versionCommand ); +} + +string +MingwBackend::GetCompilerVersion ( const string& compilerCommand ) +{ + string versionCommand = ssprintf ( "%s --version", + compilerCommand.c_str (), + NUL, + NUL ); + return GetVersionString( versionCommand ); +} + +string +MingwBackend::GetBinutilsVersion ( const string& binutilsCommand ) +{ + string versionCommand = ssprintf ( "%s -v", + binutilsCommand.c_str (), + NUL, + NUL ); + return GetVersionString( versionCommand ); +} + +bool +MingwBackend::IsSupportedCompilerVersion ( const string& compilerVersion ) +{ + if ( strcmp ( compilerVersion.c_str (), "4.4.0") < 0 ) + return false; + else + return true; +} + +bool +MingwBackend::TryToDetectThisBinutils ( const string& binutils ) +{ + string command = ssprintf ( + "%s -v 1>%s 2>%s", + FixSeparatorForSystemCommand(binutils).c_str (), + NUL, + NUL ); + int exitcode = system ( command.c_str () ); + return (exitcode == 0); +} + +string +MingwBackend::GetBinutilsVersionDate ( const string& binutilsCommand ) +{ + FILE *fp; + int ch, i; + char buffer[81]; + + string versionCommand = ssprintf ( "%s -v", + binutilsCommand.c_str (), + NUL, + NUL ); + fp = popen ( versionCommand.c_str () , "r" ); + for( i = 0; + ( i < 80 ) && + ( feof ( fp ) == 0 && + ( ( ch = fgetc( fp ) ) != -1 ) ); + i++ ) + { + buffer[i] = (char) ch; + } + buffer[i] = '\0'; + pclose ( fp ); + + char separators[] = " "; + char *token; + char *prevtoken = NULL; + + token = strtok ( buffer, separators ); + while ( token != NULL ) + { + prevtoken = token; + token = strtok ( NULL, separators ); + } + string version = string ( prevtoken ); + int lastDigit = version.find_last_not_of ( "\t\r\n" ); + if ( lastDigit != -1 ) + return string ( version, 0, lastDigit+1 ); + else + return version; +} + +bool +MingwBackend::IsSupportedBinutilsVersion ( const string& binutilsVersion ) +{ + int digit = binutilsVersion.find_last_of("."); + if(digit == -1) + { + printf("Unable to detect binutils version!\n"); + return false; + } + + string date = string(binutilsVersion, digit + 1); + if(date.length() == 8) + { + /* This is a real date in the format YYYYMMDD. + Check whether we have at least Binutils 20091016 (the oldest one + we were still using after upgrading to RosBE 1.5). */ + if(strcmp(date.c_str(), "20091016") < 0) + return false; + } + else + { + /* This is no date, so binutilsVersion should just contain the version + number. + Binutils 2.20 will hopefully contain the required features. */ + if(strcmp(binutilsVersion.c_str(), "2.20") < 0) + return false; + } + + return true; +} + +void +MingwBackend::DetectBinutils () +{ + printf ( "Detecting binutils..." ); + + bool detectedBinutils = false; + bool supportedBinutils = false; + string binutilsVersion; + + if ( ProjectNode.configuration.Linker == GnuLd ) + { + const string& ROS_PREFIXValue = Environment::GetVariable ( "ROS_PREFIX" ); + + if ( ROS_PREFIXValue.length () > 0 ) + { + binutilsPrefix = ROS_PREFIXValue; + binutilsCommand = binutilsPrefix + "-ld"; + manualBinutilsSetting = true; + detectedBinutils = true; + } +#if defined(WIN32) + if ( !detectedBinutils ) + { + binutilsPrefix = ""; + binutilsCommand = "ld"; + detectedBinutils = TryToDetectThisBinutils ( binutilsCommand ); + } +#endif + if ( !detectedBinutils ) + { + binutilsPrefix = "mingw32"; + binutilsCommand = binutilsPrefix + "-ld"; + detectedBinutils = TryToDetectThisBinutils ( binutilsCommand ); + } + if ( detectedBinutils ) + { + binutilsVersion = GetBinutilsVersionDate ( binutilsCommand ); + supportedBinutils = IsSupportedBinutilsVersion ( binutilsVersion ); + } + } + else if ( ProjectNode.configuration.Linker == MicrosoftLink ) + { + compilerCommand = "link"; + detectedBinutils = DetectMicrosoftLinker ( binutilsVersion, mslinkPath ); + supportedBinutils = true; // TODO + } + + if ( detectedBinutils ) + { + if ( supportedBinutils ) + printf ( "detected (%s %s)\n", binutilsCommand.c_str (), binutilsVersion.c_str() ); + else + { + printf ( "detected (%s), but with unsupported version (%s)\n", + binutilsCommand.c_str (), + binutilsVersion.c_str () ); + throw UnsupportedBuildToolException ( binutilsCommand, binutilsVersion ); + } + } + else + printf ( "not detected\n" ); + +} + +void +MingwBackend::DetectNetwideAssembler () +{ + printf ( "Detecting netwide assembler..." ); + + nasmCommand = "nasm"; + bool detectedNasm = TryToDetectThisNetwideAssembler ( nasmCommand ); +#if defined(WIN32) + if ( !detectedNasm ) + { + nasmCommand = "nasmw"; + detectedNasm = TryToDetectThisNetwideAssembler ( nasmCommand ); + } +#endif + if ( !detectedNasm ) + { + nasmCommand = "yasm"; + detectedNasm = TryToDetectThisNetwideAssembler ( nasmCommand ); + } + if ( detectedNasm ) + printf ( "detected (%s %s)\n", nasmCommand.c_str (), GetNetwideAssemblerVersion( nasmCommand ).c_str() ); + else + printf ( "not detected\n" ); +} + +void +MingwBackend::DetectPipeSupport () +{ + if ( ProjectNode.configuration.Compiler == GnuGcc ) + { + printf ( "Detecting compiler -pipe support..." ); + + string pipe_detection = "tools" + sSep + "rbuild" + sSep + "backend" + sSep + "mingw" + sSep + "pipe_detection.c"; + string pipe_detectionObjectFilename = ReplaceExtension ( pipe_detection, + ".o" ); + string command = ssprintf ( + "%s -pipe -c %s -o %s 1>%s 2>%s", + FixSeparatorForSystemCommand(compilerCommand).c_str (), + pipe_detection.c_str (), + pipe_detectionObjectFilename.c_str (), + NUL, + NUL ); + int exitcode = system ( command.c_str () ); + FILE* f = fopen ( pipe_detectionObjectFilename.c_str (), "rb" ); + if ( f ) + { + usePipe = (exitcode == 0); + fclose ( f ); + unlink ( pipe_detectionObjectFilename.c_str () ); + } + else + usePipe = false; + + if ( usePipe ) + printf ( "detected\n" ); + else + printf ( "not detected\n" ); + } + else + usePipe = false; +} + +void +MingwBackend::DetectPCHSupport () +{ + printf ( "Detecting compiler pre-compiled header support..." ); + + if ( configuration.PrecompiledHeadersEnabled && ProjectNode.configuration.Compiler == GnuGcc ) + { + string path = "tools" + sSep + "rbuild" + sSep + "backend" + sSep + "mingw" + sSep + "pch_detection.h"; + string cmd = ssprintf ( + "%s -c %s 1>%s 2>%s", + FixSeparatorForSystemCommand(compilerCommand).c_str (), + path.c_str (), + NUL, + NUL ); + system ( cmd.c_str () ); + path += ".gch"; + + FILE* f = fopen ( path.c_str (), "rb" ); + if ( f ) + { + use_pch = true; + fclose ( f ); + unlink ( path.c_str () ); + } + else + use_pch = false; + + if ( use_pch ) + printf ( "detected\n" ); + else + printf ( "not detected\n" ); + } + else + { + use_pch = false; + printf ( "disabled\n" ); + } +} + +void +MingwBackend::GetNonModuleInstallTargetFiles ( + vector& out ) const +{ + for ( size_t i = 0; i < ProjectNode.installfiles.size (); i++ ) + { + const InstallFile& installfile = *ProjectNode.installfiles[i]; + out.push_back ( *installfile.target ); + } +} + +void +MingwBackend::GetModuleInstallTargetFiles ( + vector& out ) const +{ + for ( std::map::const_iterator p = ProjectNode.modules.begin (); p != ProjectNode.modules.end (); ++ p ) + { + const Module& module = *p->second; + if ( !module.enabled ) + continue; + if ( module.install ) + out.push_back ( *module.install ); + } +} + +void +MingwBackend::GetInstallTargetFiles ( + vector& out ) const +{ + GetNonModuleInstallTargetFiles ( out ); + GetModuleInstallTargetFiles ( out ); +} + +void +MingwBackend::OutputInstallTarget ( const FileLocation& source, + const FileLocation& target ) +{ + fprintf ( fMakefile, + "%s: %s | %s\n", + GetFullName ( target ).c_str (), + GetFullName ( source ).c_str (), + GetFullPath ( target ).c_str () ); + fprintf ( fMakefile, + "\t$(ECHO_CP)\n" ); + fprintf ( fMakefile, + "\t${cp} %s %s 1>$(NUL)\n", + GetFullName ( source ).c_str (), + GetFullName ( target ).c_str () ); +} + +void +MingwBackend::OutputNonModuleInstallTargets () +{ + for ( size_t i = 0; i < ProjectNode.installfiles.size (); i++ ) + { + const InstallFile& installfile = *ProjectNode.installfiles[i]; + OutputInstallTarget ( *installfile.source, *installfile.target ); + } +} + +const Module& +MingwBackend::GetAliasedModuleOrModule ( const Module& module ) const +{ + if ( module.aliasedModuleName.size () > 0 ) + { + const Module* aliasedModule = ProjectNode.LocateModule ( module.aliasedModuleName ); + assert ( aliasedModule ); + return *aliasedModule; + } + else + return module; +} + +void +MingwBackend::OutputModuleInstallTargets () +{ + for ( std::map::const_iterator p = ProjectNode.modules.begin (); p != ProjectNode.modules.end (); ++ p ) + { + const Module& module = *p->second; + if ( !module.enabled ) + continue; + if ( module.install ) + { + const Module& aliasedModule = GetAliasedModuleOrModule ( module ); + OutputInstallTarget ( *aliasedModule.output, *module.install ); + } + } +} + +string +MingwBackend::GetRegistrySourceFiles () +{ + return "boot" + sSep + "bootdata" + sSep + "hivecls_" + Environment::GetArch() + ".inf " + "boot" + sSep + "bootdata" + sSep + "hivedef_" + Environment::GetArch() + ".inf " + "boot" + sSep + "bootdata" + sSep + "hiveinst_" + Environment::GetArch() + ".inf " + "boot" + sSep + "bootdata" + sSep + "hivesft_" + Environment::GetArch() + ".inf " + "boot" + sSep + "bootdata" + sSep + "hivesys_" + Environment::GetArch() + ".inf "; +} + +string +MingwBackend::GetRegistryTargetFiles () +{ + string system32ConfigDirectory = "system32" + sSep + "config"; + FileLocation system32 ( InstallDirectory, system32ConfigDirectory, "" ); + + vector registry_files; + registry_files.push_back ( FileLocation ( InstallDirectory, system32ConfigDirectory, "default" ) ); + registry_files.push_back ( FileLocation ( InstallDirectory, system32ConfigDirectory, "sam" ) ); + registry_files.push_back ( FileLocation ( InstallDirectory, system32ConfigDirectory, "security" ) ); + registry_files.push_back ( FileLocation ( InstallDirectory, system32ConfigDirectory, "software" ) ); + registry_files.push_back ( FileLocation ( InstallDirectory, system32ConfigDirectory, "system" ) ); + + return v2s( this, registry_files, 6 ); +} + +void +MingwBackend::OutputRegistryInstallTarget () +{ + FileLocation system32 ( InstallDirectory, "system32" + sSep + "config", "" ); + + string registrySourceFiles = GetRegistrySourceFiles (); + string registryTargetFiles = GetRegistryTargetFiles (); + fprintf ( fMakefile, + "install_registry: %s\n", + registryTargetFiles.c_str () ); + fprintf ( fMakefile, + "%s: %s %s $(mkhive_TARGET)\n", + registryTargetFiles.c_str (), + registrySourceFiles.c_str (), + GetFullPath ( system32 ).c_str () ); + fprintf ( fMakefile, + "\t$(ECHO_MKHIVE)\n" ); + fprintf ( fMakefile, + "\t$(mkhive_TARGET) boot%cbootdata %s $(ARCH) boot%cbootdata%chiveinst_$(ARCH).inf\n", + cSep, GetFullPath ( system32 ).c_str (), + cSep, cSep ); + fprintf ( fMakefile, + "\n" ); +} + +void +MingwBackend::GenerateInstallTarget () +{ + vector vInstallTargetFiles; + GetInstallTargetFiles ( vInstallTargetFiles ); + string installTargetFiles = v2s ( this, vInstallTargetFiles, 5 ); + string registryTargetFiles = GetRegistryTargetFiles (); + + fprintf ( fMakefile, + "install: %s %s\n", + installTargetFiles.c_str (), + registryTargetFiles.c_str () ); + OutputNonModuleInstallTargets (); + OutputModuleInstallTargets (); + OutputRegistryInstallTarget (); + fprintf ( fMakefile, + "\n" ); +} + +void +MingwBackend::GetModuleTestTargets ( + vector& out ) const +{ + for ( std::map::const_iterator p = ProjectNode.modules.begin (); p != ProjectNode.modules.end (); ++ p ) + { + const Module& module = *p->second; + if ( !module.enabled ) + continue; + if ( module.type == Test ) + out.push_back ( module.name ); + } +} + +void +MingwBackend::GenerateTestTarget () +{ + vector vTestTargets; + GetModuleTestTargets ( vTestTargets ); + string testTargets = v2s ( vTestTargets, 5 ); + + fprintf ( fMakefile, + "test: %s\n", + testTargets.c_str () ); + fprintf ( fMakefile, + "\n" ); +} + +void +MingwBackend::GenerateDirectoryTargets () +{ + intermediateDirectory->CreateRule ( fMakefile, "$(INTERMEDIATE)" ); + outputDirectory->CreateRule ( fMakefile, "$(OUTPUT)" ); + installDirectory->CreateRule ( fMakefile, "$(INSTALL)" ); +} diff --git a/tools/rbuild/backend/mingw/mingw.h b/tools/rbuild/backend/mingw/mingw.h new file mode 100644 index 00000000000..aebeb57872a --- /dev/null +++ b/tools/rbuild/backend/mingw/mingw.h @@ -0,0 +1,151 @@ +/* + * Copyright (C) 2005 Casper S. Hornstrup + * + * This program is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation; either version 2 of the License, or + * (at your option) any later version. + * + * This program 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 General Public License for more details. + * + * You should have received a copy of the GNU General Public License along + * with this program; if not, write to the Free Software Foundation, Inc., + * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. + */ + +#pragma once + +#include "../backend.h" + +#ifdef WIN32 + #define NUL "NUL" +#else + #define NUL "/dev/null" +#endif + +class Directory; +class MingwModuleHandler; + +extern std::string +v2s ( const Backend* backend, const std::vector& files, int wrap_at ); +extern std::string +v2s ( const string_list& v, int wrap_at ); + + +class MingwBackend : public Backend +{ +public: + MingwBackend ( Project& project, + Configuration& configuration ); + ~MingwBackend (); + virtual void Process (); + std::string AddDirectoryTarget ( const std::string& directory, + Directory* directoryTree ); + const Module& GetAliasedModuleOrModule ( const Module& module ) const; + bool compilerNeedsHelper; + std::string compilerPrefix; + std::string compilerCommand; + std::string nasmCommand; + std::string binutilsPrefix; + bool binutilsNeedsHelper; + std::string binutilsCommand; + bool usePipe, manualBinutilsSetting; + Directory* intermediateDirectory; + Directory* outputDirectory; + Directory* installDirectory; + + std::string GetFullName ( const FileLocation& file ) const; + std::string GetFullPath ( const FileLocation& file ) const; + +private: + void CreateMakefile (); + void CloseMakefile () const; + void GenerateHeader () const; + void GenerateGlobalProperties ( const char* assignmentOperation, + const IfableData& data ) const; + std::string GenerateProjectLDFLAGS () const; + void GenerateDirectories (); + void GenerateGlobalVariables () const; + bool IncludeInAllTarget ( const Module& module ) const; + void GenerateAllTarget ( const std::vector& handlers ) const; + void GenerateRegTestsRunTarget () const; + void GenerateXmlBuildFilesMacro() const; + void GenerateTestSupportCode (); + void GenerateCompilationUnitSupportCode (); + void GenerateSysSetup (); + std::string GetProxyMakefileTree () const; + void GenerateProxyMakefiles (); + void CheckAutomaticDependencies (); + bool TryToDetectThisCompiler ( const std::string& compiler ); + void DetectCompiler (); + std::string GetCompilerVersion ( const std::string& compilerCommand ); + bool IsSupportedCompilerVersion ( const std::string& compilerVersion ); + bool TryToDetectThisNetwideAssembler ( const std::string& assembler ); + bool TryToDetectThisBinutils ( const std::string& binutils ); + std::string GetBinutilsVersion ( const std::string& binutilsCommand ); + std::string GetBinutilsVersionDate ( const std::string& binutilsCommand ); + bool IsSupportedBinutilsVersion ( const std::string& binutilsVersion ); + std::string GetVersionString ( const std::string& versionCommand ); + std::string GetNetwideAssemblerVersion ( const std::string& nasmCommand ); + void DetectBinutils (); + void DetectNetwideAssembler (); + void DetectPipeSupport (); + void DetectPCHSupport (); + bool CanEnablePreCompiledHeaderSupportForModule ( const Module& module ); + void ProcessModules (); + void CheckAutomaticDependenciesForModuleOnly (); + void ProcessNormal (); + std::string GetNonModuleInstallDirectories ( const std::string& installDirectory ); + std::string GetInstallDirectories ( const std::string& installDirectory ); + void GetNonModuleInstallFiles ( std::vector& out ) const; + void GetInstallFiles ( std::vector& out ) const; + void GetNonModuleInstallTargetFiles ( std::vector& out ) const; + void GetModuleInstallTargetFiles ( std::vector& out ) const; + void GetInstallTargetFiles ( std::vector& out ) const; + void OutputInstallTarget ( const FileLocation& source, const FileLocation& target ); + void OutputNonModuleInstallTargets (); + void OutputModuleInstallTargets (); + std::string GetRegistrySourceFiles (); + std::string GetRegistryTargetFiles (); + void OutputRegistryInstallTarget (); + void GenerateInstallTarget (); + void GetModuleTestTargets ( std::vector& out ) const; + void GenerateTestTarget (); + void GenerateDirectoryTargets (); + FILE* fMakefile; + bool use_pch; + bool DetectMicrosoftCompiler ( std::string& version, std::string& path ); + bool DetectMicrosoftLinker ( std::string& version, std::string& path ); +}; + + +class ProxyMakefile +{ +public: + ProxyMakefile ( const Project& project ); + ~ProxyMakefile (); + void GenerateProxyMakefiles ( bool verbose, + std::string outputTree ); + static bool GenerateProxyMakefile ( const Module& module ); + +private: + std::string GeneratePathToParentDirectory ( int numberOfParentDirectories ); + std::string GetPathToTopDirectory ( Module& module ); + void GenerateProxyMakefileForModule ( Module& module, + bool verbose, + std::string outputTree ); + const Project& project; +}; + +struct ModuleHandlerInformations +{ + HostType DefaultHost; + const char* cflags; + const char* nasmflags; + const char* linkerflags; +}; + +extern const struct ModuleHandlerInformations ModuleHandlerInformations[]; diff --git a/tools/rbuild/backend/mingw/modulehandler.cpp b/tools/rbuild/backend/mingw/modulehandler.cpp new file mode 100644 index 00000000000..fe0a26842f5 --- /dev/null +++ b/tools/rbuild/backend/mingw/modulehandler.cpp @@ -0,0 +1,3112 @@ +/* + * Copyright (C) 2005 Casper S. Hornstrup + * 2007-2008 Hervé Poussineau + * + * This program is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation; either version 2 of the License, or + * (at your option) any later version. + * + * This program 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 General Public License for more details. + * + * You should have received a copy of the GNU General Public License along + * with this program; if not, write to the Free Software Foundation, Inc., + * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. + */ +#include "../../pch.h" +#include +#include + +#include "../../rbuild.h" +#include "mingw.h" +#include "modulehandler.h" +#include "rule.h" + +using std::set; +using std::string; +using std::vector; + +#define CLEAN_FILE(f) clean_files.push_back ( (f).name.length () > 0 ? backend->GetFullName ( f ) : backend->GetFullPath ( f ) ); +#define IsStaticLibrary( module ) ( ( module.type == StaticLibrary ) || ( module.type == HostStaticLibrary ) ) + +MingwBackend* +MingwModuleHandler::backend = NULL; +FILE* +MingwModuleHandler::fMakefile = NULL; + +string +PrefixFilename ( + const string& filename, + const string& prefix ) +{ + if ( !prefix.length() ) + return filename; + string out; + const char* pfilename = filename.c_str(); + const char* p1 = strrchr ( pfilename, '/' ); + const char* p2 = strrchr ( pfilename, '\\' ); + if ( p1 || p2 ) + { + if ( p2 > p1 ) + p1 = p2; + out += string(pfilename,p1-pfilename) + cSep; + pfilename = p1 + 1; + } + out += prefix + pfilename; + return out; +} + +string +GetTargetMacro ( const Module& module, bool with_dollar ) +{ + string s ( module.name ); + s += "_TARGET"; + if ( with_dollar ) + return ssprintf ( "$(%s)", s.c_str() ); + return s; +} + +MingwModuleHandler::MingwModuleHandler ( + const Module& module_ ) + + : module(module_) +{ + use_pch = false; +} + +MingwModuleHandler::~MingwModuleHandler() +{ +} + +/*static*/ void +MingwModuleHandler::SetBackend ( MingwBackend* backend_ ) +{ + backend = backend_; +} + +/*static*/ void +MingwModuleHandler::SetMakefile ( FILE* f ) +{ + fMakefile = f; +} + +void +MingwModuleHandler::EnablePreCompiledHeaderSupport () +{ + use_pch = true; +} + +/*static*/ const FileLocation* +MingwModuleHandler::PassThruCacheDirectory (const FileLocation* file ) +{ + switch ( file->directory ) + { + case SourceDirectory: + break; + case IntermediateDirectory: + backend->AddDirectoryTarget ( file->relative_path, backend->intermediateDirectory ); + break; + case OutputDirectory: + backend->AddDirectoryTarget ( file->relative_path, backend->outputDirectory ); + break; + case InstallDirectory: + backend->AddDirectoryTarget ( file->relative_path, backend->installDirectory ); + break; + default: + throw InvalidOperationException ( __FILE__, + __LINE__, + "Invalid directory %d.", + file->directory ); + } + + return file; +} + +/* caller needs to delete the returned object */ +const FileLocation* +MingwModuleHandler::GetTargetFilename ( + const Module& module, + string_list* pclean_files ) +{ + FileLocation *target = new FileLocation ( *module.output ); + if ( pclean_files ) + { + string_list& clean_files = *pclean_files; + CLEAN_FILE ( *target ); + } + return target; +} + +/* caller needs to delete the returned object */ +const FileLocation* +MingwModuleHandler::GetImportLibraryFilename ( + const Module& module, + string_list* pclean_files, + bool delayimp ) +{ + FileLocation *target; + + if (module.HasImportLibrary()) + { + if (delayimp) + { + target = new FileLocation ( *module.delayImportLibrary->target ); + } + else + target = new FileLocation ( *module.importLibrary->target ); + } + else + target = new FileLocation ( *module.dependency ); + + if ( pclean_files ) + { + string_list& clean_files = *pclean_files; + CLEAN_FILE ( *target ); + } + return target; +} + +/* caller needs to delete the returned object */ +MingwModuleHandler* +MingwModuleHandler::InstanciateHandler ( + const Module& module, + MingwBackend* backend ) +{ + MingwModuleHandler* handler; + switch ( module.type ) + { + case StaticLibrary: + case HostStaticLibrary: + case ObjectLibrary: + case RpcServer: + case RpcClient: + case RpcProxy: + case MessageHeader: + case IdlHeader: + case IdlInterface: + case EmbeddedTypeLib: + case BootSector: + handler = new MingwModuleHandler( module ); + break; + case BuildTool: + handler = new MingwBuildToolModuleHandler ( module ); + break; + case Kernel: + handler = new MingwKernelModuleHandler ( module ); + break; + case NativeCUI: + handler = new MingwNativeCUIModuleHandler ( module ); + break; + case Win32CUI: + handler = new MingwWin32CUIModuleHandler ( module ); + break; + case Win32SCR: + case Win32GUI: + handler = new MingwWin32GUIModuleHandler ( module ); + break; + case KeyboardLayout: + case KernelModeDLL: + case KernelModeDriver: + handler = new MingwKernelModeDLLModuleHandler ( module ); + break; + case NativeDLL: + handler = new MingwNativeDLLModuleHandler ( module ); + break; + case Win32DLL: + handler = new MingwWin32DLLModuleHandler ( module ); + break; + case Win32OCX: + handler = new MingwWin32OCXModuleHandler ( module ); + break; + case BootLoader: + handler = new MingwBootLoaderModuleHandler ( module ); + break; + case BootProgram: + handler = new MingwBootProgramModuleHandler ( module ); + break; + case Iso: + handler = new MingwIsoModuleHandler ( module ); + break; + case LiveIso: + handler = new MingwLiveIsoModuleHandler ( module ); + break; + case Test: + handler = new MingwTestModuleHandler ( module ); + break; + case Alias: + handler = new MingwAliasModuleHandler ( module ); + break; + case Cabinet: + handler = new MingwCabinetModuleHandler ( module ); + break; + case ElfExecutable: + handler = new MingwElfExecutableModuleHandler ( module ); + break; + default: + throw UnknownModuleTypeException ( + module.node.location, + module.type ); + break; + } + return handler; +} + +string +MingwModuleHandler::GetWorkingDirectory () const +{ + return "."; +} + +string +MingwModuleHandler::GetBasename ( const string& filename ) const +{ + size_t index = filename.find_last_of ( '.' ); + if ( index != string::npos ) + return filename.substr ( 0, index ); + return ""; +} + +string +MingwModuleHandler::GetCompilationUnitDependencies ( + const CompilationUnit& compilationUnit ) const +{ + if ( compilationUnit.GetFiles ().size () <= 1 ) + return ""; + vector sourceFiles; + for ( size_t i = 0; i < compilationUnit.GetFiles ().size (); i++ ) + { + const File& file = *compilationUnit.GetFiles ()[i]; + sourceFiles.push_back ( backend->GetFullName ( file.file ) ); + } + return string ( " " ) + v2s ( sourceFiles, 10 ); +} + +/* caller needs to delete the returned object */ +const FileLocation* +MingwModuleHandler::GetModuleArchiveFilename () const +{ + if ( IsStaticLibrary ( module ) ) + return GetTargetFilename ( module, NULL ); + return NULL; +} + +/*static*/ bool +MingwModuleHandler::ReferenceObjects ( + const Module& module ) +{ + if ( module.type == ObjectLibrary ) + return true; + if ( module.type == RpcServer ) + return true; + if ( module.type == RpcClient ) + return true; + if ( module.type == RpcProxy ) + return true; + if ( module.type == IdlHeader ) + return true; + if ( module.type == IdlInterface ) + return true; + if ( module.type == MessageHeader) + return true; + return false; +} + +void +MingwModuleHandler::OutputCopyCommand ( const FileLocation& source, + const FileLocation& destination ) +{ + fprintf ( fMakefile, "# OUTPUT COPY COMMAND\n" ); + fprintf ( fMakefile, + "\t$(ECHO_CP)\n" ); + fprintf ( fMakefile, + "\t${cp} %s %s 1>$(NUL)\n", + backend->GetFullName ( source ).c_str (), + backend->GetFullName ( *PassThruCacheDirectory ( &destination ) ).c_str () ); +} + +void +MingwModuleHandler::OutputCopyCommandSingle ( const FileLocation& source, + const FileLocation& destination ) +{ + fprintf ( fMakefile, + "%s : %s\n", + backend->GetFullName ( *PassThruCacheDirectory ( &destination ) ).c_str (), + backend->GetFullName ( source ).c_str () ); + fprintf ( fMakefile, + "\t$(ECHO_CP)\n" ); + fprintf ( fMakefile, + "\t${cp} %s %s 1>$(NUL)\n", + backend->GetFullName ( source ).c_str (), + backend->GetFullName ( *PassThruCacheDirectory ( &destination ) ).c_str () ); +} + +string +MingwModuleHandler::GetImportLibraryDependency ( + const Module& importedModule, + bool delayimp ) +{ + string dep; + if ( ReferenceObjects ( importedModule ) ) + { + const vector& compilationUnits = importedModule.non_if_data.compilationUnits; + size_t i; + + dep = GetTargetMacro ( importedModule ); + for ( i = 0; i < compilationUnits.size (); i++ ) + { + CompilationUnit& compilationUnit = *compilationUnits[i]; + const FileLocation& compilationName = compilationUnit.GetFilename (); + const FileLocation *objectFilename = GetObjectFilename ( &compilationName, importedModule ); + if ( GetExtension ( *objectFilename ) == ".h" ) + dep += ssprintf ( " $(%s_HEADERS)", importedModule.name.c_str () ); + else if ( GetExtension ( *objectFilename ) == ".rc" ) + dep += ssprintf ( " $(%s_MCHEADERS)", importedModule.name.c_str () ); + } + } + else + { + const FileLocation *library_target = GetImportLibraryFilename ( importedModule, NULL, delayimp ); + dep = backend->GetFullName ( *library_target ); + delete library_target; + } + + if ( IsStaticLibrary ( importedModule ) || importedModule.type == ObjectLibrary ) + { + const std::vector& libraries = importedModule.non_if_data.libraries; + + for ( size_t i = 0; i < libraries.size (); ++ i ) + { + dep += " "; + dep += GetImportLibraryDependency ( *libraries[i]->importedModule, libraries[i]->delayimp ); + } + } + + return dep; +} + +void +MingwModuleHandler::GetTargets ( const Module& dependencyModule, + string_list& targets ) +{ + if ( dependencyModule.invocations.size () > 0 ) + { + for ( size_t i = 0; i < dependencyModule.invocations.size (); i++ ) + { + Invoke& invoke = *dependencyModule.invocations[i]; + invoke.GetTargets ( targets ); + } + } + else + targets.push_back ( GetImportLibraryDependency ( dependencyModule, false ) ); +} + +void +MingwModuleHandler::GetModuleDependencies ( + string_list& dependencies ) +{ + size_t iend = module.dependencies.size (); + + if ( iend == 0 ) + return; + + for ( size_t i = 0; i < iend; i++ ) + { + const Dependency& dependency = *module.dependencies[i]; + const Module& dependencyModule = *dependency.dependencyModule; + GetTargets ( dependencyModule, + dependencies ); + } + vector v; + GetDefinitionDependencies ( v ); + + for ( size_t i = 0; i < v.size (); i++ ) + { + const FileLocation& file = v[i]; + dependencies.push_back ( backend->GetFullName ( file ) ); + } +} + +/* caller needs to delete the returned object */ +const FileLocation* +MingwModuleHandler::GetObjectFilename ( + const FileLocation* sourceFile, + const Module& module ) const +{ + DirectoryLocation destination_directory; + string newExtension; + string extension = GetExtension ( *sourceFile ); + + if ( module.type == BootSector ) + return new FileLocation ( *module.output ); + else if (extension == ".rc") + newExtension = "_" + module.name + ".coff"; + else if (extension == ".mc") + newExtension = ".rc"; + else if (extension == ".idl") + { + if ( module.type == RpcServer ) + newExtension = "_s.o"; + else if ( module.type == RpcClient ) + newExtension = "_c.o"; + else if ( module.type == RpcProxy ) + newExtension = "_p.o"; + else if ( module.type == IdlInterface ) + newExtension = "_i.o"; + else + newExtension = ".h"; + } + else + newExtension = "_" + module.name + ".o"; + + if ( module.type == BootSector ) + destination_directory = OutputDirectory; + else + destination_directory = IntermediateDirectory; + + const FileLocation *obj_file = new FileLocation( + destination_directory, + sourceFile->relative_path, + ReplaceExtension ( sourceFile->name, newExtension ) ); + PassThruCacheDirectory ( obj_file ); + + return obj_file; +} + +string +MingwModuleHandler::GetModuleCleanTarget ( const Module& module ) const +{ + return module.name + "_clean"; +} + +void +MingwModuleHandler::GetReferencedObjectLibraryModuleCleanTargets ( vector& moduleNames ) const +{ + for ( size_t i = 0; i < module.non_if_data.libraries.size (); i++ ) + { + Library& library = *module.non_if_data.libraries[i]; + if ( library.importedModule->type == ObjectLibrary ) + moduleNames.push_back ( GetModuleCleanTarget ( *library.importedModule ) ); + } +} + +void +MingwModuleHandler::GenerateCleanTarget () const +{ + if ( module.type == Alias ) + return; + + fprintf ( fMakefile, "# CLEAN TARGET\n" ); + fprintf ( fMakefile, + ".PHONY: %s_clean\n", + module.name.c_str() ); + vector referencedModuleNames; + GetReferencedObjectLibraryModuleCleanTargets ( referencedModuleNames ); + fprintf ( fMakefile, + "%s: %s\n\t-@${rm}", + GetModuleCleanTarget ( module ).c_str(), + v2s ( referencedModuleNames, 10 ).c_str () ); + for ( size_t i = 0; i < clean_files.size(); i++ ) + { + if ( ( i + 1 ) % 10 == 9 ) + fprintf ( fMakefile, " 2>$(NUL)\n\t-@${rm}" ); + fprintf ( fMakefile, " %s", clean_files[i].c_str() ); + } + fprintf ( fMakefile, " 2>$(NUL)\n" ); + + // Clean files generated by external rules + fprintf ( fMakefile, "\t-@${rm} $(%s_CLEANFILES) 2>$(NUL)\n", module.name.c_str() ); + + if( ProxyMakefile::GenerateProxyMakefile(module) ) + { + DirectoryLocation root; + + if ( backend->configuration.GenerateProxyMakefilesInSourceTree ) + root = SourceDirectory; + else + root = OutputDirectory; + + FileLocation proxyMakefile ( root, + module.output->relative_path, + "GNUmakefile" ); + fprintf ( fMakefile, "\t-@${rm} %s 2>$(NUL)\n", + backend->GetFullName ( proxyMakefile ).c_str () ); + } + + fprintf ( fMakefile, "clean: %s_clean\n\n", module.name.c_str() ); +} + +void +MingwModuleHandler::GenerateInstallTarget () const +{ + if ( !module.install ) + return; + fprintf ( fMakefile, "# INSTALL TARGET\n" ); + fprintf ( fMakefile, ".PHONY: %s_install\n", module.name.c_str() ); + fprintf ( fMakefile, + "%s_install: %s\n", + module.name.c_str (), + backend->GetFullName ( *module.install ).c_str () ); +} + +void +MingwModuleHandler::GenerateDependsTarget () const +{ + fprintf ( fMakefile, "# DEPENDS TARGET\n" ); + fprintf ( fMakefile, + ".PHONY: %s_depends\n", + module.name.c_str() ); + fprintf ( fMakefile, + "%s_depends: $(RBUILD_TARGET)\n", + module.name.c_str () ); + fprintf ( fMakefile, + "\t$(ECHO_RBUILD)\n" ); + fprintf ( fMakefile, + "\t$(Q)$(RBUILD_TARGET) $(RBUILD_FLAGS) -dm%s mingw\n", + module.name.c_str () ); +} + +static +const char * const CompilerPrefixTable [ CompilerTypesCount ] = +{ + "C", + "CXX", + "CPP", + "AS", + "MIDL", + "RC", + "NASM", +}; + +/* static */ void +MingwModuleHandler::GenerateParameters ( + const char* prefix, + const char* assignmentOperation, + const IfableData& data ) +{ + for ( unsigned type = CompilerTypeCC; type < CompilerTypesCount; ++ type ) + { + CompilerType compiler = static_cast < CompilerType > ( type ); + + // Includes + std::string includes = GenerateIncludeParametersFromVector ( data.includes, compiler ); + + if ( includes.size() ) + { + fprintf ( fMakefile, + "%s_%sINCLUDES%s%s\n", + prefix, + CompilerPrefixTable [ compiler ], + assignmentOperation, + includes.c_str () ); + } + + // Defines + std::string defines = GenerateDefineParametersFromVector ( data.defines, compiler ); + + if ( defines.size() ) + { + fprintf ( fMakefile, + "%s_%sDEFINES%s%s\n", + prefix, + CompilerPrefixTable [ compiler ], + assignmentOperation, + defines.c_str () ); + } + + // Flags + std::string flags = GenerateCompilerParametersFromVector ( data.compilerFlags, compiler ); + + if ( flags.size() ) + { + fprintf ( fMakefile, + "%s_%sFLAGS%s%s\n", + prefix, + CompilerPrefixTable [ compiler ], + assignmentOperation, + flags.c_str () ); + } + } +} + +/* static */ string +MingwModuleHandler::GenerateGccDefineParametersFromVector ( + const vector& defines, + set& used_defs) +{ + string parameters; + + for ( size_t i = 0; i < defines.size (); i++ ) + { + Define& define = *defines[i]; + if (used_defs.find(define.name) != used_defs.end()) + continue; + if (define.redefine) + { + if (parameters.length () > 0) + parameters += " "; + parameters += "-U"; + parameters += define.name; + } + if (parameters.length () > 0) + parameters += " "; + if (define.arguments.length ()) + parameters += "$(QT)"; + parameters += "-D"; + parameters += define.name; + parameters += define.arguments; + if (define.value.length () > 0) + { + parameters += "="; + parameters += define.value; + } + if (define.arguments.length ()) + parameters += "$(QT)"; + used_defs.insert(used_defs.begin(),define.name); + } + return parameters; +} + +/* static */ string +MingwModuleHandler::GenerateDefineParametersFromVector ( + const std::vector& defines, + CompilerType compiler ) +{ + string parameters; + + for ( size_t i = 0; i < defines.size (); i++ ) + { + Define& define = *defines[i]; + if (!define.IsCompilerSet (compiler)) + continue; + if (define.redefine) + { + if (parameters.length () > 0) + parameters += " "; + parameters += "-U"; + parameters += define.name; + } + if (parameters.length () > 0) + parameters += " "; + if (define.arguments.length ()) + parameters += "$(QT)"; + parameters += "-D"; + parameters += define.name; + parameters += define.arguments; + if (define.value.length () > 0) + { + parameters += "="; + parameters += define.value; + } + if (define.arguments.length ()) + parameters += "$(QT)"; + } + return parameters; +} + +string +MingwModuleHandler::ConcatenatePaths ( + const string& path1, + const string& path2 ) const +{ + if ( ( path1.length () == 0 ) || ( path1 == "." ) || ( path1 == "./" ) ) + return path2; + if ( path1[path1.length ()] == cSep ) + return path1 + path2; + else + return path1 + cSep + path2; +} + +/* static */ string +MingwModuleHandler::GenerateIncludeParametersFromVector ( const vector& includes, const CompilerType type ) +{ + string parameters, path_prefix; + for ( size_t i = 0; i < includes.size (); i++ ) + { + Include& include = *includes[i]; + if ( include.IsCompilerSet( type ) ) + parameters += " -I" + backend->GetFullPath ( *include.directory ); + } + return parameters; +} + +/* static */ string +MingwModuleHandler::GenerateCompilerParametersFromVector ( const vector& compilerFlags, const CompilerType type ) +{ + string parameters; + for ( size_t i = 0; i < compilerFlags.size (); i++ ) + { + CompilerFlag& compilerFlag = *compilerFlags[i]; + if ( compilerFlag.IsCompilerSet( type ) ) + parameters += " " + compilerFlag.flag; + } + return parameters; +} + +string +MingwModuleHandler::GenerateLinkerParametersFromVector ( const vector& linkerFlags ) const +{ + string parameters; + for ( size_t i = 0; i < linkerFlags.size (); i++ ) + { + LinkerFlag& linkerFlag = *linkerFlags[i]; + if ( parameters.length () > 0 ) + parameters += " "; + parameters += linkerFlag.flag; + } + return parameters; +} + +string +MingwModuleHandler::GenerateImportLibraryDependenciesFromVector ( + const vector& libraries ) +{ + string dependencies ( "" ); + int wrap_count = 0; + for ( size_t i = 0; i < libraries.size (); i++ ) + { + if ( wrap_count++ == 5 ) + dependencies += " \\\n\t\t", wrap_count = 0; + else if ( dependencies.size () > 0 ) + dependencies += " "; + dependencies += GetImportLibraryDependency ( *libraries[i]->importedModule, libraries[i]->delayimp ); + } + return dependencies; +} + +string +MingwModuleHandler::GenerateLinkerParameters () const +{ + return GenerateLinkerParametersFromVector ( module.linkerFlags ); +} + +void +MingwModuleHandler::GenerateMacros ( + const char* assignmentOperation, + const IfableData& data, + const vector* linkerFlags, + set& used_defs ) +{ + if ( linkerFlags != NULL ) + { + string linkerParameters = GenerateLinkerParametersFromVector ( *linkerFlags ); + if ( linkerParameters.size () > 0 ) + { + fprintf ( + fMakefile, + "%s %s %s\n", + linkerflagsMacro.c_str (), + assignmentOperation, + linkerParameters.c_str() ); + } + } + + if ( data.libraries.size () > 0 ) + { + // Check if host and target modules are not mixed up + HostType current = ModuleHandlerInformations[module.type].DefaultHost; + std::vector::const_iterator it; + for ( it = data.libraries.begin(); it != data.libraries.end(); ++it ) + { + HostType imported = ModuleHandlerInformations[(*it)->importedModule->type].DefaultHost; + if (current != imported) + { + throw InvalidOperationException ( __FILE__, + __LINE__, + "Module '%s' imports module '%s', which is not of the right type", + module.name.c_str (), + (*it)->importedModule->name.c_str () ); + } + } + + string deps = GenerateImportLibraryDependenciesFromVector ( data.libraries ); + if ( deps.size () > 0 ) + { + fprintf ( + fMakefile, + "%s %s %s\n", + libsMacro.c_str(), + assignmentOperation, + deps.c_str() ); + } + } +} + +void +MingwModuleHandler::CleanupCompilationUnitVector ( vector& compilationUnits ) +{ + for ( size_t i = 0; i < compilationUnits.size (); i++ ) + delete compilationUnits[i]; +} + +void +MingwModuleHandler::GetModuleSpecificCompilationUnits ( vector& compilationUnits ) +{ +} + +void +MingwModuleHandler::GenerateSourceMacros ( + const IfableData& data ) +{ + size_t i; + + const vector& compilationUnits = data.compilationUnits; + vector headers; + if ( compilationUnits.size () > 0 ) + { + fprintf ( + fMakefile, + "%s =", + sourcesMacro.c_str () ); + for ( i = 0; i < compilationUnits.size(); i++ ) + { + CompilationUnit& compilationUnit = *compilationUnits[i]; + const FileLocation& compilationName = compilationUnit.GetFilename (); + fprintf ( + fMakefile, + "%s%s", + ( i%10 == 9 ? " \\\n\t" : " " ), + backend->GetFullName ( compilationName ).c_str () ); + } + fprintf ( fMakefile, "\n" ); + } + + vector sourceCompilationUnits; + GetModuleSpecificCompilationUnits ( sourceCompilationUnits ); + for ( i = 0; i < sourceCompilationUnits.size (); i++ ) + { + const FileLocation& compilationName = sourceCompilationUnits[i]->GetFilename (); + fprintf ( + fMakefile, + "%s += %s\n", + sourcesMacro.c_str(), + backend->GetFullName ( compilationName ).c_str () ); + } + CleanupCompilationUnitVector ( sourceCompilationUnits ); +} + +void +MingwModuleHandler::GenerateObjectMacros ( + const IfableData& data ) +{ + size_t i; + const char* assignmentOperation = "="; + + const vector& compilationUnits = data.compilationUnits; + vector headers; + vector mcheaders; + vector mcresources; + if ( compilationUnits.size () > 0 ) + { + for ( i = 0; i < compilationUnits.size (); i++ ) + { + CompilationUnit& compilationUnit = *compilationUnits[i]; + if ( compilationUnit.IsFirstFile () ) + { + const FileLocation& compilationName = compilationUnit.GetFilename (); + const FileLocation *object_file = GetObjectFilename ( &compilationName, module ); + fprintf ( fMakefile, + "%s := %s\n", + objectsMacro.c_str(), + backend->GetFullName ( *object_file ).c_str () ); + delete object_file; + assignmentOperation = "+="; + break; + } + } + fprintf ( + fMakefile, + "%s %s", + objectsMacro.c_str (), + assignmentOperation ); + for ( i = 0; i < compilationUnits.size(); i++ ) + { + CompilationUnit& compilationUnit = *compilationUnits[i]; + if ( !compilationUnit.IsFirstFile () ) + { + const FileLocation& compilationName = compilationUnit.GetFilename (); + const FileLocation *objectFilename = GetObjectFilename ( &compilationName, module ); + if ( GetExtension ( *objectFilename ) == ".h" ) + headers.push_back ( objectFilename ); + else if ( GetExtension ( *objectFilename ) == ".rc" ) + { + const FileLocation *headerFilename = GetMcHeaderFilename ( &compilationUnit.GetFilename () ); + mcheaders.push_back ( headerFilename ); + mcresources.push_back ( objectFilename ); + } + else + { + fprintf ( + fMakefile, + "%s%s", + ( i%10 == 9 ? " \\\n\t" : " " ), + backend->GetFullName ( *objectFilename ).c_str () ); + delete objectFilename; + } + } + } + fprintf ( fMakefile, "\n" ); + } + if ( headers.size () > 0 ) + { + fprintf ( + fMakefile, + "%s_HEADERS %s", + module.name.c_str (), + assignmentOperation ); + for ( i = 0; i < headers.size (); i++ ) + { + fprintf ( + fMakefile, + "%s%s", + ( i%10 == 9 ? " \\\n\t" : " " ), + backend->GetFullName ( *headers[i] ).c_str () ); + delete headers[i]; + } + fprintf ( fMakefile, "\n" ); + } + + if ( mcheaders.size () > 0 ) + { + fprintf ( + fMakefile, + "%s_MCHEADERS %s", + module.name.c_str (), + assignmentOperation ); + for ( i = 0; i < mcheaders.size (); i++ ) + { + fprintf ( + fMakefile, + "%s%s", + ( i%10 == 9 ? " \\\n\t" : " " ), + backend->GetFullName ( *mcheaders[i] ).c_str () ); + delete mcheaders[i]; + } + fprintf ( fMakefile, "\n" ); + } + + if ( mcresources.size () > 0 ) + { + fprintf ( + fMakefile, + "%s_RESOURCES %s", + module.name.c_str (), + assignmentOperation ); + for ( i = 0; i < mcresources.size (); i++ ) + { + fprintf ( + fMakefile, + "%s%s", + ( i%10 == 9 ? " \\\n\t" : " " ), + backend->GetFullName ( *mcresources[i] ).c_str () ); + delete mcresources[i]; + } + fprintf ( fMakefile, "\n" ); + } + + vector sourceCompilationUnits; + GetModuleSpecificCompilationUnits ( sourceCompilationUnits ); + for ( i = 0; i < sourceCompilationUnits.size (); i++ ) + { + const FileLocation& compilationName = sourceCompilationUnits[i]->GetFilename (); + const FileLocation *object_file = GetObjectFilename ( &compilationName, module ); + fprintf ( + fMakefile, + "%s += %s\n", + objectsMacro.c_str(), + backend->GetFullName ( *object_file ).c_str () ); + delete object_file; + } + CleanupCompilationUnitVector ( sourceCompilationUnits ); + + if ( module.IsSpecDefinitionFile() ) + { + const FileLocation *stubs_file = new FileLocation( + IntermediateDirectory, + module.importLibrary->source->relative_path, + ReplaceExtension ( module.importLibrary->source->name, "_" + module.name + ".stubs.o" ) ); + + fprintf ( + fMakefile, + "%s += %s\n", + objectsMacro.c_str(), + backend->GetFullName ( *stubs_file ).c_str () ); + + delete stubs_file; + } + + if ( module.type == RpcProxy ) + { + const FileLocation *dlldata_file = GetDlldataFilename(); + + fprintf ( + fMakefile, + "%s += %s\n", + objectsMacro.c_str(), + ReplaceExtension ( backend->GetFullName ( *dlldata_file ), ".o" ).c_str() ); + + delete dlldata_file; + } +} + +const FileLocation* +MingwModuleHandler::GetDlldataFilename() const +{ + std::string dlldata_path = ""; + size_t dlldata_path_len = module.xmlbuildFile.find_last_of(cSep); + + if ( dlldata_path_len != std::string::npos && dlldata_path_len != 0 ) + dlldata_path = module.xmlbuildFile.substr(0, dlldata_path_len); + + return new FileLocation( IntermediateDirectory, dlldata_path, module.name + ".dlldata.c" ); +} + +const FileLocation* +MingwModuleHandler::GetPrecompiledHeaderPath () const +{ + if ( !module.pch || !use_pch ) + return NULL; + return new FileLocation ( IntermediateDirectory, + module.pch->file->relative_path, + ".gch_" + module.name ); +} + +const FileLocation* +MingwModuleHandler::GetPrecompiledHeaderFilename () const +{ + if ( !module.pch || !use_pch ) + return NULL; + return new FileLocation ( IntermediateDirectory, + module.pch->file->relative_path + "/.gch_" + module.name, + module.pch->file->name + ".gch" ); +} + +Rule windresRule ( "$(eval $(call RBUILD_WRC_RULE,$(module_name),$(source),$(dependencies),$(compiler_flags)))\n", + "$(intermediate_path_unique).coff", + "$(intermediate_path_unique).res", + "$(intermediate_path_unique).res.d", + "$(intermediate_dir)$(SEP)", NULL ); +Rule winebuildPRule ( "$(eval $(call RBUILD_WINEBUILD_WITH_CPP_RULE,$(module_name),$(source),$(dependencies),$(compiler_flags),$(module_dllname)))\n", + "$(intermediate_path_unique).spec", + "$(intermediate_path_unique).spec.d", + "$(intermediate_path_unique).auto.def", + "$(intermediate_path_unique).stubs.c", + "$(intermediate_path_unique).stubs.o", + "$(intermediate_path_unique).stubs.o.d", + "$(intermediate_dir)$(SEP)", NULL ); +Rule winebuildRule ( "$(eval $(call RBUILD_WINEBUILD_RULE,$(module_name),$(source),$(dependencies),$(compiler_flags),$(module_dllname)))\n", + "$(intermediate_path_unique).auto.def", + "$(intermediate_path_unique).stubs.c", + "$(intermediate_path_unique).stubs.o", + "$(intermediate_path_unique).stubs.o.d", + "$(intermediate_dir)$(SEP)", NULL ); +Rule gasRule ( "$(eval $(call RBUILD_GAS_RULE,$(module_name),$(source),$(dependencies),$(compiler_flags)))\n", + "$(intermediate_path_unique).o", + "$(intermediate_path_unique).o.d", NULL ); +Rule gccRule ( "$(eval $(call RBUILD_CC_RULE,$(module_name),$(source),$(dependencies),$(compiler_flags)))\n", + "$(intermediate_path_unique).o", + "$(intermediate_path_unique).o.d", NULL ); +Rule gccHostRule ( "$(eval $(call RBUILD_HOST_GCC_RULE,$(module_name),$(source),$(dependencies),$(compiler_flags)))\n", + "$(intermediate_path_unique).o", NULL ); +Rule gppRule ( "$(eval $(call RBUILD_CXX_RULE,$(module_name),$(source),$(dependencies),$(compiler_flags)))\n", + "$(intermediate_path_unique).o", + "$(intermediate_path_unique).o.d", NULL ); +Rule gppHostRule ( "$(eval $(call RBUILD_HOST_GPP_RULE,$(module_name),$(source),$(dependencies),$(compiler_flags)))\n", + "$(intermediate_path_unique).o", NULL ); +Rule widlHeaderRule ( "$(eval $(call RBUILD_WIDL_HEADER_RULE,$(module_name),$(source),$(dependencies),$(compiler_flags)))\n", + "$(intermediate_path_noext).h", + "$(intermediate_dir)$(SEP)", NULL ); +Rule widlServerRule ( "$(eval $(call RBUILD_WIDL_SERVER_RULE,$(module_name),$(source),$(dependencies),$(compiler_flags)))\n", + "$(intermediate_path_noext)_s.h", + "$(intermediate_path_noext)_s.c", + "$(intermediate_path_noext)_s.o", + "$(intermediate_dir)$(SEP)", NULL ); +Rule widlClientRule ( "$(eval $(call RBUILD_WIDL_CLIENT_RULE,$(module_name),$(source),$(dependencies),$(compiler_flags)))\n", + "$(intermediate_path_noext)_c.h", + "$(intermediate_path_noext)_c.c", + "$(intermediate_path_noext)_c.o", + "$(intermediate_dir)$(SEP)", NULL ); +Rule widlProxyRule ( "$(eval $(call RBUILD_WIDL_PROXY_RULE,$(module_name),$(source),$(dependencies),$(compiler_flags)))\n", + "$(intermediate_path_noext)_p.h", + "$(intermediate_path_noext)_p.c", + "$(intermediate_path_noext)_p.o", + "$(intermediate_dir)$(SEP)", NULL ); +Rule widlInterfaceRule ( "$(eval $(call RBUILD_WIDL_INTERFACE_RULE,$(module_name),$(source),$(dependencies),$(compiler_flags)))\n", + "$(intermediate_path_noext)_i.c", + "$(intermediate_path_noext)_i.o", + "$(intermediate_dir)$(SEP)", NULL ); +Rule widlDlldataRule ( "$(eval $(call RBUILD_WIDL_DLLDATA_RULE,$(module_name),$(source),$(dependencies),$(compiler_flags),$(bare_dependencies)))\n", + "$(intermediate_path_noext).o", NULL ); +Rule widlTlbRule ( "$(eval $(call RBUILD_WIDL_TLB_RULE,$(module_name),$(source),$(dependencies),$(compiler_flags)))\n", + "$(intermediate_dir)$(SEP)", NULL ); +Rule pchRule ( "$(eval $(call RBUILD_CC_PCH_RULE,$(module_name),$(source),$(dependencies),$(compiler_flags)))\n", + "$(intermediate_dir)$(SEP).gch_$(module_name)$(SEP)$(source_name).gch", + "$(intermediate_dir)$(SEP).gch_$(module_name)$(SEP)$(source_name).gch.d", + "$(intermediate_dir)$(SEP).gch_$(module_name)$(SEP)", NULL ); +Rule pchCxxRule ( "$(eval $(call RBUILD_CXX_PCH_RULE,$(module_name),$(source),$(dependencies),$(compiler_flags)))\n", + "$(intermediate_dir)$(SEP).gch_$(module_name)$(SEP)$(source_name).gch", + "$(intermediate_dir)$(SEP).gch_$(module_name)$(SEP)$(source_name).gch.d", + "$(intermediate_dir)$(SEP).gch_$(module_name)$(SEP)", NULL ); +Rule bootRule ( "$(eval $(call RBUILD_NASM,$(module_name),$(source),$(dependencies),,$(module_output)))\n", + "$(module_output)", + "$(OUTPUT)$(SEP)$(source_dir)$(SEP)", NULL ); +Rule nasmRule ( "$(eval $(call RBUILD_NASM,$(module_name),$(source),$(dependencies),,$(intermediate_path_unique).o))\n", + "$(intermediate_path_unique).o", + "$(intermediate_dir)$(SEP)", NULL ); + +/* TODO: move these to rules.mak */ +Rule wmcRule ( "$(intermediate_path_noext).rc $(INTERMEDIATE)$(SEP)include$(SEP)reactos$(SEP)$(source_name_noext).h: $(wmc_TARGET) $(source) | $(intermediate_dir)\n" + "\t$(ECHO_WMC)\n" + "\t$(Q)$(wmc_TARGET) -i -H $(INTERMEDIATE)$(SEP)include$(SEP)reactos$(SEP)$(source_name_noext).h -o $(intermediate_path_noext).rc $(source)\n", + "$(intermediate_path_noext).rc", + "$(INTERMEDIATE)$(SEP)include$(SEP)reactos$(SEP)$(source_name_noext).h", + "$(intermediate_dir)$(SEP)", NULL ); +/* TODO: if possible, move these to rules.mak */ +Rule arRule1 ( "$(intermediate_path_noext).a: $($(module_name)_OBJS) $(dependencies) | $(intermediate_dir)\n", + "$(intermediate_path_noext).a", + "$(intermediate_dir)$(SEP)", NULL ); +Rule arRule2 ( "\t$(ECHO_AR)\n" + "\t${ar} -rc $@ $($(module_name)_OBJS)\n", + NULL ); +Rule arHostRule2 ( "\t$(ECHO_HOSTAR)\n" + "\t${host_ar} -rc $@ $($(module_name)_OBJS)\n", + NULL ); + +Rule emptyRule ( "", NULL ); + +void +MingwModuleHandler::GenerateGccCommand ( + const FileLocation* sourceFile, + const Rule *rule, + const string& extraDependencies ) +{ + const FileLocation *pchFilename = GetPrecompiledHeaderFilename (); + string dependencies = extraDependencies; + + if ( pchFilename ) + { + dependencies += " " + backend->GetFullName ( *pchFilename ); + delete pchFilename; + } + + /* WIDL generated headers may be used */ + vector rpcDependencies; + GetRpcHeaderDependencies ( rpcDependencies ); + if ( rpcDependencies.size () > 0 ) + dependencies += " " + v2s ( backend, rpcDependencies, 5 ); + + rule->Execute ( fMakefile, backend, module, sourceFile, clean_files, dependencies ); +} + +string +MingwModuleHandler::GetPropertyValue ( const Module& module, const std::string& name ) +{ + const Property* property = module.project.LookupProperty(name); + + if (property) + return property->value; + else + return string ( "" ); +} + +/* caller needs to delete the returned object */ +const FileLocation* +MingwModuleHandler::GetRpcServerHeaderFilename ( const FileLocation *base ) const +{ + string newname = GetBasename ( base->name ) + "_s.h"; + return new FileLocation ( IntermediateDirectory, base->relative_path, newname ); +} + +/* caller needs to delete the returned object */ +const FileLocation* +MingwModuleHandler::GetRpcClientHeaderFilename ( const FileLocation *base ) const +{ + string newname = GetBasename ( base->name ) + "_c.h"; + return new FileLocation ( IntermediateDirectory, base->relative_path, newname ); +} + +/* caller needs to delete the returned object */ +const FileLocation* +MingwModuleHandler::GetRpcProxyHeaderFilename ( const FileLocation *base ) const +{ + string newname = GetBasename ( base->name ) + "_p.h"; + return new FileLocation ( IntermediateDirectory, base->relative_path, newname ); +} + +/* caller needs to delete the returned object */ +const FileLocation* +MingwModuleHandler::GetIdlHeaderFilename ( const FileLocation *base ) const +{ + string newname = GetBasename ( base->name ) + ".h"; + return new FileLocation ( IntermediateDirectory, base->relative_path, newname ); +} + +/* caller needs to delete the returned object */ +const FileLocation* +MingwModuleHandler::GetMcHeaderFilename ( const FileLocation *base ) const +{ + string newname = GetBasename ( base->name ) + ".h"; + return new FileLocation ( IntermediateDirectory, "include/reactos" , newname ); +} + +void +MingwModuleHandler::GenerateCommands ( + const CompilationUnit& compilationUnit, + const string& extraDependencies ) +{ + const FileLocation& sourceFile = compilationUnit.GetFilename (); + string extension = GetExtension ( sourceFile ); + std::transform ( extension.begin (), extension.end (), extension.begin (), tolower ); + + struct + { + HostType host; + ModuleType type; + string extension; + Rule* rule; + } rules[] = { + { HostDontCare, TypeDontCare, ".s", &gasRule }, + { HostDontCare, BootSector, ".asm", &bootRule }, + { HostDontCare, TypeDontCare, ".asm", &nasmRule }, + { HostDontCare, TypeDontCare, ".rc", &windresRule }, + { HostDontCare, TypeDontCare, ".mc", &wmcRule }, + { HostDontCare, RpcServer, ".idl", &widlServerRule }, + { HostDontCare, RpcClient, ".idl", &widlClientRule }, + { HostDontCare, RpcProxy, ".idl", &widlProxyRule }, + { HostDontCare, IdlInterface, ".idl", &widlInterfaceRule }, + { HostDontCare, EmbeddedTypeLib, ".idl", &widlTlbRule }, + { HostDontCare, TypeDontCare, ".idl", &widlHeaderRule }, + { HostTrue, TypeDontCare, ".c", &gccHostRule }, + { HostTrue, TypeDontCare, ".cc", &gppHostRule }, + { HostTrue, TypeDontCare, ".cpp", &gppHostRule }, + { HostTrue, TypeDontCare, ".cxx", &gppHostRule }, + { HostFalse, TypeDontCare, ".c", &gccRule }, + { HostFalse, TypeDontCare, ".cc", &gppRule }, + { HostFalse, TypeDontCare, ".cpp", &gppRule }, + { HostFalse, TypeDontCare, ".cxx", &gppRule }, + { HostFalse, Cabinet, ".*", &emptyRule } + }; + size_t i; + Rule *customRule = NULL; + + for ( i = 0; i < sizeof ( rules ) / sizeof ( rules[0] ); i++ ) + { + if ( rules[i].host != HostDontCare && rules[i].host != ModuleHandlerInformations[module.type].DefaultHost ) + continue; + if ( rules[i].type != TypeDontCare && rules[i].type != module.type ) + continue; + if ( rules[i].extension != extension && rules[i].extension != ".*") + continue; + customRule = rules[i].rule; + break; + } + + if ( extension == ".c" || extension == ".cc" || extension == ".cpp" || extension == ".cxx" ) + { + GenerateGccCommand ( &sourceFile, + customRule, + GetCompilationUnitDependencies ( compilationUnit ) + extraDependencies ); + } + else if ( customRule ) + customRule->Execute ( fMakefile, backend, module, &sourceFile, clean_files ); + else + { + throw InvalidOperationException ( __FILE__, + __LINE__, + "Unsupported filename extension '%s' in file '%s'", + extension.c_str (), + backend->GetFullName ( sourceFile ).c_str () ); + } +} + +void +MingwModuleHandler::GenerateBuildMapCode ( const FileLocation *mapTarget ) +{ + fprintf ( fMakefile, "# BUILD MAP CODE\n" ); + + fprintf ( fMakefile, + "ifeq ($(ROS_BUILDMAP),full)\n" ); + + FileLocation mapFilename ( OutputDirectory, + module.output->relative_path, + GetBasename ( module.output->name ) + ".map" ); + CLEAN_FILE ( mapFilename ); + + fprintf ( fMakefile, + "\t$(ECHO_OBJDUMP)\n" ); + fprintf ( fMakefile, + "\t$(Q)${objdump} -d -S %s > %s\n", + mapTarget ? backend->GetFullName ( *mapTarget ).c_str () : "$@", + backend->GetFullName ( mapFilename ).c_str () ); + + fprintf ( fMakefile, + "else\n" ); + fprintf ( fMakefile, + "ifeq ($(ROS_BUILDMAP),yes)\n" ); + + fprintf ( fMakefile, + "\t$(ECHO_NM)\n" ); + fprintf ( fMakefile, + "\t$(Q)${nm} --numeric-sort %s > %s\n", + mapTarget ? backend->GetFullName ( *mapTarget ).c_str () : "$@", + backend->GetFullName ( mapFilename ).c_str () ); + + fprintf ( fMakefile, + "endif\n" ); + + fprintf ( fMakefile, + "endif\n" ); +} + +void +MergeStringVector ( const Backend* backend, + const vector& input, + vector& output ) +{ + int wrap_at = 25; + string s; + int wrap_count = -1; + for ( size_t i = 0; i < input.size (); i++ ) + { + if ( wrap_count++ == wrap_at ) + { + output.push_back ( s ); + s = ""; + wrap_count = 0; + } + else if ( s.size () > 0) + s += " "; + s += backend->GetFullName ( input[i] ); + } + if ( s.length () > 0 ) + output.push_back ( s ); +} + +void +MingwModuleHandler::GetObjectsVector ( const IfableData& data, + vector& objectFiles ) const +{ + for ( size_t i = 0; i < data.compilationUnits.size (); i++ ) + { + CompilationUnit& compilationUnit = *data.compilationUnits[i]; + const FileLocation& compilationName = compilationUnit.GetFilename (); + const FileLocation *object_file = GetObjectFilename ( &compilationName, module ); + objectFiles.push_back ( *object_file ); + delete object_file; + } +} + +void +MingwModuleHandler::GenerateCleanObjectsAsYouGoCode () const +{ + if ( backend->configuration.CleanAsYouGo ) + { + vector objectFiles; + GetObjectsVector ( module.non_if_data, + objectFiles ); + vector lines; + MergeStringVector ( backend, + objectFiles, + lines ); + for ( size_t i = 0; i < lines.size (); i++ ) + { + fprintf ( fMakefile, + "\t-@${rm} %s 2>$(NUL)\n", + lines[i].c_str () ); + } + } +} + +void +MingwModuleHandler::GenerateLinkerCommand () const +{ + string definitionFilename; + + const FileLocation *DefinitionFilename = GetDefinitionFilename (); + + if ( DefinitionFilename ) { + definitionFilename = backend->GetFullName (*DefinitionFilename); + delete DefinitionFilename; + } + + string linkerScriptArgument; + if ( module.linkerScript != NULL ) { + if ( module.project.configuration.Linker == GnuLd ) + linkerScriptArgument = ssprintf ( " -T %s", backend->GetFullName ( *module.linkerScript->file ).c_str () ); + else + fprintf ( stderr, + "Linker doesn't support linker scripts: linker script %s ignored for module %s\n", + backend->GetFullName ( *module.linkerScript->file ).c_str (), + module.name.c_str() ); + } + + string extraLibraries; + if ( ModuleHandlerInformations[module.type].DefaultHost == HostFalse ) { + if ( module.cplusplus ) { + switch ( module.type ) + { + case Win32DLL: + case Win32OCX: + case Win32CUI: + case Win32GUI: + case Win32SCR: + extraLibraries = "$$(PROJECT_CXXLIBS)"; + break; + + default: + extraLibraries = "$$(PROJECT_CCLIBS)"; + break; + } + } else + extraLibraries = "$$(PROJECT_CCLIBS)"; + } + + delete PassThruCacheDirectory ( new FileLocation ( module.output->directory, module.output->relative_path, "" ) ); + delete PassThruCacheDirectory ( new FileLocation ( IntermediateDirectory, module.output->relative_path, "" ) ); + + fprintf ( fMakefile, + "$(eval $(call RBUILD_LINK_RULE,%s,%s,%s,%s,%s,%s,%s))\n", + module.name.c_str(), + definitionFilename.c_str(), + module.xmlbuildFile.c_str(), + linkerScriptArgument.c_str(), + extraLibraries.c_str(), + module.GetEntryPoint().c_str(), + module.baseaddress.c_str() ); +} + +void +MingwModuleHandler::GenerateObjectFileTargets ( const IfableData& data ) +{ + size_t i; + string moduleDependencies; + + const vector& compilationUnits = data.compilationUnits; + for ( i = 0; i < compilationUnits.size (); i++ ) + { + CompilationUnit& compilationUnit = *compilationUnits[i]; + const FileLocation& compilationName = compilationUnit.GetFilename (); + const FileLocation *objectFilename = GetObjectFilename ( &compilationName, module ); + if ( GetExtension ( *objectFilename ) == ".h" ) + moduleDependencies += ssprintf ( " $(%s_HEADERS)", module.name.c_str () ); + else if ( GetExtension ( *objectFilename ) == ".rc" ) + moduleDependencies += ssprintf ( " $(%s_RESOURCES)", module.name.c_str () ); + delete objectFilename; + } + + for ( i = 0; i < compilationUnits.size (); i++ ) + { + GenerateCommands ( *compilationUnits[i], + moduleDependencies ); + } + + vector sourceCompilationUnits; + GetModuleSpecificCompilationUnits ( sourceCompilationUnits ); + for ( i = 0; i < sourceCompilationUnits.size (); i++ ) + { + GenerateCommands ( *sourceCompilationUnits[i], + moduleDependencies ); + } + CleanupCompilationUnitVector ( sourceCompilationUnits ); + + if ( module.type == RpcProxy ) + { + widlDlldataRule.Execute ( fMakefile, + backend, + module, + GetDlldataFilename(), + clean_files, + ssprintf ( "$(%s_SOURCES)", module.name.c_str ()) ); + } +} + +void +MingwModuleHandler::GenerateObjectFileTargets () +{ + if ( module.pch && use_pch ) + { + + std::map vars; + + /* WIDL generated headers may be used */ + string dependencies; + vector rpcDependencies; + GetRpcHeaderDependencies ( rpcDependencies ); + if ( rpcDependencies.size () > 0 ) + dependencies = " " + v2s ( backend, rpcDependencies, 5 ); + + if ( module.cplusplus ) + pchCxxRule.Execute ( fMakefile, backend, module, module.pch->file, clean_files, dependencies ); + else + pchRule.Execute ( fMakefile, backend, module, module.pch->file, clean_files, dependencies ); + } + + GenerateObjectFileTargets ( module.non_if_data ); +} + +/* caller needs to delete the returned object */ +const FileLocation* +MingwModuleHandler::GenerateArchiveTarget () +{ + const FileLocation *archiveFilename = GetModuleArchiveFilename (); + + if ( archiveFilename == NULL ) + return NULL; + + const FileLocation *definitionFilename = GetDefinitionFilename (); + + fprintf ( fMakefile, "# ARCHIVE TARGET\n" ); + + if ( IsStaticLibrary ( module ) && definitionFilename ) + { + arRule1.Execute ( fMakefile, + backend, + module, + archiveFilename, + clean_files, + backend->GetFullName ( *definitionFilename ).c_str () ); + + fprintf ( fMakefile, + "\t${dlltool} --def %s --kill-at --output-lib $@\n", + backend->GetFullName ( *definitionFilename ).c_str () ); + } + else + arRule1.Execute ( fMakefile, backend, module, archiveFilename, clean_files ); + + if ( definitionFilename ) + delete definitionFilename; + + if(module.type == HostStaticLibrary) + arHostRule2.Execute ( fMakefile, backend, module, archiveFilename, clean_files ); + else + arRule2.Execute ( fMakefile, backend, module, archiveFilename, clean_files ); + + GenerateCleanObjectsAsYouGoCode (); + + fprintf ( fMakefile, "\n" ); + + return archiveFilename; +} + +/*static*/ string +MingwModuleHandler::GetObjectsMacro ( const Module& module ) +{ + return ssprintf ( "$(%s_OBJS)", + module.name.c_str () ); +} + +string +MingwModuleHandler::GetLibsMacro () const +{ + return ssprintf ( "$(%s_LIBS)", module.name.c_str () ); +} + +string +MingwModuleHandler::GetLinkerMacro () const +{ + return ssprintf ( "$(%s_LDFLAGS)", + module.name.c_str () ); +} + +string +MingwModuleHandler::GetDebugFormat () +{ + if (Environment::GetArch() == "amd64") + { + return "dwarf-2"; + } + return "stabs+"; +} + +string +MingwModuleHandler::GetModuleTargets ( const Module& module ) +{ + if ( ReferenceObjects ( module ) ) + return GetObjectsMacro ( module ); + else + { + const FileLocation *target_file = GetTargetFilename ( module, NULL ); + string target = backend->GetFullName ( *target_file ).c_str (); + delete target_file; + return target; + } +} + +void +MingwModuleHandler::GenerateSourceMacro () +{ + sourcesMacro = ssprintf ( "%s_SOURCES", module.name.c_str ()); + + if ( module.type == RpcProxy || module.type == Cabinet ) + GenerateSourceMacros ( module.non_if_data ); + + // future references to the macro will be to get its values + sourcesMacro = ssprintf ("$(%s)", sourcesMacro.c_str ()); +} + +void +MingwModuleHandler::GenerateObjectMacro () +{ + objectsMacro = ssprintf ("%s_OBJS", module.name.c_str ()); + + GenerateObjectMacros ( module.non_if_data ); + + // future references to the macro will be to get its values + objectsMacro = ssprintf ("$(%s)", objectsMacro.c_str ()); +} + +void +MingwModuleHandler::GenerateTargetMacro () +{ + fprintf ( fMakefile, + "%s := %s\n", + GetTargetMacro ( module, false ).c_str (), + GetModuleTargets ( module ).c_str () ); +} + +void +MingwModuleHandler::GetRpcHeaderDependencies ( + vector& dependencies ) const +{ + for ( size_t i = 0; i < module.non_if_data.libraries.size (); i++ ) + { + Library& library = *module.non_if_data.libraries[i]; + if ( library.importedModule->type == RpcServer || + library.importedModule->type == RpcClient || + library.importedModule->type == RpcProxy || + library.importedModule->type == IdlHeader ) + { + for ( size_t j = 0; j < library.importedModule->non_if_data.compilationUnits.size (); j++ ) + { + CompilationUnit& compilationUnit = *library.importedModule->non_if_data.compilationUnits[j]; + const FileLocation& sourceFile = compilationUnit.GetFilename (); + string extension = GetExtension ( sourceFile ); + if ( extension == ".idl" || extension == ".IDL" ) + { + string basename = GetBasename ( sourceFile.name ); + if ( library.importedModule->type == RpcServer ) + { + const FileLocation *header = GetRpcServerHeaderFilename ( &sourceFile ); + dependencies.push_back ( *header ); + delete header; + } + if ( library.importedModule->type == RpcClient ) + { + const FileLocation *header = GetRpcClientHeaderFilename ( &sourceFile ); + dependencies.push_back ( *header ); + delete header; + } + if ( library.importedModule->type == RpcProxy ) + { + const FileLocation *header = GetRpcProxyHeaderFilename ( &sourceFile ); + dependencies.push_back ( *header ); + delete header; + } + if ( library.importedModule->type == IdlHeader ) + { + const FileLocation *header = GetIdlHeaderFilename ( &sourceFile ); + dependencies.push_back ( *header ); + delete header; + } + } + } + } + } +} + +void +MingwModuleHandler::GenerateOtherMacros () +{ + set used_defs; + + linkerflagsMacro = ssprintf ("%s_LDFLAGS", module.name.c_str ()); + libsMacro = ssprintf("%s_LIBS", module.name.c_str ()); + + const FileLocation * pchPath = GetPrecompiledHeaderPath (); + + if ( pchPath ) + { + string pchPathStr = backend->GetFullName ( *pchPath ); + delete pchPath; + + fprintf ( fMakefile, + "%s_%sINCLUDES+= -I%s\n", + module.name.c_str(), + CompilerPrefixTable[CompilerTypeCC], + pchPathStr.c_str() ); + + fprintf ( fMakefile, + "%s_%sINCLUDES+= -I%s\n", + module.name.c_str(), + CompilerPrefixTable[CompilerTypeCXX], + pchPathStr.c_str() ); + } + + const char * toolPrefix = ""; + + if ( ModuleHandlerInformations[module.type].DefaultHost == HostTrue ) + toolPrefix = "HOST_"; + + // FIXME: this is very ugly and generates lots of useless entries + for ( unsigned type = CompilerTypeCC; type < CompilerTypesCount; ++ type ) + { + string flags; + + if ( module.dynamicCRT ) + flags += ssprintf ( " $(%s%sFLAG_CRTDLL)", toolPrefix, CompilerPrefixTable[type] ); + + // FIXME: this duplicates the flag for CPP and C/CXX + if ( !module.allowWarnings ) + flags += ssprintf ( " $(%s%sFLAG_WERROR)", toolPrefix, CompilerPrefixTable[type] ); + + if ( module.isUnicode ) + flags += ssprintf ( " $(%s%sFLAG_UNICODE)", toolPrefix, CompilerPrefixTable[type] ); + + if ( flags.size() ) + { + fprintf ( fMakefile, + "%s_%sFLAGS+=%s\n", + module.name.c_str(), + CompilerPrefixTable[type], + flags.c_str() ); + } + } + + GenerateParameters ( module.name.c_str(), "+=", module.non_if_data ); + + GenerateMacros ( + "+=", + module.non_if_data, + &module.linkerFlags, + used_defs ); + + fprintf ( fMakefile, "\n\n" ); +} + +void +MingwModuleHandler::GenerateRules () +{ + SpecFileType spec; + + fprintf ( fMakefile, "# RULES\n" ); + string targetMacro = GetTargetMacro ( module ); + //CLEAN_FILE ( targetMacro ); + CLEAN_FILE ( FileLocation ( SourceDirectory, "", targetMacro ) ); + + // generate phony target for module name + fprintf ( fMakefile, ".PHONY: %s\n", + module.name.c_str () ); + string dependencies = GetTargetMacro ( module ); + if ( module.type == Test ) + dependencies += " $(regtests_run_TARGET)"; + fprintf ( fMakefile, "%s: %s\n\n", + module.name.c_str (), + dependencies.c_str () ); + if ( module.type == Test ) + { + fprintf ( fMakefile, + "\t@%s\n", + targetMacro.c_str ()); + } + + if ( !ReferenceObjects ( module ) ) + { + const FileLocation* ar_target = GenerateArchiveTarget (); + + if ( ar_target ) + delete ar_target; + } + + + spec = module.IsSpecDefinitionFile(); + + if(spec) + { + Rule * defRule; + + if (spec == PSpec) + defRule = &winebuildPRule; + else + defRule = &winebuildRule; + + defRule->Execute ( fMakefile, backend, module, module.importLibrary->source, clean_files ); + } + + GenerateObjectFileTargets (); +} + +void +MingwModuleHandler::GetInvocationDependencies ( + const Module& module, + string_list& dependencies ) +{ + for ( size_t i = 0; i < module.invocations.size (); i++ ) + { + Invoke& invoke = *module.invocations[i]; + if ( invoke.invokeModule == &module ) + /* Protect against circular dependencies */ + continue; + invoke.GetTargets ( dependencies ); + } +} + +void +MingwModuleHandler::GenerateInvocations () const +{ + if ( module.invocations.size () == 0 ) + return; + + fprintf ( fMakefile, "# INVOCATIONS\n" ); + + size_t iend = module.invocations.size (); + for ( size_t i = 0; i < iend; i++ ) + { + const Invoke& invoke = *module.invocations[i]; + + if ( invoke.invokeModule->type != BuildTool ) + { + throw XMLInvalidBuildFileException ( + module.node.location, + "Only modules of type buildtool can be invoked." ); + } + + string invokeTarget = module.GetInvocationTarget ( i ); + string_list invoke_targets; + assert ( invoke_targets.size() ); + invoke.GetTargets ( invoke_targets ); + fprintf ( fMakefile, + ".PHONY: %s\n\n", + invokeTarget.c_str () ); + fprintf ( fMakefile, + "%s:", + invokeTarget.c_str () ); + size_t j, jend = invoke_targets.size(); + for ( j = 0; j < jend; j++ ) + { + fprintf ( fMakefile, + " %s", + invoke_targets[i].c_str () ); + } + fprintf ( fMakefile, "\n\n%s", invoke_targets[0].c_str () ); + for ( j = 1; j < jend; j++ ) + fprintf ( fMakefile, + " %s", + invoke_targets[i].c_str () ); + fprintf ( fMakefile, + ": %s\n", + NormalizeFilename ( backend->GetFullName ( *invoke.invokeModule->output ) ).c_str () ); + fprintf ( fMakefile, "\t$(ECHO_INVOKE)\n" ); + fprintf ( fMakefile, + "\t%s %s\n\n", + NormalizeFilename ( backend->GetFullName ( *invoke.invokeModule->output ) ).c_str (), + invoke.GetParameters ().c_str () ); + } +} + +string +MingwModuleHandler::GetPreconditionDependenciesName () const +{ + return module.name + "_precondition"; +} + +void +MingwModuleHandler::GetDefaultDependencies ( + string_list& dependencies ) const +{ + /* Avoid circular dependency */ + if ( ModuleHandlerInformations[module.type].DefaultHost == HostTrue ) + return; + + if (module.name != "psdk" && + module.name != "dxsdk") + { + dependencies.push_back ( "$(psdk_TARGET) $(psdk_HEADERS)" ); + dependencies.push_back ( "$(dxsdk_TARGET) $(dxsdk_HEADERS)" ); + } + + if (module.name != "errcodes" && + module.name != "bugcodes" && + module.name != "ntstatus") + { + dependencies.push_back ( "$(errcodes_TARGET) $(ERRCODES_MCHEADERS)" ); + dependencies.push_back ( "$(bugcodes_TARGET) $(BUGCODES_MCHEADERS)" ); + dependencies.push_back ( "$(ntstatus_TARGET) $(NTSTATUS_MCHEADERS)" ); + } + + ///* Check if any dependent library relies on the generated headers */ + //for ( size_t i = 0; i < module.project.modules.size (); i++ ) + //{ + // const Module& m = *module.project.modules[i]; + // for ( size_t j = 0; j < m.non_if_data.compilationUnits.size (); j++ ) + // { + // CompilationUnit& compilationUnit = *m.non_if_data.compilationUnits[j]; + // const FileLocation& sourceFile = compilationUnit.GetFilename (); + // string extension = GetExtension ( sourceFile ); + // if (extension == ".mc" || extension == ".MC" ) + // { + // string dependency = ssprintf ( "$(%s_MCHEADERS)", m.name.c_str () ); + // dependencies.push_back ( dependency ); + // } + // } + //} +} + +void +MingwModuleHandler::GeneratePreconditionDependencies () +{ + fprintf ( fMakefile, "# PRECONDITION DEPENDENCIES\n" ); + string preconditionDependenciesName = GetPreconditionDependenciesName (); + string_list dependencies; + GetDefaultDependencies ( dependencies ); + GetModuleDependencies ( dependencies ); + + GetInvocationDependencies ( module, dependencies ); + + if ( dependencies.size() ) + { + fprintf ( fMakefile, + "%s =", + preconditionDependenciesName.c_str () ); + for ( size_t i = 0; i < dependencies.size(); i++ ) + fprintf ( fMakefile, + " %s", + dependencies[i].c_str () ); + fprintf ( fMakefile, "\n\n" ); + } + + fprintf ( fMakefile, "\n" ); +} + +/* caller needs to delete the returned object */ +const FileLocation* +MingwModuleHandler::GetDefinitionFilename () const +{ + if ( module.importLibrary == NULL ) + return NULL; + + if ( module.IsSpecDefinitionFile () ) + { + return new FileLocation ( IntermediateDirectory, + module.importLibrary->source->relative_path, + GetBasename ( module.importLibrary->source->name ) + "_" + module.name + ".auto.def" ); + } + else + { + return new FileLocation ( SourceDirectory, + module.importLibrary->source->relative_path, + module.importLibrary->source->name ); + } +} + +void +MingwModuleHandler::GetSpecObjectDependencies ( + vector& dependencies, + const FileLocation *file ) const +{ + dependencies.push_back ( FileLocation ( IntermediateDirectory, + file->relative_path, + GetBasename ( file->name ) + "_" + module.name + ".stubs.c" ) ); +} + +void +MingwModuleHandler::GetMcObjectDependencies ( + vector& dependencies, + const FileLocation *file ) const +{ + string basename = GetBasename ( file->name ); + + FileLocation defDependency ( IntermediateDirectory, + "include/reactos", + basename + ".h" ); + dependencies.push_back ( defDependency ); + + FileLocation stubsDependency ( IntermediateDirectory, + file->relative_path, + basename + ".rc" ); + dependencies.push_back ( stubsDependency ); +} + +void +MingwModuleHandler::GetWidlObjectDependencies ( + vector& dependencies, + const FileLocation *file ) const +{ + string basename = GetBasename ( file->name ); + const FileLocation *generatedHeaderFilename = GetRpcServerHeaderFilename ( file ); + + FileLocation serverSourceDependency ( IntermediateDirectory, + file->relative_path, + basename + "_s.c" ); + dependencies.push_back ( serverSourceDependency ); + dependencies.push_back ( *generatedHeaderFilename ); + + delete generatedHeaderFilename; +} + +void +MingwModuleHandler::GetDefinitionDependencies ( + vector& dependencies ) const +{ + const vector& compilationUnits = module.non_if_data.compilationUnits; + for ( size_t i = 0; i < compilationUnits.size (); i++ ) + { + const CompilationUnit& compilationUnit = *compilationUnits[i]; + const FileLocation& sourceFile = compilationUnit.GetFilename (); + string extension = GetExtension ( sourceFile ); + + if (extension == ".spec" || extension == ".pspec") + GetSpecObjectDependencies ( dependencies, &sourceFile ); + + if (extension == ".idl") + { + if ( ( module.type == RpcServer ) || ( module.type == RpcClient ) || ( module.type == RpcProxy ) ) + GetWidlObjectDependencies ( dependencies, &sourceFile ); + } + } +} + +enum DebugSupportType +{ + DebugKernelMode, + DebugUserMode +}; + +static void +MingwAddDebugSupportLibraries ( Module& module, DebugSupportType type ) +{ + Library* pLibrary; + + switch(type) + { + case DebugKernelMode: + pLibrary = new Library ( module, "debugsup_ntoskrnl" ); + break; + + case DebugUserMode: + pLibrary = new Library ( module, "debugsup_ntdll" ); + break; + + default: + assert(0); + } + + module.non_if_data.libraries.push_back(pLibrary); +} + +static void +MingwAddCRTLibrary( Module &module ) +{ + const char * crtAttr = module.CRT.c_str (); + const char * crtLib = NULL; + + if ( stricmp ( crtAttr, "libc" ) == 0 ) + crtLib = "crt"; + else if ( stricmp ( crtAttr, "msvcrt" ) == 0 ) + crtLib = "msvcrt"; + else if ( stricmp ( crtAttr, "libcntpr" ) == 0 ) + crtLib = "libcntpr"; + else if ( stricmp ( crtAttr, "ntdll" ) == 0 ) + crtLib = "ntdll"; + + if ( crtLib ) + { + Library* pLibrary = new Library ( module, std::string ( crtLib ) ); + + if ( pLibrary->importedModule == NULL) + { + throw XMLInvalidBuildFileException ( + module.node.location, + "module '%s' trying to import non-existant C runtime module '%s'", + module.name.c_str(), + crtLib ); + } + + module.non_if_data.libraries.push_back ( pLibrary ); + } +} + +MingwBuildToolModuleHandler::MingwBuildToolModuleHandler ( const Module& module_ ) + : MingwModuleHandler ( module_ ) +{ +} + +void +MingwBuildToolModuleHandler::Process () +{ + GenerateBuildToolModuleTarget (); +} + +void +MingwBuildToolModuleHandler::GenerateBuildToolModuleTarget () +{ + string targetMacro ( GetTargetMacro (module) ); + string objectsMacro = GetObjectsMacro ( module ); + string libsMacro = GetLibsMacro (); + + GenerateRules (); + + fprintf ( fMakefile, "# BUILD TOOL MODULE TARGET\n" ); + + string linker; + if ( module.cplusplus ) + linker = "${host_gpp}"; + else + linker = "${host_gcc}"; + + const FileLocation *target_file = GetTargetFilename ( module, NULL ); + fprintf ( fMakefile, "%s: %s %s | %s\n", + targetMacro.c_str (), + objectsMacro.c_str (), + libsMacro.c_str (), + backend->GetFullPath ( *target_file ).c_str () ); + fprintf ( fMakefile, "\t$(ECHO_HOSTLD)\n" ); + fprintf ( fMakefile, + "\t%s %s -o $@ %s %s\n\n", + linker.c_str (), + GetLinkerMacro ().c_str (), + objectsMacro.c_str (), + libsMacro.c_str () ); + + delete target_file; +} + + +MingwKernelModuleHandler::MingwKernelModuleHandler ( + const Module& module_ ) + + : MingwModuleHandler ( module_ ) +{ +} + +void +MingwKernelModuleHandler::Process () +{ + GenerateKernelModuleTarget (); +} + +void +MingwKernelModuleHandler::GenerateKernelModuleTarget () +{ + GenerateRules (); + GenerateLinkerCommand (); +} + + +MingwKernelModeDLLModuleHandler::MingwKernelModeDLLModuleHandler ( + const Module& module_ ) + + : MingwModuleHandler ( module_ ) +{ +} + + +void +MingwKernelModeDLLModuleHandler::AddImplicitLibraries ( Module& module ) +{ + MingwAddCRTLibrary ( module ); + MingwAddDebugSupportLibraries ( module, DebugKernelMode ); +} + +void +MingwKernelModeDLLModuleHandler::Process () +{ + GenerateKernelModeDLLModuleTarget (); +} + +void +MingwKernelModeDLLModuleHandler::GenerateKernelModeDLLModuleTarget () +{ + GenerateRules (); + GenerateLinkerCommand (); +} + + +MingwNativeDLLModuleHandler::MingwNativeDLLModuleHandler ( + const Module& module_ ) + + : MingwModuleHandler ( module_ ) +{ +} + +void +MingwNativeDLLModuleHandler::AddImplicitLibraries ( Module& module ) +{ + MingwAddCRTLibrary ( module ); + MingwAddDebugSupportLibraries ( module, DebugUserMode ); +} + +void +MingwNativeDLLModuleHandler::Process () +{ + GenerateNativeDLLModuleTarget (); +} + +void +MingwNativeDLLModuleHandler::GenerateNativeDLLModuleTarget () +{ + GenerateRules (); + GenerateLinkerCommand (); +} + + +MingwNativeCUIModuleHandler::MingwNativeCUIModuleHandler ( + const Module& module_ ) + + : MingwModuleHandler ( module_ ) +{ +} + +void +MingwNativeCUIModuleHandler::AddImplicitLibraries ( Module& module ) +{ + MingwAddCRTLibrary ( module ); + MingwAddDebugSupportLibraries ( module, DebugUserMode ); +} + +void +MingwNativeCUIModuleHandler::Process () +{ + GenerateNativeCUIModuleTarget (); +} + +void +MingwNativeCUIModuleHandler::GenerateNativeCUIModuleTarget () +{ + GenerateRules (); + GenerateLinkerCommand (); +} + + +MingwWin32DLLModuleHandler::MingwWin32DLLModuleHandler ( + const Module& module_ ) + + : MingwModuleHandler ( module_ ) +{ +} + +MingwWin32OCXModuleHandler::MingwWin32OCXModuleHandler ( + const Module& module_ ) + + : MingwModuleHandler ( module_ ) +{ +} + +static void +MingwAddImplicitLibraries( Module &module ) +{ + Library* pLibrary; + + if ( module.type != Win32DLL + && module.type != Win32OCX + && module.type != Win32CUI + && module.type != Win32GUI + && module.type != Win32SCR) + { + return; + } + + if ( module.isDefaultEntryPoint ) + { + if ( module.IsDLL () ) + { + //pLibrary = new Library ( module, "__mingw_dllmain" ); + //module.non_if_data.libraries.insert ( module.non_if_data.libraries.begin(), pLibrary ); + } + else + { + pLibrary = new Library ( module, module.isUnicode ? "mingw_wmain" : "mingw_main" ); + module.non_if_data.libraries.insert ( module.non_if_data.libraries.begin(), pLibrary ); + } + } + + pLibrary = new Library ( module, "mingw_common" ); + module.non_if_data.libraries.push_back ( pLibrary ); + + MingwAddCRTLibrary ( module ); + MingwAddDebugSupportLibraries ( module, DebugUserMode ); +} + +void +MingwWin32DLLModuleHandler::AddImplicitLibraries ( Module& module ) +{ + MingwAddImplicitLibraries ( module ); +} + +void +MingwWin32DLLModuleHandler::Process () +{ + GenerateWin32DLLModuleTarget (); +} + +void +MingwWin32DLLModuleHandler::GenerateWin32DLLModuleTarget () +{ + GenerateRules (); + GenerateLinkerCommand (); +} + + +void +MingwWin32OCXModuleHandler::AddImplicitLibraries ( Module& module ) +{ + MingwAddImplicitLibraries ( module ); +} + +void +MingwWin32OCXModuleHandler::Process () +{ + GenerateWin32OCXModuleTarget (); +} + +void +MingwWin32OCXModuleHandler::GenerateWin32OCXModuleTarget () +{ + GenerateRules (); + GenerateLinkerCommand (); +} + + +MingwWin32CUIModuleHandler::MingwWin32CUIModuleHandler ( + const Module& module_ ) + + : MingwModuleHandler ( module_ ) +{ +} + +void +MingwWin32CUIModuleHandler::AddImplicitLibraries ( Module& module ) +{ + MingwAddImplicitLibraries ( module ); +} + +void +MingwWin32CUIModuleHandler::Process () +{ + GenerateWin32CUIModuleTarget (); +} + +void +MingwWin32CUIModuleHandler::GenerateWin32CUIModuleTarget () +{ + GenerateRules (); + GenerateLinkerCommand (); +} + + +MingwWin32GUIModuleHandler::MingwWin32GUIModuleHandler ( + const Module& module_ ) + + : MingwModuleHandler ( module_ ) +{ +} + +void +MingwWin32GUIModuleHandler::AddImplicitLibraries ( Module& module ) +{ + MingwAddImplicitLibraries ( module ); +} + +void +MingwWin32GUIModuleHandler::Process () +{ + GenerateWin32GUIModuleTarget (); +} + +void +MingwWin32GUIModuleHandler::GenerateWin32GUIModuleTarget () +{ + GenerateRules (); + GenerateLinkerCommand (); +} + + +MingwBootLoaderModuleHandler::MingwBootLoaderModuleHandler ( + const Module& module_ ) + + : MingwModuleHandler ( module_ ) +{ +} + +void +MingwBootLoaderModuleHandler::Process () +{ + GenerateBootLoaderModuleTarget (); +} + +void +MingwBootLoaderModuleHandler::GenerateBootLoaderModuleTarget () +{ + fprintf ( fMakefile, "# BOOT LOADER MODULE TARGET\n" ); + string targetMacro ( GetTargetMacro (module) ); + string objectsMacro = GetObjectsMacro ( module ); + string libsMacro = GetLibsMacro (); + + GenerateRules (); + + string objectsDir = "${call RBUILD_intermediate_dir,$(" + module.name + "_TARGET)}"; + string rspFile = objectsDir + "$(SEP)" + module.name + "_objs.rsp"; + + /* Generate the rsp rule */ + fprintf(fMakefile, "%s: $(%s_OBJS) %s | %s\n" + "\t$(ECHO_RSP)\n" + "\t-@${rm} $@ 2>$(NUL)\n" + "\t${cp} $(NUL) $@ >$(NUL)\n" + "\t$(foreach obj,$(%s_LIBS),$(Q)echo $(QUOTE)$(subst \\,\\\\,$(obj))$(QUOTE)>>$@$(NL))\n\n", + rspFile.c_str(), + module.name.c_str(), + module.xmlbuildFile.c_str(), + objectsDir.c_str(), + module.name.c_str()); + + const FileLocation *target_file = GetTargetFilename ( module, NULL ); + fprintf ( fMakefile, "%s: %s %s | %s\n", + targetMacro.c_str (), + rspFile.c_str(), + libsMacro.c_str (), + backend->GetFullPath ( *target_file ).c_str () ); + + fprintf ( fMakefile, "\t$(ECHO_LD)\n" ); + + string linkerScriptArgument; + if ( module.linkerScript != NULL ) { + linkerScriptArgument = ssprintf(" -T %s", backend->GetFullName(*module.linkerScript->file).c_str()); + } + + /* Link the stripped booloader */ + fprintf(fMakefile, + "\t${ld} --strip-all --subsystem native --entry=%s --image-base=%s @%s $(PROJECT_CCLIBS) " + "$(BUILTIN_LDFLAGS) $(PROJECT_LDFLAGS) $(LDFLAG_DRIVER) %s -o $@\n", + module.GetEntryPoint().c_str(), + module.baseaddress.c_str(), + rspFile.c_str(), + linkerScriptArgument.c_str() ); + + /* Link an unstripped version */ + fprintf(fMakefile, + "ifeq ($(ROS_BUILDNOSTRIP),yes)\n" + "\t${ld} --subsystem native --entry=%s --image-base=%s @%s $(PROJECT_CCLIBS) " + "$(BUILTIN_LDFLAGS) $(PROJECT_LDFLAGS) $(LDFLAG_DRIVER) %s -o %s$(SEP)%s.nostrip.sys\n" + "endif\n", + module.GetEntryPoint().c_str(), + module.baseaddress.c_str(), + rspFile.c_str(), + linkerScriptArgument.c_str(), + backend->GetFullPath(*target_file).c_str(), + module.name.c_str()); +} + + +MingwBootProgramModuleHandler::MingwBootProgramModuleHandler ( + const Module& module_ ) + : MingwModuleHandler ( module_ ) +{ +} + +void +MingwBootProgramModuleHandler::Process () +{ + GenerateBootProgramModuleTarget (); +} + +void +MingwBootProgramModuleHandler::GenerateBootProgramModuleTarget () +{ + fprintf ( fMakefile, "# BOOT PROGRAM MODULE TARGET\n" ); + + string targetName ( module.output->name ); + string targetMacro ( GetTargetMacro (module) ); + string workingDirectory = GetWorkingDirectory (); + FileLocation junk_tmp ( TemporaryDirectory, + "", + module.name + ".junk.tmp" ); + FileLocation junk_elf ( TemporaryDirectory, + "", + module.name + ".junk.elf" ); + FileLocation junk_cpy ( TemporaryDirectory, + "", + module.name + ".junk.elf" ); + CLEAN_FILE ( junk_tmp ); + CLEAN_FILE ( junk_elf ); + CLEAN_FILE ( junk_cpy ); + string objectsMacro = GetObjectsMacro ( module ); + string libsMacro = GetLibsMacro (); + const Module *payload = module.project.LocateModule ( module.payload ); + + GenerateRules (); + + const FileLocation *target_file = GetTargetFilename ( module, NULL ); + fprintf ( fMakefile, "%s: %s %s %s | %s\n", + targetMacro.c_str (), + objectsMacro.c_str (), + libsMacro.c_str (), + payload->name.c_str (), + backend->GetFullPath ( *target_file ).c_str () ); + + fprintf ( fMakefile, "\t$(ECHO_BOOTPROG)\n" ); + + fprintf ( fMakefile, "\t$(%s_PREPARE) $(OUTPUT)$(SEP)%s %s\n", + module.buildtype.c_str (), + NormalizeFilename( backend->GetFullName ( *payload->output ) ).c_str (), + backend->GetFullName ( junk_cpy ).c_str () ); + + fprintf ( fMakefile, "\t${objcopy} $(%s_FLATFORMAT) %s %s\n", + module.buildtype.c_str (), + backend->GetFullName ( junk_cpy ).c_str (), + backend->GetFullName ( junk_tmp ).c_str () ); + + fprintf ( fMakefile, "\t${ld} $(%s_LINKFORMAT) %s %s -o %s\n", + module.buildtype.c_str (), + libsMacro.c_str (), + backend->GetFullName ( junk_tmp ).c_str (), + backend->GetFullName ( junk_elf ).c_str () ); + + fprintf ( fMakefile, "\t${objcopy} $(%s_COPYFORMAT) %s $(INTERMEDIATE)$(SEP)%s\n", + module.buildtype.c_str (), + backend->GetFullName ( junk_elf ).c_str (), + backend->GetFullName ( *module.output ) .c_str () ); + + fprintf ( fMakefile, + "\t-@${rm} %s %s %s 2>$(NUL)\n", + backend->GetFullName ( junk_tmp ).c_str (), + backend->GetFullName ( junk_elf ).c_str (), + backend->GetFullName ( junk_cpy ).c_str () ); + + delete target_file; +} + + +MingwIsoModuleHandler::MingwIsoModuleHandler ( + const Module& module_ ) + + : MingwModuleHandler ( module_ ) +{ +} + +void +MingwIsoModuleHandler::Process () +{ + GenerateIsoModuleTarget (); +} + +void +MingwIsoModuleHandler::OutputBootstrapfileCopyCommands ( + const string& bootcdDirectory, + vector& destinations ) +{ + for ( std::map::const_iterator p = module.project.modules.begin (); p != module.project.modules.end (); ++ p ) + { + const Module& m = *p->second; + if ( !m.enabled ) + continue; + if ( m.bootstrap != NULL ) + { + FileLocation targetFile ( OutputDirectory, + m.bootstrap->base.length () > 0 + ? bootcdDirectory + sSep + m.bootstrap->base + : bootcdDirectory, + m.bootstrap->nameoncd ); + OutputCopyCommandSingle ( *m.output, targetFile ); + destinations.push_back ( targetFile ); + } + } +} + +void +MingwIsoModuleHandler::OutputCdfileCopyCommands ( + const string& bootcdDirectory, + std::vector& destinations ) +{ + for ( size_t i = 0; i < module.project.cdfiles.size (); i++ ) + { + const CDFile& cdfile = *module.project.cdfiles[i]; + FileLocation targetFile ( OutputDirectory, + cdfile.target->relative_path.length () > 0 + ? bootcdDirectory + sSep + cdfile.target->relative_path + : bootcdDirectory, + cdfile.target->name ); + OutputCopyCommandSingle ( *cdfile.source, targetFile ); + destinations.push_back ( targetFile ); + } + for ( size_t i = 0; i < module.cdfiles.size (); i++ ) + { + const CDFile& cdfile = *module.cdfiles[i]; + FileLocation targetFile ( OutputDirectory, + cdfile.target->relative_path.length () > 0 + ? bootcdDirectory + sSep + cdfile.target->relative_path + : bootcdDirectory, + cdfile.target->name ); + OutputCopyCommandSingle ( *cdfile.source, targetFile ); + destinations.push_back ( targetFile ); + } +} + +void +MingwIsoModuleHandler::GetBootstrapCdDirectories ( vector& out, + const string& bootcdDirectory ) +{ + for ( std::map::const_iterator p = module.project.modules.begin (); p != module.project.modules.end (); ++ p ) + { + const Module& m = *p->second; + if ( !m.enabled ) + continue; + if ( m.bootstrap != NULL ) + { + FileLocation targetDirectory ( OutputDirectory, + m.bootstrap->base.length () > 0 + ? bootcdDirectory + sSep + m.bootstrap->base + : bootcdDirectory, + "" ); + out.push_back ( targetDirectory ); + } + } +} + +void +MingwIsoModuleHandler::GetNonModuleCdDirectories ( vector& out, + const string& bootcdDirectory ) +{ + for ( size_t i = 0; i < module.project.cdfiles.size (); i++ ) + { + const CDFile& cdfile = *module.project.cdfiles[i]; + FileLocation targetDirectory ( OutputDirectory, + cdfile.target->relative_path.length () > 0 + ? bootcdDirectory + sSep + cdfile.target->relative_path + : bootcdDirectory, + "" ); + out.push_back( targetDirectory ); + } +} + +void +MingwIsoModuleHandler::GetCdDirectories ( vector& out, + const string& bootcdDirectory ) +{ + GetBootstrapCdDirectories ( out, bootcdDirectory ); + GetNonModuleCdDirectories ( out, bootcdDirectory ); +} + +void +MingwIsoModuleHandler::GetBootstrapCdFiles ( + vector& out ) const +{ + for ( std::map::const_iterator p = module.project.modules.begin (); p != module.project.modules.end (); ++ p ) + { + const Module& m = *p->second; + if ( !m.enabled ) + continue; + if ( m.bootstrap != NULL ) + { + out.push_back ( *m.output ); + } + } +} + +void +MingwIsoModuleHandler::GetNonModuleCdFiles ( + vector& out ) const +{ + for ( size_t i = 0; i < module.project.cdfiles.size (); i++ ) + { + const CDFile& cdfile = *module.project.cdfiles[i]; + out.push_back ( *cdfile.source ); + } +} + +void +MingwIsoModuleHandler::GetCdFiles ( + vector& out ) const +{ + GetBootstrapCdFiles ( out ); + GetNonModuleCdFiles ( out ); +} + +void +MingwIsoModuleHandler::GenerateIsoModuleTarget () +{ + fprintf ( fMakefile, "# ISO MODULE TARGET\n" ); + string bootcdDirectory = module.name; + FileLocation bootcd ( OutputDirectory, + bootcdDirectory, + "" ); + FileLocation bootcdReactos ( OutputDirectory, + bootcdDirectory + sSep + Environment::GetCdOutputPath (), + "" ); + + // bootsector + const Module* bootModule = module.bootSector->bootSectorModule; + + if (!bootModule) + { + throw InvalidOperationException ( module.node.location.c_str(), + 0, + "Invalid bootsector. module '%s' requires ", + module.name.c_str ()); + } + + const FileLocation *isoboot = bootModule->output; + + // prepare reactos.dff and reactos.inf + FileLocation reactosDff ( SourceDirectory, + "boot" + sSep + "bootdata" + sSep + "packages", + "reactos.dff" ); + FileLocation reactosInf ( bootcdReactos.directory, + bootcdReactos.relative_path, + "reactos.inf" ); + + /* + We use only the name and not full FileLocation(ouput) because Iso/LiveIso are an exception to the general rule. + Iso/LiveIso outputs are generated in code base root + */ + string IsoName = module.output->name; + + fprintf ( fMakefile, ".PHONY: %s_CABINET\n\n", + module.name.c_str () ); + fprintf ( fMakefile, "%s_CABINET: all $(cabman_TARGET) %s | %s\n", + module.name.c_str (), + backend->GetFullName ( reactosDff ).c_str (), + backend->GetFullPath ( bootcdReactos ).c_str () ); + fprintf ( fMakefile, + "\t$(Q)$(cabman_TARGET) -C %s -L %s -I -P $(OUTPUT)\n", + backend->GetFullName ( reactosDff ).c_str (), + backend->GetFullPath ( bootcdReactos ).c_str () ); + fprintf ( fMakefile, + "\t$(Q)$(cabman_TARGET) -C %s -RC %s -L %s -N -P $(OUTPUT)\n", + backend->GetFullName ( reactosDff ).c_str (), + backend->GetFullName ( reactosInf ).c_str (), + backend->GetFullPath ( bootcdReactos ).c_str ()); + fprintf ( fMakefile, + "\t-@${rm} %s 2>$(NUL)\n\n", + backend->GetFullName ( reactosInf ).c_str () ); + + std::vector sourceFiles; + OutputBootstrapfileCopyCommands ( bootcdDirectory, sourceFiles ); + OutputCdfileCopyCommands ( bootcdDirectory, sourceFiles ); + + fprintf( fMakefile, + "\n%s_OBJS := %s\n\n", + module.name.c_str (), + v2s ( backend, sourceFiles, 5 ).c_str () ); + + fprintf ( fMakefile, ".PHONY: %s\n\n", + module.name.c_str ()); + fprintf ( fMakefile, + "%s: $(%s_OBJS) %s_CABINET %s $(cdmake_TARGET) | %s\n", + module.name.c_str (), + module.name.c_str (), + module.name.c_str (), + backend->GetFullName ( *isoboot ).c_str (), + backend->GetFullPath ( FileLocation ( OutputDirectory, + bootcdDirectory, + "" ) ).c_str () ); + + fprintf ( fMakefile, "\t$(ECHO_CDMAKE)\n" ); + fprintf ( fMakefile, + "\t$(Q)$(cdmake_TARGET) -v -j -m -b %s %s REACTOS %s\n", + backend->GetFullName ( *isoboot ).c_str (), + backend->GetFullPath ( bootcd ).c_str (), + IsoName.c_str() ); + fprintf ( fMakefile, + "\n" ); +} + + +MingwLiveIsoModuleHandler::MingwLiveIsoModuleHandler ( + const Module& module_ ) + + : MingwModuleHandler ( module_ ) +{ +} + +void +MingwLiveIsoModuleHandler::Process () +{ + GenerateLiveIsoModuleTarget (); +} + +void +MingwLiveIsoModuleHandler::CreateDirectory ( const string& directory ) +{ + FileLocation dir ( OutputDirectory, + directory, + "" ); + MingwModuleHandler::PassThruCacheDirectory ( &dir ); +} + +void +MingwLiveIsoModuleHandler::OutputModuleCopyCommands ( string& livecdDirectory, + string& reactosDirectory, + std::vector& destinations ) +{ + for ( std::map::const_iterator p = module.project.modules.begin (); p != module.project.modules.end (); ++ p ) + { + const Module& m = *p->second; + if ( !m.enabled ) + continue; + if ( m.install ) + { + const Module& aliasedModule = backend->GetAliasedModuleOrModule ( m ); + FileLocation destination ( OutputDirectory, + m.install->relative_path.length () > 0 + ? livecdDirectory + sSep + reactosDirectory + sSep + m.install->relative_path + : livecdDirectory + sSep + reactosDirectory, + m.install->name ); + OutputCopyCommandSingle ( *aliasedModule.output, + destination); + destinations.push_back ( destination ); + } + } +} + +void +MingwLiveIsoModuleHandler::OutputNonModuleCopyCommands ( string& livecdDirectory, + string& reactosDirectory, + std::vector& destinations ) +{ + for ( size_t i = 0; i < module.project.installfiles.size (); i++ ) + { + const InstallFile& installfile = *module.project.installfiles[i]; + FileLocation target ( OutputDirectory, + installfile.target->relative_path.length () > 0 + ? livecdDirectory + sSep + reactosDirectory + sSep + installfile.target->relative_path + : livecdDirectory + sSep + reactosDirectory, + installfile.target->name ); + OutputCopyCommandSingle ( *installfile.source, target ); + destinations.push_back ( target ); + } +} + +void +MingwLiveIsoModuleHandler::OutputProfilesDirectoryCommands ( string& livecdDirectory, + vector& destinations ) +{ + CreateDirectory ( livecdDirectory + sSep + "Profiles" ); + CreateDirectory ( livecdDirectory + sSep + "Profiles" + sSep + "All Users") ; + CreateDirectory ( livecdDirectory + sSep + "Profiles" + sSep + "All Users" + sSep + "Desktop" ); + CreateDirectory ( livecdDirectory + sSep + "Profiles" + sSep + "Default User" ); + CreateDirectory ( livecdDirectory + sSep + "Profiles" + sSep + "Default User" + sSep + "Desktop" ); + CreateDirectory ( livecdDirectory + sSep + "Profiles" + sSep + "Default User" + sSep + "My Documents" ); + + FileLocation livecdIni ( SourceDirectory, + "boot" + sSep + "bootdata", + "livecd.ini" ); + FileLocation destination ( OutputDirectory, + livecdDirectory, + "freeldr.ini" ); + OutputCopyCommandSingle ( livecdIni, + destination ); + destinations.push_back ( destination ); +} + +void +MingwLiveIsoModuleHandler::OutputLoaderCommands ( string& livecdDirectory, + std::vector& destinations ) +{ + FileLocation freeldr ( OutputDirectory, + "boot" + sSep + "freeldr" + sSep + "freeldr", + "freeldr.sys" ); + FileLocation destination ( OutputDirectory, + livecdDirectory + sSep + "loader", + "setupldr.sys" ); + OutputCopyCommandSingle ( freeldr, + destination ); + destinations.push_back ( destination ); +} + +void +MingwLiveIsoModuleHandler::OutputRegistryCommands ( string& livecdDirectory ) +{ + fprintf ( fMakefile, "# REGISTRY COMMANDS\n" ); + FileLocation reactosSystem32ConfigDirectory ( OutputDirectory, + livecdDirectory + sSep + "reactos" + sSep + "system32" + sSep + "config", + "" ); + fprintf ( fMakefile, + "\t$(ECHO_MKHIVE)\n" ); + fprintf ( fMakefile, + "\t$(mkhive_TARGET) boot%cbootdata %s $(ARCH) boot%cbootdata%clivecd.inf boot%cbootdata%chiveinst_$(ARCH).inf\n", + cSep, backend->GetFullPath ( reactosSystem32ConfigDirectory ).c_str (), + cSep, cSep, cSep, cSep ); +} + +void +MingwLiveIsoModuleHandler::GenerateLiveIsoModuleTarget () +{ + fprintf ( fMakefile, "# LIVE ISO MODULE TARGET\n" ); + string livecdDirectory = module.name; + FileLocation livecd ( OutputDirectory, livecdDirectory, "" ); + + string IsoName; + + // bootsector + const Module* bootModule = module.bootSector->bootSectorModule; + + if (!bootModule) + { + throw InvalidOperationException ( module.node.location.c_str(), + 0, + "Invalid bootsector. module '%s' requires ", + module.name.c_str ()); + } + + const FileLocation *isoboot = bootModule->output; + + /* + We use only the name and not full FileLocation(ouput) because Iso/LiveIso are an exception to the general rule. + Iso/LiveIso outputs are generated in code base root + */ + IsoName = module.output->name; + + string reactosDirectory = "reactos"; + string livecdReactosNoFixup = livecdDirectory + sSep + reactosDirectory; + FileLocation livecdReactos ( OutputDirectory, + livecdReactosNoFixup, + "" ); + CLEAN_FILE ( livecdReactos ); + + std::vector sourceFiles; + OutputModuleCopyCommands ( livecdDirectory, + reactosDirectory, + sourceFiles ); + OutputNonModuleCopyCommands ( livecdDirectory, + reactosDirectory, + sourceFiles ); + OutputProfilesDirectoryCommands ( livecdDirectory, sourceFiles ); + OutputLoaderCommands ( livecdDirectory, sourceFiles ); + + fprintf( fMakefile, + "\n%s_OBJS := %s\n\n", + module.name.c_str (), + v2s ( backend, sourceFiles, 5 ).c_str () ); + + fprintf ( fMakefile, ".PHONY: %s\n\n", + module.name.c_str ()); + fprintf ( fMakefile, + "%s : $(%s_OBJS) %s %s $(mkhive_TARGET) $(cdmake_TARGET)\n", + module.name.c_str (), + module.name.c_str (), + backend->GetFullName ( *isoboot) .c_str (), + backend->GetFullPath ( FileLocation ( OutputDirectory, + livecdDirectory, + "" ) ).c_str () ); + OutputRegistryCommands ( livecdDirectory ); + fprintf ( fMakefile, "\t$(ECHO_CDMAKE)\n" ); + fprintf ( fMakefile, + "\t$(Q)$(cdmake_TARGET) -v -m -j -b %s %s REACTOS %s\n", + backend->GetFullName( *isoboot ).c_str (), + backend->GetFullPath ( livecd ).c_str (), + IsoName.c_str() ); + fprintf ( fMakefile, + "\n" ); +} + + +MingwTestModuleHandler::MingwTestModuleHandler ( + const Module& module_ ) + + : MingwModuleHandler ( module_ ) +{ +} + +void +MingwTestModuleHandler::Process () +{ + GenerateTestModuleTarget (); +} + +/* caller needs to delete the returned object */ +void +MingwTestModuleHandler::GetModuleSpecificCompilationUnits ( vector& compilationUnits ) +{ + compilationUnits.push_back ( new CompilationUnit ( new File ( IntermediateDirectory, module.output->relative_path + sSep + "..", module.name + "_hooks.c", false, "", false ) ) ); + compilationUnits.push_back ( new CompilationUnit ( new File ( IntermediateDirectory, module.output->relative_path + sSep + "..", module.name + "_stubs.S", false, "", false ) ) ); + compilationUnits.push_back ( new CompilationUnit ( new File ( IntermediateDirectory, module.output->relative_path + sSep + "..", module.name + "_startup.c", false, "", false ) ) ); +} + +void +MingwTestModuleHandler::GenerateTestModuleTarget () +{ + GenerateRules (); + GenerateLinkerCommand (); +} + + +MingwAliasModuleHandler::MingwAliasModuleHandler ( + const Module& module_ ) + + : MingwModuleHandler ( module_ ) +{ +} + +void +MingwAliasModuleHandler::Process () +{ +} + + +MingwCabinetModuleHandler::MingwCabinetModuleHandler ( + const Module& module_ ) + + : MingwModuleHandler ( module_ ) +{ +} + +void +MingwCabinetModuleHandler::Process () +{ + fprintf ( fMakefile, "# CABINET MODULE TARGET\n" ); + string targetMacro ( GetTargetMacro (module) ); + + GenerateRules (); + + const FileLocation *target_file = GetTargetFilename ( module, NULL ); + fprintf ( fMakefile, "%s: $(cabman_TARGET) | %s\n", + targetMacro.c_str (), + backend->GetFullPath ( *target_file ).c_str () ); + + fprintf ( fMakefile, "\t$(ECHO_CABMAN)\n" ); + fprintf ( fMakefile, + "\t$(Q)$(cabman_TARGET) -M raw -S %s $(%s_SOURCES)\n", // Escape the asterisk for Make + targetMacro.c_str (), + module.name.c_str()); +} + +MingwElfExecutableModuleHandler::MingwElfExecutableModuleHandler ( + const Module& module_ ) + + : MingwModuleHandler ( module_ ) +{ +} + +void +MingwElfExecutableModuleHandler::Process () +{ + string targetName ( module.output->name ); + string targetMacro ( GetTargetMacro (module) ); + string workingDirectory = GetWorkingDirectory (); + string objectsMacro = GetObjectsMacro ( module ); + string libsMacro = GetLibsMacro (); + string debugFormat = GetDebugFormat (); + + fprintf ( fMakefile, "# ELF EXECUTABLE TARGET\n" ); + GenerateRules (); + + const FileLocation *target_file = GetTargetFilename ( module, NULL ); + fprintf ( fMakefile, "%s: %s %s | %s\n", + targetMacro.c_str (), + objectsMacro.c_str (), + libsMacro.c_str (), + backend->GetFullPath ( *target_file ).c_str () ); + + fprintf ( fMakefile, "\t$(ECHO_BOOTPROG)\n" ); + + fprintf ( fMakefile, "\t${gcc} $(%s_LINKFORMAT) %s %s -g%s -o %s\n", + module.buildtype.c_str(), + objectsMacro.c_str(), + libsMacro.c_str(), + debugFormat.c_str(), + targetMacro.c_str () ); + + delete target_file; + fprintf ( fMakefile, "#/ELF EXECUTABLE TARGET\n" ); +} diff --git a/tools/rbuild/backend/mingw/modulehandler.h b/tools/rbuild/backend/mingw/modulehandler.h new file mode 100644 index 00000000000..b67f63f4b7a --- /dev/null +++ b/tools/rbuild/backend/mingw/modulehandler.h @@ -0,0 +1,372 @@ +/* + * Copyright (C) 2005 Casper S. Hornstrup + * + * This program is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation; either version 2 of the License, or + * (at your option) any later version. + * + * This program 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 General Public License for more details. + * + * You should have received a copy of the GNU General Public License along + * with this program; if not, write to the Free Software Foundation, Inc., + * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. + */ + +#pragma once + +#include "../backend.h" +#include "mingw.h" + +class MingwBackend; +class Rule; + +extern std::string +GetTargetMacro ( const Module&, bool with_dollar = true ); + +extern std::string +PrefixFilename ( + const std::string& filename, + const std::string& prefix ); + +class MingwModuleHandler +{ +public: + MingwModuleHandler ( const Module& module_ ); + virtual ~MingwModuleHandler(); + + static void SetBackend ( MingwBackend* backend_ ); + static void SetMakefile ( FILE* f ); + void EnablePreCompiledHeaderSupport (); + + static const FileLocation* PassThruCacheDirectory (const FileLocation* fileLocation ); + + static const FileLocation* GetTargetFilename ( + const Module& module, + string_list* pclean_files ); + + static const FileLocation* GetImportLibraryFilename ( + const Module& module, + string_list* pclean_files, + bool delayimp ); + + static std::string GenerateGccDefineParametersFromVector ( const std::vector& defines, std::set &used_defs ); + static std::string GenerateDefineParametersFromVector ( const std::vector& defines, CompilerType compiler ); + static std::string GenerateCompilerParametersFromVector ( const std::vector& compilerFlags, const CompilerType type ); + static std::string GenerateIncludeParametersFromVector ( const std::vector& includes, CompilerType compiler ); + + static void GenerateParameters ( const char* prefix, + const char* assignmentOperation, + const IfableData& data ); + + std::string GetModuleTargets ( const Module& module ); + void GetObjectsVector ( const IfableData& data, + std::vector& objectFiles ) const; + void GenerateSourceMacro(); + void GenerateObjectMacro(); + void GenerateTargetMacro(); + void GenerateOtherMacros(); + + static MingwModuleHandler* InstanciateHandler ( const Module& module_, + MingwBackend* backend_ ); + void GeneratePreconditionDependencies (); + virtual void Process () { GenerateRules (); } + void GenerateInvocations () const; + void GenerateCleanTarget () const; + void GenerateInstallTarget () const; + void GenerateDependsTarget () const; + static bool ReferenceObjects ( const Module& module ); + virtual void AddImplicitLibraries ( Module& module ) { return; } + + void OutputCopyCommand ( const FileLocation& source, + const FileLocation& destination ); + void OutputCopyCommandSingle ( const FileLocation& source, + const FileLocation& destination ); +protected: + virtual void GetModuleSpecificCompilationUnits ( std::vector& compilationUnits ); + std::string GetWorkingDirectory () const; + std::string GetBasename ( const std::string& filename ) const; + std::string GetCompilationUnitDependencies ( const CompilationUnit& compilationUnit ) const; + const FileLocation* GetModuleArchiveFilename () const; + std::string GetImportLibraryDependency ( const Module& importedModule, bool delayimp ); + void GetTargets ( const Module& dependencyModule, + string_list& targets ); + void GetModuleDependencies ( string_list& dependencies ); + std::string GetAllDependencies () const; + const FileLocation* GetObjectFilename ( const FileLocation* sourceFile, + const Module& module ) const; + + std::string GetPreconditionDependenciesName () const; + static std::string GetObjectsMacro ( const Module& ); + std::string GetLinkingDependenciesMacro () const; + std::string GetLibsMacro () const; + std::string GetLinkerMacro () const; + static std::string GetDebugFormat (); + void GenerateCleanObjectsAsYouGoCode () const; + void GenerateLinkerCommand () const; + void GenerateBuildMapCode ( const FileLocation *mapTarget = NULL ); + void GenerateRules (); + void GenerateImportLibraryTargetIfNeeded (); + void GetDefinitionDependencies ( std::vector& dependencies ) const; + std::string GetLinkingDependencies () const; + static MingwBackend* backend; + static FILE* fMakefile; + bool use_pch; +private: + std::string ConcatenatePaths ( const std::string& path1, + const std::string& path2 ) const; + std::string GenerateLinkerParametersFromVector ( const std::vector& linkerFlags ) const; + std::string GenerateImportLibraryDependenciesFromVector ( const std::vector& libraries ); + std::string GenerateLinkerParameters () const; + void GenerateMacros ( const char* op, + const IfableData& data, + const std::vector* linkerFlags, + std::set& used_defs ); + void GenerateSourceMacros ( const IfableData& data ); + void GenerateObjectMacros ( const IfableData& data ); + const FileLocation* GetPrecompiledHeaderFilename () const; + const FileLocation* GetPrecompiledHeaderPath () const; + const FileLocation* GetDlldataFilename () const; + void GenerateGccCommand ( const FileLocation* sourceFile, + const Rule *rule, + const std::string& extraDependencies ); + void GenerateCommands ( const CompilationUnit& compilationUnit, + const std::string& extraDependencies ); + void GenerateObjectFileTargets ( const IfableData& data ); + void GenerateObjectFileTargets (); + const FileLocation* GenerateArchiveTarget (); + void GetMcObjectDependencies ( std::vector& dependencies, + const FileLocation *file ) const; + void GetSpecObjectDependencies ( std::vector& dependencies, + const FileLocation *file ) const; + void GetSpecImplibDependencies ( std::vector& dependencies, + const FileLocation *file ) const; + void GetWidlObjectDependencies ( std::vector& dependencies, + const FileLocation *file ) const; + void GetDefaultDependencies ( string_list& dependencies ) const; + void GetInvocationDependencies ( const Module& module, string_list& dependencies ); + SpecFileType IsSpecDefinitionFile () const; + const FileLocation* GetDefinitionFilename () const; + void GenerateBuildNonSymbolStrippedCode (); + void CleanupCompilationUnitVector ( std::vector& compilationUnits ); + void GetRpcHeaderDependencies ( std::vector& dependencies ) const; + void GetMcHeaderDependencies ( std::vector& dependencies ) const; + static std::string GetPropertyValue ( const Module& module, const std::string& name ); + const FileLocation* GetRpcServerHeaderFilename ( const FileLocation *base ) const; + const FileLocation* GetRpcClientHeaderFilename ( const FileLocation *base ) const; + const FileLocation* GetRpcProxyHeaderFilename ( const FileLocation *base ) const; + const FileLocation* GetIdlHeaderFilename ( const FileLocation *base ) const; + const FileLocation* GetMcHeaderFilename ( const FileLocation *base ) const; + std::string GetModuleCleanTarget ( const Module& module ) const; + void GetReferencedObjectLibraryModuleCleanTargets ( std::vector& moduleNames ) const; +public: + const Module& module; + string_list clean_files; + std::string commonflagsMacro; + std::string cflagsMacro; + std::string cxxflagsMacro; + std::string nasmflagsMacro; + std::string windresflagsMacro; + std::string widlflagsMacro; + std::string linkerflagsMacro; + std::string sourcesMacro; + std::string objectsMacro; + std::string libsMacro; + std::string linkDepsMacro; +}; + + +class MingwBuildToolModuleHandler : public MingwModuleHandler +{ +public: + MingwBuildToolModuleHandler ( const Module& module ); + virtual void Process (); +private: + void GenerateBuildToolModuleTarget (); +}; + + +class MingwKernelModuleHandler : public MingwModuleHandler +{ +public: + MingwKernelModuleHandler ( const Module& module ); + virtual void Process (); +private: + void GenerateKernelModuleTarget (); +}; + + +class MingwKernelModeDLLModuleHandler : public MingwModuleHandler +{ +public: + MingwKernelModeDLLModuleHandler ( const Module& module ); + virtual void Process (); + void AddImplicitLibraries ( Module& module ); +private: + void GenerateKernelModeDLLModuleTarget (); +}; + + +class MingwNativeDLLModuleHandler : public MingwModuleHandler +{ +public: + MingwNativeDLLModuleHandler ( const Module& module ); + virtual void Process (); + void AddImplicitLibraries ( Module& module ); +private: + void GenerateNativeDLLModuleTarget (); +}; + + +class MingwNativeCUIModuleHandler : public MingwModuleHandler +{ +public: + MingwNativeCUIModuleHandler ( const Module& module ); + virtual void Process (); + void AddImplicitLibraries ( Module& module ); +private: + void GenerateNativeCUIModuleTarget (); +}; + + +class MingwWin32DLLModuleHandler : public MingwModuleHandler +{ +public: + MingwWin32DLLModuleHandler ( const Module& module ); + virtual void Process (); + void AddImplicitLibraries ( Module& module ); +private: + void GenerateWin32DLLModuleTarget (); +}; + + +class MingwWin32OCXModuleHandler : public MingwModuleHandler +{ +public: + MingwWin32OCXModuleHandler ( const Module& module ); + virtual void Process (); + void AddImplicitLibraries ( Module& module ); +private: + void GenerateWin32OCXModuleTarget (); +}; + + +class MingwWin32CUIModuleHandler : public MingwModuleHandler +{ +public: + MingwWin32CUIModuleHandler ( const Module& module ); + virtual void Process (); + void AddImplicitLibraries ( Module& module ); +private: + void GenerateWin32CUIModuleTarget (); +}; + + +class MingwWin32GUIModuleHandler : public MingwModuleHandler +{ +public: + MingwWin32GUIModuleHandler ( const Module& module ); + virtual void Process (); + void AddImplicitLibraries ( Module& module ); +private: + void GenerateWin32GUIModuleTarget (); +}; + + +class MingwBootLoaderModuleHandler : public MingwModuleHandler +{ +public: + MingwBootLoaderModuleHandler ( const Module& module ); + virtual void Process (); +private: + void GenerateBootLoaderModuleTarget (); +}; + + +class MingwBootProgramModuleHandler : public MingwModuleHandler +{ +public: + MingwBootProgramModuleHandler ( const Module& module ); + virtual void Process (); + std::string GetProgTextAddrMacro (); +private: + void GenerateBootProgramModuleTarget (); +}; + + +class MingwIsoModuleHandler : public MingwModuleHandler +{ +public: + MingwIsoModuleHandler ( const Module& module ); + virtual void Process (); +private: + void GenerateIsoModuleTarget (); + void GetBootstrapCdDirectories ( std::vector& out, const std::string& bootcdDirectory ); + void GetNonModuleCdDirectories ( std::vector& out, const std::string& bootcdDirectory ); + void GetCdDirectories ( std::vector& out, const std::string& bootcdDirectory ); + void GetBootstrapCdFiles ( std::vector& out ) const; + void GetNonModuleCdFiles ( std::vector& out ) const; + void GetCdFiles ( std::vector& out ) const; + void OutputBootstrapfileCopyCommands ( const std::string& bootcdDirectory, + std::vector& destinations ); + void OutputCdfileCopyCommands ( const std::string& bootcdDirectory, + std::vector& destinations ); +}; + + +class MingwLiveIsoModuleHandler : public MingwModuleHandler +{ +public: + MingwLiveIsoModuleHandler ( const Module& module ); + virtual void Process (); +private: + void GenerateLiveIsoModuleTarget (); + void CreateDirectory ( const std::string& directory ); + void OutputModuleCopyCommands ( std::string& livecdDirectory, + std::string& livecdReactos, + std::vector& destinations ); + void OutputNonModuleCopyCommands ( std::string& livecdDirectory, + std::string& livecdReactos, + std::vector& destinations ); + void OutputProfilesDirectoryCommands ( std::string& livecdDirectory, + std::vector& destinations ); + void OutputLoaderCommands ( std::string& livecdDirectory, + std::vector& destinations ); + void OutputRegistryCommands ( std::string& livecdDirectory ); +}; + + +class MingwTestModuleHandler : public MingwModuleHandler +{ +public: + MingwTestModuleHandler ( const Module& module ); + virtual void Process (); +protected: + virtual void GetModuleSpecificCompilationUnits ( std::vector& compilationUnits ); +private: + void GenerateTestModuleTarget (); +}; + +class MingwAliasModuleHandler : public MingwModuleHandler +{ +public: + MingwAliasModuleHandler ( const Module& module ); + virtual void Process (); +}; + +class MingwCabinetModuleHandler : public MingwModuleHandler +{ +public: + MingwCabinetModuleHandler ( const Module& module ); + virtual void Process (); +}; + +class MingwElfExecutableModuleHandler : public MingwModuleHandler +{ +public: + MingwElfExecutableModuleHandler ( const Module& module ); + virtual void Process (); +}; diff --git a/tools/rbuild/backend/mingw/mstools_detection.cpp b/tools/rbuild/backend/mingw/mstools_detection.cpp new file mode 100644 index 00000000000..bc8ea8b68ad --- /dev/null +++ b/tools/rbuild/backend/mingw/mstools_detection.cpp @@ -0,0 +1,2295 @@ +/* + * Copyright (C) 2009 KJK::Hyperion + * + * This program is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation; either version 2 of the License, or + * (at your option) any later version. + * + * This program 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 General Public License for more details. + * + * You should have received a copy of the GNU General Public License along + * with this program; if not, write to the Free Software Foundation, Inc., + * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. + */ + +#if defined(WIN32) + +#define UNICODE +#define _UNICODE + +#define NOMINMAX + +#include "../../pch.h" + +#include "mingw.h" + +#ifndef ARRAYSIZE +#define ARRAYSIZE(X_) (sizeof(X_) / sizeof((X_)[0])) +#endif + +#include + +#include +#include +#include + +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include + +#if defined(_CPPLIB_VER) +#include +typedef std::filebuf stdio_filebuf; +#elif defined(__GLIBCXX__) +#include +typedef __gnu_cxx::stdio_sync_filebuf stdio_filebuf; +#else +#error Unknown or unsupported C++ standard library +#endif + + + +namespace +{ + +#if 1 +HRESULT dispPropGet(IDispatch * object, DISPID dispid, VARIANTARG * args, UINT ccArgs, VARTYPE vt, VARIANT& result) +{ + HRESULT hr; + + DISPPARAMS params = {}; + params.rgvarg = args; + params.cArgs = ccArgs; + + hr = object->Invoke(dispid, IID_NULL, 0, DISPATCH_PROPERTYGET | (ccArgs ? DISPATCH_METHOD : 0), ¶ms, &result, NULL, NULL); + + if(SUCCEEDED(hr)) + hr = VariantChangeType(&result, &result, 0, vt); + + return hr; +} + +HRESULT dispPropGet(IDispatch * object, const OLECHAR * name, VARIANTARG * args, UINT ccArgs, VARTYPE vt, VARIANT& result) +{ + HRESULT hr; + + DISPID dispid; + hr = object->GetIDsOfNames(IID_NULL, const_cast(&name), 1, 0, &dispid); + + if(SUCCEEDED(hr)) + hr = dispPropGet(object, dispid, args, ccArgs, vt, result); + + return hr; +} + +VARIANT dispPropGet(HRESULT& hr, IDispatch * object, DISPID dispid, VARTYPE vt) +{ + VARIANT ret; + VariantInit(&ret); + + if(SUCCEEDED(hr)) + hr = dispPropGet(object, dispid, 0, 0, vt, ret); + + return ret; +} + +VARIANT dispPropGet(HRESULT& hr, IDispatch * object, const OLECHAR * name, VARTYPE vt) +{ + VARIANT ret; + VariantInit(&ret); + + if(SUCCEEDED(hr)) + hr = dispPropGet(object, name, 0, 0, vt, ret); + + return ret; +} + +HRESULT dispInvoke(IDispatch * object, DISPID dispid, VARIANTARG * args, UINT ccArgs, VARTYPE vt, VARIANT& result) +{ + HRESULT hr; + + DISPPARAMS params = {}; + params.rgvarg = args; + params.cArgs = ccArgs; + + hr = object->Invoke(dispid, IID_NULL, 0, DISPATCH_METHOD, ¶ms, &result, NULL, NULL); + + if(SUCCEEDED(hr)) + hr = VariantChangeType(&result, &result, 0, vt); + + return hr; +} + +HRESULT dispInvoke(IDispatch * object, DISPID dispid, const VARIANTARG& arg, VARTYPE vt, VARIANT& result) +{ + return dispInvoke(object, dispid, const_cast(&arg), 1, vt, result); +} + +HRESULT dispInvoke(IDispatch * object, DISPID dispid, VARTYPE vt, VARIANT& result) +{ + return dispInvoke(object, dispid, NULL, 0, vt, result); +} + +HRESULT dispInvoke(IDispatch * object, VARIANTARG * args, UINT ccArgs, VARTYPE vt, VARIANT& result) +{ + return dispInvoke(object, DISPID_VALUE, args, ccArgs, vt, result); +} + +HRESULT dispInvoke(IDispatch * object, VARTYPE vt, VARIANT& result) +{ + return dispInvoke(object, DISPID_VALUE, NULL, 0, vt, result); +} + +HRESULT dispInvoke(IDispatch * object, const VARIANTARG& arg, VARTYPE vt, VARIANT& result) +{ + return dispInvoke(object, DISPID_VALUE, const_cast(&arg), 1, vt, result); +} + +HRESULT dispInvoke(IDispatch * object, const OLECHAR * name, VARIANTARG * args, UINT ccArgs, VARTYPE vt, VARIANT& result) +{ + HRESULT hr; + + DISPID dispid; + hr = object->GetIDsOfNames(IID_NULL, const_cast(&name), 1, 0, &dispid); + + if(SUCCEEDED(hr)) + hr = dispInvoke(object, dispid, args, ccArgs, vt, result); + + return hr; +} + +HRESULT dispInvoke(IDispatch * object, const OLECHAR * name, const VARIANTARG& arg, VARTYPE vt, VARIANT& result) +{ + return dispInvoke(object, name, const_cast(&arg), 1, vt, result); +} + +HRESULT dispInvoke(IDispatch * object, const OLECHAR * name, VARTYPE vt, VARIANT& result) +{ + return dispInvoke(object, name, NULL, 0, vt, result); +} + +VARIANT dispInvoke(HRESULT& hr, IDispatch * object, DISPID dispid, VARIANTARG * args, UINT ccArgs, VARTYPE vt) +{ + VARIANT ret; + VariantInit(&ret); + + if(SUCCEEDED(hr)) + hr = dispInvoke(object, dispid, args, ccArgs, vt, ret); + + return ret; +} + +VARIANT dispInvoke(HRESULT& hr, IDispatch * object, const OLECHAR * name, VARIANTARG * args, UINT ccArgs, VARTYPE vt) +{ + VARIANT ret; + VariantInit(&ret); + + if(SUCCEEDED(hr)) + hr = dispInvoke(object, name, args, ccArgs, vt, ret); + + return ret; +} + +VARIANT dispInvoke(HRESULT& hr, IDispatch * object, DISPID dispid, const VARIANTARG& arg, VARTYPE vt) +{ + return dispInvoke(hr, object, dispid, const_cast(&arg), 1, vt); +} + +VARIANT dispInvoke(HRESULT& hr, IDispatch * object, DISPID dispid, VARTYPE vt) +{ + return dispInvoke(hr, object, dispid, NULL, 0, vt); +} + +VARIANT dispInvoke(HRESULT& hr, IDispatch * object, VARIANTARG * args, UINT ccArgs, VARTYPE vt) +{ + return dispInvoke(hr, object, DISPID(DISPID_VALUE), args, ccArgs, vt); +} + +VARIANT dispInvoke(HRESULT& hr, IDispatch * object, VARTYPE vt) +{ + return dispInvoke(hr, object, DISPID(DISPID_VALUE), NULL, 0, vt); +} + +VARIANT dispInvoke(HRESULT& hr, IDispatch * object, const VARIANTARG& arg, VARTYPE vt) +{ + return dispInvoke(hr, object, DISPID(DISPID_VALUE), const_cast(&arg), 1, vt); +} + +VARIANT dispInvoke(HRESULT& hr, IDispatch * object, const OLECHAR * name, const VARIANTARG& arg, VARTYPE vt) +{ + return dispInvoke(hr, object, name, const_cast(&arg), 1, vt); +} + +VARIANT dispInvoke(HRESULT& hr, IDispatch * object, const OLECHAR * name, VARTYPE vt) +{ + return dispInvoke(hr, object, name, NULL, 0, vt); +} + +VARIANT oleString(HRESULT& hr, const OLECHAR * sz) +{ + VARIANT v; + VariantInit(&v); + + if(SUCCEEDED(hr)) + { + V_VT(&v) = VT_BSTR; + V_BSTR(&v) = SysAllocString(sz); + + if(!V_BSTR(&v)) + hr = E_OUTOFMEMORY; + } + + if(FAILED(hr)) + { + V_VT(&v) = VT_ERROR; + V_ERROR(&v) = hr; + } + + return v; +} + +#endif + +#if 1 +namespace knuth_morris_pratt +{ + +namespace details +{ + +template +typename std::iterator_traits::iterator_category iterator_category(const Iter&) +{ + return typename std::iterator_traits::iterator_category(); +} + +template +struct type_equals +{ + enum { value = 0 }; +}; + +template +struct type_equals +{ + enum { value = 1 }; +}; + +template +void advance_substr(Iter& pos, Iter, diff_type, diff_type rel, const std::bidirectional_iterator_tag&) +{ + std::advance(pos, rel); +} + +template +void advance_substr(Iter& pos, Iter begin, diff_type absol, diff_type rel, const std::forward_iterator_tag&) +{ + if(rel > 0) + std::advance(pos, rel); + else + { + pos = begin; + std::advance(pos, absol); + } +} + +template +void advance_substr(Iter& pos, Iter begin, diff_type absol, diff_type rel) +{ + advance_substr(pos, begin, absol, rel, iterator_category(pos)); +} + +template +struct fixed_table +{ +public: + typedef typename std::iterator_traits::difference_type value_type; + typedef value_type * pointer; + typedef value_type& reference; + typedef const value_type * const_pointer; + typedef const value_type& const_reference; + typedef typename std::allocator::difference_type difference_type; + typedef typename std::allocator::size_type size_type; + +private: + value_type m_table[(N)]; + +public: + static pointer address(reference r) { return &r; } + static const_pointer address(const_reference r) { return &r; } + static size_type max_size() { return (N); } + static void construct(pointer p, const T& v) { p->T(v); } + static void destroy(pointer p) { p->~T(); } + template struct rebind { typedef fixed_table other; }; + + template pointer allocate(size_type n, const Other * hint) + { + assert(n <= (N)); + assert(hint == 0); + return m_table; + } + + pointer allocate(size_type n) + { + assert(n <= (N)); + return m_table; + } + + void deallocate(pointer p, size_type n) const + { + assert(p == m_table); + assert(n <= (N)); + } +}; + +void validate_range_iterator_category(const std::input_iterator_tag&) { } +void validate_substr_iterator_category(const std::forward_iterator_tag&) { } + +template +RangeIter search_cornercase_neg(RangeIter, RangeIter end, SubstrIter) +{ + return end; +} + +template +RangeIter search_cornercase0(RangeIter begin, RangeIter, SubstrIter) +{ + return begin; +} + +template +RangeIter search_cornercase1(RangeIter begin, RangeIter end, SubstrIter substrBegin) +{ + RangeIter pos = std::find(begin, end, *substrBegin); + + if(type_equals::iterator_category, std::input_iterator_tag>::value && pos != end) + ++ pos; + + return pos; +} + +template +void search_createtable_dynamic +( + SubstrIter beginSubstr, + typename std::iterator_traits::difference_type substrSize, + TableType table, + TableSize +) +{ + typedef typename std::iterator_traits::difference_type substr_diff_type; + typedef typename TableType::pointer table_type; + typedef TableSize table_size_type; + + substr_diff_type i(2); + SubstrIter pi = beginSubstr; + std::advance(pi, substr_diff_type(1)); + + substr_diff_type j(0); + SubstrIter pj = beginSubstr; + std::advance(pj, substr_diff_type(0)); + + while(i < substrSize) + { + if(*pi == *pj) + { + substr_diff_type new_j = j; + ++ new_j; + + table[static_cast(i)] = new_j; + + ++ i; ++ pi; + ++ j; ++ pj; + } + else if(j > 0) + { + substr_diff_type new_j = table[i]; + details::advance_substr(pj, beginSubstr, new_j, new_j - j); + j = new_j; + } + else + { + table[i] = 0; + ++ i; ++ pi; + } + } +} + +template +void search_createtable_static +( + const S (& substr)[N], + D (& table)[N] +) +{ + typedef std::ptrdiff_t substr_diff_type; + + table[0] = substr_diff_type(-1); + table[1] = substr_diff_type(0); + + substr_diff_type pos = 2; + substr_diff_type cnd = 0; + + while(pos < static_cast(N)) + { + if(substr[pos - 1] == substr[cnd]) + { + table[pos] = cnd + 1; + ++ pos; + ++ cnd; + } + else if(cnd > 0) + cnd = table[cnd]; + else + { + table[pos] = 0; + ++ pos; + } + } +} + +template +RangeIter search +( + const RangeIter& begin, + const RangeIter& end, + const SubstrIter beginSubstr, + typename std::iterator_traits::difference_type substrSize, + Table table, + TableSize +) +{ + details::validate_range_iterator_category(details::iterator_category(begin)); + details::validate_substr_iterator_category(details::iterator_category(beginSubstr)); + + typedef typename std::iterator_traits::difference_type substr_diff_type; + typedef Table table_type; + typedef TableSize table_size_type; + + // Find the next match + substr_diff_type iSubstr(0); // i + RangeIter pCurMatch = begin; // m + RangeIter pCurElem = begin; // m + i + SubstrIter pCurSubstrElem = beginSubstr; // i + + while(pCurElem != end) + { + if(*pCurSubstrElem == *pCurElem) + { + ++ iSubstr; // ++ i + + if(iSubstr == substrSize) + { + // For input iterators, we return the end of the match + if(type_equals::iterator_category, std::input_iterator_tag>::value) + ++ pCurElem; // return m + i + 1 + // For all other iterators, we return the beginning of the match + else + pCurElem = pCurMatch; // return m + + break; + } + + ++ pCurElem; // ++ i + ++ pCurSubstrElem; // ++ i + } + else + { + substr_diff_type table_iSubstr = table[static_cast(iSubstr)]; // T[i] + substr_diff_type iSubstr_backtracked = iSubstr - table_iSubstr; // i - T[i] + assert(iSubstr_backtracked >= substr_diff_type(0)); + + if(!type_equals::iterator_category, std::input_iterator_tag>::value) + std::advance(pCurMatch, iSubstr_backtracked); // m = m + i - T[i] + + if(iSubstr > substr_diff_type(0)) // i > 0 + { + iSubstr = table_iSubstr; // i = T[i] + pCurSubstrElem = beginSubstr; + std::advance(pCurSubstrElem, iSubstr); // i = T[i] + } + else + std::advance(pCurElem, iSubstr_backtracked); + } + } + + return pCurElem; +} + +}; + +template +RangeIter search(RangeIter begin, RangeIter end, SubstrIter beginSubstr, SubstrIter endSubstr, AllocTable& allocTable) +{ + typename std::iterator_traits::difference_type substrSize = std::distance(beginSubstr, endSubstr); + + if(substrSize < 0) + return knuth_morris_pratt::details::search_cornercase_neg(begin, end, beginSubstr); + + if(substrSize == 0) + return knuth_morris_pratt::details::search_cornercase0(begin, end, beginSubstr); + + if(substrSize == 1) + return knuth_morris_pratt::details::search_cornercase1(begin, end, beginSubstr); + + typedef typename AllocTable::size_type table_size; + typedef typename AllocTable::pointer table_type; + + table_size tableSize = static_cast(substrSize); + table_type table = allocTable.allocate(tableSize); + + RangeIter pos = knuth_morris_pratt::details::search(begin, end, beginSubstr, substrSize, table, tableSize); + + allocTable.deallocate(table, tableSize); + + return pos; +} + +template +RangeIter search(RangeIter begin, RangeIter end, SubstrIter beginSubstr, SubstrIter endSubstr) +{ + std::allocator::difference_type> allocTable; + return knuth_morris_pratt::search(begin, end, beginSubstr, endSubstr, allocTable); +} + +template +RangeIter search(RangeIter begin, RangeIter end, const SubstrElem (& substr)[(N)]) +{ + if((N) == 0) + return knuth_morris_pratt::details::search_cornercase0(begin, end, substr); + + if((N) == 1) + return knuth_morris_pratt::details::search_cornercase1(begin, end, substr); + + if((N) * sizeof(SubstrElem) <= 4096) + { + ptrdiff_t table[N]; + knuth_morris_pratt::details::search_createtable_static(substr, table); + return knuth_morris_pratt::details::search(begin, end, substr, (N), table, sizeof(table)); + } + else + return knuth_morris_pratt::search(begin, end, substr, substr + (N)); +} + +} +#endif + +#if 1 +template +std::basic_string replace(const std::basic_string& str, const CharT (& substr)[(N)], ReplIter replBegin, ReplIter replEnd) +{ + if((N) == 0) + return str; + + std::basic_string newStr; + typename std::basic_string::const_iterator cur = str.begin(); + typename std::basic_string::const_iterator end = str.end(); + + while(cur != end) + { + typename std::basic_string::const_iterator found = knuth_morris_pratt::search(cur, end, *reinterpret_cast(&substr)); + + newStr.append(cur, found); + cur = found; + + if(found != end) + { + newStr.append(replBegin, replEnd); + advance(cur, (N) - 1); + } + } + + return newStr; +} + +template +std::basic_string replace(const std::basic_string& str, const CharT (& substr)[(N)], const CharT (& repl)[(M)]) +{ + return replace(str, substr, repl, repl + ((M) - 1)); +} + +template +std::basic_string replace(const std::basic_string& str, const CharT (& substr)[(N)], const std::basic_string& repl) +{ + return replace(str, substr, repl.begin(), repl.end()); +} + +template +std::basic_string replace(const std::basic_string& str, const std::basic_string& substr, const CharT (& repl)[(M)]) +{ + return replace(str, substr.begin(), substr.end(), repl, repl + ((M) - 1)); +} + +template +std::basic_string replace(const std::basic_string& str, const std::basic_string& substr, const std::basic_string& repl) +{ + return replace(str, substr.begin(), substr.end(), repl.begin(), repl.end()); +} + +template +struct type_equals +{ + enum { value = 0 }; +}; + +template +struct type_equals +{ + enum { value = 1 }; +}; + +template +bool advance_between_impl(InIter& cur, const InIter& begin, const InIter& end, Dist off, const std::input_iterator_tag&) +{ + if(Dist(0) < off) + for(; off != Dist(0) && cur != end; -- off) + ++ cur; + + return off == Dist(0); +} + +template +bool advance_between_impl(InIter& cur, const InIter& begin, const InIter& end, Dist off, const std::bidirectional_iterator_tag&) +{ + if(Dist(0) < off) + for(; off != Dist(0) && cur != end; -- off) + ++ cur; + else + for(; off != Dist(0) && cur != begin; ++ off) + ++ cur; + + return off == Dist(0); +} + +template +bool advance_between_impl(InIter& cur, const InIter& begin, const InIter& end, Dist off, const std::random_access_iterator_tag&) +{ + bool ret; + + if(Dist(0) < off) + { + Dist max = distance(cur, end); + ret = off == max || off < max; + } + else + { + Dist max = distance(cur, end); + ret = abs(off) == max || abs(off) < max; + } + + if(ret) + advance(cur, off); + + return ret; +} + +template +bool advance_between(InIter& cur, const InIter& begin, const InIter& end, Dist off) +{ + return advance_between_impl(cur, begin, end, off, typename std::iterator_traits::iterator_category()); +} + +template +class range_streambuf_base: public std::basic_streambuf +{ +public: + typedef typename std::basic_streambuf::int_type int_type; + typedef typename std::basic_streambuf::pos_type pos_type; + typedef typename std::basic_streambuf::off_type off_type; + +protected: + InIter m_cur; + InIter m_end; + int_type m_ungetc; + int_type m_putbackc; + + int_type get_char() + { + int_type c = m_ungetc; + + if(c == Traits::eof()) + { + if(m_cur != m_end) + { + c = *m_cur; + ++ m_cur; + } + } + else + m_ungetc = Traits::eof(); + + return c; + } + + int_type unget_char(int_type c) + { + if(c == Traits::eof()) + return c; + + if(m_ungetc == Traits::eof()) + m_ungetc = c; + else + return Traits::eof(); + + return c; + } + +protected: + range_streambuf_base(const InIter& begin, const InIter& end): + m_cur(begin), + m_end(end), + m_ungetc(Traits::eof()), + m_putbackc(Traits::eof()) + { + } + +public: + virtual int_type pbackfail(int_type c) + { + int_type ret; + + if(Traits::eq_int_type(c, Traits::eof())) + { + if(!Traits::eq_int_type(m_putbackc, Traits::eof())) + ret = unget_char(m_putbackc); + else + ret = Traits::eof(); + } + else + ret = unget_char(c); + + m_putbackc = Traits::eof(); + return ret; + } + + virtual std::streamsize showmanyc() const + { + return std::streamsize(-1); + } + + virtual int_type underflow() + { + return unget_char(get_char()); + } + + virtual int_type uflow() + { + m_putbackc = get_char(); + return m_putbackc; + } + + virtual std::streamsize xsgetn(Elem * p, std::streamsize n) + { + return _Xsgetn_s(p, std::numeric_limits::max(), n); + } + + virtual std::streamsize _Xsgetn_s(Elem * p, size_t cb, std::streamsize n) + { + std::streamsize i; + size_t ib; + + for(i = 0, ib = 0; i < n && ib < cb; ++ i, ++ ib, ++ p) + { + int_type c = get_char(); + + if(c == Traits::eof()) + break; + + *p = Traits::to_char_type(c); + } + + if(i > 0) + m_putbackc = p[-1]; + else + m_putbackc = Traits::eof(); + + return i; + } + + virtual pos_type seekoff(off_type off, std::ios_base::seekdir dir, std::ios_base::openmode mode) + { + if(((off == 0 && dir == std::ios_base::end) || (off >= 0 && dir == std::ios_base::cur)) && !(mode & std::ios_base::out)) + { + m_ungetc = Traits::eof(); + + if(dir == std::ios_base::end) + m_cur = m_end; + + advance_between(m_cur, m_cur, m_end, off); + } + + return pos_type(-1); + } +}; + +template +class range_streambuf_base: + public range_streambuf_base +{ +public: + typedef typename range_streambuf_base::int_type int_type; + typedef typename range_streambuf_base::pos_type pos_type; + typedef typename range_streambuf_base::off_type off_type; + +private: + typedef range_streambuf_base super; + InIter m_begin; + +protected: + range_streambuf_base(const InIter& begin, const InIter& end): + m_begin(begin), + range_streambuf_base(begin, end) + { + } + +public: + virtual pos_type seekoff(off_type off, std::ios_base::seekdir dir, std::ios_base::openmode mode) + { + if(!(mode & std::ios_base::out) && off >= 0) + { + if(dir == std::ios_base::beg) + super::m_cur = m_begin; + else if(dir != std::ios_base::cur) + super::m_cur = super::m_end; + + advance_between(super::m_cur, m_begin, super::m_end, off); + } + + return pos_type(-1); + } +}; + +template +class range_streambuf_base: public std::basic_streambuf +{ +public: + typedef typename std::basic_streambuf::int_type int_type; + typedef typename std::basic_streambuf::pos_type pos_type; + typedef typename std::basic_streambuf::off_type off_type; + +protected: + InIter m_begin; + InIter m_cur; + InIter m_end; + +protected: + range_streambuf_base(const InIter& begin, const InIter& end): + m_begin(begin), + m_cur(begin), + m_end(end) + { + } + +public: + virtual int_type pbackfail(int_type c) + { + int_type ret = Traits::eof(); + + if(m_cur != m_begin) + { + InIter prev = m_cur; + -- prev; + + if(Traits::eq_int_type(c, Traits::eof()) || Traits::eq_int_type(c, Traits::to_int_type(*prev))) + { + -- m_cur; + ret = Traits::to_int_type(*m_cur); + } + } + + return ret; + } + + virtual std::streamsize showmanyc() const + { + return std::streamsize(-1); + } + + virtual int_type underflow() + { + if(m_cur != m_end) + return *m_cur; + else + return Traits::eof(); + } + + virtual int_type uflow() + { + int_type c = Traits::eof(); + + if(m_cur != m_end) + { + c = *m_cur; + ++ m_cur; + } + + return c; + } + + virtual std::streamsize xsgetn(Elem * p, std::streamsize n) + { + return _Xsgetn_s(p, std::numeric_limits::max(), n); + } + + virtual std::streamsize _Xsgetn_s(Elem * p, size_t cb, std::streamsize n) + { + std::streamsize i; + size_t ib; + + for(i = 0, ib = 0; i < n && ib < cb && m_cur != m_end; ++ i, ++ ib, ++ p, ++ m_cur) + *p = Traits::to_char_type(*m_cur); + + return i; + } + + virtual pos_type seekoff(off_type off, std::ios_base::seekdir dir, std::ios_base::openmode mode) + { + if(mode & std::ios_base::out) + return pos_type(-1); + + if(dir == std::ios_base::beg) + m_cur = m_begin; + else if(dir != std::ios_base::cur) + m_cur = m_end; + + if(!advance_between(m_cur, m_begin, m_end, off)) + return pos_type(-1); + + return m_cur - m_begin; + } +}; + +template +class range_streambuf_base: + public range_streambuf_base +{ +private: + typedef range_streambuf_base super; + +protected: + range_streambuf_base(const InIter& begin, const InIter& end): + range_streambuf_base(begin, end) + { + } + +public: + virtual std::streamsize showmanyc() const + { + return distance(super::m_cur, super::m_end); + } + + virtual std::streamsize _Xsgetn_s(Elem * p, size_t cb, std::streamsize n) + { + std::streamsize maxn = showmanyc(); + + if(n > maxn) + n = maxn; + + if(cb > static_cast(n)) + cb = static_cast(n); + + std::copy(super::m_cur, super::m_cur + cb, p); + return cb; + } +}; + +template::value_type, class Traits = typename std::char_traits > +class range_streambuf: + public range_streambuf_base::iterator_category> +{ +public: + range_streambuf(const InIter& begin, const InIter& end): + range_streambuf_base::iterator_category>(begin, end) { } +}; + +#endif + +struct version_tuple +{ +private: + unsigned short m_fields[4]; + +public: + version_tuple(): m_fields() {} + + version_tuple(unsigned short major, unsigned short minor, unsigned short build_major = 0, unsigned short build_minor = 0) + { + m_fields[0] = major; + m_fields[1] = minor; + m_fields[2] = build_major; + m_fields[3] = build_minor; + } + + version_tuple(const version_tuple& That) + { + m_fields[0] = That.m_fields[0]; + m_fields[1] = That.m_fields[1]; + m_fields[2] = That.m_fields[2]; + m_fields[3] = That.m_fields[3]; + } + + const version_tuple& operator=(const version_tuple& That) + { + m_fields[0] = That.m_fields[0]; + m_fields[1] = That.m_fields[1]; + m_fields[2] = That.m_fields[2]; + m_fields[3] = That.m_fields[3]; + return *this; + } + + unsigned short get_major() const + { + return m_fields[0]; + } + + unsigned short get_minor() const + { + return m_fields[1]; + } + + unsigned short get_build_major() const + { + return m_fields[2]; + } + + unsigned short get_build_minor() const + { + return m_fields[3]; + } + + bool operator==(const version_tuple& That) const + { + return memcmp(this->m_fields, That.m_fields, sizeof(this->m_fields)) == 0; + } + + bool operator<(const version_tuple& That) const + { + return std::lexicographical_compare + ( + &(this->m_fields[0]) + 0, + &(this->m_fields[0]) + ARRAYSIZE(this->m_fields), + &(That.m_fields[0]) + 0, + &(That.m_fields[0]) + ARRAYSIZE(That.m_fields) + ); + } + + bool operator<=(const version_tuple& That) const + { + return (*this == That) || (*this < That); + } + + bool operator>(const version_tuple& That) const + { + return !(*this <= That); + } + + bool operator>=(const version_tuple& That) const + { + return !(*this < That); + } +}; + +template std::basic_ostream& operator<<(std::basic_ostream& ostr, const version_tuple& v) +{ + std::ios_base::fmtflags flags = ostr.flags(); + ostr.flags(std::ios_base::dec); + ostr << v.get_major(); + ostr << Tr::to_char_type('.'); + ostr << v.get_minor(); + ostr << Tr::to_char_type('.'); + ostr << v.get_build_major(); + ostr << Tr::to_char_type('.'); + ostr << v.get_build_minor(); + ostr.flags(flags); + return ostr; +} + +template std::basic_istream& operator>>(std::basic_istream& istr, version_tuple& v) +{ + const std::ctype& ct = std::use_facet >(istr.getloc()); + unsigned short a = 0, b = 0, c = 0, d = 0; + Elem ch; + + std::ios_base::fmtflags flags = istr.setf(std::ios_base::dec); + + if(istr >> a) + { + istr >> ch; + + if(ch == ct.widen('.')) + { + if(istr >> b) + { + istr >> ch; + + if(ch == ct.widen('.')) + { + if(istr >> c) + { + istr >> ch; + + if(ch == ct.widen('.')) + istr >> d; + else + istr.putback(ch); + } + } + else + istr.putback(ch); + + if(istr) + { + v = version_tuple(a, b, c, d); + istr.flags(flags); + return istr; + } + } + } + else + istr.putback(ch); + } + + istr.flags(flags); + istr.setstate(std::ios_base::failbit); + return istr; +} + +struct cl_version: public version_tuple +{ +private: + bool m_optimizing; + +public: + cl_version(): m_optimizing() {} + + cl_version(const version_tuple& version_number, bool optimizing = false): + version_tuple(version_number), m_optimizing(optimizing) {} + + cl_version + ( + unsigned short major, + unsigned short minor, + unsigned short build_major = 0, + unsigned short build_minor = 0, + bool optimizing = false, + bool analyze = false + ): + version_tuple(major, minor, build_major, build_minor), m_optimizing(optimizing) {} + + cl_version(const cl_version& That): version_tuple(That), m_optimizing(That.m_optimizing) {} + + const cl_version& operator=(const cl_version& That) + { + version_tuple::operator=(That); + m_optimizing = That.m_optimizing; + return *this; + } + + bool is_optimizing() const + { + return m_optimizing; + } + + bool operator==(const cl_version& That) const + { + return this->m_optimizing == That.m_optimizing && this->version_tuple::operator==(That); + } + + bool operator<(const cl_version& That) const + { + return (!this->m_optimizing && That.m_optimizing) || this->version_tuple::operator<(That); + } + + bool operator<=(const cl_version& That) const + { + return (*this == That) || (*this < That); + } + + bool operator>(const cl_version& That) const + { + return !(*this <= That); + } + + bool operator>=(const cl_version& That) const + { + return !(*this < That); + } + + operator bool() const + { + return get_major() || get_minor() || get_build_major() || get_build_minor(); + } +}; + +struct link_version: public version_tuple +{ +public: + link_version() {} + + link_version(const version_tuple& version_number): version_tuple(version_number) {} + + link_version + ( + unsigned short major, + unsigned short minor, + unsigned short build_major = 0, + unsigned short build_minor = 0 + ): + version_tuple(major, minor, build_major, build_minor) {} + + link_version(const link_version& That): version_tuple(That) {} + + const link_version& operator=(const link_version& That) + { + version_tuple::operator=(That); + return *this; + } + + bool operator==(const cl_version& That) const + { + return this->version_tuple::operator==(That); + } + + bool operator<(const cl_version& That) const + { + return this->version_tuple::operator<(That); + } + + bool operator<=(const cl_version& That) const + { + return (*this == That) || (*this < That); + } + + bool operator>(const cl_version& That) const + { + return !(*this <= That); + } + + bool operator>=(const cl_version& That) const + { + return !(*this < That); + } + + operator bool() const + { + return get_major() || get_minor() || get_build_major() || get_build_minor(); + } +}; + +template +struct type_holder +{ + typedef T type; +}; + +template +std::basic_string get_env(const Elem * name, const type_holder&, const type_holder&) +{ + DWORD cchValue = 0; + std::vector value; + + for(;;) + { + value.resize(cchValue); + + if(type_equals::value) + cchValue = GetEnvironmentVariableA(reinterpret_cast(name), reinterpret_cast(cchValue ? &(value[0]) : NULL), cchValue); + else if(type_equals::value) + cchValue = GetEnvironmentVariableW(reinterpret_cast(name), reinterpret_cast(cchValue ? &(value[0]) : NULL), cchValue); + + if(cchValue == 0) + return std::basic_string(); + + if(cchValue <= value.size()) + break; + } + + value.resize(cchValue); + return std::basic_string(value.begin(), value.end()); +} + +template +std::basic_string get_env(const Elem * name) +{ + return get_env(name, type_holder(), type_holder()); +} + +template +std::basic_string get_env(const Elem * name) +{ + return get_env(name, type_holder(), type_holder::allocator_type>()); +} + +template +std::basic_string get_env(const Elem * name) +{ + return get_env(name, type_holder::traits_type>(), type_holder::allocator_type>()); +} + +template +void set_env(const Elem * name, const Elem * value) +{ + if(type_equals::value) + SetEnvironmentVariableA(reinterpret_cast(name), reinterpret_cast(value)); + else if(type_equals::value) + SetEnvironmentVariableW(reinterpret_cast(name), reinterpret_cast(value)); +} + +template +FILE * pipe_open(const CharT * commandLine, const CharT * mode) +{ + if(type_equals::value) + return _popen(reinterpret_cast(commandLine), reinterpret_cast(mode)); + else if(type_equals::value) + return _wpopen(reinterpret_cast(commandLine), reinterpret_cast(mode)); + else + return NULL; +} + +template +FILE * pipe_open_override_path(const CharT * commandLine, const CharT * mode, const CharT2 * newPath) +{ + FILE * pipe = NULL; + const CharT2 path[] = { 'P', 'A', 'T', 'H', 0 }; + + std::basic_string oldPath; + + if(newPath) + { + oldPath = get_env(path); + set_env(path, newPath); + } + + try + { + pipe = pipe_open(commandLine, mode); + } + catch(...) + { + if(pipe != NULL) + fclose(pipe); + + if(newPath) + set_env(path, oldPath.c_str()); + + throw; + } + + if(newPath) + set_env(path, oldPath.c_str()); + + return pipe; +} + +template +std::pair tokenize(InIter begin, InIter end, IsSep isSeparator) +{ + InIter beginToken = std::find_if(begin, end, std::not1(isSeparator)); + InIter endToken = std::find_if(beginToken, end, isSeparator); + return std::make_pair(beginToken, endToken); +} + +std::locale clocale("C"); +const std::ctype& cctype = std::use_facet >(clocale); + +template +struct is_ctype_l: public std::binary_function +{ +public: + result_type operator()(const first_argument_type& locale, second_argument_type c) const + { + return std::use_facet >(locale).is(Mask, c); + } +}; + +typedef is_ctype_l is_space_l; + +template +struct is_ctype: public std::unary_function +{ +private: + const std::locale& m_locale; + is_ctype_l m_is_ctype_l; + +public: + is_ctype(const std::locale& locale): m_locale(locale) {} + + result_type operator()(argument_type c) const + { + return m_is_ctype_l(m_locale, c); + } +}; + +typedef is_ctype is_space; + +template +std::pair string_literal_token(const Elem (& lit)[N]) +{ + return std::make_pair(lit, lit + ((N) - 1)); +} + +template +bool token_equals(const std::pair& tokenX, const std::pair& tokenY) +{ + return std::distance(tokenX.first, tokenX.second) == std::distance(tokenY.first, tokenY.second) && std::equal(tokenX.first, tokenX.second, tokenY.first); +} + +std::pair GetClArchToken(const std::string& arch) +{ + if(arch == "i386") + return string_literal_token("80x86"); + else if(arch == "amd64") + return string_literal_token("x64"); + else if(arch == "arm") + return string_literal_token("ARM"); + else + return string_literal_token(""); +} + +template +cl_version CheckClVersion(const std::string& arch, const Elem * pathOverride) +{ + stdio_filebuf clVersionInfoBuf(pipe_open_override_path(_T("cl /nologo- 2>&1 >nul archToken = GetClArchToken(arch); + + version_tuple clVersionNumber; + bool clOptimizing = false; + bool clTargetArch = false; + + std::string clVersionLine; + getline(clVersionInfo, clVersionLine); + + for + ( + std::pair token = tokenize(clVersionLine.begin(), clVersionLine.end(), is_space(clocale)); + token.first != token.second; + token = tokenize(token.second, clVersionLine.end(), is_space(clocale)) + ) + { + // Is the compiler optimizing? + if(token_equals(token, string_literal_token("Optimizing"))) + { + clOptimizing = true; + continue; + } + + // Is this the version number? + range_streambuf tokenBuf(token.first, token.second); + std::istream tokenStream(&tokenBuf); + + if(tokenStream >> clVersionNumber) + continue; + + // Does the compiler support the target architecture? + if(token_equals(token, archToken)) + { + clTargetArch = true; + continue; + } + } + + if(clTargetArch) + return cl_version(clVersionNumber, clOptimizing); + else + return cl_version(); +} + +cl_version CheckClVersion(const std::string& arch) +{ + return CheckClVersion(arch, (const char *)0); +} + +std::pair GetLinkArchToken(const std::string& arch) +{ + if(arch == "i386") + return string_literal_token(_T("X86")); + else if(arch == "amd64") + return string_literal_token(_T("X64")); + else if(arch == "arm") + return string_literal_token(_T("ARM")); + else + return string_literal_token(_T("")); +} + +template +link_version CheckLinkVersion(const std::string& arch, const Elem * pathOverride) +{ + std::pair archToken = GetLinkArchToken(arch); + + std::basic_string<_TCHAR> linkCmdLine; + linkCmdLine.append(_T("link /nologo- /machine:\"")); + linkCmdLine.append(archToken.first, archToken.second); + linkCmdLine.append(_T("\" nul")); + + stdio_filebuf linkOutputBuf(pipe_open_override_path(linkCmdLine.c_str(), _T("rt"), pathOverride)); + std::istream linkOutput(&linkOutputBuf); + + link_version linkVersion; + + std::string linkOutputLine; + + if(getline(linkOutput, linkOutputLine)) + { + for + ( + std::pair token = tokenize(linkOutputLine.begin(), linkOutputLine.end(), is_space(clocale)); + token.first != token.second; + token = tokenize(token.second, linkOutputLine.end(), is_space(clocale)) + ) + { + range_streambuf tokenBuf(token.first, token.second); + std::istream tokenStream(&tokenBuf); + + version_tuple linkVersionNumber; + + if(tokenStream >> linkVersionNumber) + { + linkVersion = linkVersionNumber; + break; + } + } + } + + if(linkVersion) + { + bool linkArchCheckFail = false; + + while(!linkArchCheckFail && getline(linkOutput, linkOutputLine)) + { + linkArchCheckFail = + knuth_morris_pratt::search(linkOutputLine.begin(), linkOutputLine.end(), "LNK4012") != linkOutputLine.end() || + knuth_morris_pratt::search(linkOutputLine.begin(), linkOutputLine.end(), "LNK1146") != linkOutputLine.end(); + } + + if(linkArchCheckFail) + linkVersion = link_version(); + } + + return linkVersion; +} + +link_version CheckLinkVersion(const std::string& arch) +{ + return CheckLinkVersion(arch, (const char *)0); +} + +template +void CharsToString(HRESULT& hr, std::basic_string& str, const Elem * beginChars, const Elem * endChars) +{ + if(SUCCEEDED(hr)) + str = std::basic_string(beginChars, endChars); +} + +template +void CharsToString(HRESULT& hr, std::basic_string& str, const WCHAR * beginChars, const WCHAR * endChars) +{ + if(!SUCCEEDED(hr)) + return; + + UINT cchChars = endChars - beginChars; + int cch = WideCharToMultiByte(CP_ACP, 0, beginChars, cchChars, NULL, 0, NULL, NULL); + + if(cch <= 0) + { + hr = HRESULT_FROM_WIN32(GetLastError()); + return; + } + + CHAR * psz = new CHAR[cch]; + + if(psz == NULL) + { + hr = E_OUTOFMEMORY; + return; + } + + cch = WideCharToMultiByte(CP_ACP, 0, beginChars, cchChars, psz, cch, NULL, NULL); + + if(cch <= 0) + hr = HRESULT_FROM_WIN32(GetLastError()); + else + str = std::basic_string(psz, psz + cch); + + delete[] psz; +} + +template +void CharsToString(HRESULT& hr, std::basic_string& str, const CHAR * beginChars, const CHAR * endChars) +{ + if(!SUCCEEDED(hr)) + return; + + UINT cchChars = endChars - beginChars; + int cch = MultiByteToWideChar(CP_ACP, 0, beginChars, cchChars, NULL, 0); + + if(cch <= 0) + { + hr = HRESULT_FROM_WIN32(GetLastError()); + return; + } + + WCHAR * psz = new WCHAR[cch]; + + if(psz == NULL) + { + hr = E_OUTOFMEMORY; + return; + } + + cch = MultiByteToWideChar(CP_ACP, 0, beginChars, cchChars, psz, cch); + + if(cch <= 0) + hr = HRESULT_FROM_WIN32(GetLastError()); + else + str = std::basic_string(psz, psz + cch); + + delete[] psz; +} + +template +void BSTRToString(HRESULT& hr, std::basic_string& str, BSTR bstr) +{ + CharsToString(hr, str, bstr, bstr + SysStringLen(bstr)); +} + +std::vector SplitPath(const std::string& strPath) +{ + std::vector path; + std::string::const_iterator cur = strPath.begin(); + std::string::const_iterator end = strPath.end(); + + while(!(cur == end)) + { + std::string::const_iterator itemBegin = cur; + std::string::const_iterator itemEnd = std::find(cur, end, ';'); + + if(!(itemBegin == itemEnd)) + path.push_back(std::string(itemBegin, itemEnd)); + + cur = itemEnd; + + if(!(cur == end)) + ++ cur; + } + + return path; +} + +std::vector ParsePlatformPath(HRESULT& hr, IDispatch * pPlatform, BSTR bstrPath) +{ + std::vector path; + + if(FAILED(hr)) + return path; + + VARIANT varPath; + VariantInit(&varPath); + V_VT(&varPath) = VT_BSTR; + V_BSTR(&varPath) = bstrPath; + + VARIANT varRet = dispInvoke(hr, pPlatform, OLESTR("Evaluate"), varPath, VT_BSTR); + + std::string strPath; + BSTRToString(hr, strPath, V_BSTR(&varRet)); + + VariantClear(&varRet); + + path = SplitPath(strPath); + return path; +} + +VARIANT GetDTEProjectEngine(HRESULT& hr, IDispatch * pDTE) +{ + VARIANT varVCProjects = oleString(hr, OLESTR("VCProjects")); + VARIANT varVCProjectEngine = oleString(hr, OLESTR("VCProjectEngine")); + VARIANT varProjects = dispInvoke(hr, pDTE, OLESTR("GetObject"), varVCProjects, VT_DISPATCH); + VARIANT varProjectsProperties = dispPropGet(hr, V_DISPATCH(&varProjects), OLESTR("Properties"), VT_DISPATCH); + VARIANT varProjectEngineProperty = dispInvoke(hr, V_DISPATCH(&varProjectsProperties), varVCProjectEngine, VT_DISPATCH); + VARIANT varRet = dispPropGet(hr, V_DISPATCH(&varProjectEngineProperty), OLESTR("Object"), VT_DISPATCH); + VariantClear(&varProjectEngineProperty); + VariantClear(&varProjectsProperties); + VariantClear(&varProjects); + VariantClear(&varVCProjectEngine); + VariantClear(&varVCProjects); + return varRet; +} + +VARIANT GetDTEPlatformPath(HRESULT& hr, IDispatch * pDTE, BSTR bstrPlatformName, const OLECHAR * pszPathName) +{ + VARIANTARG argsProperties[2] = { oleString(hr, OLESTR("VCDirectories")), oleString(hr, OLESTR("Projects")) }; + + VARIANT varProperties; + VariantInit(&varProperties); + + if(SUCCEEDED(hr)) + hr = dispPropGet(pDTE, OLESTR("Properties"), argsProperties, ARRAYSIZE(argsProperties), VT_DISPATCH, varProperties); + + VARIANT varPathName = oleString(hr, pszPathName); + VARIANT varPath = dispInvoke(hr, V_DISPATCH(&varProperties), varPathName, VT_BSTR); + + VARIANT varRet; + VariantInit(&varRet); + + if(SUCCEEDED(hr)) + { + const OLECHAR * pCur = V_BSTR(&varPath); + const OLECHAR * pEnd = V_BSTR(&varPath) + SysStringLen(V_BSTR(&varPath)); + + while(!(pCur == pEnd)) + { + const OLECHAR * pBeginName = pCur; + const OLECHAR * pEndName = std::find(pBeginName, pEnd, OLESTR('|')); + const OLECHAR * pBeginValue = pEndName == pEnd ? pEndName : pEndName + 1; + const OLECHAR * pEndValue = std::find(pBeginValue, pEnd, OLESTR('|')); + + pCur = pEndValue; + + if(!(pCur == pEnd)) + ++ pCur; + + BSTR bstrName = SysAllocStringLen(pBeginName, pEndName - pBeginName); + + if(bstrName) + { + hr = VarBstrCmp(bstrName, bstrPlatformName, 0, NORM_IGNORECASE); + + if(hr == VARCMP_EQ) + { + BSTR bstrRet = SysAllocStringLen(pBeginValue, pEndValue - pBeginValue); + + if(bstrRet) + { + V_VT(&varRet) = VT_BSTR; + V_BSTR(&varRet) = bstrRet; + } + else + hr = E_OUTOFMEMORY; + } + + SysFreeString(bstrName); + + if(FAILED(hr) || hr == VARCMP_EQ) + break; + } + else + { + hr = E_OUTOFMEMORY; + break; + } + } + } + + VariantClear(&varPath); + VariantClear(&varPathName); + VariantClear(&varProperties); + VariantClear(&argsProperties[1]); + VariantClear(&argsProperties[0]); + + if(SUCCEEDED(hr) && V_VT(&varRet) != VT_BSTR) + { + VariantClear(&varRet); + varRet = oleString(hr, OLESTR("")); + } + + return varRet; +} + +cl_version msCompilerVersion; +std::string msCompilerPath; +std::vector msCompilerIncludeDirs; // TODO: use this +std::string msCompilerSource; // TODO: use this + +link_version msLinkerVersion; +std::string msLinkerPath; +std::vector msLinkerLibDirs; // TODO: use this +std::string msLinkerSource; // TODO: use this + +void ProcessVCPlatform(HRESULT& hr, const std::string& arch, bool wantCompiler, bool wantLinker, IDispatch * pVCProjectEngine, IDispatch * pPlatform, BSTR bstrPath, BSTR bstrInclude, BSTR bstrLib) +{ + if(FAILED(hr)) + return; + + std::basic_string strPath = replace(std::basic_string(bstrPath, SysStringLen(bstrPath)), OLESTR("$(PATH)"), OLESTR("%PATH%")); + + VARIANT varPath; + VariantInit(&varPath); + V_VT(&varPath) = VT_BSTR; + V_BSTR(&varPath) = SysAllocStringLen(strPath.c_str(), strPath.size()); + + if(!V_BSTR(&varPath)) + hr = E_OUTOFMEMORY; + + VARIANT varRet = dispInvoke(hr, pPlatform, OLESTR("Evaluate"), varPath, VT_BSTR); + + if(SUCCEEDED(hr)) + { + std::basic_string strPathOverride = replace + ( + std::basic_string(V_BSTR(&varRet), V_BSTR(&varRet) + SysStringLen(V_BSTR(&varRet))), + OLESTR("%PATH%"), + get_env(OLESTR("PATH")) + ); + + cl_version clVersion; + link_version linkVersion; + + if(wantCompiler) + clVersion = CheckClVersion(arch, strPathOverride.c_str()); + + if(wantLinker) + linkVersion = CheckLinkVersion(arch, strPathOverride.c_str()); + + // TODO: need a way to choose the desired tools and which version + // BUGBUG: for now, only set the new version if both tools are the highest version yet + if((!wantCompiler || (clVersion && clVersion > msCompilerVersion)) && (!wantLinker || (linkVersion && linkVersion > msLinkerVersion))) + { + std::string strPath; + BSTRToString(hr, strPath, V_BSTR(&varRet)); + strPath = replace(strPath, "%PATH%", "$(PATH)"); + + std::vector include = ParsePlatformPath(hr, pPlatform, bstrInclude); + std::vector lib = ParsePlatformPath(hr, pPlatform, bstrLib); + + if(SUCCEEDED(hr)) + { + if(wantCompiler) + { + msCompilerVersion = clVersion; + msCompilerPath = strPath; + msCompilerIncludeDirs = include; + //msCompilerSource; // TODO: fill this in + } + + if(wantLinker) + { + msLinkerVersion = linkVersion; + msLinkerPath = strPath; + msLinkerLibDirs = lib; + //msLinkerSource; // TODO: fill this in + } + } + } + } + + VariantClear(&varPath); + VariantClear(&varRet); +} + +bool IsVCPlatformSupported(HRESULT& hr, const std::string& arch, IDispatch * pPlatform) +{ + bool ret = false; + + VARIANT varPlatformName = dispPropGet(hr, pPlatform, OLESTR("Name"), VT_BSTR); + + if(arch == "i386") + { + VARIANT varWin32 = oleString(hr, OLESTR("Win32")); + + if(SUCCEEDED(hr)) + { + hr = VarBstrCmp(V_BSTR(&varWin32), V_BSTR(&varPlatformName), 0, NORM_IGNORECASE); + ret = hr == VARCMP_EQ; + } + + VariantClear(&varWin32); + } + else if(arch == "amd64") + { + VARIANT varX64 = oleString(hr, OLESTR("x64")); + + if(SUCCEEDED(hr)) + { + hr = VarBstrCmp(V_BSTR(&varX64), V_BSTR(&varPlatformName), 0, NORM_IGNORECASE); + ret = hr == VARCMP_EQ; + } + + VariantClear(&varX64); + } + else if(arch == "arm") + { + VARIANT varARM = oleString(hr, OLESTR("ARM")); + VARIANT varARCHFAM = oleString(hr, OLESTR("ARCHFAM")); + VARIANT varArchFamily = dispInvoke(hr, pPlatform, OLESTR("GetMacroValue"), varARCHFAM, VT_BSTR); + + if(SUCCEEDED(hr)) + { + hr = VarBstrCmp(V_BSTR(&varARM), V_BSTR(&varArchFamily), 0, NORM_IGNORECASE); + ret = hr == VARCMP_EQ; + } + + VariantClear(&varArchFamily); + VariantClear(&varARCHFAM); + VariantClear(&varARM); + } + + VariantClear(&varPlatformName); + + return SUCCEEDED(hr) && ret; +} + +void EnumerateVCTools(const std::string& arch, bool wantCompiler, bool wantLinker, const OLECHAR * szProductTag) +{ + size_t cchProductTag = std::wcslen(szProductTag); + HRESULT hr; + + hr = OleInitialize(NULL); + + if(SUCCEEDED(hr)) + { + std::basic_string strProductKey; + CharsToString(hr, strProductKey, szProductTag, szProductTag + cchProductTag); + + if(SUCCEEDED(hr)) + { + strProductKey = TEXT("SOFTWARE\\Microsoft\\") + strProductKey; + + HKEY hkVisualStudio; + hr = HRESULT_FROM_WIN32(RegOpenKeyEx(HKEY_LOCAL_MACHINE, strProductKey.c_str(), 0, KEY_ENUMERATE_SUB_KEYS, &hkVisualStudio)); + + if(SUCCEEDED(hr)) + { + for(DWORD i = 0; ; ++ i) + { + TCHAR szProductVersion[255 + 1]; + DWORD cchProductVersion = ARRAYSIZE(szProductVersion); + + hr = HRESULT_FROM_WIN32(RegEnumKeyEx(hkVisualStudio, i, szProductVersion, &cchProductVersion, NULL, NULL, NULL, NULL)); + + if(SUCCEEDED(hr)) + { + std::basic_string strProductVersion; + CharsToString(hr, strProductVersion, szProductVersion, szProductVersion + cchProductVersion); + + if(SUCCEEDED(hr)) + { + std::basic_string strDTEProgId(szProductTag, szProductTag + cchProductTag); + strDTEProgId += OLESTR(".DTE."); + strDTEProgId += strProductVersion; + + CLSID clsidDTE; + hr = CLSIDFromProgID(strDTEProgId.c_str(), &clsidDTE); + + if(SUCCEEDED(hr)) + { + IDispatch * pDTE; + hr = CoCreateInstance(clsidDTE, NULL, CLSCTX_ALL, IID_IDispatch, (void **)(void *)&pDTE); + + if(SUCCEEDED(hr)) + { + VARIANT varProjectEngine = GetDTEProjectEngine(hr, pDTE); + VARIANT varPlatforms = dispPropGet(hr, V_DISPATCH(&varProjectEngine), OLESTR("Platforms"), VT_DISPATCH); + VARIANT varCount = dispPropGet(hr, V_DISPATCH(&varPlatforms), OLESTR("Count"), VT_I4); + VARIANT varI; + VariantInit(&varI); + V_VT(&varI) = VT_I4; + + for(V_I4(&varI) = 1; V_I4(&varI) <= V_I4(&varCount); ++ V_I4(&varI)) + { + VARIANT varPlatform = dispInvoke(hr, V_DISPATCH(&varPlatforms), varI, VT_DISPATCH); + + if(IsVCPlatformSupported(hr, arch, V_DISPATCH(&varPlatform))) + { + VARIANT varPlatformName = dispPropGet(hr, V_DISPATCH(&varPlatform), OLESTR("Name"), VT_BSTR); + VARIANT varPath = GetDTEPlatformPath(hr, pDTE, V_BSTR(&varPlatformName), OLESTR("ExecutableDirectories")); + VARIANT varInclude = GetDTEPlatformPath(hr, pDTE, V_BSTR(&varPlatformName), OLESTR("IncludeDirectories")); + VARIANT varLib = GetDTEPlatformPath(hr, pDTE, V_BSTR(&varPlatformName), OLESTR("LibraryDirectories")); + + ProcessVCPlatform(hr, arch, wantCompiler, wantLinker, V_DISPATCH(&varProjectEngine), V_DISPATCH(&varPlatform), V_BSTR(&varPath), V_BSTR(&varInclude), V_BSTR(&varLib)); + + VariantClear(&varLib); + VariantClear(&varInclude); + VariantClear(&varPath); + VariantClear(&varPlatformName); + } + + VariantClear(&varPlatform); + } + + VariantClear(&varI); + VariantClear(&varCount); + VariantClear(&varPlatforms); + VariantClear(&varProjectEngine); + + pDTE->Release(); + } + } + + // TODO: print an error message here + } + + hr = S_OK; + } + else if(hr == HRESULT_FROM_WIN32(ERROR_NO_MORE_ITEMS)) + { + hr = S_OK; + break; + } + else + break; + } + } + } + + OleUninitialize(); + } +} + +const TCHAR * GetDDKArchPath(const std::string& arch) +{ + if(arch == "i386") + return TEXT("x86"); + else if(arch == "amd64") + return TEXT("amd64"); + else + return NULL; +} + +void EnumerateDDKTools(const std::string& arch, bool wantCompiler, bool wantLinker) +{ + const TCHAR * pszArchPath = GetDDKArchPath(arch); + + if(pszArchPath == NULL) + return; + + HRESULT hr; + + HKEY hkDDK; + hr = HRESULT_FROM_WIN32(RegOpenKeyEx(HKEY_LOCAL_MACHINE, TEXT("SOFTWARE\\Microsoft\\WINDDK"), 0, KEY_ENUMERATE_SUB_KEYS, &hkDDK)); + + if(SUCCEEDED(hr)) + { + for(DWORD i = 0; ; ++ i) + { + TCHAR szDDKVersion[255 + ARRAYSIZE(TEXT("\\Setup"))]; + DWORD cchDDKVersion = ARRAYSIZE(szDDKVersion); + + hr = HRESULT_FROM_WIN32(RegEnumKeyEx(hkDDK, i, szDDKVersion, &cchDDKVersion, NULL, NULL, NULL, NULL)); + + if(SUCCEEDED(hr)) + { + memcpy(szDDKVersion + cchDDKVersion, TEXT("\\Setup"), sizeof(TEXT("\\Setup"))); + + HKEY hkDDKVersion; + hr = HRESULT_FROM_WIN32(RegOpenKeyEx(hkDDK, szDDKVersion, 0, KEY_QUERY_VALUE, &hkDDKVersion)); + + if(SUCCEEDED(hr)) + { + TCHAR szDDKPath[MAX_PATH]; + DWORD cbDDKPath = sizeof(szDDKPath); + DWORD dwType = 0; + + hr = HRESULT_FROM_WIN32(RegQueryValueEx(hkDDKVersion, TEXT("BUILD"), NULL, &dwType, reinterpret_cast(szDDKPath), &cbDDKPath)); + + if(SUCCEEDED(hr) && dwType == REG_SZ) + { +#if defined(_X86_) + static const TCHAR * const a_szBinPaths[] = { TEXT("x86") }; +#elif defined(_AMD64_) + // Prefer native tools, fall back on x86 if necessary + static const TCHAR * const a_szBinPaths[] = { TEXT("amd64"), TEXT("x86") }; +#elif defined(_IA64_) + // Prefer native tools, fall back on x86 if necessary + static const TCHAR * const a_szBinPaths[] = { TEXT("ia64"), TEXT("x86") }; +#endif + szDDKPath[cbDDKPath / sizeof(TCHAR)] = 0; + std::basic_string strDDKPath(szDDKPath); + strDDKPath += TEXT("\\bin\\"); + + std::basic_string::size_type cchCutoff = strDDKPath.length(); + + for(unsigned i = 0; i < ARRAYSIZE(a_szBinPaths); ++ i) + { + strDDKPath.resize(cchCutoff); + strDDKPath += a_szBinPaths[i]; + strDDKPath += TEXT("\\"); + strDDKPath += pszArchPath; + + cl_version clVersion; + link_version linkVersion; + + if(wantCompiler) + clVersion = CheckClVersion(arch, strDDKPath.c_str()); + + if(wantLinker) + linkVersion = CheckLinkVersion(arch, strDDKPath.c_str()); + + if((!wantCompiler || (clVersion && clVersion > msCompilerVersion)) && (!wantLinker || (linkVersion && linkVersion > msLinkerVersion))) + { + std::string strPath; + CharsToString(hr, strPath, strDDKPath.c_str(), strDDKPath.c_str() + strDDKPath.length()); + + if(SUCCEEDED(hr)) + { + if(wantCompiler) + { + msCompilerVersion = clVersion; + msCompilerPath = strPath; + msCompilerIncludeDirs.clear(); + //msCompilerSource; // TODO: fill this in + } + + if(wantLinker) + { + msLinkerVersion = linkVersion; + msLinkerPath = strPath; + msLinkerLibDirs.clear(); + //msLinkerSource; // TODO: fill this in + } + } + else + break; + } + } + } + + RegCloseKey(hkDDKVersion); + } + } + else if(hr == HRESULT_FROM_WIN32(ERROR_NO_MORE_ITEMS)) + { + hr = S_OK; + break; + } + + if(FAILED(hr)) + break; + } + + RegCloseKey(hkDDK); + } +} + +void DetectEnvironmentVCTools(const std::string& arch, bool wantCompiler, bool wantLinker) +{ + cl_version clVersion; + link_version linkVersion; + + if(wantCompiler) + clVersion = CheckClVersion(arch); + + if(wantLinker) + linkVersion = CheckLinkVersion(arch); + + if((!wantCompiler || (clVersion && clVersion > msCompilerVersion)) && (!wantLinker || (linkVersion && linkVersion > msLinkerVersion))) + { + if(wantCompiler) + { + msCompilerVersion = clVersion; + msCompilerPath.clear(); + msCompilerIncludeDirs = SplitPath(get_env("INCLUDE")); + msCompilerSource = "environment"; + } + + if(wantLinker) + { + msLinkerVersion = linkVersion; + msLinkerPath.clear(); + msLinkerLibDirs = SplitPath(get_env("LIB")); + msLinkerSource = "environment"; + } + } +} + +void EnumerateMicrosoftTools(const std::string& arch, bool wantCompiler, bool wantLinker) +{ + DetectEnvironmentVCTools(arch, wantCompiler, wantLinker); + + if(!msCompilerVersion || !msLinkerVersion) + { + EnumerateVCTools(arch, wantCompiler, wantLinker, OLESTR("VisualStudio")); + EnumerateVCTools(arch, wantCompiler, wantLinker, OLESTR("VCExpress")); + EnumerateDDKTools(arch, wantCompiler, wantLinker); + } +} + +} + +bool +MingwBackend::DetectMicrosoftCompiler ( std::string& version, std::string& path ) +{ + bool wantCompiler = ProjectNode.configuration.Compiler == MicrosoftC; + bool wantLinker = ProjectNode.configuration.Linker == MicrosoftLink; + + if ( wantCompiler && !msCompilerVersion ) + EnumerateMicrosoftTools ( Environment::GetArch(), wantCompiler, wantLinker ); + + bool ret = wantCompiler && msCompilerVersion; + + if ( ret ) + { + compilerNeedsHelper = true; + compilerCommand = "cl"; + + std::ostringstream compilerVersion; + compilerVersion << msCompilerVersion; + version = compilerVersion.str(); + path = msCompilerPath; + } + + return ret; +} + +bool +MingwBackend::DetectMicrosoftLinker ( std::string& version, std::string& path ) +{ + bool wantCompiler = ProjectNode.configuration.Compiler == MicrosoftC; + bool wantLinker = ProjectNode.configuration.Linker == MicrosoftLink; + + if ( wantLinker && !msLinkerVersion ) + EnumerateMicrosoftTools ( Environment::GetArch(), wantCompiler, wantLinker ); + + bool ret = wantLinker && msLinkerVersion; + + if ( ret ) + { + binutilsNeedsHelper = msLinkerPath.length() != 0; + binutilsCommand = "link"; + + std::ostringstream linkerVersion; + linkerVersion << msLinkerVersion; + version = linkerVersion.str(); + path = msLinkerPath; + } + + return ret; +} + +#endif + +// TODO? attempt to support Microsoft tools on non-Windows? +#if !defined(WIN32) + +#include "../../pch.h" + +#include "mingw.h" + +bool +MingwBackend::DetectMicrosoftCompiler ( std::string&, std::string& ) +{ + return false; +} + +bool +MingwBackend::DetectMicrosoftLinker ( std::string&, std::string& ) +{ + return false; +} + +#endif + +// EOF diff --git a/tools/rbuild/backend/mingw/pch_detection.h b/tools/rbuild/backend/mingw/pch_detection.h new file mode 100644 index 00000000000..3c26c8e4494 --- /dev/null +++ b/tools/rbuild/backend/mingw/pch_detection.h @@ -0,0 +1,17 @@ +/* + * This program is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation; either version 2 of the License, or + * (at your option) any later version. + * + * This program 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 General Public License for more details. + * + * You should have received a copy of the GNU General Public License along + * with this program; if not, write to the Free Software Foundation, Inc., + * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. + */ + +/* This file is intentionally left empty */ diff --git a/tools/rbuild/backend/mingw/pipe_detection.c b/tools/rbuild/backend/mingw/pipe_detection.c new file mode 100644 index 00000000000..229c4a56d42 --- /dev/null +++ b/tools/rbuild/backend/mingw/pipe_detection.c @@ -0,0 +1,23 @@ +/* + * Copyright (C) 2005 Casper S. Hornstrup + * + * This program is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation; either version 2 of the License, or + * (at your option) any later version. + * + * This program 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 General Public License for more details. + * + * You should have received a copy of the GNU General Public License along + * with this program; if not, write to the Free Software Foundation, Inc., + * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. + */ + +int +main ( int argc, char** argv ) +{ + return 0; +} diff --git a/tools/rbuild/backend/mingw/proxymakefile.cpp b/tools/rbuild/backend/mingw/proxymakefile.cpp new file mode 100644 index 00000000000..9e3c9dbf0b5 --- /dev/null +++ b/tools/rbuild/backend/mingw/proxymakefile.cpp @@ -0,0 +1,127 @@ +/* + * Copyright (C) 2005 Casper S. Hornstrup + * + * This program is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation; either version 2 of the License, or + * (at your option) any later version. + * + * This program 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 General Public License for more details. + * + * You should have received a copy of the GNU General Public License along + * with this program; if not, write to the Free Software Foundation, Inc., + * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. + */ +#include "../../pch.h" + +#include "mingw.h" +#include + +using std::string; +using std::vector; + +ProxyMakefile::ProxyMakefile ( const Project& project ) + : project ( project ) +{ +} + +ProxyMakefile::~ProxyMakefile () +{ +} + +bool +ProxyMakefile::GenerateProxyMakefile ( const Module& module ) +{ + return module.output->directory == OutputDirectory; +} + +void +ProxyMakefile::GenerateProxyMakefiles ( bool verbose, + string outputTree ) +{ + for ( std::map::const_iterator p = project.modules.begin (); p != project.modules.end (); ++ p ) + { + Module& module = *p->second; + if ( !module.enabled ) + continue; + if ( !GenerateProxyMakefile ( module ) ) + continue; + GenerateProxyMakefileForModule ( module, + verbose, + outputTree ); + } +} + +string +ProxyMakefile::GeneratePathToParentDirectory ( int numberOfParentDirectories ) +{ + string path = ""; + for ( int i = 0; i < numberOfParentDirectories; i++ ) + { + if ( path != "" ) + path += sSep; + path += ".."; + } + return path; +} + +string +ProxyMakefile::GetPathToTopDirectory ( Module& module ) +{ + int numberOfDirectories = 1; + string basePath = module.output->relative_path; + for ( size_t i = 0; i < basePath.length (); i++ ) + { + if ( basePath[i] == cSep ) + numberOfDirectories++; + } + return GeneratePathToParentDirectory ( numberOfDirectories ); +} + +void +ProxyMakefile::GenerateProxyMakefileForModule ( Module& module, + bool verbose, + string outputTree ) +{ + char* buf; + char* s; + + if ( verbose ) + { + printf ( "\nGenerating proxy makefile for %s", + module.name.c_str () ); + } + + string base; + string pathToTopDirectory; + if ( outputTree.length () > 0 ) + { + base = outputTree + sSep + module.output->relative_path; + pathToTopDirectory = working_directory; + } + else + { + base = module.output->relative_path; + pathToTopDirectory = GetPathToTopDirectory ( module ); + } + string proxyMakefile = NormalizeFilename ( base + sSep + "GNUmakefile" ); + string defaultTarget = module.name; + + buf = (char*) malloc ( 10*1024 ); + if ( buf == NULL ) + throw OutOfMemoryException (); + + s = buf; + s = s + sprintf ( s, "# This file is automatically generated.\n" ); + s = s + sprintf ( s, "\n" ); + s = s + sprintf ( s, "TOP = %s\n", pathToTopDirectory.c_str () ); + s = s + sprintf ( s, "DEFAULT = %s\n", defaultTarget.c_str () ); + s = s + sprintf ( s, "include $(TOP)/proxy.mak\n" ); + + FileSupportCode::WriteIfChanged ( buf, proxyMakefile, true ); + + free ( buf ); +} diff --git a/tools/rbuild/backend/mingw/rule.cpp b/tools/rbuild/backend/mingw/rule.cpp new file mode 100644 index 00000000000..12199dc03a7 --- /dev/null +++ b/tools/rbuild/backend/mingw/rule.cpp @@ -0,0 +1,157 @@ +/* + * Copyright (C) 2008 Hervé Poussineau + * + * This program is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation; either version 2 of the License, or + * (at your option) any later version. + * + * This program 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 General Public License for more details. + * + * You should have received a copy of the GNU General Public License along + * with this program; if not, write to the Free Software Foundation, Inc., + * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. + */ + +#include "../../rbuild.h" +#include "modulehandler.h" +#include "rule.h" + +using std::string; + +static void +ReplaceVariable( string& str, + const string& name, + const string& value ) +{ + size_t i = str.find ( name ); + while ( i != string::npos ) + { + str.replace ( i, name.length (), value ); + i = str.find ( name ); + } +} + +static std::string +FixString ( const string& str, Backend *backend, const Module& module, const FileLocation *source, + const std::string& additional_dependencies, const std::string& compiler_flags, + const std::map& custom_variables ) +{ + string ret = str; + + for ( std::map::const_iterator p = custom_variables.begin(); p != custom_variables.end(); ++ p ) + { + ReplaceVariable ( ret, "$(" + p->first + ")", p->second ); + } + + string dep = additional_dependencies; + + dep += " " + module.xmlbuildFile; + + if ( source ) + { + ReplaceVariable ( ret, "$(source_noext)", ReplaceExtension ( backend->GetFullName ( *source ), "" ) ); + ReplaceVariable ( ret, "$(source)", backend->GetFullName ( *source ) ); + ReplaceVariable ( ret, "$(source_dir)", source->relative_path ); + ReplaceVariable ( ret, "$(source_name)", source->name ); + ReplaceVariable ( ret, "$(source_name_noext)", ReplaceExtension ( source->name , "" ) ); + ReplaceVariable ( ret, "$(source_path)", backend->GetFullPath ( *source ) ); + ReplaceVariable ( ret, "$(intermediate_dir)", backend->GetFullPath ( FileLocation ( IntermediateDirectory, source->relative_path, "" ) ) ); + ReplaceVariable ( ret, "$(intermediate_path_noext)", ReplaceExtension ( backend->GetFullName ( FileLocation ( IntermediateDirectory, source->relative_path, source->name ) ), "" ) ); + ReplaceVariable ( ret, "$(intermediate_path_unique)", ReplaceExtension ( backend->GetFullName ( FileLocation ( IntermediateDirectory, source->relative_path, source->name ) ), "" ) + "_" + module.name ); + } + ReplaceVariable ( ret, "$(dependencies)", dep ); + ReplaceVariable ( ret, "$(bare_dependencies)", additional_dependencies ); + ReplaceVariable ( ret, "$(module_name)", module.name ); + ReplaceVariable ( ret, "$(module_dllname)", module.GetDllName() ); + ReplaceVariable ( ret, "$(module_output)", GetTargetMacro ( module, true ) ); + ReplaceVariable ( ret, "$(SEP)", sSep ); + + ReplaceVariable ( ret, "$(compiler_flags)", compiler_flags ); + + return ret; +} + +Rule::Rule( const std::string& command, const char *generatedFile1, ... ) + : command ( command ) +{ + va_list ap; + const char *s; + + s = generatedFile1; + va_start ( ap, generatedFile1 ); + while ( s ) + { + generatedFiles.push_back ( s ); + s = va_arg ( ap, const char* ); + } + va_end ( ap ); +} + + +void Rule::Execute ( FILE *outputFile, + MingwBackend *backend, + const Module& module, + const FileLocation *source, + string_list& clean_files, + const std::string& additional_dependencies, + const std::string& compiler_flags, + const std::map& custom_variables ) const +{ + string cmd = FixString ( command, backend, module, source, additional_dependencies, compiler_flags, custom_variables ); + + fprintf ( outputFile, "%s", cmd.c_str () ); + + for ( size_t i = 0; i < generatedFiles.size (); i++ ) + { + string file = FixString ( generatedFiles[i], backend, module, source, "", "", custom_variables ); + if ( file[file.length () - 1] != cSep ) + { + clean_files.push_back ( file ); + continue; + } + + if ( file[0] != '$' ) + throw InvalidOperationException ( __FILE__, + __LINE__, + "Invalid directory %s.", + file.c_str () ); + + size_t pos = file.find_first_of ( cSep ); + string relative_path = file.substr ( pos + 1, file.length () - pos - 2 ); + string dir = file.substr ( 0, pos ); + if ( dir == "$(INTERMEDIATE)" ) + backend->AddDirectoryTarget ( relative_path, backend->intermediateDirectory ); + else if ( dir == "$(OUTPUT)" ) + backend->AddDirectoryTarget ( relative_path, backend->outputDirectory ); + else if ( dir == "$(INSTALL)" ) + backend->AddDirectoryTarget ( relative_path, backend->installDirectory ); + else + throw InvalidOperationException ( __FILE__, + __LINE__, + "Invalid directory %s.", + dir.c_str () ); + } +} + + +void Rule::Execute ( FILE *outputFile, + MingwBackend *backend, + const Module& module, + const FileLocation *source, + string_list& clean_files, + const std::string& additional_dependencies, + const std::string& compiler_flags ) const +{ + this->Execute ( outputFile, + backend, + module, + source, + clean_files, + additional_dependencies, + compiler_flags, + std::map() ); +} diff --git a/tools/rbuild/backend/mingw/rule.h b/tools/rbuild/backend/mingw/rule.h new file mode 100644 index 00000000000..1c9c9a5bf86 --- /dev/null +++ b/tools/rbuild/backend/mingw/rule.h @@ -0,0 +1,47 @@ +/* + * Copyright (C) 2008 Hervé Poussineau + * + * This program is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation; either version 2 of the License, or + * (at your option) any later version. + * + * This program 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 General Public License for more details. + * + * You should have received a copy of the GNU General Public License along + * with this program; if not, write to the Free Software Foundation, Inc., + * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. + */ + +#pragma once + +#include "mingw.h" + +#include + +class Rule +{ +public: + Rule ( const std::string& command, const char *generatedFile1, ... ); + void Execute ( FILE *outputFile, + MingwBackend *backend, + const Module& module, + const FileLocation *source, + string_list& clean_files, + const std::string& additional_dependencies = "", + const std::string& compiler_flags = "" ) const; + void Execute ( FILE *outputFile, + MingwBackend *backend, + const Module& module, + const FileLocation *source, + string_list& clean_files, + const std::string& additional_dependencies, + const std::string& compiler_flags, + const std::map& custom_variables ) const; +private: + const std::string command; + string_list generatedFiles; +}; diff --git a/tools/rbuild/backend/mingw/rules.mak b/tools/rbuild/backend/mingw/rules.mak new file mode 100644 index 00000000000..c1eb6367a33 --- /dev/null +++ b/tools/rbuild/backend/mingw/rules.mak @@ -0,0 +1,364 @@ +RBUILD_fullpath=${subst <<<,,${subst $(SEP)<<<,,${subst /,$(SEP),${subst \\,$(SEP),$(1)}}<<<}} + +RBUILD_compress_prefix=${subst >>>,,${subst >>>$($(2)),$$($(2)),>>>$(1)}} +RBUILD_compress_prefixes=${call RBUILD_compress_prefix,${call RBUILD_compress_prefix,${call RBUILD_compress_prefix,${call RBUILD_compress_prefix,${call RBUILD_compress_prefix,$(1),INTERMEDIATE},OUTPUT},CDOUTPUT},TEMPORARY},INSTALL} + +RBUILD_strip_prefix=${subst >>>,,${subst >>>$($(2)),,>>>$(1)}} +RBUILD_strip_prefixes=${subst >>>,,${subst >>>$(SEP),,>>>${call RBUILD_strip_prefix,${call RBUILD_strip_prefix,${call RBUILD_strip_prefix,${call RBUILD_strip_prefix,${call RBUILD_strip_prefix,$(1),INTERMEDIATE},OUTPUT},CDOUTPUT},TEMPORARY},INSTALL}}} + +#(source) +RBUILD_intermediate_path_noext=${call RBUILD_intermediate_dir,$(1)}$(SEP)$(basename $(notdir $(1))) +RBUILD_output_path_noext=${call RBUILD_output_dir,$(1)}$(SEP)$(basename $(notdir $(1))) + +#(module, source) +RBUILD_intermediate_path_unique=${call RBUILD_intermediate_path_noext,$(2)}_$(1) +RBUILD_output_dir=${call RBUILD_output_path_noext,$(2)}_$(1) + +#(source) +RBUILD_intermediate_dir=${call RBUILD_fullpath,$(value INTERMEDIATE)$(SEP)$(dir ${call RBUILD_strip_prefixes,$(1)})} +RBUILD_output_dir=${call RBUILD_fullpath,$(value OUTPUT)$(SEP)$(dir ${call RBUILD_strip_prefixes,$(1)})} + +#(source) +RBUILD_name=$(basename $(notdir $(1))) +RBUILD_noext=$(dir $(1))$(basename $(notdir $(1))) + +#(source) +RBUILD_dir=${call RBUILD_fullpath,$(dir ${call RBUILD_compress_prefixes,$(1)})} + +#(module, flags, includes, compiler, prefix) +RBUILD_compiler_flags=\ +$$(BUILTIN_$(5)$(4)FLAGS) \ +$$(PROJECT_$(5)$(4)FLAGS) \ +$$(MODULETYPE$($(1)_TYPE)_$(4)FLAGS) \ +$$($(1)_$(4)FLAGS) \ +$(2) \ +$$($(5)$(4)FLAGS) + +#(module, flags, includes, compiler, prefix) +RBUILD_compiler_flags_with_cpp=\ +$$($(5)$(4)INCLUDES) $$(CPPINCLUDES) \ +$(3) \ +$$($(1)_$(4)INCLUDES) $$($(1)_CPPINCLUDES) \ +$$(MODULETYPE$($(1)_TYPE)_$(4)INCLUDES) $$(MODULETYPE$($(1)_TYPE)_CPPINCLUDES) \ +$$(PROJECT_$(5)$(4)INCLUDES) $$(PROJECT_$(5)CPPINCLUDES) \ +$$(BUILTIN_$(5)$(4)INCLUDES) $$(BUILTIN_$(5)CPPINCLUDES) \ +$$(BUILTIN_$(5)CPPDEFINES) $$(BUILTIN_$(5)CPPFLAGS) $$(BUILTIN_$(5)$(4)DEFINES) $$(BUILTIN_$(5)$(4)FLAGS) \ +$$(PROJECT_$(5)CPPDEFINES) $$(PROJECT_$(5)CPPFLAGS) $$(PROJECT_$(5)$(4)DEFINES) $$(PROJECT_$(5)$(4)FLAGS) \ +$$(MODULETYPE$($(1)_TYPE)_CPPDEFINES) $$(MODULETYPE$($(1)_TYPE)_CPPFLAGS) $$(MODULETYPE$($(1)_TYPE)_$(4)DEFINES) $$(MODULETYPE$($(1)_TYPE)_$(4)FLAGS) \ +$$($(1)_CPPDEFINES) $$($(1)_CPPFLAGS) $$($(1)_$(4)DEFINES) $$($(1)_$(4)FLAGS) \ +$(2) \ +$$(CPPDEFINES) $$(CPPFLAGS) $$($(5)$(4)DEFINES) $$($(5)$(4)FLAGS) + +#(module, flags, includes, compiler, prefix) +RBUILD_compiler_flags_builtin_cpp=\ +$$($(5)$(4)INCLUDES) $$(CPPINCLUDES) \ +$(3) \ +$$($(1)_$(4)INCLUDES) $$($(1)_CPPINCLUDES) \ +$$(MODULETYPE$($(1)_TYPE)_$(4)INCLUDES) $$(MODULETYPE$($(1)_TYPE)_CPPINCLUDES) \ +$$(PROJECT_$(5)$(4)INCLUDES) $$(PROJECT_$(5)CPPINCLUDES) \ +$$(BUILTIN_$(5)$(4)INCLUDES) $$(BUILTIN_$(5)CPPINCLUDES) \ +$$(BUILTIN_$(5)CPPDEFINES) $$(BUILTIN_$(5)$(4)DEFINES) $$(BUILTIN_$(5)$(4)FLAGS) \ +$$(PROJECT_$(5)CPPDEFINES) $$(PROJECT_$(5)$(4)DEFINES) $$(PROJECT_$(5)$(4)FLAGS) \ +$$(MODULETYPE$($(1)_TYPE)_CPPDEFINES) $$(MODULETYPE$($(1)_TYPE)_$(4)DEFINES) $$(MODULETYPE$($(1)_TYPE)_$(4)FLAGS) \ +$$($(1)_CPPDEFINES) $$($(1)_$(4)DEFINES) $$($(1)_$(4)FLAGS) \ +$(2) \ +$$(CPPDEFINES) $$($(5)$(4)DEFINES) $$($(5)$(4)FLAGS) + +#(module, flags, includes, compiler, prefix) +RBUILD_compiler_flags_with_includes=\ +$$($(5)$(4)INCLUDES) \ +$(3) \ +$$($(1)_$(4)INCLUDES) $$($(1)_CPPINCLUDES) \ +$$(MODULETYPE$($(1)_TYPE)_$(4)INCLUDES) \ +$$(PROJECT_$(5)$(4)INCLUDES) \ +$$(BUILTIN_$(5)$(4)INCLUDES) \ +$$(BUILTIN_$(5)$(4)FLAGS) \ +$$(PROJECT_$(5)$(4)FLAGS) \ +$$(MODULETYPE$($(1)_TYPE)_$(4)FLAGS) \ +$$($(1)_$(4)FLAGS) \ +$(2) \ +$$($(5)$(4)FLAGS) + +#(module, flags, includes, compiler, prefix) +RBUILD_compiler_flags_cpp=\ +$$($(5)$(4)INCLUDES) $$(CPPINCLUDES) \ +$(3) \ +$$($(1)_$(4)INCLUDES) $$($(1)_CPPINCLUDES) \ +$$(MODULETYPE$($(1)_TYPE)_$(4)INCLUDES) $$(MODULETYPE$($(1)_TYPE)_CPPINCLUDES) \ +$$(PROJECT_$(5)$(4)INCLUDES) $$(PROJECT_$(5)CPPINCLUDES) \ +$$(BUILTIN_$(5)$(4)INCLUDES) $$(BUILTIN_$(5)CPPINCLUDES) \ +$$(BUILTIN_$(5)CPPFLAGS) $$(BUILTIN_$(5)CPPDEFINES) $$(BUILTIN_$(5)$(4)DEFINES) \ +$$(PROJECT_$(5)CPPFLAGS) $$(PROJECT_$(5)CPPDEFINES) $$(PROJECT_$(5)$(4)DEFINES) \ +$$(MODULETYPE$($(1)_TYPE)_CPPFLAGS) $$(MODULETYPE$($(1)_TYPE)_CPPDEFINES) $$(MODULETYPE$($(1)_TYPE)_$(4)DEFINES) \ +$$($(1)_CPPFLAGS) $$($(1)_CPPDEFINES) $$($(1)_$(4)DEFINES) \ +$(2) \ +$$(CPPFLAGS) $$(CPPDEFINES) $$($(5)$(4)DEFINES) + +#(module, flags, includes) +RBUILD_cflags=${call RBUILD_compiler_flags_with_cpp,$(1),$(2),$(3),C} +RBUILD_cxxflags=${call RBUILD_compiler_flags_with_cpp,$(1),$(2),$(3),CXX} +#~ RBUILD_asflags=${call RBUILD_compiler_flags_with_cpp,$(1),$(2),$(3),AS} +RBUILD_asflags=${call RBUILD_compiler_flags_builtin_cpp,$(1),$(2),$(3),AS} +RBUILD_nasmflags=${call RBUILD_compiler_flags_builtin_cpp,$(1),$(2),$(3),NASM} +RBUILD_rc_pp_flags=${call RBUILD_compiler_flags_cpp,$(1),-DRC_INVOKED=1 -D__WIN32__=1 -D__FLAT__=1,$(3) -I.,RC} +RBUILD_rc_flags=${call RBUILD_compiler_flags_with_includes,$(1),$(2),$(3),RC} +RBUILD_spec_pp_flags=${call RBUILD_compiler_flags_cpp,$(1),,$(3),SPEC} +RBUILD_spec_flags=${call RBUILD_compiler_flags,$(1),$(2),,SPEC} +RBUILD_midlflags=${call RBUILD_compiler_flags_builtin_cpp,$(1),$(2),$(3),MIDL} +RBUILD_host_cflags=${call RBUILD_compiler_flags_with_cpp,$(1),$(2),$(3),C,HOST_} +RBUILD_host_cxxflags=${call RBUILD_compiler_flags_with_cpp,$(1),$(2),$(3),CXX,HOST_} +RBUILD_ldflags=${call RBUILD_compiler_flags,$(1),$(2),,LD} + +RCFLAG_UNICODE:=-DUNICODE -D_UNICODE + +BUILTIN_ASDEFINES+= -D__ASM__ +BUILTIN_RCFLAGS+= --nostdinc +BUILTIN_RCDEFINES+= -DRC_INVOKED +BUILTIN_NASMFLAGS+= -f win32 + +#(module, source, dependencies, cflags, output) +define RBUILD_GAS + +$(2): $${$(1)_precondition} + +ifeq ($(ROS_BUILDDEPS),full) + +$(5).d: $(2) | ${call RBUILD_dir,$(5)} + $$(ECHO_DEPENDS) + $${gas} -MF $$@ ${call RBUILD_asflags,$(1),$(4)} -M -MP -MT $$@ $$< + +-include $(5).d + +$(5): $(2) $(5).d $(3) | ${call RBUILD_dir,$(5)} + $$(ECHO_AS) + $${gas} -o $$@ ${call RBUILD_asflags,$(1),$(4)} -c $$< + +else + +$(5): $(2) $(3) | ${call RBUILD_dir,$(5)} + $$(ECHO_AS) + $${gas} -o $$@ ${call RBUILD_asflags,$(1),$(4)} -c $$< + +endif + +endef + +#(module, source, dependencies, cflags) +RBUILD_GAS_RULE=${call RBUILD_GAS,$(1),$(2),$(3),$(4),${call RBUILD_intermediate_path_unique,$(1),$(2)}.o} + +#(module, source, dependencies, cflags, output) +define RBUILD_NASM + +$(2): $${$(1)_precondition} + +$(5): $(2) $(3) | ${call RBUILD_dir,$(5)} + $$(ECHO_NASM) + $${nasm} -o $$@ ${call RBUILD_nasmflags,$(1),$(4)} $$< + +endef + +# TODO: module_dllname -> ${call RBUILD_module_dllname,$(1)} + +#(module, source, dependencies, cflags, module_dllname, output) +define RBUILD_WINEBUILD_DEF + +$(6): $(2) $$(winebuild_TARGET) | ${call RBUILD_intermediate_dir,$(6)} + $$(ECHO_WINEBLD) + $$(Q)$$(winebuild_TARGET) $$(WINEBUILD_FLAGS) -o $$@ --def -E $$< --filename $(5) ${call RBUILD_spec_flags,$(1),$(4)} + +endef + +#(module, source, dependencies, cflags, module_dllname, output) +define RBUILD_WINEBUILD_STUBS + +$(6): $(2) $$(winebuild_TARGET) | ${call RBUILD_intermediate_dir,$(6)} + $$(ECHO_WINEBLD) + $$(Q)$$(winebuild_TARGET) $$(WINEBUILD_FLAGS) -o $$@ --pedll $$< --filename $(5) ${call RBUILD_spec_flags,$(1),$(4)} + +endef + +#(module, source, dependencies, cflags, module_dllname) +define RBUILD_WINEBUILD_WITH_CPP_RULE + +ifeq ($$(ROS_BUILDDEPS),full) + +${call RBUILD_DEPENDS,$(1),$(2),,${call RBUILD_spec_pp_flags,$(1),$(4)},${call RBUILD_intermediate_path_unique,$(1),$(2)}.spec.d} +-include ${call RBUILD_intermediate_path_unique,$(1),$(2)}.spec.d + +${call RBUILD_CPP,$(1),$(2),${call RBUILD_intermediate_path_unique,$(1),$(2)}.spec.d $(3),${call RBUILD_spec_pp_flags,$(1),$(4)},${call RBUILD_intermediate_path_unique,$(1),$(2)}.spec} + +else + +${call RBUILD_CPP,$(1),$(2),$(3),${call RBUILD_spec_pp_flags,$(1),$(4)},${call RBUILD_intermediate_path_unique,$(1),$(2)}.spec} + +endif + +${call RBUILD_WINEBUILD_DEF,$(1),${call RBUILD_intermediate_path_unique,$(1),$(2)}.spec,,$(4),$(5),${call RBUILD_intermediate_path_unique,$(1),$(2)}.auto.def} +${call RBUILD_WINEBUILD_STUBS,$(1),${call RBUILD_intermediate_path_unique,$(1),$(2)}.spec,,$(4),$(5),${call RBUILD_intermediate_path_unique,$(1),$(2)}.stubs.c} +${call RBUILD_CC,$(1),${call RBUILD_intermediate_path_unique,$(1),$(2)}.stubs.c,,,${call RBUILD_intermediate_path_unique,$(1),$(2)}.stubs.o} + +endef + +#(module, source, dependencies, cflags, module_dllname) +define RBUILD_WINEBUILD_RULE + +${call RBUILD_WINEBUILD_DEF,$(1),$(2),$(3),$(4),$(5),${call RBUILD_intermediate_path_unique,$(1),$(2)}.auto.def} +${call RBUILD_WINEBUILD_STUBS,$(1),$(2),$(3),$(4),$(5),${call RBUILD_intermediate_path_unique,$(1),$(2)}.stubs.c} +${call RBUILD_CC,$(1),${call RBUILD_intermediate_path_unique,$(1),$(2)}.stubs.c,,,${call RBUILD_intermediate_path_unique,$(1),$(2)}.stubs.o} + +endef + +# FIXME: wrc butchers localized strings and doesn't implement -M, so we have to use an external preprocessor +#(module, source, dependencies, cflags) +define RBUILD_WRC_RULE + +$(2): $${$(1)_precondition} + +ifeq ($$(ROS_BUILDDEPS),full) + +${call RBUILD_DEPENDS,$(1),$(2),,${call RBUILD_rc_pp_flags,$(1),$(4)},${call RBUILD_intermediate_path_unique,$(1),$(2)}.res.d} +-include ${call RBUILD_intermediate_path_unique,$(1),$(2)}.coff.d + +${call RBUILD_intermediate_path_unique,$(1),$(2)}.res: $(2) ${call RBUILD_intermediate_path_unique,$(1),$(2)}.res.d $(3) $$(wrc_TARGET) | ${call RBUILD_intermediate_dir,$(2)} + $$(ECHO_RC) + ${call RBUILD_PIPE_CPP,$$<,${call RBUILD_rc_pp_flags,$(1),$(4)}} | $$(wrc_TARGET) -o $$@ ${call RBUILD_rc_flags,$(1),$(4),-I${call RBUILD_dir,$(2)}} + +else + +${call RBUILD_intermediate_path_unique,$(1),$(2)}.res: $(2) $(3) $$(wrc_TARGET) | ${call RBUILD_intermediate_dir,$(2)} + $$(ECHO_RC) +ifeq ($(ARCH),amd64) + $$(Q)$$(wrc_TARGET) --input=$$< -o $$@ ${call RBUILD_rc_pp_flags,$(1),$(4)} ${call RBUILD_rc_flags,$(1),$(4),-I${call RBUILD_dir,$(2)}} +else + ${call RBUILD_PIPE_CPP,$$<,${call RBUILD_rc_pp_flags,$(1),$(4)}} | $$(wrc_TARGET) -o $$@ ${call RBUILD_rc_flags,$(1),$(4),-I${call RBUILD_dir,$(2)}} +endif + +endif + +${call RBUILD_intermediate_path_unique,$(1),$(2)}.coff: ${call RBUILD_intermediate_path_unique,$(1),$(2)}.res | ${call RBUILD_intermediate_dir,$(2)} + $$(ECHO_CVTRES) + $${windres} -i $$< -o $$@ -J res -O coff + +endef + +define RBUILD_WIDL + +endef + +define RBUILD_WIDL_HEADER_RULE + +$(2): $${$(1)_precondition} + +${call RBUILD_intermediate_path_noext,$(2)}.h: $(2) $(3) $$(widl_TARGET) | ${call RBUILD_intermediate_dir,$(2)} + $$(ECHO_WIDL) + $$(Q)$$(widl_TARGET) ${call RBUILD_midlflags,$(1),$(4),-I${call RBUILD_dir,$(2)}} -h -o $$@ $$< + +endef + +#(module, source, dependencies, cflags) +define RBUILD_WIDL_CLIENT_RULE + +$(2): $${$(1)_precondition} + +${call RBUILD_intermediate_path_noext,$(2)}_c.c ${call RBUILD_intermediate_path_noext,$(2)}_c.h: ${call RBUILD_intermediate_path_noext,$(2)}_c + +${call RBUILD_intermediate_path_noext,$(2)}_c: $(2) $(3) $$(widl_TARGET) | ${call RBUILD_intermediate_dir,$(2)} + $$(ECHO_WIDL) + $$(Q)$$(widl_TARGET) ${call RBUILD_midlflags,$(1),$(4),-I${call RBUILD_dir,$(2)}} -h -H ${call RBUILD_intermediate_path_noext,$(2)}_c.h -c -C ${call RBUILD_intermediate_path_noext,$(2)}_c.c $(2) + $${checkpoint} $$@>$(NUL) + +${call RBUILD_CC,$(1),${call RBUILD_intermediate_path_noext,$(2)}_c.c,,,${call RBUILD_intermediate_path_noext,$(2)}_c.o} + +endef + +#(module, source, dependencies, cflags) +define RBUILD_WIDL_SERVER_RULE + +$(2): $${$(1)_precondition} + +${call RBUILD_intermediate_path_noext,$(2)}_s.c ${call RBUILD_intermediate_path_noext,$(2)}_s.h: ${call RBUILD_intermediate_path_noext,$(2)}_s + +${call RBUILD_intermediate_path_noext,$(2)}_s: $(2) $(3) $$(widl_TARGET) | ${call RBUILD_intermediate_dir,$(2)} + $$(ECHO_WIDL) + $$(Q)$$(widl_TARGET) ${call RBUILD_midlflags,$(1),$(4),-I${call RBUILD_dir,$(2)}} -h -H ${call RBUILD_intermediate_path_noext,$(2)}_s.h -s -S ${call RBUILD_intermediate_path_noext,$(2)}_s.c $(2) + $${checkpoint} $$@>$(NUL) + +${call RBUILD_CC,$(1),${call RBUILD_intermediate_path_noext,$(2)}_s.c,,,${call RBUILD_intermediate_path_noext,$(2)}_s.o} + +endef + +#(module, source, dependencies, cflags) +define RBUILD_WIDL_PROXY_RULE + +$(2): $${$(1)_precondition} + +${call RBUILD_intermediate_path_noext,$(2)}_p.c ${call RBUILD_intermediate_path_noext,$(2)}_p.h: ${call RBUILD_intermediate_path_noext,$(2)}_p + +${call RBUILD_intermediate_path_noext,$(2)}_p: $(2) $(3) $$(widl_TARGET) | ${call RBUILD_intermediate_dir,$(2)} + $$(ECHO_WIDL) + $$(Q)$$(widl_TARGET) ${call RBUILD_midlflags,$(1),$(4),-I${call RBUILD_dir,$(2)}} -h -H ${call RBUILD_intermediate_path_noext,$(2)}_p.h -p -P ${call RBUILD_intermediate_path_noext,$(2)}_p.c $(2) + $${checkpoint} $$@>$(NUL) + +${call RBUILD_CC,$(1),${call RBUILD_intermediate_path_noext,$(2)}_p.c,,,${call RBUILD_intermediate_path_noext,$(2)}_p.o} + +endef + +#(module, source, dependencies, cflags) +define RBUILD_WIDL_INTERFACE_RULE + +$(2): $${$(1)_precondition} + +${call RBUILD_intermediate_path_noext,$(2)}_i.c: $(2) $(3) $$(widl_TARGET) | ${call RBUILD_intermediate_dir,$(2)} + $$(ECHO_WIDL) + $$(Q)$$(widl_TARGET) ${call RBUILD_midlflags,$(1),$(4),-I${call RBUILD_dir,$(2)}} -u -o $$@ $$< + +${call RBUILD_CC,$(1),${call RBUILD_intermediate_path_noext,$(2)}_i.c,,,${call RBUILD_intermediate_path_noext,$(2)}_i.o} + +endef + +# FIXME: this rule sucks +#(module, source, dependencies, cflags, bare_dependencies) +define RBUILD_WIDL_DLLDATA_RULE + +$(2): $(3) ${$(1)_precondition} $$(widl_TARGET) | ${call RBUILD_intermediate_dir,$(2)} + $$(ECHO_WIDL) + $$(Q)$$(widl_TARGET) ${call RBUILD_midlflags,$(1),$(4)} --dlldata-only -o $(2) $(5) + +${call RBUILD_CC,$(1),$(2),,,${call RBUILD_intermediate_path_noext,$(2)}.o} + +endef + +#(module, source, dependencies, cflags) +define RBUILD_WIDL_TLB_RULE + +$(2): $${$(1)_precondition} + +${call RBUILD_intermediate_dir,$(2)}$$(SEP)$(1).tlb: $(2) $(3) $$(widl_TARGET) | ${call RBUILD_intermediate_dir,$(2)} + $$(ECHO_WIDL) + $$(Q)$$(widl_TARGET) ${call RBUILD_midlflags,$(1),$(4),-I${call RBUILD_dir,$(2)}} -t -o $$@ $$< + +endef + +#(module, source, dependencies, cflags) +define RBUILD_HOST_GCC_RULE + +$(2): $${$(1)_precondition} + +${call RBUILD_intermediate_path_unique,$(1),$(2)}.o: $(2) $(3) | ${call RBUILD_intermediate_dir,$(2)} + $$(ECHO_HOSTCC) + $${host_gcc} -o $$@ ${call RBUILD_host_cflags,$(1),$(4)} -c $$< + +endef + +#(module, source, dependencies, cflags) +define RBUILD_HOST_GPP_RULE + +$(2): $${$(1)_precondition} + +${call RBUILD_intermediate_path_unique,$(1),$(2)}.o: $(2) $(3) | ${call RBUILD_intermediate_dir,$(2)} + $$(ECHO_HOSTCC) + $${host_gpp} -o $$@ ${call RBUILD_host_cxxflags,$(1),$(4)} -c $$< + +endef + +# EOF diff --git a/tools/rbuild/backend/msbuild/msbuild.cpp b/tools/rbuild/backend/msbuild/msbuild.cpp new file mode 100644 index 00000000000..82a009371ab --- /dev/null +++ b/tools/rbuild/backend/msbuild/msbuild.cpp @@ -0,0 +1,270 @@ +/* + * Copyright (C) 2007 Christoph von Wittich + * + * This program is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation; either version 2 of the License, or + * (at your option) any later version. + * + * This program 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 General Public License for more details. + * + * You should have received a copy of the GNU General Public License along + * with this program; if not, write to the Free Software Foundation, Inc., + * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. + */ +#ifdef _MSC_VER +#pragma warning ( disable : 4786 ) +#endif//_MSC_VER + +#include +#include +#include +#include + +#include + +#include "msbuild.h" +#include "../mingw/mingw.h" + +using std::string; +using std::vector; +using std::map; +using std::ifstream; + +#ifdef OUT +#undef OUT +#endif//OUT + + +static class MsBuildFactory : public Backend::Factory +{ + public: + + MsBuildFactory() : Factory("MsBuild", "Ms Build") {} + Backend *operator() (Project &project, + Configuration& configuration) + { + return new MsBuildBackend(project, configuration); + } + +} factory; + + +MsBuildBackend::MsBuildBackend(Project &project, + Configuration& configuration) : Backend(project, configuration) +{ + +} + +void MsBuildBackend::Process() +{ + if ( configuration.CleanAsYouGo ) { + _clean_project_files(); + return; + } + + ProcessModules(); +} + +void +MsBuildBackend::_generate_makefile ( const Module& module ) +{ + string makefile = module.output->relative_path + "\\makefile"; + FILE* OUT = fopen ( makefile.c_str(), "wb" ); + fprintf ( OUT, "!INCLUDE $(NTMAKEENV)\\makefile.def\r\n" ); + fclose ( OUT ); +} + +void +MsBuildBackend::_generate_sources ( const Module& module ) +{ + size_t i; + + string module_type = GetExtension(*module.output); + vector source_files, resource_files, includes, libraries; + vector header_files, common_defines, compiler_flags; + vector vars, values; + string sourcesfile = module.output->relative_path + "\\sources"; + string proj_path = module.output->relative_path; + + FILE* OUT = fopen ( sourcesfile.c_str(), "wb" ); + fprintf ( OUT, "TARGETNAME=%s\r\n", module.name.c_str() ); + + vector ifs_list; + ifs_list.push_back ( &module.project.non_if_data ); + ifs_list.push_back ( &module.non_if_data ); + while ( ifs_list.size() ) + { + const IfableData& data = *ifs_list.back(); + ifs_list.pop_back(); + const vector& files = data.files; + for ( i = 0; i < files.size(); i++ ) + { + source_files.push_back ( files[i]->file.name ); + } + const vector& incs = data.includes; + for ( i = 0; i < incs.size(); i++ ) + { + string path = Path::RelativeFromDirectory ( + incs[i]->directory->relative_path, + module.output->relative_path ); + + includes.push_back ( path ); + } + const vector& libs = data.libraries; + for ( i = 0; i < libs.size(); i++ ) + { + libraries.push_back ( libs[i]->name ); + } + const vector& cflags = data.compilerFlags; + for ( i = 0; i < cflags.size(); i++ ) + { + compiler_flags.push_back ( cflags[i]->flag ); + } + const vector& defs = data.defines; + for ( i = 0; i < defs.size(); i++ ) + { + if ( defs[i]->value[0] ) + { + const string& escaped = _replace_str(defs[i]->value, "\"","""); + common_defines.push_back( defs[i]->name + "=" + escaped ); + } + else + { + common_defines.push_back( defs[i]->name ); + } + } + } + + if (module_type == ".sys") + fprintf ( OUT, "TARGETTYPE=DRIVER\r\n" ); + else if (module_type == ".dll") + { + fprintf ( OUT, "TARGETTYPE=LIBRARY\r\n" ); + + } + else if (module_type == ".exe") + fprintf ( OUT, "TARGETTYPE=PROGRAM\r\n" ); + + fprintf ( OUT, "\r\nMSC_WARNING_LEVEL=/W3 /WX\r\n\r\n" ); + + /* Disable deprecated function uage warnings */ + fprintf ( OUT, "C_DEFINES=$(C_DEFINES) /DSTDCALL=__stdcall /DDDKAPI=__stdcall /wd4996\r\n" ); + + + /* includes */ + fprintf ( OUT, "INCLUDES=.; \\\r\n" ); + for ( i = 1; i < includes.size() -1; i++ ) + { + const string& include = includes[i]; + + /* don't include psdk / ddk / crt */ + std::string::size_type pos = include.find("ddk"); + std::string::size_type pos2 = include.find("psdk"); + std::string::size_type pos3 = include.find("crt"); + if ((std::string::npos == pos) && (std::string::npos == pos2) && (std::string::npos == pos3)) + fprintf ( OUT, "\t%s; \\\r\n", include.c_str() ); + } + if (includes.size() > 1) + { + const string& include = includes[includes.size()-1]; + fprintf ( OUT, "\t%s \r\n\r\n", include.c_str() ); + } + + fprintf ( OUT, "TARGETLIBS= $(DDK_LIB_PATH)\\ntstrsafe.lib\r\n\r\n" ); + + string source_file = ""; + if (source_files.size() > 0) + { + source_file = DosSeparator(source_files[0]); + fprintf ( OUT, "SOURCES=%s \\\r\n", source_file.c_str() ); + + for ( size_t isrcfile = 1; isrcfile < source_files.size()-1; isrcfile++ ) + { + source_file = DosSeparator(source_files[isrcfile]); + fprintf ( OUT, "\t%s \\\r\n", source_file.c_str() ); + } + } + if (source_files.size() > 1) + { + source_file = DosSeparator(source_files[source_files.size()-1]); + fprintf ( OUT, "\t%s \r\n", source_file.c_str() ); + } + + fprintf ( OUT, "TARGET_DESTINATION=retail\r\n" ); + + + fclose ( OUT ); +} + +void MsBuildBackend::ProcessModules() +{ + for( std::map::const_iterator p = ProjectNode.modules.begin(); p != ProjectNode.modules.end(); ++ p ) + { + Module &module = *p->second; + _generate_makefile ( module ); + _generate_sources ( module ); + } +} + +void +MsBuildBackend::_clean_project_files ( void ) +{ + for( std::map::const_iterator p = ProjectNode.modules.begin(); p != ProjectNode.modules.end(); ++ p ) + { + Module& module = *p->second; + printf("Cleaning project %s %s\n", module.name.c_str (), module.output->relative_path.c_str () ); + + string makefile = module.output->relative_path + "\\makefile"; + string sourcesfile = module.output->relative_path + "\\sources"; + + string basepath = module.output->relative_path; + remove ( makefile.c_str() ); + remove ( sourcesfile.c_str() ); + } +} + +MsBuildConfiguration::MsBuildConfiguration ( const std::string &name ) +{ + /* nothing to do here */ +} + +const Property* +MsBuildBackend::_lookup_property ( const Module& module, const std::string& name ) const +{ + std::map::const_iterator p; + + /* Check local values */ + p = module.non_if_data.properties.find(name); + + if ( p != module.non_if_data.properties.end() ) + return p->second; + + // TODO FIXME - should we check local if-ed properties? + p = module.project.non_if_data.properties.find(name); + + if ( p != module.project.non_if_data.properties.end() ) + return p->second; + + // TODO FIXME - should we check global if-ed properties? + return NULL; +} + +std::string +MsBuildBackend::_replace_str(std::string string1, const std::string &find_str, const std::string &replace_str) +{ + std::string::size_type pos = string1.find(find_str, 0); + int intLen = find_str.length(); + + while(std::string::npos != pos) + { + string1.replace(pos, intLen, replace_str); + pos = string1.find(find_str, intLen + pos); + } + + return string1; +} + diff --git a/tools/rbuild/backend/msbuild/msbuild.h b/tools/rbuild/backend/msbuild/msbuild.h new file mode 100644 index 00000000000..d1cd1f08fe6 --- /dev/null +++ b/tools/rbuild/backend/msbuild/msbuild.h @@ -0,0 +1,68 @@ +/* + * Copyright (C) 2007 Christoph von Wittich + * + * This program is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation; either version 2 of the License, or + * (at your option) any later version. + * + * This program 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 General Public License for more details. + * + * You should have received a copy of the GNU General Public License along + * with this program; if not, write to the Free Software Foundation, Inc., + * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. + */ + +#pragma once + +#include +#include +#include + +#include "../backend.h" + +class MsBuildConfiguration +{ + public: + MsBuildConfiguration(const std::string &name = ""); + virtual ~MsBuildConfiguration() {} + std::string name; +}; + +class MsBuildBackend : public Backend +{ + public: + + MsBuildBackend(Project &project, + Configuration& configuration); + virtual ~MsBuildBackend() {} + + virtual void Process(); + + private: + + FILE* m_MsBuildFile; + + std::vector m_configurations; + void _generate_makefile ( const Module& module ); + void _generate_sources ( const Module& module ); + void _clean_project_files ( void ); + void ProcessModules(); + const Property* _lookup_property ( const Module& module, const std::string& name ) const; + std::string _replace_str(std::string string1, const std::string &find_str, const std::string &replace_str); + + struct module_data + { + std::vector libraries; + std::vector references; + + module_data() + {} + ~module_data() + {} + }; + +}; diff --git a/tools/rbuild/backend/msvc/genguid.cpp b/tools/rbuild/backend/msvc/genguid.cpp new file mode 100644 index 00000000000..5dedb375ef8 --- /dev/null +++ b/tools/rbuild/backend/msvc/genguid.cpp @@ -0,0 +1,95 @@ +/* + * Based on the genguid utility for WINE and ReactOS + * + * Copyright 2003 Jonathan Wilson + * Copyright 2005 Steven Edwards + * + * 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 Street, Fifth Floor, Boston, MA 02110-1301 USA + */ + +#include "../../pch.h" +#include "msvc.h" +#include + +using std::string; + +#ifdef _WIN32 +#include +#include + +typedef HRESULT _stdcall CoInitializeFunc ( PVOID ); +typedef void _stdcall CoUninitializeFunc ( void ); +typedef HRESULT _stdcall CoCreateGuidFunc ( GUID* ); + +static CoInitializeFunc *pCoInitialize = NULL; +static CoUninitializeFunc *pCoUninitialize = NULL; +static CoCreateGuidFunc *pCoCreateGuid = NULL; + + +std::string +MSVCBackend::_gen_guid() +{ + GUID m_guid; + HRESULT result; + bool good_guid = false; + static char guid[38]; + + // Load ole32. We will need it later on + HMODULE olelib = LoadLibrary ( "ole32.dll" ); + if ( olelib != NULL ) + { + pCoInitialize = (CoInitializeFunc *)GetProcAddress( olelib, "CoInitialize" ); + pCoUninitialize = (CoUninitializeFunc *)GetProcAddress( olelib, "CoUninitialize" ); + pCoCreateGuid = (CoCreateGuidFunc *)GetProcAddress( olelib, "CoCreateGuid" ); + if ( !pCoInitialize || !pCoUninitialize || !pCoCreateGuid ) + printf ( "Missing exports from ole32.dll\n" ); + else + { + if (pCoInitialize(NULL) != S_OK) + printf("Unable to initalize OLE libraries\n"); + else + { + result = pCoCreateGuid(&m_guid); + if (result != S_OK) + printf("Unable to create GUID\n"); + else + good_guid = true; + pCoUninitialize(); + } + } + FreeLibrary ( olelib ); + } + if ( !good_guid ) + { + // TODO FIXME - fall-back to random #'s + } + const char* strfmt = "%08lX-%04X-%04x-%02X%02X-%02X%02X%02X%02X%02X%02X"; + sprintf(guid, strfmt,m_guid.Data1,m_guid.Data2,m_guid.Data3,m_guid.Data4[0], + m_guid.Data4[1],m_guid.Data4[2],m_guid.Data4[3],m_guid.Data4[4],m_guid.Data4[5], + m_guid.Data4[6],m_guid.Data4[7],m_guid.Data1,m_guid.Data2,m_guid.Data3,m_guid.Data4[0], + m_guid.Data4[1],m_guid.Data4[2],m_guid.Data4[3],m_guid.Data4[4],m_guid.Data4[5], + m_guid.Data4[6],m_guid.Data4[7]); + + return guid; +} + +#else /* Linux, etc */ + +std::string +MSVCBackend::_gen_guid() +{ + return std::string(); +} +#endif /* WIN32/Linux */ diff --git a/tools/rbuild/backend/msvc/msvc.cpp b/tools/rbuild/backend/msvc/msvc.cpp new file mode 100644 index 00000000000..6fc993d06b3 --- /dev/null +++ b/tools/rbuild/backend/msvc/msvc.cpp @@ -0,0 +1,568 @@ +/* + * Copyright (C) 2005 Trevor McCort + * Copyright (C) 2005 Casper S. Hornstrup + * Copyright (C) 2005 Steven Edwards + * Copyright (C) 2005 Royce Mitchell + * Copyright (C) 2006 Christoph von Wittich + * Copyright (C) 2009 Ged Murphy + * + * This program is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation; either version 2 of the License, or + * (at your option) any later version. + * + * This program 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 General Public License for more details. + * + * You should have received a copy of the GNU General Public License along + * with this program; if not, write to the Free Software Foundation, Inc., + * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. + */ +#ifdef _MSC_VER +#pragma warning ( disable : 4786 ) +#pragma warning ( disable : 4996 ) +#endif//_MSC_VER + +#include +#include +#include +#include + +#include "msvc.h" + +using std::string; +using std::vector; +using std::ifstream; + +static class MSVCFactory : public Backend::Factory +{ + public: + + MSVCFactory() : Factory("MSVC", "Microsoft Visual C") {} + Backend *operator() (Project &project, + Configuration& configuration) + { + return new MSVCBackend(project, configuration); + } + +} factory; + +MSVCConfiguration::MSVCConfiguration ( const OptimizationType optimization, const HeadersType headers, const std::string &name ) +{ + this->optimization = optimization; + this->headers = headers; + if ( name != "" ) + this->name = name; + else + { + std::string headers_name; + if ( headers == MSVCHeaders ) + headers_name = ""; + else + headers_name = " - ReactOS headers"; + if ( optimization == Debug ) + this->name = "Debug" + headers_name; + else if ( optimization == Release ) + this->name = "Release" + headers_name; + else if ( optimization == Speed ) + this->name = "Speed" + headers_name; + else if ( optimization == RosBuild ) + this->name = "RosBuild"; + else + this->name = "Unknown" + headers_name; + } +} + +MSVCBackend::MSVCBackend(Project &project, + Configuration& configuration) : Backend(project, configuration) +{ + m_unitCount = 0; +} + +void MSVCBackend::Process() +{ + while ( m_configurations.size () > 0 ) + { + const MSVCConfiguration* cfg = m_configurations.back(); + m_configurations.pop_back(); + delete cfg; + } + + //Don't generate configurations that require WDK if it can't be found + if(getenv ( "BASEDIR" ) != NULL) + { + m_configurations.push_back ( new MSVCConfiguration( Debug )); + m_configurations.push_back ( new MSVCConfiguration( Release )); + } + m_configurations.push_back ( new MSVCConfiguration( RosBuild )); + m_configurations.push_back ( new MSVCConfiguration( Debug, ReactOSHeaders )); + m_configurations.push_back ( new MSVCConfiguration( Release, ReactOSHeaders )); + // m_configurations.push_back ( new MSVCConfiguration( Speed )); + // m_configurations.push_back ( new MSVCConfiguration( Speed, ReactOSHeaders )); + + if ( configuration.CleanAsYouGo ) { + _clean_project_files(); + return; + } + if ( configuration.InstallFiles ) { + _install_files( _get_vc_dir(), configuration.VSConfigurationType ); + return; + } + string filename_sln ( ProjectNode.name ); + + filename_sln += "_auto.sln"; + printf ( "Creating MSVC workspace: %s\n", filename_sln.c_str() ); + + if (configuration.VSProjectVersion == "10.00") + { + PropsMaker propsMaker( &ProjectNode, "reactos.props", m_configurations ); + propsMaker._generate_props( _get_solution_version(), _get_studio_version() ); + } + else + { + //Write a property page for each configuration + for ( size_t icfg = 0; icfg < m_configurations.size(); icfg++ ) + { + MSVCConfiguration* cfg = m_configurations[icfg]; + + //RosBuild doesn't need a property page + if(cfg->optimization == RosBuild) + continue; + + //Write the propery pages files + string filename_props( cfg->name ); + + filename_props = filename_props + ".vsprops"; + VSPropsMaker propsMaker( configuration, &ProjectNode, filename_props, cfg ); + propsMaker._generate_props( _get_solution_version(), _get_studio_version() ); + } + } + // Write out the project files + ProcessModules(); + + printf ( "Done.\n" ); +} + +void MSVCBackend::ProcessModules() +{ + string filename_sln ( ProjectNode.name ); + + filename_sln += "_auto.sln"; + + // Write the solution file + SlnMaker slnMaker( configuration, m_configurations, filename_sln, _get_solution_version(), _get_studio_version() ); + + for(std::map::const_iterator p = ProjectNode.modules.begin(); p != ProjectNode.modules.end(); ++ p) + { + Module &module = *p->second; + + module.guid = _gen_guid(); + + ProjMaker *projMaker; + + if (configuration.VSProjectVersion == "10.00") + { + string vcxproj_file = VcxprojFileName(module); + projMaker = new VCXProjMaker( configuration, m_configurations, vcxproj_file, module ); + } + else + { + string vcproj_file = VcprojFileName(module); + projMaker = new VCProjMaker( configuration, m_configurations, vcproj_file, module ); + } + + projMaker->_generate_proj_file ( module ); + + slnMaker._add_project(*projMaker, module); + + delete projMaker; + } + +} + +static bool FileExists(string &filename) +{ + ifstream file(filename.c_str()); + + if(!file.is_open()) + return false; + + file.close(); + return true; +} + +void MSVCBackend::ProcessFile(string &filepath) +{ + // Remove the .\ at the start of the filenames + if ( filepath[0] == '.' && strchr ( "/\\", filepath[1] ) ) + filepath.erase(0, 2); + + if(!FileExists(filepath)) + return; + + // Change the \ to / + for(size_t i = 0; i < filepath.length(); i++) + { + if(filepath[i] == '\\') + filepath[i] = '/'; + } + + // Remove the filename from the path + string folder = ""; + + size_t pos = filepath.rfind(string("/"), filepath.length() - 1); + + if(pos != string::npos) + { + folder = filepath; + folder.erase(pos, folder.length() - pos); + } + + FileUnit fileUnit; + fileUnit.filename = filepath; + fileUnit.folder = folder; + + m_fileUnits.push_back(fileUnit); + + if(folder != "") + AddFolders(folder); + + m_unitCount++; +} + +bool MSVCBackend::CheckFolderAdded(string &folder) +{ + for(size_t i = 0; i < m_folders.size(); i++) + { + if(m_folders[i] == folder) + return true; + } + + return false; +} + +void MSVCBackend::AddFolders(string &folder) +{ + // Check if this folder was already added. true if it was, false otherwise. + if(CheckFolderAdded(folder)) + return; + + m_folders.push_back(folder); + + size_t pos = folder.rfind(string("/"), folder.length() - 1); + + if(pos == string::npos) + return; + + folder.erase(pos, folder.length() - pos); + AddFolders(folder); +} + +void MSVCBackend::OutputFolders() +{ +#if 0 + m_devFile << "Folders="; + + for(size_t i = 0; i < m_folders.size(); i++) + { + if(i > 0) + m_devFile << ","; + + m_devFile << m_folders[i]; + } +#endif +} + +std::string +MSVCBackend::UserFileName ( const Module& module, std::string vcproj_file ) const +{ + string computername; + string username; + + if (getenv ( "USERNAME" ) != NULL) + username = getenv ( "USERNAME" ); + if (getenv ( "COMPUTERNAME" ) != NULL) + computername = getenv ( "COMPUTERNAME" ); + else if (getenv ( "HOSTNAME" ) != NULL) + computername = getenv ( "HOSTNAME" ); + + if ((computername != "") && (username != "")) + return vcproj_file + "." + computername + "." + username + ".user"; + else + return ""; +} + +std::string +MSVCBackend::SuoFileName ( const Module& module ) const +{ + return FixSeparatorForSystemCommand( + ReplaceExtension ( module.output->relative_path + "\\" + module.output->name, "_" + _get_vc_dir() + "_auto.suo" ) + ); +} + +std::string +MSVCBackend::SlnFileName ( const Module& module ) const +{ + return FixSeparatorForSystemCommand( + ReplaceExtension ( module.output->relative_path + "\\" + module.output->name, "_" + _get_vc_dir() + "_auto.sln" ) + ); +} + +std::string +MSVCBackend::NcbFileName ( const Module& module ) const +{ + return FixSeparatorForSystemCommand( + ReplaceExtension ( module.output->relative_path + "\\" + module.output->name, "_" + _get_vc_dir() + "_auto.ncb" ) + ); +} + +std::string +MSVCBackend::VcprojFileName ( const Module& module ) const +{ + return FixSeparatorForSystemCommand( + ReplaceExtension ( module.output->relative_path + "\\" + module.name, "_" + _get_vc_dir() + "_auto.vcproj" ) + ); +} + +std::string +MSVCBackend::VcxprojFileName ( const Module& module ) const +{ + return FixSeparatorForSystemCommand( + ReplaceExtension ( module.output->relative_path + "\\" + module.name, "_" + _get_vc_dir() + "_auto.vcxproj" ) + ); +} + +std::string MSVCBackend::_get_vc_dir ( void ) const +{ + if ( configuration.VSProjectVersion == "8.00" ) + return "vc8"; + else if ( configuration.VSProjectVersion == "10.00" ) + return "vc10"; + else /* default to VS2008 */ + return "vc9"; +} + +void +MSVCBackend::_get_object_files ( const Module& module, vector& out) const +{ + string basepath = module.output->relative_path; + string vcdir = _get_vc_dir (); + size_t i; + string intenv = Environment::GetIntermediatePath () + DEF_SSEP + basepath + DEF_SSEP; + string outenv = Environment::GetOutputPath () + DEF_SSEP + basepath + DEF_SSEP; + + if ( configuration.UseVSVersionInPath ) + { + intenv += vcdir + DEF_SSEP; + outenv += vcdir + DEF_SSEP; + } + + string dbg = vcdir.substr ( 0, 3 ); + + vector cfgs; + + if ( configuration.UseConfigurationInPath ) + { + cfgs.push_back ( intenv + "Debug" ); + cfgs.push_back ( intenv + "Release" ); + cfgs.push_back ( intenv + "Speed" ); + cfgs.push_back ( outenv + "Debug" ); + cfgs.push_back ( outenv + "Release" ); + cfgs.push_back ( outenv + "Speed" ); + } + else + { + cfgs.push_back ( intenv ); + cfgs.push_back ( outenv ); + } + + vector ifs_list; + ifs_list.push_back ( &module.project.non_if_data ); + ifs_list.push_back ( &module.non_if_data ); + while ( ifs_list.size () ) + { + const IfableData& data = *ifs_list.back(); + ifs_list.pop_back(); + const vector& files = data.files; + for ( i = 0; i < files.size (); i++ ) + { + string file = files[i]->file.relative_path + sSep + files[i]->file.name; + string::size_type pos = file.find_last_of (DEF_SSEP); + if ( pos != string::npos ) + file.erase ( 0, pos+1 ); + if ( !stricmp ( Right(file,3).c_str(), ".rc" ) ) + file = ReplaceExtension ( file, ".res" ); + else + file = ReplaceExtension ( file, ".obj" ); + for ( size_t j = 0; j < cfgs.size () / 2; j++ ) + out.push_back ( cfgs[j] + file ); + } + + } + //common files in intermediate dir + for ( i = 0; i < cfgs.size () / 2; i++) + { + out.push_back ( cfgs[i] + "BuildLog.htm" ); + out.push_back ( cfgs[i] + dbg + "0.pdb" ); + out.push_back ( cfgs[i] + dbg + "0.idb" ); + out.push_back ( cfgs[i] + module.name + ".pch" ); + } + //files in the output dir + for ( i = cfgs.size () / 2; i < cfgs.size (); i++ ) + { + out.push_back ( cfgs[i] + module.output->name ); + out.push_back ( cfgs[i] + module.name + ".pdb" ); + out.push_back ( cfgs[i] + module.name + ".lib" ); + out.push_back ( cfgs[i] + module.name + ".exp" ); + out.push_back ( cfgs[i] + module.name + ".ilk" ); + } +} + +void +MSVCBackend::_get_def_files ( const Module& module, vector& out) const +{ + if (module.HasImportLibrary()) + { +#if 0 + string modulename = module.GetBasePath (); + string file = module.importLibrary->definition; + size_t pos = file.find (".def"); + if (pos != string::npos) + { + file.insert (pos, "_msvc"); + } + modulename += DEF_SSEP + file; + out.push_back (modulename); +#endif + } +} + +void +MSVCBackend::_clean_project_files ( void ) +{ + for( std::map::const_iterator p = ProjectNode.modules.begin(); p != ProjectNode.modules.end(); ++ p ) + { + Module& module = *p->second; + vector out; + printf("Cleaning project %s %s %s\n", module.name.c_str (), module.output->relative_path.c_str (), NcbFileName ( module ).c_str () ); + + string vcproj_file_user = UserFileName(module, VcprojFileName ( module )); + if(vcproj_file_user != "") + remove ( vcproj_file_user.c_str () ); + + _get_object_files ( module, out ); + _get_def_files ( module, out ); + for ( size_t j = 0; j < out.size (); j++) + { + printf("Cleaning file %s\n", out[j].c_str () ); + remove ( out[j].c_str () ); + } + } + + string filename_sln = ProjectNode.name + ".sln"; + + remove ( filename_sln.c_str () ); +} + +bool +MSVCBackend::_copy_file ( const std::string& inputname, const std::string& targetname ) const +{ + FILE * input = fopen ( inputname.c_str (), "rb" ); + if ( !input ) + return false; + + FILE * output = fopen ( targetname.c_str (), "wb+" ); + if ( !output ) + { + fclose ( input ); + return false; + } + + char buffer[256]; + int num_read; + while ( (num_read = fread( buffer, sizeof(char), 256, input) ) || !feof( input ) ) + fwrite( buffer, sizeof(char), num_read, output ); + + fclose ( input ); + fclose ( output ); + return true; +} + +void +MSVCBackend::_install_files (const std::string& vcdir, const::string& config) +{ + for( std::map::const_iterator p = ProjectNode.modules.begin(); p != ProjectNode.modules.end(); ++ p ) + { + Module& module = *p->second; + if ( !module.install ) + continue; + + string inputname = Environment::GetOutputPath () + DEF_SSEP + module.output->relative_path + DEF_SSEP + vcdir + DEF_SSEP + config + DEF_SSEP + module.output->name; + string installdir = Environment::GetInstallPath () + DEF_SSEP + module.install->relative_path + DEF_SSEP + module.install->name; + if ( _copy_file( inputname, installdir ) ) + printf ("Installed File :'%s'\n",installdir.c_str () ); + } +} + +std::string +MSVCBackend::_get_solution_version ( void ) +{ + string version; + + if (configuration.VSProjectVersion.empty()) + configuration.VSProjectVersion = MS_VS_DEF_VERSION; + + else if (configuration.VSProjectVersion == "8.00") + version = "9.00"; + + else if (configuration.VSProjectVersion == "9.00") + version = "10.00"; + + else if (configuration.VSProjectVersion == "10.00") + version = "11.00"; + + return version; +} + +std::string +MSVCBackend::_get_studio_version ( void ) +{ + string version; + + if (configuration.VSProjectVersion.empty()) + configuration.VSProjectVersion = MS_VS_DEF_VERSION; + + else if (configuration.VSProjectVersion == "8.00") + version = "2005"; + + else if (configuration.VSProjectVersion == "9.00") + version = "2008"; + + else if (configuration.VSProjectVersion == "10.00") + version = "2010"; + + return version; +} + +const Property* +MSVCBackend::_lookup_property ( const Module& module, const std::string& name ) const +{ + std::map::const_iterator p; + + /* Check local values */ + p = module.non_if_data.properties.find(name); + + if ( p != module.non_if_data.properties.end() ) + return p->second; + + // TODO FIXME - should we check local if-ed properties? + p = module.project.non_if_data.properties.find(name); + + if ( p != module.project.non_if_data.properties.end() ) + return p->second; + + // TODO FIXME - should we check global if-ed properties? + return NULL; +} diff --git a/tools/rbuild/backend/msvc/msvc.h b/tools/rbuild/backend/msvc/msvc.h new file mode 100644 index 00000000000..25bc70d0aa6 --- /dev/null +++ b/tools/rbuild/backend/msvc/msvc.h @@ -0,0 +1,282 @@ +/* + * Copyright (C) 2005 Trevor McCort + * Copyright (C) 2005 Casper S. Hornstrup + * + * This program is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation; either version 2 of the License, or + * (at your option) any later version. + * + * This program 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 General Public License for more details. + * + * You should have received a copy of the GNU General Public License along + * with this program; if not, write to the Free Software Foundation, Inc., + * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. + */ + +#pragma once + +#include +#include +#include + +#include "../backend.h" + +#ifdef OUT +#undef OUT +#endif//OUT + + +class FileUnit +{ + public: + std::string filename; + std::string folder; +}; + +enum OptimizationType +{ + RosBuild, + Debug, + Release, + Speed, +}; + +enum ConfigurationType +{ + ConfigUnknown, + ConfigApp, + ConfigDll, + ConfigEmpty, + ConfigLib +}; + +enum BinaryType +{ + BinUnknown, + Lib, + Dll, + Exe, + Sys +}; + +enum HeadersType +{ + MSVCHeaders, + ReactOSHeaders +}; + +class MSVCConfiguration +{ + public: + MSVCConfiguration(const OptimizationType optimization, + const HeadersType headers = MSVCHeaders, + const std::string &name = ""); + virtual ~MSVCConfiguration() {} + std::string name; + OptimizationType optimization; + HeadersType headers; +}; + +class MSVCBackend : public Backend +{ + public: + + MSVCBackend(Project &project, + Configuration& configuration); + virtual ~MSVCBackend() {} + + virtual void Process(); + + private: + + void ProcessModules(); + void ProcessFile(std::string &filename); + + bool CheckFolderAdded(std::string &folder); + void AddFolders(std::string &folder); + + void OutputFolders(); + void OutputFileUnits(); + + std::string VcprojFileName ( const Module& module ) const; + std::string VcxprojFileName ( const Module& module ) const; + std::string SlnFileName ( const Module& module ) const; + std::string SuoFileName ( const Module& module ) const; + std::string UserFileName ( const Module& module, std::string vcproj_file ) const; + std::string NcbFileName ( const Module& module ) const; + + std::vector m_configurations; + + std::vector m_fileUnits; + std::vector m_folders; + + int m_unitCount; + + std::string _gen_guid(); + + std::string _get_solution_version ( void ); + std::string _get_studio_version ( void ); + std::string _get_vc_dir ( void ) const; + + void _clean_project_files ( void ); + void _get_object_files ( const Module& module, std::vector& out ) const; + void _get_def_files ( const Module& module, std::vector& out ) const; + void _install_files ( const std::string& vcdir, const std::string& config ); + bool _copy_file ( const std::string& inputname, const std::string& targetname ) const; + const Property* _lookup_property ( const Module& module, const std::string& name ) const; +}; + + +// Abstract class +class ProjMaker +{ + public: + ProjMaker ( ); + ProjMaker ( Configuration& buildConfig, const std::vector& msvc_configs, std::string filename ); + virtual ~ProjMaker() {} + + virtual void _generate_proj_file ( const Module& module ) = 0; + virtual void _generate_user_configuration (); + + std::string VcprojFileName ( const Module& module ) const; + + protected: + Configuration configuration; + std::vector m_configurations; + std::string vcproj_file; + FILE* OUT; + + std::vector header_files; + std::vector source_files; + std::vector resource_files; + std::vector generated_files; + std::vector defines; + std::vector includes; + std::vector libraries; + + std::string baseaddr; + BinaryType binaryType; + + std::string _get_vc_dir ( void ) const; + std::string _strip_gcc_deffile(std::string Filename, std::string sourcedir, std::string objdir); + std::string _get_solution_version ( void ); + std::string _get_studio_version ( void ); + std::string _replace_str( std::string string1, const std::string &find_str, const std::string &replace_str); + std::string _get_file_path( FileLocation* file, std::string relative_path); + + void _collect_files(const Module& module); + void _generate_standard_configuration( const Module& module, const MSVCConfiguration& cfg, BinaryType binaryType ); + void _generate_makefile_configuration( const Module& module, const MSVCConfiguration& cfg ); +}; + +class VCProjMaker : public ProjMaker +{ + public: + VCProjMaker ( ); + VCProjMaker ( Configuration& buildConfig, const std::vector& msvc_configs, std::string filename, const Module& module ); + virtual ~VCProjMaker (); + + void _generate_proj_file ( const Module& module ); + void _generate_user_configuration (); + + private: + + void _generate_standard_configuration( const Module& module, const MSVCConfiguration& cfg, BinaryType binaryType ); + void _generate_makefile_configuration( const Module& module, const MSVCConfiguration& cfg ); + std::string _get_file_path( FileLocation* file, std::string relative_path); +}; + +class VCXProjMaker : public ProjMaker +{ + public: + VCXProjMaker ( ); + VCXProjMaker ( Configuration& buildConfig, const std::vector& msvc_configs, std::string filename, const Module& module ); + virtual ~VCXProjMaker (); + + void _generate_proj_file ( const Module& module ); + void _generate_user_configuration (); + + private: + std::string _get_configuration_type (); + void _generate_item_group (std::vector); + void _generate_standard_configuration( const Module& module, const MSVCConfiguration& cfg, BinaryType binaryType ); + void _generate_makefile_configuration( const Module& module, const MSVCConfiguration& cfg ); +}; + +class SlnMaker +{ + public: + SlnMaker ( Configuration& buildConfig, const std::vector& configurations, std::string filename_sln, std::string solution_version, std::string studio_version); + ~SlnMaker (); + + void _add_project(ProjMaker &project, Module &module); + private: + Configuration m_configuration; + std::vector m_configurations; + FILE* OUT; + std::vector modules; + + void _generate_sln_header ( std::string solution_version, std::string studio_version ); + void _generate_sln_footer ( ); + void _generate_sln_configurations ( std::string vcproj_guid ); +}; + +class VSPropsMaker +{ + public: + VSPropsMaker ( Configuration& buildConfig, + Project* ProjectNode, + std::string filename_props, + MSVCConfiguration* msvc_configs); + + ~VSPropsMaker (); + + void _generate_props ( std::string solution_version, std::string studio_version ); + + private: + Configuration m_configuration; + Project* m_ProjectNode; + FILE* OUT; + MSVCConfiguration* m_msvc_config; + bool debug; + bool release; + bool speed; + bool use_ros_headers; + + void _generate_header(); + void _generate_tools_defaults(); + void _generate_macro(std::string Name, std::string Value, bool EvairomentVariable); + void _generate_global_includes(); + void _generate_global_definitions(); + void _generate_footer(); + +}; + + +class PropsMaker +{ + public: + PropsMaker ( Project* ProjectNode, + std::string filename_props, + std::vector configurations); + + ~PropsMaker (); + + void _generate_props ( std::string solution_version, std::string studio_version ); + + private: + Project* m_ProjectNode; + FILE* OUT; + std::vector m_configurations; + + void _generate_macro(std::string Name, std::string Value); + void _generate_global_includes(bool debug, bool use_ros_headers); + void _generate_global_definitions(bool debug, bool use_ros_headers); + void _generate_header(); + void _generate_footer(); + +}; \ No newline at end of file diff --git a/tools/rbuild/backend/msvc/msvcmaker.cpp b/tools/rbuild/backend/msvc/msvcmaker.cpp new file mode 100644 index 00000000000..82bd3ee600d --- /dev/null +++ b/tools/rbuild/backend/msvc/msvcmaker.cpp @@ -0,0 +1,872 @@ +/* + * Copyright (C) 2002 Patrik Stridvall + * Copyright (C) 2005 Royce Mitchell III + * + * This program is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation; either version 2 of the License, or + * (at your option) any later version. + * + * This program 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 General Public License for more details. + * + * You should have received a copy of the GNU General Public License along + * with this program; if not, write to the Free Software Foundation, Inc., + * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. + */ + +#ifdef _MSC_VER +#pragma warning ( disable : 4786 ) +#endif//_MSC_VER + +#include +#include +#include + +#include + +#include "msvc.h" + +using std::string; +using std::vector; +using std::set; + +typedef set StringSet; + +#ifdef OUT +#undef OUT +#endif//OUT + +void +MSVCBackend::_generate_dsp ( const Module& module ) +{ + size_t i; + // TODO FIXME wine hack? + const bool wine = false; + + string dsp_file = DspFileName(module); + printf ( "Creating MSVC project: '%s'\n", dsp_file.c_str() ); + FILE* OUT = fopen ( dsp_file.c_str(), "wb" ); + + vector imports; + for ( i = 0; i < module.non_if_data.libraries.size(); i++ ) + { + imports.push_back ( module.non_if_data.libraries[i]->name ); + } + + string module_type = GetExtension(*module.output); + bool lib = (module_type == ".lib") || (module_type == ".a"); + bool dll = (module_type == ".dll") || (module_type == ".cpl"); + bool exe = (module_type == ".exe") || (module_type == ".scr"); + // TODO FIXME - need more checks here for 'sys' and possibly 'drv'? + + bool console = exe && (module.type == Win32CUI); + + // TODO FIXME - not sure if the count here is right... + int parts = 0; + const char* p = strpbrk ( dsp_file.c_str(), "/\\" ); + while ( p ) + { + ++parts; + p = strpbrk ( p+1, "/\\" ); + } + string msvc_wine_dir = ".."; + while ( --parts ) + msvc_wine_dir += "\\.."; + + string wine_include_dir = msvc_wine_dir + "\\include"; + + //$progress_current++; + //$output->progress("$dsp_file (file $progress_current of $progress_max)"); + + // TODO FIXME - what's diff. betw. 'c_srcs' and 'source_files'? + vector c_srcs, source_files, header_files, resource_files, includes, libraries; + StringSet common_defines; + vector ifs_list; + ifs_list.push_back ( &module.project.non_if_data ); + ifs_list.push_back ( &module.non_if_data ); + + // this is a define in MinGW w32api, but not Microsoft's headers + common_defines.insert ( "STDCALL=__stdcall" ); + + while ( ifs_list.size() ) + { + const IfableData& data = *ifs_list.back(); + ifs_list.pop_back(); + const vector& files = data.files; + for ( i = 0; i < files.size(); i++ ) + { + if (files[i]->file.directory != SourceDirectory) + continue; + + // We want the full path here for directory support later on + string path = Path::RelativeFromDirectory ( + files[i]->file.relative_path, + module.output->relative_path ); + string file = path + std::string("\\") + files[i]->file.name; + + source_files.push_back ( file ); + if ( !stricmp ( Right(file,2).c_str(), ".c" ) ) + c_srcs.push_back ( file ); + if ( !stricmp ( Right(file,2).c_str(), ".h" ) ) + header_files.push_back ( file ); + if ( !stricmp ( Right(file,3).c_str(), ".rc" ) ) + resource_files.push_back ( file ); + } + const vector& incs = data.includes; + for ( i = 0; i < incs.size(); i++ ) + { + string path = Path::RelativeFromDirectory ( + incs[i]->directory->relative_path, + module.output->relative_path ); + includes.push_back ( path ); + } + const vector& libs = data.libraries; + for ( i = 0; i < libs.size(); i++ ) + { + libraries.push_back ( libs[i]->name + ".lib" ); + } + const vector& defs = data.defines; + for ( i = 0; i < defs.size(); i++ ) + { + if ( defs[i]->value[0] ) + common_defines.insert( defs[i]->name + "=" + defs[i]->value ); + else + common_defines.insert( defs[i]->name ); + } + } + // TODO FIXME - we don't include header files in our build system + //my @header_files = @{module->{header_files}}; + //vector header_files; + + // TODO FIXME - wine hack? + /*if (module.name !~ /^wine(?:_unicode|build|runtests|test)?$/ && + module.name !~ /^(?:gdi32)_.+?$/ && + Right ( module.name, 5 ) == "_test" ) + { + source_files.push_back ( module.name + ".spec" ); + @source_files = sort(@source_files); + }*/ + + bool no_cpp = true; + bool no_msvc_headers = true; + // TODO FIXME - wine hack? + /*if (module.name =~ /^wine(?:runtests|test)$/ + || Right ( module.name, 5 ) == "_test" ) + { + no_msvc_headers = false; + }*/ + + std::vector cfgs; + + cfgs.push_back ( module.name + " - Win32" ); + + if (!no_cpp) + { + std::vector _cfgs; + for ( i = 0; i < cfgs.size(); i++ ) + { + _cfgs.push_back ( cfgs[i] + " C" ); + _cfgs.push_back ( cfgs[i] + " C++" ); + } + cfgs.resize(0); + cfgs = _cfgs; + } + + // TODO FIXME - wine hack? + /*if (!no_release) + { + std::vector _cfgs; + for ( i = 0; i < cfgs.size(); i++ ) + { + _cfgs.push_back ( cfgs[i] + " Debug" ); + _cfgs.push_back ( cfgs[i] + " Release" ); + } + cfgs.resize(0); + cfgs = _cfgs; + }*/ + + if (!no_msvc_headers) + { + std::vector _cfgs; + for ( i = 0; i < cfgs.size(); i++ ) + { + _cfgs.push_back ( cfgs[i] + " MSVC Headers" ); + _cfgs.push_back ( cfgs[i] + " Wine Headers" ); + } + cfgs.resize(0); + cfgs = _cfgs; + } + + string default_cfg = cfgs.back(); + + fprintf ( OUT, "# Microsoft Developer Studio Project File - Name=\"%s\" - Package Owner=<4>\r\n", module.name.c_str() ); + fprintf ( OUT, "# Microsoft Developer Studio Generated Build File, Format Version 6.00\r\n" ); + fprintf ( OUT, "# ** DO NOT EDIT **\r\n" ); + fprintf ( OUT, "\r\n" ); + + if ( lib ) + { + fprintf ( OUT, "# TARGTYPE \"Win32 (x86) Static Library\" 0x0104\r\n" ); + } + else if ( dll ) + { + fprintf ( OUT, "# TARGTYPE \"Win32 (x86) Dynamic-Link Library\" 0x0102\r\n" ); + } + else + { + fprintf ( OUT, "# TARGTYPE \"Win32 (x86) Console Application\" 0x0103\r\n" ); + } + fprintf ( OUT, "\r\n" ); + + fprintf ( OUT, "CFG=%s\r\n", default_cfg.c_str() ); + fprintf ( OUT, "!MESSAGE This is not a valid makefile. To build this project using NMAKE,\r\n" ); + fprintf ( OUT, "!MESSAGE use the Export Makefile command and run\r\n" ); + fprintf ( OUT, "!MESSAGE \r\n" ); + fprintf ( OUT, "!MESSAGE NMAKE /f \"%s.mak\".\r\n", module.name.c_str() ); + fprintf ( OUT, "!MESSAGE \r\n" ); + fprintf ( OUT, "!MESSAGE You can specify a configuration when running NMAKE\r\n" ); + fprintf ( OUT, "!MESSAGE by defining the macro CFG on the command line. For example:\r\n" ); + fprintf ( OUT, "!MESSAGE \r\n" ); + fprintf ( OUT, "!MESSAGE NMAKE /f \"%s.mak\" CFG=\"%s\"\r\n", module.name.c_str(), default_cfg.c_str() ); + fprintf ( OUT, "!MESSAGE \r\n" ); + fprintf ( OUT, "!MESSAGE Possible choices for configuration are:\r\n" ); + fprintf ( OUT, "!MESSAGE \r\n" ); + for ( i = 0; i < cfgs.size(); i++ ) + { + const string& cfg = cfgs[i]; + if ( lib ) + { + fprintf ( OUT, "!MESSAGE \"%s\" (based on \"Win32 (x86) Static Library\")\r\n", cfg.c_str() ); + } + else if ( dll ) + { + fprintf ( OUT, "!MESSAGE \"%s\" (based on \"Win32 (x86) Dynamic-Link Library\")\r\n", cfg.c_str() ); + } + else + { + fprintf ( OUT, "!MESSAGE \"%s\" (based on \"Win32 (x86) Console Application\")\r\n", cfg.c_str() ); + } + } + fprintf ( OUT, "!MESSAGE \r\n" ); + fprintf ( OUT, "\r\n" ); + + fprintf ( OUT, "# Begin Project\r\n" ); + fprintf ( OUT, "# PROP AllowPerConfigDependencies 0\r\n" ); + fprintf ( OUT, "# PROP Scc_ProjName \"\"\r\n" ); + fprintf ( OUT, "# PROP Scc_LocalPath \"\"\r\n" ); + fprintf ( OUT, "CPP=cl.exe\r\n" ); + if ( !lib && !exe ) fprintf ( OUT, "MTL=midl.exe\r\n" ); + fprintf ( OUT, "RSC=rc.exe\r\n" ); + + std::string output_dir; + for ( size_t icfg = 0; icfg < cfgs.size(); icfg++ ) + { + std::string& cfg = cfgs[icfg]; + if ( icfg == 0 ) + { + fprintf ( OUT, "!IF \"$(CFG)\" == \"%s\"\r\n", cfg.c_str() ); + fprintf ( OUT, "\r\n" ); + } + else + { + fprintf ( OUT, "\r\n" ); + fprintf ( OUT, "!ELSEIF \"$(CFG)\" == \"%s\"\r\n", cfg.c_str() ); + fprintf ( OUT, "\r\n" ); + } + + bool debug = !strstr ( cfg.c_str(), "Release" ); + bool msvc_headers = ( 0 != strstr ( cfg.c_str(), "MSVC Headers" ) ); + + fprintf ( OUT, "# PROP BASE Use_MFC 0\r\n" ); + + if ( debug ) + { + fprintf ( OUT, "# PROP BASE Use_Debug_Libraries 1\r\n" ); + } + else + { + fprintf ( OUT, "# PROP BASE Use_Debug_Libraries 0\r\n" ); + } + + output_dir = Replace(cfg,module.name + " - ",""); + output_dir = Replace(output_dir," ","_"); + output_dir = Replace(output_dir,"C++","Cxx"); + // TODO FIXME - wine hack? + //if ( output_prefix_dir.size() ) + // output_dir = output_prefix_dir + "\\" + output_dir; + + fprintf ( OUT, "# PROP BASE Output_Dir \"%s\"\r\n", output_dir.c_str() ); + fprintf ( OUT, "# PROP BASE Intermediate_Dir \"%s\"\r\n", output_dir.c_str() ); + + fprintf ( OUT, "# PROP BASE Target_Dir \"\"\r\n" ); + + fprintf ( OUT, "# PROP Use_MFC 0\r\n" ); + if ( debug ) + { + fprintf ( OUT, "# PROP Use_Debug_Libraries 1\r\n" ); + } + else + { + fprintf ( OUT, "# PROP Use_Debug_Libraries 0\r\n" ); + } + fprintf ( OUT, "# PROP Output_Dir \"%s\"\r\n", output_dir.c_str() ); + fprintf ( OUT, "# PROP Intermediate_Dir \"%s\"\r\n", output_dir.c_str() ); + + if ( dll ) fprintf ( OUT, "# PROP Ignore_Export_Lib 0\r\n" ); + fprintf ( OUT, "# PROP Target_Dir \"\"\r\n" ); + + StringSet defines = common_defines; + + if ( debug ) + { + defines.insert ( "_DEBUG" ); + if ( lib || exe ) + { + fprintf ( OUT, "# ADD BASE CPP /nologo /W3 /Gm /GX /Zi /Od" ); + defines.insert ( "_LIB" ); + } + else + { + fprintf ( OUT, "# ADD BASE CPP /nologo /MTd /W3 /Gm /GX /Zi /Od" ); + defines.insert ( "_WINDOWS" ); + defines.insert ( "_USRDLL" ); + // TODO FIXME - wine hack? + //defines.insert ( string("\U") + module.name + "\E_EXPORTS" ); + } + } + else + { + defines.insert ( "NDEBUG" ); + if ( lib || exe ) + { + fprintf ( OUT, "# ADD BASE CPP /nologo /W3 /GX /O2" ); + defines.insert ( "_LIB" ); + } + else + { + fprintf ( OUT, "# ADD BASE CPP /nologo /MT /W3 /GX /O2" ); + defines.insert ( "_WINDOWS" ); + defines.insert ( "_USRDLL" ); + // TODO FIXME - wine hack? + //defines.insert ( string("\U") + module.name + "\E_EXPORTS" ); + } + } + + for ( StringSet::const_iterator it1=defines.begin(); it1!=defines.end(); it1++ ) + { + fprintf ( OUT, " /D \"%s\"", it1->c_str() ); + } + if ( lib || exe ) fprintf ( OUT, " /YX" ); + fprintf ( OUT, " /FD" ); + if ( debug ) + { + fprintf ( OUT, " /GZ" ); + if ( lib || exe ) fprintf ( OUT, " " ); + } + fprintf ( OUT, " /c" ); + fprintf ( OUT, "\r\n" ); + + if ( debug ) + { + defines.insert ( "_DEBUG" ); + if(lib) + { + fprintf ( OUT, "# ADD CPP /nologo /MTd /W3 /Gm /GX /Zi /Od" ); + defines.insert ( "_LIB" ); + } + else + { + fprintf ( OUT, "# ADD CPP /nologo /MTd /W3 /Gm /GX /Zi /Od" ); + defines.insert ( "_USRDLL" ); + } + } + else + { + defines.insert ( "NDEBUG" ); + if(lib) + { + fprintf ( OUT, "# ADD CPP /nologo /MT /W3 /GX /O2" ); + defines.insert ( "_LIB" ); + } + else + { + fprintf ( OUT, "# ADD CPP /nologo /MT /W3 /GX /O2" ); + defines.insert ( "_USRDLL" ); + } + } + + // TODO FIXME - wine hack? + if ( wine ) + { + // TODO FIXME - wine hack? + //defines.insert ( string("_\U") + module.name + "\E_" ); + // TODO FIXME - wine hack? + /*if ( module.name !~ /^(?:wine(?:build|test)|.*?_test)$/ ) + defines.insert ( "__WINESRC__" );*/ + if ( msvc_headers ) + defines.insert ( "__WINE_USE_NATIVE_HEADERS" ); + string output_dir2 = Replace(output_dir,"\\","\\\\"); + defines.insert ( ssprintf("__WINETEST_OUTPUT_DIR=\\\"%s\\\"",output_dir.c_str()) ); + defines.insert ( "__i386__" ); + defines.insert ( "_X86_" ); + + // TODO FIXME - wine hacks? + /*if(module.name =~ /^gdi32_(?:enhmfdrv|mfdrv)$/) { + push @includes, ".." ); + } + + if ( strstr ( module.name.c_str(), "_test" ) + { + include.push_back ( msvc_wine_dir + "\\" + output_dir ); + } + + if (!msvc_headers || module.name == "winetest") + { + includes.push_back ( wine_include_dir ); + }*/ + } + + //if ( wine ) + { + for ( i = 0; i < includes.size(); i++ ) + { + const string& include = includes[i]; + if ( strpbrk ( include.c_str(), "[\\\"]" ) || !strncmp ( include.c_str(), "../", 3 ) ) + { + fprintf ( OUT, " /I \"%s\"", include.c_str() ); + } + else + { + fprintf ( OUT, " /I %s", include.c_str() ); + } + } + } + + fprintf ( OUT, " /I \".\"" ); + for ( StringSet::const_iterator it2=defines.begin(); it2!=defines.end(); it2++ ) + { + const string& define = *it2; + if ( strpbrk ( define.c_str(), "[\\\"]" ) ) + { + fprintf ( OUT, " /D \"%s\"", define.c_str() ); + } + else + { + fprintf ( OUT, " /D %s", define.c_str() ); + } + } + if ( wine ) fprintf ( OUT, " /D inline=__inline" ); + if ( 0 && wine ) fprintf ( OUT, " /D \"__STDC__\"" ); + + fprintf ( OUT, lib ? " /YX" : " /FR" ); + fprintf ( OUT, " /FD" ); + if ( debug ) fprintf ( OUT, " /GZ" ); + if ( debug && lib ) fprintf ( OUT, " " ); + fprintf ( OUT, " /c" ); + if ( !no_cpp ) fprintf ( OUT, " /TP" ); + fprintf ( OUT, "\r\n" ); + + if ( debug ) + { + if ( dll ) + { + fprintf ( OUT, "# SUBTRACT CPP /X /YX\r\n" ); + fprintf ( OUT, "# ADD BASE MTL /nologo /D \"_DEBUG\" /mktyplib203 /win32\r\n" ); + fprintf ( OUT, "# ADD MTL /nologo /D \"_DEBUG\" /mktyplib203 /win32\r\n" ); + } + fprintf ( OUT, "# ADD BASE RSC /l 0x41d /d \"_DEBUG\"\r\n" ); + fprintf ( OUT, "# ADD RSC /l 0x41d" ); + /*if ( wine )*/ + { + for ( i = 0; i < includes.size(); i++ ) + { + fprintf ( OUT, " /i \"%s\"", includes[i].c_str() ); + } + } + + for ( StringSet::const_iterator it3=defines.begin(); it3!=defines.end(); it3++ ) + { + fprintf ( OUT, " /D \"%s\"", it3->c_str() ); + } + fprintf ( OUT, " /d \"_DEBUG\"\r\n" ); + } + else + { + if ( dll ) + { + fprintf ( OUT, "# SUBTRACT CPP /YX\r\n" ); + fprintf ( OUT, "# ADD BASE MTL /nologo /D \"NDEBUG\" /mktyplib203 /win32\r\n" ); + fprintf ( OUT, "# ADD MTL /nologo /D \"NDEBUG\" /mktyplib203 /win32\r\n" ); + } + fprintf ( OUT, "# ADD BASE RSC /l 0x41d /d \"NDEBUG\"\r\n" ); + fprintf ( OUT, "# ADD RSC /l 0x41d" ); + if ( wine ) + { + for ( i = 0; i < includes.size(); i++ ) + fprintf ( OUT, " /i \"%s\"", includes[i].c_str() ); + } + + for ( StringSet::const_iterator it4=defines.begin(); it4!=defines.end(); it4++ ) + { + fprintf ( OUT, " /D \"%s\"", it4->c_str() ); + } + + + fprintf ( OUT, "/d \"NDEBUG\"\r\n" ); + } + fprintf ( OUT, "BSC32=bscmake.exe\r\n" ); + fprintf ( OUT, "# ADD BASE BSC32 /nologo\r\n" ); + fprintf ( OUT, "# ADD BSC32 /nologo\r\n" ); + + if ( exe || dll ) + { + fprintf ( OUT, "LINK32=link.exe\r\n" ); + fprintf ( OUT, "# ADD BASE LINK32 " ); + + for ( i = 0; i < libraries.size(); i++ ) + { + fprintf ( OUT, "%s ", libraries[i].c_str() ); + } + fprintf ( OUT, " /nologo" ); + if ( dll ) fprintf ( OUT, " /dll" ); + if ( console ) fprintf ( OUT, " /subsystem:console" ); + if ( debug ) fprintf ( OUT, " /debug" ); + fprintf ( OUT, " /machine:I386" ); + if ( debug ) fprintf ( OUT, " /pdbtype:sept" ); + fprintf ( OUT, "\r\n" ); + + fprintf ( OUT, "# ADD LINK32" ); + fprintf ( OUT, " /nologo" ); + // TODO FIXME - do we need their kludge? + //if ( module.name == "ntdll" ) fprintf ( OUT, " libcmt.lib" ); // FIXME: Kludge + for ( i = 0; i < imports.size(); i++ ) + { + const string& import = imports[i]; + if ( import != "msvcrt" ) + fprintf ( OUT, " %s.lib", import.c_str() ); + } + if ( dll ) fprintf ( OUT, " /dll" ); + if ( console ) fprintf ( OUT, " /subsystem:console" ); + if ( debug ) fprintf ( OUT, " /debug" ); + fprintf ( OUT, " /machine:I386" ); + // TODO FIXME - do we need their kludge? + //if ( module.name == "ntdll" ) fprintf ( OUT, " /nodefaultlib" ); // FIXME: Kludge + if ( dll ) fprintf ( OUT, " /def:\"%s.def\"", module.name.c_str() ); + if (( dll ) && ( module_type == ".cpl")) fprintf ( OUT, " /out:\"Win32\\%s%s\"", module.name.c_str(), module_type.c_str() ); + if ( debug ) fprintf ( OUT, " /pdbtype:sept" ); + fprintf ( OUT, "\r\n" ); + } + else + { + fprintf ( OUT, "LIB32=link.exe -lib\r\n" ); + fprintf ( OUT, "# ADD BASE LIB32 /nologo\r\n" ); + fprintf ( OUT, "# ADD LIB32 /nologo\r\n" ); + } + } + + if ( cfgs.size() != 0 ) + { + fprintf ( OUT, "\r\n" ); + fprintf ( OUT, "!ENDIF \r\n" ); + fprintf ( OUT, "\r\n" ); + } +#if 0 + if ( module.name == "winebuild" ) + { + fprintf ( OUT, "# Begin Special Build Tool\r\n" ); + fprintf ( OUT, "SOURCE=\"$(InputPath)\"\r\n" ); + fprintf ( OUT, "PostBuild_Desc=Copying wine.dll and wine_unicode.dll ...\r\n" ); + fprintf ( OUT, "PostBuild_Cmds=" ); + fprintf ( OUT, "copy ..\\..\\library\\%s\\wine.dll $(OutDir)\t", + output_dir.c_str() ); + fprintf ( OUT, "copy ..\\..\\unicode\\%s\\wine_unicode.dll $(OutDir)\r\n", + output_dir.c_str() ); + fprintf ( OUT, "# End Special Build Tool\r\n" ); + } +#endif + fprintf ( OUT, "# Begin Target\r\n" ); + fprintf ( OUT, "\r\n" ); + for ( i = 0; i < cfgs.size(); i++ ) + { + fprintf ( OUT, "# Name \"%s\"\r\n", cfgs[i].c_str() ); + } + + fprintf ( OUT, "# Begin Group \"Source Files\"\r\n" ); + fprintf ( OUT, "\r\n" ); + fprintf ( OUT, "# PROP Default_Filter \"cpp;c;cxx;rc;def;r;odl;idl;hpj;bat\"\r\n" ); + + for ( size_t isrcfile = 0; isrcfile < source_files.size(); isrcfile++ ) + { + string source_file = DosSeparator(source_files[isrcfile]); + + if ( strncmp ( source_file.c_str(), ".\\", 2 ) ) + { + source_file = string(".\\") + source_file; + } +#if 0 + if ( !strcmp ( &source_file[source_file.size()-5], ".spec" ) ) + { + string basename = string ( source_file.c_str(), source_file.size() - 5 ); + + // TODO FIXME - not sure what this is doing? wine hack maybe? + //if ( basename !~ /\..{1,3}$/; ) basename += string(".dll"); + string dbg_c_file = basename + ".dbg.c"; + + fprintf ( OUT, "# Begin Source File\r\n" ); + fprintf ( OUT, "\r\n" ); + fprintf ( OUT, "SOURCE=%s\r\n", dbg_c_file.c_str() ); + fprintf ( OUT, "# End Source File\r\n" ); + } +#endif + fprintf ( OUT, "# Begin Source File\r\n" ); + fprintf ( OUT, "\r\n" ); + + fprintf ( OUT, "SOURCE=%s\r\n", source_file.c_str() ); + + if ( !strcmp ( &source_file[source_file.size()-5], ".spec" ) ) + { +#if 0 + string basename = string ( source_file.c_str(), source_file.size() - 5 ); + + string spec_file = source_file; + string def_file = basename + ".def"; + + // TODO FIXME - not sure what this is doing? wine hack maybe? + //if ( basename !~ /\..{1,3}$/; ) basename += ".dll"; + string dbg_file = basename + ".dbg"; + string dbg_c_file = basename + ".dbg.c"; + + string srcdir = "."; // FIXME: Is this really always correct? + + fprintf ( OUT, "# Begin Custom Build\r\n" ); + fprintf ( OUT, "InputPath=%s\r\n", spec_file.c_str() ); + fprintf ( OUT, "\r\n" ); + fprintf ( OUT, "BuildCmds= \\\r\n" ); + fprintf ( OUT, "\t..\\..\\tools\\winebuild\\%s\\winebuild.exe --def %s > %s \\\r\n", + output_dir.c_str(), + spec_file.c_str(), + def_file.c_str() ); + + if ( module.name == "ntdll" ) + { + int n = 0; + for ( i = 0; i < c_srcs.size(); i++ ) + { + const string& c_src = c_srcs[i]; + if(n++ > 0) + { + fprintf ( OUT, "\techo %s >> %s \\\r\n", c_src.c_str(), dbg_file.c_str() ); + } + else + { + fprintf ( OUT, "\techo %s > %s \\\r\n", c_src.c_str(), dbg_file.c_str() ); + } + } + fprintf ( OUT, "\t..\\..\\tools\\winebuild\\%s\\winebuild.exe", + output_dir.c_str() ); + fprintf ( OUT, " -o %s --debug -C%s %s \\\r\n", + dbg_c_file.c_str(), + srcdir.c_str(), + dbg_file.c_str() ); + } + else + { + string sc_srcs; + for ( i = 0; i < c_srcs.size(); i++ ) + { + const string& c_src = c_srcs[i]; + if ( !strcmp ( &c_src[c_src.size()-2], ".c" ) ) + { + if ( sc_srcs.size() ) + sc_srcs += " "; + sc_srcs += c_src; + } + } + + fprintf ( OUT, "\t..\\..\\tools\\winebuild\\%s\\winebuild.exe", + output_dir.c_str() ); + fprintf ( OUT, " -o %s --debug -C%s %s \\\r\n", + dbg_c_file.c_str(), + srcdir.c_str(), + sc_srcs.c_str() ); + } + + fprintf ( OUT, "\t\r\n" ); + fprintf ( OUT, "\r\n" ); + fprintf ( OUT, "\"%s\" : $(SOURCE) \"$(INTDIR)\" \"$(OUTDIR)\"\r\n", def_file.c_str() ); + fprintf ( OUT, " $(BuildCmds)\r\n" ); + fprintf ( OUT, "\r\n" ); + fprintf ( OUT, "\"%s\" : $(SOURCE) \"$(INTDIR)\" \"$(OUTDIR)\"\r\n", dbg_c_file.c_str() ); + fprintf ( OUT, " $(BuildCmds)\r\n" ); + fprintf ( OUT, "# End Custom Build\r\n" ); +#endif + } + /*else if ( source_file =~ /([^\\]*?\.h)$/ ) + { + my $h_file = $1; + + foreach my $cfg (@cfgs) { + if($#cfgs == 0) { + # Nothing + } elsif($n == 0) { + fprintf ( OUT, "!IF \"$(CFG)\" == \"$cfg\"\r\n" ); + fprintf ( OUT, "\r\n" ); + } else { + fprintf ( OUT, "\r\n" ); + fprintf ( OUT, "!ELSEIF \"$(CFG)\" == \"$cfg\"\r\n" ); + fprintf ( OUT, "\r\n" ); + } + + $output_dir = $cfg; + $output_dir =~ s/^$project - //; + $output_dir =~ s/ /_/g; + $output_dir =~ s/C\+\+/Cxx/g; + if($output_prefix_dir) { + $output_dir = "$output_prefix_dir\\$output_dir" ); + } + + fprintf ( OUT, "# Begin Custom Build\r\n" ); + fprintf ( OUT, "OutDir=%s\r\n", output_dir.c_str() ); + fprintf ( OUT, "InputPath=%s\r\n", source_file.c_str() ); + fprintf ( OUT, "\r\n" ); + fprintf ( OUT, "\"$(OutDir)\\wine\\%s\" : $(SOURCE) \"$(INTDIR)\" \"$(OUTDIR)\"\r\n", h_file.c_str() ); + fprintf ( OUT, "\tcopy \"$(InputPath)\" \"$(OutDir)\\wine\"\r\n" ); + fprintf ( OUT, "\r\n" ); + fprintf ( OUT, "# End Custom Build\r\n" ); + } + + if ( cfgs.size() != 0) + { + fprintf ( OUT, "\r\n" ); + fprintf ( OUT, "!ENDIF \r\n" ); + fprintf ( OUT, "\r\n" ); + } + }*/ + + fprintf ( OUT, "# End Source File\r\n" ); + } + fprintf ( OUT, "# End Group\r\n" ); + fprintf ( OUT, "# Begin Group \"Header Files\"\r\n" ); + fprintf ( OUT, "\r\n" ); + fprintf ( OUT, "# PROP Default_Filter \"h;hpp;hxx;hm;inl\"\r\n" ); + for ( i = 0; i < header_files.size(); i++ ) + { + const string& header_file = header_files[i]; + fprintf ( OUT, "# Begin Source File\r\n" ); + fprintf ( OUT, "\r\n" ); + fprintf ( OUT, "SOURCE=.\\%s\r\n", header_file.c_str() ); + fprintf ( OUT, "# End Source File\r\n" ); + } + fprintf ( OUT, "# End Group\r\n" ); + + + + fprintf ( OUT, "# Begin Group \"Resource Files\"\r\n" ); + fprintf ( OUT, "\r\n" ); + fprintf ( OUT, "# PROP Default_Filter \"ico;cur;bmp;dlg;rc2;rct;bin;rgs;gif;jpg;jpeg;jpe\"\r\n" ); +/* for ( i = 0; i < resource_files.size(); i++ ) + { + const string& resource_file = resource_files[i]; + fprintf ( OUT, "# Begin Source File\r\n" ); + fprintf ( OUT, "\r\n" ); + fprintf ( OUT, "SOURCE=.\\%s\r\n", resource_file.c_str() ); + fprintf ( OUT, "# End Source File\r\n" ); + } +*/ fprintf ( OUT, "# End Group\r\n" ); + + fprintf ( OUT, "# End Target\r\n" ); + fprintf ( OUT, "# End Project\r\n" ); + + fclose(OUT); +} + +void +MSVCBackend::_generate_dsw_header ( FILE* OUT ) +{ + fprintf ( OUT, "Microsoft Developer Studio Workspace File, Format Version 6.00\r\n" ); + fprintf ( OUT, "# WARNING: DO NOT EDIT OR DELETE THIS WORKSPACE FILE!\r\n" ); + fprintf ( OUT, "\r\n" ); +} + +void +MSVCBackend::_generate_dsw_project ( + FILE* OUT, + const Module& module, + std::string dsp_file, + const std::vector& dependencies ) +{ + dsp_file = DosSeparator ( std::string(".\\") + dsp_file ); + + // TODO FIXME - must they be sorted? + //@dependencies = sort(@dependencies); + + fprintf ( OUT, "###############################################################################\r\n" ); + fprintf ( OUT, "\r\n" ); + fprintf ( OUT, "Project: \"%s\"=%s - Package Owner=<4>\r\n", module.name.c_str(), dsp_file.c_str() ); + fprintf ( OUT, "\r\n" ); + fprintf ( OUT, "Package=<5>\r\n" ); + fprintf ( OUT, "{{{\r\n" ); + fprintf ( OUT, "}}}\r\n" ); + fprintf ( OUT, "\r\n" ); + fprintf ( OUT, "Package=<4>\r\n" ); + fprintf ( OUT, "{{{\r\n" ); + for ( size_t i = 0; i < dependencies.size(); i++ ) + { + Dependency& dependency = *dependencies[i]; + fprintf ( OUT, " Begin Project Dependency\r\n" ); + fprintf ( OUT, " Project_Dep_Name %s\r\n", dependency.module.name.c_str() ); + fprintf ( OUT, " End Project Dependency\r\n" ); + } + fprintf ( OUT, "}}}\r\n" ); + fprintf ( OUT, "\r\n" ); +} + +void +MSVCBackend::_generate_dsw_footer ( FILE* OUT ) +{ + fprintf ( OUT, "###############################################################################\r\n" ); + fprintf ( OUT, "\r\n" ); + fprintf ( OUT, "Global:\r\n" ); + fprintf ( OUT, "\r\n" ); + fprintf ( OUT, "Package=<5>\r\n" ); + fprintf ( OUT, "{{{\r\n" ); + fprintf ( OUT, "}}}\r\n" ); + fprintf ( OUT, "\r\n" ); + fprintf ( OUT, "Package=<3>\r\n" ); + fprintf ( OUT, "{{{\r\n" ); + fprintf ( OUT, "}}}\r\n" ); + fprintf ( OUT, "\r\n" ); + fprintf ( OUT, "###############################################################################\r\n" ); + fprintf ( OUT, "\r\n" ); +} + +void +MSVCBackend::_generate_wine_dsw ( FILE* OUT ) +{ + _generate_dsw_header(OUT); + // TODO FIXME - is it necessary to sort them? + for( std::map::const_iterator p = ProjectNode.modules.begin(); p != ProjectNode.modules.end(); ++ p ) + { + Module& module = *p->second; + + std::string dsp_file = DspFileName ( module ); + + // TODO FIXME - more wine hacks? + /*if ( module.name == "gdi32" ) + { + for ( size_t idir = 0; idir < gdi32_dirs.size(); idir++ ) + { + string dir2 = gdi32_dirs[idir]; + $dir2 =~ s%^.*?/([^/]+)$%$1%; + + dependencies.push_back ( Replace ( "gdi32_" + dir2, "/", "_" ) ); + } + }*/ + + _generate_dsw_project ( OUT, module, dsp_file, module.dependencies ); + } + _generate_dsw_footer ( OUT ); +} diff --git a/tools/rbuild/backend/msvc/projmaker.cpp b/tools/rbuild/backend/msvc/projmaker.cpp new file mode 100644 index 00000000000..2986e859d04 --- /dev/null +++ b/tools/rbuild/backend/msvc/projmaker.cpp @@ -0,0 +1,330 @@ +/* + * Copyright (C) 2002 Patrik Stridvall + * Copyright (C) 2005 Royce Mitchell III + * Copyright (C) 2006 Hervé Poussineau + * Copyright (C) 2006 Christoph von Wittich + * Copyright (C) 2009 Ged Murphy + * + * This program is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation; either version 2 of the License, or + * (at your option) any later version. + * + * This program 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 General Public License for more details. + * + * You should have received a copy of the GNU General Public License along + * with this program; if not, write to the Free Software Foundation, Inc., + * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. + */ + +#ifdef _MSC_VER +#pragma warning ( disable : 4786 ) +#endif//_MSC_VER + +#include +#include +#include +#include +#include +#include + +#include + +#include "msvc.h" + +using std::string; +using std::vector; +using std::set; + +typedef set StringSet; + +#ifdef OUT +#undef OUT +#endif//OUT + +ProjMaker::ProjMaker ( ) +{ + vcproj_file = ""; +} + +ProjMaker::ProjMaker ( Configuration& buildConfig, + const std::vector& msvc_configs, + std::string filename ) +{ + configuration = buildConfig; + m_configurations = msvc_configs; + vcproj_file = filename; +} + +void +ProjMaker::_generate_proj_file ( const Module& module ) +{ + printf("_generate_proj_file not implemented for the base class\n"); +} + +void +ProjMaker::_generate_user_configuration() +{ +#if 0 + string computername; + string username; + string vcproj_file_user = ""; + + if (getenv ( "USERNAME" ) != NULL) + username = getenv ( "USERNAME" ); + if (getenv ( "COMPUTERNAME" ) != NULL) + computername = getenv ( "COMPUTERNAME" ); + else if (getenv ( "HOSTNAME" ) != NULL) + computername = getenv ( "HOSTNAME" ); + + if ((computername != "") && (username != "")) + vcproj_file_user = vcproj_file + "." + computername + "." + username + ".user"; + + /* User configuration file */ + if (vcproj_file_user != "") + { + OUT = fopen ( vcproj_file_user.c_str(), "wb" ); + fprintf ( OUT, "\r\n" ); + fprintf ( OUT, "\r\n" ); + + fprintf ( OUT, "\t\r\n" ); + for ( size_t icfg = 0; icfg < m_configurations.size(); icfg++ ) + { + const MSVCConfiguration& cfg = *m_configurations[icfg]; + fprintf ( OUT, "\t\t\r\n" ); + fprintf ( OUT, "\t\t\t\r\n" ); + fprintf ( OUT, "\t\t\r\n" ); + } + fprintf ( OUT, "\t\r\n" ); + fprintf ( OUT, "\r\n" ); + fclose ( OUT ); + } +#endif +} + + +void +ProjMaker::_generate_standard_configuration( const Module& module, const MSVCConfiguration& cfg, BinaryType binaryType ) +{ + printf("_generate_standard_configuration not implemented for the base class\n"); +} + +void +ProjMaker::_generate_makefile_configuration( const Module& module, const MSVCConfiguration& cfg ) +{ + printf("_generate_makefile_configuration not implemented for the base class\n"); +} + +std::string +ProjMaker::_get_vc_dir ( void ) const +{ + if ( configuration.VSProjectVersion == "8.00" ) + return "vc8"; + else if ( configuration.VSProjectVersion == "10.00" ) + return "vc10"; + else /* default to VS2008 */ + return "vc9"; +} + +std::string +ProjMaker::VcprojFileName ( const Module& module ) const +{ + return FixSeparatorForSystemCommand( + ReplaceExtension ( module.output->relative_path + "\\" + module.name, "_" + _get_vc_dir() + "_auto.vcproj" ) + ); +} + +std::string +ProjMaker::_strip_gcc_deffile(std::string Filename, std::string sourcedir, std::string objdir) +{ + std::string NewFilename = Environment::GetIntermediatePath () + "\\" + objdir + "\\" + Filename; + // we don't like infinite loops - so replace it in two steps + NewFilename = _replace_str(NewFilename, ".def", "_msvc.de"); + NewFilename = _replace_str(NewFilename, "_msvc.de", "_msvc.def"); + Filename = sourcedir + "\\" + Filename; + + Directory dir(objdir); + dir.GenerateTree(IntermediateDirectory, false); + + std::fstream in_file(Filename.c_str(), std::ios::in); + std::fstream out_file(NewFilename.c_str(), std::ios::out); + std::string::size_type pos; + DWORD i = 0; + + std::string line; + while (std::getline(in_file, line)) + { + pos = line.find("@", 0); + while (std::string::npos != pos) + { + if (pos > 1) + { + // make sure it is stdcall and no ordinal + if (line[pos -1] != ' ') + { + i = 0; + while (true) + { + i++; + if ((line[pos + i] < '0') || (line[pos + i] > '9')) + break; + } + line.replace(pos, i, ""); + } + } + pos = line.find("@", pos + 1); + } + + line += "\n"; + out_file << line; + } + in_file.close(); + out_file.close(); + + return NewFilename; +} + +std::string +ProjMaker::_replace_str(std::string string1, const std::string &find_str, const std::string &replace_str) +{ + std::string::size_type pos = string1.find(find_str, 0); + int intLen = find_str.length(); + + while(std::string::npos != pos) + { + string1.replace(pos, intLen, replace_str); + pos = string1.find(find_str, intLen + pos); + } + + return string1; +} + + +std::string +ProjMaker::_get_file_path( FileLocation* file, std::string relative_path) +{ + if (file->directory == SourceDirectory) + { + // We want the full path here for directory support later on + return Path::RelativeFromDirectory (file->relative_path, relative_path ); + } + else if(file->directory == IntermediateDirectory) + { + return std::string("$(RootIntDir)\\") + file->relative_path; + } + else if(file->directory == OutputDirectory) + { + return std::string("$(RootOutDir)\\") + file->relative_path; + } + + return std::string(""); +} + +void +ProjMaker::_collect_files(const Module& module) +{ + size_t i; + const IfableData& data = module.non_if_data; + const vector& files = data.files; + for ( i = 0; i < files.size(); i++ ) + { + string path = _get_file_path(&files[i]->file, module.output->relative_path); + string file = path + std::string("\\") + files[i]->file.name; + + if (files[i]->file.directory != SourceDirectory) + generated_files.push_back ( file ); + else if ( !stricmp ( Right(file,3).c_str(), ".rc" ) ) + resource_files.push_back ( file ); + else if ( !stricmp ( Right(file,2).c_str(), ".h" ) ) + header_files.push_back ( file ); + else + source_files.push_back ( file ); + } + const vector& incs = data.includes; + for ( i = 0; i < incs.size(); i++ ) + { + includes.push_back ( _get_file_path(incs[i]->directory, module.output->relative_path) ); + } + const vector& libs = data.libraries; + for ( i = 0; i < libs.size(); i++ ) + { + string libpath = "$(RootOutDir)\\" + libs[i]->importedModule->output->relative_path + "\\" + _get_vc_dir() + "\\$(ConfigurationName)\\" + libs[i]->name + ".lib"; + libraries.push_back ( libpath ); + } + const vector& defs = data.defines; + for ( i = 0; i < defs.size(); i++ ) + { + if ( defs[i]->backend != "" && defs[i]->backend != "msvc" ) + continue; + + if( module.isUnicode && (defs[i]->name == "UNICODE" || defs[i]->name == "_UNICODE")) + continue; + + if ( defs[i]->value != "" ) + defines.push_back( defs[i]->name + "=" + defs[i]->value ); + else + defines.push_back( defs[i]->name ); + } + for ( std::map::const_iterator p = data.properties.begin(); p != data.properties.end(); ++ p ) + { + Property& prop = *p->second; + if ( strstr ( module.baseaddress.c_str(), prop.name.c_str() ) ) + baseaddr = prop.value; + } + + if(module.importLibrary) + { + std::string ImportLibraryPath = _get_file_path(module.importLibrary->source, module.output->relative_path); + + switch (module.IsSpecDefinitionFile()) + { + case PSpec: + generated_files.push_back("$(IntDir)\\" + ReplaceExtension(module.importLibrary->source->name,".spec")); + case Spec: + generated_files.push_back("$(IntDir)\\" + ReplaceExtension(module.importLibrary->source->name,".stubs.c")); + generated_files.push_back("$(IntDir)\\" + ReplaceExtension(module.importLibrary->source->name,".def")); + default: + source_files.push_back(ImportLibraryPath + std::string("\\") + module.importLibrary->source->name); + } + } +} \ No newline at end of file diff --git a/tools/rbuild/backend/msvc/propsmaker.cpp b/tools/rbuild/backend/msvc/propsmaker.cpp new file mode 100644 index 00000000000..70f2427555b --- /dev/null +++ b/tools/rbuild/backend/msvc/propsmaker.cpp @@ -0,0 +1,195 @@ +#ifdef _MSC_VER +#pragma warning ( disable : 4786 ) +#endif//_MSC_VER + +#include +#include +#include +#include +#include +#include + +#include + +#include "msvc.h" + +using std::string; +using std::vector; +using std::set; + +typedef set StringSet; + +#ifdef OUT +#undef OUT +#endif//OUT + + +PropsMaker::PropsMaker (Project* ProjectNode, + std::string filename_props, + std::vector configurations) +{ + m_ProjectNode = ProjectNode; + m_configurations = configurations; + + OUT = fopen ( filename_props.c_str(), "wb" ); + + if ( !OUT ) + { + printf ( "Could not create file '%s'.\n", filename_props.c_str() ); + } +} + +PropsMaker::~PropsMaker ( ) +{ + fclose ( OUT ); +} + +void +PropsMaker::_generate_header() +{ + fprintf ( OUT, "\r\n"); + fprintf ( OUT, "\r\n"); +} + +void +PropsMaker::_generate_footer() +{ + fprintf ( OUT, "\r\n"); +} + +void +PropsMaker::_generate_macro(std::string Name, std::string Value) +{ + fprintf ( OUT, "\t\t<%s>%s\r\n", Name.c_str(), Value.c_str(), Name.c_str()); +} + +void +PropsMaker::_generate_global_includes(bool debug, bool use_ros_headers) +{ + fprintf ( OUT, "\t\t"); + + const IfableData& data = m_ProjectNode->non_if_data; + //const vector& files = data.files; + size_t i; + const vector& incs = data.includes; + for ( i = 0; i < incs.size(); i++ ) + { + if ((incs[i]->directory->relative_path == "include\\crt" || + incs[i]->directory->relative_path == "include\\ddk" || + incs[i]->directory->relative_path == "include\\GL" || + incs[i]->directory->relative_path == "include\\psdk") && + ! use_ros_headers) + { + continue; + } + + if(incs[i]->directory->directory == SourceDirectory) + fprintf ( OUT, "\"$(RootSrcDir)\\"); + else if (incs[i]->directory->directory == IntermediateDirectory) + fprintf ( OUT, "\"$(RootIntDir)\\"); + else if (incs[i]->directory->directory == OutputDirectory) + fprintf ( OUT, "\"$(RootOutDir)\\"); + else + continue; + + fprintf ( OUT, "%s\" ; ", incs[i]->directory->relative_path.c_str()); + } + + fprintf ( OUT, "\"$(RootIntDir)\\include\" ; "); + fprintf ( OUT, "\"$(RootIntDir)\\include\\reactos\" ; "); + + if ( !use_ros_headers ) + { + // Add WDK or PSDK paths, if user provides them + if (getenv ( "BASEDIR" ) != NULL) + { + string WdkBase = getenv ( "BASEDIR" ); + fprintf ( OUT, "\"%s\\inc\\api\" ; ", WdkBase.c_str()); + fprintf ( OUT, "\"%s\\inc\\crt\" ; ", WdkBase.c_str()); + fprintf ( OUT, "\"%s\\inc\\ddk\" ; ", WdkBase.c_str()); + } + } + fprintf ( OUT, "\t\r\n"); +} + +void +PropsMaker::_generate_global_definitions(bool debug, bool use_ros_headers) +{ + fprintf ( OUT, "\t\t"); + + // Always add _CRT_SECURE_NO_WARNINGS to disable warnings about not + // using the safe functions introduced in MSVC8. + fprintf ( OUT, "_CRT_SECURE_NO_WARNINGS ; ") ; + + if ( debug ) + { + fprintf ( OUT, "_DEBUG ; "); + } + + if ( !use_ros_headers ) + { + // this is a define in MinGW w32api, but not Microsoft's headers + fprintf ( OUT, "STDCALL=__stdcall ; "); + } + + const IfableData& data = m_ProjectNode->non_if_data; + const vector& defs = data.defines; + size_t i; + + for ( i = 0; i < defs.size(); i++ ) + { + if ( defs[i]->backend != "" && defs[i]->backend != "msvc" ) + continue; + + if ( defs[i]->value != "" ) + fprintf ( OUT, "%s=%s ; ",defs[i]->name.c_str(), defs[i]->value.c_str()); + else + fprintf ( OUT, "%s ; ", defs[i]->name.c_str()); + } + + fprintf ( OUT, "\t\r\n"); +} + +void +PropsMaker::_generate_props ( std::string solution_version, std::string studio_version ) +{ + + string srcdir = Environment::GetSourcePath(); + string intdir = Environment::GetIntermediatePath (); + string outdir = Environment::GetOutputPath (); + string rosbedir = Environment::GetVariable("_ROSBE_BASEDIR"); + + if ( intdir == "obj-i386" ) + intdir = srcdir + "\\obj-i386"; /* append relative dir from project dir */ + + if ( outdir == "output-i386" ) + outdir = srcdir + "\\output-i386"; + + _generate_header(); + + fprintf ( OUT, "\t\r\n"); + _generate_macro("RootSrcDir", srcdir); + _generate_macro("RootOutDir", outdir); + _generate_macro("RootIntDir", intdir); + _generate_macro("Tools", "$(RootOutDir)\\tools"); + _generate_macro("RosBE", rosbedir); + fprintf ( OUT, "\t\r\n"); + + for ( size_t icfg = 0; icfg < m_configurations.size(); icfg++ ) + { + MSVCConfiguration* cfg = m_configurations[icfg]; + + if(cfg->optimization == RosBuild) + continue; + + fprintf ( OUT, "\t\r\n", cfg->name.c_str() ); + _generate_global_includes(cfg->optimization == Debug, cfg->headers == ReactOSHeaders); + _generate_global_definitions(cfg->optimization == Debug, cfg->headers == ReactOSHeaders); + fprintf ( OUT, "\t\r\n"); + } + + _generate_footer(); +} diff --git a/tools/rbuild/backend/msvc/rules/reactos.defaults.props b/tools/rbuild/backend/msvc/rules/reactos.defaults.props new file mode 100644 index 00000000000..6de8e131aa4 --- /dev/null +++ b/tools/rbuild/backend/msvc/rules/reactos.defaults.props @@ -0,0 +1,27 @@ + + + + + + $(globalIncludes);$(IncludePath) + + + + $(globalIncludes);$(ProjectIncludes);%(AdditionalIncludeDirectories) + $(ProjectDefines);$(globalDefines);%(PreprocessorDefinitions) + true + CompileAsC + Cdecl + + + $(globalIncludes);$(ProjectIncludes) + __ASM__ + + + $(globalIncludes);$(ProjectIncludes) + + + $(globalIncludes);$(ProjectIncludes);%(AdditionalIncludeDirectories) + + + \ No newline at end of file diff --git a/tools/rbuild/backend/msvc/rules/reactos.targets b/tools/rbuild/backend/msvc/rules/reactos.targets new file mode 100644 index 00000000000..e3c2e377314 --- /dev/null +++ b/tools/rbuild/backend/msvc/rules/reactos.targets @@ -0,0 +1,6 @@ + + + + + + \ No newline at end of file diff --git a/tools/rbuild/backend/msvc/rules/s_as_mscpp.props b/tools/rbuild/backend/msvc/rules/s_as_mscpp.props new file mode 100644 index 00000000000..b9a8d0d05a0 --- /dev/null +++ b/tools/rbuild/backend/msvc/rules/s_as_mscpp.props @@ -0,0 +1,21 @@ + + + + Midl + CustomBuild + + + _SelectedFiles;$(s_as_mscppDependsOn) + + + + $(IntDir)%(Filename).obj + $(globalIncludes) + cl /nologo /E [sIncPaths] [sPPDefs] "%(FullPath)" | "$(RosBE)\i386\bin\as" -o [sOutF] + %(sOutF) + Assembling + + + \ No newline at end of file diff --git a/tools/rbuild/backend/msvc/rules/s_as_mscpp.rules b/tools/rbuild/backend/msvc/rules/s_as_mscpp.rules new file mode 100644 index 00000000000..ec4a41b742c --- /dev/null +++ b/tools/rbuild/backend/msvc/rules/s_as_mscpp.rules @@ -0,0 +1,44 @@ + + + + + + + + + + + + + diff --git a/tools/rbuild/backend/msvc/rules/s_as_mscpp.targets b/tools/rbuild/backend/msvc/rules/s_as_mscpp.targets new file mode 100644 index 00000000000..39abb5b2f04 --- /dev/null +++ b/tools/rbuild/backend/msvc/rules/s_as_mscpp.targets @@ -0,0 +1,84 @@ + + + + + + _s_as_mscpp + + + + $(MSBuildThisFileDirectory)$(MSBuildThisFileName).xml + + + + + + + + @(s_as_mscpp, '|') + + + + + + + + + $(ComputeLinkInputsTargets); + Computes_as_mscppOutput; + + + $(ComputeLibInputsTargets); + Computes_as_mscppOutput; + + + + + + + + + + + + \ No newline at end of file diff --git a/tools/rbuild/backend/msvc/rules/s_as_mscpp.xml b/tools/rbuild/backend/msvc/rules/s_as_mscpp.xml new file mode 100644 index 00000000000..b2a71f56073 --- /dev/null +++ b/tools/rbuild/backend/msvc/rules/s_as_mscpp.xml @@ -0,0 +1,145 @@ + + + + + + + + + + General + + + + + Command Line + + + + + + + + + + + + + + + Execute Before + + + Specifies the targets for the build customization to run before. + + + + + + + + + + + Execute After + + + Specifies the targets for the build customization to run after. + + + + + + + + + + + + + + Additional Options + + + Additional Options + + + + + + + \ No newline at end of file diff --git a/tools/rbuild/backend/msvc/rules/spec.props b/tools/rbuild/backend/msvc/rules/spec.props new file mode 100644 index 00000000000..32906ec895c --- /dev/null +++ b/tools/rbuild/backend/msvc/rules/spec.props @@ -0,0 +1,38 @@ + + + + Midl + Pspec + + + _SelectedFiles;$(specDependsOn) + + + + $(IntDir)%(Filename).def + $(IntDir)%(Filename).stubs.c + "$(Tools)\winebuild\winebuild.exe" -F $(TargetFileName) -o [DefFile] --def -k -E [inputs] | "$(Tools)\winebuild\winebuild.exe" -F $(TargetFileName) -o [StubsFile] --pedll -k -E [inputs] + [DefFile] + Generating module definition file + + + + spec + CustomBuild + + + _SelectedFiles;$(PspecDependsOn) + + + + $(IntDir)%(Filename).spec + cl /nologo /EP [includes] [inputs] > [Specfile] + [Specfile] + Generating module definition file + + + \ No newline at end of file diff --git a/tools/rbuild/backend/msvc/rules/spec.rules b/tools/rbuild/backend/msvc/rules/spec.rules new file mode 100644 index 00000000000..ef13f59e885 --- /dev/null +++ b/tools/rbuild/backend/msvc/rules/spec.rules @@ -0,0 +1,57 @@ + + + + + + + + + + + + + + + + + diff --git a/tools/rbuild/backend/msvc/rules/spec.targets b/tools/rbuild/backend/msvc/rules/spec.targets new file mode 100644 index 00000000000..901cc156762 --- /dev/null +++ b/tools/rbuild/backend/msvc/rules/spec.targets @@ -0,0 +1,159 @@ + + + + + + _spec + + + _Pspec + + + + $(MSBuildThisFileDirectory)$(MSBuildThisFileName).xml + + + $(MSBuildThisFileDirectory)$(MSBuildThisFileName).xml + + + + + + + + @(spec, '|') + + + + + + + + + $(ComputeLinkInputsTargets); + ComputespecOutput; + + + $(ComputeLibInputsTargets); + ComputespecOutput; + + + + + + + + + + + + + + + + + + @(Pspec, '|') + + + + + + + + + $(ComputeLinkInputsTargets); + ComputePspecOutput; + + + $(ComputeLibInputsTargets); + ComputePspecOutput; + + + + + + + + + + + + \ No newline at end of file diff --git a/tools/rbuild/backend/msvc/rules/spec.xml b/tools/rbuild/backend/msvc/rules/spec.xml new file mode 100644 index 00000000000..db15656b23b --- /dev/null +++ b/tools/rbuild/backend/msvc/rules/spec.xml @@ -0,0 +1,274 @@ + + + + + + + + + + General + + + + + Command Line + + + + + + + + + + + + + + Execute Before + + + Specifies the targets for the build customization to run before. + + + + + + + + + + + Execute After + + + Specifies the targets for the build customization to run after. + + + + + + + + + + + + + + Additional Options + + + Additional Options + + + + + + + + + + + + + + General + + + + + Command Line + + + + + + + + + + + + + + Execute Before + + + Specifies the targets for the build customization to run before. + + + + + + + + + + + Execute After + + + Specifies the targets for the build customization to run after. + + + + + + + + + + + + + + Additional Options + + + Additional Options + + + + + + + \ No newline at end of file diff --git a/tools/rbuild/backend/msvc/slnmaker.cpp b/tools/rbuild/backend/msvc/slnmaker.cpp new file mode 100644 index 00000000000..ebc2dc8d6c5 --- /dev/null +++ b/tools/rbuild/backend/msvc/slnmaker.cpp @@ -0,0 +1,137 @@ +/* + * Copyright (C) 2002 Patrik Stridvall + * Copyright (C) 2005 Royce Mitchell III + * Copyright (C) 2006 Hervé Poussineau + * Copyright (C) 2006 Christoph von Wittich + * Copyright (C) 2009 Ged Murphy + * + * This program is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation; either version 2 of the License, or + * (at your option) any later version. + * + * This program 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 General Public License for more details. + * + * You should have received a copy of the GNU General Public License along + * with this program; if not, write to the Free Software Foundation, Inc., + * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. + */ + +#ifdef _MSC_VER +#pragma warning ( disable : 4786 ) +#endif//_MSC_VER + +#include +#include +#include +#include +#include +#include + +#include + +#include "msvc.h" + +using std::string; +using std::vector; +using std::set; + + + +SlnMaker::SlnMaker ( Configuration& buildConfig, + const std::vector& configurations, + std::string filename_sln, + std::string solution_version, + std::string studio_version) +{ + m_configuration = buildConfig; + m_configurations = configurations; + + OUT = fopen ( filename_sln.c_str(), "wb" ); + + if ( !OUT ) + { + printf ( "Could not create file '%s'.\n", filename_sln.c_str() ); + } + + _generate_sln_header( solution_version, studio_version); +} + +SlnMaker::~SlnMaker() +{ + _generate_sln_footer ( ); + fclose ( OUT ); +} + +void +SlnMaker::_generate_sln_header ( std::string solution_version, std::string studio_version ) +{ + //fprintf ( OUT, "Microsoft Visual Studio Solution File, Format Version %s\r\n", _get_solution_version().c_str() ); + //fprintf ( OUT, "# Visual Studio %s\r\n", _get_studio_version().c_str() ); + fprintf ( OUT, "Microsoft Visual Studio Solution File, Format Version %s\r\n", solution_version.c_str() ); + fprintf ( OUT, "# Visual Studio %s\r\n", studio_version.c_str() ); + fprintf ( OUT, "\r\n" ); +} + +void +SlnMaker::_generate_sln_footer ( ) +{ + fprintf ( OUT, "Global\r\n" ); + fprintf ( OUT, "\tGlobalSection(SolutionConfigurationPlatforms) = preSolution\r\n" ); + for ( size_t i = 0; i < m_configurations.size(); i++ ) + fprintf ( OUT, "\t\t%s = %s\r\n", m_configurations[i]->name.c_str(), m_configurations[i]->name.c_str() ); + fprintf ( OUT, "\tEndGlobalSection\r\n" ); + + fprintf ( OUT, "\tGlobalSection(ProjectConfigurationPlatforms) = postSolution\r\n" ); + for ( size_t i = 0; i < modules.size (); i++) + { + _generate_sln_configurations ( modules[i]->guid.c_str() ); + } + fprintf ( OUT, "\tEndGlobalSection\r\n" ); +/* + fprintf ( OUT, "\tGlobalSection(ExtensibilityGlobals) = postSolution\r\n" ); + fprintf ( OUT, "\tEndGlobalSection\r\n" ); + fprintf ( OUT, "\tGlobalSection(ExtensibilityAddIns) = postSolution\r\n" ); + fprintf ( OUT, "\tEndGlobalSection\r\n" ); +*/ + + if (m_configuration.VSProjectVersion == "7.00") { + fprintf ( OUT, "\tGlobalSection(ProjectDependencies) = postSolution\r\n" ); + //FIXME: Add dependencies for VS 2002 + fprintf ( OUT, "\tEndGlobalSection\r\n" ); + } + else { + fprintf ( OUT, "\tGlobalSection(SolutionProperties) = preSolution\r\n" ); + fprintf ( OUT, "\t\tHideSolutionNode = FALSE\r\n" ); + fprintf ( OUT, "\tEndGlobalSection\r\n" ); + } + + fprintf ( OUT, "EndGlobal\r\n" ); + fprintf ( OUT, "\r\n" ); +} + + +void +SlnMaker::_generate_sln_configurations ( std::string vcproj_guid ) +{ + for ( size_t i = 0; i < m_configurations.size (); i++) + { + const MSVCConfiguration& cfg = *m_configurations[i]; + fprintf ( OUT, "\t\t%s.%s|Win32.ActiveCfg = %s|Win32\r\n", vcproj_guid.c_str(), cfg.name.c_str(), cfg.name.c_str() ); + fprintf ( OUT, "\t\t%s.%s|Win32.Build.0 = %s|Win32\r\n", vcproj_guid.c_str(), cfg.name.c_str(), cfg.name.c_str() ); + } +} + +void +SlnMaker::_add_project(ProjMaker &project, Module &module) +{ + string sln_guid = "{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}"; + + fprintf ( OUT, "Project(\"%s\") = \"%s\", \".\\%s\",\"%s\"\n", sln_guid.c_str(), module.name.c_str() , project.VcprojFileName(module).c_str() , module.guid.c_str()); + fprintf ( OUT, "EndProject\r\n" ); + + modules.push_back(&module); +} diff --git a/tools/rbuild/backend/msvc/vcprojmaker.cpp b/tools/rbuild/backend/msvc/vcprojmaker.cpp new file mode 100644 index 00000000000..b09658d18df --- /dev/null +++ b/tools/rbuild/backend/msvc/vcprojmaker.cpp @@ -0,0 +1,674 @@ +/* + * Copyright (C) 2002 Patrik Stridvall + * Copyright (C) 2005 Royce Mitchell III + * Copyright (C) 2006 Hervé Poussineau + * Copyright (C) 2006 Christoph von Wittich + * Copyright (C) 2009 Ged Murphy + * + * This program is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation; either version 2 of the License, or + * (at your option) any later version. + * + * This program 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 General Public License for more details. + * + * You should have received a copy of the GNU General Public License along + * with this program; if not, write to the Free Software Foundation, Inc., + * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. + */ + +#ifdef _MSC_VER +#pragma warning ( disable : 4786 ) +#endif//_MSC_VER + +#include +#include +#include +#include +#include +#include + +#include + +#include "msvc.h" + +using std::string; +using std::vector; +using std::set; + +typedef set StringSet; + +#ifdef OUT +#undef OUT +#endif//OUT + +struct SortFilesAscending +{ + bool operator()(const string& rhs, const string& lhs) + { + return rhs < lhs; + } +}; + + +VCProjMaker::VCProjMaker ( ) +{ + vcproj_file = ""; +} + +VCProjMaker::VCProjMaker ( Configuration& buildConfig, + const std::vector& msvc_configs, + std::string filename, + const Module& module) +{ + configuration = buildConfig; + m_configurations = msvc_configs; + vcproj_file = filename; + + OUT = fopen ( vcproj_file.c_str(), "wb" ); + + if ( !OUT ) + { + printf ( "Could not create file '%s'.\n", vcproj_file.c_str() ); + } + + // Set the binary type + string module_type = GetExtension(*module.output); + + if ((module.type == ObjectLibrary) || (module.type == RpcClient) ||(module.type == RpcServer) || (module_type == ".lib") || (module_type == ".a")) + binaryType = Lib; + else if ((module_type == ".dll") || (module_type == ".cpl")) + binaryType = Dll; + else if ((module_type == ".exe") || (module_type == ".scr")) + binaryType = Exe; + else if (module_type == ".sys") + binaryType = Sys; + else + binaryType = BinUnknown; + +} + +VCProjMaker::~VCProjMaker() +{ + fclose ( OUT ); +} + +void +VCProjMaker::_generate_proj_file ( const Module& module ) +{ + size_t i; + + printf ( "Creating MSVC project: '%s'\n", vcproj_file.c_str() ); + + string path_basedir = module.GetPathToBaseDir (); + + _collect_files(module); + + fprintf ( OUT, "\r\n" ); + fprintf ( OUT, "\r\n" ); + + fprintf ( OUT, "\t\r\n" ); + fprintf ( OUT, "\t\t\r\n" ); + fprintf ( OUT, "\t\r\n" ); + + fprintf ( OUT, "\t\r\n" ); + fprintf ( OUT, "\t\t\r\n" ); + fprintf ( OUT, "\t\t\r\n" ); + fprintf ( OUT, "\t\r\n" ); + + // Write out all the configurations + fprintf ( OUT, "\t\r\n" ); + for ( size_t icfg = 0; icfg < m_configurations.size(); icfg++ ) + { + const MSVCConfiguration& cfg = *m_configurations[icfg]; + + if ( cfg.optimization == RosBuild ) + { + _generate_makefile_configuration( module, cfg ); + } + else + { + _generate_standard_configuration( module, cfg, binaryType ); + } + } + fprintf ( OUT, "\t\r\n" ); + + // Write out the project files + fprintf ( OUT, "\t\r\n" ); + + // Generated files + fprintf ( OUT, "\t\t\r\n" ); + for( i = 0; i < generated_files.size(); i++) + { + string source_file = DosSeparator(generated_files[i]); + + fprintf ( OUT, "\t\t\t\r\n", source_file.c_str() ); + fprintf ( OUT, "\t\t\t\r\n"); + } + fprintf ( OUT, "\t\t\r\n" ); + + // Source files + fprintf ( OUT, "\t\t\r\n" ); + + std::sort(source_files.begin(), source_files.end(), SortFilesAscending()); + vector last_folder; + vector split_path; + string indent_tab("\t\t\t"); + + for ( size_t isrcfile = 0; isrcfile < source_files.size(); isrcfile++ ) + { + string source_file = DosSeparator(source_files[isrcfile]); + + Path::Split(split_path, source_file, false); + size_t same_folder_index = 0; + for ( size_t ifolder = 0; ifolder < last_folder.size(); ifolder++ ) + { + if ( ifolder < split_path.size() && last_folder[ifolder] == split_path[ifolder] ) + ++same_folder_index; + else + break; + } + + if ( same_folder_index < split_path.size() || last_folder.size() > split_path.size() ) + { + int tabStart = 1; + if ( split_path.size() > last_folder.size() ) + { + for ( size_t ifolder = last_folder.size(); ifolder < split_path.size(); ifolder++ ) + indent_tab.push_back('\t'); + tabStart = split_path.size() - last_folder.size() + 1; + } + else if ( split_path.size() < last_folder.size() ) + { + indent_tab.resize( split_path.size() + 3 ); + tabStart = split_path.size() - last_folder.size() + 1; + } + + for ( size_t ifolder = last_folder.size(), itab = tabStart; ifolder > same_folder_index; ifolder--, itab++ ) + { + fprintf ( OUT, "%s\r\n", indent_tab.substr(0, indent_tab.size() - itab).c_str() ); + } + + for ( size_t ifolder = same_folder_index, itab = split_path.size() - same_folder_index; ifolder < split_path.size(); ifolder++, itab-- ) + { + const string tab = indent_tab.substr(0, indent_tab.size() - itab); + fprintf ( OUT, "%s\r\n", tab.c_str(), split_path[ifolder].c_str() ); + } + + last_folder = split_path; + } + + fprintf ( OUT, "%s\r\n", indent_tab.c_str(), source_file.c_str() ); + + for ( size_t iconfig = 0; iconfig < m_configurations.size(); iconfig++ ) + { + const MSVCConfiguration& config = *m_configurations[iconfig]; + + //if (configuration.VSProjectVersion < "8.00") { + if ((source_file.find(".idl") != string::npos) || ((source_file.find(".asm") != string::npos))) + { + fprintf ( OUT, "%s\t\r\n" ); +#if 0 + fprintf ( OUT, "%s\t\t\r\n", indent_tab.c_str() ); + } + else if ((source_file.find(".asm") != string::npos)) + { + fprintf ( OUT, "%s\t\t\tName=\"VCCustomBuildTool\"\r\n", indent_tab.c_str() ); + fprintf ( OUT, "%s\t\t\tCommandLine=\"nasmw $(InputPath) -f coff -o "$(OutDir)\\$(InputName).obj"\"\r\n", indent_tab.c_str() ); + fprintf ( OUT, "%s\t\t\tOutputs=\"$(OutDir)\\$(InputName).obj\"/>\r\n", indent_tab.c_str() ); + } +#endif + fprintf ( OUT, "%s\t\r\n", indent_tab.c_str() ); + } + //} + } + fprintf ( OUT, "%s\r\n", indent_tab.c_str() ); + } + + for ( size_t ifolder = last_folder.size(); ifolder > 0; ifolder-- ) + { + indent_tab.resize( ifolder + 2 ); + fprintf ( OUT, "%s\r\n", indent_tab.c_str() ); + } + + fprintf ( OUT, "\t\t\r\n" ); + + // Header files + fprintf ( OUT, "\t\t\r\n" ); + for ( i = 0; i < header_files.size(); i++ ) + { + fprintf ( OUT, "\t\t\t\r\n", header_files[i].c_str() ); + fprintf ( OUT, "\t\t\t\r\n" ); + } + fprintf ( OUT, "\t\t\r\n" ); + + // Resource files + fprintf ( OUT, "\t\t\r\n" ); + for ( i = 0; i < resource_files.size(); i++ ) + { + fprintf ( OUT, "\t\t\t\r\n", resource_files[i].c_str() ); + fprintf ( OUT, "\t\t\t\r\n" ); + } + fprintf ( OUT, "\t\t\r\n" ); + + fprintf ( OUT, "\t\r\n" ); + fprintf ( OUT, "\t\r\n" ); + fprintf ( OUT, "\t\r\n" ); + fprintf ( OUT, "\r\n" ); +} + +void VCProjMaker::_generate_user_configuration () +{ + // Call base implementation + ProjMaker::_generate_user_configuration (); +} + +void VCProjMaker::_generate_standard_configuration( const Module& module, + const MSVCConfiguration& cfg, + BinaryType binaryType ) +{ + string path_basedir = module.GetPathToBaseDir (); + string vcdir; + + bool include_idl = false; + + size_t i; + string intermediatedir = ""; + string importLib; + + if ( configuration.UseVSVersionInPath ) + { + vcdir = DEF_SSEP + _get_vc_dir(); + } + + if(module.IsSpecDefinitionFile()) + { + importLib = "$(IntDir)\\$(ProjectName).def"; + } + else if (module.importLibrary != NULL) + { + intermediatedir = module.output->relative_path + vcdir; + importLib = _strip_gcc_deffile(module.importLibrary->source->name, module.importLibrary->source->relative_path, intermediatedir); + importLib = Path::RelativeFromDirectory ( + importLib, + module.output->relative_path ); + } + + string module_type = GetExtension(*module.output); + + // Set the configuration type for this config + ConfigurationType CfgType; + if ( binaryType == Exe ) + CfgType = ConfigApp; + else if ( binaryType == Lib ) + CfgType = ConfigLib; + else if ( binaryType == Dll || binaryType == Sys ) + CfgType = ConfigDll; + else + CfgType = ConfigUnknown; + + fprintf ( OUT, "\t\trelative_path.c_str (), vcdir.c_str () ); + fprintf ( OUT, "\t\t\tIntermediateDirectory=\"$(RootIntDir)\\%s%s\\$(ConfigurationName)\"\r\n", module.output->relative_path.c_str (), vcdir.c_str () ); + } + else + { + fprintf ( OUT, "\t\t\tOutputDirectory=\"$(RootOutDir)\\%s%s\"\r\n", module.output->relative_path.c_str (), vcdir.c_str () ); + fprintf ( OUT, "\t\t\tIntermediateDirectory=\"$(RootIntDir)\\%s%s\"\r\n", module.output->relative_path.c_str (), vcdir.c_str () ); + } + + fprintf ( OUT, "\t\t\tConfigurationType=\"%d\"\r\n", CfgType ); + + fprintf ( OUT, "\t\t\tInheritedPropertySheets=\"%s\\%s.vsprops\"\r\n", path_basedir.c_str (), cfg.name.c_str ()); + fprintf ( OUT, "\t\t\tCharacterSet=\"%s\"\r\n", module.isUnicode ? "1" : "2" ); + fprintf ( OUT, "\t\t\t>\r\n" ); + + fprintf ( OUT, "\t\t\t\r\n" ); + + fprintf ( OUT, "\t\t\t\r\n" ); + + + fprintf ( OUT, "\t\t\tfile->name, + module.output->relative_path ); + string::size_type pos = pch_path.find_last_of ("/"); + if ( pos != string::npos ) + pch_path.erase(0, pos+1); + fprintf ( OUT, "\t\t\t\tPrecompiledHeaderThrough=\"%s\"\r\n", pch_path.c_str() ); + + // Only include from the same module + pos = pch_path.find("../"); + if (pos == string::npos && std::find(header_files.begin(), header_files.end(), pch_path) == header_files.end()) + header_files.push_back(pch_path); + } +#endif + + if ( module.cplusplus ) + fprintf ( OUT, "\t\t\t\tCompileAs=\"2\"\r\n" ); + + fprintf ( OUT, "\t\t\t/>\r\n"); + + fprintf ( OUT, "\t\t\t\r\n" ); + + if ( binaryType != Lib ) + { + fprintf ( OUT, "\t\t\t 0 ) + fprintf ( OUT, " " ); + string libpath = libraries[i].c_str(); + libpath = libpath.erase (0, libpath.find_last_of ("\\") + 1 ); + if ( libpath == "msvcrt.lib" ) + { + use_msvcrt_lib = true; + } + fprintf ( OUT, "%s", libpath.c_str() ); + } + fprintf ( OUT, "\"\r\n" ); + + fprintf ( OUT, "\t\t\t\tAdditionalLibraryDirectories=\"" ); + + // Add conventional libraries dirs + for (i = 0; i < libraries.size (); i++) + { + if ( i > 0 ) + fprintf ( OUT, ";" ); + + string libpath = libraries[i].c_str(); + libpath = libpath.substr (0, libpath.find_last_of ("\\") ); + fprintf ( OUT, "%s", libpath.c_str() ); + } + + fprintf ( OUT, "\"\r\n" ); + + fprintf ( OUT, "\t\t\t\tOutputFile=\"$(OutDir)/%s%s\"\r\n", module.name.c_str(), module_type.c_str() ); + if ( binaryType == Sys ) + { + if (module.GetEntryPoint() == "0") + fprintf ( OUT, "\t\t\t\tAdditionalOptions=\" /noentry /ALIGN:0x20 /SECTION:INIT,D /IGNORE:4001,4037,4039,4065,4070,4078,4087,4089,4096\"\r\n" ); + else + fprintf ( OUT, "\t\t\t\tAdditionalOptions=\" /ALIGN:0x20 /SECTION:INIT,D /IGNORE:4001,4037,4039,4065,4070,4078,4087,4089,4096\"\r\n" ); + fprintf ( OUT, "\t\t\t\tIgnoreAllDefaultLibraries=\"TRUE\"\r\n" ); + fprintf ( OUT, "\t\t\t\tGenerateManifest=\"FALSE\"\r\n" ); + fprintf ( OUT, "\t\t\t\tSubSystem=\"%d\"\r\n", 3 ); + fprintf ( OUT, "\t\t\t\tDriver=\"%d\"\r\n", 1 ); + fprintf ( OUT, "\t\t\t\tEntryPointSymbol=\"%s\"\r\n", module.GetEntryPoint() == "" ? "DriverEntry" : module.GetEntryPoint().c_str ()); + fprintf ( OUT, "\t\t\t\tBaseAddress=\"%s\"\r\n", baseaddr == "" ? "0x10000" : baseaddr.c_str ()); + } + else if ( binaryType == Exe ) + { + if ( module.type == Kernel ) + { + fprintf ( OUT, "\t\t\t\tAdditionalOptions=\" /SECTION:INIT,D /ALIGN:0x80\"\r\n" ); + fprintf ( OUT, "\t\t\t\tIgnoreAllDefaultLibraries=\"TRUE\"\r\n" ); + fprintf ( OUT, "\t\t\t\tGenerateManifest=\"FALSE\"\r\n" ); + fprintf ( OUT, "\t\t\t\tSubSystem=\"%d\"\r\n", 3 ); + fprintf ( OUT, "\t\t\t\tDriver=\"%d\"\r\n", 1 ); + fprintf ( OUT, "\t\t\t\tEntryPointSymbol=\"KiSystemStartup\"\r\n" ); + fprintf ( OUT, "\t\t\t\tBaseAddress=\"%s\"\r\n", baseaddr.c_str ()); + } + else if ( module.type == NativeCUI ) + { + fprintf ( OUT, "\t\t\t\tAdditionalOptions=\" /ALIGN:0x20\"\r\n" ); + fprintf ( OUT, "\t\t\t\tSubSystem=\"%d\"\r\n", 1 ); + fprintf ( OUT, "\t\t\t\tGenerateManifest=\"FALSE\"\r\n" ); + fprintf ( OUT, "\t\t\t\tIgnoreAllDefaultLibraries=\"TRUE\"\r\n" ); + fprintf ( OUT, "\t\t\t\tEntryPointSymbol=\"NtProcessStartup\"\r\n" ); + fprintf ( OUT, "\t\t\t\tBaseAddress=\"%s\"\r\n", baseaddr.c_str ()); + } + else if ( module.type == Win32CUI || module.type == Win32GUI || module.type == Win32SCR) + { + if ( use_msvcrt_lib ) + { + fprintf ( OUT, "\t\t\t\tIgnoreAllDefaultLibraries=\"TRUE\"\r\n" ); + } + fprintf ( OUT, "\t\t\t\tSubSystem=\"%d\"\r\n", 2 ); + } + } + else if ( binaryType == Dll ) + { + if (module.GetEntryPoint() == "0") + fprintf ( OUT, "\t\t\t\tEntryPointSymbol=\"\"\r\n" ); + else + { + // get rid of DllMain@12 because MSVC needs to link to _DllMainCRTStartup@12 + // when using CRT + if (module.GetEntryPoint() == "DllMain@12") + fprintf ( OUT, "\t\t\t\tEntryPointSymbol=\"\"\r\n" ); + else + fprintf ( OUT, "\t\t\t\tEntryPointSymbol=\"%s\"\r\n", module.GetEntryPoint().c_str ()); + } + fprintf ( OUT, "\t\t\t\tBaseAddress=\"%s\"\r\n", baseaddr == "" ? "0x40000" : baseaddr.c_str ()); + if ( use_msvcrt_lib ) + { + fprintf ( OUT, "\t\t\t\tIgnoreAllDefaultLibraries=\"TRUE\"\r\n" ); + } + } + fprintf ( OUT, "\t\t\t/>\r\n" ); + } + + fprintf ( OUT, "\t\t\t\r\n " ); + + fprintf ( OUT, "\t\t\t\r\n" ); + if (configuration.VSProjectVersion == "8.00") + { + fprintf ( OUT, "\t\t\t\r\n" ); + } + fprintf ( OUT, "\t\t\r\n" ); +} + + +void +VCProjMaker::_generate_makefile_configuration( const Module& module, const MSVCConfiguration& cfg ) +{ + string path_basedir = module.GetPathToBaseDir (); + string intenv = Environment::GetIntermediatePath (); + string outenv = Environment::GetOutputPath (); + + string outdir; + string intdir; + + if ( intenv == "obj-i386" ) + intdir = path_basedir + "obj-i386"; /* append relative dir from project dir */ + else + intdir = intenv; + + if ( outenv == "output-i386" ) + outdir = path_basedir + "output-i386"; + else + outdir = outenv; + + fprintf ( OUT, "\t\trelative_path.c_str (), cfg.name.c_str() ); + fprintf ( OUT, "\t\t\tIntermediateDirectory=\"%s\\%s\\%s\"\r\n", intdir.c_str (), module.output->relative_path.c_str (), cfg.name.c_str() ); + } + else + { + fprintf ( OUT, "\t\t\tOutputDirectory=\"%s\\%s\"\r\n", outdir.c_str (), module.output->relative_path.c_str () ); + fprintf ( OUT, "\t\t\tIntermediateDirectory=\"%s\\%s\"\r\n", intdir.c_str (), module.output->relative_path.c_str () ); + } + + fprintf ( OUT, "\t\t\tConfigurationType=\"0\"\r\n"); + fprintf ( OUT, "\t\t\t>\r\n" ); + + fprintf ( OUT, "\t\t\t\r\n" ); + fprintf ( OUT, "\t\t\r\n" ); +} diff --git a/tools/rbuild/backend/msvc/vcxprojmaker.cpp b/tools/rbuild/backend/msvc/vcxprojmaker.cpp new file mode 100644 index 00000000000..33331130043 --- /dev/null +++ b/tools/rbuild/backend/msvc/vcxprojmaker.cpp @@ -0,0 +1,282 @@ +/* + * Copyright (C) 2002 Patrik Stridvall + * Copyright (C) 2005 Royce Mitchell III + * Copyright (C) 2006 Hervé Poussineau + * Copyright (C) 2006 Christoph von Wittich + * Copyright (C) 2009 Ged Murphy + * + * This program is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation; either version 2 of the License, or + * (at your option) any later version. + * + * This program 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 General Public License for more details. + * + * You should have received a copy of the GNU General Public License along + * with this program; if not, write to the Free Software Foundation, Inc., + * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. + */ + +#ifdef _MSC_VER +#pragma warning ( disable : 4786 ) +#endif//_MSC_VER + +#include +#include +#include +#include +#include +#include + +#include + +#include "msvc.h" + +using std::string; +using std::vector; +using std::set; + +typedef set StringSet; + +#ifdef OUT +#undef OUT +#endif//OUT + + +VCXProjMaker::VCXProjMaker ( ) +{ + vcproj_file = ""; +} + +VCXProjMaker::VCXProjMaker ( Configuration& buildConfig, + const std::vector& msvc_configs, + std::string filename, + const Module& module) +{ + configuration = buildConfig; + m_configurations = msvc_configs; + vcproj_file = filename; + + OUT = fopen ( vcproj_file.c_str(), "wb" ); + + if ( !OUT ) + { + printf ( "Could not create file '%s'.\n", vcproj_file.c_str() ); + } + + // Set the binary type + string module_type = GetExtension(*module.output); + + if ((module.type == ObjectLibrary) || (module.type == RpcClient) ||(module.type == RpcServer) || (module_type == ".lib") || (module_type == ".a")) + binaryType = Lib; + else if ((module_type == ".dll") || (module_type == ".cpl")) + binaryType = Dll; + else if ((module_type == ".exe") || (module_type == ".scr")) + binaryType = Exe; + else if (module_type == ".sys") + binaryType = Sys; + else + binaryType = BinUnknown; +} + +VCXProjMaker::~VCXProjMaker() +{ + fclose ( OUT ); +} + +void +VCXProjMaker::_generate_item_group (std::vector files) +{ + size_t i; + + for( i = 0; i\r\n", files[i].c_str()); + else if( extension == ".s") + fprintf ( OUT, "\t\t\r\n", files[i].c_str()); + else if( extension == ".spec") + fprintf ( OUT, "\t\t\r\n", files[i].c_str()); + else if( extension == ".pspec") + fprintf ( OUT, "\t\t\r\n", files[i].c_str()); + else if( extension == ".rc") + fprintf ( OUT, "\t\t\r\n", files[i].c_str()); + else if( extension == ".h") + fprintf ( OUT, "\t\t\r\n", files[i].c_str()); + else + fprintf ( OUT, "\t\t\r\n", files[i].c_str()); + } +} + +string +VCXProjMaker::_get_configuration_type () +{ + switch (binaryType) + { + case Exe: + return "Application"; + case Dll: + case Sys: + return "DynamicLibrary"; + case Lib: + return "StaticLibrary"; + default: + return ""; + } +} + +void +VCXProjMaker::_generate_proj_file ( const Module& module ) +{ + string path_basedir = module.GetPathToBaseDir (); + size_t i; + string vcdir; + + if ( configuration.UseVSVersionInPath ) + { + vcdir = DEF_SSEP + _get_vc_dir(); + } + + printf ( "Creating MSVC project: '%s'\n", vcproj_file.c_str() ); + + _collect_files(module); + + fprintf ( OUT, "\r\n" ); + fprintf ( OUT, "\r\n" ); + + if (configuration.VSProjectVersion.empty()) + configuration.VSProjectVersion = "10.00"; + + // Write out the configurations + fprintf ( OUT, "\t\r\n" ); + for ( size_t icfg = 0; icfg < m_configurations.size(); icfg++ ) + { + const MSVCConfiguration& cfg = *m_configurations[icfg]; + + if ( cfg.optimization == RosBuild ) + _generate_makefile_configuration( module, cfg ); + else + _generate_standard_configuration( module, cfg, binaryType ); + } + fprintf ( OUT, "\t\r\n\r\n" ); + + // Write out the global info + fprintf ( OUT, "\t\r\n" ); + fprintf ( OUT, "\t\t{%s}\r\n", module.guid.c_str() ); + fprintf ( OUT, "\t\t%s\r\n", "Win32Proj" ); //FIXME: Win32Proj??? + fprintf ( OUT, "\t\t%s\r\n", module.name.c_str() ); //FIXME: shouldn't this be the soltion name? + fprintf ( OUT, "\t\r\n" ); + fprintf ( OUT, "\r\n" ); + + fprintf ( OUT, "\t\r\n"); + if( binaryType != BinUnknown) + fprintf ( OUT, "\t\t%s\r\n" , _get_configuration_type().c_str()); + fprintf ( OUT, "\t\t%s\r\n", module.isUnicode ? "Unicode" : "MultiByte"); + fprintf ( OUT, "\t\r\n"); + + fprintf ( OUT, "\t\r\n" ); + fprintf ( OUT, "\t\r\n" ); + fprintf ( OUT, "\t\r\n"); + fprintf ( OUT, "\t\t\r\n", path_basedir.c_str()); + fprintf ( OUT, "\t\t\r\n", path_basedir.c_str()); + fprintf ( OUT, "\t\r\n"); + + fprintf ( OUT, "\t\r\n"); + fprintf ( OUT, "\t\t$(RootOutDir)\\%s%s\\$(Configuration)\\\r\n", module.output->relative_path.c_str (), vcdir.c_str ()); + fprintf ( OUT, "\t\t$(RootIntDir)\\%s%s\\$(Configuration)\\\r\n", module.output->relative_path.c_str (), vcdir.c_str ()); + + if( includes.size() != 0) + { + fprintf( OUT, "\t\t"); + for ( i = 0; i < includes.size(); i++ ) + fprintf ( OUT, "%s;", includes[i].c_str() ); + fprintf( OUT, "\r\n"); + } + + if(defines.size() != 0) + { + fprintf( OUT, "\t\t"); + for ( i = 0; i < defines.size(); i++ ) + fprintf ( OUT, "%s;", defines[i].c_str() ); + fprintf( OUT, "\r\n"); + } + + fprintf ( OUT, "\t\r\n\r\n"); + + fprintf ( OUT, "\t\r\n"); + fprintf ( OUT, "\t\t\r\n"); + if ( module.cplusplus ) + fprintf ( OUT, "\t\t\tCompileAsCpp\r\n"); + fprintf ( OUT, "\t\t\r\n"); + + fprintf ( OUT, "\t\t\r\n"); + if(libraries.size() != 0) + { + fprintf ( OUT, "\t\t\t"); + for ( i = 0; i < libraries.size(); i++ ) + { + string libpath = libraries[i].c_str(); + libpath = libpath.erase (0, libpath.find_last_of ("\\") + 1 ); + fprintf ( OUT, "%s;", libpath.c_str() ); + } + fprintf ( OUT, "%%(AdditionalDependencies)\r\n"); + + fprintf ( OUT, "\t\t\t"); + for ( i = 0; i < libraries.size(); i++ ) + { + string libpath = libraries[i].c_str(); + libpath = libpath.substr (0, libpath.find_last_of ("\\") ); + fprintf ( OUT, "%s;", libpath.c_str() ); + } + fprintf ( OUT, "%%(AdditionalLibraryDirectories)\r\n"); + } + + if( module.CRT != "msvcrt") + fprintf ( OUT, "\t\t\ttrue\r\n"); + + fprintf ( OUT, "\t\t\r\n"); + fprintf ( OUT, "\t\r\n"); + + fprintf ( OUT, "\t\r\n"); + _generate_item_group(header_files); + _generate_item_group(source_files); + _generate_item_group(resource_files); + _generate_item_group(generated_files); + fprintf ( OUT, "\t\r\n\r\n"); + + fprintf ( OUT, "\t\r\n"); + fprintf ( OUT, "\t\r\n", path_basedir.c_str()); + + fprintf ( OUT, "\r\n"); +} + +void +VCXProjMaker::_generate_user_configuration () +{ + // Call base implementation + ProjMaker::_generate_user_configuration (); +} + +void +VCXProjMaker::_generate_standard_configuration( const Module& module, const MSVCConfiguration& cfg, BinaryType binaryType ) +{ + fprintf ( OUT, "\t\t\r\n", cfg.name.c_str() ); + fprintf ( OUT, "\t\t%s\r\n", cfg.name.c_str() ); + fprintf ( OUT, "\t\tWin32\r\n" ); + fprintf ( OUT, "\t\r\n" ); +} + +void +VCXProjMaker::_generate_makefile_configuration( const Module& module, const MSVCConfiguration& cfg ) +{ + // TODO: Implement me + ProjMaker::_generate_makefile_configuration ( module, cfg ); +} diff --git a/tools/rbuild/backend/msvc/vspropsmaker.cpp b/tools/rbuild/backend/msvc/vspropsmaker.cpp new file mode 100644 index 00000000000..7f03ec36d10 --- /dev/null +++ b/tools/rbuild/backend/msvc/vspropsmaker.cpp @@ -0,0 +1,268 @@ +#ifdef _MSC_VER +#pragma warning ( disable : 4786 ) +#endif//_MSC_VER + +#include +#include +#include +#include +#include +#include + +#include + +#include "msvc.h" + +using std::string; +using std::vector; +using std::set; + +typedef set StringSet; + +#ifdef OUT +#undef OUT +#endif//OUT + +VSPropsMaker::VSPropsMaker ( Configuration& buildConfig, + Project* ProjectNode, + std::string filename_props, + MSVCConfiguration* msvc_configs) +{ + m_configuration = buildConfig; + m_ProjectNode = ProjectNode; + + m_msvc_config = msvc_configs; + + debug = ( m_msvc_config->optimization == Debug ); + release = ( m_msvc_config->optimization == Release ); + speed = ( m_msvc_config->optimization == Speed ); + use_ros_headers = (m_msvc_config->headers == ReactOSHeaders); + + OUT = fopen ( filename_props.c_str(), "wb" ); + + if ( !OUT ) + { + printf ( "Could not create file '%s'.\n", filename_props.c_str() ); + } +} + +VSPropsMaker::~VSPropsMaker ( ) +{ + fclose ( OUT ); +} + +void +VSPropsMaker::_generate_header() +{ + fprintf ( OUT, "\r\n" ); + fprintf ( OUT, "\r\n", m_msvc_config->name.c_str() ); +} + +void +VSPropsMaker::_generate_tools_defaults() +{ + fprintf ( OUT, "\t\r\n"); + + //Linker + fprintf ( OUT, "\t\r\n"); + + //Librarian + fprintf ( OUT, "\t\r\n"); + + //Resource compiler + fprintf ( OUT, "\t\t\t\r\n"); +} + +void +VSPropsMaker::_generate_macro(std::string Name, + std::string Value, + bool EvairomentVariable) +{ + fprintf ( OUT, "\t\r\n"); +} + +void +VSPropsMaker::_generate_global_includes() +{ + //Generate global includes + //they will be used by the c compiler, the resource compiler + //and the preprocessor for .s and .pspec files + + fprintf ( OUT, "\tnon_if_data; + //const vector& files = data.files; + size_t i; + const vector& incs = data.includes; + for ( i = 0; i < incs.size(); i++ ) + { + if ((incs[i]->directory->relative_path == "include\\crt" || + incs[i]->directory->relative_path == "include\\ddk" || + incs[i]->directory->relative_path == "include\\GL" || + incs[i]->directory->relative_path == "include\\psdk") && + ! use_ros_headers) + { + continue; + } + + if(incs[i]->directory->directory == SourceDirectory) + fprintf ( OUT, "$(RootSrcDir)\\"); + else if (incs[i]->directory->directory == IntermediateDirectory) + fprintf ( OUT, "$(RootIntDir)\\"); + else if (incs[i]->directory->directory == OutputDirectory) + fprintf ( OUT, "$(RootOutDir)\\"); + else + continue; + + fprintf ( OUT, "%s ; ", incs[i]->directory->relative_path.c_str()); + } + + fprintf ( OUT, "$(RootIntDir)\\include ; "); + fprintf ( OUT, "$(RootIntDir)\\include\\reactos ; "); + + if ( !use_ros_headers ) + { + // Add WDK or PSDK paths, if user provides them + if (getenv ( "BASEDIR" ) != NULL) + { + string WdkBase = getenv ( "BASEDIR" ); + fprintf ( OUT, "%s\\inc\\api ; ", WdkBase.c_str()); + fprintf ( OUT, "%s\\inc\\crt ; ", WdkBase.c_str()); + fprintf ( OUT, "%s\\inc\\ddk ; ", WdkBase.c_str()); + } + } + fprintf ( OUT, "\"\r\n"); + fprintf ( OUT, "\t\tPerformEnvironmentSet=\"true\"\r\n"); + fprintf( OUT, "\t/>\r\n"); +} + +void +VSPropsMaker::_generate_global_definitions() +{ + fprintf ( OUT, "\tnon_if_data; + const vector& defs = data.defines; + size_t i; + + for ( i = 0; i < defs.size(); i++ ) + { + if ( defs[i]->backend != "" && defs[i]->backend != "msvc" ) + continue; + + if ( defs[i]->value != "" ) + fprintf ( OUT, "%s=%s ; ",defs[i]->name.c_str(), defs[i]->value.c_str()); + else + fprintf ( OUT, "%s ; ", defs[i]->name.c_str()); + } + + fprintf ( OUT, "\"\r\n"); + fprintf ( OUT, "\t\tPerformEnvironmentSet=\"true\"\r\n"); + fprintf( OUT, "\t/>\r\n"); +} + +void +VSPropsMaker::_generate_footer() +{ + fprintf ( OUT, "\r\n"); +} + + +void +VSPropsMaker::_generate_props ( std::string solution_version, + std::string studio_version ) +{ + _generate_header(); + _generate_tools_defaults(); + + string srcdir = Environment::GetSourcePath(); + string intdir = Environment::GetIntermediatePath (); + string outdir = Environment::GetOutputPath (); + string rosbedir = Environment::GetVariable("_ROSBE_BASEDIR"); + + if ( intdir == "obj-i386" ) + intdir = srcdir + "\\obj-i386"; /* append relative dir from project dir */ + + if ( outdir == "output-i386" ) + outdir = srcdir + "\\output-i386"; + + //Generate global macros + _generate_macro("RootSrcDir", srcdir, true); + _generate_macro("RootOutDir", outdir, true); + _generate_macro("RootIntDir", intdir, true); + _generate_macro("Tools", "$(RootOutDir)\\tools", true); + _generate_macro("RosBE", rosbedir, true); + + _generate_global_includes(); + _generate_global_definitions(); + _generate_footer(); +} diff --git a/tools/rbuild/backend/versionreport/versionreport.cpp b/tools/rbuild/backend/versionreport/versionreport.cpp new file mode 100644 index 00000000000..80516635489 --- /dev/null +++ b/tools/rbuild/backend/versionreport/versionreport.cpp @@ -0,0 +1,126 @@ +/* + * Copyright (C) 2007 Marc Piulachs (marc.piulachs [at] codexchange [dot] net) + * + * This program is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation; either version 2 of the License, or + * (at your option) any later version. + * + * This program 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 General Public License for more details. + * + * You should have received a copy of the GNU General Public License along + * with this program; if not, write to the Free Software Foundation, Inc., + * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. + */ +#ifdef _MSC_VER +#pragma warning ( disable : 4786 ) +#endif//_MSC_VER + +#include +#include +#include +#include +#include + +#include + +#include "versionreport.h" +#include "../mingw/mingw.h" + +using std::string; +using std::vector; +using std::map; +using std::ifstream; + +#ifdef OUT +#undef OUT +#endif//OUT + + +static class VReportFactory : public Backend::Factory +{ + public: + + VReportFactory() : Factory("VReport", "Version Report") {} + Backend *operator() (Project &project, + Configuration& configuration) + { + return new VReportBackend(project, configuration); + } + +} factory; + + +VReportBackend::VReportBackend(Project &project, + Configuration& configuration) : Backend(project, configuration) +{ + +} + +void VReportBackend::Process() +{ + string filename_depmap ( "versionreport.xml" ); + printf ( "Creating version report: %s\n", filename_depmap.c_str() ); + + m_VReportFile = fopen ( filename_depmap.c_str(), "wb" ); + + if ( !m_VReportFile ) + { + printf ( "Could not create file '%s'.\n", filename_depmap.c_str() ); + return; + } + + GenerateReport ( m_VReportFile ); + + fclose ( m_VReportFile ); + printf ( "Done.\n" ); +} + +void +VReportBackend::CleanFiles ( void ) +{ + remove ( "versionreport.xml" ); +} + +void +VReportBackend::GenerateReport ( FILE* OUT ) +{ + fprintf ( m_VReportFile, "\r\n" ); + fprintf ( m_VReportFile, "\r\n" ); + fprintf ( m_VReportFile, "\r\n" ); + + for( std::map::const_iterator p = ProjectNode.modules.begin(); p != ProjectNode.modules.end(); ++ p ) + { + Module& module = *p->second; + if ((module.type != Iso) && + (module.type != LiveIso)) + { + Module& module = *p->second; + + if (module.metadata) + { + if (module.metadata->version.length() > 0) + { + fprintf ( m_VReportFile, "\t\r\n" ); + fprintf ( m_VReportFile, "\t\t%s\r\n", module.name.c_str () ); + fprintf ( m_VReportFile, "\t\t%s\r\n", module.output->relative_path.c_str () ); + fprintf ( m_VReportFile, "\t\t%s\r\n", module.metadata->version.c_str () ); + fprintf ( m_VReportFile, "\t\t%s\r\n", module.metadata->date.c_str () ); + fprintf ( m_VReportFile, "\t\t%s\r\n", module.metadata->owner.c_str () ); + fprintf ( m_VReportFile, "\t\r\n" ); + } + } + } + } + + fprintf ( m_VReportFile, "" ); +} + + +VReportConfiguration::VReportConfiguration ( const std::string &name ) +{ + /* nothing to do here */ +} diff --git a/tools/rbuild/backend/versionreport/versionreport.h b/tools/rbuild/backend/versionreport/versionreport.h new file mode 100644 index 00000000000..24d4addefb1 --- /dev/null +++ b/tools/rbuild/backend/versionreport/versionreport.h @@ -0,0 +1,65 @@ +/* + * Copyright (C) 2007 Marc Piulachs (marc.piulachs [at] codexchange [dot] net) + * + * This program is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation; either version 2 of the License, or + * (at your option) any later version. + * + * This program 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 General Public License for more details. + * + * You should have received a copy of the GNU General Public License along + * with this program; if not, write to the Free Software Foundation, Inc., + * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. + */ + +#pragma once + +#include +#include +#include + +#include "../backend.h" + +class VReportConfiguration +{ + public: + VReportConfiguration(const std::string &name = ""); + virtual ~VReportConfiguration() {} + std::string name; +}; + +class VReportBackend : public Backend +{ + public: + + VReportBackend(Project &project, + Configuration& configuration); + virtual ~VReportBackend() {} + + virtual void Process(); + + private: + + FILE* m_VReportFile; + + std::vector m_configurations; + + void GenerateReport ( FILE* OUT ); + void CleanFiles ( void ); + + struct module_data + { + std::vector libraries; + std::vector references; + + module_data() + {} + ~module_data() + {} + }; + +}; diff --git a/tools/rbuild/bootstrap.cpp b/tools/rbuild/bootstrap.cpp new file mode 100644 index 00000000000..f02132f261c --- /dev/null +++ b/tools/rbuild/bootstrap.cpp @@ -0,0 +1,122 @@ +/* + * Copyright (C) 2005 Casper S. Hornstrup + * + * This program is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation; either version 2 of the License, or + * (at your option) any later version. + * + * This program 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 General Public License for more details. + * + * You should have received a copy of the GNU General Public License along + * with this program; if not, write to the Free Software Foundation, Inc., + * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. + */ +#include "pch.h" +#include + +#include "rbuild.h" + +using std::string; + +Bootstrap::Bootstrap ( const Project& project_, + const Module* module_, + const XMLElement& bootstrapNode ) + : project(project_), + module(module_), + node(bootstrapNode) +{ + Initialize(); +} + +Bootstrap::~Bootstrap () +{ +} + +bool +Bootstrap::IsSupportedModuleType ( ModuleType type ) +{ + switch ( type ) + { + case Kernel: + case KernelModeDLL: + case KeyboardLayout: + case NativeDLL: + case NativeCUI: + case Win32DLL: + case Win32OCX: + case Win32CUI: + case Win32SCR: + case Win32GUI: + case KernelModeDriver: + case BootSector: + case BootLoader: + case BootProgram: + case Cabinet: + return true; + case BuildTool: + case StaticLibrary: + case HostStaticLibrary: + case ObjectLibrary: + case Iso: + case LiveIso: + case Test: + case RpcServer: + case RpcClient: + case RpcProxy: + case Alias: + case IdlHeader: + case IdlInterface: + case MessageHeader: + case EmbeddedTypeLib: + case ElfExecutable: + return false; + case TypeDontCare: + break; + } + throw InvalidOperationException ( __FILE__, + __LINE__ ); +} + +string +Bootstrap::ReplaceVariable ( const string& name, + const string& value, + string path ) +{ + size_t i = path.find ( name ); + if ( i != string::npos ) + return path.replace ( i, name.length (), value ); + else + return path; +} + +void +Bootstrap::Initialize () +{ + if ( !IsSupportedModuleType ( module->type ) ) + { + throw XMLInvalidBuildFileException ( + node.location, + " is not applicable for this module type." ); + } + + const XMLAttribute* att = node.GetAttribute ( "installbase", false ); + if ( att != NULL ) + base = ReplaceVariable ( "$(CDOUTPUT)", Environment::GetCdOutputPath (), att->value ); + else + base = ""; + + att = node.GetAttribute ( "nameoncd", false ); + if ( att != NULL ) + nameoncd = att->value; + else + nameoncd = module->output->name; +} + +void +Bootstrap::ProcessXML() +{ +} diff --git a/tools/rbuild/cdfile.cpp b/tools/rbuild/cdfile.cpp new file mode 100644 index 00000000000..65b19d1b178 --- /dev/null +++ b/tools/rbuild/cdfile.cpp @@ -0,0 +1,65 @@ +/* + * Copyright (C) 2005 Casper S. Hornstrup + * + * This program is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation; either version 2 of the License, or + * (at your option) any later version. + * + * This program 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 General Public License for more details. + * + * You should have received a copy of the GNU General Public License along + * with this program; if not, write to the Free Software Foundation, Inc., + * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. + */ +#include "pch.h" +#include + +#include "rbuild.h" + +using std::string; + +string +CDFile::ReplaceVariable ( const string& name, + const string& value, + string path ) +{ + size_t i = path.find ( name ); + if ( i != string::npos ) + return path.replace ( i, name.length (), value ); + else + return path; +} + +CDFile::~CDFile () +{ + delete source; + delete target; +} + +CDFile::CDFile ( const Project& project, + const XMLElement& cdfileNode, + const string& path ) + : XmlNode ( project, cdfileNode ) +{ + const XMLAttribute* att = cdfileNode.GetAttribute ( "installbase", false ); + string target_relative_directory; + if ( att != NULL ) + target_relative_directory = ReplaceVariable ( "$(CDOUTPUT)", Environment::GetCdOutputPath (), att->value ); + else + target_relative_directory = ""; + + const XMLAttribute* nameoncd = cdfileNode.GetAttribute ( "nameoncd", false ); + + source = new FileLocation ( SourceDirectory, + path, + cdfileNode.value, + &cdfileNode ); + target = new FileLocation ( OutputDirectory, + target_relative_directory, + nameoncd ? nameoncd->value : cdfileNode.value, + &cdfileNode ); +} diff --git a/tools/rbuild/compilationunit.cpp b/tools/rbuild/compilationunit.cpp new file mode 100644 index 00000000000..b5d1105f302 --- /dev/null +++ b/tools/rbuild/compilationunit.cpp @@ -0,0 +1,137 @@ +/* + * Copyright (C) 2005 Casper S. Hornstrup + * + * This program is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation; either version 2 of the License, or + * (at your option) any later version. + * + * This program 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 General Public License for more details. + * + * You should have received a copy of the GNU General Public License along + * with this program; if not, write to the Free Software Foundation, Inc., + * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. + */ +#include "pch.h" +#include + +#include "rbuild.h" + +using std::string; +using std::vector; + +CompilationUnit::CompilationUnit ( const File* file ) + : project(NULL), + module(NULL), + node(NULL) +{ + default_name = new FileLocation ( IntermediateDirectory, + "", + file->file.name ); + + name = file->file.relative_path + sSep + file->file.name; + files.push_back ( file ); +} + +CompilationUnit::CompilationUnit ( const Project* project, + const Module* module, + const XMLElement* node ) + : project(project), + module(module), + node(node) +{ + const XMLAttribute* att = node->GetAttribute ( "name", true ); + assert(att); + + default_name = new FileLocation ( IntermediateDirectory, + module ? module->output->relative_path : "", + att->value, + node ); + name = module->output->relative_path + cSep + att->value; +} + +CompilationUnit::~CompilationUnit () +{ + size_t i; + for ( i = 0; i < files.size (); i++ ) + delete files[i]; + + delete default_name; +} + +void +CompilationUnit::ProcessXML () +{ + size_t i; + for ( i = 0; i < files.size (); i++ ) + const_cast ( files[i] )->ProcessXML (); +} + +bool +CompilationUnit::IsGeneratedFile () const +{ + if ( files.size () != 1 ) + return false; + const File* file = files[0]; + string extension = GetExtension ( file->file ); + return ( extension == ".spec" || extension == ".pspec" || extension == ".mc"); +} + +bool +CompilationUnit::HasFileWithExtension ( const std::string& extension ) const +{ + size_t i; + for ( i = 0; i < files.size (); i++ ) + { + const File& file = *files[i]; + string fileExtension = GetExtension ( file.file ); + if ( !stricmp ( fileExtension.c_str (), extension.c_str () ) ) + return true; + } + return false; +} + +bool +CompilationUnit::IsFirstFile () const +{ + if ( files.size () == 0 || files.size () > 1 ) + return false; + const File* file = files[0]; + return file->first; +} + + +const FileLocation& +CompilationUnit::GetFilename () const +{ + if ( files.size () == 0 || files.size () > 1 ) + return *default_name; + + const File* file = files[0]; + return file->file; +} + +const std::string& +CompilationUnit::GetSwitches () const +{ + static const std::string empty_string = std::string(""); + if ( files.size () == 0 || files.size () > 1 ) + return empty_string; + const File* file = files[0]; + return file->switches; +} + +void +CompilationUnit::AddFile ( const File * file ) +{ + files.push_back ( file ); +} + +const std::vector +CompilationUnit::GetFiles () const +{ + return files; +} diff --git a/tools/rbuild/compilationunitsupportcode.cpp b/tools/rbuild/compilationunitsupportcode.cpp new file mode 100644 index 00000000000..c6e76fdc880 --- /dev/null +++ b/tools/rbuild/compilationunitsupportcode.cpp @@ -0,0 +1,97 @@ +/* + * Copyright (C) 2005 Casper S. Hornstrup + * + * This program is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation; either version 2 of the License, or + * (at your option) any later version. + * + * This program 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 General Public License for more details. + * + * You should have received a copy of the GNU General Public License along + * with this program; if not, write to the Free Software Foundation, Inc., + * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. + */ +#include "pch.h" +#include + +#include "rbuild.h" + +using std::string; +using std::vector; + +CompilationUnitSupportCode::CompilationUnitSupportCode ( const Project& project ) + : project ( project ) +{ +} + +CompilationUnitSupportCode::~CompilationUnitSupportCode () +{ +} + +void +CompilationUnitSupportCode::Generate ( bool verbose ) +{ + for( std::map::const_iterator p = project.modules.begin(); p != project.modules.end(); ++ p ) + { + GenerateForModule ( *p->second, + verbose ); + } +} + +void +CompilationUnitSupportCode::GenerateForModule ( Module& module, + bool verbose ) +{ + if ( verbose ) + { + printf ( "\nGenerating compilation unit support code for %s", + module.name.c_str () ); + } + + for ( size_t i = 0; i < module.non_if_data.compilationUnits.size () ; i++ ) + { + CompilationUnit& compilationUnit = *module.non_if_data.compilationUnits[i]; + if ( compilationUnit.GetFiles ().size () <= 1 ) + continue; + WriteCompilationUnitFile ( module, compilationUnit ); + } +} + +string +CompilationUnitSupportCode::GetCompilationUnitFilename ( Module& module, + CompilationUnit& compilationUnit ) +{ + return NormalizeFilename ( Environment::GetIntermediatePath () + sSep + compilationUnit.name ); +} + +void +CompilationUnitSupportCode::WriteCompilationUnitFile ( Module& module, + CompilationUnit& compilationUnit ) +{ + char* buf; + char* s; + + buf = (char*) malloc ( 512*1024 ); + if ( buf == NULL ) + throw OutOfMemoryException (); + + s = buf; + s = s + sprintf ( s, "/* This file is automatically generated. */\n" ); + s = s + sprintf ( s, "#define ONE_COMPILATION_UNIT\n" ); + + for ( size_t i = 0; i < compilationUnit.GetFiles ().size () ; i++ ) + { + const File& file = *compilationUnit.GetFiles ()[i]; + s = s + sprintf ( s, "#include <%s/%s>\n", ChangeSeparator ( file.file.relative_path, '\\', '/' ).c_str (), file.file.name.c_str () ); + } + + s = s + sprintf ( s, "\n" ); + + FileSupportCode::WriteIfChanged ( buf, GetCompilationUnitFilename ( module, compilationUnit ) ); + + free ( buf ); +} diff --git a/tools/rbuild/compilerdirective.cpp b/tools/rbuild/compilerdirective.cpp new file mode 100644 index 00000000000..c8ceebd18ea --- /dev/null +++ b/tools/rbuild/compilerdirective.cpp @@ -0,0 +1,145 @@ +/* + * Copyright (C) 2009 KJK::Hyperion + * + * This program is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation; either version 2 of the License, or + * (at your option) any later version. + * + * This program 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 General Public License for more details. + * + * You should have received a copy of the GNU General Public License along + * with this program; if not, write to the Free Software Foundation, Inc., + * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. + */ +#include "pch.h" +#include + +#include "rbuild.h" + +#include + +void +CompilerDirective::SetCompiler ( CompilerType compiler ) +{ + assert ( compiler < CompilerTypesCount ); + compilersSet.set ( compiler ); +} + +void +CompilerDirective::UnsetCompiler ( CompilerType compiler ) +{ + assert ( compiler < CompilerTypesCount ); + compilersSet.reset ( compiler ); +} + +void +CompilerDirective::SetAllCompilers () +{ + compilersSet.set (); +} + +void +CompilerDirective::UnsetAllCompilers () +{ + compilersSet.reset (); +} + +bool +CompilerDirective::IsCompilerSet ( CompilerType compiler ) const +{ + assert ( compiler < CompilerTypesCount ); + return compilersSet.test ( compiler ); +} + +template < std::size_t N > +static +bool +CompareStringElement ( const std::string::const_iterator& begin, const std::string::const_iterator& end, const char (& compareTo)[(N)] ) +{ + return !std::use_facet < std::collate < char > > ( std::locale::classic () ) + .compare ( &(*begin), + &(*(end - 1)), + &compareTo[0], + &compareTo[(N) - 2] ); +} + +void +CompilerDirective::ParseCompilers ( const XMLElement& node, const std::string& defaultValue ) +{ + const XMLAttribute* att = node.GetAttribute ( "compiler", false ); + const std::string& value = att ? att->value : defaultValue; + + if ( value == "*" ) + SetAllCompilers (); + else + { + UnsetAllCompilers (); + + std::string::const_iterator beginString; + + beginString = value.begin(); + + do + { + for ( ; beginString != value.end(); ++ beginString ) + { + if ( *beginString != ',' ) + break; + } + + if ( beginString == value.end() ) + break; + + std::string::const_iterator endString = beginString; + + for ( ; endString != value.end(); ++ endString ) + { + if ( *endString == ',' ) + break; + } + + assert ( endString != beginString ); + + CompilerType compiler; + + if ( CompareStringElement ( beginString, endString, "cc" ) ) + compiler = CompilerTypeCC; + else if ( CompareStringElement ( beginString, endString, "cxx" ) ) + compiler = CompilerTypeCXX; + else if ( CompareStringElement ( beginString, endString, "cpp" ) ) + compiler = CompilerTypeCPP; + else if ( CompareStringElement ( beginString, endString, "as" ) ) + compiler = CompilerTypeAS; + else if ( CompareStringElement ( beginString, endString, "midl" ) ) + compiler = CompilerTypeMIDL; + else if ( CompareStringElement ( beginString, endString, "rc" ) ) + compiler = CompilerTypeRC; + else if ( CompareStringElement ( beginString, endString, "nasm" ) ) + compiler = CompilerTypeNASM; + else + { + throw InvalidAttributeValueException ( + node.location, + "compiler", + value ); + } + + SetCompiler ( compiler ); + + beginString = endString; + } + while ( beginString != value.end() ); + + if ( !compilersSet.any() ) + { + throw InvalidAttributeValueException ( + node.location, + "compiler", + value ); + } + } +} diff --git a/tools/rbuild/compilerflag.cpp b/tools/rbuild/compilerflag.cpp new file mode 100644 index 00000000000..081b30fcfee --- /dev/null +++ b/tools/rbuild/compilerflag.cpp @@ -0,0 +1,67 @@ +/* + * Copyright (C) 2005 Casper S. Hornstrup + * + * This program is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation; either version 2 of the License, or + * (at your option) any later version. + * + * This program 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 General Public License for more details. + * + * You should have received a copy of the GNU General Public License along + * with this program; if not, write to the Free Software Foundation, Inc., + * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. + */ +#include "pch.h" +#include + +#include "rbuild.h" + +using std::string; +using std::vector; + +CompilerFlag::CompilerFlag ( const Project& project_, + const XMLElement& compilerFlagNode ) + : project(project_), + module(NULL), + node(compilerFlagNode) +{ + Initialize(); +} + +CompilerFlag::CompilerFlag ( const Project& project_, + const Module* module_, + const XMLElement& compilerFlagNode ) + : project(project_), + module(module_), + node(compilerFlagNode) +{ + Initialize(); +} + +CompilerFlag::~CompilerFlag () +{ +} + +void +CompilerFlag::Initialize () +{ + if (node.value.size () == 0) + { + throw XMLInvalidBuildFileException ( + node.location, + " is empty." ); + } + + flag = node.value; + + ParseCompilers ( node, "cc,cxx" ); +} + +void +CompilerFlag::ProcessXML () +{ +} diff --git a/tools/rbuild/configuration.cpp b/tools/rbuild/configuration.cpp new file mode 100644 index 00000000000..222c982e30b --- /dev/null +++ b/tools/rbuild/configuration.cpp @@ -0,0 +1,42 @@ +/* + * Copyright (C) 2005 Casper S. Hornstrup + * + * This program is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation; either version 2 of the License, or + * (at your option) any later version. + * + * This program 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 General Public License for more details. + * + * You should have received a copy of the GNU General Public License along + * with this program; if not, write to the Free Software Foundation, Inc., + * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. + */ +#include "pch.h" +#include + +#include "rbuild.h" + +Configuration::Configuration () +{ + Verbose = false; + CleanAsYouGo = false; + Dependencies = AutomaticDependencies; + CheckDependenciesForModuleOnly = false; + CompilationUnitsEnabled = true; + PrecompiledHeadersEnabled = true; + MakeHandlesInstallDirectories = false; + GenerateProxyMakefilesInSourceTree = false; + InstallFiles = false; + UseConfigurationInPath = false; + UseVSVersionInPath = false; + Compiler = GnuGcc; + Linker = GnuLd; +} + +Configuration::~Configuration () +{ +} diff --git a/tools/rbuild/define.cpp b/tools/rbuild/define.cpp new file mode 100644 index 00000000000..13ee819983f --- /dev/null +++ b/tools/rbuild/define.cpp @@ -0,0 +1,97 @@ +/* + * Copyright (C) 2005 Casper S. Hornstrup + * + * This program is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation; either version 2 of the License, or + * (at your option) any later version. + * + * This program 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 General Public License for more details. + * + * You should have received a copy of the GNU General Public License along + * with this program; if not, write to the Free Software Foundation, Inc., + * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. + */ +#include "pch.h" +#include + +#include "rbuild.h" + +using std::string; +using std::vector; + +Define::Define ( const Project& project, + const XMLElement& defineNode ) + : project(project), + module(NULL), + node(&defineNode) +{ + Initialize(); +} + +Define::Define ( const Project& project, + const Module* module, + const XMLElement& defineNode ) + : project(project), + module(module), + node(&defineNode) +{ + Initialize(); +} + +Define::Define ( const Project& project, + const Module* module, + const std::string& name_, + const std::string& backend_, + bool redefine_) + : project(project), + module(module), + node(NULL) +{ + name = name_; + value = ""; + backend = backend_; + redefine = redefine_; +} + +Define::~Define () +{ +// if ( node ) +// delete node; +// if ( module ) +// delete module; +} + +void +Define::Initialize() +{ + redefine = node->name == "redefine"; + + const XMLAttribute* att = node->GetAttribute ( "name", true ); + + att = node->GetAttribute ( "name", true ); + assert(att); + + size_t name_len = att->value.find ( '(' ); + + name = att->value.substr ( 0, name_len ); + + if ( name_len != std::string::npos ) + arguments = att->value.substr ( att->value.find ( '(' ) ); + + value = node->value; + + att = node->GetAttribute ( "backend", false ); + if ( att ) + backend = att->value; + + ParseCompilers ( *node, "cpp" ); +} + +void +Define::ProcessXML() +{ +} diff --git a/tools/rbuild/directory.cpp b/tools/rbuild/directory.cpp new file mode 100644 index 00000000000..9e4ed41b179 --- /dev/null +++ b/tools/rbuild/directory.cpp @@ -0,0 +1,249 @@ +/* + * Copyright (C) 2005 Casper S. Hornstrup + * + * This program is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation; either version 2 of the License, or + * (at your option) any later version. + * + * This program 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 General Public License for more details. + * + * You should have received a copy of the GNU General Public License along + * with this program; if not, write to the Free Software Foundation, Inc., + * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. + */ +#include "pch.h" +#include + +#include "rbuild.h" +#ifdef _MSC_VER +#include +#else +#include +#endif//_MSC_VER + +#ifdef WIN32 +#define MKDIR(s) mkdir(s) +#else +#define MKDIR(s) mkdir(s, 0755) +#endif + +using std::string; +using std::vector; + +Directory::Directory ( const string& name_ ) + : name(name_) +{ + size_t pos = name.find_first_of ( "$:" ); + if ( pos != string::npos ) + { + throw InvalidOperationException ( __FILE__, + __LINE__, + "Invalid directory name '%s'", + name.c_str() ); + } + + const char* p = strpbrk ( name_.c_str (), "/\\" ); + if ( name_.c_str () == p ) + { + throw InvalidOperationException ( __FILE__, + __LINE__, + "Invalid relative path '%s'", + name_.c_str () ); + } + + if ( p ) + { + name.erase ( p - name_.c_str ()); + Add ( p + 1 ); + } +} + +void +Directory::Add ( const char* subdir ) +{ + size_t i; + string s1 = string ( subdir ); + if ( ( i = s1.find ( '$' ) ) != string::npos ) + { + throw InvalidOperationException ( __FILE__, + __LINE__, + "No environment variables can be used here. Path was %s", + subdir ); + } + + const char* p = strpbrk ( subdir, "/\\" ); + if ( subdir == p || ( *subdir && subdir[1] == ':' ) ) + { + throw InvalidOperationException ( __FILE__, + __LINE__, + "Invalid relative path '%s'", + subdir ); + } + + if ( !p ) + p = subdir + strlen(subdir); + string s ( subdir, p-subdir ); + if ( subdirs.find(s) == subdirs.end() ) + subdirs[s] = new Directory(s); + if ( *p && *++p ) + subdirs[s]->Add ( p ); +} + +bool +Directory::mkdir_p ( const char* path ) +{ +#ifndef _MSC_VER + DIR *directory; + directory = opendir ( path ); + if ( directory != NULL ) + { + closedir ( directory ); + return false; + } +#endif//_MSC_VER + + if ( MKDIR ( path ) != 0 ) + { +#ifdef _MSC_VER + if ( errno == EEXIST ) + return false; +#endif//_MSC_VER + throw AccessDeniedException ( string ( path ) ); + } + return true; +} + +bool +Directory::CreateDirectory ( const string& path ) +{ + size_t index = 0; + size_t nextIndex; + if ( isalpha ( path[0] ) && path[1] == ':' && path[2] == cSep ) + { + nextIndex = path.find ( cSep, 3); + index = path.find ( cSep ); + } + else + nextIndex = path.find ( cSep ); + + bool directoryWasCreated = false; + while ( nextIndex != string::npos ) + { + nextIndex = path.find ( cSep, index + 1 ); + directoryWasCreated = mkdir_p ( path.substr ( 0, nextIndex ).c_str () ); + index = nextIndex; + } + return directoryWasCreated; +} + +void +Directory::GenerateTree ( DirectoryLocation root, + bool verbose ) +{ + switch ( root ) + { + case IntermediateDirectory: + return GenerateTree ( Environment::GetIntermediatePath (), verbose ); + case OutputDirectory: + return GenerateTree ( Environment::GetOutputPath (), verbose ); + case InstallDirectory: + return GenerateTree ( Environment::GetInstallPath (), verbose ); + default: + throw InvalidOperationException ( __FILE__, + __LINE__, + "Invalid directory %d.", + root ); + } +} + +void +Directory::GenerateTree ( const string& parent, + bool verbose ) +{ + string path; + + if ( parent.size () > 0 ) + { + if ( name.size () > 0 ) + path = parent + sSep + name; + else + path = parent; + if ( CreateDirectory ( path ) && verbose ) + printf ( "Created %s\n", path.c_str () ); + } + else + path = name; + + for ( directory_map::iterator i = subdirs.begin (); + i != subdirs.end (); + ++i ) + { + i->second->GenerateTree ( path, verbose ); + } +} + +string +Directory::EscapeSpaces ( const string& path ) +{ + string newpath; + const char* p = &path[0]; + while ( *p != 0 ) + { + if ( *p == ' ' ) + newpath = newpath + "\\ "; + else + newpath = newpath + *p; + p++; + } + return newpath; +} + +void +Directory::CreateRule ( FILE* f, + const string& parent ) +{ + string path; + string escapedName = EscapeSpaces ( name ); + + if ( escapedName.size() > 0 ) + { + if ( ! (escapedName == "tools" && + ( parent == "$(OUTPUT)" || parent == "$(INTERMEDIATE)" ) ) ) + { + fprintf ( f, + "%s%c%s: | %s\n", + parent.c_str (), + cSep, + escapedName.c_str (), + parent.c_str () ); + + fprintf ( f, + "\t$(ECHO_MKDIR)\n" ); + + fprintf ( f, + "\t${mkdir} $@\n" ); + } + + path = parent + sSep + escapedName; + } + else + path = parent; + + for ( directory_map::iterator i = subdirs.begin(); + i != subdirs.end(); + ++i ) + { + i->second->CreateRule ( f, path ); + } +} + +Directory::~Directory() +{ + std::map::iterator theIterator; + for ( theIterator = subdirs.begin (); theIterator != subdirs.end (); theIterator++ ) + delete theIterator->second; +} diff --git a/tools/rbuild/doc/rbuild.dbk b/tools/rbuild/doc/rbuild.dbk new file mode 100644 index 00000000000..bea0334a464 --- /dev/null +++ b/tools/rbuild/doc/rbuild.dbk @@ -0,0 +1,1809 @@ + + + + ReactOS Build System Documentation + + + $Id: rbuild.dbk 25738 2007-02-06 13:34:47Z greatlrd $ + + + Casper + + Hornstrup + + + + Emanuele + + Aliberti + + + + 2005 + + + + + Building ReactOS + +
+ Building ReactOS + + To generate GNU make makefiles and building ReactOS, do the + following: + + Go to the top-level reactos + directory; + + + + Run the command:mingw32-make + + This will start building ReactOS. + + + + To build a bootable CD, run the following command:mingw32-make bootcdThis + will create ReactOS.iso in the top-level + reactos directory. +
+
+ + + How build directions are stored + + XML files are used throughout the ReactOS source tree to drive the + build system. + +
+ Top-level XML Build File + + The top-level XML build file (ReactOS.rbuild) is + processed by rbuild. The following is an example of + how it could look like:<?xml version="1.0"?> +<!DOCTYPE project SYSTEM "tools/rbuild/project.dtd"> +<project name="ReactOS" makefile="Makefile.auto" xmlns:xi="http://www.w3.org/2001/XInclude"> + <xi:include href="config.rbuild"> + <xi:fallback> + <xi:include href="config.template.rbuild" /> + </xi:fallback> + </xi:include> + + <define name="_M_IX86" /> + <if property="DBG" value="1"> + <define name="DBG" value="1" /> + <property name="DBG_OR_KDBG" value="true" /> + </if> + + <include base="ReactOS">include</include> + + <directory name="boot"> + <xi:include href="boot/boot.rbuild" /> + </directory> + + <module name="bootcd" type="iso"> + </module> +</project> +
+ +
+ XInclude + + XML files used by rbuild are modular and use + XInclude to include other chunks of XML in the top-level + ReactOS.rbuild file. The namespace used by XInclude is + xi. + +
+ xi:include + + It is possible to split an XML build file over several files. + The include element in the xi namespace is used to + accomplish this. + +
+ Syntax + + <xi:include href="config.rbuild"> + <xi:fallback> + <xi:include href="config.template.rbuild" /> + </xi:fallback> +</xi:include> +
+ +
+ Attributes + + + + href + + + Name of XML build file to include. The filename is + relative to the location of the current XML build + file. + + + +
+ +
+ Content + + None. +
+ +
+ Children + + xi:fallback. +
+
+ +
+ xi:fallback + + This element is used to provide the name of an alternate file + that is to be included if the first include file did not + exists. + +
+ Syntax + + <xi:fallback> + <xi:include href="config.template.rbuild" /> +</xi:fallback> +
+ +
+ Attributes + + None. +
+ +
+ Content + + None. +
+ +
+ Parents + + xi:include. +
+ +
+ Children + + xi:include. +
+
+
+ +
+ Element reference + +
+ Bootstrap element + + A bootstrap element specifies that the generated file should be + put on the bootable CD as a bootstrap file. + +
+ Syntax + + <bootstrap base="reactos" nameoncd="halmp.dll" /> +
+ +
+ Attributes + + + + base + + + Put file in this directory on the bootable CD. This + attribute is optional. + + + + + nameoncd + + + Name of file on the bootable CD. This attribute is + optional. + + + +
+ +
+ Content + + None. +
+ +
+ Parents + + module. +
+ +
+ Children + + None. +
+
+ +
+ CDFile element + + A cdfile element specifies the name of a file that is to be put + on the bootable CD. + +
+ Syntax + + <cdfile base="reactos" nameoncd="ReadMe.txt">ReadMe.txt</cdfile> +
+ +
+ Attributes + + + + base + + + Put file in this directory on the bootable CD. This + attribute is optional. + + + + + nameoncd + + + Name of file on the bootable CD. This attribute is + optional. + + + +
+ +
+ Content + + Name of file. +
+ +
+ Children + + None. +
+
+ +
+ Compilerflag element + + A compilerflag element specifies additional flags to be bassed + to the compiler. + +
+ Syntax + + <compilerflags>-Wpointer-arith</compilerflag> +
+ +
+ Attributes. + + None. +
+ +
+ Content + + The compiler flags. +
+ +
+ Parents + + if, project. +
+ +
+ Children + + None. +
+
+ +
+ Component element + + A component element specifies that imports from a library are to + be stubbed so tests can be run without actually calling the functions + in the library. This element can only be used for modules of type + test. + +
+ Syntax + + <component name="ntdll.dll"> + ... +</component> +
+ +
+ Attributes + + + + name + + + Name of library. + + + +
+ +
+ Content + + None. +
+ +
+ Children + + symbol. +
+
+ +
+ Define element + + A define element specifies the name and (optionally) value of a + define for the C/C++ compiler and resource compiler. + +
+ Syntax + + <define name="WINVER">0x501</define> +
+ +
+ Attributes + + + + name + + + Name of define. + + + +
+ +
+ Content + + Value of define. The value is optional. +
+ +
+ Parents + + project, module. +
+ +
+ Children + + None. +
+
+ +
+ Dependency element + + A dependency element specifies the name of a module (usually of + type buildtool) that is to be processed before the current + module. + +
+ Syntax + + <dependency>OtherModule</dependency> +
+ +
+ Attributes + + None. +
+ +
+ Content + + Name of module. +
+ +
+ Children + + None. +
+
+ +
+ Directory element + + A directory element specifies the name of a subdirectory. + +
+ Syntax + + <directory name="MyDirectory"> + ... +</directory> +
+ +
+ Attributes + + + + name + + + Name of directory. + + + +
+ +
+ Content + + None. +
+ +
+ Parents + + directory, if, project. +
+ +
+ Children + + cdfile, directory, file, if, pch, property. +
+
+ +
+ File element + + A file element specifies the name of a file that is to be + processed. + +
+ Syntax + + <file>MyFile.c</file> +
+ +
+ Attributes + + None. +
+ +
+ Content + + Name of file. +
+ +
+ Parents + + directory, module. +
+ +
+ Children + + None. +
+
+ +
+ Group element + + A group element's purpose is grouping subelements. + +
+ Syntax + + <group> + <file>i386-dis.c</file> + <file>kdb_help.S</file> + <file>longjmp.S</file> + <file>setjmp.S</file> +</group> +
+ +
+ Attributes + + None. +
+ +
+ Content + + None. +
+ +
+ Parents + + if. +
+ +
+ Children + + file. +
+
+ +
+ If element + + An if element allows for conditional processing of other + elements. + +
+ Syntax + + <if property="DBG" value="1"> + ... +</if> +
+ +
+ Attributes + + + + property + + + Name of the property that is to be evaluated. + + + + + value + + + Value to compare to the value of the property. If the + property has the specified value, then the subelements are + processed. + + + +
+ +
+ Content + + None. +
+ +
+ Parents + + project, directory. +
+ +
+ Children + + compilerflag, + define, directory, file, if, include, property. +
+
+ +
+ Importlibrary element + + An importlibrary element specifies that an import library should + be generated which other modules can use to link with the current + module. + +
+ Syntax + + <importlibrary definition="MyModule.def" /> +
+ +
+ Attributes + + + + definition + + + Filename of definition file + (.def) used to generate the import + library. The filename is relative to the current + module. + + + +
+ +
+ Content + + None. +
+ +
+ Parents + + module. +
+ +
+ Children + + None. +
+
+ +
+ Include element + + An include element specifies an include directory for the C/C++ + compiler and resource compiler. + +
+ Syntax + + <include base="MyLibraryModule">include</include> +
+ +
+ Attributes + + + + base + + + Module or project which the value of this element is + relative to. This attribute is optional. If left out, the + include directory is relative to the position of the + top-level XML build file. + + + +
+ +
+ Content + + Relative include directory. +
+ +
+ Parents + + project, module. +
+ +
+ Children + + None. +
+
+ +
+ Input element + + An input element specifies a group of filenames that is to be + passed as parameters to a build tool. Input filename parameters are + located after output filename parameters on the command line. + +
+ Syntax + + <input> + ... +</input> +
+ +
+ Attributes + + None. +
+ +
+ Content + + None. +
+ +
+ Parents + + invoke. +
+ +
+ Children + + inputfile. +
+
+ +
+ Inputfile element + + An inputfile element specifies a filename that is to be passed + as a parameter to a build tool. + +
+ Syntax + + <inputfile>ntoskrnl.mc</inputfile> +
+ +
+ Attributes + + + + switches + + + Switches that is passed as parameters just before the + filename. This attribute is optional. + + + +
+ +
+ Content + + Name of file that is to be passed as a parameter to the build + tool. +
+ +
+ Parents + + input. +
+ +
+ Children + + None. +
+
+ +
+ Installfile element + + An installfile element specifies the name of a file that is to + be installed when using 'make install'. + +
+ Syntax + + <installfile base="reactos" newname="ReadMe.txt">ReadMe.txt</installfile> +
+ +
+ Attributes + + + + base + + + Put file in this directory within the install + directory. This attribute is optional. + + + + + newname + + + Name of file within the install directory. This + attribute is optional. + + + +
+ +
+ Content + + Name of file. +
+ +
+ Children + + None. +
+
+ +
+ Invoke element + + An invoke element specifies the name of a module which is to be + executed before the current module is processed. + +
+ Syntax + + <invoke module="wmc"> + <input> + <inputfile>ntoskrnl.mc</inputfile> + </input> + <output> + <outputfile switches="-H">../include/reactos/bugcodes.h</outputfile> + <outputfile switches="-o">bugcodes.rc</outputfile> + </output> +</invoke> +
+ +
+ Attributes + + + + module + + + Name of the module to execute. + + + +
+ +
+ Content + + None. +
+ +
+ Children + + input, output. +
+
+ +
+ Library element + + A library element specifies the name of another module which is + to be linked with the current module. + +
+ Syntax + + <library>MyLibraryModule</library> +
+ +
+ Attributes + + None.section +
+ +
+ Parents + + module. +
+ +
+ Children + + None. +
+
+ +
+ Linkerflag element + + A likerflag element specifies flags to be passed to the linker + tool. + +
+ Syntax + + <linkerflag>-lgcc</linkerflag> +
+ +
+ Attributes + + None. +
+ +
+ Content + + The switches to pass to the linker. +
+ +
+ Parents + + module. +
+ +
+ Children + + None. +
+
+ +
+ Module element + + There can be zero or more modules per XML build file. + +
+ Syntax + + <module if="${MP}" ifnot="${MP}" name="msvcrt" type="win32dll" extension=".dll" entrypoint="_DllMain@12" baseaddress="0x70000000" mangledsymbols="true" installbase="system32" installname="msvcrt.dll" usewrc="false" allowwarnings="true" aliasof="module1"> + ... +</module> +
+ +
+ Attributes + + + + if + + + If the value is 1, then the module is enabled, + otherwise it is disabled. A disabled module is not + processed. + + + + + ifnot + + + If the value is 1, then the module is disabled, + otherwise it is enabled. A disabled module is not + processed. + + + + + name + + + Name of the module. Also the base name of the + generated file if such file is generated for the particular + module type. + + + + + type + + + Type of module. See below for an explanation of module + types. The module type determines the + actions that is to be carried out to process the module. The + defined module types are seen + below: + + + Module Types + + + + + Value + + Output name suffix + + Entrypoint + + Baseaddress + + Mangledsymbols + + Description + + + + + + buildtool + + + + + .exe (Windows) + + none (Linux) + + + + + - + + - + + - + + Builds a tool that can be run (invoked) when + building ReactOS. + + + + staticlibrary + + .a + + - + + - + + - + + Builds a static library containing object + files that can be linked together with other + modules. + + + + objectlibrary + + .o + + - + + - + + - + + Builds object files that can be linked + together with other modules. + + + + kernel + + .exe + + _NtProcessStartup + + - + + - + + Builds + ntoskrnl.exe. + + + + kernelmodedll + + .dll + + _DriverEntry@8 + + - + + - + + Builds a kernel-mode DLL. + + + + kernelmodedriver + + .sys + + _DriverEntry@8 + + - + + - + + Builds a kernel-mode driver. + + + + nativecui + + .exe + + _NtProcessStartup + + - + + - + + Build a native NT/ROS program (no enviroment + subsystem required to run). + + + + nativedll + + .dll + + _DllMainCRTStartup@12 + + - + + - + + Builds a native DLL. + + + + win32dll + + .dll + + _DllMain@12 + + - + + - + + Builds a Win32 DLL. + + + + win32cui + + .exe + + _mainCRTStartup + + - + + - + + Builds a Win32 console executable. + + + + win32gui + + .exe + + _WinMainCRTStartup + + - + + - + + Builds a Win32 GUI executable. + + + + bootloader + + - + + - + + - + + - + + Builds a bootloader. + + + + bootsector + + - + + - + + - + + - + + Builds one or more bootsector + binaries. + + + + iso + + - + + - + + - + + -. + + Builds a bootable CD. + + + + test + + .exe + + _mainCRTStartup + + - + + - + + Builds a testsuite. + + + + rpcserver + + .o + + - + + - + + - + + Generates and builds server code for an RPC + interface. + + + + rpcclient + + .o + + - + + - + + - + + Generates and builds client code for an RPC + interface. + + + + alias + + - + + - + + - + + - + + Module is an alias for another module. This + module type is the only module type for which the + aliasof attribute is applicable. Only the module + install functionality is aliased. + + + +
+
+
+ + + extension + + + Extension of the generated file if such file is + generated for the particular module type. + + + + + entrypoint + + + Entrypoint symbol of the generated file if such file + is generated for the particular module type. + + + + + baseaddress + + + Base address of the generated file if such file is + generated for the particular module type. + + + + + mangledsymbols + + + Controls wether or not to pass --kill-at to dlltool. + If this attribute has the value false then --kill-at is + passed to dlltool. If the value is true, then --kill-at is + not passed to dlltool. If the generated file exports C++ + classes then this need to be true. + + + + + installbase + + + Base directory of the generated file in the + installation directory. This attribute is optional. + + + + + installname + + + Name of generated file in the installation directory. + This attribute is optional, but if not specified, the + generated file is not copied to the installation + directory. + + + + + usewrc + + + Use WRC to compile resources if true. If false, + windres is used. This attribute is optional. If not + specified, WRC will be used. + + + + + allowwarnings + + + Error out if false and at least one warning is emitted + during building of this module. This attribute is optional. + If not specified, it is assumed to be false. + + + + + aliasof + + + Name of module that is aliased. + + +
+
+ +
+ Content + + None. +
+ +
+ Parents + + project, directory. +
+ +
+ Children + + bootstrap, component, define, dependency, directory, file, if, importlibrary, include, invoke, library, linkerflag, property. +
+
+ +
+ Output element + + An output element specifies a group of filenames that is to be + passed as parameters to a build tool. Output filename parameters are + located before input filename parameters on the command line. + +
+ Syntax + + <output> + ... +</output> +
+ +
+ Attributes + + None. +
+ +
+ Content + + None. +
+ +
+ Parents + + invoke +
+ +
+ Children + + outputfile. +
+
+ +
+ Outputfile element + + An outputfile element specifies a filename that is to be passed + as a parameter to a build tool. + +
+ Syntax + + <outputfile switches="-H">../include/reactos/bugcodes.h</outputfile> +
+ +
+ Attributes + + + + switches + + + Switches that are passed as parameters just before the + filename. This attribute is optional. + + + +
+ +
+ Content + + Name of file that is to be passed as a parameter to the build + tool. +
+ +
+ Parents + + output. +
+ +
+ Children + + None. +
+
+ +
+ Pch element + + A pch element specifies a GCC precompiled header file. + +
+ Syntax + + <pch>ntdll.h</pch> +
+ +
+ Attributes + + None. +
+ +
+ Content + + Name of the include file to be precompiled. +
+ +
+ Parents + + directory. +
+ +
+ Children + + None. +
+
+ +
+ Project element + + There can be one project per + top-level XML build file. A project can only be defined in a top-level + XML build file. + +
+ Syntax + + <project name="ReactOS" makefile="Makefile.auto" xmlns:xi="http://www.w3.org/2001/XInclude"> + ... +</project> +
+ +
+ Attributes + + + + name + + + Name of the project. + + + + + makefile + + + Filename of the GNU makefile that is to be + created. + + + +
+ +
+ Content + + None. +
+ +
+ Parents + + None. This is the top-level (root) element of + ReactOS.rbuild file. +
+ +
+ Children + + define, directory, if, include, module, property. +
+
+ +
+ Property element + + A property element specifies the name and value of a property + that can be used for conditional processing of the XML build + file. + +
+ Syntax + + <property name="mypropertyname" value="mypropertyvalue" /> +
+ +
+ Attributes + + + + name + + + Name of property. + + + + + value + + + Value of property. + + + +
+ +
+ Content + + None. +
+ +
+ Parents + + +
+ +
+ Children + + None. +
+
+ +
+ Symbol element + + A symbol element specifies an imported function from a library + that is to be stubbed so tests can be run without actually calling the + function in the library. + +
+ Syntax + + <symbol newname="RtlAllocateHeap">HeapAlloc@12</symbol> +
+ +
+ Attributes + + + + newname + + + New name of symbol. This attribute is optional. + + + +
+ +
+ Content + + Name of symbol. +
+ +
+ Children + + None. +
+
+
+
+ + + Bibliography + + <ulink + url="http://www.w3.org/TR/2004/REC-xml-20040204/">Extensible Markup + Language (XML) 1.0 (Third Edition)</ulink>W3C + Recommendation + François + + Yergeau + + Tim + + Bray + + Jean + + Paoli + + C. M. + + Sperberg-McQueen + + Eve + + Maler + 4th February 2004 + + <ulink + url="http://www.w3.org/TR/2004/REC-xinclude-20041220/">XML Inclusions + (XInclude) Version 1.0 </ulink>W3C + Recommendation + Jonathan + + Marsh + + + Microsoft + + + jmarsh@microsoft.com + + David + + Orchard + + + BEA Systems + + + dorchard@bea.com + 20 December 2004 + +
\ No newline at end of file diff --git a/tools/rbuild/doc/rbuild.txt b/tools/rbuild/doc/rbuild.txt new file mode 100644 index 00000000000..ffe0a711a12 --- /dev/null +++ b/tools/rbuild/doc/rbuild.txt @@ -0,0 +1,538 @@ +ReactOS Build System Documentation +================================== + +Building ReactOS +---------------- +To generate GNU make makefiles and building ReactOS do the following: + + 1) Go to the top-level reactos directory + 2) Run the command: mingw32-make + +This will start building ReactOS. + +To build a bootable CD run the following command: + + mingw32-make bootcd + +This will create ReactOS.iso in the top-level reactos directory. + + +Top-level XML Build File +------------------------ +The top-level xml build file (ReactOS.rbuild) is processed by rbuild. The following is an example of how it could look like: + + + + + + + + + + + + + + + + + include + + + + + + + + + + +xi:include +---------- +It is possible to split an xml build file over several files. The include element in the xi namespace is used to accomplish this. + +Syntax: + + + + + + +Attributes: + href - Name of xml build file to include. The filename is relative to the location of the current xml build file. + +Value: + None. + +Elements: + xi:fallback + + +xi:fallback +----------- +This element is used to provide the name of an alternate file that is to be included if the first include file did not exists. + +Attributes: + None. + +Value: + None. + +Elements: + xi:include. + + +Project element +--------------- +There can be one project per top-level XML build file. A project can only be defined in a top-level xml build file. + +Syntax: + + ... + + +Attributes: + name - Name of the project. + makefile - Filename of the GNU makefile that is to be created. + +Value: + None. + +Elements: + define, directory, if, include, module, property + + +Module element +-------------- +There can be zero or more modules per xml build file. + +Syntax: + + ... + + +Attributes: + if - If the value is 1, then the module is enabled, otherwise it is disabled. A disabled module is not processed. + ifnot - If the value is 1, then the module is disabled, otherwise it is enabled. A disabled module is not processed. + name - Name of the module. Also the base name of the generated file if such file is generated for the particular module type. + type - Type of module. See below for an explanation of module types. + extension - Extension of the generated file if such file is generated for the particular module type. + entrypoint - Entrypoint symbol of the generated file if such file is generated for the particular module type. + baseaddress - Base address of the generated file if such file is generated for the particular module type. + mangledsymbols - Controls wether or not to pass --kill-at to dlltool. If this attribute has the value false then --kill-at is passed to dlltool. If the value is true, then --kill-at is not passed to dlltool. If the generated file exports C++ classes then this need to be true. + installbase - Base directory of the generated file in the installation directory. This attribute is optional. + installname - Name of generated file in the installation directory. This attribute is optional, but if not specified, the generated file is not copied to the installation directory. + usewrc - Use WRC to compile resources if true. If false, windres is used. This attribute is optional. If not specified, WRC will be used. + allowwarnings - Error out if false and at least one warning is emitted during building of this module. This attribute is optional. If not specified, it is assumed to be false. + aliasof - Name of module that is aliased. +Value: + None. + +Elements: + autoregister, bootstrap, component, compilationunit, define, dependency, directory, file, if, importlibrary, include, invoke, library, linkerscript, property. + + +Module types +------------ +The module type determines the actions that is to be carried out to process the module. The defined module types are seen below: + buildtool - Builds a tool that can be run (invoked) when building ReactOS. Default extension is .exe when building on Windows and nothing when building on Linux. The entrypoint, baseaddress, and mangledsymbols module attributes are not applicable for this module type. + staticlibrary - Builds a static library containing object files that can be linked together with other modules. Default extension is .a. The entrypoint, baseaddress, and mangledsymbols module attributes are not applicable for this module type. + objectlibrary - Builds object files that can be linked together with other modules. Default extension is .o. The entrypoint, baseaddress, and mangledsymbols module attributes are not applicable for this module type. + kernel - Builds ntoskrnl.exe. Default extension is .exe. Default entrypoint is _NtProcessStartup. + kernelmodedll - Builds a kernel-mode DLL. Default extension is .dll. Default entrypoint is _DriverEntry@8. + kernelmodedriver - Builds a kernel-mode driver. Default extension is .sys. Default entrypoint is _DriverEntry@8. + nativedll - Builds a native DLL. Default extension is .dll. Default entrypoint is _DllMainCRTStartup@12. + win32dll - Builds a Win32 DLL. Default extension is .dll. Default entrypoint is _DllMain@12. + win32cui - Builds a Win32 console executable. Default extension is .exe. Default entrypoint is _mainCRTStartup. The baseaddress module attribute is not applicable for this module type. + win32gui - Builds a Win32 GUI executable. Default extension is .exe. Default entrypoint is _WinMainCRTStartup. The baseaddress module attribute is not applicable for this module type. + bootloader - Builds a bootloader. The entrypoint, baseaddress, and mangledsymbols module attributes are not applicable for this module type. + bootsector - Builds one or more bootsector binaries. The entrypoint, baseaddress, and mangledsymbols module attributes are not applicable for this module type. + iso - Builds a bootable CD. The entrypoint, baseaddress, and mangledsymbols module attributes are not applicable for this module type. + test - Builds a testsuite. Default extension is .exe. Default entrypoint is _mainCRTStartup. The baseaddress module attribute is not applicable for this module type. + rpcserver - Generates and builds server code for an RPC interface. Default extension is .o. The entrypoint, baseaddress, and mangledsymbols module attributes are not applicable for this module type. + rpcclient - Generates and builds client code for an RPC interface. Default extension is .o. The entrypoint, baseaddress, and mangledsymbols module attributes are not applicable for this module type. + alias - Module is an alias for another module. This module type is the only module type for which the aliasof attribute is applicable. Only the module install functionality is aliased. + + +Autoregister element +-------------------- +An autoregister element specifies that the generated executable should be registered in the registry during second stage setup. + +Syntax: + + +Attributes: + infsection - Name of section in syssetup.inf. + type - Type of registration. Can be either DllRegisterServer, DllInstall, or Both. + +Value: + None. + +Elements: + None. + + +Bootstrap element +----------------- +A bootstrap element specifies that the generated file should be put on the bootable CD as a bootstrap file. + +Syntax: + + +Attributes: + installbase - Put file in this directory on the bootable CD. This attribute is optional. + nameoncd - Name of file on the bootable CD. This attribute is optional. + +Value: + None. + +Elements: + None. + + +CDFile element +-------------- +A cdfile element specifies the name of a file that is to be put on the bootable CD. + +Syntax: + ReadMe.txt + +Attributes: + installbase - Put file in this directory on the bootable CD. This attribute is optional. + nameoncd - Name of file on the bootable CD. This attribute is optional. + +Value: + Name of file. + +Elements: + None. + + +CompilationUnit element +----------------------- +A compilationunit element specifies that one or more source code files are to be compiled as a single compilation unit. + +Syntax: + + ... + + +Attributes: + name - Name of generated source code file. + +Value: + None. + +Elements: + directory, file, if. + + +Component element +----------------- +A component element specifies that imports from a library are to be stubbed so tests can be run without actually calling the functions in the library. This element can only be used for modules of type test. + +Syntax: + + ... + + +Attributes: + name - Name of library. + +Value: + None. + +Elements: + Symbol. + + +Symbol element +-------------- +A symbol element specifies an imported function from a library that is to be stubbed so tests can be run without actually calling the function in the library. + +Syntax: + HeapAlloc@12 + +Attributes: + newname - New name of symbol. This attribute is optional. + +Value: + Name of symbol. + +Elements: + None. + + +Define element +-------------- +A define element specifies the name and (optionally) value of a define for the C/C++ compiler and resource compiler. + +Syntax: + 0x501 + +Attributes: + name - Name of define. + +Value: + Value of define. The value is optional. + +Elements: + None. + + +Dependency element +------------------ +A dependency element specifies the name of a module (usually of type buildtool) that is to be processed before the current module. + +Syntax: + OtherModule + +Attributes: + None. + +Value: + Name of module. + +Elements: + None. + + +Directory element +----------------- +A directory element specifies the name of a subdirectory. + +Syntax: + + ... + + +Attributes: + name - Name of directory. + +Value: + None. + +Elements: + cdfile, directory, file, if, property. + + +File element +------------ +A file element specifies the name of a file that is to be processed. + +Syntax: + MyFile.c + +Attributes: + None. + +Value: + Name of file. + +Elements: + None. + + +If element +---------- +An if element allows for conditional processing of other elements. + +Syntax: + + ... + + +Attributes: + property - Name of the property that is to be evaluated. + value - Value to compare to the value of the property. If the property has the specified value, then the subelements are processed. + +Value: + None. + +Elements: + compilationunit, compilerflag, define, directory, file, if, include, property. + + +Importlibrary element +--------------------- +An importlibrary element specifies that an import library should be generated which other modules can use to link with the current module. + +Syntax: + + +Attributes: + definition - Filename of definition file (.def) used to generate the import library. The filename is relative to the current module. + +Value: + None. + +Elements: + None. + + +Include element +--------------- +An include element specifies an include directory for the C/C++ compiler and resource compiler. + +Syntax: + include + +Attributes: + base - Module or project which the value of this element is relative to. This attribute is optional. If left out, the include directory is relative to the position of the top-level xml build file. + +Value: + Relative include directory. + +Elements: + None. + + +Installfile element +------------------- +An installfile element specifies the name of a file that is to be installed when using 'make install'. + +Syntax: + ReadMe.txt + +Attributes: + installbase - Put file in this directory within the install directory. This attribute is optional. + newname - Name of file within the install directory. This attribute is optional. + +Value: + Name of file. + +Elements: + None. + + +Invoke element +-------------- +An invoke element specifies the name of a module which is to be executed before the current module is processed. + +Syntax: + + + ntoskrnl.mc + + + ../include/reactos/bugcodes.h + bugcodes.rc + + + +Attributes: + None. + +Value: + Name of the module to execute. + +Elements: + input, output. + + +Input element +------------- +An input element specifies a group of filenames that is to be passed as parameters to a build tool. Input filename parameters are located after output filename parameters on the command line. + +Attributes: + None. + +Value: + None. + +Elements: + inputfile. + + +Inputfile element +----------------- +An inputfile element specifies a filename that is to be passed as a parameter to a build tool. + +Attributes: + switches - Switches that is passed as parameters just before the filename. This attribute is optional. + +Value: + Name of file that is to be passed as a parameter to the build tool. + +Elements: + None. + + +Output element +-------------- +An output element specifies a group of filenames that is to be passed as parameters to a build tool. Output filename parameters are located before input filename parameters on the command line. + +Attributes: + None. + +Value: + None. + +Elements: + outputfile. + + +Outputfile element +------------------ +An outputfile element specifies a filename that is to be passed as a parameter to a build tool. + +Attributes: + switches - Switches that is passed as parameters just before the filename. This attribute is optional. + +Value: + Name of file that is to be passed as a parameter to the build tool. + +Elements: + None. + + +Library +------- +An importlibrary element specifies the name of another module which is to be linked with the current module. + +Syntax: + MyLibraryModule + +Attributes: + None. + +Value: + Name of the module to link with. + +Elements: + None. + + +Linkerscript +------------ +A linkerscript element specifies the filename of a binutils linker script. + +Syntax: + MyLinkerScript + +Attributes: + base - Module which the value of this element is relative to. This attribute is optional. If left out, the linker script is relative to the position of the top-level xml build file. + +Value: + Relative linker script filename. + +Elements: + None. + + +Property +-------- +A property element specifies the name and value of a property that can be used for conditional processing of the xml build file. + +Syntax: + + +Attributes: + name - Name of property. + value - Value of property. + +Value: + None. + +Elements: + None. diff --git a/tools/rbuild/empty.def b/tools/rbuild/empty.def new file mode 100644 index 00000000000..aabd2247c04 --- /dev/null +++ b/tools/rbuild/empty.def @@ -0,0 +1 @@ +EXPORTS diff --git a/tools/rbuild/exception.cpp b/tools/rbuild/exception.cpp new file mode 100644 index 00000000000..4c6f4611842 --- /dev/null +++ b/tools/rbuild/exception.cpp @@ -0,0 +1,184 @@ +/* + * Copyright (C) 2005 Casper S. Hornstrup + * + * This program is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation; either version 2 of the License, or + * (at your option) any later version. + * + * This program 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 General Public License for more details. + * + * You should have received a copy of the GNU General Public License along + * with this program; if not, write to the Free Software Foundation, Inc., + * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. + */ +#include "pch.h" +#include "rbuild.h" + +using std::string; + +Exception::Exception () +{ +} + +Exception::Exception ( const string& message ) +{ + _e = message; +} + +Exception::Exception ( const char* format, ...) +{ + va_list args; + va_start ( args, format); + _e = ssvprintf ( format, args); + va_end ( args ); +} + +void Exception::SetMessage ( const char* format, ...) +{ + va_list args; + va_start ( args, format); + _e = ssvprintf ( format, args); + va_end ( args ); +} + +void Exception::SetMessageV ( const char* message, va_list args ) +{ + _e = ssvprintf ( message, args); +} + + +MissingArgumentException::MissingArgumentException ( const string& argument ) + : Exception ( "Argument '%s' is missing", + argument.c_str () ) +{ +} + + +OutOfMemoryException::OutOfMemoryException () + : Exception ( "Out of memory" ) +{ +} + + +InvalidOperationException::InvalidOperationException ( + const char* filename, + const int linenumber ) + : Exception ( "%s:%d", filename, linenumber ) +{ +} + +InvalidDateException::InvalidDateException ( const string& filename) + : Exception ( "File '%s' has an invalid date.", + filename.c_str() ) +{ + Filename = filename; +} + +InvalidOperationException::InvalidOperationException ( + const char* filename, + const int linenumber, + const char* message, + ... ) +{ + string errorMessage; + va_list args; + va_start ( args, message ); + errorMessage = ssvprintf ( message, args ); + va_end ( args ); + SetMessage ( + "%s:%d %s", + filename, + linenumber, + errorMessage.c_str () ); +} + + +FileNotFoundException::FileNotFoundException ( const string& filename ) + : Exception ( "File '%s' not found.", + filename.c_str() ) +{ + Filename = filename; +} + + +AccessDeniedException::AccessDeniedException ( const string& filename) + : Exception ( "Access denied to file or directory '%s'.", + filename.c_str() ) +{ + Filename = filename; +} + + +RequiredAttributeNotFoundException::RequiredAttributeNotFoundException ( + const string& location, + const string& attributeName, + const string& elementName ) + : XMLInvalidBuildFileException ( + location, + "Required attribute '%s' not found on '%s'.", + attributeName.c_str (), + elementName.c_str ()) +{ +} + +InvalidAttributeValueException::InvalidAttributeValueException ( + const string& location, + const string& name, + const string& value ) + : XMLInvalidBuildFileException ( + location, + "Attribute '%s' has an invalid value '%s'.", + name.c_str (), + value.c_str () ) +{ + +} + +BackendNameConflictException::BackendNameConflictException ( const string& name ) + : Exception ( "Backend name conflict: '%s'", + name.c_str() ) +{ +} + + +UnknownBackendException::UnknownBackendException ( const string& name ) + : Exception ( "Unknown Backend requested: '%s'", + name.c_str() ) +{ +} + + +UnknownModuleTypeException::UnknownModuleTypeException ( const string& location, + int moduletype ) + : XMLInvalidBuildFileException ( + location, + "module type requested: %i", + moduletype ) +{ +} + + +InvocationFailedException::InvocationFailedException ( const std::string& command, + int exitcode ) + : Exception ( "Failed to execute '%s' (exit code %d)", + command.c_str (), + exitcode ) +{ + Command = command; + ExitCode = exitcode; +} + + +UnsupportedBuildToolException::UnsupportedBuildToolException ( const std::string& buildTool, + const std::string& version ) + : Exception ( "Build tool '%s' with version '%s' is unsupported. Please upgrade your build tool.", + buildTool.c_str (), + version.c_str () ) +{ + BuildTool = buildTool; + Version = version; +} diff --git a/tools/rbuild/exception.h b/tools/rbuild/exception.h new file mode 100644 index 00000000000..c09528553f5 --- /dev/null +++ b/tools/rbuild/exception.h @@ -0,0 +1,146 @@ +/* + * Copyright (C) 2005 Casper S. Hornstrup + * + * This program is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation; either version 2 of the License, or + * (at your option) any later version. + * + * This program 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 General Public License for more details. + * + * You should have received a copy of the GNU General Public License along + * with this program; if not, write to the Free Software Foundation, Inc., + * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. + */ + +#pragma once + +#include "pch.h" +#include "xml.h" + +class Exception +{ +public: + Exception ( const std::string& message ); + Exception ( const char* format, + ...); + const std::string& operator *() { return _e; } + +protected: + Exception (); + void SetMessage ( const char* message, ... ); + void SetMessageV ( const char* message, va_list args ); + +private: + std::string _e; +}; + + +class MissingArgumentException : public Exception +{ +public: + MissingArgumentException ( const std::string& argument ); +}; + + +class InvalidOperationException : public Exception +{ +public: + InvalidOperationException ( const char* filename, + const int linenumber); + InvalidOperationException ( const char* filename, + const int linenumber, + const char* message, + ... ); +}; + + +class OutOfMemoryException : public Exception +{ +public: + OutOfMemoryException (); +}; + + +class FileNotFoundException : public Exception +{ +public: + FileNotFoundException ( const std::string& filename ); + std::string Filename; +}; + + +class AccessDeniedException : public Exception +{ +public: + AccessDeniedException ( const std::string& filename ); + std::string Filename; +}; + +class InvalidDateException : public Exception +{ +public: + InvalidDateException ( const std::string& filename ); + std::string Filename; +}; + +class RequiredAttributeNotFoundException : public XMLInvalidBuildFileException +{ +public: + RequiredAttributeNotFoundException ( const std::string& location, + const std::string& attributeName, + const std::string& elementName ); +}; + + +class InvalidAttributeValueException : public XMLInvalidBuildFileException +{ +public: + InvalidAttributeValueException ( const std::string& location, + const std::string& name, + const std::string& value ); +}; + + +class BackendNameConflictException : public Exception +{ +public: + BackendNameConflictException ( const std::string& name ); +}; + + +class UnknownBackendException : public Exception +{ +public: + UnknownBackendException ( const std::string& name ); +}; + +class UnknownModuleTypeException : public XMLInvalidBuildFileException +{ +public: + UnknownModuleTypeException ( const std::string& location, + int moduletype ); +}; + + +class InvocationFailedException : public Exception +{ +public: + InvocationFailedException ( const std::string& command, + int exitcode ); + std::string Command; + int ExitCode; +}; + + +class UnsupportedBuildToolException : public Exception +{ +public: + UnsupportedBuildToolException ( const std::string& buildtool, + const std::string& version ); + std::string BuildTool; + std::string Version; +}; diff --git a/tools/rbuild/filesupportcode.cpp b/tools/rbuild/filesupportcode.cpp new file mode 100644 index 00000000000..f247ad908f6 --- /dev/null +++ b/tools/rbuild/filesupportcode.cpp @@ -0,0 +1,90 @@ +/* + * Copyright (C) 2005 Casper S. Hornstrup + * + * This program is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation; either version 2 of the License, or + * (at your option) any later version. + * + * This program 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 General Public License for more details. + * + * You should have received a copy of the GNU General Public License along + * with this program; if not, write to the Free Software Foundation, Inc., + * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. + */ +#include "pch.h" +#include + +#include "rbuild.h" + +using std::string; + +/* static */ void +FileSupportCode::WriteIfChanged ( char* outbuf, + const string& filename, + bool ignoreError ) +{ + FILE* out; + unsigned int end; + char* cmpbuf; + unsigned int stat; + + out = fopen ( filename.c_str (), "rb" ); + if ( out == NULL ) + { + out = fopen ( filename.c_str (), "wb" ); + if ( out == NULL ) + { + if ( ignoreError ) + return; + throw AccessDeniedException ( filename ); + } + fputs ( outbuf, out ); + fclose ( out ); + return; + } + + fseek ( out, 0, SEEK_END ); + end = ftell ( out ); + cmpbuf = (char*) malloc ( end ); + if ( cmpbuf == NULL ) + { + fclose ( out ); + throw OutOfMemoryException (); + } + + fseek ( out, 0, SEEK_SET ); + stat = fread ( cmpbuf, 1, end, out ); + if ( stat != end ) + { + free ( cmpbuf ); + fclose ( out ); + throw AccessDeniedException ( filename ); + } + if ( end == strlen ( outbuf ) && memcmp ( cmpbuf, outbuf, end ) == 0 ) + { + free ( cmpbuf ); + fclose ( out ); + return; + } + + free ( cmpbuf ); + fclose ( out ); + out = fopen ( filename.c_str (), "wb" ); + if ( out == NULL ) + { + throw AccessDeniedException ( filename ); + } + + stat = fwrite ( outbuf, 1, strlen ( outbuf ), out); + if ( strlen ( outbuf ) != stat ) + { + fclose ( out ); + throw AccessDeniedException ( filename ); + } + + fclose ( out ); +} diff --git a/tools/rbuild/global.cpp b/tools/rbuild/global.cpp new file mode 100644 index 00000000000..088cf14c0ee --- /dev/null +++ b/tools/rbuild/global.cpp @@ -0,0 +1,70 @@ +/* + * Copyright (C) 2005 Casper S. Hornstrup + * + * This program is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation; either version 2 of the License, or + * (at your option) any later version. + * + * This program 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 General Public License for more details. + * + * You should have received a copy of the GNU General Public License along + * with this program; if not, write to the Free Software Foundation, Inc., + * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. + */ +#include "rbuild.h" + +using std::string; +using std::vector; + +string ExePrefix; +string ExePostfix; +string sSep; +string sBadSep; +char cSep; +char cBadSep; + + +void +InitializeEnvironment () +{ + char *SepValue, *ExePostfixValue, *ExePrefixValue; + + SepValue = getenv ( "SEP" ); + if ( SepValue && ( 0 == strcmp ( SepValue, DEF_SSEP ) || 0 == strcmp ( SepValue, DEF_SBAD_SEP ) ) ) + { + cSep = SepValue[0]; + sSep = SepValue; + } + else + { + cSep = DEF_CSEP; + sSep = DEF_SSEP; + } + if ( cSep == DEF_CSEP ) + { + cBadSep = DEF_CBAD_SEP; + sBadSep = DEF_SBAD_SEP; + } + else + { + cBadSep = DEF_CSEP; + sBadSep = DEF_SSEP; + } + ExePostfixValue = getenv ( "EXEPOSTFIX" ); + ExePrefixValue = getenv ( "EXEPREFIX" ); + if ( ( ExePostfixValue == NULL || 0 == strlen ( ExePostfixValue ) ) && + ( ExePrefixValue == NULL || 0 == strlen ( ExePrefixValue ) ) ) + { + ExePostfix = DEF_EXEPOSTFIX; + ExePrefix = DEF_EXEPREFIX; + } + else + { + ExePostfix = ExePostfixValue ? ExePostfixValue : ""; + ExePrefix = ExePrefixValue ? ExePrefixValue : ""; + } +} diff --git a/tools/rbuild/include.cpp b/tools/rbuild/include.cpp new file mode 100644 index 00000000000..699f8e4e332 --- /dev/null +++ b/tools/rbuild/include.cpp @@ -0,0 +1,137 @@ +/* + * Copyright (C) 2005 Casper S. Hornstrup + * + * This program is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation; either version 2 of the License, or + * (at your option) any later version. + * + * This program 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 General Public License for more details. + * + * You should have received a copy of the GNU General Public License along + * with this program; if not, write to the Free Software Foundation, Inc., + * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. + */ +#include "pch.h" +#include + +#include "rbuild.h" + +using std::string; +using std::vector; + +Include::Include ( const Project& project, + const XMLElement* includeNode ) + : directory ( NULL ), + project ( project ), + node ( includeNode ), + module ( NULL ) +{ + Initialize (); +} + +Include::Include ( const Project& project, + const XMLElement* includeNode, + const Module* module ) + : directory ( NULL ), + project ( project ), + node ( includeNode ), + module ( module ) +{ + Initialize (); +} + +Include::Include ( const Project& project, + DirectoryLocation root, + const std::string& relative_path ) + : project ( project ), + node ( NULL ) +{ + directory = new FileLocation ( root, relative_path, "" ); +} + +Include::~Include() +{ + if ( directory ) + delete directory; +} + +void +Include::ProcessXML () +{ + DirectoryLocation root = SourceDirectory; + const Module *base = module; + + string relative_path; + const XMLAttribute* att = node->GetAttribute ( "base", false ); + if ( att ) + { + if ( !module ) + throw XMLInvalidBuildFileException ( + node->location, + "'base' attribute illegal from global " ); + + if ( att->value == project.name ) + base = NULL; + else + { + base = project.LocateModule ( att->value ); + if ( !base ) + throw XMLInvalidBuildFileException ( + node->location, + " attribute 'base' references non-existant project or module '%s'", + att->value.c_str() ); + root = GetDefaultDirectoryTree ( base ); + } + } + + if ( base ) + { + relative_path = base->output->relative_path; + if ( node->value.length () > 0 && node->value != "." ) + relative_path += sSep + node->value; + } + else + relative_path = node->value; + + att = node->GetAttribute ( "root", false ); + if ( att ) + { + if ( att->value == "intermediate" ) + root = IntermediateDirectory; + else if ( att->value == "output" ) + root = OutputDirectory; + else + throw InvalidAttributeValueException ( node->location, + "root", + att->value ); + } + + directory = new FileLocation ( root, + relative_path, + "", + node ); +} + +DirectoryLocation +Include::GetDefaultDirectoryTree ( const Module* module ) const +{ + if ( module != NULL && + ( module->type == RpcServer || + module->type == RpcClient || + module->type == RpcProxy || + module->type == IdlHeader || + module->type == IdlInterface) ) + return IntermediateDirectory; + else + return SourceDirectory; +} + +void +Include::Initialize () +{ + ParseCompilers ( *node, "cpp" ); +} diff --git a/tools/rbuild/installfile.cpp b/tools/rbuild/installfile.cpp new file mode 100644 index 00000000000..0083340b7b7 --- /dev/null +++ b/tools/rbuild/installfile.cpp @@ -0,0 +1,68 @@ +/* + * Copyright (C) 2005 Casper S. Hornstrup + * + * This program is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation; either version 2 of the License, or + * (at your option) any later version. + * + * This program 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 General Public License for more details. + * + * You should have received a copy of the GNU General Public License along + * with this program; if not, write to the Free Software Foundation, Inc., + * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. + */ +#include "pch.h" +#include + +#include "rbuild.h" + +using std::string; + +InstallFile::~InstallFile() +{ + delete source; + delete target; +} + +InstallFile::InstallFile ( const Project& project, + const XMLElement& installfileNode, + const string& path ) + : XmlNode(project, installfileNode ) +{ + const XMLAttribute* base = node.GetAttribute ( "installbase", false ); + const XMLAttribute* newname = node.GetAttribute ( "newname", false ); + + DirectoryLocation source_directory = SourceDirectory; + const XMLAttribute* att = node.GetAttribute ( "root", false ); + if ( att != NULL) + { + if ( att->value == "intermediate" ) + source_directory = IntermediateDirectory; + else if ( att->value == "output" ) + source_directory = OutputDirectory; + else + { + throw InvalidAttributeValueException ( + node.location, + "root", + att->value ); + } + } + + source = new FileLocation ( source_directory, + path, + node.value, + &node ); + target = new FileLocation ( InstallDirectory, + base && base->value != "." + ? base->value + : "", + newname + ? newname->value + : node.value, + &node ); +} diff --git a/tools/rbuild/linkerflag.cpp b/tools/rbuild/linkerflag.cpp new file mode 100644 index 00000000000..a949401b1c6 --- /dev/null +++ b/tools/rbuild/linkerflag.cpp @@ -0,0 +1,64 @@ +/* + * Copyright (C) 2005 Casper S. Hornstrup + * + * This program is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation; either version 2 of the License, or + * (at your option) any later version. + * + * This program 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 General Public License for more details. + * + * You should have received a copy of the GNU General Public License along + * with this program; if not, write to the Free Software Foundation, Inc., + * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. + */ +#include "pch.h" +#include + +#include "rbuild.h" + +using std::string; +using std::vector; + +LinkerFlag::LinkerFlag ( const Project& project_, + const XMLElement& linkerFlagNode ) + : project(project_), + module(NULL), + node(linkerFlagNode) +{ + Initialize(); +} + +LinkerFlag::LinkerFlag ( const Project& project_, + const Module* module_, + const XMLElement& linkerFlagNode ) + : project(project_), + module(module_), + node(linkerFlagNode) +{ + Initialize(); +} + +LinkerFlag::~LinkerFlag () +{ +} + +void +LinkerFlag::Initialize () +{ +} + +void +LinkerFlag::ProcessXML () +{ + if ( node.value.size () == 0 ) + { + throw XMLInvalidBuildFileException ( + node.location, + " is empty." ); + } + flag = node.value; +} diff --git a/tools/rbuild/linkerscript.cpp b/tools/rbuild/linkerscript.cpp new file mode 100644 index 00000000000..26b84d09c16 --- /dev/null +++ b/tools/rbuild/linkerscript.cpp @@ -0,0 +1,38 @@ +/* + * Copyright (C) 2005 Casper S. Hornstrup + * + * This program is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation; either version 2 of the License, or + * (at your option) any later version. + * + * This program 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 General Public License for more details. + * + * You should have received a copy of the GNU General Public License along + * with this program; if not, write to the Free Software Foundation, Inc., + * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. + */ +#include "pch.h" +#include + +#include "rbuild.h" + +LinkerScript::LinkerScript ( const XMLElement& node_, + const Module& module_, + const FileLocation *file_ ) + : node(node_), module(module_), file(file_) +{ +} + +LinkerScript::~LinkerScript () +{ + delete file; +} + +void +LinkerScript::ProcessXML() +{ +} diff --git a/tools/rbuild/makefile b/tools/rbuild/makefile new file mode 100644 index 00000000000..58ea26d26e8 --- /dev/null +++ b/tools/rbuild/makefile @@ -0,0 +1,3 @@ +TOP = ../.. +DEFAULT = rbuild +include $(TOP)/proxy.mak diff --git a/tools/rbuild/module.cpp b/tools/rbuild/module.cpp new file mode 100644 index 00000000000..f050640e68c --- /dev/null +++ b/tools/rbuild/module.cpp @@ -0,0 +1,1981 @@ +/* + * Copyright (C) 2005 Casper S. Hornstrup + * Copyright (C) 2008 Hervé Poussineau + * + * This program is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation; either version 2 of the License, or + * (at your option) any later version. + * + * This program 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 General Public License for more details. + * + * You should have received a copy of the GNU General Public License along + * with this program; if not, write to the Free Software Foundation, Inc., + * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. + */ +#include "pch.h" +#include + +#include "rbuild.h" + +using std::string; +using std::vector; + +string +Right ( const string& s, size_t n ) +{ + if ( n > s.size() ) + return s; + return string ( &s[s.size()-n] ); +} + +string +Replace ( const string& s, const string& find, const string& with ) +{ + string ret; + const char* p = s.c_str(); + while ( p ) + { + const char* p2 = strstr ( p, find.c_str() ); + if ( !p2 ) + break; + if ( p2 > p ) + ret += string ( p, p2-p ); + ret += with; + p = p2 + find.size(); + } + if ( *p ) + ret += p; + return ret; +} + +string +ChangeSeparator ( const string& s, + const char fromSeparator, + const char toSeparator ) +{ + string s2(s); + char* p = strchr ( &s2[0], fromSeparator ); + while ( p ) + { + *p++ = toSeparator; + p = strchr ( p, fromSeparator ); + } + return s2; +} + +string +FixSeparator ( const string& s ) +{ + return ChangeSeparator ( s, cBadSep, cSep ); +} + +string +FixSeparatorForSystemCommand ( const string& s ) +{ + string s2(s); + char* p = strchr ( &s2[0], DEF_CBAD_SEP ); + while ( p ) + { + *p++ = DEF_CSEP; + p = strchr ( p, DEF_CBAD_SEP ); + } + return s2; +} + +string +DosSeparator ( const string& s ) +{ + string s2(s); + char* p = strchr ( &s2[0], '/' ); + while ( p ) + { + *p++ = '\\'; + p = strchr ( p, '/' ); + } + return s2; +} + +string +ReplaceExtension ( + const string& filename, + const string& newExtension ) +{ + size_t index = filename.find_last_of ( '/' ); + if ( index == string::npos ) + index = 0; + size_t index2 = filename.find_last_of ( '\\' ); + if ( index2 != string::npos && index2 > index ) + index = index2; + string tmp = filename.substr( index /*, filename.size() - index*/ ); + size_t ext_index = tmp.find_last_of( '.' ); + if ( ext_index != string::npos ) + return filename.substr ( 0, index + ext_index ) + newExtension; + return filename + newExtension; +} + +string +GetSubPath ( + const Project& project, + const string& location, + const string& path, + const string& att_value ) +{ + if ( !att_value.size() ) + throw XMLInvalidBuildFileException ( + location, + " tag has empty 'name' attribute" ); + if ( strpbrk ( att_value.c_str (), "/\\?*:<>|" ) ) + throw XMLInvalidBuildFileException ( + location, + " tag has invalid characters in 'name' attribute" ); + if ( !path.size() ) + return att_value; + + return FixSeparator(path + cSep + att_value); +} + +string +GetExtension ( const string& filename ) +{ + size_t index = filename.find_last_of ( '/' ); + if (index == string::npos) index = 0; + string tmp = filename.substr( index, filename.size() - index ); + size_t ext_index = tmp.find_last_of( '.' ); + if (ext_index != string::npos) + return filename.substr ( index + ext_index, filename.size() ); + return ""; +} + +string +GetExtension ( const FileLocation& file ) +{ + return GetExtension ( file.name ); +} + +string +NormalizeFilename ( const string& filename ) +{ + if ( filename == "" ) + return ""; + Path path; + string normalizedPath = path.Fixup ( filename, true ); + string relativeNormalizedPath = path.RelativeFromWorkingDirectory ( normalizedPath ); + return FixSeparator ( relativeNormalizedPath ); +} + +bool +GetBooleanValue ( const string& value ) +{ + if ( value == "1" ) + return true; + else + return false; +} + +string +ToLower ( string filename ) +{ + for ( size_t i = 1; i < filename.length (); i++ ) + filename[i] = tolower ( filename[i] ); + return filename; +} + +IfableData::IfableData( ) + : asmFiles ( 0 ) +{ +} + +void IfableData::ExtractModules( std::map &modules ) +{ + size_t i; + for ( i = 0; i < this->modules.size (); i++ ) + modules.insert(std::make_pair(this->modules[i]->name, this->modules[i])); +} + +IfableData::~IfableData() +{ + size_t i; + for ( i = 0; i < includes.size (); i++ ) + delete includes[i]; + for ( i = 0; i < defines.size (); i++ ) + delete defines[i]; + for ( i = 0; i < libraries.size (); i++ ) + delete libraries[i]; + for ( std::map::const_iterator p = properties.begin(); p != properties.end(); ++ p ) + delete p->second; + for ( i = 0; i < compilerFlags.size (); i++ ) + delete compilerFlags[i]; + for ( i = 0; i < modules.size(); i++ ) + delete modules[i]; + for ( i = 0; i < compilationUnits.size (); i++ ) + delete compilationUnits[i]; +} + +void IfableData::ProcessXML () +{ + size_t i; + for ( i = 0; i < includes.size (); i++ ) + includes[i]->ProcessXML (); + for ( i = 0; i < defines.size (); i++ ) + defines[i]->ProcessXML (); + for ( i = 0; i < libraries.size (); i++ ) + libraries[i]->ProcessXML (); + for ( std::map::const_iterator p = properties.begin(); p != properties.end(); ++ p ) + p->second->ProcessXML (); + for ( i = 0; i < compilerFlags.size(); i++ ) + compilerFlags[i]->ProcessXML (); + for ( i = 0; i < compilationUnits.size (); i++ ) + compilationUnits[i]->ProcessXML (); +} + +bool Module::GetBooleanAttribute ( const XMLElement& moduleNode, const char * name, bool default_value ) +{ + const XMLAttribute* att = moduleNode.GetAttribute ( name, false ); + if ( att != NULL ) + { + const char* p = att->value.c_str(); + if ( !stricmp ( p, "true" ) || !stricmp ( p, "yes" ) ) + return true; + else if ( !stricmp ( p, "false" ) || !stricmp ( p, "no" ) ) + return false; + else + { + throw InvalidAttributeValueException ( + moduleNode.location, + name, + att->value ); + } + } + else + return default_value; +} + +Module::Module ( const Project& project, + const XMLElement& moduleNode, + const string& modulePath ) + : project (project), + node (moduleNode), + importLibrary (NULL), + delayImportLibrary (NULL), + metadata (NULL), + bootSector (NULL), + bootstrap (NULL), + autoRegister(NULL), + linkerScript (NULL), + pch (NULL), + cplusplus (false), + output (NULL), + install (NULL) +{ + if ( node.name != "module" ) + throw InvalidOperationException ( __FILE__, + __LINE__, + "Module created with non- node" ); + + xmlbuildFile = FixSeparator ( Path::RelativeFromWorkingDirectory ( moduleNode.xmlFile->filename () ) ); + + const XMLAttribute* att = moduleNode.GetAttribute ( "name", true ); + assert(att); + name = att->value; + + enabled = true; + + att = moduleNode.GetAttribute ( "if", false ); + if ( att != NULL ) + enabled = GetBooleanValue ( project.ResolveProperties ( att->value ) ); + + att = moduleNode.GetAttribute ( "ifnot", false ); + if ( att != NULL ) + enabled = !GetBooleanValue ( project.ResolveProperties ( att->value ) ); + + if ( !enabled && project.configuration.Verbose ) + printf("Module '%s' has been disabled.\n", name.c_str () ); + + att = moduleNode.GetAttribute ( "type", true ); + assert(att); + type = GetModuleType ( node.location, *att ); + + att = moduleNode.GetAttribute ( "extension", false ); + if ( att != NULL ) + extension = att->value; + else + extension = GetDefaultModuleExtension (); + + isUnicode = GetBooleanAttribute ( moduleNode, "unicode" ); + + if (isUnicode) + { + // Always define UNICODE and _UNICODE + Define* pDefine = new Define ( project, this, "UNICODE" ); + non_if_data.defines.push_back ( pDefine ); + + pDefine = new Define ( project, this, "_UNICODE" ); + non_if_data.defines.push_back ( pDefine ); + } + + att = moduleNode.GetAttribute ( "entrypoint", false ); + if ( att != NULL ) + { + if ( att->value == "" ) + { + throw InvalidAttributeValueException ( + moduleNode.location, + "entrypoint", + att->value ); + } + + entrypoint = att->value; + isDefaultEntryPoint = false; + } + else + { + entrypoint = GetDefaultModuleEntrypoint (); + isDefaultEntryPoint = true; + } + + att = moduleNode.GetAttribute ( "baseaddress", false ); + if ( att != NULL ) + baseaddress = att->value; + else + baseaddress = GetDefaultModuleBaseaddress (); + + isStartupLib = GetBooleanAttribute ( moduleNode, "isstartuplib" ); + isCRT = GetBooleanAttribute ( moduleNode, "iscrt", GetDefaultModuleIsCRT () ); + + att = moduleNode.GetAttribute ( "crt", false ); + if ( att != NULL) + { + CRT = att->value; + + if ( stricmp ( CRT.c_str (), "auto" ) == 0 ) + CRT = GetDefaultModuleCRT (); + } + else + CRT = GetDefaultModuleCRT (); + + const char * crtAttr = CRT.c_str (); + if ( crtAttr == NULL || stricmp ( crtAttr, "none" ) == 0 ) + dynamicCRT = false; + else if ( stricmp ( crtAttr, "libc" ) == 0 ) + dynamicCRT = false; + else if ( stricmp ( crtAttr, "msvcrt" ) == 0 ) + dynamicCRT = true; + else if ( stricmp ( crtAttr, "libcntpr" ) == 0 ) + dynamicCRT = false; + else if ( stricmp ( crtAttr, "ntdll" ) == 0 ) + dynamicCRT = true; + else if ( stricmp ( crtAttr, "static" ) == 0 ) + dynamicCRT = false; + else if ( stricmp ( crtAttr, "dll" ) == 0 ) + dynamicCRT = true; + else + { + throw InvalidAttributeValueException ( + moduleNode.location, + "crt", + std::string ( crtAttr ) ); + } + + if ( isCRT && dynamicCRT ) + { + throw XMLInvalidBuildFileException ( + moduleNode.location, + "C runtime module '%s' cannot be compiled for a dynamically-linked C runtime", + name.c_str() ); + } + + att = moduleNode.GetAttribute ( "prefix", false ); + if ( att != NULL ) + prefix = att->value; + + att = moduleNode.GetAttribute ( "installname", false ); + if ( att != NULL ) + { + const XMLAttribute* installbase = moduleNode.GetAttribute ( "installbase", false ); + install = new FileLocation ( InstallDirectory, + installbase ? installbase->value : "", + att->value, + &moduleNode ); + + output = new FileLocation ( GetTargetDirectoryTree (), + modulePath, + att->value, + &moduleNode ); + } + + att = moduleNode.GetAttribute ( "output", false ); + if ( att != NULL ) + { + if (output != NULL) + { + printf ( "%s: WARNING: 'installname' overrides 'output' also defined for this module.\n", + moduleNode.location.c_str() ); + } + else + { + output = new FileLocation ( GetTargetDirectoryTree (), + modulePath, + att->value, + &moduleNode ); + } + } + + /* If no one has set the output file for this module set it automatically */ + if (output == NULL) + { + output = new FileLocation ( GetTargetDirectoryTree (), + modulePath, + name + extension, + &moduleNode ); + } + + att = moduleNode.GetAttribute ( "allowwarnings", false ); + if ( att == NULL ) + { + att = moduleNode.GetAttribute ( "warnings", false ); + if ( att != NULL ) + { + printf ( "%s: WARNING: 'warnings' attribute of is deprecated, use 'allowwarnings' instead\n", + moduleNode.location.c_str() ); + } + } + if ( att != NULL ) + allowWarnings = att->value == "true"; + else if ( project.allowWarningsSet ) + allowWarnings = project.allowWarnings; + else + allowWarnings = false; + + att = moduleNode.GetAttribute ( "aliasof", false ); + if ( type == Alias && att != NULL ) + aliasedModuleName = att->value; + else + aliasedModuleName = ""; + + if ( type == BootProgram ) + { + att = moduleNode.GetAttribute ( "payload", true ); + payload = att->value; + } + + if ( type == BootProgram || type == ElfExecutable ) + { + att = moduleNode.GetAttribute ( "buildtype", false ); + if ( att != NULL ) + { + buildtype = att->value; + } + else + { + buildtype = "BOOTPROG"; + } + } + + att = moduleNode.GetAttribute ( "description", false ); + if (att != NULL ) + { + description = project.ResolveProperties(att->value); + } + else + description = ""; + + att = moduleNode.GetAttribute ( "lcid", false ); + if (type == KeyboardLayout && att != NULL ) + lcid = att->value; + else + lcid = ""; + + att = moduleNode.GetAttribute ( "layoutid", false ); + if (type == KeyboardLayout && att != NULL ) + layoutId = att->value; + else + layoutId = ""; + + att = moduleNode.GetAttribute ( "layoutnameresid", false ); + if (type == KeyboardLayout && att != NULL ) + layoutNameResId = att->value; + else + layoutNameResId = ""; + + SetImportLibrary ( NULL ); +} + +Module::~Module () +{ + size_t i; + for ( i = 0; i < invocations.size(); i++ ) + delete invocations[i]; + for ( i = 0; i < dependencies.size(); i++ ) + delete dependencies[i]; + for ( i = 0; i < compilerFlags.size(); i++ ) + delete compilerFlags[i]; + for ( i = 0; i < linkerFlags.size(); i++ ) + delete linkerFlags[i]; + for ( i = 0; i < stubbedComponents.size(); i++ ) + delete stubbedComponents[i]; + for ( i = 0; i < cdfiles.size (); i++ ) + delete cdfiles[i]; + if ( linkerScript ) + delete linkerScript; + if ( pch ) + delete pch; + if ( install ) + delete install; + if ( metadata ) + delete metadata; + if ( bootstrap ) + delete bootstrap; + if ( importLibrary ) + delete importLibrary; + if ( bootSector ) + delete bootSector; + if ( dependency ) + delete dependency; + if ( autoRegister ) + delete autoRegister; + if ( output ) + delete output; +} + +void +Module::ProcessXML() +{ + if ( type == Alias ) + { + aliasedModuleName = project.ResolveProperties ( aliasedModuleName ); + if ( aliasedModuleName == name ) + { + throw XMLInvalidBuildFileException ( + node.location, + "module '%s' cannot link against itself", + name.c_str() ); + } + const Module* m = project.LocateModule ( aliasedModuleName ); + if ( !m && enabled ) + { + throw XMLInvalidBuildFileException ( + node.location, + "module '%s' trying to alias non-existant module '%s'", + name.c_str(), + aliasedModuleName.c_str() ); + } + } + + size_t i; + for ( i = 0; i < node.subElements.size(); i++ ) + { + ParseContext parseContext; + ProcessXMLSubElement ( *node.subElements[i], SourceDirectory, output->relative_path, parseContext ); + } + for ( i = 0; i < invocations.size(); i++ ) + invocations[i]->ProcessXML (); + for ( i = 0; i < dependencies.size(); i++ ) + dependencies[i]->ProcessXML (); + for ( i = 0; i < compilerFlags.size(); i++ ) + compilerFlags[i]->ProcessXML(); + for ( i = 0; i < linkerFlags.size(); i++ ) + linkerFlags[i]->ProcessXML(); + for ( i = 0; i < stubbedComponents.size(); i++ ) + stubbedComponents[i]->ProcessXML(); + non_if_data.ProcessXML(); + if ( linkerScript ) + linkerScript->ProcessXML(); + if ( pch ) + pch->ProcessXML(); + if ( autoRegister ) + autoRegister->ProcessXML(); +} + +void +Module::ProcessXMLSubElement ( const XMLElement& e, + DirectoryLocation directory, + const string& relative_path, + ParseContext& parseContext ) +{ + const XMLAttribute* att; + + att = e.GetAttribute ( "compilerset", false ); + + if ( att ) + { + CompilerSet compilerSet; + + if ( att->value == "msc" ) + compilerSet = MicrosoftC; + else if ( att->value == "gcc" ) + compilerSet = GnuGcc; + else + throw InvalidAttributeValueException ( + e.location, + "compilerset", + att->value ); + + if ( compilerSet != project.configuration.Compiler ) + return; + } + + att = e.GetAttribute ( "linkerset", false ); + + if ( att ) + { + LinkerSet linkerSet; + + if ( att->value == "mslink" ) + linkerSet = MicrosoftLink; + else if ( att->value == "ld" ) + linkerSet = GnuLd; + else + throw InvalidAttributeValueException ( + e.location, + "linkerset", + att->value ); + + if ( linkerSet != project.configuration.Linker ) + return; + } + + CompilationUnit* pOldCompilationUnit = parseContext.compilationUnit; + bool subs_invalid = false; + string subpath ( relative_path ); + DirectoryLocation subdirectory = SourceDirectory; + if ( e.name == "file" && e.value.size () > 0 ) + { + bool first = false; + const XMLAttribute* att = e.GetAttribute ( "first", false ); + if ( att != NULL ) + { + if ( !stricmp ( att->value.c_str(), "true" ) ) + first = true; + else if ( stricmp ( att->value.c_str(), "false" ) ) + { + throw XMLInvalidBuildFileException ( + e.location, + "attribute 'first' of element can only be 'true' or 'false'" ); + } + } + string switches = ""; + att = e.GetAttribute ( "switches", false ); + if ( att != NULL ) + switches = att->value; + if ( !cplusplus ) + { + // check for c++ file + string ext = GetExtension ( e.value ); + if ( !stricmp ( ext.c_str(), ".cpp" ) ) + cplusplus = true; + else if ( !stricmp ( ext.c_str(), ".cc" ) ) + cplusplus = true; + else if ( !stricmp ( ext.c_str(), ".cxx" ) ) + cplusplus = true; + } + File* pFile = new File ( directory, + relative_path, + e.value, + first, + switches, + false ); + if ( parseContext.compilationUnit ) + parseContext.compilationUnit->AddFile ( pFile ); + else + { + CompilationUnit* pCompilationUnit = new CompilationUnit ( pFile ); + string ext = ToLower ( GetExtension ( e.value ) ); + if ( ext == ".idl" ) + { + // put .idl files at the start of the module + non_if_data.compilationUnits.insert ( + non_if_data.compilationUnits.begin(), + pCompilationUnit ); + } + else if ( ext == ".asm" || ext == ".s" ) + { + // put .asm files at the end of the module + non_if_data.compilationUnits.push_back ( pCompilationUnit ); + non_if_data.asmFiles++; + } + else + { + // put other files in the middle + non_if_data.compilationUnits.insert ( + non_if_data.compilationUnits.end() - non_if_data.asmFiles, + pCompilationUnit ); + } + } + non_if_data.files.push_back ( pFile ); + subs_invalid = true; + } + else if ( e.name == "library" && e.value.size () ) + { + const XMLAttribute* att = e.GetAttribute ( "delayimport", false ); + Library* pLibrary = new Library ( e, *this, e.value ); + if ( att && !stricmp ( att->value.c_str(), "true" ) ) + pLibrary->delayimp = true; + non_if_data.libraries.push_back ( pLibrary ); + subs_invalid = true; + } + else if ( e.name == "directory" ) + { + const XMLAttribute* att = e.GetAttribute ( "name", true ); + const XMLAttribute* root = e.GetAttribute ( "root", false ); + assert(att); + if ( root ) + { + if ( root->value == "intermediate" ) + subdirectory = IntermediateDirectory; + else if ( root->value == "output" ) + subdirectory = OutputDirectory; + else + { + throw InvalidAttributeValueException ( + e.location, + "root", + root->value ); + } + } + subpath = GetSubPath ( this->project, e.location, relative_path, att->value ); + } + else if ( e.name == "include" ) + { + Include* include = new Include ( project, &e, this ); + non_if_data.includes.push_back ( include ); + subs_invalid = true; + } + else if ( e.name == "define" || e.name == "redefine" ) + { + Define* pDefine = new Define ( project, this, e ); + non_if_data.defines.push_back ( pDefine ); + subs_invalid = true; + } + else if ( e.name == "metadata" ) + { + metadata = new Metadata ( e, *this ); + subs_invalid = false; + } + else if ( e.name == "invoke" ) + { + invocations.push_back ( new Invoke ( e, *this ) ); + subs_invalid = false; + } + else if ( e.name == "dependency" ) + { + dependencies.push_back ( new Dependency ( e, *this ) ); + subs_invalid = true; + } + else if ( e.name == "bootsector" ) + { + bootSector = new Bootsector ( e, this ); + subs_invalid = true; + } + else if ( e.name == "importlibrary" ) + { + if ( importLibrary ) + { + throw XMLInvalidBuildFileException ( + e.location, + "Only one is valid per module" ); + } + SetImportLibrary ( new ImportLibrary ( project, e, this, false ) ); + SetDelayImportLibrary ( new ImportLibrary ( project, e, this, true ) ); + subs_invalid = true; + } + else if ( e.name == "if" || e.name == "ifnot" ) + { + const XMLAttribute* name; + name = e.GetAttribute ( "property", true ); + assert( name ); + const Property *property = project.LookupProperty( name->value ); + const string *PropertyValue; + const string EmptyString; + + if (property) + { + PropertyValue = &property->value; + } + else + { + // Property does not exist, treat it as being empty + PropertyValue = &EmptyString; + } + + const XMLAttribute* value; + value = e.GetAttribute ( "value", true ); + assert( value ); + + bool negate = ( e.name == "ifnot" ); + bool equality = ( *PropertyValue == value->value ); + if ( equality == negate ) + { + // Failed, skip this element + if ( project.configuration.Verbose ) + printf("Skipping 'If' at %s\n", e.location.c_str () ); + return; + } + subs_invalid = false; + } + else if ( e.name == "compilerflag" ) + { + CompilerFlag* pCompilerFlag = new CompilerFlag ( project, this, e ); + non_if_data.compilerFlags.push_back ( pCompilerFlag ); + subs_invalid = true; + } + else if ( e.name == "linkerflag" ) + { + linkerFlags.push_back ( new LinkerFlag ( project, this, e ) ); + subs_invalid = true; + } + else if ( e.name == "linkerscript" ) + { + if ( linkerScript ) + { + throw XMLInvalidBuildFileException ( + e.location, + "Only one is valid per module" ); + } + size_t pos = e.value.find_last_of ( "/\\" ); + if ( pos == string::npos ) + { + linkerScript = new LinkerScript ( + e, *this, new FileLocation ( SourceDirectory, relative_path, e.value, &e ) ); + } + else + { + string dir = e.value.substr ( 0, pos ); + string name = e.value.substr ( pos + 1); + linkerScript = new LinkerScript ( + e, *this, new FileLocation ( SourceDirectory, relative_path + sSep + dir, name, &e ) ); + } + subs_invalid = true; + } + else if ( e.name == "component" ) + { + stubbedComponents.push_back ( new StubbedComponent ( this, e ) ); + subs_invalid = false; + } + else if ( e.name == "property" ) + { + throw XMLInvalidBuildFileException ( + e.location, + " is not a valid sub-element of " ); + } + else if ( e.name == "bootstrap" ) + { + bootstrap = new Bootstrap ( project, this, e ); + subs_invalid = true; + } + else if ( e.name == "pch" ) + { + if ( pch ) + { + throw XMLInvalidBuildFileException ( + e.location, + "Only one is valid per module" ); + } + size_t pos = e.value.find_last_of ( "/\\" ); + if ( pos == string::npos ) + { + pch = new PchFile ( + e, *this, new FileLocation ( SourceDirectory, relative_path, e.value, &e ) ); + } + else + { + string dir = e.value.substr ( 0, pos ); + string name = e.value.substr ( pos + 1); + pch = new PchFile ( + e, *this, new FileLocation ( SourceDirectory, relative_path + sSep + dir, name, &e ) ); + } + subs_invalid = true; + } + else if ( e.name == "compilationunit" ) + { + if ( project.configuration.CompilationUnitsEnabled ) + { + CompilationUnit* pCompilationUnit = new CompilationUnit ( &project, this, &e ); + non_if_data.compilationUnits.push_back ( pCompilationUnit ); + parseContext.compilationUnit = pCompilationUnit; + } + subs_invalid = false; + } + else if ( e.name == "autoregister" ) + { + if ( autoRegister != NULL) + { + throw XMLInvalidBuildFileException ( + e.location, + "there can be only one <%s> element for a module", + e.name.c_str() ); + } + autoRegister = new AutoRegister ( project, this, e ); + subs_invalid = true; + } + else if ( e.name == "cdfile" ) + { + CDFile* cdfile = new CDFile ( project, e, subpath ); + cdfiles.push_back ( cdfile ); + subs_invalid = true; + } + if ( subs_invalid && e.subElements.size() > 0 ) + { + throw XMLInvalidBuildFileException ( + e.location, + "<%s> cannot have sub-elements", + e.name.c_str() ); + } + for ( size_t i = 0; i < cdfiles.size (); i++ ) + cdfiles[i]->ProcessXML (); + for ( size_t i = 0; i < e.subElements.size (); i++ ) + ProcessXMLSubElement ( *e.subElements[i], subdirectory, subpath, parseContext ); + parseContext.compilationUnit = pOldCompilationUnit; +} + +ModuleType +Module::GetModuleType ( const string& location, const XMLAttribute& attribute ) +{ + if ( attribute.value == "buildtool" ) + return BuildTool; + if ( attribute.value == "staticlibrary" ) + return StaticLibrary; + if ( attribute.value == "hoststaticlibrary" ) + return HostStaticLibrary; + if ( attribute.value == "objectlibrary" ) + return ObjectLibrary; + if ( attribute.value == "kernel" ) + return Kernel; + if ( attribute.value == "kernelmodedll" ) + return KernelModeDLL; + if ( attribute.value == "kernelmodedriver" ) + return KernelModeDriver; + if ( attribute.value == "nativedll" ) + return NativeDLL; + if ( attribute.value == "nativecui" ) + return NativeCUI; + if ( attribute.value == "keyboardlayout" ) + return KeyboardLayout; + if ( attribute.value == "win32dll" ) + return Win32DLL; + if ( attribute.value == "win32ocx" ) + return Win32OCX; + if ( attribute.value == "win32cui" ) + return Win32CUI; + if ( attribute.value == "win32gui" ) + return Win32GUI; + if ( attribute.value == "win32scr" ) + return Win32SCR; + if ( attribute.value == "bootloader" ) + return BootLoader; + if ( attribute.value == "bootsector" ) + return BootSector; + if ( attribute.value == "bootprogram" ) + return BootProgram; + if ( attribute.value == "iso" ) + return Iso; + if ( attribute.value == "liveiso" ) + return LiveIso; + if ( attribute.value == "test" ) + return Test; + if ( attribute.value == "rpcserver" ) + return RpcServer; + if ( attribute.value == "rpcclient" ) + return RpcClient; + if ( attribute.value == "rpcproxy" ) + return RpcProxy; + if ( attribute.value == "alias" ) + return Alias; + if ( attribute.value == "idlheader" ) + return IdlHeader; + if ( attribute.value == "idlinterface" ) + return IdlInterface; + if ( attribute.value == "embeddedtypelib" ) + return EmbeddedTypeLib; + if ( attribute.value == "elfexecutable" ) + return ElfExecutable; + if ( attribute.value == "cabinet" ) + return Cabinet; + if ( attribute.value == "messageheader" ) + return MessageHeader; + throw InvalidAttributeValueException ( location, + attribute.name, + attribute.value ); +} + +DirectoryLocation +Module::GetTargetDirectoryTree () const +{ + switch ( type ) + { + case Kernel: + case KernelModeDLL: + case KeyboardLayout: + case NativeDLL: + case Win32DLL: + case Win32OCX: + case KernelModeDriver: + case NativeCUI: + case Win32CUI: + case Test: + case Win32SCR: + case Win32GUI: + case BuildTool: + case BootLoader: + case BootSector: + case BootProgram: + case Iso: + case LiveIso: + case ElfExecutable: + case Cabinet: + return OutputDirectory; + case EmbeddedTypeLib: + case StaticLibrary: + case HostStaticLibrary: + case ObjectLibrary: + case RpcServer: + case RpcClient: + case RpcProxy: + case Alias: + case IdlHeader: + case IdlInterface: + case MessageHeader: + return IntermediateDirectory; + case TypeDontCare: + break; + } + throw InvalidOperationException ( __FILE__, + __LINE__, + "Invalid module type %d.", + type ); +} + +string +Module::GetDefaultModuleExtension () const +{ + switch (type) + { + case BuildTool: + return ExePostfix; + case BootProgram: + case StaticLibrary: + case HostStaticLibrary: + return ".a"; + case ObjectLibrary: + return ".o"; + case Kernel: + case NativeCUI: + case Win32CUI: + case Win32GUI: + return ".exe"; + case Win32SCR: + return ".scr"; + + case KernelModeDLL: + case NativeDLL: + case KeyboardLayout: + case Win32DLL: + return ".dll"; + case Win32OCX: + return ".ocx"; + case KernelModeDriver: + case BootLoader: + return ".sys"; + case Cabinet: + return ".cab"; + case BootSector: + return ".o"; + case Iso: + case LiveIso: + return ".iso"; + case Test: + return ".exe"; + case RpcServer: + case RpcClient: + case RpcProxy: + case IdlInterface: + return ".o"; + case Alias: + case ElfExecutable: + case IdlHeader: + case MessageHeader: + return ""; + case EmbeddedTypeLib: + return ".tlb"; + case TypeDontCare: + break; + } + throw InvalidOperationException ( __FILE__, + __LINE__ ); +} + +string +Module::GetDefaultModuleEntrypoint () const +{ + switch ( type ) + { + case Kernel: + if (Environment::GetArch() == "i386") return "KiSystemStartup@4"; + return "KiSystemStartup"; + case KeyboardLayout: + case KernelModeDLL: + case KernelModeDriver: + if (Environment::GetArch() == "i386") return "DriverEntry@8"; + return "DriverEntry"; + case NativeDLL: + if (Environment::GetArch() == "i386") return "DllMainCRTStartup@12"; + return "DllMainCRTStartup"; + case NativeCUI: + if (Environment::GetArch() == "i386") return "NtProcessStartup@4"; + return "NtProcessStartup"; + case Win32DLL: + case Win32OCX: + if (Environment::GetArch() == "i386") return "DllMain@12"; + return "DllMain"; + case Win32CUI: + case Test: + case BootLoader: + return "mainCRTStartup"; + case Win32SCR: + case Win32GUI: + return "WinMainCRTStartup"; + case BuildTool: + case StaticLibrary: + case HostStaticLibrary: + case ObjectLibrary: + case BootSector: + case Iso: + case LiveIso: + case RpcServer: + case RpcClient: + case RpcProxy: + case Alias: + case BootProgram: + case IdlHeader: + case IdlInterface: + case MessageHeader: + case ElfExecutable: + case EmbeddedTypeLib: + case Cabinet: + return ""; + case TypeDontCare: + break; + } + throw InvalidOperationException ( __FILE__, + __LINE__ ); +} + +string +Module::GetDefaultModuleBaseaddress () const +{ + switch ( type ) + { + case Kernel: + return "0x80800000"; + case Win32DLL: + case Win32OCX: + return "0x10000000"; + case NativeDLL: + case NativeCUI: + case Win32CUI: + case Test: + return "0x00400000"; + case Win32SCR: + case Win32GUI: + return "0x00400000"; + case KeyboardLayout: + case KernelModeDLL: + case KernelModeDriver: + return "0x00010000"; + case ElfExecutable: + return "0xe00000"; + case BootLoader: + return "0x8000"; + case BuildTool: + case StaticLibrary: + case HostStaticLibrary: + case ObjectLibrary: + case BootSector: + case Iso: + case LiveIso: + case RpcServer: + case RpcClient: + case RpcProxy: + case Alias: + case BootProgram: + case IdlHeader: + case IdlInterface: + case MessageHeader: + case EmbeddedTypeLib: + case Cabinet: + return ""; + case TypeDontCare: + break; + } + throw InvalidOperationException ( __FILE__, + __LINE__ ); +} + +std::string +Module::GetDefaultModuleCRT () const +{ + if ( isCRT ) + return "static"; + + switch ( type ) + { + case Kernel: + return "static"; + case Win32DLL: + case Win32OCX: + return "msvcrt"; + case NativeDLL: + case NativeCUI: + return "ntdll"; + case Win32CUI: + case Win32SCR: + case Win32GUI: + return "msvcrt"; + case Test: + return "msvcrt"; // BUGBUG: not sure about this + case KeyboardLayout: + return "none"; + case KernelModeDLL: + case KernelModeDriver: + return "dll"; + case BootLoader: + return "libcntpr"; + case ElfExecutable: + case BuildTool: + case StaticLibrary: + case HostStaticLibrary: + case ObjectLibrary: + case BootSector: + case Iso: + case LiveIso: + case RpcServer: + case RpcClient: + case RpcProxy: + case Alias: + case BootProgram: + case IdlHeader: + case IdlInterface: + case MessageHeader: + case EmbeddedTypeLib: + case Cabinet: + case TypeDontCare: + return "none"; + } + throw InvalidOperationException ( __FILE__, + __LINE__ ); +} + +bool +Module::GetDefaultModuleIsCRT () const +{ + return type == Kernel; +} + +bool +Module::HasImportLibrary () const +{ + return importLibrary != NULL && type != StaticLibrary && type != HostStaticLibrary; +} + +bool +Module::IsDLL () const +{ + switch ( type ) + { + case Kernel: + case KernelModeDLL: + case NativeDLL: + case KeyboardLayout: + case Win32DLL: + case Win32OCX: + case KernelModeDriver: + return true; + case NativeCUI: + case Win32CUI: + case Test: + case Win32SCR: + case Win32GUI: + case BuildTool: + case StaticLibrary: + case HostStaticLibrary: + case ObjectLibrary: + case BootLoader: + case BootSector: + case BootProgram: + case Iso: + case LiveIso: + case RpcServer: + case RpcClient: + case RpcProxy: + case Alias: + case IdlHeader: + case IdlInterface: + case MessageHeader: + case EmbeddedTypeLib: + case ElfExecutable: + case Cabinet: + return false; + case TypeDontCare: + break; + } + throw InvalidOperationException ( __FILE__, + __LINE__ ); +} + +string +Module::GetPathWithPrefix ( const string& prefix ) const +{ + return output->relative_path + cSep + prefix + output->name; +} + +string +Module::GetPathToBaseDir () const +{ + string temp_path = output->relative_path; + string result = "..\\"; + while(temp_path.find ('\\') != string::npos) + { + temp_path.erase (0, temp_path.find('\\')+1); + result += "..\\"; + } + return result; +} + +string +Module::GetInvocationTarget ( const int index ) const +{ + return ssprintf ( "%s_invoke_%d", + name.c_str (), + index ); +} + +string +Module::GetEntryPoint() const +{ + string result = ""; + if (entrypoint == "0" || entrypoint == "0x0") + return "0"; + + if (Environment::GetArch() != "arm" && Environment::GetArch() != "amd64") + result = "_"; + + result += entrypoint; + + if (Environment::GetArch() == "amd64") + { + size_t at_index = result.find_last_of( '@' ); + if ( at_index != result.npos ) + return result.substr (0, at_index ); + } + + return result; +} + +bool +Module::HasFileWithExtension ( + const IfableData& data, + const std::string& extension ) const +{ + size_t i; + for ( i = 0; i < data.compilationUnits.size (); i++ ) + { + CompilationUnit* compilationUnit = data.compilationUnits[i]; + if ( compilationUnit->HasFileWithExtension ( extension ) ) + return true; + } + return false; +} + +void +Module::InvokeModule () const +{ + for ( size_t i = 0; i < invocations.size (); i++ ) + { + Invoke& invoke = *invocations[i]; + string command = FixSeparatorForSystemCommand(invoke.invokeModule->output->relative_path + "/" + invoke.invokeModule->output->name ) + " " + invoke.GetParameters (); + printf ( "Executing '%s'\n\n", command.c_str () ); + int exitcode = system ( command.c_str () ); + if ( exitcode != 0 ) + throw InvocationFailedException ( command, + exitcode ); + } +} + + +void +Module::SetImportLibrary ( ImportLibrary* importLibrary ) +{ + this->importLibrary = importLibrary; + dependency = new FileLocation ( HasImportLibrary () ? IntermediateDirectory : output->directory, + output->relative_path, + HasImportLibrary () ? "lib" + name + ".a" : output->name ); +} + +void +Module::SetDelayImportLibrary ( ImportLibrary* importLibrary ) +{ + this->delayImportLibrary = importLibrary; +} + +std::string +Module::GetDllName () const +{ + if ( importLibrary && !importLibrary->dllname.empty() ) + return importLibrary->dllname; + else if ( output ) + return output->name; + else + throw new InvalidOperationException ( __FILE__, __LINE__, "Module %s has no dllname." ); +} + +SpecFileType +Module::IsSpecDefinitionFile () const +{ + if(!importLibrary) + return None; + + std::string ext = GetExtension ( *importLibrary->source ); + + if ( ext == ".spec" ) + return Spec; + + if ( ext == ".pspec" ) + return PSpec; + + return None; +} + + +File::File ( DirectoryLocation directory, + const string& relative_path, + const string& name, + bool _first, + const string& _switches, + bool _isPreCompiledHeader ) + : file ( directory, relative_path, name ), + first(_first), + switches(_switches), + isPreCompiledHeader(_isPreCompiledHeader) +{ +} + + +void +File::ProcessXML() +{ +} + + +std::string File::GetFullPath () const +{ + string directory ( "" ); + switch ( file.directory ) + { + case SourceDirectory: + break; + case IntermediateDirectory: + directory = Environment::GetIntermediatePath () + sSep; + break; + default: + throw InvalidOperationException ( __FILE__, + __LINE__, + "Invalid directory %d.", + file.directory ); + } + + if ( file.relative_path.length () > 0 ) + directory += file.relative_path + sSep; + + + return directory + file.name; +} + + +Library::Library ( const XMLElement& _node, + const Module& _module, + const string& _name ) + : node(&_node), + module(_module), + name(_name), + importedModule(_module.project.LocateModule(_name)), + delayimp(false) +{ + if ( module.name == name ) + { + throw XMLInvalidBuildFileException ( + node->location, + "module '%s' cannot link against itself", + name.c_str() ); + } + if ( !importedModule ) + { + throw XMLInvalidBuildFileException ( + node->location, + "module '%s' trying to import non-existant module '%s'", + module.name.c_str(), + name.c_str() ); + } +} + +Library::Library ( const Module& _module, + const string& _name ) + : node(NULL), + module(_module), + name(_name), + importedModule(_module.project.LocateModule(_name)), + delayimp(false) +{ + if ( !importedModule ) + { + throw XMLInvalidBuildFileException ( + "", + "module '%s' trying to import non-existant module '%s'", + module.name.c_str(), + name.c_str() ); + } +} + +void +Library::ProcessXML() +{ + if ( node && !module.project.LocateModule ( name ) ) + { + throw XMLInvalidBuildFileException ( + node->location, + "module '%s' is trying to link against non-existant module '%s'", + module.name.c_str(), + name.c_str() ); + } +} + + +Invoke::Invoke ( const XMLElement& _node, + const Module& _module ) + : node (_node), + module (_module) +{ +} + +void +Invoke::ProcessXML() +{ + const XMLAttribute* att = node.GetAttribute ( "module", false ); + if (att == NULL) + invokeModule = &module; + else + { + invokeModule = module.project.LocateModule ( att->value ); + if ( invokeModule == NULL ) + { + throw XMLInvalidBuildFileException ( + node.location, + "module '%s' is trying to invoke non-existant module '%s'", + module.name.c_str(), + att->value.c_str() ); + } + } + + for ( size_t i = 0; i < node.subElements.size (); i++ ) + ProcessXMLSubElement ( *node.subElements[i] ); +} + +void +Invoke::ProcessXMLSubElement ( const XMLElement& e ) +{ + bool subs_invalid = false; + if ( e.name == "input" ) + { + for ( size_t i = 0; i < e.subElements.size (); i++ ) + ProcessXMLSubElementInput ( *e.subElements[i] ); + } + else if ( e.name == "output" ) + { + for ( size_t i = 0; i < e.subElements.size (); i++ ) + ProcessXMLSubElementOutput ( *e.subElements[i] ); + } + if ( subs_invalid && e.subElements.size() > 0 ) + { + throw XMLInvalidBuildFileException ( + e.location, + "<%s> cannot have sub-elements", + e.name.c_str() ); + } +} + +void +Invoke::ProcessXMLSubElementInput ( const XMLElement& e ) +{ + bool subs_invalid = false; + if ( e.name == "inputfile" && e.value.size () > 0 ) + { + input.push_back ( new InvokeFile ( + e, FixSeparator ( module.output->relative_path + cSep + e.value ) ) ); + subs_invalid = true; + } + if ( subs_invalid && e.subElements.size() > 0 ) + { + throw XMLInvalidBuildFileException ( + e.location, + "<%s> cannot have sub-elements", + e.name.c_str() ); + } +} + +void +Invoke::ProcessXMLSubElementOutput ( const XMLElement& e ) +{ + bool subs_invalid = false; + if ( e.name == "outputfile" && e.value.size () > 0 ) + { + output.push_back ( new InvokeFile ( + e, FixSeparator ( module.output->relative_path + cSep + e.value ) ) ); + subs_invalid = true; + } + if ( subs_invalid && e.subElements.size() > 0 ) + { + throw XMLInvalidBuildFileException ( + e.location, + "<%s> cannot have sub-elements", + e.name.c_str() ); + } +} + +void +Invoke::GetTargets ( string_list& targets ) const +{ + for ( size_t i = 0; i < output.size (); i++ ) + { + InvokeFile& file = *output[i]; + targets.push_back ( NormalizeFilename ( file.name ) ); + } +} + +string +Invoke::GetParameters () const +{ + string parameters ( "" ); + size_t i; + for ( i = 0; i < output.size (); i++ ) + { + if ( parameters.length () > 0) + parameters += " "; + InvokeFile& invokeFile = *output[i]; + if ( invokeFile.switches.length () > 0 ) + { + parameters += invokeFile.switches + " "; + } + parameters += invokeFile.name; + } + + for ( i = 0; i < input.size (); i++ ) + { + if ( parameters.length () > 0 ) + parameters += " "; + InvokeFile& invokeFile = *input[i]; + if ( invokeFile.switches.length () > 0 ) + { + parameters += invokeFile.switches; + parameters += " "; + } + parameters += invokeFile.name ; + } + + return parameters; +} + + +InvokeFile::InvokeFile ( const XMLElement& _node, + const string& _name ) + : node (_node), + name (_name) +{ + const XMLAttribute* att = _node.GetAttribute ( "switches", false ); + if (att != NULL) + switches = att->value; + else + switches = ""; +} + +void +InvokeFile::ProcessXML() +{ +} + + +Dependency::Dependency ( const XMLElement& _node, + const Module& _module ) + : node (_node), + module (_module), + dependencyModule (NULL) +{ +} + +void +Dependency::ProcessXML() +{ + dependencyModule = module.project.LocateModule ( node.value ); + if ( dependencyModule == NULL ) + { + throw XMLInvalidBuildFileException ( + node.location, + "module '%s' depend on non-existant module '%s'", + module.name.c_str(), + node.value.c_str() ); + } +} + +Bootsector::Bootsector ( const XMLElement& _node, + const Module* _module ) + : node (_node), + module (_module), + bootSectorModule (NULL) +{ + if ( !IsSupportedModuleType ( module->type ) ) + { + throw XMLInvalidBuildFileException ( + node.location, + " is not applicable for this module type." ); + } + + bootSectorModule = module->project.LocateModule ( node.value ); + if ( bootSectorModule == NULL ) + { + throw XMLInvalidBuildFileException ( + node.location, + "module '%s' depend on non-existant module '%s'", + module->name.c_str(), + node.value.c_str() ); + } + + if (bootSectorModule->type != BootSector) + { + throw XMLInvalidBuildFileException ( + node.location, + "module '%s' is referencing non BootSector module '%s'", + module->name.c_str(), + node.value.c_str() ); + } +} + +void +Bootsector::ProcessXML() +{ +} + +bool +Bootsector::IsSupportedModuleType ( ModuleType type ) +{ + if ( type == Iso || + type == LiveIso ) + { + return true; + } + + return false; +} + +Metadata::Metadata ( const XMLElement& _node, + const Module& _module ) + : node (_node), + module (_module) +{ + /* The module name */ + const XMLAttribute* att = _node.GetAttribute ( "name", false ); + if (att != NULL) + name = att->value; + else + name = module.name; + + /* The module description */ + att = _node.GetAttribute ( "description", false ); + if (att != NULL) + description = att->value; + else + description = ""; + + /* The module version */ + att = _node.GetAttribute ( "version", false ); + if (att != NULL) + version = att->value; + else + version = ""; + + /* The module copyright */ + att = _node.GetAttribute ( "copyright", false ); + if (att != NULL) + copyright = att->value; + else + copyright = ""; + + att = _node.GetAttribute ( "url", false ); + if (att != NULL) + url = att->value; + else + url = ""; + + /* When was this module updated */ + att = _node.GetAttribute ( "date", false ); + if (att != NULL) + date = att->value; + else + date = "?"; + + /* When was this module updated */ + att = _node.GetAttribute ( "owner", false ); + if (att != NULL) + owner = att->value; + else + owner = "ReactOS"; +} + + +ImportLibrary::~ImportLibrary () +{ + delete source; + delete target; +} + + +ImportLibrary::ImportLibrary ( const Project& project, + const XMLElement& node, + const Module* module, + bool delayimp ) + : XmlNode ( project, node ), + module (module) +{ + DirectoryLocation directory = SourceDirectory; + const Module* base = module; + const XMLAttribute* dllname = node.GetAttribute ( "dllname", false ); + const XMLAttribute* definition = node.GetAttribute ( "definition", true ); + assert ( definition ); + + string relative_path; + const XMLAttribute* att = node.GetAttribute ( "base", false ); + if ( att ) + { + base = project.LocateModule ( att->value ); + if ( !base ) + throw XMLInvalidBuildFileException ( + node.location, + " attribute 'base' references non-existant module '%s'", + att->value.c_str() ); + + } + + if ( base ) + { + relative_path = base->output->relative_path; + if ( node.value.length () > 0 && node.value != "." ) + relative_path += sSep + node.value; + } + else + relative_path = node.value; + + att = node.GetAttribute ( "root", false ); + if ( att ) + { + if ( att->value == "intermediate" ) + directory = IntermediateDirectory; + else + throw InvalidAttributeValueException ( node.location, + "root", + att->value ); + } + + if ( dllname ) + this->dllname = dllname->value; + + size_t index = definition->value.find_last_of ( "/\\" ); + if ( index == string::npos ) + { + source = new FileLocation ( directory, + base->output->relative_path, + definition->value, + &node ); + } + else + { + string dir = definition->value.substr ( 0, index ); + string name = definition->value.substr ( index + 1); + source = new FileLocation ( directory, + NormalizeFilename ( base->output->relative_path + sSep + dir ), + name, + &node ); + } + + target = new FileLocation ( IntermediateDirectory, + base->output->relative_path, + "lib" + module->name + (delayimp ? ".delayimp.a" : ".a" )); + +} + + +Property::Property ( const XMLElement& node_, + const Project& project_, + const Module* module_ ) + : project(project_), module(module_) +{ + const XMLAttribute* att; + + att = node_.GetAttribute ( "name", true ); + assert(att); + name = project.ResolveProperties ( att->value ); + + att = node_.GetAttribute ( "value", true ); + assert(att); + value = att->value; + + att = node_.GetAttribute ( "internal", false ); + if ( att != NULL ) + { + const char* p = att->value.c_str(); + if ( !stricmp ( p, "true" ) || !stricmp ( p, "yes" ) ) + isInternal = true; + else if ( !stricmp ( p, "false" ) || !stricmp ( p, "no" ) ) + isInternal = false; + else + { + throw InvalidAttributeValueException ( + node_.location, + "internal", + att->value ); + } + } + else + isInternal = false; +} + +Property::Property ( const Project& project_, + const Module* module_, + const std::string& name_, + const std::string& value_ ) + : project(project_), module(module_), name(name_), value(value_) +{ +} + +void +Property::ProcessXML() +{ +} + + +PchFile::PchFile ( + const XMLElement& node_, + const Module& module_, + const FileLocation *file_ ) + : node(node_), module(module_), file(file_) +{ +} + +PchFile::~PchFile() +{ + delete file; +} + +void +PchFile::ProcessXML() +{ +} diff --git a/tools/rbuild/pch.h b/tools/rbuild/pch.h new file mode 100644 index 00000000000..e98342b1b8b --- /dev/null +++ b/tools/rbuild/pch.h @@ -0,0 +1,81 @@ +/* + * Copyright (C) 2005 Casper S. Hornstrup + * + * This program is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation; either version 2 of the License, or + * (at your option) any later version. + * + * This program 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 General Public License for more details. + * + * You should have received a copy of the GNU General Public License along + * with this program; if not, write to the Free Software Foundation, Inc., + * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. + */ + +#pragma once + +#ifdef _MSC_VER +#pragma warning ( disable : 4786 ) // identifier was truncated to '255' characters in the debug information +#pragma warning ( disable : 4996 ) // CRT deprecate +#endif//_MSC_VER + +#include +#include +#include +#include +#include +#include + +#ifdef WIN32 +#include +#ifndef MAX_PATH +#define MAX_PATH _MAX_PATH +#endif//MAX_PATH +#else +#include +#include +typedef LONG *PLONG; + +#endif//WIN32 + +#include +#include + +#ifndef WIN32 +#include +#include +#include +#include + +inline char * strlwr(char *x) +{ + char *y=x; + + while (*y) { + *y=tolower(*y); + y++; + } + return x; +} + +inline char *strupr(char *x) +{ + char *y=x; + + while (*y) { + *y=toupper(*y); + y++; + } + return x; +} + +#define _finite __finite +#define _isnan __isnan +#define stricmp strcasecmp +#define MAX_PATH PATH_MAX +#define _MAX_PATH PATH_MAX +#endif diff --git a/tools/rbuild/project.cpp b/tools/rbuild/project.cpp new file mode 100644 index 00000000000..894c8dca515 --- /dev/null +++ b/tools/rbuild/project.cpp @@ -0,0 +1,549 @@ +/* + * Copyright (C) 2005 Casper S. Hornstrup + * Copyright (C) 2008 Hervé Poussineau + * + * This program is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation; either version 2 of the License, or + * (at your option) any later version. + * + * This program 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 General Public License for more details. + * + * You should have received a copy of the GNU General Public License along + * with this program; if not, write to the Free Software Foundation, Inc., + * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. + */ +#include "pch.h" +#include + +#include "rbuild.h" +#include "backend/backend.h" + +using std::string; +using std::vector; + +/* static */ string +Environment::GetVariable ( const string& name ) +{ + char* value = getenv ( name.c_str () ); + if ( value != NULL && strlen ( value ) > 0 ) + return ssprintf ( "%s", + value ); + else + return ""; +} + +string +Environment::GetArch () +{ + return GetEnvironmentVariablePathOrDefault ( "ROS_ARCH", "i386" ); +} + +/* static */ string +Environment::GetEnvironmentVariablePathOrDefault ( const string& name, + const string& defaultValue ) +{ + const string& environmentVariableValue = Environment::GetVariable ( name ); + if ( environmentVariableValue.length () > 0 ) + return NormalizeFilename ( environmentVariableValue ); + else + return defaultValue; +} + +/* static */ string +Environment::GetIntermediatePath () +{ + string defaultIntermediate = + string( "obj-" ) + GetArch (); + return GetEnvironmentVariablePathOrDefault ( "ROS_INTERMEDIATE", + defaultIntermediate ); +} + +/* static */ string +Environment::GetSourcePath () +{ + char temp[_MAX_PATH]; + getcwd(temp, _MAX_PATH); + return string(temp); +} + +string +Environment::GetOutputPath () +{ + string defaultOutput = + string( "output-" ) + GetArch (); + return GetEnvironmentVariablePathOrDefault ( "ROS_OUTPUT", + defaultOutput ); +} + +/* static */ string +Environment::GetInstallPath () +{ + string defaultInstall = GetCdOutputPath (); + return GetEnvironmentVariablePathOrDefault ( "ROS_INSTALL", + defaultInstall ); +} + +/* static */ string +Environment::GetCdOutputPath () +{ + return GetEnvironmentVariablePathOrDefault ( "ROS_CDOUTPUT", + "reactos" ); +} + +/* static */ string +Environment::GetAutomakeFile ( const std::string& defaultFile ) +{ + return GetEnvironmentVariablePathOrDefault ( "ROS_AUTOMAKE", + defaultFile ); +} + +ParseContext::ParseContext () + : compilationUnit (NULL) +{ +} + + +FileLocation::FileLocation ( const DirectoryLocation directory, + const std::string& relative_path, + const std::string& name, + const XMLElement *node ) + : directory ( directory ), + relative_path ( NormalizeFilename ( relative_path ) ), + name ( name ) +{ + if ( relative_path[0] == '/' || + relative_path[0] == '\\' || + relative_path.find ( '$' ) != string::npos || + ( relative_path.length () > 1 && ( relative_path[1] == ':' || + relative_path.find_last_of ( "/\\" ) == relative_path.length () - 1 ) ) || + ( relative_path.length () > 3 && relative_path.find ( ':' ) != string::npos ) + ) + { + if ( node ) + throw InvalidOperationException ( __FILE__, + __LINE__, + "Invalid relative path '%s' at %s", + relative_path.c_str (), + node->location.c_str () ); + else + throw InvalidOperationException ( __FILE__, + __LINE__, + "Invalid relative path '%s'", + relative_path.c_str () ); + } + + if ( name.find_first_of ( "/\\:" ) != string::npos ) + { + if ( node ) + throw InvalidOperationException ( __FILE__, + __LINE__, + "Invalid file name '%s' at %s", + name.c_str (), + node->location.c_str () ); + else + throw InvalidOperationException ( __FILE__, + __LINE__, + "Invalid file name '%s'", + name.c_str () ); + } +} + + +FileLocation::FileLocation ( const FileLocation& other ) + : directory ( other.directory ), + relative_path ( other.relative_path ), + name ( other.name ) +{ +} + + +Project::Project ( const Configuration& configuration, + const string& filename, + const std::map* properties ) + : xmlfile (filename), + node (NULL), + head (NULL), + configuration (configuration) +{ + _backend = NULL; + + if ( properties ) + { + std::map::const_iterator it; + for (it = properties->begin (); it != properties->end (); it++) + { + const Property *existing = LookupProperty( it->first ); + if ( !existing ) + { + Property* property = new Property ( *this, NULL, it->first, it->second ); + non_if_data.properties.insert ( std::make_pair ( property->name, property ) ); + } + } + } + + ReadXml(); +} + +Project::~Project () +{ + size_t i; + if ( _backend ) + delete _backend; +#ifdef NOT_NEEDED_SINCE_THESE_ARE_CLEANED_BY_IFABLE_DATA + for ( i = 0; i < modules.size (); i++ ) + delete modules[i]; +#endif + for ( i = 0; i < linkerFlags.size (); i++ ) + delete linkerFlags[i]; + for ( i = 0; i < cdfiles.size (); i++ ) + delete cdfiles[i]; + for ( i = 0; i < installfiles.size (); i++ ) + delete installfiles[i]; + if ( head ) + delete head; +} + +const Property* +Project::LookupProperty ( const string& name ) const +{ + std::map::const_iterator p = non_if_data.properties.find(name); + + if ( p == non_if_data.properties.end () ) + return NULL; + + return p->second; +} + +string +Project::ResolveNextProperty ( const string& s ) const +{ + size_t i = s.find ( "${" ); + if ( i == string::npos ) + i = s.find ( "$(" ); + if ( i != string::npos ) + { + string endCharacter; + if ( s[i + 1] == '{' ) + endCharacter = "}"; + else + endCharacter = ")"; + size_t j = s.find ( endCharacter ); + if ( j != string::npos ) + { + int propertyNameLength = j - i - 2; + string propertyName = s.substr ( i + 2, propertyNameLength ); + const Property* property = LookupProperty ( propertyName ); + if ( property != NULL ) + return string ( s ).replace ( i, propertyNameLength + 3, property->value ); + } + } + return s; +} + +string +Project::ResolveProperties ( const string& s ) const +{ + string s2 = s; + string s3; + do + { + s3 = s2; + s2 = ResolveNextProperty ( s3 ); + } while ( s2 != s3 ); + return s2; +} + +void +Project::ExecuteInvocations () +{ + for( std::map::const_iterator p = modules.begin(); p != modules.end(); ++ p ) + p->second->InvokeModule (); +} + +void +Project::ReadXml () +{ + Path path; + head = XMLLoadFile ( xmlfile, path, xmlbuildfiles ); + node = NULL; + for ( size_t i = 0; i < head->subElements.size (); i++ ) + { + if ( head->subElements[i]->name == "project" ) + { + node = head->subElements[i]; + string path; + ProcessXML ( path ); + return; + } + } + + if (node == NULL) + node = head->subElements[0]; + + throw XMLInvalidBuildFileException ( + node->location, + "Document contains no 'project' tag." ); +} + +void +Project::ProcessXML ( const string& path ) +{ + const XMLAttribute *att; + if ( node->name != "project" ) + throw Exception ( "internal tool error: Project::ProcessXML() called with non- node" ); + + att = node->GetAttribute ( "name", false ); + if ( !att ) + name = "Unnamed"; + else + name = att->value; + + att = node->GetAttribute ( "makefile", true ); + assert(att); + makefile = Environment::GetAutomakeFile ( att->value ); + + att = node->GetAttribute ( "allowwarnings", false ); + allowWarningsSet = att != NULL; + if ( att != NULL ) + allowWarnings = att->value == "true"; + + size_t i; + for ( i = 0; i < node->subElements.size (); i++ ) + { + ParseContext parseContext; + ProcessXMLSubElement ( *node->subElements[i], path, parseContext ); + } + + non_if_data.ProcessXML (); + host_non_if_data.ProcessXML (); + + non_if_data.ExtractModules( modules ); + + for ( i = 0; i < linkerFlags.size (); i++ ) + linkerFlags[i]->ProcessXML (); + for( std::map::const_iterator p = modules.begin(); p != modules.end(); ++ p ) + p->second->ProcessXML (); + for ( i = 0; i < cdfiles.size (); i++ ) + cdfiles[i]->ProcessXML (); + for ( i = 0; i < installfiles.size (); i++ ) + installfiles[i]->ProcessXML (); +} + +void +Project::ProcessXMLSubElement ( const XMLElement& e, + const string& path, + ParseContext& parseContext ) +{ + const XMLAttribute* att; + + att = e.GetAttribute ( "compilerset", false ); + + if ( att ) + { + CompilerSet compilerSet; + + if ( att->value == "msc" ) + compilerSet = MicrosoftC; + else if ( att->value == "gcc" ) + compilerSet = GnuGcc; + else + throw InvalidAttributeValueException ( + e.location, + "compilerset", + att->value ); + + if ( compilerSet != configuration.Compiler ) + return; + } + + att = e.GetAttribute ( "linkerset", false ); + + if ( att ) + { + LinkerSet linkerSet; + + if ( att->value == "mslink" ) + linkerSet = MicrosoftLink; + else if ( att->value == "ld" ) + linkerSet = GnuLd; + else + throw InvalidAttributeValueException ( + e.location, + "linkerset", + att->value ); + + if ( linkerSet != configuration.Linker ) + return; + } + + bool subs_invalid = false; + + string subpath(path); + if ( e.name == "module" ) + { + Module* module = new Module ( *this, e, path ); + if ( LocateModule ( module->name ) ) + throw XMLInvalidBuildFileException ( + node->location, + "module name conflict: '%s' (originally defined at %s)", + module->name.c_str(), + module->node.location.c_str() ); + non_if_data.modules.push_back ( module ); + return; // defer processing until later + } + else if ( e.name == "cdfile" ) + { + CDFile* cdfile = new CDFile ( *this, e, path ); + cdfiles.push_back ( cdfile ); + subs_invalid = true; + } + else if ( e.name == "installfile" ) + { + InstallFile* installfile = new InstallFile ( *this, e, path ); + installfiles.push_back ( installfile ); + subs_invalid = true; + } + else if ( e.name == "directory" ) + { + const XMLAttribute* att = e.GetAttribute ( "name", true ); + assert(att); + subpath = GetSubPath ( *this, e.location, path, att->value ); + } + else if ( e.name == "include" ) + { + const XMLAttribute* host = e.GetAttribute("host", false); + Include* include = new Include ( *this, &e ); + + if(host && host->value == "true") + host_non_if_data.includes.push_back(include); + else + non_if_data.includes.push_back ( include ); + + subs_invalid = true; + } + else if ( e.name == "define" || e.name == "redefine" ) + { + const XMLAttribute* host = e.GetAttribute("host", false); + Define* define = new Define ( *this, e ); + + if(host && host->value == "true") + host_non_if_data.defines.push_back(define); + else + non_if_data.defines.push_back ( define ); + + subs_invalid = true; + } + else if ( e.name == "compilerflag" ) + { + CompilerFlag* pCompilerFlag = new CompilerFlag ( *this, e ); + non_if_data.compilerFlags.push_back ( pCompilerFlag ); + subs_invalid = true; + } + else if ( e.name == "linkerflag" ) + { + linkerFlags.push_back ( new LinkerFlag ( *this, e ) ); + subs_invalid = true; + } + else if ( e.name == "if" || e.name == "ifnot" ) + { + const XMLAttribute* name; + name = e.GetAttribute ( "property", true ); + assert( name ); + const Property *property = LookupProperty( name->value ); + const string *PropertyValue; + const string EmptyString; + + if (property) + { + PropertyValue = &property->value; + } + else + { + // Property does not exist, treat it as being empty + PropertyValue = &EmptyString; + } + + const XMLAttribute* value; + value = e.GetAttribute ( "value", true ); + assert( value ); + + bool negate = ( e.name == "ifnot" ); + bool equality = ( *PropertyValue == value->value ); + if ( equality == negate ) + { + // Failed, skip this element + if ( configuration.Verbose ) + printf("Skipping 'If' at %s\n", e.location.c_str () ); + return; + } + subs_invalid = false; + } + else if ( e.name == "property" ) + { + Property* property = new Property ( e, *this, NULL ); + non_if_data.properties.insert ( std::make_pair ( property->name, property ) ); + } + if ( subs_invalid && e.subElements.size() ) + { + throw XMLInvalidBuildFileException ( + e.location, + "<%s> cannot have sub-elements", + e.name.c_str() ); + } + for ( size_t i = 0; i < e.subElements.size (); i++ ) + ProcessXMLSubElement ( *e.subElements[i], subpath, parseContext ); +} + +Module* +Project::LocateModule ( const string& name ) +{ + std::map::const_iterator p = modules.find(name); + + if ( p == modules.end() ) + return NULL; + + return p->second; +} + +const Module* +Project::LocateModule ( const string& name ) const +{ + std::map::const_iterator p = modules.find(name); + + if ( p == modules.end() ) + return NULL; + + return p->second; +} + +const std::string& +Project::GetProjectFilename () const +{ + return xmlfile; +} + +std::string +Project::GetCompilerSet () const +{ + switch ( configuration.Compiler ) + { + case GnuGcc: return "gcc"; + case MicrosoftC: return "msc"; + default: assert ( false ); + } +} + +std::string +Project::GetLinkerSet () const +{ + switch ( configuration.Linker ) + { + case GnuLd: return "ld"; + case MicrosoftLink: return "mslink"; + default: assert ( false ); + } +} diff --git a/tools/rbuild/project.dtd b/tools/rbuild/project.dtd new file mode 100644 index 00000000000..dad95b0f4d0 --- /dev/null +++ b/tools/rbuild/project.dtd @@ -0,0 +1,155 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/tools/rbuild/rbuild.cpp b/tools/rbuild/rbuild.cpp new file mode 100644 index 00000000000..dc098a819c4 --- /dev/null +++ b/tools/rbuild/rbuild.cpp @@ -0,0 +1,422 @@ +/* + * Copyright (C) 2005 Casper S. Hornstrup + * + * This program is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation; either version 2 of the License, or + * (at your option) any later version. + * + * This program 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 General Public License for more details. + * + * You should have received a copy of the GNU General Public License along + * with this program; if not, write to the Free Software Foundation, Inc., + * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. + */ +#include "pch.h" +#include +#include + +#include +#ifdef WIN32 +#include +#endif +#include + +#include "rbuild.h" +#include "backend/backend.h" +#include "backend/mingw/mingw.h" + +using std::string; +using std::vector; + +static string BuildSystem; +static string RootXmlFile; +static Configuration configuration; +static std::map properties; + +bool +ParseAutomaticDependencySwitch ( + char switchChar2, + char* switchStart ) +{ + switch ( switchChar2 ) + { + case 'd': + configuration.Dependencies = NoDependencies; + break; + case 'a': + configuration.Dependencies = AutomaticDependencies; + break; + case 'f': + configuration.Dependencies = FullDependencies; + break; + case 'm': + if ( strlen ( switchStart ) <= 3 ) + { + printf ( "Switch -dm requires a module name\n" ); + return false; + } + configuration.CheckDependenciesForModuleOnly = true; + configuration.CheckDependenciesForModuleOnlyModule = string(&switchStart[3]); + break; + default: + printf ( "Unknown switch -d%c\n", + switchChar2 ); + return false; + } + return true; +} + +bool +ParseCompilationUnitSwitch ( + char switchChar2, + char* switchStart ) +{ + switch ( switchChar2 ) + { + case 'd': + configuration.CompilationUnitsEnabled = false; + break; + default: + printf ( "Unknown switch -u%c\n", + switchChar2 ); + return false; + } + return true; +} + +bool +ParsePrecompiledHeaderSwitch ( + char switchChar2, + char* switchStart ) +{ + switch ( switchChar2 ) + { + case 'd': + configuration.PrecompiledHeadersEnabled = false; + break; + default: + printf ( "Unknown switch -h%c\n", + switchChar2 ); + return false; + } + return true; +} + +bool +ParseVCProjectSwitch ( + char switchChar2, + char* switchStart ) +{ + string temp; + + switch ( switchChar2 ) + { + case 's': + if ( strlen ( switchStart ) <= 3 ) + { + printf ( "Switch -dm requires a module name\n" ); + return false; + } + configuration.VSProjectVersion = string(&switchStart[3]); + + if (configuration.VSProjectVersion.at(0) == '{') { + printf ( "Error: invalid char {\n" ); + return false; + } + + if (configuration.VSProjectVersion.length() == 1) //7,8 + configuration.VSProjectVersion.append(".00"); + + if (configuration.VSProjectVersion.length() == 3) //7.1 + configuration.VSProjectVersion.append("0"); + + //We should set this here because in the end we will use + //msc sompiler so we need to parse msc specidic + //definitions and includes + configuration.Compiler = MicrosoftC; + + break; + case 'c': + configuration.VSConfigurationType = string (&switchStart[3]); + configuration.InstallFiles = true; + break; + case 'o': + if ( strlen ( switchStart ) <= 3 ) + { + printf ( "Invalid switch\n" ); + return false; + } + temp = string (&switchStart[3]); + if ( temp.find ("configuration") != string::npos ) + configuration.UseConfigurationInPath = true; + + if ( temp.find ("version") != string::npos ) + configuration.UseVSVersionInPath = true; + break; + default: + printf ( "Unknown switch -d%c\n", + switchChar2 ); + return false; + } + return true; +} + +bool +ParseMingwSwitch ( char* switchStart ) +{ + switchStart += 2; + + if ( *switchStart == 'c' ) + { + ++ switchStart; + + if ( strcmp ( switchStart, "msc" ) == 0 ) + configuration.Compiler = MicrosoftC; + else if ( strcmp ( switchStart, "gcc" ) == 0 ) + configuration.Compiler = GnuGcc; + else + { + printf ( "Unknown value of -Mc: %s\n", switchStart ); + return false; + } + } + else if ( *switchStart == 'l' ) + { + ++ switchStart; + + if ( strcmp ( switchStart, "mslink" ) == 0 ) + configuration.Linker = MicrosoftLink; + else if ( strcmp ( switchStart, "ld" ) == 0 ) + configuration.Linker = GnuLd; + else + { + printf ( "Unknown value of -Ml: %s\n", switchStart ); + return false; + } + } + else if ( strcmp ( switchStart, "microsoft" ) == 0 ) + { + configuration.Compiler = MicrosoftC; + configuration.Linker = MicrosoftLink; + } + else if ( strcmp ( switchStart, "gnu" ) == 0 ) + { + configuration.Compiler = GnuGcc; + configuration.Linker = GnuLd; + } + else + { + printf ( "Unknown value of -M: %s\n", switchStart ); + return false; + } + + return true; +} + +bool +ParseMakeSwitch ( char switchChar2 ) +{ + switch ( switchChar2 ) + { + case 'i': + configuration.MakeHandlesInstallDirectories = true; + break; + default: + printf ( "Unknown switch -m%c\n", + switchChar2 ); + return false; + } + return true; +} + +bool +ParseProxyMakefileSwitch ( char switchChar2 ) +{ + switch ( switchChar2 ) + { + case 's': + configuration.GenerateProxyMakefilesInSourceTree = true; + break; + default: + printf ( "Unknown switch -p%c\n", + switchChar2 ); + return false; + } + return true; +} + +bool +ParseDefineSwitch ( char* switchStart ) +{ + string s = string ( switchStart + 2 ); + string::size_type separator = s.find ( '=' ); + if ( separator == string::npos || separator == 0 ) + { + printf ( "Invalid define switch: '%s'\n", switchStart ); + return false; + } + if ( s.find ( '=', separator + 1 ) != string::npos ) + { + printf ( "Invalid define switch: '%s'\n", switchStart ); + return false; + } + + string var = s.substr ( 0, separator ); + string val = s.substr ( separator + 1 ); + properties.insert ( std::pair ( var, val ) ); + return true; +} + +bool +ParseSwitch ( int argc, char** argv, int index ) +{ + char switchChar = strlen ( argv[index] ) > 1 ? argv[index][1] : ' '; + char switchChar2 = strlen ( argv[index] ) > 2 ? argv[index][2] : ' '; + switch ( switchChar ) + { + case 'v': + if (switchChar2 == 's' || switchChar2 == 'c' || switchChar2 == 'o') + { + return ParseVCProjectSwitch ( + switchChar2, + argv[index] ); + } + else + configuration.Verbose = true; + break; + case 'c': + configuration.CleanAsYouGo = true; + break; + case 'd': + return ParseAutomaticDependencySwitch ( + switchChar2, + argv[index] ); + case 'h': + return ParsePrecompiledHeaderSwitch ( + switchChar2, + argv[index] ); + + case 'u': + return ParseCompilationUnitSwitch ( + switchChar2, + argv[index] ); + case 'r': + RootXmlFile = string(&argv[index][2]); + break; + case 'm': + return ParseMakeSwitch ( switchChar2 ); + case 'M': + return ParseMingwSwitch ( argv[index] ); + case 'p': + return ParseProxyMakefileSwitch ( switchChar2 ); + case 'D': + return ParseDefineSwitch ( argv[index] ); + default: + printf ( + "Unknown switch -%c\n", + switchChar ); + return false; + } + return true; +} + +bool +ParseArguments ( int argc, char** argv ) +{ + if ( argc < 2 ) + return false; + + for ( int i = 1; i < argc; i++ ) + { + if ( argv[i][0] == '-' ) + { + if ( !ParseSwitch ( argc, argv, i ) ) + return false; + } + else + BuildSystem = argv[i]; + } + + return true; +} + +int +main ( int argc, char** argv ) +{ + InitializeEnvironment (); + + if ( !ParseArguments ( argc, argv ) ) + { + printf ( "Generates project files for buildsystems\n\n" ); + printf ( " rbuild [switches] -r{rootfile.rbuild} buildsystem\n\n" ); + printf ( "Switches:\n" ); + printf ( " -v Be verbose.\n" ); + printf ( " -c Clean as you go. Delete generated files as soon as they are not\n" ); + printf ( " needed anymore.\n" ); + printf ( " -dd Disable automatic dependencies.\n" ); + printf ( " -da Enable automatic dependencies.\n" ); + printf ( " -df Enable full dependencies.\n" ); + printf ( " -dm{module} Check only automatic dependencies for this module.\n" ); + printf ( " -ud Disable multiple source files per compilation unit.\n" ); + printf ( " -mi Let make handle creation of install directories. Rbuild will\n" ); + printf ( " not generate the directories.\n" ); + printf ( " -ps Generate proxy makefiles in source tree instead of the output.\n" ); + printf ( " tree.\n" ); + printf ( " -vs{version} Version of MS VS project files. Default is %s.\n", MS_VS_DEF_VERSION ); + printf ( " -vo{version|configuration} Adds subdirectory path to the default Intermediate-Outputdirectory.\n" ); + printf ( " -Mc{compiler} Compiler to use for mingw backend. Can be one of:\n" ); + printf ( " %-10s %s (default)\n", "gcc", "GNU compiler collection (gcc, g++)\n"); + printf ( " %-10s %s\n", "msc", "Microsoft Visual C++ (cl)\n"); + printf ( " -Ml{compiler} Linker to use for mingw backend. Can be one of:\n" ); + printf ( " %-10s %s (default)\n", "ld", "GNU binutils (ld, dlltool)\n"); + printf ( " %-10s %s\n", "mslink", "Microsoft Linker (link, lib)\n"); + printf ( " -Mmicrosoft Same as -Mcmsc -Mlmslink\n" ); + printf ( " -Mgnu Same as -Mcgcc -Mlld\n" ); + printf ( " -Dvar=val Set the value of 'var' variable to 'val'.\n" ); + printf ( "\n" ); + printf ( " buildsystem Target build system. Can be one of:\n" ); + + std::map::iterator iter; + for (iter = Backend::Factory::map_begin(); iter != Backend::Factory::map_end(); iter++) + { + Backend::Factory *factory = iter->second; + printf ( " %-10s %s\n", factory->Name(), factory->Description()); + } + return 1; + } + try + { + if ( RootXmlFile.length () == 0 ) + throw MissingArgumentException ( "-r" ); + + string projectFilename ( RootXmlFile ); + + printf ( "Reading build files..." ); + Project project ( configuration, projectFilename, &properties ); + printf ( "done\n" ); + + project.SetBackend ( Backend::Factory::Create ( + BuildSystem, + project, + configuration ) ); + + project.ExecuteInvocations (); + project.GetBackend().Process(); + + return 0; + } + catch ( Exception& ex ) + { + printf ( "%s\n", (*ex).c_str () ); + return 1; + } + catch ( XMLException& ex ) + { + printf ( "%s\n", (*ex).c_str () ); + return 1; + } +} diff --git a/tools/rbuild/rbuild.dsp b/tools/rbuild/rbuild.dsp new file mode 100644 index 00000000000..2da6b736a5e --- /dev/null +++ b/tools/rbuild/rbuild.dsp @@ -0,0 +1,360 @@ +# Microsoft Developer Studio Project File - Name="rbuild" - Package Owner=<4> +# Microsoft Developer Studio Generated Build File, Format Version 6.00 +# ** DO NOT EDIT ** + +# TARGTYPE "Win32 (x86) Console Application" 0x0103 + +CFG=rbuild - Win32 Debug +!MESSAGE This is not a valid makefile. To build this project using NMAKE, +!MESSAGE use the Export Makefile command and run +!MESSAGE +!MESSAGE NMAKE /f "rbuild.mak". +!MESSAGE +!MESSAGE You can specify a configuration when running NMAKE +!MESSAGE by defining the macro CFG on the command line. For example: +!MESSAGE +!MESSAGE NMAKE /f "rbuild.mak" CFG="rbuild - Win32 Debug" +!MESSAGE +!MESSAGE Possible choices for configuration are: +!MESSAGE +!MESSAGE "rbuild - Win32 Release" (based on "Win32 (x86) Console Application") +!MESSAGE "rbuild - Win32 Debug" (based on "Win32 (x86) Console Application") +!MESSAGE + +# Begin Project +# PROP AllowPerConfigDependencies 0 +# PROP Scc_ProjName "" +# PROP Scc_LocalPath "" +CPP=cl.exe +RSC=rc.exe + +!IF "$(CFG)" == "rbuild - Win32 Release" + +# PROP BASE Use_MFC 0 +# PROP BASE Use_Debug_Libraries 0 +# PROP BASE Output_Dir "Release" +# PROP BASE Intermediate_Dir "Release" +# PROP BASE Target_Dir "" +# PROP Use_MFC 0 +# PROP Use_Debug_Libraries 0 +# PROP Output_Dir "Release" +# PROP Intermediate_Dir "Release" +# PROP Target_Dir "" +# ADD BASE CPP /nologo /W3 /GX /O2 /D "WIN32" /D "NDEBUG" /D "_CONSOLE" /D "_MBCS" /YX /FD /c +# ADD CPP /nologo /W3 /GX /O2 /D "WIN32" /D "NDEBUG" /D "_CONSOLE" /D "_MBCS" /YX /FD /c +# ADD BASE RSC /l 0x409 /d "NDEBUG" +# ADD RSC /l 0x409 /d "NDEBUG" +BSC32=bscmake.exe +# ADD BASE BSC32 /nologo +# ADD BSC32 /nologo +LINK32=link.exe +# ADD BASE LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib /nologo /subsystem:console /machine:I386 +# ADD LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib /nologo /subsystem:console /machine:I386 + +!ELSEIF "$(CFG)" == "rbuild - Win32 Debug" + +# PROP BASE Use_MFC 0 +# PROP BASE Use_Debug_Libraries 1 +# PROP BASE Output_Dir "Debug" +# PROP BASE Intermediate_Dir "Debug" +# PROP BASE Target_Dir "" +# PROP Use_MFC 0 +# PROP Use_Debug_Libraries 1 +# PROP Output_Dir "Debug" +# PROP Intermediate_Dir "Debug" +# PROP Target_Dir "" +# ADD BASE CPP /nologo /W3 /Gm /GX /ZI /Od /D "WIN32" /D "_DEBUG" /D "_CONSOLE" /D "_MBCS" /YX /FD /GZ /c +# ADD CPP /nologo /W3 /Gm /GX /ZI /Od /I ".." /I "../../lib/inflib" /I "../../include/reactos" /D "WIN32" /D "_DEBUG" /D "_CONSOLE" /D "_MBCS" /D "INFLIB_HOST" /YX /FD /GZ /c +# ADD BASE RSC /l 0x409 /d "_DEBUG" +# ADD RSC /l 0x409 /d "_DEBUG" +BSC32=bscmake.exe +# ADD BASE BSC32 /nologo +# ADD BSC32 /nologo +LINK32=link.exe +# ADD BASE LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib /nologo /subsystem:console /debug /machine:I386 /pdbtype:sept +# ADD LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib /nologo /subsystem:console /debug /machine:I386 /pdbtype:sept + +!ENDIF + +# Begin Target + +# Name "rbuild - Win32 Release" +# Name "rbuild - Win32 Debug" +# Begin Group "backends" + +# PROP Default_Filter "" +# Begin Group "devcpp" + +# PROP Default_Filter "" +# Begin Source File + +SOURCE=.\backend\devcpp\devcpp.cpp +# End Source File +# Begin Source File + +SOURCE=.\backend\devcpp\devcpp.h +# End Source File +# End Group +# Begin Group "msvc" + +# PROP Default_Filter "" +# Begin Source File + +SOURCE=.\backend\msvc\genguid.cpp +# End Source File +# Begin Source File + +SOURCE=.\backend\msvc\msvc.cpp +# End Source File +# Begin Source File + +SOURCE=.\backend\msvc\msvc.h +# End Source File +# Begin Source File + +SOURCE=.\backend\msvc\msvcmaker.cpp +# End Source File +# Begin Source File + +SOURCE=.\backend\msvc\vcprojmaker.cpp +# End Source File +# End Group +# Begin Group "mingw" + +# PROP Default_Filter "" +# Begin Source File + +SOURCE=.\backend\mingw\mingw.cpp +# End Source File +# Begin Source File + +SOURCE=.\backend\mingw\mingw.h +# End Source File +# Begin Source File + +SOURCE=.\backend\mingw\modulehandler.cpp +# End Source File +# Begin Source File + +SOURCE=.\backend\mingw\modulehandler.h +# End Source File +# Begin Source File + +SOURCE=.\backend\mingw\pch_detection.h +# End Source File +# Begin Source File + +SOURCE=.\backend\mingw\proxymakefile.cpp +# End Source File +# End Group +# Begin Group "backend_sources" + +# PROP Default_Filter "" +# Begin Source File + +SOURCE=.\backend\backend.cpp +# End Source File +# End Group +# Begin Group "backend_headers" + +# PROP Default_Filter "" +# Begin Source File + +SOURCE=.\backend\backend.h +# End Source File +# End Group +# End Group +# Begin Group "rbuild_sources" + +# PROP Default_Filter "" +# Begin Source File + +SOURCE=.\automaticdependency.cpp +# End Source File +# Begin Source File + +SOURCE=.\bootstrap.cpp +# End Source File +# Begin Source File + +SOURCE=.\cdfile.cpp +# End Source File +# Begin Source File + +SOURCE=.\compilationunit.cpp +# End Source File +# Begin Source File + +SOURCE=.\compilationunitsupportcode.cpp +# End Source File +# Begin Source File + +SOURCE=.\compilerdirective.cpp +# End Source File +# Begin Source File + +SOURCE=.\compilerflag.cpp +# End Source File +# Begin Source File + +SOURCE=.\configuration.cpp +# End Source File +# Begin Source File + +SOURCE=.\define.cpp +# End Source File +# Begin Source File + +SOURCE=.\directory.cpp +# End Source File +# Begin Source File + +SOURCE=.\exception.cpp +# End Source File +# Begin Source File + +SOURCE=.\filesupportcode.cpp +# End Source File +# Begin Source File + +SOURCE=.\global.cpp +# End Source File +# Begin Source File + +SOURCE=.\include.cpp +# End Source File +# Begin Source File + +SOURCE=.\installfile.cpp +# End Source File +# Begin Source File + +SOURCE=.\linkerflag.cpp +# End Source File +# Begin Source File + +SOURCE=.\linkerscript.cpp +# End Source File +# Begin Source File + +SOURCE=.\module.cpp +# End Source File +# Begin Source File + +SOURCE=.\project.cpp +# End Source File +# Begin Source File + +SOURCE=.\rbuild.cpp +# End Source File +# Begin Source File + +SOURCE=.\stubbedcomponent.cpp +# End Source File +# Begin Source File + +SOURCE=.\syssetupgenerator.cpp +# End Source File +# Begin Source File + +SOURCE=.\testsupportcode.cpp +# End Source File +# Begin Source File + +SOURCE=.\wineresource.cpp +# End Source File +# End Group +# Begin Group "rbuild_headers" + +# PROP Default_Filter "" +# Begin Source File + +SOURCE=.\exception.h +# End Source File +# Begin Source File + +SOURCE=.\pch.h +# End Source File +# Begin Source File + +SOURCE=.\rbuild.h +# End Source File +# Begin Source File + +SOURCE=.\test.h +# End Source File +# End Group +# Begin Group "inflib" + +# PROP Default_Filter "" +# Begin Source File + +SOURCE=..\..\lib\inflib\builddep.h +# End Source File +# Begin Source File + +SOURCE=..\..\lib\inflib\infcommon.h +# End Source File +# Begin Source File + +SOURCE=..\..\lib\inflib\infcore.c +# End Source File +# Begin Source File + +SOURCE=..\..\lib\inflib\infget.c +# End Source File +# Begin Source File + +SOURCE=..\..\lib\inflib\infhost.h +# End Source File +# Begin Source File + +SOURCE=..\..\lib\inflib\infhostgen.c +# End Source File +# Begin Source File + +SOURCE=..\..\lib\inflib\infhostget.c +# End Source File +# Begin Source File + +SOURCE=..\..\lib\inflib\infhostglue.c +# End Source File +# Begin Source File + +SOURCE=..\..\lib\inflib\infhostput.c +# End Source File +# Begin Source File + +SOURCE=..\..\lib\inflib\inflib.h +# End Source File +# Begin Source File + +SOURCE=..\..\lib\inflib\infpriv.h +# End Source File +# Begin Source File + +SOURCE=..\..\lib\inflib\infput.c +# End Source File +# End Group +# Begin Group "tools" + +# PROP Default_Filter "" +# Begin Source File + +SOURCE=..\ssprintf.cpp +# End Source File +# Begin Source File + +SOURCE=..\ssprintf.h +# End Source File +# Begin Source File + +SOURCE=..\xml.cpp +# End Source File +# Begin Source File + +SOURCE=..\xml.h +# End Source File +# End Group +# End Target +# End Project diff --git a/tools/rbuild/rbuild.dsw b/tools/rbuild/rbuild.dsw new file mode 100644 index 00000000000..6d967c4fe0c --- /dev/null +++ b/tools/rbuild/rbuild.dsw @@ -0,0 +1,29 @@ +Microsoft Developer Studio Workspace File, Format Version 6.00 +# WARNING: DO NOT EDIT OR DELETE THIS WORKSPACE FILE! + +############################################################################### + +Project: "rbuild"=.\rbuild.dsp - Package Owner=<4> + +Package=<5> +{{{ +}}} + +Package=<4> +{{{ +}}} + +############################################################################### + +Global: + +Package=<5> +{{{ +}}} + +Package=<3> +{{{ +}}} + +############################################################################### + diff --git a/tools/rbuild/rbuild.h b/tools/rbuild/rbuild.h new file mode 100644 index 00000000000..04d2d69e7f7 --- /dev/null +++ b/tools/rbuild/rbuild.h @@ -0,0 +1,1100 @@ +/* + * Copyright (C) 2005 Casper S. Hornstrup + * + * This program is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation; either version 2 of the License, or + * (at your option) any later version. + * + * This program 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 General Public License for more details. + * + * You should have received a copy of the GNU General Public License along + * with this program; if not, write to the Free Software Foundation, Inc., + * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. + */ + +#pragma once + +#include "pch.h" + +#ifdef WIN32 +#include +#include +#endif/*WIN32*/ +#include +#include +#ifdef _MSC_VER +#include +#else/*_MSC_VER*/ +#include +#ifdef WIN32 +#include +#endif/*WIN32*/ +#endif/*_MSC_VER*/ + +#include + +#include "ssprintf.h" +#include "exception.h" +#include "xml.h" + +class Backend; // forward declaration + +typedef std::vector string_list; + +extern std::string ExePrefix; +extern std::string ExePostfix; +extern std::string sSep; +extern std::string sBadSep; +extern char cSep; +extern char cBadSep; + +#ifdef WIN32 +#define DEF_EXEPREFIX "" +#define DEF_EXEPOSTFIX ".exe" +#define DEF_CSEP '\\' +#define DEF_CBAD_SEP '/' +#define DEF_SSEP "\\" +#define DEF_SBAD_SEP "/" +#else +#define DEF_EXEPREFIX "./" +#define DEF_EXEPOSTFIX "" +#define DEF_CSEP '/' +#define DEF_CBAD_SEP '\\' +#define DEF_SSEP "/" +#define DEF_SBAD_SEP "\\" +#endif + +#define MS_VS_DEF_VERSION "9.00" + +class XmlNode; +class Directory; +class Project; +class IfableData; +class Module; +class Include; +class Define; +class File; +class Library; +class Invoke; +class InvokeFile; +class Dependency; +class ImportLibrary; +class CompilerFlag; +class LinkerFlag; +class LinkerScript; +class Property; +class TestSupportCode; +class AutomaticDependency; +class Bootstrap; +class CDFile; +class InstallFile; +class PchFile; +class StubbedComponent; +class StubbedSymbol; +class CompilationUnit; +class FileLocation; +class AutoRegister; + +class SourceFileTest; +class Metadata; +class Bootsector; + +typedef std::map directory_map; + +class XmlNode +{ +protected: + const Project& project; + const XMLElement& node; + + XmlNode ( const Project& project_, + const XMLElement& node_ ); + virtual ~XmlNode(); + +public: + virtual void ProcessXML(); +}; + +enum DirectoryLocation +{ + SourceDirectory, + IntermediateDirectory, + OutputDirectory, + InstallDirectory, + TemporaryDirectory, +}; + +class Directory +{ +public: + std::string name; + directory_map subdirs; + Directory ( const std::string& name ); + ~Directory(); + void Add ( const char* subdir ); + void GenerateTree ( DirectoryLocation root, + bool verbose ); + void CreateRule ( FILE* f, + const std::string& parent ); +private: + bool mkdir_p ( const char* path ); + bool CreateDirectory ( const std::string& path ); + std::string EscapeSpaces ( const std::string& path ); + void GenerateTree ( const std::string& parent, + bool verbose ); +}; + +enum DependenciesType +{ + NoDependencies, + AutomaticDependencies, + FullDependencies +}; + +enum CompilerSet +{ + GnuGcc, + MicrosoftC +}; + +enum LinkerSet +{ + GnuLd, + MicrosoftLink +}; + +enum SpecFileType +{ + None, + Spec = 1, + PSpec = 2 +}; + +class Configuration +{ +public: + Configuration (); + ~Configuration (); + bool Verbose; + bool CleanAsYouGo; + DependenciesType Dependencies; + bool CheckDependenciesForModuleOnly; + bool CompilationUnitsEnabled; + bool PrecompiledHeadersEnabled; + std::string CheckDependenciesForModuleOnlyModule; + std::string VSProjectVersion; + std::string VSConfigurationType; + bool UseVSVersionInPath; + bool UseConfigurationInPath; + bool MakeHandlesInstallDirectories; + bool GenerateProxyMakefilesInSourceTree; + bool InstallFiles; + CompilerSet Compiler; + LinkerSet Linker; +}; + +class Environment +{ +public: + static std::string GetVariable ( const std::string& name ); + static std::string GetArch (); + static std::string GetIntermediatePath (); + static std::string GetOutputPath (); + static std::string GetSourcePath (); + static std::string GetCdOutputPath (); + static std::string GetInstallPath (); + static std::string GetAutomakeFile ( const std::string& defaultFile ); + static std::string GetEnvironmentVariablePathOrDefault ( const std::string& name, + const std::string& defaultValue ); +}; + + +class FileSupportCode +{ +public: + static void WriteIfChanged ( char* outbuf, + const std::string& filename, + bool ignoreError = false ); +}; + + +class ParseContext +{ +public: + CompilationUnit* compilationUnit; + ParseContext (); +}; + + +class IfableData +{ +public: + std::vector compilationUnits; + std::vector files; + std::vector includes; + std::vector defines; + std::vector libraries; + std::map properties; + std::vector modules; + std::vector compilerFlags; + int asmFiles; // number of .asm files in compilationUnits + + IfableData(); + ~IfableData(); + void ProcessXML(); + void ExtractModules( std::map &modules ); +}; + +class Project +{ + std::string xmlfile; + XMLElement *node, *head; + Backend* _backend; +public: + const Configuration& configuration; + std::string name; + std::string makefile; + XMLIncludes xmlbuildfiles; + std::vector linkerFlags; + std::vector cdfiles; + std::vector installfiles; + std::map modules; + IfableData non_if_data; + IfableData host_non_if_data; + bool allowWarnings; + bool allowWarningsSet; + + Project ( const Configuration& configuration, + const std::string& filename, + const std::map* properties = NULL ); + ~Project (); + void SetBackend ( Backend* backend ) { _backend = backend; } + Backend& GetBackend() { return *_backend; } + void ExecuteInvocations (); + + void ProcessXML ( const std::string& path ); + Module* LocateModule ( const std::string& name ); + const Module* LocateModule ( const std::string& name ) const; + const std::string& GetProjectFilename () const; + std::string ResolveProperties ( const std::string& s ) const; + const Property* LookupProperty ( const std::string& name ) const; + std::string GetCompilerSet () const; + std::string GetLinkerSet () const; +private: + std::string ResolveNextProperty ( const std::string& s ) const; + void ReadXml (); + void ProcessXMLSubElement ( const XMLElement& e, + const std::string& path, + ParseContext& parseContext ); + + // disable copy semantics + Project ( const Project& ); + Project& operator = ( const Project& ); +}; + + +enum ModuleType +{ + BuildTool, + StaticLibrary, + ObjectLibrary, + Kernel, + KernelModeDLL, + KernelModeDriver, + NativeDLL, + NativeCUI, + Win32DLL, + Win32OCX, + Win32CUI, + Win32GUI, + BootLoader, + BootSector, + Iso, + LiveIso, + Test, + RpcServer, + RpcClient, + Alias, + BootProgram, + Win32SCR, + IdlHeader, + IdlInterface, + EmbeddedTypeLib, + ElfExecutable, + RpcProxy, + HostStaticLibrary, + Cabinet, + KeyboardLayout, + MessageHeader, + TypeDontCare, // always at the end +}; + +enum HostType +{ + HostFalse, + HostDefault, + HostTrue, + HostDontCare, +}; + +enum CompilerType +{ + CompilerTypeCC, + CompilerTypeCXX, + CompilerTypeCPP, + CompilerTypeAS, + CompilerTypeMIDL, + CompilerTypeRC, + CompilerTypeNASM, + + CompilerTypesCount +}; + +class FileLocation +{ +public: + DirectoryLocation directory; + std::string relative_path; + std::string name; + + FileLocation ( const DirectoryLocation directory, + const std::string& relative_path, + const std::string& name, + const XMLElement *node = NULL ); + + FileLocation ( const FileLocation& other ); +}; + +class Module +{ +public: + const Project& project; + const XMLElement& node; + std::string xmlbuildFile; + std::string name; + std::string guid; + std::string extension; + std::string baseaddress; + std::string payload; + std::string buildtype; + ModuleType type; + ImportLibrary* importLibrary; + ImportLibrary* delayImportLibrary; + Metadata* metadata; + Bootsector* bootSector; + bool isUnicode; + bool isDefaultEntryPoint; + Bootstrap* bootstrap; + AutoRegister* autoRegister; // node + IfableData non_if_data; + std::vector invocations; + std::vector dependencies; + std::vector compilerFlags; + std::vector linkerFlags; + std::vector stubbedComponents; + std::vector cdfiles; + LinkerScript* linkerScript; + PchFile* pch; + bool cplusplus; + std::string prefix; + std::string aliasedModuleName; + bool allowWarnings; + bool enabled; + bool isStartupLib; + bool isCRT; + std::string CRT; + bool dynamicCRT; + FileLocation *output; // "path/foo.exe" + FileLocation *dependency; // "path/foo.exe" or "path/libfoo.a" + FileLocation *install; + std::string description; + std::string lcid; + std::string layoutId; + std::string layoutNameResId; + + Module ( const Project& project, + const XMLElement& moduleNode, + const std::string& modulePath ); + ~Module (); + ModuleType GetModuleType ( const std::string& location, + const XMLAttribute& attribute ); + bool HasImportLibrary () const; + bool IsDLL () const; + std::string GetPathWithPrefix ( const std::string& prefix ) const; // "path/prefixfoo.exe" + std::string GetPathToBaseDir() const; // "../" offset to rootdirectory + std::string GetEntryPoint() const; + void GetTargets ( string_list& ) const; + std::string GetInvocationTarget ( const int index ) const; + bool HasFileWithExtension ( const IfableData&, const std::string& extension ) const; + void InvokeModule () const; + void ProcessXML (); + std::string GetDllName() const; + SpecFileType IsSpecDefinitionFile () const; +private: + void SetImportLibrary ( ImportLibrary* importLibrary ); + void SetDelayImportLibrary ( ImportLibrary* importLibrary ); + DirectoryLocation GetTargetDirectoryTree () const; + std::string GetDefaultModuleExtension () const; + std::string GetDefaultModuleEntrypoint () const; + std::string GetDefaultModuleBaseaddress () const; + std::string GetDefaultModuleCRT () const; + bool GetDefaultModuleIsCRT () const; + std::string entrypoint; + void ProcessXMLSubElement ( const XMLElement& e, + DirectoryLocation directory, + const std::string& relative_path, + ParseContext& parseContext ); + bool GetBooleanAttribute ( const XMLElement& moduleNode, + const char * name, + bool default_value = false ); +}; + +class ToolsetDirective +{ +private: + bool enabled; + +protected: + void ParseToolsets ( const Project& project, const XMLElement& node ); + +public: + virtual ~ToolsetDirective() { } + bool IsEnabled () const; +}; + +class CompilerDirective +{ +private: + std::bitset compilersSet; + bool enabled; + +protected: + void ParseCompilers ( const XMLElement& node, const std::string& defaultValue ); + +public: + CompilerDirective (): enabled ( true ) { } + virtual ~CompilerDirective() { } + void SetCompiler ( CompilerType compiler ); + void UnsetCompiler ( CompilerType compiler ); + void SetAllCompilers (); + void UnsetAllCompilers (); + bool IsCompilerSet ( CompilerType compiler ) const; +}; + +class Include: public CompilerDirective, public ToolsetDirective +{ +public: + FileLocation *directory; + + Include ( const Project& project, + const XMLElement* includeNode ); + Include ( const Project& project, + const XMLElement* includeNode, + const Module* module ); + Include ( const Project& project, + DirectoryLocation directory, + const std::string& relative_path ); + ~Include (); + void ProcessXML (); +private: + const Project& project; + const XMLElement* node; + const Module* module; + DirectoryLocation GetDefaultDirectoryTree ( const Module* module ) const; + void Initialize (); +}; + + +class Define: public CompilerDirective, public ToolsetDirective +{ +public: + const Project& project; + const Module* module; + const XMLElement* node; + std::string name; + std::string arguments; + std::string value; + std::string backend; + bool redefine; + + Define ( const Project& project, + const XMLElement& defineNode ); + Define ( const Project& project, + const Module* module, + const XMLElement& defineNode ); + Define ( const Project& project, + const Module* module, + const std::string& name_, + const std::string& backend_ = "", + bool redefine_ = false ); + ~Define(); + void ProcessXML(); +private: + void Initialize(); +}; + + +class File +{ +public: + FileLocation file; + bool first; + std::string switches; + bool isPreCompiledHeader; + + File ( DirectoryLocation directory, + const std::string& relative_path, + const std::string& name, + bool _first, + const std::string& _switches, + bool _isPreCompiledHeader ); + + void ProcessXML(); + std::string GetFullPath () const; +}; + + +class Library +{ + const XMLElement *node; +public: + const Module& module; + std::string name; + const Module* importedModule; + bool delayimp; + + Library ( const XMLElement& _node, + const Module& _module, + const std::string& _name ); + Library ( const Module& _module, + const std::string& _name ); + + void ProcessXML(); +}; + + +class Invoke +{ +public: + const XMLElement& node; + const Module& module; + const Module* invokeModule; + std::vector input; + std::vector output; + + Invoke ( const XMLElement& _node, + const Module& _module ); + + void ProcessXML(); + void GetTargets ( string_list& targets ) const; + std::string GetParameters () const; +private: + void ProcessXMLSubElement ( const XMLElement& e ); + void ProcessXMLSubElementInput ( const XMLElement& e ); + void ProcessXMLSubElementOutput ( const XMLElement& e ); +}; + + +class InvokeFile +{ +public: + const XMLElement& node; + std::string name; + std::string switches; + + InvokeFile ( const XMLElement& _node, + const std::string& _name ); + + void ProcessXML (); +}; + + +class Dependency +{ +public: + const XMLElement& node; + const Module& module; + const Module* dependencyModule; + + Dependency ( const XMLElement& _node, + const Module& _module ); + + void ProcessXML(); +}; + +class Bootsector +{ +public: + const XMLElement& node; + const Module* module; + const Module* bootSectorModule; + + Bootsector ( const XMLElement& _node, + const Module* _module ); + + void ProcessXML(); +private: + bool IsSupportedModuleType ( ModuleType type ); +}; + +class Metadata +{ +public: + const XMLElement& node; + const Module& module; + std::string name; + std::string description; + std::string version; + std::string copyright; + std::string url; + std::string date; + std::string owner; + + Metadata ( const XMLElement& _node, + const Module& _module ); + + void ProcessXML(); +}; + +class ImportLibrary : public XmlNode +{ +public: + const Module* module; + std::string dllname; + FileLocation *source; + FileLocation *target; + + ImportLibrary ( const Project& project, + const XMLElement& node, + const Module* module, + bool delayimp ); + ~ImportLibrary (); +}; + + +class CompilerFlag: public CompilerDirective, public ToolsetDirective +{ +public: + const Project& project; + const Module* module; + const XMLElement& node; + std::string flag; + + CompilerFlag ( const Project& project, + const XMLElement& compilerFlagNode ); + CompilerFlag ( const Project& project, + const Module* module, + const XMLElement& compilerFlagNode ); + ~CompilerFlag (); + void ProcessXML(); +private: + void Initialize(); +}; + + +class LinkerFlag: public ToolsetDirective +{ +public: + const Project& project; + const Module* module; + const XMLElement& node; + std::string flag; + + LinkerFlag ( const Project& project, + const XMLElement& linkerFlagNode ); + LinkerFlag ( const Project& project, + const Module* module, + const XMLElement& linkerFlagNode ); + ~LinkerFlag (); + void ProcessXML(); +private: + void Initialize(); +}; + + +class LinkerScript +{ +public: + const XMLElement& node; + const Module& module; + const FileLocation *file; + + LinkerScript ( const XMLElement& node, + const Module& module, + const FileLocation *file ); + ~LinkerScript (); + void ProcessXML(); +}; + + +class Property +{ +public: + const Project& project; + const Module* module; + std::string name, value; + bool isInternal; + + Property ( const XMLElement& node_, + const Project& project_, + const Module* module_ ); + + Property ( const Project& project_, + const Module* module_, + const std::string& name_, + const std::string& value_ ); + + void ProcessXML(); +}; + + +class TestSupportCode +{ +public: + const Project& project; + + TestSupportCode ( const Project& project ); + ~TestSupportCode (); + void GenerateTestSupportCode ( bool verbose ); +private: + bool IsTestModule ( const Module& module ); + void GenerateTestSupportCodeForModule ( Module& module, + bool verbose ); + std::string GetHooksFilename ( Module& module ); + char* WriteStubbedSymbolToHooksFile ( char* buffer, + const StubbedComponent& component, + const StubbedSymbol& symbol ); + char* WriteStubbedComponentToHooksFile ( char* buffer, + const StubbedComponent& component ); + void WriteHooksFile ( Module& module ); + std::string GetStubsFilename ( Module& module ); + char* WriteStubbedSymbolToStubsFile ( char* buffer, + const StubbedComponent& component, + const StubbedSymbol& symbol, + int stubIndex ); + char* WriteStubbedComponentToStubsFile ( char* buffer, + const StubbedComponent& component, + int* stubIndex ); + void WriteStubsFile ( Module& module ); + std::string GetStartupFilename ( Module& module ); + bool IsUnknownCharacter ( char ch ); + std::string GetTestDispatcherName ( std::string filename ); + bool IsTestFile ( std::string& filename ) const; + void GetSourceFilenames ( string_list& list, + Module& module ) const; + char* WriteTestDispatcherPrototypesToStartupFile ( char* buffer, + Module& module ); + char* WriteRegisterTestsFunctionToStartupFile ( char* buffer, + Module& module ); + void WriteStartupFile ( Module& module ); +}; + + +class SourceFile +{ +public: + SourceFile ( AutomaticDependency* automaticDependency, + const Module& module, + const File& file, + SourceFile* parent ); + void Parse (); + std::vector files; /* List of files included in this file */ + const File& file; + AutomaticDependency* automaticDependency; + const Module& module; + std::vector parents; /* List of files, this file is included from */ + time_t lastWriteTime; + time_t youngestLastWriteTime; /* Youngest last write time of this file and all children */ + SourceFile* youngestFile; +private: + void Close (); + void Open (); + void SkipWhitespace (); + bool ReadInclude ( std::string& filename, + bool& searchCurrentDirectory, + bool& includeNext ); + bool IsIncludedFrom ( const File& file ); + SourceFile* ParseFile(const File& file); + bool CanProcessFile ( const File& file ); + bool IsParentOf ( const SourceFile* parent, + const SourceFile* child ); + std::string buf; + const char *p; + const char *end; +}; + + +class AutomaticDependency +{ + friend class SourceFileTest; +public: + const Project& project; + + AutomaticDependency ( const Project& project ); + ~AutomaticDependency (); + bool LocateIncludedFile ( const FileLocation& directory, + const std::string& includedFilename ); + bool LocateIncludedFile ( SourceFile* sourceFile, + const Module& module, + const std::string& includedFilename, + bool searchCurrentDirectory, + bool includeNext, + File& resolvedFile ); + SourceFile* RetrieveFromCacheOrParse ( const Module& module, + const File& file, + SourceFile* parentSourceFile ); + SourceFile* RetrieveFromCache ( const File& file ); + void CheckAutomaticDependencies ( bool verbose ); + void CheckAutomaticDependenciesForModule ( Module& module, + bool verbose ); +private: + void GetModulesToCheck ( Module& module, std::vector& modules ); + void CheckAutomaticDependencies ( const Module& module, + bool verbose ); + void CheckAutomaticDependenciesForFile ( SourceFile* sourceFile ); + void GetIncludeDirectories ( std::vector& includes, + const Module& module ); + void GetModuleFiles ( const Module& module, + std::vector& files ) const; + void ParseFiles (); + void ParseFiles ( const Module& module ); + void ParseFile ( const Module& module, + const File& file ); + std::map sourcefile_map; +}; + + +class Bootstrap +{ +public: + const Project& project; + const Module* module; + const XMLElement& node; + std::string base; + std::string nameoncd; + + Bootstrap ( const Project& project, + const Module* module, + const XMLElement& bootstrapNode ); + ~Bootstrap (); + void ProcessXML(); +private: + bool IsSupportedModuleType ( ModuleType type ); + void Initialize(); + static std::string ReplaceVariable ( const std::string& name, + const std::string& value, + std::string path ); +}; + + +class CDFile : public XmlNode +{ +public: + FileLocation *source; + FileLocation *target; + + CDFile ( const Project& project, + const XMLElement& bootstrapNode, + const std::string& path ); + ~CDFile (); +private: + static std::string ReplaceVariable ( const std::string& name, + const std::string& value, + std::string path ); +}; + + +class InstallFile : public XmlNode +{ +public: + FileLocation *source; + FileLocation *target; + + InstallFile ( const Project& project, + const XMLElement& bootstrapNode, + const std::string& path ); + ~InstallFile (); +}; + + +class PchFile +{ +public: + const XMLElement& node; + const Module& module; + const FileLocation *file; + + PchFile ( + const XMLElement& node, + const Module& module, + const FileLocation *file ); + ~PchFile(); + void ProcessXML(); +}; + + +class StubbedComponent +{ +public: + const Module* module; + const XMLElement& node; + std::string name; + std::vector symbols; + + StubbedComponent ( const Module* module_, + const XMLElement& stubbedComponentNode ); + ~StubbedComponent (); + void ProcessXML (); + void ProcessXMLSubElement ( const XMLElement& e ); +}; + + +class StubbedSymbol +{ +public: + const XMLElement& node; + std::string symbol; + std::string newname; + std::string strippedName; + + StubbedSymbol ( const XMLElement& stubbedSymbolNode ); + ~StubbedSymbol (); + void ProcessXML(); +private: + std::string StripSymbol ( std::string symbol ); +}; + + +class CompilationUnit +{ +public: + std::string name; + + CompilationUnit ( const File* file ); + CompilationUnit ( const Project* project, + const Module* module, + const XMLElement* node ); + ~CompilationUnit (); + void ProcessXML(); + bool IsGeneratedFile () const; + bool HasFileWithExtension ( const std::string& extension ) const; + bool IsFirstFile () const; + const FileLocation& GetFilename () const; + const std::string& GetSwitches () const; + void AddFile ( const File * file ); + const std::vector GetFiles () const; +private: + const Project* project; + const Module* module; + const XMLElement* node; + std::vector files; + FileLocation *default_name; +}; + + +class CompilationUnitSupportCode +{ +public: + const Project& project; + + CompilationUnitSupportCode ( const Project& project ); + ~CompilationUnitSupportCode (); + void Generate ( bool verbose ); +private: + void GenerateForModule ( Module& module, + bool verbose ); + std::string GetCompilationUnitFilename ( Module& module, + CompilationUnit& compilationUnit ); + void WriteCompilationUnitFile ( Module& module, + CompilationUnit& compilationUnit ); +}; + + +enum AutoRegisterType +{ + DllRegisterServer, + DllInstall, + Both +}; + +class AutoRegister : public XmlNode +{ +public: + const Module* module; + std::string infSection; + AutoRegisterType type; + AutoRegister ( const Project& project_, + const Module* module_, + const XMLElement& node_ ); +private: + bool IsSupportedModuleType ( ModuleType type ); + AutoRegisterType GetAutoRegisterType( const std::string& type ); + void Initialize (); +}; + + +class SysSetupGenerator +{ +public: + const Project& project; + SysSetupGenerator ( const Project& project ); + ~SysSetupGenerator (); + void Generate (); +private: + std::string GetDirectoryId ( const Module& module ); + std::string GetFlags ( const Module& module ); + void Generate ( HINF inf, + const Module& module ); +}; + + +extern void +InitializeEnvironment (); + +extern std::string +Right ( const std::string& s, size_t n ); + +extern std::string +Replace ( const std::string& s, const std::string& find, const std::string& with ); + +extern std::string +ChangeSeparator ( const std::string& s, + const char fromSeparator, + const char toSeparator ); + +extern std::string +FixSeparator ( const std::string& s ); + +extern std::string +FixSeparatorForSystemCommand ( const std::string& s ); + +extern std::string +DosSeparator ( const std::string& s ); + +extern std::string +ReplaceExtension ( + const std::string& filename, + const std::string& newExtension ); + +extern std::string +GetSubPath ( + const Project& project, + const std::string& location, + const std::string& path, + const std::string& att_value ); + +extern std::string +GetExtension ( const std::string& filename ); + +extern std::string +GetExtension ( const FileLocation& file ); + +extern std::string +NormalizeFilename ( const std::string& filename ); + +extern std::string +ToLower ( std::string filename ); diff --git a/tools/rbuild/rbuild.mak b/tools/rbuild/rbuild.mak new file mode 100644 index 00000000000..a2d422d908e --- /dev/null +++ b/tools/rbuild/rbuild.mak @@ -0,0 +1,560 @@ +# Copyright (C) 2005 Casper S. Hornstrup +# +# This program is free software; you can redistribute it and/or modify +# it under the terms of the GNU General Public License as published by +# the Free Software Foundation; either version 2 of the License, or +# (at your option) any later version. +# +# This program 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 General Public License for more details. +# +# You should have received a copy of the GNU General Public License along +# with this program; if not, write to the Free Software Foundation, Inc., +# 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. + +RBUILD_BASE = $(TOOLS_BASE_)rbuild +RBUILD_BASE_ = $(RBUILD_BASE)$(SEP) +RBUILD_INT = $(INTERMEDIATE_)$(RBUILD_BASE) +RBUILD_INT_ = $(RBUILD_INT)$(SEP) +RBUILD_OUT = $(OUTPUT_)$(RBUILD_BASE) +RBUILD_OUT_ = $(RBUILD_OUT)$(SEP) + +$(RBUILD_INT): | $(TOOLS_INT) + $(ECHO_MKDIR) + ${mkdir} $@ + +ifneq ($(INTERMEDIATE),$(OUTPUT)) +$(RBUILD_OUT): | $(TOOLS_OUT) + $(ECHO_MKDIR) + ${mkdir} $@ +endif + + +RBUILD_BACKEND_BASE = $(RBUILD_BASE_)backend +RBUILD_BACKEND_BASE_ = $(RBUILD_BACKEND_BASE)$(SEP) +RBUILD_BACKEND_INT = $(INTERMEDIATE_)$(RBUILD_BACKEND_BASE) +RBUILD_BACKEND_INT_ = $(RBUILD_BACKEND_INT)$(SEP) +RBUILD_BACKEND_OUT = $(OUTPUT_)$(RBUILD_BACKEND_BASE) +RBUILD_BACKEND_OUT_ = $(RBUILD_BACKEND_OUT)$(SEP) + +$(RBUILD_BACKEND_INT): | $(RBUILD_INT) + $(ECHO_MKDIR) + ${mkdir} $@ + +ifneq ($(INTERMEDIATE),$(OUTPUT)) +$(RBUILD_BACKEND_OUT): | $(RBUILD_OUT) + $(ECHO_MKDIR) + ${mkdir} $@ +endif + + +RBUILD_MINGW_BASE = $(RBUILD_BACKEND_BASE_)mingw +RBUILD_MINGW_BASE_ = $(RBUILD_MINGW_BASE)$(SEP) +RBUILD_MINGW_INT = $(INTERMEDIATE_)$(RBUILD_MINGW_BASE) +RBUILD_MINGW_INT_ = $(RBUILD_MINGW_INT)$(SEP) +RBUILD_MINGW_OUT = $(OUTPUT_)$(RBUILD_MINGW_BASE) +RBUILD_MINGW_OUT_ = $(RBUILD_MINGW_OUT)$(SEP) + +$(RBUILD_MINGW_INT): | $(RBUILD_BACKEND_INT) + $(ECHO_MKDIR) + ${mkdir} $@ + +ifneq ($(INTERMEDIATE),$(OUTPUT)) +$(RBUILD_MINGW_OUT): | $(RBUILD_BACKEND_OUT) + $(ECHO_MKDIR) + ${mkdir} $@ +endif + + +RBUILD_TESTS_BASE = $(RBUILD_BASE_)tests +RBUILD_TESTS_BASE_ = $(RBUILD_TESTS_BASE)$(SEP) +RBUILD_TESTS_INT = $(INTERMEDIATE_)$(RBUILD_TESTS_BASE) +RBUILD_TESTS_INT_ = $(RBUILD_TESTS_INT)$(SEP) +RBUILD_TESTS_OUT = $(OUTPUT_)$(RBUILD_TESTS_BASE) + +$(RBUILD_TESTS_INT): | $(RBUILD_INT) + $(ECHO_MKDIR) + ${mkdir} $@ + +ifneq ($(INTERMEDIATE),$(OUTPUT)) +$(RBUILD_TESTS_OUT): | $(RBUILD_OUT) + $(ECHO_MKDIR) + ${mkdir} $@ +endif + +RBUILD_MSBUILD_BASE = $(RBUILD_BACKEND_BASE_)msbuild +RBUILD_MSBUILD_BASE_ = $(RBUILD_MSBUILD_BASE)$(SEP) +RBUILD_MSBUILD_INT = $(INTERMEDIATE_)$(RBUILD_MSBUILD_BASE) +RBUILD_MSBUILD_INT_ = $(RBUILD_MSBUILD_INT)$(SEP) +RBUILD_MSBUILD_OUT = $(OUTPUT_)$(RBUILD_MSBUILD_BASE) +RBUILD_MSBUILD_OUT_ = $(RBUILD_MSBUILD_OUT)$(SEP) + +$(RBUILD_MSBUILD_INT): | $(RBUILD_BACKEND_INT) + $(ECHO_MKDIR) + ${mkdir} $@ + +ifneq ($(INTERMEDIATE),$(OUTPUT)) +$(RBUILD_MSBUILD_OUT): | $(RBUILD_BACKEND_OUT) + $(ECHO_MKDIR) + ${mkdir} $@ +endif + +RBUILD_DEPMAP_BASE = $(RBUILD_BACKEND_BASE_)dependencymap +RBUILD_DEPMAP_BASE_ = $(RBUILD_DEPMAP_BASE)$(SEP) +RBUILD_DEPMAP_INT = $(INTERMEDIATE_)$(RBUILD_DEPMAP_BASE) +RBUILD_DEPMAP_INT_ = $(RBUILD_DEPMAP_INT)$(SEP) +RBUILD_DEPMAP_OUT = $(OUTPUT_)$(RBUILD_DEPMAP_BASE) +RBUILD_DEPMAP_OUT_ = $(RBUILD_DEPMAP_OUT)$(SEP) + +$(RBUILD_DEPMAP_INT): | $(RBUILD_BACKEND_INT) + $(ECHO_MKDIR) + ${mkdir} $@ + +ifneq ($(INTERMEDIATE),$(OUTPUT)) +$(RBUILD_DEPMAP_OUT): | $(RBUILD_BACKEND_OUT) + $(ECHO_MKDIR) + ${mkdir} $@ +endif + +RBUILD_VREPORT_BASE = $(RBUILD_BACKEND_BASE_)versionreport +RBUILD_VREPORT_BASE_ = $(RBUILD_VREPORT_BASE)$(SEP) +RBUILD_VREPORT_INT = $(INTERMEDIATE_)$(RBUILD_VREPORT_BASE) +RBUILD_VREPORT_INT_ = $(RBUILD_VREPORT_INT)$(SEP) +RBUILD_VREPORT_OUT = $(OUTPUT_)$(RBUILD_VREPORT_BASE) +RBUILD_VREPORT_OUT_ = $(RBUILD_VREPORT_OUT)$(SEP) + +$(RBUILD_VREPORT_INT): | $(RBUILD_BACKEND_INT) + $(ECHO_MKDIR) + ${mkdir} $@ + +ifneq ($(INTERMEDIATE),$(OUTPUT)) +$(RBUILD_VREPORT_OUT): | $(RBUILD_BACKEND_OUT) + $(ECHO_MKDIR) + ${mkdir} $@ +endif + + +RBUILD_MSVC_BASE = $(RBUILD_BACKEND_BASE_)msvc +RBUILD_MSVC_BASE_ = $(RBUILD_MSVC_BASE)$(SEP) +RBUILD_MSVC_INT = $(INTERMEDIATE_)$(RBUILD_MSVC_BASE) +RBUILD_MSVC_INT_ = $(RBUILD_MSVC_INT)$(SEP) +RBUILD_MSVC_OUT = $(OUTPUT_)$(RBUILD_MSVC_BASE) +RBUILD_MSVC_OUT_ = $(RBUILD_MSVC_OUT)$(SEP) + +$(RBUILD_MSVC_INT): | $(RBUILD_BACKEND_INT) + $(ECHO_MKDIR) + ${mkdir} $@ + +ifneq ($(INTERMEDIATE),$(OUTPUT)) +$(RBUILD_MSVC_OUT): | $(RBUILD_BACKEND_OUT) + $(ECHO_MKDIR) + ${mkdir} $@ +endif + + +RBUILD_TARGET = \ + $(RBUILD_OUT_)rbuild$(EXEPOSTFIX) + +RBUILD_TEST_TARGET = \ + $(RBUILD_OUT_)rbuild_test$(EXEPOSTFIX) + +RBUILD_BACKEND_MINGW_BASE_SOURCES = $(addprefix $(RBUILD_MINGW_BASE_), \ + mingw.cpp \ + modulehandler.cpp \ + mstools_detection.cpp \ + proxymakefile.cpp \ + rule.cpp \ + ) + +RBUILD_BACKEND_DEPMAP_BASE_SOURCES = $(addprefix $(RBUILD_DEPMAP_BASE_), \ + dependencymap.cpp \ + ) + +RBUILD_BACKEND_VREPORT_BASE_SOURCES = $(addprefix $(RBUILD_VREPORT_BASE_), \ + versionreport.cpp \ + ) + +RBUILD_BACKEND_MSBUILD_BASE_SOURCES = $(addprefix $(RBUILD_MSBUILD_BASE_), \ + msbuild.cpp \ + ) + +RBUILD_BACKEND_MSVC_BASE_SOURCES = $(addprefix $(RBUILD_MSVC_BASE_), \ + genguid.cpp \ + msvc.cpp \ + projmaker.cpp \ + propsmaker.cpp \ + slnmaker.cpp \ + vcprojmaker.cpp \ + vcxprojmaker.cpp \ + vspropsmaker.cpp \ + ) + +RBUILD_BACKEND_SOURCES = \ + $(RBUILD_BACKEND_MINGW_BASE_SOURCES) \ + $(RBUILD_BACKEND_MSVC_BASE_SOURCES) \ + $(RBUILD_BACKEND_DEPMAP_BASE_SOURCES) \ + $(RBUILD_BACKEND_VREPORT_BASE_SOURCES) \ + $(RBUILD_BACKEND_MSBUILD_BASE_SOURCES) \ + $(RBUILD_BACKEND_BASE_)backend.cpp + +RBUILD_SOURCES = \ + $(RBUILD_BACKEND_SOURCES) \ + $(addprefix $(RBUILD_BASE_), \ + global.cpp \ + automaticdependency.cpp \ + autoregister.cpp \ + bootstrap.cpp \ + cdfile.cpp \ + compilationunit.cpp \ + compilationunitsupportcode.cpp \ + compilerdirective.cpp \ + compilerflag.cpp \ + configuration.cpp \ + define.cpp \ + directory.cpp \ + exception.cpp \ + filesupportcode.cpp \ + include.cpp \ + installfile.cpp \ + linkerflag.cpp \ + linkerscript.cpp \ + module.cpp \ + project.cpp \ + rbuild.cpp \ + stubbedcomponent.cpp \ + syssetupgenerator.cpp \ + testsupportcode.cpp \ + xmlnode.cpp \ + ) + +RBUILD_OBJECTS = \ + $(addprefix $(INTERMEDIATE_), $(RBUILD_SOURCES:.cpp=.o)) + +RBUILD_BACKEND_MSVCCPP_HEADERS = \ + msvc.h + +RBUILD_BACKEND_DEPMAP_HEADERS = \ + dependencymap.h + +RBUILD_BACKEND_VREPORT_HEADERS = \ + versionreport.h + +RBUILD_BACKEND_MSBUILD_HEADERS = \ + msbuild.h + +RBUILD_BACKEND_MINGW_HEADERS = \ + mingw.h \ + modulehandler.h \ + rule.h + +RBUILD_BACKEND_HEADERS = \ + backend.h \ + $(addprefix msvc$(SEP), $(RBUILD_BACKEND_MSVC_HEADERS)) \ + $(addprefix mingw$(SEP), $(RBUILD_BACKEND_MINGW_HEADERS)) \ + $(addprefix msbuild$(SEP), $(RBUILD_BACKEND_MSBUILD_HEADERS)) \ + $(addprefix versionreport$(SEP), $(RBUILD_BACKEND_VREPORT_HEADERS)) \ + $(addprefix dependencymap$(SEP), $(RBUILD_BACKEND_DEPMAP_HEADERS)) + +RBUILD_HEADERS = \ + $(addprefix $(RBUILD_BASE_), \ + exception.h \ + pch.h \ + rbuild.h \ + test.h \ + $(addprefix backend$(SEP), $(RBUILD_BACKEND_HEADERS)) \ + ) \ + $(XML_SSPRINTF_HEADERS) + +RBUILD_TESTS = \ + tests$(SEP)cdfiletest.cpp \ + tests$(SEP)compilationunittest.cpp \ + tests$(SEP)definetest.cpp \ + tests$(SEP)functiontest.cpp \ + tests$(SEP)iftest.cpp \ + tests$(SEP)includetest.cpp \ + tests$(SEP)invoketest.cpp \ + tests$(SEP)linkerflagtest.cpp \ + tests$(SEP)moduletest.cpp \ + tests$(SEP)projecttest.cpp \ + tests$(SEP)sourcefiletest.cpp \ + tests$(SEP)symboltest.cpp + +RBUILD_TEST_SPECIAL_SOURCES = \ + $(addprefix $(RBUILD_BASE_), $(RBUILD_TESTS)) \ + $(RBUILD_BASE_)tests$(SEP)alltests.cpp + +RBUILD_TEST_SOURCES = \ + $(RBUILD_COMMON_SOURCES) \ + $(RBUILD_TEST_SPECIAL_SOURCES) + +RBUILD_TEST_SPECIAL_OBJECTS = \ + $(addprefix $(INTERMEDIATE_), $(RBUILD_TEST_SPECIAL_SOURCES:.cpp=.o)) + +RBUILD_TEST_OBJECTS = \ + $(RBUILD_COMMON_OBJECTS) \ + $(RBUILD_TEST_SPECIAL_OBJECTS) + +RBUILD_HOST_CXXFLAGS = -I$(RBUILD_BASE) -I$(TOOLS_BASE) -I$(INFLIB_BASE) $(TOOLS_CPPFLAGS) -Iinclude -Iinclude/reactos -Iinclude/host + +RBUILD_HOST_LFLAGS = $(TOOLS_LFLAGS) + +ifeq ($(HOST),mingw32-windows) +RBUILD_HOST_LFLAGS += -loleaut32 -lole32 -luuid +endif + +.PHONY: rbuild +rbuild: $(RBUILD_TARGET) +host_gpp += -g + +$(RBUILD_TARGET): $(RBUILD_OBJECTS) $(XML_SSPRINTF_OBJECTS) $(INFLIB_HOST_OBJECTS) | $(RBUILD_OUT) + $(ECHO_HOSTLD) + ${host_gpp} $^ $(RBUILD_HOST_LFLAGS) -o $@ + +$(RBUILD_INT_)global.o: $(RBUILD_BASE_)global.cpp $(RBUILD_HEADERS) | $(RBUILD_INT) + $(ECHO_HOSTCC) + ${host_gpp} $(RBUILD_HOST_CXXFLAGS) -c $< -o $@ + +$(RBUILD_INT_)automaticdependency.o: $(RBUILD_BASE_)automaticdependency.cpp $(RBUILD_HEADERS) | $(RBUILD_INT) + $(ECHO_HOSTCC) + ${host_gpp} $(RBUILD_HOST_CXXFLAGS) -c $< -o $@ + +$(RBUILD_INT_)autoregister.o: $(RBUILD_BASE_)autoregister.cpp $(RBUILD_HEADERS) | $(RBUILD_INT) + $(ECHO_HOSTCC) + ${host_gpp} $(RBUILD_HOST_CXXFLAGS) -c $< -o $@ + +$(RBUILD_INT_)bootstrap.o: $(RBUILD_BASE_)bootstrap.cpp $(RBUILD_HEADERS) | $(RBUILD_INT) + $(ECHO_HOSTCC) + ${host_gpp} $(RBUILD_HOST_CXXFLAGS) -c $< -o $@ + +$(RBUILD_INT_)cdfile.o: $(RBUILD_BASE_)cdfile.cpp $(RBUILD_HEADERS) | $(RBUILD_INT) + $(ECHO_HOSTCC) + ${host_gpp} $(RBUILD_HOST_CXXFLAGS) -c $< -o $@ + +$(RBUILD_INT_)compilationunit.o: $(RBUILD_BASE_)compilationunit.cpp $(RBUILD_HEADERS) | $(RBUILD_INT) + $(ECHO_HOSTCC) + ${host_gpp} $(RBUILD_HOST_CXXFLAGS) -c $< -o $@ + +$(RBUILD_INT_)compilationunitsupportcode.o: $(RBUILD_BASE_)compilationunitsupportcode.cpp $(RBUILD_HEADERS) | $(RBUILD_INT) + $(ECHO_HOSTCC) + ${host_gpp} $(RBUILD_HOST_CXXFLAGS) -c $< -o $@ + +$(RBUILD_INT_)compilerdirective.o: $(RBUILD_BASE_)compilerdirective.cpp $(RBUILD_HEADERS) | $(RBUILD_INT) + $(ECHO_HOSTCC) + ${host_gpp} $(RBUILD_HOST_CXXFLAGS) -c $< -o $@ + +$(RBUILD_INT_)compilerflag.o: $(RBUILD_BASE_)compilerflag.cpp $(RBUILD_HEADERS) | $(RBUILD_INT) + $(ECHO_HOSTCC) + ${host_gpp} $(RBUILD_HOST_CXXFLAGS) -c $< -o $@ + +$(RBUILD_INT_)configuration.o: $(RBUILD_BASE_)configuration.cpp $(RBUILD_HEADERS) | $(RBUILD_INT) + $(ECHO_HOSTCC) + ${host_gpp} $(RBUILD_HOST_CXXFLAGS) -c $< -o $@ + +$(RBUILD_INT_)define.o: $(RBUILD_BASE_)define.cpp $(RBUILD_HEADERS) | $(RBUILD_INT) + $(ECHO_HOSTCC) + ${host_gpp} $(RBUILD_HOST_CXXFLAGS) -c $< -o $@ + +$(RBUILD_INT_)directory.o: $(RBUILD_BASE_)directory.cpp $(RBUILD_HEADERS) | $(RBUILD_INT) + $(ECHO_HOSTCC) + ${host_gpp} $(RBUILD_HOST_CXXFLAGS) -c $< -o $@ + +$(RBUILD_INT_)exception.o: $(RBUILD_BASE_)exception.cpp $(RBUILD_HEADERS) | $(RBUILD_INT) + $(ECHO_HOSTCC) + ${host_gpp} $(RBUILD_HOST_CXXFLAGS) -c $< -o $@ + +$(RBUILD_INT_)filesupportcode.o: $(RBUILD_BASE_)filesupportcode.cpp $(RBUILD_HEADERS) | $(RBUILD_INT) + $(ECHO_HOSTCC) + ${host_gpp} $(RBUILD_HOST_CXXFLAGS) -c $< -o $@ + +$(RBUILD_INT_)include.o: $(RBUILD_BASE_)include.cpp $(RBUILD_HEADERS) | $(RBUILD_INT) + $(ECHO_HOSTCC) + ${host_gpp} $(RBUILD_HOST_CXXFLAGS) -c $< -o $@ + +$(RBUILD_INT_)installfile.o: $(RBUILD_BASE_)installfile.cpp $(RBUILD_HEADERS) | $(RBUILD_INT) + $(ECHO_HOSTCC) + ${host_gpp} $(RBUILD_HOST_CXXFLAGS) -c $< -o $@ + +$(RBUILD_INT_)linkerflag.o: $(RBUILD_BASE_)linkerflag.cpp $(RBUILD_HEADERS) | $(RBUILD_INT) + $(ECHO_HOSTCC) + ${host_gpp} $(RBUILD_HOST_CXXFLAGS) -c $< -o $@ + +$(RBUILD_INT_)linkerscript.o: $(RBUILD_BASE_)linkerscript.cpp $(RBUILD_HEADERS) | $(RBUILD_INT) + $(ECHO_HOSTCC) + ${host_gpp} $(RBUILD_HOST_CXXFLAGS) -c $< -o $@ + +$(RBUILD_INT_)module.o: $(RBUILD_BASE_)module.cpp $(RBUILD_HEADERS) | $(RBUILD_INT) + $(ECHO_HOSTCC) + ${host_gpp} $(RBUILD_HOST_CXXFLAGS) -c $< -o $@ + +$(RBUILD_INT_)project.o: $(RBUILD_BASE_)project.cpp $(RBUILD_HEADERS) | $(RBUILD_INT) + $(ECHO_HOSTCC) + ${host_gpp} $(RBUILD_HOST_CXXFLAGS) -c $< -o $@ + +$(RBUILD_INT_)rbuild.o: $(RBUILD_BASE_)rbuild.cpp $(RBUILD_HEADERS) | $(RBUILD_INT) + $(ECHO_HOSTCC) + ${host_gpp} $(RBUILD_HOST_CXXFLAGS) -c $< -o $@ + +$(RBUILD_INT_)rule.o: $(RBUILD_BASE_)rule.cpp $(RBUILD_HEADERS) | $(RBUILD_INT) + $(ECHO_HOSTCC) + ${host_gpp} $(RBUILD_HOST_CXXFLAGS) -c $< -o $@ + +$(RBUILD_INT_)stubbedcomponent.o: $(RBUILD_BASE_)stubbedcomponent.cpp $(RBUILD_HEADERS) | $(RBUILD_INT) + $(ECHO_HOSTCC) + ${host_gpp} $(RBUILD_HOST_CXXFLAGS) -c $< -o $@ + +$(RBUILD_INT_)syssetupgenerator.o: $(RBUILD_BASE_)syssetupgenerator.cpp $(RBUILD_HEADERS) | $(RBUILD_INT) + $(ECHO_HOSTCC) + ${host_gpp} $(RBUILD_HOST_CXXFLAGS) -c $< -o $@ + +$(RBUILD_INT_)wineresource.o: $(RBUILD_BASE_)wineresource.cpp $(RBUILD_HEADERS) | $(RBUILD_INT) + $(ECHO_HOSTCC) + ${host_gpp} $(RBUILD_HOST_CXXFLAGS) -c $< -o $@ + +$(RBUILD_INT_)xmlnode.o: $(RBUILD_BASE_)xmlnode.cpp $(RBUILD_HEADERS) | $(RBUILD_INT) + $(ECHO_HOSTCC) + ${host_gpp} $(RBUILD_HOST_CXXFLAGS) -c $< -o $@ + +$(RBUILD_INT_)testsupportcode.o: $(RBUILD_BASE_)testsupportcode.cpp $(RBUILD_HEADERS) | $(RBUILD_INT) + $(ECHO_HOSTCC) + ${host_gpp} $(RBUILD_HOST_CXXFLAGS) -c $< -o $@ + +$(RBUILD_BACKEND_INT_)backend.o: $(RBUILD_BACKEND_BASE_)backend.cpp $(RBUILD_HEADERS) | $(RBUILD_BACKEND_INT) + $(ECHO_HOSTCC) + ${host_gpp} $(RBUILD_HOST_CXXFLAGS) -c $< -o $@ + +$(RBUILD_MINGW_INT_)mingw.o: $(RBUILD_MINGW_BASE_)mingw.cpp $(RBUILD_HEADERS) | $(RBUILD_MINGW_INT) + $(ECHO_HOSTCC) + ${host_gpp} $(RBUILD_HOST_CXXFLAGS) -c $< -o $@ + +$(RBUILD_MINGW_INT_)modulehandler.o: $(RBUILD_MINGW_BASE_)modulehandler.cpp $(RBUILD_HEADERS) | $(RBUILD_MINGW_INT) + $(ECHO_HOSTCC) + ${host_gpp} $(RBUILD_HOST_CXXFLAGS) -c $< -o $@ + +$(RBUILD_MINGW_INT_)mstools_detection.o: $(RBUILD_MINGW_BASE_)mstools_detection.cpp $(RBUILD_HEADERS) | $(RBUILD_MINGW_INT) + $(ECHO_HOSTCC) + ${host_gpp} $(RBUILD_HOST_CXXFLAGS) -c $< -o $@ + +$(RBUILD_MINGW_INT_)proxymakefile.o: $(RBUILD_MINGW_BASE_)proxymakefile.cpp $(RBUILD_HEADERS) | $(RBUILD_MINGW_INT) + $(ECHO_HOSTCC) + ${host_gpp} $(RBUILD_HOST_CXXFLAGS) -c $< -o $@ + +$(RBUILD_MINGW_INT_)rule.o: $(RBUILD_MINGW_BASE_)rule.cpp $(RBUILD_HEADERS) | $(RBUILD_MINGW_INT) + $(ECHO_HOSTCC) + ${host_gpp} $(RBUILD_HOST_CXXFLAGS) -c $< -o $@ + +$(RBUILD_DEPMAP_INT_)dependencymap.o: $(RBUILD_DEPMAP_BASE_)dependencymap.cpp $(RBUILD_HEADERS) | $(RBUILD_DEPMAP_INT) + $(ECHO_HOSTCC) + ${host_gpp} $(RBUILD_HOST_CXXFLAGS) -c $< -o $@ + +$(RBUILD_VREPORT_INT_)versionreport.o: $(RBUILD_VREPORT_BASE_)versionreport.cpp $(RBUILD_HEADERS) | $(RBUILD_VREPORT_INT) + $(ECHO_HOSTCC) + ${host_gpp} $(RBUILD_HOST_CXXFLAGS) -c $< -o $@ + +$(RBUILD_MSBUILD_INT_)msbuild.o: $(RBUILD_MSBUILD_BASE_)msbuild.cpp $(RBUILD_HEADERS) | $(RBUILD_MSBUILD_INT) + $(ECHO_HOSTCC) + ${host_gpp} $(RBUILD_HOST_CXXFLAGS) -c $< -o $@ + +$(RBUILD_MSVC_INT_)genguid.o: $(RBUILD_MSVC_BASE_)genguid.cpp $(RBUILD_HEADERS) | $(RBUILD_MSVC_INT) + $(ECHO_HOSTCC) + ${host_gpp} $(RBUILD_HOST_CXXFLAGS) -c $< -o $@ + +$(RBUILD_MSVC_INT_)msvc.o: $(RBUILD_MSVC_BASE_)msvc.cpp $(RBUILD_HEADERS) | $(RBUILD_MSVC_INT) + $(ECHO_HOSTCC) + ${host_gpp} $(RBUILD_HOST_CXXFLAGS) -c $< -o $@ + +$(RBUILD_MSVC_INT_)projmaker.o: $(RBUILD_MSVC_BASE_)projmaker.cpp $(RBUILD_HEADERS) | $(RBUILD_MSVC_INT) + $(ECHO_HOSTCC) + ${host_gpp} $(RBUILD_HOST_CXXFLAGS) -c $< -o $@ + +$(RBUILD_MSVC_INT_)vspropsmaker.o: $(RBUILD_MSVC_BASE_)vspropsmaker.cpp $(RBUILD_HEADERS) | $(RBUILD_MSVC_INT) + $(ECHO_HOSTCC) + ${host_gpp} $(RBUILD_HOST_CXXFLAGS) -c $< -o $@ + +$(RBUILD_MSVC_INT_)propsmaker.o: $(RBUILD_MSVC_BASE_)propsmaker.cpp $(RBUILD_HEADERS) | $(RBUILD_MSVC_INT) + $(ECHO_HOSTCC) + ${host_gpp} $(RBUILD_HOST_CXXFLAGS) -c $< -o $@ + +$(RBUILD_MSVC_INT_)slnmaker.o: $(RBUILD_MSVC_BASE_)slnmaker.cpp $(RBUILD_HEADERS) | $(RBUILD_MSVC_INT) + $(ECHO_HOSTCC) + ${host_gpp} $(RBUILD_HOST_CXXFLAGS) -c $< -o $@ + +$(RBUILD_MSVC_INT_)vcprojmaker.o: $(RBUILD_MSVC_BASE_)vcprojmaker.cpp $(RBUILD_HEADERS) | $(RBUILD_MSVC_INT) + $(ECHO_HOSTCC) + ${host_gpp} $(RBUILD_HOST_CXXFLAGS) -c $< -o $@ + +$(RBUILD_MSVC_INT_)vcxprojmaker.o: $(RBUILD_MSVC_BASE_)vcxprojmaker.cpp $(RBUILD_HEADERS) | $(RBUILD_MSVC_INT) + $(ECHO_HOSTCC) + ${host_gpp} $(RBUILD_HOST_CXXFLAGS) -c $< -o $@ + +$(RBUILD_TEST_TARGET): $(RBUILD_TEST_OBJECTS) $(INFLIB_HOST_OBJECTS) $(RBUILD_HEADERS) | $(RBUILD_OUT) + $(ECHO_HOSTLD) + ${host_gpp} $(RBUILD_TEST_OBJECTS) $(INFLIB_HOST_OBJECTS) $(RBUILD_HOST_LFLAGS) -o $@ + +$(RBUILD_TESTS_INT_)cdfiletest.o: $(RBUILD_TESTS_BASE_)cdfiletest.cpp $(RBUILD_HEADERS) | $(RBUILD_TESTS_INT) + $(ECHO_HOSTCC) + ${host_gpp} $(RBUILD_HOST_CXXFLAGS) -c $< -o $@ + +$(RBUILD_TESTS_INT_)compilationunittest.o: $(RBUILD_TESTS_BASE_)compilationunittest.cpp $(RBUILD_HEADERS) | $(RBUILD_TESTS_INT) + $(ECHO_HOSTCC) + ${host_gpp} $(RBUILD_HOST_CXXFLAGS) -c $< -o $@ + +$(RBUILD_TESTS_INT_)definetest.o: $(RBUILD_TESTS_BASE_)definetest.cpp $(RBUILD_HEADERS) | $(RBUILD_TESTS_INT) + $(ECHO_HOSTCC) + ${host_gpp} $(RBUILD_HOST_CXXFLAGS) -c $< -o $@ + +$(RBUILD_TESTS_INT_)functiontest.o: $(RBUILD_TESTS_BASE_)functiontest.cpp $(RBUILD_HEADERS) | $(RBUILD_TESTS_INT) + $(ECHO_HOSTCC) + ${host_gpp} $(RBUILD_HOST_CXXFLAGS) -c $< -o $@ + +$(RBUILD_TESTS_INT_)iftest.o: $(RBUILD_TESTS_BASE_)iftest.cpp $(RBUILD_HEADERS) | $(RBUILD_TESTS_INT) + $(ECHO_HOSTCC) + ${host_gpp} $(RBUILD_HOST_CXXFLAGS) -c $< -o $@ + +$(RBUILD_TESTS_INT_)includetest.o: $(RBUILD_TESTS_BASE_)includetest.cpp $(RBUILD_HEADERS) | $(RBUILD_TESTS_INT) + $(ECHO_HOSTCC) + ${host_gpp} $(RBUILD_HOST_CXXFLAGS) -c $< -o $@ + +$(RBUILD_TESTS_INT_)invoketest.o: $(RBUILD_TESTS_BASE_)invoketest.cpp $(RBUILD_HEADERS) | $(RBUILD_TESTS_INT) + $(ECHO_HOSTCC) + ${host_gpp} $(RBUILD_HOST_CXXFLAGS) -c $< -o $@ + +$(RBUILD_TESTS_INT_)linkerflagtest.o: $(RBUILD_TESTS_BASE_)linkerflagtest.cpp $(RBUILD_HEADERS) | $(RBUILD_TESTS_INT) + $(ECHO_HOSTCC) + ${host_gpp} $(RBUILD_HOST_CXXFLAGS) -c $< -o $@ + +$(RBUILD_TESTS_INT_)moduletest.o: $(RBUILD_TESTS_BASE_)moduletest.cpp $(RBUILD_HEADERS) | $(RBUILD_TESTS_INT) + $(ECHO_HOSTCC) + ${host_gpp} $(RBUILD_HOST_CXXFLAGS) -c $< -o $@ + +$(RBUILD_TESTS_INT_)projecttest.o: $(RBUILD_TESTS_BASE_)projecttest.cpp $(RBUILD_HEADERS) | $(RBUILD_TESTS_INT) + $(ECHO_HOSTCC) + ${host_gpp} $(RBUILD_HOST_CXXFLAGS) -c $< -o $@ + +$(RBUILD_TESTS_INT_)sourcefiletest.o: $(RBUILD_TESTS_BASE_)sourcefiletest.cpp $(RBUILD_HEADERS) | $(RBUILD_TESTS_INT) + $(ECHO_HOSTCC) + ${host_gpp} $(RBUILD_HOST_CXXFLAGS) -c $< -o $@ + +$(RBUILD_TESTS_INT_)symboltest.o: $(RBUILD_TESTS_BASE_)symboltest.cpp $(RBUILD_HEADERS) | $(RBUILD_TESTS_INT) + $(ECHO_HOSTCC) + ${host_gpp} $(RBUILD_HOST_CXXFLAGS) -c $< -o $@ + +$(RBUILD_TESTS_INT_)alltests.o: $(RBUILD_TESTS_BASE_)alltests.cpp $(RBUILD_HEADERS) | $(RBUILD_TESTS_INT) + $(ECHO_HOSTCC) + ${host_gpp} $(RBUILD_HOST_CXXFLAGS) -c $< -o $@ + + +.PHONY: rbuild_test +rbuild_test: $(RBUILD_TEST_TARGET) + $(ECHO_TEST) + $(Q)$(RBUILD_TEST_TARGET) + +.PHONY: rbuild_test_clean +rbuild_test_clean: $(RBUILD_TEST_TARGET) $(RBUILD_TESTS_INT) + -@$(rm) $(RBUILD_TEST_TARGET) $(RBUILD_TEST_SPECIAL_OBJECTS) 2>$(NUL) + +.PHONY: rbuild_clean +rbuild_clean: $(RBUILD_TARGET) $(RBUILD_OBJECTS) $(RBUILD_TESTS_INT) + -@$(rm) $(RBUILD_TARGET) $(RBUILD_OBJECTS) 2>$(NUL) +clean: rbuild_clean diff --git a/tools/rbuild/rbuild.sln b/tools/rbuild/rbuild.sln new file mode 100644 index 00000000000..b3fc0e817cb --- /dev/null +++ b/tools/rbuild/rbuild.sln @@ -0,0 +1,19 @@ +Microsoft Visual Studio Solution File, Format Version 10.00 +# Visual Studio 2008 +Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "rbuild", "rbuild.vcproj", "{D9305AFB-499E-49F1-A865-99DD7E19E762}" +EndProject +Global + GlobalSection(SolutionConfigurationPlatforms) = preSolution + Debug|Win32 = Debug|Win32 + Release|Win32 = Release|Win32 + EndGlobalSection + GlobalSection(ProjectConfigurationPlatforms) = postSolution + {D9305AFB-499E-49F1-A865-99DD7E19E762}.Debug|Win32.ActiveCfg = Debug|Win32 + {D9305AFB-499E-49F1-A865-99DD7E19E762}.Debug|Win32.Build.0 = Debug|Win32 + {D9305AFB-499E-49F1-A865-99DD7E19E762}.Release|Win32.ActiveCfg = Release|Win32 + {D9305AFB-499E-49F1-A865-99DD7E19E762}.Release|Win32.Build.0 = Release|Win32 + EndGlobalSection + GlobalSection(SolutionProperties) = preSolution + HideSolutionNode = FALSE + EndGlobalSection +EndGlobal diff --git a/tools/rbuild/rbuild.vcproj b/tools/rbuild/rbuild.vcproj new file mode 100644 index 00000000000..cd7ff0494cc --- /dev/null +++ b/tools/rbuild/rbuild.vcproj @@ -0,0 +1,1286 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/tools/rbuild/stubbedcomponent.cpp b/tools/rbuild/stubbedcomponent.cpp new file mode 100644 index 00000000000..1444d6b830d --- /dev/null +++ b/tools/rbuild/stubbedcomponent.cpp @@ -0,0 +1,118 @@ +/* + * Copyright (C) 2005 Casper S. Hornstrup + * + * This program is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation; either version 2 of the License, or + * (at your option) any later version. + * + * This program 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 General Public License for more details. + * + * You should have received a copy of the GNU General Public License along + * with this program; if not, write to the Free Software Foundation, Inc., + * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. + */ +#include "pch.h" +#include + +#include "rbuild.h" + +using std::string; +using std::vector; + +StubbedComponent::StubbedComponent ( const Module* module_, + const XMLElement& stubbedComponentNode ) + : module(module_), + node(stubbedComponentNode) +{ + const XMLAttribute* att = node.GetAttribute ( "name", true ); + assert ( att ); + name = att->value; +} + +StubbedComponent::~StubbedComponent () +{ + for ( size_t i = 0; i < symbols.size(); i++ ) + delete symbols[i]; +} + +void +StubbedComponent::ProcessXML () +{ + size_t i; + for ( i = 0; i < node.subElements.size (); i++ ) + ProcessXMLSubElement ( *node.subElements[i] ); + for ( i = 0; i < symbols.size (); i++ ) + symbols[i]->ProcessXML (); +} + +void +StubbedComponent::ProcessXMLSubElement ( const XMLElement& e ) +{ + bool subs_invalid = false; + if ( e.name == "symbol" ) + { + symbols.push_back ( new StubbedSymbol ( e ) ); + subs_invalid = false; + } + if ( subs_invalid && e.subElements.size () > 0 ) + { + throw XMLInvalidBuildFileException ( + e.location, + "<%s> cannot have sub-elements", + e.name.c_str() ); + } + for ( size_t i = 0; i < e.subElements.size (); i++ ) + ProcessXMLSubElement ( *e.subElements[i] ); +} + + + +StubbedSymbol::StubbedSymbol ( const XMLElement& stubbedSymbolNode ) + : node(stubbedSymbolNode) +{ +} + +StubbedSymbol::~StubbedSymbol () +{ +} + +void +StubbedSymbol::ProcessXML () +{ + if ( node.value.size () == 0 ) + { + throw XMLInvalidBuildFileException ( + node.location, + " is empty." ); + } + symbol = node.value; + + strippedName = StripSymbol ( symbol ); + + const XMLAttribute* att = node.GetAttribute ( "newname", false ); + if ( att != NULL ) + newname = att->value; + else + newname = strippedName; +} + +string +StubbedSymbol::StripSymbol ( string symbol ) +{ + size_t start = 0; + while ( start < symbol.length () && symbol[start] == '@') + start++; + size_t end = symbol.length () - 1; + while ( end > 0 && isdigit ( symbol[end] ) ) + end--; + if ( end > 0 && symbol[end] == '@' ) + end--; + if ( end > 0 ) + return symbol.substr ( start, end - start + 1 ); + else + return ""; +} diff --git a/tools/rbuild/syssetupgenerator.cpp b/tools/rbuild/syssetupgenerator.cpp new file mode 100644 index 00000000000..c7e64e8cf7a --- /dev/null +++ b/tools/rbuild/syssetupgenerator.cpp @@ -0,0 +1,117 @@ +/* + * Copyright (C) 2005 Casper S. Hornstrup + * + * This program is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation; either version 2 of the License, or + * (at your option) any later version. + * + * This program 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 General Public License for more details. + * + * You should have received a copy of the GNU General Public License along + * with this program; if not, write to the Free Software Foundation, Inc., + * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. + */ +#include "pch.h" +#include + +#include "rbuild.h" + +using std::string; +using std::vector; + +SysSetupGenerator::SysSetupGenerator ( const Project& project ) + : project ( project ) +{ +} + +SysSetupGenerator::~SysSetupGenerator () +{ +} + +void +SysSetupGenerator::Generate () +{ + HINF inf; + ULONG errorLine; + + string syssetupTemplate = "media" + sSep + "inf" + sSep + "syssetup.inf.tpl"; + string syssetup = Environment::GetOutputPath() + sSep + "media" + sSep + "inf" + sSep + "syssetup.inf"; + + if ( 0 != InfHostOpenFile ( &inf, syssetupTemplate.c_str (), &errorLine ) ) + throw new FileNotFoundException ( syssetupTemplate ); + + for( std::map::const_iterator p = project.modules.begin(); p != project.modules.end(); ++ p ) + { + const Module& module = *p->second; + if ( module.autoRegister != NULL ) + Generate ( inf, module ); + } + + if ( 0 != InfHostWriteFile ( inf, syssetup.c_str (), "" ) ) + { + InfHostCloseFile ( inf ); + throw new AccessDeniedException ( syssetup ); + } + + InfHostCloseFile ( inf ); +} + +#define DIRECTORYID_SYSTEM32 "11" + +string +SysSetupGenerator::GetDirectoryId ( const Module& module ) +{ + if ( module.install && ToLower ( module.install->relative_path ) == "system32" ) + return DIRECTORYID_SYSTEM32; + throw InvalidOperationException ( __FILE__, + __LINE__ ); +} + +#define FLG_REGSVR_DLLREGISTER "1" +#define FLG_REGSVR_DLLINSTALL "2" +#define FLG_REGSVR_BOTH "3" + +string +SysSetupGenerator::GetFlags ( const Module& module ) +{ + if ( module.autoRegister->type == DllRegisterServer ) + return FLG_REGSVR_DLLREGISTER; + if ( module.autoRegister->type == DllInstall ) + return FLG_REGSVR_DLLINSTALL; + if ( module.autoRegister->type == Both ) + return FLG_REGSVR_BOTH; + throw InvalidOperationException ( __FILE__, + __LINE__ ); +} + +void +SysSetupGenerator::Generate ( HINF inf, + const Module& module ) +{ + PINFCONTEXT context; + + string infSection = module.autoRegister->infSection; + if ( 0 != InfHostFindOrAddSection ( inf, infSection.c_str (), &context ) ) + { + throw new Exception ( ".inf section '%s' not found", infSection.c_str () ); + InfHostCloseFile ( inf ); + } + + if ( 0 != InfHostAddLine ( context, NULL ) || + 0 != InfHostAddField ( context, GetDirectoryId ( module ).c_str () ) || + 0 != InfHostAddField ( context, "" ) || + ( module.install && 0 != InfHostAddField ( context, module.install->name.c_str () ) ) || + 0 != InfHostAddField ( context, GetFlags ( module ).c_str () ) ) + { + InfHostFreeContext ( context ); + InfHostCloseFile ( inf ); + throw InvalidOperationException ( __FILE__, + __LINE__ ); + } + + InfHostFreeContext ( context ); +} diff --git a/tools/rbuild/test.h b/tools/rbuild/test.h new file mode 100644 index 00000000000..69e131f44ed --- /dev/null +++ b/tools/rbuild/test.h @@ -0,0 +1,162 @@ +/* + * Copyright (C) 2005 Casper S. Hornstrup + * + * This program is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation; either version 2 of the License, or + * (at your option) any later version. + * + * This program 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 General Public License for more details. + * + * You should have received a copy of the GNU General Public License along + * with this program; if not, write to the Free Software Foundation, Inc., + * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. + */ + +#pragma once + +#include "rbuild.h" +#include "backend/mingw/mingw.h" + +#define SSEP DEF_SSEP + +#define RBUILD_BASE "tools" SSEP "rbuild" SSEP + +class BaseTest +{ +public: + bool Failed; + BaseTest (); + virtual ~BaseTest (); + virtual void Run () = 0; +protected: + void Assert ( const char *message, + ... ); + void IsNull ( void* reference, + const char* file, + int line ); + void IsNotNull ( void* reference, + const char* file, + int line ); + void IsTrue ( bool condition, + const char* file, + int line ); + void IsFalse ( bool condition, + const char* file, + int line ); + void AreEqual ( int expected, + int actual, + const char* file, + int line ); + void AreEqual ( const std::string& expected, + const std::string& actual, + const char* file, + int line ); + void AreNotEqual ( int expected, + int actual, + const char* file, + int line ); +private: + void Fail (); +}; + +#define IS_NULL(reference) IsNull((void*)reference,__FILE__,__LINE__) +#define IS_NOT_NULL(reference) IsNotNull((void*)reference,__FILE__,__LINE__) +#define IS_TRUE(condition) IsTrue(condition,__FILE__,__LINE__) +#define IS_FALSE(condition) IsFalse(condition,__FILE__,__LINE__) +#define ARE_EQUAL(expected,actual) AreEqual(expected,actual,__FILE__,__LINE__) +#define ARE_NOT_EQUAL(expected,actual) AreNotEqual(expected,actual,__FILE__,__LINE__) + +class ProjectTest : public BaseTest +{ +public: + void Run (); +}; + + +class ModuleTest : public BaseTest +{ +public: + void Run (); +}; + + +class DefineTest : public BaseTest +{ +public: + void Run (); +}; + + +class IncludeTest : public BaseTest +{ +public: + void Run (); +}; + + +class InvokeTest : public BaseTest +{ +public: + void Run (); +}; + + +class LinkerFlagTest : public BaseTest +{ +public: + void Run (); +}; + + +class IfTest : public BaseTest +{ +public: + void Run (); +private: + void TestProjectIf ( Project& project ); + void TestModuleIf ( Project& project ); +}; + + +class FunctionTest : public BaseTest +{ +public: + void Run (); +}; + + +class SourceFileTest : public BaseTest +{ +public: + void Run (); + void IncludeTest (); + void FullParseTest (); +private: + bool IsParentOf ( const SourceFile* parent, + const SourceFile* child ); + +}; + + +class CDFileTest : public BaseTest +{ +public: + void Run (); +}; + + +class SymbolTest : public BaseTest +{ +public: + void Run (); +}; + +class CompilationUnitTest : public BaseTest +{ +public: + void Run (); +}; diff --git a/tools/rbuild/tests/alltests.cpp b/tools/rbuild/tests/alltests.cpp new file mode 100644 index 00000000000..5451d81b0fb --- /dev/null +++ b/tools/rbuild/tests/alltests.cpp @@ -0,0 +1,215 @@ +/* + * Copyright (C) 2005 Casper S. Hornstrup + * + * This program is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation; either version 2 of the License, or + * (at your option) any later version. + * + * This program 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 General Public License for more details. + * + * You should have received a copy of the GNU General Public License along + * with this program; if not, write to the Free Software Foundation, Inc., + * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. + */ +#include "pch.h" + +#include "rbuild.h" +#include "test.h" + +BaseTest::BaseTest() +{ + Failed = false; +} + +BaseTest::~BaseTest() +{ +} + +void BaseTest::Assert(const char *message, ...) +{ + va_list args; + va_start ( args, message ); + vprintf(message, args); + va_end ( args ); + Fail(); +} + +void BaseTest::IsNull(void* reference, + const char* file, + int line) +{ + if (reference != NULL) + { + Assert("Condition was not NULL at %s:%d\n", + file, + line); + } +} + +void BaseTest::IsNotNull(void* reference, + const char* file, + int line) +{ + if (reference == NULL) + { + Assert("Condition was NULL at %s:%d\n", + file, + line); + } +} + +void BaseTest::IsTrue(bool condition, + const char* file, + int line) +{ + if (!condition) + { + Assert("Condition was not true at %s:%d\n", + file, + line); + } +} + +void BaseTest::IsFalse(bool condition, + const char* file, + int line) +{ + if (condition) + { + Assert("Condition was not false at %s:%d\n", + file, + line); + } +} + +void BaseTest::AreEqual(int expected, + int actual, + const char* file, + int line) +{ + if (actual != expected) + { + Assert("Expected %d/0x%.08x was %d/0x%.08x at %s:%d\n", + expected, + expected, + actual, + actual, + file, + line); + } +} + +void BaseTest::AreEqual(const std::string& expected, + const std::string& actual, + const char* file, + int line) +{ + if (actual != expected) + { + Assert("Expected '%s' was '%s' at %s:%d\n", + expected.c_str(), + actual.c_str(), + file, + line); + } +} + +void BaseTest::AreNotEqual(int expected, + int actual, + const char* file, + int line) +{ + if (actual == expected) + { + Assert("Actual value expected to be different from %d/0x%.08x at %s:%d\n", + expected, + expected, + file, + line); + } +} + +void BaseTest::Fail() +{ + Failed = true; +} + +class BaseTestList : public std::vector +{ +public: + ~BaseTestList() + { + for ( size_t i = 0; i < size(); i++ ) + { + delete (*this)[i]; + } + } +}; + +class TestDispatcher +{ +public: + void Run() + { + int numberOfFailedTests = 0; + BaseTestList tests; + GetTests(tests); + for (size_t i = 0; i < tests.size(); i++) + { + try + { + BaseTest& test = *tests[i]; + test.Run(); + if (test.Failed) + numberOfFailedTests++; + } + catch ( Exception& ex ) + { + printf ( "%s\n", (*ex).c_str () ); + numberOfFailedTests++; + } + catch ( XMLException& ex ) + { + printf ( "%s\n", (*ex).c_str () ); + numberOfFailedTests++; + } + } + + if (numberOfFailedTests > 0) + printf("%d tests failed\n", + numberOfFailedTests); + else + printf("All tests succeeded\n"); + } + +private: + void GetTests ( BaseTestList& tests ) + { + tests.push_back(new ProjectTest()); + tests.push_back(new ModuleTest()); + tests.push_back(new DefineTest()); + tests.push_back(new IncludeTest()); + tests.push_back(new InvokeTest()); + tests.push_back(new LinkerFlagTest()); + tests.push_back(new IfTest()); + tests.push_back(new FunctionTest()); + tests.push_back(new SourceFileTest()); + tests.push_back(new CDFileTest()); + tests.push_back(new SymbolTest()); + tests.push_back(new CompilationUnitTest()); + } +}; + + +int main(int argc, + char** argv) +{ + InitializeEnvironment (); + TestDispatcher testDispatcher; + testDispatcher.Run(); + return 0; +}; diff --git a/tools/rbuild/tests/cdfiletest.cpp b/tools/rbuild/tests/cdfiletest.cpp new file mode 100644 index 00000000000..56cf6740191 --- /dev/null +++ b/tools/rbuild/tests/cdfiletest.cpp @@ -0,0 +1,40 @@ +/* + * Copyright (C) 2005 Casper S. Hornstrup + * + * This program is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation; either version 2 of the License, or + * (at your option) any later version. + * + * This program 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 General Public License for more details. + * + * You should have received a copy of the GNU General Public License along + * with this program; if not, write to the Free Software Foundation, Inc., + * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. + */ +#include "test.h" + +using std::string; + +void CDFileTest::Run() +{ + string projectFilename ( RBUILD_BASE "tests/data/cdfile.xml" ); + Configuration configuration; + Project project ( configuration, projectFilename ); + ARE_EQUAL ( 3, project.cdfiles.size () ); + + CDFile& cdfile1 = *project.cdfiles[0]; + ARE_EQUAL("dir1", cdfile1.base); + ARE_EQUAL("ReadMe1.txt", cdfile1.nameoncd); + + CDFile& cdfile2 = *project.cdfiles[1]; + ARE_EQUAL("dir2", cdfile2.base); + ARE_EQUAL("readme2.txt", cdfile2.nameoncd); + + CDFile& cdfile3 = *project.cdfiles[2]; + //ARE_EQUAL("", cdfile3.base); + ARE_EQUAL("readme3.txt", cdfile3.nameoncd); +} diff --git a/tools/rbuild/tests/compilationunittest.cpp b/tools/rbuild/tests/compilationunittest.cpp new file mode 100644 index 00000000000..a74d99d0bf3 --- /dev/null +++ b/tools/rbuild/tests/compilationunittest.cpp @@ -0,0 +1,49 @@ +/* + * Copyright (C) 2005 Casper S. Hornstrup + * + * This program is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation; either version 2 of the License, or + * (at your option) any later version. + * + * This program 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 General Public License for more details. + * + * You should have received a copy of the GNU General Public License along + * with this program; if not, write to the Free Software Foundation, Inc., + * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. + */ +#include "test.h" + +using std::string; + +void CompilationUnitTest::Run() +{ + string projectFilename ( RBUILD_BASE "tests/data/compilationunit.xml" ); + Configuration configuration; + Project project ( configuration, projectFilename ); + ARE_EQUAL ( 1, project.modules.size () ); + + Module& module1 = *project.modules[0]; + IS_TRUE ( module1.type == BuildTool ); + + ARE_EQUAL ( 3, module1.non_if_data.files.size()); + ARE_EQUAL ( "dir1" SSEP "file1.c", module1.non_if_data.files[0]->name ); + ARE_EQUAL ( "dir1" SSEP "file2.c", module1.non_if_data.files[1]->name ); + ARE_EQUAL ( "dir1" SSEP "file3.c", module1.non_if_data.files[2]->name ); + + ARE_EQUAL ( 2, module1.non_if_data.compilationUnits.size () ); + + CompilationUnit& compilationUnit1 = *module1.non_if_data.compilationUnits[0]; + ARE_EQUAL ( 2, compilationUnit1.files.size () ); + + ARE_EQUAL ( "dir1" SSEP "file1.c", compilationUnit1.files[0]->name ); + ARE_EQUAL ( "dir1" SSEP "file2.c", compilationUnit1.files[1]->name ); + + CompilationUnit& compilationUnit2 = *module1.non_if_data.compilationUnits[1]; + ARE_EQUAL ( 1, compilationUnit2.files.size () ); + + ARE_EQUAL ( "dir1" SSEP "file3.c", compilationUnit2.files[0]->name ); +} diff --git a/tools/rbuild/tests/data/automaticdependency.rbuild b/tools/rbuild/tests/data/automaticdependency.rbuild new file mode 100644 index 00000000000..6612ba36a02 --- /dev/null +++ b/tools/rbuild/tests/data/automaticdependency.rbuild @@ -0,0 +1,16 @@ + + + + + + + + + . + sourcefile1.c + + + + + + diff --git a/tools/rbuild/tests/data/automaticdependency_include.rbuild b/tools/rbuild/tests/data/automaticdependency_include.rbuild new file mode 100644 index 00000000000..0fda1c24f56 --- /dev/null +++ b/tools/rbuild/tests/data/automaticdependency_include.rbuild @@ -0,0 +1,17 @@ + + + + + + + + + . + sourcefile1 + sourcefile_include.c + + + + + + diff --git a/tools/rbuild/tests/data/cdfile.rbuild b/tools/rbuild/tests/data/cdfile.rbuild new file mode 100644 index 00000000000..42c4a71a157 --- /dev/null +++ b/tools/rbuild/tests/data/cdfile.rbuild @@ -0,0 +1,9 @@ + + + + + readme1.txt + readme2.txt + readme3.txt + + diff --git a/tools/rbuild/tests/data/compilationunit.rbuild b/tools/rbuild/tests/data/compilationunit.rbuild new file mode 100644 index 00000000000..3fb03d2ef0f --- /dev/null +++ b/tools/rbuild/tests/data/compilationunit.rbuild @@ -0,0 +1,13 @@ + + + + + + + file1.c + file2.c + + file3.c + + + diff --git a/tools/rbuild/tests/data/define.rbuild b/tools/rbuild/tests/data/define.rbuild new file mode 100644 index 00000000000..2dc1fa334cd --- /dev/null +++ b/tools/rbuild/tests/data/define.rbuild @@ -0,0 +1,10 @@ + + + + value1 + + + value2 + + + diff --git a/tools/rbuild/tests/data/if.rbuild b/tools/rbuild/tests/data/if.rbuild new file mode 100644 index 00000000000..415d1bf98cd --- /dev/null +++ b/tools/rbuild/tests/data/if.rbuild @@ -0,0 +1,14 @@ + + + + + compilerflag1 + + + + compilerflag2 + file1.c + + file2.c + + diff --git a/tools/rbuild/tests/data/include.rbuild b/tools/rbuild/tests/data/include.rbuild new file mode 100644 index 00000000000..62ac296fc2a --- /dev/null +++ b/tools/rbuild/tests/data/include.rbuild @@ -0,0 +1,15 @@ + + + + include1 + + + include2 + + + + + include3 + + + diff --git a/tools/rbuild/tests/data/invoke.rbuild b/tools/rbuild/tests/data/invoke.rbuild new file mode 100644 index 00000000000..39d8a65674f --- /dev/null +++ b/tools/rbuild/tests/data/invoke.rbuild @@ -0,0 +1,14 @@ + + + + + + file1.c + + + file1.c + + + + + diff --git a/tools/rbuild/tests/data/linkerflag.rbuild b/tools/rbuild/tests/data/linkerflag.rbuild new file mode 100644 index 00000000000..3abff97e74f --- /dev/null +++ b/tools/rbuild/tests/data/linkerflag.rbuild @@ -0,0 +1,8 @@ + + + + -lgcc1 + + -lgcc2 + + diff --git a/tools/rbuild/tests/data/module.rbuild b/tools/rbuild/tests/data/module.rbuild new file mode 100644 index 00000000000..905affd95a7 --- /dev/null +++ b/tools/rbuild/tests/data/module.rbuild @@ -0,0 +1,18 @@ + + + + + + file1.c + file2.c + + + + + module1 + module1 + file3.c + file4.c + + + diff --git a/tools/rbuild/tests/data/project.rbuild b/tools/rbuild/tests/data/project.rbuild new file mode 100644 index 00000000000..30cb97f060a --- /dev/null +++ b/tools/rbuild/tests/data/project.rbuild @@ -0,0 +1,12 @@ + + + + + + + + + + + + diff --git a/tools/rbuild/tests/data/sourcefile1.c b/tools/rbuild/tests/data/sourcefile1.c new file mode 100644 index 00000000000..28af7778e50 --- /dev/null +++ b/tools/rbuild/tests/data/sourcefile1.c @@ -0,0 +1,13 @@ +/* + * ReactOS kernel + */ +/* $Id: main.c 12694 2005-01-01 11:47:33Z hbirr $ + * FILE: ntoskrnl/ke/main.c + */ + +/* INCLUDES *****************************************************************/ + +#include +#include + +/* GLOBALS *******************************************************************/ diff --git a/tools/rbuild/tests/data/sourcefile1/sourcefile1_header3.h b/tools/rbuild/tests/data/sourcefile1/sourcefile1_header3.h new file mode 100644 index 00000000000..40a8c178f10 --- /dev/null +++ b/tools/rbuild/tests/data/sourcefile1/sourcefile1_header3.h @@ -0,0 +1 @@ +/* empty */ diff --git a/tools/rbuild/tests/data/sourcefile1/sourcefile_includenext.h b/tools/rbuild/tests/data/sourcefile1/sourcefile_includenext.h new file mode 100644 index 00000000000..40a8c178f10 --- /dev/null +++ b/tools/rbuild/tests/data/sourcefile1/sourcefile_includenext.h @@ -0,0 +1 @@ +/* empty */ diff --git a/tools/rbuild/tests/data/sourcefile1_header1.h b/tools/rbuild/tests/data/sourcefile1_header1.h new file mode 100644 index 00000000000..c4261ef88cb --- /dev/null +++ b/tools/rbuild/tests/data/sourcefile1_header1.h @@ -0,0 +1 @@ +#include diff --git a/tools/rbuild/tests/data/sourcefile1_header2.h b/tools/rbuild/tests/data/sourcefile1_header2.h new file mode 100644 index 00000000000..212537b619a --- /dev/null +++ b/tools/rbuild/tests/data/sourcefile1_header2.h @@ -0,0 +1,3 @@ +#include "sourcefile1/sourcefile1_header3.h" +#include +#include diff --git a/tools/rbuild/tests/data/sourcefile1_recurse.h b/tools/rbuild/tests/data/sourcefile1_recurse.h new file mode 100644 index 00000000000..0ce390cf892 --- /dev/null +++ b/tools/rbuild/tests/data/sourcefile1_recurse.h @@ -0,0 +1,2 @@ +#include +#include diff --git a/tools/rbuild/tests/data/sourcefile_include.c b/tools/rbuild/tests/data/sourcefile_include.c new file mode 100644 index 00000000000..8ee9670f406 --- /dev/null +++ b/tools/rbuild/tests/data/sourcefile_include.c @@ -0,0 +1,2 @@ +# include +#include diff --git a/tools/rbuild/tests/data/sourcefile_include.h b/tools/rbuild/tests/data/sourcefile_include.h new file mode 100644 index 00000000000..40a8c178f10 --- /dev/null +++ b/tools/rbuild/tests/data/sourcefile_include.h @@ -0,0 +1 @@ +/* empty */ diff --git a/tools/rbuild/tests/data/sourcefile_includenext.h b/tools/rbuild/tests/data/sourcefile_includenext.h new file mode 100644 index 00000000000..0f4f8e730b5 --- /dev/null +++ b/tools/rbuild/tests/data/sourcefile_includenext.h @@ -0,0 +1 @@ +#include_next diff --git a/tools/rbuild/tests/data/symbol.rbuild b/tools/rbuild/tests/data/symbol.rbuild new file mode 100644 index 00000000000..7f08a286e6b --- /dev/null +++ b/tools/rbuild/tests/data/symbol.rbuild @@ -0,0 +1,10 @@ + + + + + + HeapAlloc@12 + LdrAccessResource@16 + + + diff --git a/tools/rbuild/tests/definetest.cpp b/tools/rbuild/tests/definetest.cpp new file mode 100644 index 00000000000..6af2d872381 --- /dev/null +++ b/tools/rbuild/tests/definetest.cpp @@ -0,0 +1,39 @@ +/* + * Copyright (C) 2005 Casper S. Hornstrup + * + * This program is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation; either version 2 of the License, or + * (at your option) any later version. + * + * This program 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 General Public License for more details. + * + * You should have received a copy of the GNU General Public License along + * with this program; if not, write to the Free Software Foundation, Inc., + * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. + */ +#include "test.h" + +using std::string; + +void DefineTest::Run() +{ + string projectFilename ( RBUILD_BASE "tests/data/define.xml" ); + Configuration configuration; + Project project ( configuration, projectFilename ); + ARE_EQUAL(1, project.non_if_data.defines.size()); + Define& define1 = *project.non_if_data.defines[0]; + ARE_EQUAL("define1", define1.name); + ARE_EQUAL("value1", define1.value); + + ARE_EQUAL(1, project.modules.size()); + Module& module1 = *project.modules[0]; + + ARE_EQUAL(1, module1.non_if_data.defines.size()); + Define& define2 = *module1.non_if_data.defines[0]; + ARE_EQUAL("define2", define2.name); + ARE_EQUAL("value2", define2.value); +} diff --git a/tools/rbuild/tests/functiontest.cpp b/tools/rbuild/tests/functiontest.cpp new file mode 100644 index 00000000000..7a60d33f114 --- /dev/null +++ b/tools/rbuild/tests/functiontest.cpp @@ -0,0 +1,28 @@ +/* + * Copyright (C) 2005 Casper S. Hornstrup + * + * This program is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation; either version 2 of the License, or + * (at your option) any later version. + * + * This program 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 General Public License for more details. + * + * You should have received a copy of the GNU General Public License along + * with this program; if not, write to the Free Software Foundation, Inc., + * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. + */ +#include "test.h" + +using std::string; + +void FunctionTest::Run () +{ + string fixedupFilename = NormalizeFilename ( "." SSEP "dir1" SSEP "dir2" SSEP ".." SSEP "filename.txt" ); + ARE_EQUAL ( "dir1" SSEP "filename.txt", fixedupFilename ); + ARE_EQUAL ( "file.txt", GetFilename ( "file.txt" ) ); + ARE_EQUAL ( "file.txt", GetFilename ( "dir" SSEP "file.txt" ) ); +} diff --git a/tools/rbuild/tests/iftest.cpp b/tools/rbuild/tests/iftest.cpp new file mode 100644 index 00000000000..4e8574d2c4d --- /dev/null +++ b/tools/rbuild/tests/iftest.cpp @@ -0,0 +1,68 @@ +/* + * Copyright (C) 2005 Casper S. Hornstrup + * + * This program is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation; either version 2 of the License, or + * (at your option) any later version. + * + * This program 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 General Public License for more details. + * + * You should have received a copy of the GNU General Public License along + * with this program; if not, write to the Free Software Foundation, Inc., + * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. + */ +#include "test.h" + +using std::string; + +void +IfTest::TestProjectIf ( Project& project ) +{ + ARE_EQUAL ( 1, project.non_if_data.ifs.size () ); + If& if1 = *project.non_if_data.ifs[0]; + ARE_EQUAL ( "VAR1", if1.property ); + ARE_EQUAL ( "value1", if1.value ); + + ARE_EQUAL ( 1, if1.data.compilerFlags.size () ); + CompilerFlag& compilerFlag1 = *if1.data.compilerFlags[0]; + ARE_EQUAL( "compilerflag1", compilerFlag1.flag ); +} + +void +IfTest::TestModuleIf ( Project& project ) +{ + ARE_EQUAL ( 1, project.modules.size () ); + Module& module1 = *project.modules[0]; + + ARE_EQUAL ( 1, module1.non_if_data.ifs.size () ); + If& if1 = *module1.non_if_data.ifs[0]; + ARE_EQUAL ( "VAR2", if1.property ); + ARE_EQUAL ( "value2", if1.value ); + + ARE_EQUAL ( 1, if1.data.files.size () ); + File& file1 = *if1.data.files[0]; + ARE_EQUAL( SSEP "file1.c", file1.name ); + + ARE_EQUAL ( 1, module1.non_if_data.files.size () ); + File& file2 = *module1.non_if_data.files[0]; + ARE_EQUAL( SSEP "file2.c", file2.name ); + + ARE_EQUAL ( 1, if1.data.compilerFlags.size () ); + CompilerFlag& compilerFlag2 = *if1.data.compilerFlags[0]; + ARE_EQUAL( "compilerflag2", compilerFlag2.flag ); +} + +void +IfTest::Run () +{ + string projectFilename ( RBUILD_BASE "tests/data/if.xml" ); + Configuration configuration; + Project project ( configuration, projectFilename ); + + TestProjectIf ( project ); + TestModuleIf ( project ); +} diff --git a/tools/rbuild/tests/includetest.cpp b/tools/rbuild/tests/includetest.cpp new file mode 100644 index 00000000000..d31aa081ff3 --- /dev/null +++ b/tools/rbuild/tests/includetest.cpp @@ -0,0 +1,42 @@ +/* + * Copyright (C) 2005 Casper S. Hornstrup + * + * This program is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation; either version 2 of the License, or + * (at your option) any later version. + * + * This program 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 General Public License for more details. + * + * You should have received a copy of the GNU General Public License along + * with this program; if not, write to the Free Software Foundation, Inc., + * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. + */ +#include "test.h" + +using std::string; + +void IncludeTest::Run() +{ + string projectFilename ( RBUILD_BASE "tests/data/include.xml" ); + Configuration configuration; + Project project ( configuration, projectFilename ); + ARE_EQUAL(1, project.non_if_data.includes.size()); + Include& include1 = *project.non_if_data.includes[0]; + ARE_EQUAL("include1", include1.directory); + + ARE_EQUAL(2, project.modules.size()); + Module& module1 = *project.modules[0]; + Module& module2 = *project.modules[1]; + + ARE_EQUAL(1, module1.non_if_data.includes.size()); + Include& include2 = *module1.non_if_data.includes[0]; + ARE_EQUAL("include2", include2.directory); + + ARE_EQUAL(1, module2.non_if_data.includes.size()); + Include& include3 = *module2.non_if_data.includes[0]; + ARE_EQUAL(FixSeparator("dir1/include3"), include3.directory); +} diff --git a/tools/rbuild/tests/invoketest.cpp b/tools/rbuild/tests/invoketest.cpp new file mode 100644 index 00000000000..f1aec754ec1 --- /dev/null +++ b/tools/rbuild/tests/invoketest.cpp @@ -0,0 +1,37 @@ +/* + * Copyright (C) 2005 Casper S. Hornstrup + * + * This program is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation; either version 2 of the License, or + * (at your option) any later version. + * + * This program 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 General Public License for more details. + * + * You should have received a copy of the GNU General Public License along + * with this program; if not, write to the Free Software Foundation, Inc., + * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. + */ +#include "test.h" + +using std::string; + +void InvokeTest::Run() +{ + string projectFilename ( RBUILD_BASE "tests/data/invoke.xml" ); + Configuration configuration; + Project project ( configuration, projectFilename ); + ARE_EQUAL(1, project.modules.size()); + + Module& module1 = *project.modules[0]; + ARE_EQUAL(1, module1.invocations.size()); + + Invoke& invoke1 = *module1.invocations[0]; + ARE_EQUAL(1, invoke1.output.size()); + + InvokeFile& file1 = *invoke1.output[0]; + ARE_EQUAL(FixSeparator("dir1/file1.c"), file1.name); +} diff --git a/tools/rbuild/tests/linkerflagtest.cpp b/tools/rbuild/tests/linkerflagtest.cpp new file mode 100644 index 00000000000..6040a4e35bf --- /dev/null +++ b/tools/rbuild/tests/linkerflagtest.cpp @@ -0,0 +1,37 @@ +/* + * Copyright (C) 2005 Casper S. Hornstrup + * + * This program is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation; either version 2 of the License, or + * (at your option) any later version. + * + * This program 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 General Public License for more details. + * + * You should have received a copy of the GNU General Public License along + * with this program; if not, write to the Free Software Foundation, Inc., + * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. + */ +#include "test.h" + +using std::string; + +void LinkerFlagTest::Run() +{ + string projectFilename ( RBUILD_BASE "tests/data/linkerflag.xml" ); + Configuration configuration; + Project project ( configuration, projectFilename ); + ARE_EQUAL(1, project.linkerFlags.size()); + LinkerFlag& linkerFlag1 = *project.linkerFlags[0]; + ARE_EQUAL("-lgcc1", linkerFlag1.flag); + + ARE_EQUAL(1, project.modules.size()); + Module& module1 = *project.modules[0]; + + ARE_EQUAL(1, module1.linkerFlags.size()); + LinkerFlag& linkerFlag2 = *module1.linkerFlags[0]; + ARE_EQUAL("-lgcc2", linkerFlag2.flag); +} diff --git a/tools/rbuild/tests/moduletest.cpp b/tools/rbuild/tests/moduletest.cpp new file mode 100644 index 00000000000..4bf0abecd18 --- /dev/null +++ b/tools/rbuild/tests/moduletest.cpp @@ -0,0 +1,55 @@ +/* + * Copyright (C) 2005 Casper S. Hornstrup + * + * This program is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation; either version 2 of the License, or + * (at your option) any later version. + * + * This program 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 General Public License for more details. + * + * You should have received a copy of the GNU General Public License along + * with this program; if not, write to the Free Software Foundation, Inc., + * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. + */ +#include "test.h" + +using std::string; + +void ModuleTest::Run() +{ + string projectFilename ( RBUILD_BASE "tests/data/module.xml" ); + Configuration configuration; + Project project ( configuration, projectFilename ); + ARE_EQUAL(2, project.modules.size()); + + Module& module1 = *project.modules[0]; + IS_TRUE(module1.type == BuildTool); + + ARE_EQUAL(2, module1.non_if_data.files.size()); + ARE_EQUAL("dir1" SSEP "file1.c", module1.non_if_data.files[0]->name); + ARE_EQUAL("dir1" SSEP "file2.c", module1.non_if_data.files[1]->name); + + ARE_EQUAL(0, module1.non_if_data.libraries.size()); + + Module& module2 = *project.modules[1]; + IS_TRUE(module2.type == KernelModeDLL); + ARE_EQUAL("reactos", module2.installBase); + ARE_EQUAL("module2.ext", module2.installName); + + ARE_EQUAL(2, module2.non_if_data.files.size()); + ARE_EQUAL("dir2" SSEP "file3.c", module2.non_if_data.files[0]->name); + ARE_EQUAL("dir2" SSEP "file4.c", module2.non_if_data.files[1]->name); + + ARE_EQUAL(1, module2.non_if_data.libraries.size()); + Library& library1 = *module2.non_if_data.libraries[0]; + ARE_EQUAL("module1", library1.name); + + ARE_EQUAL(1, module2.dependencies.size()); + Dependency& module1dependency = *module2.dependencies[0]; + IS_NOT_NULL(module1dependency.dependencyModule); + ARE_EQUAL("module1", module1dependency.dependencyModule->name); +} diff --git a/tools/rbuild/tests/projecttest.cpp b/tools/rbuild/tests/projecttest.cpp new file mode 100644 index 00000000000..9e188653b7a --- /dev/null +++ b/tools/rbuild/tests/projecttest.cpp @@ -0,0 +1,28 @@ +/* + * Copyright (C) 2005 Casper S. Hornstrup + * + * This program is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation; either version 2 of the License, or + * (at your option) any later version. + * + * This program 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 General Public License for more details. + * + * You should have received a copy of the GNU General Public License along + * with this program; if not, write to the Free Software Foundation, Inc., + * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. + */ +#include "test.h" + +using std::string; + +void ProjectTest::Run() +{ + string projectFilename ( RBUILD_BASE "tests/data/project.xml" ); + Configuration configuration; + Project project ( configuration, projectFilename ); + ARE_EQUAL(2, project.modules.size()); +} diff --git a/tools/rbuild/tests/sourcefiletest.cpp b/tools/rbuild/tests/sourcefiletest.cpp new file mode 100644 index 00000000000..f7dfb23d604 --- /dev/null +++ b/tools/rbuild/tests/sourcefiletest.cpp @@ -0,0 +1,91 @@ +/* + * Copyright (C) 2005 Casper S. Hornstrup + * + * This program is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation; either version 2 of the License, or + * (at your option) any later version. + * + * This program 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 General Public License for more details. + * + * You should have received a copy of the GNU General Public License along + * with this program; if not, write to the Free Software Foundation, Inc., + * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. + */ +#include "test.h" + +using std::string; + +bool +SourceFileTest::IsParentOf ( const SourceFile* parent, + const SourceFile* child ) +{ + size_t i; + for ( i = 0; i < child->parents.size (); i++ ) + { + if ( child->parents[i] != NULL ) + { + if ( child->parents[i] == parent ) + { + return true; + } + } + } + for ( i = 0; i < child->parents.size (); i++ ) + { + if ( child->parents[i] != NULL ) + { + if ( IsParentOf ( parent, + child->parents[i] ) ) + { + return true; + } + } + } + return false; +} + +void +SourceFileTest::IncludeTest () +{ + const string projectFilename = RBUILD_BASE "tests" SSEP "data" SSEP "automaticdependency_include.xml"; + Configuration configuration; + Project project ( configuration, projectFilename ); + AutomaticDependency automaticDependency ( project ); + automaticDependency.ParseFiles (); + ARE_EQUAL( 4, automaticDependency.sourcefile_map.size () ); + const SourceFile* include = automaticDependency.RetrieveFromCache ( RBUILD_BASE "tests" SSEP "data" SSEP "sourcefile_include.h" ); + IS_NOT_NULL( include ); + const SourceFile* includenext = automaticDependency.RetrieveFromCache ( RBUILD_BASE "tests" SSEP "data" SSEP "sourcefile1" SSEP "sourcefile_includenext.h" ); + IS_NOT_NULL( includenext ); +} + +void +SourceFileTest::FullParseTest () +{ + const string projectFilename = RBUILD_BASE "tests" SSEP "data" SSEP "automaticdependency.xml"; + Configuration configuration; + Project project ( configuration, projectFilename ); + AutomaticDependency automaticDependency ( project ); + automaticDependency.ParseFiles (); + ARE_EQUAL( 5, automaticDependency.sourcefile_map.size () ); + const SourceFile* header1 = automaticDependency.RetrieveFromCache ( RBUILD_BASE "tests" SSEP "data" SSEP "sourcefile1_header1.h" ); + IS_NOT_NULL( header1 ); + const SourceFile* recurse = automaticDependency.RetrieveFromCache ( RBUILD_BASE "tests" SSEP "data" SSEP "sourcefile1_recurse.h" ); + IS_NOT_NULL( recurse ); + IS_TRUE( IsParentOf ( header1, + recurse ) ); + IS_FALSE( IsParentOf ( recurse, + header1 ) ); + +} + +void +SourceFileTest::Run () +{ + IncludeTest (); + FullParseTest (); +} diff --git a/tools/rbuild/tests/symboltest.cpp b/tools/rbuild/tests/symboltest.cpp new file mode 100644 index 00000000000..e9259590237 --- /dev/null +++ b/tools/rbuild/tests/symboltest.cpp @@ -0,0 +1,43 @@ +/* + * Copyright (C) 2005 Casper S. Hornstrup + * + * This program is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation; either version 2 of the License, or + * (at your option) any later version. + * + * This program 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 General Public License for more details. + * + * You should have received a copy of the GNU General Public License along + * with this program; if not, write to the Free Software Foundation, Inc., + * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. + */ +#include "test.h" + +using std::string; + +void SymbolTest::Run() +{ + string projectFilename ( RBUILD_BASE "tests/data/symbol.xml" ); + Configuration configuration; + Project project ( configuration, projectFilename ); + + ARE_EQUAL ( 1, project.modules.size () ); + Module& module1 = *project.modules[0]; + + ARE_EQUAL ( 1, module1.stubbedComponents.size () ); + StubbedComponent& component1 = *module1.stubbedComponents[0]; + ARE_EQUAL ( "ntdll.dll", component1.name ); + + ARE_EQUAL ( 2, component1.symbols.size () ); + StubbedSymbol& symbol1 = *component1.symbols[0]; + ARE_EQUAL ( "HeapAlloc@12", symbol1.symbol ); + ARE_EQUAL ( "RtlAllocateHeap", symbol1.newname ); + + StubbedSymbol& symbol2 = *component1.symbols[1]; + ARE_EQUAL ( "LdrAccessResource@16", symbol2.symbol ); + ARE_EQUAL ( "LdrAccessResource", symbol2.newname ); +} diff --git a/tools/rbuild/testsupportcode.cpp b/tools/rbuild/testsupportcode.cpp new file mode 100644 index 00000000000..acd062e5f4f --- /dev/null +++ b/tools/rbuild/testsupportcode.cpp @@ -0,0 +1,413 @@ +/* + * Copyright (C) 2005 Casper S. Hornstrup + * + * This program is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation; either version 2 of the License, or + * (at your option) any later version. + * + * This program 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 General Public License for more details. + * + * You should have received a copy of the GNU General Public License along + * with this program; if not, write to the Free Software Foundation, Inc., + * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. + */ +#include "pch.h" +#include + +#include "rbuild.h" + +using std::string; +using std::vector; + +static std::string +GetFilename ( const std::string& filename ) +{ + size_t index = filename.find_last_of ( cSep ); + if ( index == string::npos ) + return filename; + else + return filename.substr ( index + 1, filename.length () - index ); +} + +TestSupportCode::TestSupportCode ( const Project& project ) + : project ( project ) +{ +} + +TestSupportCode::~TestSupportCode () +{ +} + +bool +TestSupportCode::IsTestModule ( const Module& module ) +{ + return module.type == Test; +} + +void +TestSupportCode::GenerateTestSupportCode ( bool verbose ) +{ + for( std::map::const_iterator p = project.modules.begin(); p != project.modules.end(); ++ p ) + { + if ( IsTestModule ( *p->second ) ) + { + GenerateTestSupportCodeForModule ( *p->second, + verbose ); + } + } +} + +void +TestSupportCode::GenerateTestSupportCodeForModule ( Module& module, + bool verbose ) +{ + if ( verbose ) + { + printf ( "\nGenerating test support code for %s", + module.name.c_str () ); + } + + WriteHooksFile ( module ); + WriteStubsFile ( module ); + WriteStartupFile ( module ); +} + +string +TestSupportCode::GetHooksFilename ( Module& module ) +{ + return NormalizeFilename ( Environment::GetIntermediatePath () + sSep + module.output->relative_path + sSep + "_hooks.c" ); +} + +char* +TestSupportCode::WriteStubbedSymbolToHooksFile ( char* buffer, + const StubbedComponent& component, + const StubbedSymbol& symbol ) +{ + buffer = buffer + sprintf ( buffer, + " {\"%s\", \"%s\", NULL, NULL, NULL},\n", + component.name.c_str (), + symbol.newname.c_str () ); + return buffer; +} + +char* +TestSupportCode::WriteStubbedComponentToHooksFile ( char* buffer, + const StubbedComponent& component ) +{ + for ( size_t i = 0; i < component.symbols.size () ; i++ ) + buffer = WriteStubbedSymbolToHooksFile ( buffer, + component, + *component.symbols[i] ); + return buffer; +} + +void +TestSupportCode::WriteHooksFile ( Module& module ) +{ + char* buf; + char* s; + + buf = (char*) malloc ( 50*1024 ); + if ( buf == NULL ) + throw OutOfMemoryException (); + + s = buf; + s = s + sprintf ( s, "/* This file is automatically generated. */\n" ); + s = s + sprintf ( s, "#include \n" ); + s = s + sprintf ( s, "#include \"regtests.h\"\n" ); + s = s + sprintf ( s, "\n" ); + s = s + sprintf ( s, "_API_DESCRIPTION ExternalDependencies[] =\n" ); + s = s + sprintf ( s, "{\n" ); + + int symbolCount = 0; + for ( size_t i = 0; i < module.stubbedComponents.size () ; i++ ) + { + s = WriteStubbedComponentToHooksFile ( s, + *module.stubbedComponents[i] ); + symbolCount += module.stubbedComponents[i]->symbols.size (); + } + + s = s + sprintf ( s, "};\n" ); + s = s + sprintf ( s, "\n" ); + s = s + sprintf ( s, "#define ExternalDependencyCount %d\n", symbolCount ); + s = s + sprintf ( s, "ULONG MaxExternalDependency = ExternalDependencyCount - 1;\n" ); + s = s + sprintf ( s, "\n" ); + + FileSupportCode::WriteIfChanged ( buf, GetHooksFilename ( module ) ); + + free ( buf ); +} + +string +TestSupportCode::GetStubsFilename ( Module& module ) +{ + return NormalizeFilename ( Environment::GetIntermediatePath () + sSep + module.output->relative_path + sSep + "_stubs.S" ); +} + +string +GetLinkerSymbol ( const StubbedSymbol& symbol ) +{ + if (symbol.symbol[0] == '@') + return symbol.symbol; + else + return "_" + symbol.symbol; +} + +string +GetLinkerImportSymbol ( const StubbedSymbol& symbol ) +{ + if (symbol.symbol[0] == '@') + return "__imp_" + symbol.symbol; + else + return "__imp__" + symbol.symbol; +} + +string +GetIndirectCallTargetSymbol ( const StubbedSymbol& symbol ) +{ + return GetLinkerSymbol ( symbol ) + "_"; +} + +char* +TestSupportCode::WriteStubbedSymbolToStubsFile ( char* buffer, + const StubbedComponent& component, + const StubbedSymbol& symbol, + int stubIndex ) +{ + string linkerSymbol = GetLinkerSymbol ( symbol ); + string linkerImportSymbol = GetLinkerImportSymbol ( symbol ); + string indirectCallTargetSymbol = GetIndirectCallTargetSymbol ( symbol ); + buffer = buffer + sprintf ( buffer, + ".globl %s\n", + linkerSymbol.c_str () ); + buffer = buffer + sprintf ( buffer, + ".globl %s\n", + linkerImportSymbol.c_str () ); + buffer = buffer + sprintf ( buffer, + "%s:\n", + linkerSymbol.c_str () ); + buffer = buffer + sprintf ( buffer, + "%s:\n", + linkerImportSymbol.c_str () ); + buffer = buffer + sprintf ( buffer, + " .long %s\n", + indirectCallTargetSymbol.c_str () ); + buffer = buffer + sprintf ( buffer, + "%s:\n", + indirectCallTargetSymbol.c_str () ); + buffer = buffer + sprintf ( buffer, + " pushl $%d\n", + stubIndex ); + buffer = buffer + sprintf ( buffer, + " jmp passthrough\n" ); + buffer = buffer + sprintf ( buffer, "\n" ); + return buffer; +} + +char* +TestSupportCode::WriteStubbedComponentToStubsFile ( char* buffer, + const StubbedComponent& component, + int* stubIndex ) +{ + for ( size_t i = 0; i < component.symbols.size () ; i++ ) + buffer = WriteStubbedSymbolToStubsFile ( buffer, + component, + *component.symbols[i], + (*stubIndex)++ ); + return buffer; +} + +void +TestSupportCode::WriteStubsFile ( Module& module ) +{ + char* buf; + char* s; + + buf = (char*) malloc ( 512*1024 ); + if ( buf == NULL ) + throw OutOfMemoryException (); + + s = buf; + s = s + sprintf ( s, "/* This file is automatically generated. */\n" ); + s = s + sprintf ( s, "passthrough:\n" ); + s = s + sprintf ( s, " call _FrameworkGetHook@4\n" ); + s = s + sprintf ( s, " test %%eax, %%eax\n" ); + s = s + sprintf ( s, " je .return\n" ); + s = s + sprintf ( s, " jmp *%%eax\n" ); + s = s + sprintf ( s, ".return:\n" ); + s = s + sprintf ( s, " /* This will most likely corrupt the stack */\n" ); + s = s + sprintf ( s, " ret\n" ); + s = s + sprintf ( s, "\n" ); + + int stubIndex = 0; + for ( size_t i = 0; i < module.stubbedComponents.size () ; i++ ) + { + s = WriteStubbedComponentToStubsFile ( s, + *module.stubbedComponents[i], + &stubIndex ); + } + + FileSupportCode::WriteIfChanged ( buf, GetStubsFilename ( module ) ); + + free ( buf ); +} + +string +TestSupportCode::GetStartupFilename ( Module& module ) +{ + return NormalizeFilename ( Environment::GetIntermediatePath () + sSep + module.output->relative_path + sSep + "_startup.c" ); +} + +bool +TestSupportCode::IsUnknownCharacter ( char ch ) +{ + if ( ch >= 'a' && ch <= 'z' ) + return false; + if ( ch >= 'A' && ch <= 'Z' ) + return false; + if ( ch >= '0' && ch <= '9' ) + return false; + return true; +} + +string +TestSupportCode::GetTestDispatcherName ( string filename ) +{ + string filenamePart = ReplaceExtension ( GetFilename ( filename ), "" ); + if ( filenamePart.length () > 0 ) + filenamePart[0] = toupper ( filenamePart[0] ); + for ( size_t i = 1; i < filenamePart.length (); i++ ) + { + if ( IsUnknownCharacter ( filenamePart[i] ) ) + filenamePart[i] = '_'; + else + filenamePart[i] = tolower ( filenamePart[i] ); + } + return filenamePart + "Test"; +} + +bool +TestSupportCode::IsTestFile ( string& filename ) const +{ + if ( stricmp ( GetFilename ( filename ).c_str (), "setup.c" ) == 0 ) + return false; + return true; +} + +void +TestSupportCode::GetSourceFilenames ( string_list& list, + Module& module ) const +{ + size_t i; + + const vector& compilationUnits = module.non_if_data.compilationUnits; + for ( i = 0; i < compilationUnits.size (); i++ ) + { + const FileLocation& sourceFileLocation = compilationUnits[i]->GetFilename (); + string filename = sourceFileLocation.relative_path + sSep + sourceFileLocation.name; + if ( !compilationUnits[i]->IsGeneratedFile () && IsTestFile ( filename ) ) + list.push_back ( filename ); + } +} + +char* +TestSupportCode::WriteTestDispatcherPrototypesToStartupFile ( char* buffer, + Module& module ) +{ + string_list files; + GetSourceFilenames ( files, + module ); + for ( size_t i = 0; i < files.size (); i++ ) + { + buffer = buffer + sprintf ( buffer, + "extern void %s(int Command, char *Buffer);\n", + GetTestDispatcherName ( files[i] ).c_str () ); + } + buffer = buffer + sprintf ( buffer, "\n" ); + return buffer; +} + +char* +TestSupportCode::WriteRegisterTestsFunctionToStartupFile ( char* buffer, + Module& module ) +{ + buffer = buffer + sprintf ( buffer, + "extern void AddTest(TestRoutine Routine);\n" ); + buffer = buffer + sprintf ( buffer, + "\n" ); + + buffer = buffer + sprintf ( buffer, + "void\n" ); + buffer = buffer + sprintf ( buffer, + "RegisterTests()\n" ); + buffer = buffer + sprintf ( buffer, + "{\n" ); + + string_list files; + GetSourceFilenames ( files, + module ); + for ( size_t i = 0; i < files.size (); i++ ) + { + buffer = buffer + sprintf ( buffer, + "AddTest((TestRoutine)%s);\n", + GetTestDispatcherName ( files[i]).c_str () ); + } + buffer = buffer + sprintf ( buffer, + "}\n" ); + buffer = buffer + sprintf ( buffer, "\n" ); + return buffer; +} + +void +TestSupportCode::WriteStartupFile ( Module& module ) +{ + char* buf; + char* s; + + buf = (char*) malloc ( 50*1024 ); + if ( buf == NULL ) + throw OutOfMemoryException (); + + s = buf; + s = s + sprintf ( s, "/* This file is automatically generated. */\n" ); + s = s + sprintf ( s, "\n" ); + s = s + sprintf ( s, "#include \n" ); + s = s + sprintf ( s, "#include \"regtests.h\"\n" ); + s = s + sprintf ( s, "\n" ); + s = WriteTestDispatcherPrototypesToStartupFile ( s, + module ); + s = WriteRegisterTestsFunctionToStartupFile ( s, + module ); + s = s + sprintf ( s, "\n" ); + s = s + sprintf ( s, "void\n" ); + s = s + sprintf ( s, "ConsoleWrite(char *Buffer)\n" ); + s = s + sprintf ( s, "{\n" ); + s = s + sprintf ( s, " printf(Buffer);\n" ); + s = s + sprintf ( s, "}\n" ); + s = s + sprintf ( s, "\n" ); + s = s + sprintf ( s, "int\n" ); + s = s + sprintf ( s, "WINAPI\n" ); + s = s + sprintf ( s, "WinMain(HINSTANCE hInstance,\n" ); + s = s + sprintf ( s, " HINSTANCE hPrevInstance,\n" ); + s = s + sprintf ( s, " LPSTR lpszCmdParam,\n" ); + s = s + sprintf ( s, " int nCmdShow)\n" ); + s = s + sprintf ( s, "{\n" ); + s = s + sprintf ( s, " _SetPriorityClass(_GetCurrentProcess(), HIGH_PRIORITY_CLASS);\n" ); + s = s + sprintf ( s, " _SetThreadPriority(_GetCurrentThread(), THREAD_PRIORITY_TIME_CRITICAL);\n" ); + s = s + sprintf ( s, " InitializeTests();\n" ); + s = s + sprintf ( s, " RegisterTests();\n" ); + s = s + sprintf ( s, " SetupOnce();\n" ); + s = s + sprintf ( s, " PerformTests(ConsoleWrite, NULL);\n" ); + s = s + sprintf ( s, " _ExitProcess(0);\n" ); + s = s + sprintf ( s, " return 0;\n" ); + s = s + sprintf ( s, "}\n" ); + s = s + sprintf ( s, "\n" ); + + FileSupportCode::WriteIfChanged ( buf, GetStartupFilename ( module ) ); + + free ( buf ); +} diff --git a/tools/rbuild/xmlnode.cpp b/tools/rbuild/xmlnode.cpp new file mode 100644 index 00000000000..cf1c749de90 --- /dev/null +++ b/tools/rbuild/xmlnode.cpp @@ -0,0 +1,38 @@ +/* + * Copyright (C) 2007 Hervé Poussineau + * + * This program is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation; either version 2 of the License, or + * (at your option) any later version. + * + * This program 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 General Public License for more details. + * + * You should have received a copy of the GNU General Public License along + * with this program; if not, write to the Free Software Foundation, Inc., + * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. + */ +#include "pch.h" + +#include "rbuild.h" + +using std::string; + +XmlNode::XmlNode ( const Project& project_, + const XMLElement& node ) + : project(project_), + node(node) +{ +} + +XmlNode::~XmlNode () +{ +} + +void +XmlNode::ProcessXML () +{ +} diff --git a/tools/rbuild_helper/rbuild_helper.rbuild b/tools/rbuild_helper/rbuild_helper.rbuild new file mode 100644 index 00000000000..fa9af2680e4 --- /dev/null +++ b/tools/rbuild_helper/rbuild_helper.rbuild @@ -0,0 +1,7 @@ + + + . + + + rbuild_helper.cpp + diff --git a/tools/rgenstat/rgenstat.rbuild b/tools/rgenstat/rgenstat.rbuild new file mode 100644 index 00000000000..6de3bef7407 --- /dev/null +++ b/tools/rgenstat/rgenstat.rbuild @@ -0,0 +1,6 @@ + + + + rgenstat.c + llmosrt.c + diff --git a/tools/rsym/raddr2line.mak b/tools/rsym/raddr2line.mak new file mode 100644 index 00000000000..df00e8d02d1 --- /dev/null +++ b/tools/rsym/raddr2line.mak @@ -0,0 +1,41 @@ +RADDR2LINE_BASE = $(TOOLS_BASE)$(SEP)rsym +RADDR2LINE_BASE_ = $(RADDR2LINE_BASE)$(SEP) + +RADDR2LINE_INT = $(INTERMEDIATE_)$(RADDR2LINE_BASE) +RADDR2LINE_INT_ = $(RADDR2LINE_INT)$(SEP) +RADDR2LINE_OUT = $(OUTPUT_)$(RADDR2LINE_BASE) +RADDR2LINE_OUT_ = $(RADDR2LINE_OUT)$(SEP) + +RADDR2LINE_TARGET = \ + $(RADDR2LINE_OUT_)raddr2line$(EXEPOSTFIX) + +RADDR2LINE_SOURCES = \ + $(RADDR2LINE_BASE_)raddr2line.c \ + $(RADDR2LINE_BASE_)rsym_common.c + +RADDR2LINE_OBJECTS = \ + $(addprefix $(INTERMEDIATE_), $(RADDR2LINE_SOURCES:.c=.o)) + +RADDR2LINE_HOST_CFLAGS = $(TOOLS_CFLAGS) + +RADDR2LINE_HOST_LFLAGS = $(TOOLS_LFLAGS) + +.PHONY: raddr2line +raddr2line: $(RADDR2LINE_TARGET) + +$(RADDR2LINE_TARGET): $(RADDR2LINE_OBJECTS) | $(RADDR2LINE_OUT) + $(ECHO_HOSTLD) + ${host_gcc} $(RADDR2LINE_OBJECTS) $(RADDR2LINE_HOST_LFLAGS) -o $@ + +$(RADDR2LINE_INT_)raddr2line.o: $(RADDR2LINE_BASE_)raddr2line.c | $(RADDR2LINE_INT) + $(ECHO_HOSTCC) + ${host_gcc} $(RADDR2LINE_HOST_CFLAGS) -c $< -o $@ + +#$(RADDR2LINE_INT_)rsym_common.o: $(RADDR2LINE_BASE_)rsym_common.c | $(RADDR2LINE_INT) +# $(ECHO_HOSTCC) +# ${host_gcc} $(RADDR2LINE_HOST_CFLAGS) -c $< -o $@ + +.PHONY: raddr2line_clean +raddr2line_clean: + -@$(rm) $(RADDR2LINE_TARGET) $(RADDR2LINE_OBJECTS) 2>$(NUL) +clean: raddr2line_clean diff --git a/tools/rsym/rsym.c b/tools/rsym/rsym.c new file mode 100644 index 00000000000..50aa2e39c0e --- /dev/null +++ b/tools/rsym/rsym.c @@ -0,0 +1,985 @@ +/* + * Usage: rsym input-file output-file + * + * There are two sources of information: the .stab/.stabstr + * sections of the executable and the COFF symbol table. Most + * of the information is in the .stab/.stabstr sections. + * However, most of our asm files don't contain .stab directives, + * so routines implemented in assembler won't show up in the + * .stab section. They are present in the COFF symbol table. + * So, we mostly use the .stab/.stabstr sections, but we augment + * the info there with info from the COFF symbol table when + * possible. + * + * This is a tool and is compiled using the host compiler, + * i.e. on Linux gcc and not mingw-gcc (cross-compiler). + * Therefore we can't include SDK headers and we have to + * duplicate some definitions here. + * Also note that the internal functions are "old C-style", + * returning an int, where a return of 0 means success and + * non-zero is failure. + */ + +#include +#include +#include +#include + +#include "rsym.h" + +static int +CompareSymEntry(const PROSSYM_ENTRY SymEntry1, const PROSSYM_ENTRY SymEntry2) +{ + if (SymEntry1->Address < SymEntry2->Address) + { + return -1; + } + + if (SymEntry2->Address < SymEntry1->Address) + { + return +1; + } + + return 0; +} + +static int +GetStabInfo(void *FileData, PIMAGE_FILE_HEADER PEFileHeader, + PIMAGE_SECTION_HEADER PESectionHeaders, + ULONG *StabSymbolsLength, void **StabSymbolsBase, + ULONG *StabStringsLength, void **StabStringsBase) +{ + ULONG Idx; + + /* Load .stab and .stabstr sections if available */ + *StabSymbolsBase = NULL; + *StabSymbolsLength = 0; + *StabStringsBase = NULL; + *StabStringsLength = 0; + + for (Idx = 0; Idx < PEFileHeader->NumberOfSections; Idx++) + { + /* printf("section: '%.08s'\n", PESectionHeaders[Idx].Name); */ + if ((strncmp((char*)PESectionHeaders[Idx].Name, ".stab", 5) == 0) + && (PESectionHeaders[Idx].Name[5] == 0)) + { + /* printf(".stab section found. Size %d\n", + PESectionHeaders[Idx].SizeOfRawData); */ + + *StabSymbolsLength = PESectionHeaders[Idx].SizeOfRawData; + *StabSymbolsBase = (void *)((char *) FileData + PESectionHeaders[Idx].PointerToRawData); + } + + if (strncmp((char*)PESectionHeaders[Idx].Name, ".stabstr", 8) == 0) + { + /* printf(".stabstr section found. Size %d\n", + PESectionHeaders[Idx].SizeOfRawData); */ + + *StabStringsLength = PESectionHeaders[Idx].SizeOfRawData; + *StabStringsBase = (void *)((char *) FileData + PESectionHeaders[Idx].PointerToRawData); + } + } + + return 0; +} + +static int +GetCoffInfo(void *FileData, PIMAGE_FILE_HEADER PEFileHeader, + PIMAGE_SECTION_HEADER PESectionHeaders, + ULONG *CoffSymbolsLength, void **CoffSymbolsBase, + ULONG *CoffStringsLength, void **CoffStringsBase) +{ + + if (0 == PEFileHeader->PointerToSymbolTable || 0 == PEFileHeader->NumberOfSymbols) + { + /* No COFF symbol table */ + *CoffSymbolsLength = 0; + *CoffStringsLength = 0; + } + else + { + *CoffSymbolsLength = PEFileHeader->NumberOfSymbols * sizeof(COFF_SYMENT); + *CoffSymbolsBase = (void *)((char *) FileData + PEFileHeader->PointerToSymbolTable); + *CoffStringsLength = *((ULONG *) ((char *) *CoffSymbolsBase + *CoffSymbolsLength)); + *CoffStringsBase = (void *)((char *) *CoffSymbolsBase + *CoffSymbolsLength); + } + + return 0; +} + +static ULONG +FindOrAddString(char *StringToFind, ULONG *StringsLength, void *StringsBase) +{ + char *Search, *End; + + Search = (char *) StringsBase; + End = Search + *StringsLength; + + while (Search < End) + { + if (0 == strcmp(Search, StringToFind)) + { + return Search - (char *) StringsBase; + } + Search += strlen(Search) + 1; + } + + strcpy(Search, StringToFind); + *StringsLength += strlen(StringToFind) + 1; + + return Search - (char *) StringsBase; +} + +static int +ConvertStabs(ULONG *SymbolsCount, PROSSYM_ENTRY *SymbolsBase, + ULONG *StringsLength, void *StringsBase, + ULONG StabSymbolsLength, void *StabSymbolsBase, + ULONG StabStringsLength, void *StabStringsBase, + ULONG_PTR ImageBase, PIMAGE_FILE_HEADER PEFileHeader, + PIMAGE_SECTION_HEADER PESectionHeaders) +{ + PSTAB_ENTRY StabEntry; + ULONG Count, i; + ULONG_PTR Address, LastFunctionAddress; + int First = 1; + char *Name; + ULONG NameLen; + char FuncName[256]; + PROSSYM_ENTRY Current; + + StabEntry = StabSymbolsBase; + Count = StabSymbolsLength / sizeof(STAB_ENTRY); + *SymbolsCount = 0; + if (Count == 0) + { + /* No symbol info */ + *SymbolsBase = NULL; + return 0; + } + + *SymbolsBase = malloc(Count * sizeof(ROSSYM_ENTRY)); + if (NULL == *SymbolsBase) + { + fprintf(stderr, "Failed to allocate memory for converted .stab symbols\n"); + return 1; + } + Current = *SymbolsBase; + memset ( Current, 0, sizeof(*Current) ); + + LastFunctionAddress = 0; + for (i = 0; i < Count; i++) + { + if ( 0 == LastFunctionAddress ) + { + Address = StabEntry[i].n_value - ImageBase; + } + else + { + Address = LastFunctionAddress + StabEntry[i].n_value; + } + switch (StabEntry[i].n_type) + { + case N_SO: + case N_SOL: + case N_BINCL: + Name = (char *) StabStringsBase + StabEntry[i].n_strx; + if (StabStringsLength < StabEntry[i].n_strx + ||'\0' == *Name || '/' == Name[strlen(Name) - 1] + || '\\' == Name[strlen(Name) - 1] + || StabEntry[i].n_value < ImageBase) + { + continue; + } + if ( First || Address != Current->Address ) + { + if ( !First ) + { + memset ( ++Current, 0, sizeof(*Current) ); + Current->FunctionOffset = Current[-1].FunctionOffset; + } + else + First = 0; + Current->Address = Address; + } + Current->FileOffset = FindOrAddString((char *)StabStringsBase + + StabEntry[i].n_strx, + StringsLength, + StringsBase); + break; + case N_FUN: + if (0 == StabEntry[i].n_desc || StabEntry[i].n_value < ImageBase) + { + LastFunctionAddress = 0; /* line # 0 = end of function */ + continue; + } + if ( First || Address != Current->Address ) + { + if ( !First ) + memset ( ++Current, 0, sizeof(*Current) ); + else + First = 0; + Current->Address = Address; + Current->FileOffset = Current[-1].FileOffset; + } + Name = (char *) StabStringsBase + StabEntry[i].n_strx; + NameLen = strcspn(Name, ":"); + if (sizeof(FuncName) <= NameLen) + { + free(*SymbolsBase); + fprintf(stderr, "Function name too long\n"); + return 1; + } + memcpy(FuncName, Name, NameLen); + FuncName[NameLen] = '\0'; + Current->FunctionOffset = FindOrAddString(FuncName, + StringsLength, + StringsBase); + Current->SourceLine = 0; + LastFunctionAddress = Address; + break; + case N_SLINE: + if ( First || Address != Current->Address ) + { + if ( !First ) + { + memset ( ++Current, 0, sizeof(*Current) ); + Current->FileOffset = Current[-1].FileOffset; + Current->FunctionOffset = Current[-1].FunctionOffset; + } + else + First = 0; + Current->Address = Address; + } + Current->SourceLine = StabEntry[i].n_desc; + break; + default: + continue; + } + } + *SymbolsCount = (Current - *SymbolsBase + 1); + + qsort(*SymbolsBase, *SymbolsCount, sizeof(ROSSYM_ENTRY), (int (*)(const void *, const void *)) CompareSymEntry); + + return 0; +} + +static int +ConvertCoffs(ULONG *SymbolsCount, PROSSYM_ENTRY *SymbolsBase, + ULONG *StringsLength, void *StringsBase, + ULONG CoffSymbolsLength, void *CoffSymbolsBase, + ULONG CoffStringsLength, void *CoffStringsBase, + ULONG_PTR ImageBase, PIMAGE_FILE_HEADER PEFileHeader, + PIMAGE_SECTION_HEADER PESectionHeaders) +{ + ULONG Count, i; + PCOFF_SYMENT CoffEntry; + char FuncName[256]; + char *p; + PROSSYM_ENTRY Current; + + CoffEntry = (PCOFF_SYMENT) CoffSymbolsBase; + Count = CoffSymbolsLength / sizeof(COFF_SYMENT); + *SymbolsBase = malloc(Count * sizeof(ROSSYM_ENTRY)); + if (NULL == *SymbolsBase) + { + fprintf(stderr, "Unable to allocate memory for converted COFF symbols\n"); + return 1; + } + *SymbolsCount = 0; + Current = *SymbolsBase; + + for (i = 0; i < Count; i++) + { + if (ISFCN(CoffEntry[i].e_type) || C_EXT == CoffEntry[i].e_sclass) + { + Current->Address = CoffEntry[i].e_value; + if (0 < CoffEntry[i].e_scnum) + { + if (PEFileHeader->NumberOfSections < CoffEntry[i].e_scnum) + { + free(*SymbolsBase); + fprintf(stderr, "Invalid section number %d in COFF symbols (only %d sections present)\n", + CoffEntry[i].e_scnum, PEFileHeader->NumberOfSections); + return 1; + } + Current->Address += PESectionHeaders[CoffEntry[i].e_scnum - 1].VirtualAddress; + } + Current->FileOffset = 0; + if (0 == CoffEntry[i].e.e.e_zeroes) + { + if (sizeof(FuncName) <= strlen((char *) CoffStringsBase + CoffEntry[i].e.e.e_offset)) + { + free(*SymbolsBase); + fprintf(stderr, "Function name too long\n"); + return 1; + } + strcpy(FuncName, (char *) CoffStringsBase + CoffEntry[i].e.e.e_offset); + } + else + { + memcpy(FuncName, CoffEntry[i].e.e_name, E_SYMNMLEN); + FuncName[E_SYMNMLEN] = '\0'; + } + + /* Name demangling: stdcall */ + p = strrchr(FuncName, '@'); + if (NULL != p) + { + *p = '\0'; + } + p = ('_' == FuncName[0] || '@' == FuncName[0] ? FuncName + 1 : FuncName); + Current->FunctionOffset = FindOrAddString(p, + StringsLength, + StringsBase); + Current->SourceLine = 0; + memset ( ++Current, 0, sizeof(*Current) ); + } + i += CoffEntry[i].e_numaux; + } + + *SymbolsCount = (Current - *SymbolsBase + 1); + qsort(*SymbolsBase, *SymbolsCount, sizeof(ROSSYM_ENTRY), (int (*)(const void *, const void *)) CompareSymEntry); + + return 0; +} + +static int +MergeStabsAndCoffs(ULONG *MergedSymbolCount, PROSSYM_ENTRY *MergedSymbols, + ULONG StabSymbolsCount, PROSSYM_ENTRY StabSymbols, + ULONG CoffSymbolsCount, PROSSYM_ENTRY CoffSymbols) +{ + ULONG StabIndex, j; + ULONG CoffIndex; + ULONG_PTR StabFunctionStartAddress; + ULONG StabFunctionStringOffset, NewStabFunctionStringOffset; + + *MergedSymbolCount = 0; + if (StabSymbolsCount == 0) + { + *MergedSymbols = NULL; + return 0; + } + *MergedSymbols = malloc(StabSymbolsCount * sizeof(ROSSYM_ENTRY)); + if (NULL == *MergedSymbols) + { + fprintf(stderr, "Unable to allocate memory for merged symbols\n"); + return 1; + } + + StabFunctionStartAddress = 0; + StabFunctionStringOffset = 0; + CoffIndex = 0; + for (StabIndex = 0; StabIndex < StabSymbolsCount; StabIndex++) + { + (*MergedSymbols)[*MergedSymbolCount] = StabSymbols[StabIndex]; + for (j = StabIndex + 1; + j < StabSymbolsCount && StabSymbols[j].Address == StabSymbols[StabIndex].Address; + j++) + { + if (0 != StabSymbols[j].FileOffset && 0 == (*MergedSymbols)[*MergedSymbolCount].FileOffset) + { + (*MergedSymbols)[*MergedSymbolCount].FileOffset = StabSymbols[j].FileOffset; + } + if (0 != StabSymbols[j].FunctionOffset && 0 == (*MergedSymbols)[*MergedSymbolCount].FunctionOffset) + { + (*MergedSymbols)[*MergedSymbolCount].FunctionOffset = StabSymbols[j].FunctionOffset; + } + if (0 != StabSymbols[j].SourceLine && 0 == (*MergedSymbols)[*MergedSymbolCount].SourceLine) + { + (*MergedSymbols)[*MergedSymbolCount].SourceLine = StabSymbols[j].SourceLine; + } + } + StabIndex = j - 1; + while (CoffIndex < CoffSymbolsCount + && CoffSymbols[CoffIndex + 1].Address <= (*MergedSymbols)[*MergedSymbolCount].Address) + { + CoffIndex++; + } + NewStabFunctionStringOffset = (*MergedSymbols)[*MergedSymbolCount].FunctionOffset; + if (CoffSymbolsCount > 0 && + CoffSymbols[CoffIndex].Address < (*MergedSymbols)[*MergedSymbolCount].Address + && StabFunctionStartAddress < CoffSymbols[CoffIndex].Address + && 0 != CoffSymbols[CoffIndex].FunctionOffset) + { + (*MergedSymbols)[*MergedSymbolCount].FunctionOffset = CoffSymbols[CoffIndex].FunctionOffset; + } + if (StabFunctionStringOffset != NewStabFunctionStringOffset) + { + StabFunctionStartAddress = (*MergedSymbols)[*MergedSymbolCount].Address; + } + StabFunctionStringOffset = NewStabFunctionStringOffset; + (*MergedSymbolCount)++; + } + + return 0; +} + +static PIMAGE_SECTION_HEADER +FindSectionForRVA(DWORD RVA, unsigned NumberOfSections, PIMAGE_SECTION_HEADER SectionHeaders) +{ + unsigned Section; + + for (Section = 0; Section < NumberOfSections; Section++) + { + if (SectionHeaders[Section].VirtualAddress <= RVA && + RVA < SectionHeaders[Section].VirtualAddress + SectionHeaders[Section].Misc.VirtualSize) + { + return SectionHeaders + Section; + } + } + + return NULL; +} + +static int +IncludeRelocationsForSection(PIMAGE_SECTION_HEADER SectionHeader) +{ + static char *BlacklistedSections[] = + { + ".edata", + ".idata", + ".reloc" + }; + char SectionName[IMAGE_SIZEOF_SHORT_NAME]; + unsigned i; + + if (0 != (SectionHeader->Characteristics & IMAGE_SCN_LNK_REMOVE)) + { + return 0; + } + + for (i = 0; i < sizeof(BlacklistedSections) / sizeof(BlacklistedSections[0]); i++) + { + strncpy(SectionName, BlacklistedSections[i], IMAGE_SIZEOF_SHORT_NAME); + if (0 == memcmp(SectionName, SectionHeader->Name, IMAGE_SIZEOF_SHORT_NAME)) + { + return 0; + } + } + + return 1; +} + +static int +ProcessRelocations(ULONG *ProcessedRelocsLength, void **ProcessedRelocs, + void *RawData, PIMAGE_OPTIONAL_HEADER OptHeader, + unsigned NumberOfSections, PIMAGE_SECTION_HEADER SectionHeaders) +{ + PIMAGE_SECTION_HEADER RelocSectionHeader, TargetSectionHeader; + PIMAGE_BASE_RELOCATION BaseReloc, End, AcceptedRelocs; + int Found; + + if (OptHeader->NumberOfRvaAndSizes < IMAGE_DIRECTORY_ENTRY_BASERELOC + || 0 == OptHeader->DataDirectory[IMAGE_DIRECTORY_ENTRY_BASERELOC].VirtualAddress) + { + /* No relocation entries */ + *ProcessedRelocsLength = 0; + *ProcessedRelocs = NULL; + return 0; + } + + RelocSectionHeader = FindSectionForRVA(OptHeader->DataDirectory[IMAGE_DIRECTORY_ENTRY_BASERELOC].VirtualAddress, + NumberOfSections, SectionHeaders); + if (NULL == RelocSectionHeader) + { + fprintf(stderr, "Can't find section header for relocation data\n"); + return 1; + } + + *ProcessedRelocs = malloc(RelocSectionHeader->SizeOfRawData); + if (NULL == *ProcessedRelocs) + { + fprintf(stderr, "Failed to allocate %u bytes for relocations\n", (unsigned int)RelocSectionHeader->SizeOfRawData); + return 1; + } + *ProcessedRelocsLength = 0; + + BaseReloc = (PIMAGE_BASE_RELOCATION) ((char *) RawData + + RelocSectionHeader->PointerToRawData + + (OptHeader->DataDirectory[IMAGE_DIRECTORY_ENTRY_BASERELOC].VirtualAddress - + RelocSectionHeader->VirtualAddress)); + End = (PIMAGE_BASE_RELOCATION) ((char *) BaseReloc + + OptHeader->DataDirectory[IMAGE_DIRECTORY_ENTRY_BASERELOC].Size); + + while (BaseReloc < End && 0 < BaseReloc->SizeOfBlock) + { + TargetSectionHeader = FindSectionForRVA(BaseReloc->VirtualAddress, NumberOfSections, + SectionHeaders); + if (NULL != TargetSectionHeader && IncludeRelocationsForSection(TargetSectionHeader)) + { + AcceptedRelocs = *ProcessedRelocs; + Found = 0; + while (AcceptedRelocs < (PIMAGE_BASE_RELOCATION) ((char *) *ProcessedRelocs + + *ProcessedRelocsLength) + && ! Found) + { + Found = BaseReloc->SizeOfBlock == AcceptedRelocs->SizeOfBlock + && 0 == memcmp(BaseReloc, AcceptedRelocs, AcceptedRelocs->SizeOfBlock); + AcceptedRelocs= (PIMAGE_BASE_RELOCATION) ((char *) AcceptedRelocs + + AcceptedRelocs->SizeOfBlock); + } + if (! Found) + { + memcpy((char *) *ProcessedRelocs + *ProcessedRelocsLength, + BaseReloc, BaseReloc->SizeOfBlock); + *ProcessedRelocsLength += BaseReloc->SizeOfBlock; + } + } + BaseReloc = (PIMAGE_BASE_RELOCATION)((char *) BaseReloc + BaseReloc->SizeOfBlock); + } + + return 0; +} + +static int +CreateOutputFile(FILE *OutFile, void *InData, + PIMAGE_DOS_HEADER InDosHeader, PIMAGE_FILE_HEADER InFileHeader, + PIMAGE_OPTIONAL_HEADER InOptHeader, PIMAGE_SECTION_HEADER InSectionHeaders, + ULONG RosSymLength, void *RosSymSection) +{ + ULONG StartOfRawData; + unsigned Section; + void *OutHeader, *ProcessedRelocs, *PaddedRosSym, *Data; + PIMAGE_DOS_HEADER OutDosHeader; + PIMAGE_FILE_HEADER OutFileHeader; + PIMAGE_OPTIONAL_HEADER OutOptHeader; + PIMAGE_SECTION_HEADER OutSectionHeaders, CurrentSectionHeader; + DWORD CheckSum; + ULONG Length, i; + ULONG ProcessedRelocsLength; + ULONG RosSymOffset, RosSymFileLength; + int InRelocSectionIndex; + PIMAGE_SECTION_HEADER OutRelocSection; + + StartOfRawData = 0; + for (Section = 0; Section < InFileHeader->NumberOfSections; Section++) + { + if ((0 == StartOfRawData + || InSectionHeaders[Section].PointerToRawData < StartOfRawData) + && 0 != InSectionHeaders[Section].PointerToRawData + && 0 == (InSectionHeaders[Section].Characteristics & IMAGE_SCN_LNK_REMOVE)) + { + StartOfRawData = InSectionHeaders[Section].PointerToRawData; + } + } + OutHeader = malloc(StartOfRawData); + if (NULL == OutHeader) + { + fprintf(stderr, "Failed to allocate %u bytes for output file header\n", (unsigned int)StartOfRawData); + return 1; + } + memset(OutHeader, '\0', StartOfRawData); + + OutDosHeader = (PIMAGE_DOS_HEADER) OutHeader; + memcpy(OutDosHeader, InDosHeader, InDosHeader->e_lfanew + sizeof(ULONG)); + + OutFileHeader = (PIMAGE_FILE_HEADER)((char *) OutHeader + OutDosHeader->e_lfanew + sizeof(ULONG)); + memcpy(OutFileHeader, InFileHeader, sizeof(IMAGE_FILE_HEADER)); + OutFileHeader->PointerToSymbolTable = 0; + OutFileHeader->NumberOfSymbols = 0; + OutFileHeader->Characteristics &= ~(IMAGE_FILE_LINE_NUMS_STRIPPED | IMAGE_FILE_LOCAL_SYMS_STRIPPED | + IMAGE_FILE_DEBUG_STRIPPED); + + OutOptHeader = (PIMAGE_OPTIONAL_HEADER)(OutFileHeader + 1); + memcpy(OutOptHeader, InOptHeader, sizeof(IMAGE_OPTIONAL_HEADER)); + OutOptHeader->CheckSum = 0; + + OutSectionHeaders = (PIMAGE_SECTION_HEADER)((char *) OutOptHeader + OutFileHeader->SizeOfOptionalHeader); + + if (ProcessRelocations(&ProcessedRelocsLength, &ProcessedRelocs, InData, InOptHeader, + InFileHeader->NumberOfSections, InSectionHeaders)) + { + return 1; + } + if (InOptHeader->NumberOfRvaAndSizes < IMAGE_DIRECTORY_ENTRY_BASERELOC + || 0 == InOptHeader->DataDirectory[IMAGE_DIRECTORY_ENTRY_BASERELOC].VirtualAddress) + { + InRelocSectionIndex = -1; + } + else + { + InRelocSectionIndex = FindSectionForRVA(InOptHeader->DataDirectory[IMAGE_DIRECTORY_ENTRY_BASERELOC].VirtualAddress, + InFileHeader->NumberOfSections, InSectionHeaders) - InSectionHeaders; + } + + OutFileHeader->NumberOfSections = 0; + CurrentSectionHeader = OutSectionHeaders; + OutOptHeader->SizeOfImage = 0; + RosSymOffset = 0; + OutRelocSection = NULL; + for (Section = 0; Section < InFileHeader->NumberOfSections; Section++) + { + if (0 == (InSectionHeaders[Section].Characteristics & IMAGE_SCN_LNK_REMOVE)) + { + *CurrentSectionHeader = InSectionHeaders[Section]; + CurrentSectionHeader->PointerToLinenumbers = 0; + CurrentSectionHeader->NumberOfLinenumbers = 0; + if (OutOptHeader->SizeOfImage < CurrentSectionHeader->VirtualAddress + + CurrentSectionHeader->Misc.VirtualSize) + { + OutOptHeader->SizeOfImage = ROUND_UP(CurrentSectionHeader->VirtualAddress + + CurrentSectionHeader->Misc.VirtualSize, + OutOptHeader->SectionAlignment); + } + if (RosSymOffset < CurrentSectionHeader->PointerToRawData + CurrentSectionHeader->SizeOfRawData) + { + RosSymOffset = CurrentSectionHeader->PointerToRawData + CurrentSectionHeader->SizeOfRawData; + } + if (Section == (ULONG)InRelocSectionIndex) + { + OutRelocSection = CurrentSectionHeader; + } + (OutFileHeader->NumberOfSections) ++; + CurrentSectionHeader++; + } + } + + if (OutRelocSection == CurrentSectionHeader - 1) + { + OutOptHeader->DataDirectory[IMAGE_DIRECTORY_ENTRY_BASERELOC].Size = ProcessedRelocsLength; + if (OutOptHeader->SizeOfImage == OutRelocSection->VirtualAddress + + ROUND_UP(OutRelocSection->Misc.VirtualSize, + OutOptHeader->SectionAlignment)) + { + OutOptHeader->SizeOfImage = OutRelocSection->VirtualAddress + + ROUND_UP(ProcessedRelocsLength, + OutOptHeader->SectionAlignment); + } + OutRelocSection->Misc.VirtualSize = ProcessedRelocsLength; + if (RosSymOffset == OutRelocSection->PointerToRawData + + OutRelocSection->SizeOfRawData) + { + RosSymOffset = OutRelocSection->PointerToRawData + + ROUND_UP(ProcessedRelocsLength, OutOptHeader->FileAlignment); + } + OutRelocSection->SizeOfRawData = ROUND_UP(ProcessedRelocsLength, + OutOptHeader->FileAlignment); + } + + if (RosSymLength > 0) + { + RosSymFileLength = ROUND_UP(RosSymLength, OutOptHeader->FileAlignment); + memcpy(CurrentSectionHeader->Name, ".rossym", 8); /* We're lucky: string is exactly 8 bytes long */ + CurrentSectionHeader->Misc.VirtualSize = RosSymLength; + CurrentSectionHeader->VirtualAddress = OutOptHeader->SizeOfImage; + CurrentSectionHeader->SizeOfRawData = RosSymFileLength; + CurrentSectionHeader->PointerToRawData = RosSymOffset; + CurrentSectionHeader->PointerToRelocations = 0; + CurrentSectionHeader->PointerToLinenumbers = 0; + CurrentSectionHeader->NumberOfRelocations = 0; + CurrentSectionHeader->NumberOfLinenumbers = 0; + CurrentSectionHeader->Characteristics = IMAGE_SCN_MEM_READ | IMAGE_SCN_MEM_DISCARDABLE + | IMAGE_SCN_LNK_REMOVE | IMAGE_SCN_TYPE_NOLOAD; + OutOptHeader->SizeOfImage = ROUND_UP(CurrentSectionHeader->VirtualAddress + + CurrentSectionHeader->Misc.VirtualSize, + OutOptHeader->SectionAlignment); + (OutFileHeader->NumberOfSections)++; + + PaddedRosSym = malloc(RosSymFileLength); + if (NULL == PaddedRosSym) + { + fprintf(stderr, "Failed to allocate %u bytes for padded .rossym\n", (unsigned int)RosSymFileLength); + return 1; + } + memcpy(PaddedRosSym, RosSymSection, RosSymLength); + memset((char *) PaddedRosSym + RosSymLength, '\0', RosSymFileLength - RosSymLength); + } + else + { + PaddedRosSym = NULL; + } + CheckSum = 0; + for (i = 0; i < StartOfRawData / 2; i++) + { + CheckSum += ((unsigned short*) OutHeader)[i]; + CheckSum = 0xffff & (CheckSum + (CheckSum >> 16)); + } + Length = StartOfRawData; + for (Section = 0; Section < OutFileHeader->NumberOfSections; Section++) + { + DWORD SizeOfRawData; + if (OutRelocSection == OutSectionHeaders + Section) + { + Data = (void *) ProcessedRelocs; + SizeOfRawData = ProcessedRelocsLength; + } + else if (RosSymLength > 0 && Section + 1 == OutFileHeader->NumberOfSections) + { + Data = (void *) PaddedRosSym; + SizeOfRawData = OutSectionHeaders[Section].SizeOfRawData; + } + else + { + Data = (void *) ((char *) InData + OutSectionHeaders[Section].PointerToRawData); + SizeOfRawData = OutSectionHeaders[Section].SizeOfRawData; + } + for (i = 0; i < SizeOfRawData / 2; i++) + { + CheckSum += ((unsigned short*) Data)[i]; + CheckSum = 0xffff & (CheckSum + (CheckSum >> 16)); + } + Length += OutSectionHeaders[Section].SizeOfRawData; + } + CheckSum += Length; + OutOptHeader->CheckSum = CheckSum; + + if (fwrite(OutHeader, 1, StartOfRawData, OutFile) != StartOfRawData) + { + perror("Error writing output header\n"); + free(OutHeader); + return 1; + } + + for (Section = 0; Section < OutFileHeader->NumberOfSections; Section++) + { + if (0 != OutSectionHeaders[Section].SizeOfRawData) + { + DWORD SizeOfRawData; + fseek(OutFile, OutSectionHeaders[Section].PointerToRawData, SEEK_SET); + if (OutRelocSection == OutSectionHeaders + Section) + { + Data = (void *) ProcessedRelocs; + SizeOfRawData = ProcessedRelocsLength; + } + else if (RosSymLength > 0 && Section + 1 == OutFileHeader->NumberOfSections) + { + Data = (void *) PaddedRosSym; + SizeOfRawData = OutSectionHeaders[Section].SizeOfRawData; + } + else + { + Data = (void *) ((char *) InData + OutSectionHeaders[Section].PointerToRawData); + SizeOfRawData = OutSectionHeaders[Section].SizeOfRawData; + } + if (fwrite(Data, 1, SizeOfRawData, OutFile) != SizeOfRawData) + { + perror("Error writing section data\n"); + free(PaddedRosSym); + free(OutHeader); + return 1; + } + } + } + + if (PaddedRosSym) + { + free(PaddedRosSym); + } + free(OutHeader); + + return 0; +} + +int main(int argc, char* argv[]) +{ + PSYMBOLFILE_HEADER SymbolFileHeader; + PIMAGE_DOS_HEADER PEDosHeader; + PIMAGE_FILE_HEADER PEFileHeader; + PIMAGE_OPTIONAL_HEADER PEOptHeader; + PIMAGE_SECTION_HEADER PESectionHeaders; + ULONG ImageBase; + void *StabBase; + ULONG StabsLength; + void *StabStringBase; + ULONG StabStringsLength; + void *CoffBase = NULL; + ULONG CoffsLength; + void *CoffStringBase = NULL; + ULONG CoffStringsLength; + char* path1; + char* path2; + FILE* out; + void *StringBase; + ULONG StringsLength; + ULONG StabSymbolsCount; + PROSSYM_ENTRY StabSymbols; + ULONG CoffSymbolsCount; + PROSSYM_ENTRY CoffSymbols; + ULONG MergedSymbolsCount; + PROSSYM_ENTRY MergedSymbols; + size_t FileSize; + void *FileData; + ULONG RosSymLength; + void *RosSymSection; + char elfhdr[4] = { '\177', 'E', 'L', 'F' }; + + if (3 != argc) + { + fprintf(stderr, "Usage: rsym \n"); + exit(1); + } + + path1 = convert_path(argv[1]); + path2 = convert_path(argv[2]); + + FileData = load_file ( path1, &FileSize ); + if ( !FileData ) + { + fprintf ( stderr, "An error occured loading '%s'\n", path1 ); + exit(1); + } + + /* Check if MZ header exists */ + PEDosHeader = (PIMAGE_DOS_HEADER) FileData; + if (PEDosHeader->e_magic != IMAGE_DOS_MAGIC || PEDosHeader->e_lfanew == 0L) + { + /* Ignore elf */ + if (!memcmp(PEDosHeader, elfhdr, sizeof(elfhdr))) + exit(0); + perror("Input file is not a PE image.\n"); + free(FileData); + exit(1); + } + + /* Locate PE file header */ + /* sizeof(ULONG) = sizeof(MAGIC) */ + PEFileHeader = (PIMAGE_FILE_HEADER)((char *) FileData + PEDosHeader->e_lfanew + sizeof(ULONG)); + + /* Locate optional header */ + assert(sizeof(ULONG) == 4); + PEOptHeader = (PIMAGE_OPTIONAL_HEADER)(PEFileHeader + 1); + ImageBase = PEOptHeader->ImageBase; + + /* Locate PE section headers */ + PESectionHeaders = (PIMAGE_SECTION_HEADER)((char *) PEOptHeader + PEFileHeader->SizeOfOptionalHeader); + + if (GetStabInfo(FileData, PEFileHeader, PESectionHeaders, &StabsLength, &StabBase, + &StabStringsLength, &StabStringBase)) + { + free(FileData); + exit(1); + } + + if (GetCoffInfo(FileData, PEFileHeader, PESectionHeaders, &CoffsLength, &CoffBase, + &CoffStringsLength, &CoffStringBase)) + { + free(FileData); + exit(1); + } + + StringBase = malloc(1 + StabStringsLength + CoffStringsLength + + (CoffsLength / sizeof(ROSSYM_ENTRY)) * (E_SYMNMLEN + 1)); + if (NULL == StringBase) + { + free(FileData); + fprintf(stderr, "Failed to allocate memory for strings table\n"); + exit(1); + } + /* Make offset 0 into an empty string */ + *((char *) StringBase) = '\0'; + StringsLength = 1; + + if (ConvertStabs(&StabSymbolsCount, &StabSymbols, &StringsLength, StringBase, + StabsLength, StabBase, StabStringsLength, StabStringBase, + ImageBase, PEFileHeader, PESectionHeaders)) + { + free(StringBase); + free(FileData); + fprintf(stderr, "Failed to allocate memory for strings table\n"); + exit(1); + } + + if (ConvertCoffs(&CoffSymbolsCount, &CoffSymbols, &StringsLength, StringBase, + CoffsLength, CoffBase, CoffStringsLength, CoffStringBase, + ImageBase, PEFileHeader, PESectionHeaders)) + { + if (StabSymbols) + { + free(StabSymbols); + } + free(StringBase); + free(FileData); + exit(1); + } + + if (MergeStabsAndCoffs(&MergedSymbolsCount, &MergedSymbols, + StabSymbolsCount, StabSymbols, + CoffSymbolsCount, CoffSymbols)) + { + if (CoffSymbols) + { + free(CoffSymbols); + } + if (StabSymbols) + { + free(StabSymbols); + } + free(StringBase); + free(FileData); + exit(1); + } + + if (CoffSymbols) + { + free(CoffSymbols); + } + if (StabSymbols) + { + free(StabSymbols); + } + if (MergedSymbolsCount == 0) + { + RosSymLength = 0; + RosSymSection = NULL; + } + else + { + RosSymLength = sizeof(SYMBOLFILE_HEADER) + MergedSymbolsCount * sizeof(ROSSYM_ENTRY) + + StringsLength; + RosSymSection = malloc(RosSymLength); + if (NULL == RosSymSection) + { + free(MergedSymbols); + free(StringBase); + free(FileData); + fprintf(stderr, "Unable to allocate memory for .rossym section\n"); + exit(1); + } + memset(RosSymSection, '\0', RosSymLength); + + SymbolFileHeader = (PSYMBOLFILE_HEADER) RosSymSection; + SymbolFileHeader->SymbolsOffset = sizeof(SYMBOLFILE_HEADER); + SymbolFileHeader->SymbolsLength = MergedSymbolsCount * sizeof(ROSSYM_ENTRY); + SymbolFileHeader->StringsOffset = SymbolFileHeader->SymbolsOffset + SymbolFileHeader->SymbolsLength; + SymbolFileHeader->StringsLength = StringsLength; + + memcpy((char *) RosSymSection + SymbolFileHeader->SymbolsOffset, MergedSymbols, + SymbolFileHeader->SymbolsLength); + memcpy((char *) RosSymSection + SymbolFileHeader->StringsOffset, StringBase, + SymbolFileHeader->StringsLength); + + free(MergedSymbols); + } + free(StringBase); + out = fopen(path2, "wb"); + if (out == NULL) + { + perror("Cannot open output file"); + free(RosSymSection); + free(FileData); + exit(1); + } + + if (CreateOutputFile(out, FileData, PEDosHeader, PEFileHeader, PEOptHeader, + PESectionHeaders, RosSymLength, RosSymSection)) + { + fclose(out); + if (RosSymSection) + { + free(RosSymSection); + } + free(FileData); + exit(1); + } + + fclose(out); + if (RosSymSection) + { + free(RosSymSection); + } + free(FileData); + + return 0; +} + +/* EOF */ diff --git a/tools/rsym/rsym.mak b/tools/rsym/rsym.mak new file mode 100644 index 00000000000..0adacedcae2 --- /dev/null +++ b/tools/rsym/rsym.mak @@ -0,0 +1,64 @@ +RSYM_BASE = $(TOOLS_BASE)$(SEP)rsym +RSYM_BASE_ = $(RSYM_BASE)$(SEP) +RSYM_INT = $(INTERMEDIATE_)$(RSYM_BASE) +RSYM_INT_ = $(RSYM_INT)$(SEP) +RSYM_OUT = $(OUTPUT_)$(RSYM_BASE) +RSYM_OUT_ = $(RSYM_OUT)$(SEP) + +$(RSYM_INT): | $(TOOLS_INT) + $(ECHO_MKDIR) + ${mkdir} $@ + +ifneq ($(INTERMEDIATE),$(OUTPUT)) +$(RSYM_OUT): | $(TOOLS_OUT) + $(ECHO_MKDIR) + ${mkdir} $@ +endif + +RSYM_TARGET = \ + $(RSYM_OUT_)rsym$(EXEPOSTFIX) + +ifeq ($(ARCH),amd64) +RSYM_SOURCES = \ + $(RSYM_BASE_)rsym64.c \ + $(RSYM_BASE_)rsym_common.c +else +RSYM_SOURCES = \ + $(RSYM_BASE_)rsym.c \ + $(RSYM_BASE_)rsym_common.c +endif + +RSYM_OBJECTS = \ + $(addprefix $(INTERMEDIATE_), $(RSYM_SOURCES:.c=.o)) + +ifeq ($(ARCH),amd64) +RSYM_HOST_CFLAGS = $(TOOLS_CFLAGS) -D_TARGET_PE64 +else +RSYM_HOST_CFLAGS = $(TOOLS_CFLAGS) +endif + +RSYM_HOST_LFLAGS = $(TOOLS_LFLAGS) + +.PHONY: rsym +rsym: $(RSYM_TARGET) + +$(RSYM_TARGET): $(RSYM_OBJECTS) | $(RSYM_OUT) + $(ECHO_LD) + ${host_gcc} $(RSYM_OBJECTS) $(RSYM_HOST_LFLAGS) -o $@ + +$(RSYM_INT_)rsym.o: $(RSYM_BASE_)rsym.c | $(RSYM_INT) + $(ECHO_CC) + ${host_gcc} $(RSYM_HOST_CFLAGS) -c $< -o $@ + +$(RSYM_INT_)rsym64.o: $(RSYM_BASE_)rsym64.c | $(RSYM_INT) + $(ECHO_CC) + ${host_gcc} $(RSYM_HOST_CFLAGS) -c $< -o $@ + +$(RSYM_INT_)rsym_common.o: $(RSYM_BASE_)rsym_common.c | $(RSYM_INT) + $(ECHO_CC) + ${host_gcc} $(RSYM_HOST_CFLAGS) -c $< -o $@ + +.PHONY: rsym_clean +rsym_clean: + -@$(rm) $(RSYM_TARGET) $(RSYM_OBJECTS) 2>$(NUL) +clean: rsym_clean diff --git a/tools/ssprintf.cpp b/tools/ssprintf.cpp new file mode 100644 index 00000000000..6ddf195a4b3 --- /dev/null +++ b/tools/ssprintf.cpp @@ -0,0 +1,1969 @@ +/* + * This program is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation; either version 2 of the License, or + * (at your option) any later version. + * + * This program 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 General Public License for more details. + * + * You should have received a copy of the GNU General Public License along + * with this program; if not, write to the Free Software Foundation, Inc., + * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. + */ + +// For character conversion functions like "wctomb" and "alloca" under Unix +#include + +#if defined(WIN32) + // Under Win32 hosts, "alloca" is not defined by stdlib.h, but by malloc.h + // On the other hand, malloc.h is deprecated under some Unix hosts, so only include it for Win32 hosts. + #include +#endif + +#include +#include +#include +#include +#include "ssprintf.h" + +#ifndef WIN32 +#define _finite __finite +#define _isnan __isnan +#endif + +#ifndef __APPLE__ +inline int iswdigit ( wchar_t c ) +{ + return ( c >= L'0' && c <= L'9' ); +} +#endif + +#if defined(__sun__) +#include +#include +#endif + +#if defined(__FreeBSD__) || defined(__APPLE__) || defined(__sun__) || defined(__CYGWIN__) +# define __isnan isnan +# define __finite finite +# define powl __builtin_powl +# define modfl __builtin_modfl +#endif // _FreeBSD__ + +#ifdef _MSC_VER +#define alloca _alloca +#endif//_MSC_VER + +#ifdef _MSC_VER +typedef __int64 LONGLONG; +typedef unsigned __int64 ULONGLONG; +#else +typedef long long LONGLONG; +typedef unsigned long long ULONGLONG; +#endif + +typedef struct { + unsigned int mantissa:23; + unsigned int exponent:8; + unsigned int sign:1; +} ieee_float_t; + +typedef struct { + unsigned int mantissal:32; + unsigned int mantissah:20; + unsigned int exponent:11; + unsigned int sign:1; +} ieee_double_t; + +typedef struct { + unsigned int mantissal:32; + unsigned int mantissah:32; + unsigned int exponent:15; + unsigned int sign:1; + unsigned int empty:16; +} ieee_long_double_t; + +std::string +ssprintf ( const char* fmt, ... ) +{ + va_list arg; + va_start(arg, fmt); + std::string f = ssvprintf ( fmt, arg ); + va_end(arg); + return f; +} + +std::wstring +sswprintf ( const wchar_t* fmt, ... ) +{ + va_list arg; + va_start(arg, fmt); + std::wstring f = sswvprintf ( fmt, arg ); + va_end(arg); + return f; +} + +#define ZEROPAD 1 /* pad with zero */ +#define SIGN 2 /* unsigned/signed long */ +#define PLUS 4 /* show plus */ +#define SPACE 8 /* space if plus */ +#define LEFT 16 /* left justified */ +#define SPECIAL 32 /* 0x */ +#define LARGE 64 /* use 'ABCDEF' instead of 'abcdef' */ +#define ZEROTRUNC 128 /* truncate zero 's */ + + +static int +skip_atoi(const char **s) +{ + int i=0; + + while (isdigit(**s)) + i = i*10 + *((*s)++) - '0'; + return i; +} + +static int +skip_wtoi(const wchar_t **s) +{ + int i=0; + + while (iswdigit(**s)) + i = i*10 + *((*s)++) - L'0'; + return i; +} + + +static int +do_div(LONGLONG *n,int base) +{ + int __res = ((ULONGLONG) *n) % (unsigned) base; + *n = ((ULONGLONG) *n) / (unsigned) base; + return __res; +} + + +static bool +number(std::string& f, LONGLONG num, int base, int size, int precision ,int type) +{ + char c,sign,tmp[66]; + const char *digits="0123456789abcdefghijklmnopqrstuvwxyz"; + int i; + + if (type & LARGE) + digits = "0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZ"; + if (type & LEFT) + type &= ~ZEROPAD; + if (base < 2 || base > 36) + return false; + c = (type & ZEROPAD) ? '0' : ' '; + sign = 0; + if (type & SIGN) { + if (num < 0) { + sign = '-'; + num = -num; + size--; + } else if (type & PLUS) { + sign = '+'; + size--; + } else if (type & SPACE) { + sign = ' '; + size--; + } + } + if (type & SPECIAL) { + if (base == 16) + size -= 2; + else if (base == 8) + size--; + } + i = 0; + if (num == 0) + tmp[i++]='0'; + else while (num != 0) + tmp[i++] = digits[do_div(&num,base)]; + if (i > precision) + precision = i; + size -= precision; + if (!(type&(ZEROPAD+LEFT))) + while(size-->0) + f += ' '; + if (sign) + f += sign; + if (type & SPECIAL) + { + if (base==8) + f += '0'; + else if (base==16) + { + f += '0'; + f += digits[33]; + } + } + if (!(type & LEFT)) + { + while (size-- > 0) + f += c; + } + while (i < precision--) + { + f += '0'; + } + while (i-- > 0) + { + f += tmp[i]; + } + while (size-- > 0) + { + f += ' '; + } + return true; +} + +static bool +wnumber(std::wstring& f, LONGLONG num, int base, int size, int precision ,int type) +{ + wchar_t c,sign,tmp[66]; + const wchar_t *digits = L"0123456789abcdefghijklmnopqrstuvwxyz"; + int i; + + if (type & LARGE) + digits = L"0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZ"; + if (type & LEFT) + type &= ~ZEROPAD; + if (base < 2 || base > 36) + return 0; + c = (type & ZEROPAD) ? L'0' : L' '; + sign = false; + if (type & SIGN) { + if (num < 0) { + sign = L'-'; + num = -num; + size--; + } else if (type & PLUS) { + sign = L'+'; + size--; + } else if (type & SPACE) { + sign = L' '; + size--; + } + } + if (type & SPECIAL) { + if (base == 16) + size -= 2; + else if (base == 8) + size--; + } + i = 0; + if (num == 0) + tmp[i++]=L'0'; + else while (num != 0) + tmp[i++] = digits[do_div(&num,base)]; + if (i > precision) + precision = i; + size -= precision; + if (!(type&(ZEROPAD+LEFT))) + while(size-->0) + f += L' '; + if (sign) + f += sign; + if (type & SPECIAL) + { + if (base==8) + f += L'0'; + else if (base==16) + { + f += L'0'; + f += digits[33]; + } + } + if (!(type & LEFT)) + { + while (size-- > 0) + f += c; + } + while (i < precision--) + { + f += L'0'; + } + while (i-- > 0) + { + f += tmp[i]; + } + while (size-- > 0) + { + f += L' '; + } + return true; +} + + +static bool +numberf(std::string& f, double __n, char exp_sign, int size, int precision, int type) +{ + double exponent = 0.0; + double e; + long ie; + + int i = 0; + int j = 0; + int ro = 0; + + double frac, intr; + double p; + char *buf, *tmp, sign, c; + int result; + + union + { + double* __n; + ieee_double_t* n; + } n; + + n.__n = &__n; + + if ( exp_sign == 'g' || exp_sign == 'G' || exp_sign == 'e' || exp_sign == 'E' ) + { + ie = ((unsigned int)n.n->exponent - (unsigned int)0x3ff); + exponent = ie/3.321928; + } + + if ( exp_sign == 'g' || exp_sign == 'G' ) + { + type |= ZEROTRUNC; + if ( exponent < -4 || fabs(exponent) >= precision ) + exp_sign -= 2; // g -> e and G -> E + else + exp_sign = 'f'; + } + + if ( exp_sign == 'e' || exp_sign == 'E' ) + { + frac = modf(exponent,&e); + if ( frac > 0.5 ) + e++; + else if ( frac < -0.5 ) + e--; + + result = numberf(f,__n/pow(10.0L,(long double)e),'f',size-4, precision, type); + if (result < 0) + return false; + f += exp_sign; + size--; + ie = (long)e; + type = LEFT | PLUS; + if ( ie < 0 ) + type |= SIGN; + + result = number(f,ie, 10,2, 2,type ); + if (result < 0) + return false; + return true; + } + + if ( exp_sign == 'f' ) + { + buf = (char*)alloca(4096); + if (type & LEFT) + type &= ~ZEROPAD; + + c = (type & ZEROPAD) ? '0' : ' '; + sign = 0; + if (type & SIGN) + { + if (__n < 0) + { + sign = '-'; + __n = fabs(__n); + size--; + } + else if (type & PLUS) + { + sign = '+'; + size--; + } + else if (type & SPACE) + { + sign = ' '; + size--; + } + } + + frac = modf(__n,&intr); + + // # flags forces a . and prevents trucation of trailing zero's + if ( precision > 0 ) + { + i = precision-1; + while ( i >= 0 ) + { + frac*=10.0L; + frac = modf(frac, &p); + buf[i] = (int)p + '0'; + i--; + } + i = precision; + size -= precision; + + ro = 0; + if ( frac > 0.5 ) + ro = 1; + + if ( precision >= 1 || type & SPECIAL) + { + buf[i++] = '.'; + size--; + } + } + + if ( intr == 0.0 ) + { + buf[i++] = '0'; + size--; + } + else + { + while ( intr > 0.0 ) + { + p = intr; + intr/=10.0L; + modf(intr, &intr); + + p -= 10.0*intr; + + buf[i++] = (int)p + '0'; + size--; + } + } + + j = 0; + while ( j < i && ro == 1) + { + if ( buf[j] >= '0' && buf[j] <= '8' ) + { + buf[j]++; + ro = 0; + } + else if ( buf[j] == '9' ) + { + buf[j] = '0'; + } + j++; + } + if ( ro == 1 ) + buf[i++] = '1'; + + buf[i] = 0; + + if (!(type&(ZEROPAD+LEFT))) + { + while(size-->0) + f += ' '; + } + if (sign) + { + f += sign; + } + + if (!(type&(ZEROPAD+LEFT))) + { + while(size-->0) + f += ' '; + } + + if (!(type & LEFT)) + { + while (size-- > 0) + f += c; + } + + tmp = buf; + if ( type & ZEROTRUNC && ((type & SPECIAL) != SPECIAL) ) + { + j = 0; + while ( j < i && ( *tmp == '0' || *tmp == '.' )) + { + tmp++; + i--; + } + } + while (i-- > 0) + { + f += tmp[i]; + } + while (size-- > 0) + { + f += ' '; + } + } + return true; +} + +static bool +wnumberf(std::wstring& f, double __n, wchar_t exp_sign, int size, int precision, int type) +{ + double exponent = 0.0; + double e; + long ie; + + int i = 0; + int j = 0; + int ro = 0; + + double frac, intr; + double p; + wchar_t *buf, *tmp, sign, c; + int result; + + union + { + double* __n; + ieee_double_t* n; + } n; + + n.__n = &__n; + + if ( exp_sign == L'g' || exp_sign == L'G' || exp_sign == L'e' || exp_sign == L'E' ) + { + ie = ((unsigned int)n.n->exponent - (unsigned int)0x3ff); + exponent = ie/3.321928; + } + + if ( exp_sign == L'g' || exp_sign == L'G' ) + { + type |= ZEROTRUNC; + if ( exponent < -4 || fabs(exponent) >= precision ) + exp_sign -= 2; // g -> e and G -> E + else + exp_sign = L'f'; + } + + if ( exp_sign == L'e' || exp_sign == L'E' ) + { + frac = modf(exponent,&e); + if ( frac > 0.5 ) + e++; + else if ( frac < -0.5 ) + e--; + + result = wnumberf(f,__n/pow(10.0L,(long double) e),L'f',size-4, precision, type); + if (result < 0) + return false; + f += exp_sign; + size--; + ie = (long)e; + type = LEFT | PLUS; + if ( ie < 0 ) + type |= SIGN; + + result = wnumber(f,ie, 10,2, 2,type ); + if (result < 0) + return false; + return true; + } + + if ( exp_sign == L'f' ) + { + buf = (wchar_t*)alloca(4096*sizeof(wchar_t)); + if (type & LEFT) + type &= ~ZEROPAD; + + c = (type & ZEROPAD) ? L'0' : L' '; + sign = 0; + if (type & SIGN) + { + if (__n < 0) + { + sign = L'-'; + __n = fabs(__n); + size--; + } + else if (type & PLUS) + { + sign = L'+'; + size--; + } + else if (type & SPACE) + { + sign = L' '; + size--; + } + } + + frac = modf(__n,&intr); + + // # flags forces a . and prevents trucation of trailing zero's + if ( precision > 0 ) + { + i = precision-1; + while ( i >= 0 ) + { + frac*=10.0L; + frac = modf(frac, &p); + buf[i] = (int)p + L'0'; + i--; + } + i = precision; + size -= precision; + + ro = 0; + if ( frac > 0.5 ) + ro = 1; + + if ( precision >= 1 || type & SPECIAL) + { + buf[i++] = L'.'; + size--; + } + } + + if ( intr == 0.0 ) + { + buf[i++] = L'0'; + size--; + } + else + { + while ( intr > 0.0 ) + { + p = intr; + intr/=10.0L; + modf(intr, &intr); + + p -= 10.0*intr; + + buf[i++] = (int)p + L'0'; + size--; + } + } + + j = 0; + while ( j < i && ro == 1) + { + if ( buf[j] >= L'0' && buf[j] <= L'8' ) + { + buf[j]++; + ro = 0; + } + else if ( buf[j] == L'9' ) + { + buf[j] = L'0'; + } + j++; + } + if ( ro == 1 ) + buf[i++] = L'1'; + + buf[i] = 0; + + if (!(type&(ZEROPAD+LEFT))) + { + while(size-->0) + f += L' '; + } + if (sign) + { + f += sign; + } + + if (!(type&(ZEROPAD+LEFT))) + { + while(size-->0) + f += L' '; + } + + if (!(type & LEFT)) + { + while (size-- > 0) + f += c; + } + + tmp = buf; + if ( type & ZEROTRUNC && ((type & SPECIAL) != SPECIAL) ) + { + j = 0; + while ( j < i && ( *tmp == L'0' || *tmp == L'.' )) + { + tmp++; + i--; + } + } + while (i-- > 0) + { + f += tmp[i]; + } + while (size-- > 0) + { + f += L' '; + } + } + return true; +} + +static bool +numberfl(std::string& f, long double __n, char exp_sign, int size, int precision, int type) +{ + long double exponent = 0.0; + long double e; + long ie; + + int i = 0; + int j = 0; + int ro = 0; + + long double frac, intr; + long double p; + char *buf, *tmp, sign, c; + int result; + + union + { + long double* __n; + ieee_long_double_t* n; + } n; + + n.__n = &__n; + + if ( exp_sign == 'g' || exp_sign == 'G' || exp_sign == 'e' || exp_sign == 'E' ) + { + ie = ((unsigned int)n.n->exponent - (unsigned int)0x3fff); + exponent = ie/3.321928; + } + + if ( exp_sign == 'g' || exp_sign == 'G' ) + { + type |= ZEROTRUNC; + if ( exponent < -4 || fabs(exponent) >= precision ) + exp_sign -= 2; // g -> e and G -> E + else + exp_sign = 'f'; + } + + if ( exp_sign == 'e' || exp_sign == 'E' ) + { + frac = modfl(exponent,&e); + if ( frac > 0.5 ) + e++; + else if ( frac < -0.5 ) + e--; + + result = numberf(f,__n/powl(10.0L,e),'f',size-4, precision, type); + if (result < 0) + return false; + f += exp_sign; + size--; + ie = (long)e; + type = LEFT | PLUS; + if ( ie < 0 ) + type |= SIGN; + + result = number(f,ie, 10,2, 2,type ); + if (result < 0) + return false; + return true; + } + + if ( exp_sign == 'f' ) + { + buf = (char*)alloca(4096); + if (type & LEFT) + type &= ~ZEROPAD; + + c = (type & ZEROPAD) ? '0' : ' '; + sign = 0; + if (type & SIGN) + { + if (__n < 0) + { + sign = '-'; + __n = fabs(__n); + size--; + } + else if (type & PLUS) + { + sign = '+'; + size--; + } + else if (type & SPACE) + { + sign = ' '; + size--; + } + } + + frac = modfl(__n,&intr); + + // # flags forces a . and prevents trucation of trailing zero's + if ( precision > 0 ) + { + i = precision-1; + while ( i >= 0 ) + { + frac*=10.0L; + frac = modfl((long double)frac, &p); + buf[i] = (int)p + '0'; + i--; + } + i = precision; + size -= precision; + + ro = 0; + if ( frac > 0.5 ) + ro = 1; + + if ( precision >= 1 || type & SPECIAL) + { + buf[i++] = '.'; + size--; + } + } + + if ( intr == 0.0 ) + { + buf[i++] = '0'; + size--; + } + else + { + while ( intr > 0.0 ) + { + p = intr; + intr/=10.0L; + modfl(intr, &intr); + + p -= 10.0L*intr; + + buf[i++] = (int)p + '0'; + size--; + } + } + + j = 0; + while ( j < i && ro == 1) + { + if ( buf[j] >= '0' && buf[j] <= '8' ) + { + buf[j]++; + ro = 0; + } + else if ( buf[j] == '9' ) + { + buf[j] = '0'; + } + j++; + } + if ( ro == 1 ) + buf[i++] = '1'; + + buf[i] = 0; + + if (!(type&(ZEROPAD+LEFT))) + { + while(size-->0) + f += ' '; + } + if (sign) + { + f += sign; + } + + if (!(type&(ZEROPAD+LEFT))) + { + while(size-->0) + f += ' '; + } + + if (!(type & LEFT)) + { + while (size-- > 0) + f += c; + } + + tmp = buf; + if ( type & ZEROTRUNC && ((type & SPECIAL) != SPECIAL) ) + { + j = 0; + while ( j < i && ( *tmp == '0' || *tmp == '.' )) + { + tmp++; + i--; + } + } + while (i-- > 0) + { + f += tmp[i]; + } + while (size-- > 0) + { + f += ' '; + } + } + return true; +} + +static bool +wnumberfl(std::wstring& f, long double __n, wchar_t exp_sign, int size, int precision, int type) +{ + long double exponent = 0.0; + long double e; + long ie; + + int i = 0; + int j = 0; + int ro = 0; + + long double frac, intr; + long double p; + wchar_t *buf, *tmp, sign, c; + int result; + + union + { + long double* __n; + ieee_long_double_t* n; + } n; + + n.__n = &__n; + + if ( exp_sign == L'g' || exp_sign == L'G' || exp_sign == L'e' || exp_sign == L'E' ) + { + ie = ((unsigned int)n.n->exponent - (unsigned int)0x3fff); + exponent = ie/3.321928; + } + + if ( exp_sign == L'g' || exp_sign == L'G' ) + { + type |= ZEROTRUNC; + if ( exponent < -4 || fabs(exponent) >= precision ) + exp_sign -= 2; // g -> e and G -> E + else + exp_sign = 'f'; + } + + if ( exp_sign == L'e' || exp_sign == L'E' ) + { + frac = modfl(exponent,&e); + if ( frac > 0.5 ) + e++; + else if ( frac < -0.5 ) + e--; + + result = wnumberf(f,__n/powl(10.0L,e),L'f',size-4, precision, type); + if (result < 0) + return false; + f += exp_sign; + size--; + ie = (long)e; + type = LEFT | PLUS; + if ( ie < 0 ) + type |= SIGN; + + result = wnumber(f,ie, 10,2, 2,type ); + if (result < 0) + return false; + return true; + } + + if ( exp_sign == L'f' ) + { + buf = (wchar_t*)alloca(4096*sizeof(wchar_t)); + if (type & LEFT) + type &= ~ZEROPAD; + + c = (type & ZEROPAD) ? L'0' : L' '; + sign = 0; + if (type & SIGN) + { + if (__n < 0) + { + sign = L'-'; + __n = fabs(__n); + size--; + } + else if (type & PLUS) + { + sign = L'+'; + size--; + } + else if (type & SPACE) + { + sign = L' '; + size--; + } + } + + frac = modfl(__n,&intr); + + // # flags forces a . and prevents trucation of trailing zero's + if ( precision > 0 ) + { + i = precision-1; + while ( i >= 0 ) + { + frac*=10.0L; + frac = modfl((long double)frac, &p); + buf[i] = (int)p + L'0'; + i--; + } + i = precision; + size -= precision; + + ro = 0; + if ( frac > 0.5 ) + ro = 1; + + if ( precision >= 1 || type & SPECIAL) + { + buf[i++] = L'.'; + size--; + } + } + + if ( intr == 0.0 ) + { + buf[i++] = L'0'; + size--; + } + else + { + while ( intr > 0.0 ) + { + p = intr; + intr/=10.0L; + modfl(intr, &intr); + + p -= 10.0L*intr; + + buf[i++] = (int)p + L'0'; + size--; + } + } + + j = 0; + while ( j < i && ro == 1) + { + if ( buf[j] >= L'0' && buf[j] <= L'8' ) + { + buf[j]++; + ro = 0; + } + else if ( buf[j] == L'9' ) + { + buf[j] = L'0'; + } + j++; + } + if ( ro == 1 ) + buf[i++] = L'1'; + + buf[i] = 0; + + if (!(type&(ZEROPAD+LEFT))) + { + while(size-->0) + f += L' '; + } + if (sign) + { + f += sign; + } + + if (!(type&(ZEROPAD+LEFT))) + { + while(size-->0) + f += L' '; + } + + if (!(type & LEFT)) + { + while (size-- > 0) + f += c; + } + + tmp = buf; + if ( type & ZEROTRUNC && ((type & SPECIAL) != SPECIAL) ) + { + j = 0; + while ( j < i && ( *tmp == L'0' || *tmp == L'.' )) + { + tmp++; + i--; + } + } + while (i-- > 0) + { + f += tmp[i]; + } + while (size-- > 0) + { + f += L' '; + } + } + return true; +} + +static int +do_string(std::string& f, const char* s, int len, int field_width, int precision, int flags) +{ + int i, done = 0; + if (s == NULL) + { + s = ""; + len = 6; + } + else + { + if (len == -1) + { + len = 0; + while ((unsigned int)len < (unsigned int)precision && s[len]) + len++; + } + else + { + if ((unsigned int)len > (unsigned int)precision) + len = precision; + } + } + if (!(flags & LEFT)) + while (len < field_width--) + { + f += ' '; + done++; + } + for (i = 0; i < len; ++i) + { + f += *s++; + done++; + } + while (len < field_width--) + { + f += ' '; + done++; + } + return done; +} + +static int +do_wstring(std::wstring& f, const wchar_t* s, int len, int field_width, int precision, int flags) +{ + int i, done = 0; + if (s == NULL) + { + s = L""; + len = 6; + } + else + { + if (len == -1) + { + len = 0; + while ((unsigned int)len < (unsigned int)precision && s[len]) + len++; + } + else + { + if ((unsigned int)len > (unsigned int)precision) + len = precision; + } + } + if (!(flags & LEFT)) + while (len < field_width--) + { + f += L' '; + done++; + } + for (i = 0; i < len; ++i) + { + f += *s++; + done++; + } + while (len < field_width--) + { + f += L' '; + done++; + } + return done; +} + +static int +stringw(std::string& f, const wchar_t* sw, int len, int field_width, int precision, int flags) +{ + int i, done = 0; + if (sw == NULL) + { + sw = L""; + len = 6; + } + else + { + if (len == -1) + { + len = 0; + while ((unsigned int)len < (unsigned int)precision && sw[len]) + len++; + } + else + { + if ((unsigned int)len > (unsigned int)precision) + len = precision; + } + } + if (!(flags & LEFT)) + while (len < field_width--) + { + f += ' '; + done++; + } + for (i = 0; i < len; ++i) + { +#define MY_MB_CUR_MAX 1 + char mb[MY_MB_CUR_MAX]; + int mbcount, j; + mbcount = wctomb(mb, *sw++); + if (mbcount <= 0) + { + break; + } + for (j = 0; j < mbcount; j++) + { + f += mb[j]; + done++; + } + } + while (len < field_width--) + { + f += ' '; + done++; + } + return done; +} + +static int +wstringa(std::wstring& f, const char* sa, int len, int field_width, int precision, int flags) +{ + int i, done = 0; + if (sa == NULL) + { + sa = ""; + len = 6; + } + else + { + if (len == -1) + { + len = 0; + while ((unsigned int)len < (unsigned int)precision && sa[len]) + len++; + } + else + { + if ((unsigned int)len > (unsigned int)precision) + len = precision; + } + } + if (!(flags & LEFT)) + while (len < field_width--) + { + f += L' '; + done++; + } + for (i = 0; i < len;) + { + wchar_t w; + int mbcount; + mbcount = mbtowc(&w, sa+i, len-i); + if (mbcount <= 0) + break; + f += w; + done++; + i += mbcount; + } + while (len < field_width--) + { + f += L' '; + done++; + } + return done; +} + +#define _isnanl _isnan +#define _finitel _finite + +std::string +ssvprintf ( const char *fmt, va_list args ) +{ + ULONGLONG num; + int base; + long double _ldouble; + double _double; + const char *s; + const wchar_t* sw; + int result; + std::string f; + + int flags; /* flags to number() */ + + int field_width; /* width of output field */ + int precision; /* min. # of digits for integers; max + number of chars for from string */ + int qualifier = 0; /* 'h', 'l', 'L' or 'I64' for integer fields */ + + for (; *fmt ; ++fmt) + { + if (*fmt != '%') + { + f += *fmt; + continue; + } + + /* process flags */ + flags = 0; + repeat: + ++fmt; /* this also skips first '%' */ + switch (*fmt) { + case '-': flags |= LEFT; goto repeat; + case '+': flags |= PLUS; goto repeat; + case ' ': flags |= SPACE; goto repeat; + case '#': flags |= SPECIAL; goto repeat; + case '0': flags |= ZEROPAD; goto repeat; + } + + /* get field width */ + field_width = -1; + if (isdigit(*fmt)) + field_width = skip_atoi(&fmt); + else if (*fmt == '*') { + ++fmt; + /* it's the next argument */ + field_width = va_arg(args, int); + if (field_width < 0) { + field_width = -field_width; + flags |= LEFT; + } + } + + /* get the precision */ + precision = -1; + if (*fmt == '.') { + ++fmt; + if (isdigit(*fmt)) + precision = skip_atoi(&fmt); + else if (*fmt == '*') { + ++fmt; + /* it's the next argument */ + precision = va_arg(args, int); + } + if (precision < 0) + precision = 0; + } + + /* get the conversion qualifier */ + qualifier = 0; + // %Z can be just stand alone or as size_t qualifier + if ( *fmt == 'Z' ) { + qualifier = *fmt; + switch ( *(fmt+1)) { + case 'o': + case 'b': + case 'X': + case 'x': + case 'd': + case 'i': + case 'u': + ++fmt; + break; + default: + break; + } + } else if (*fmt == 'h' || *fmt == 'l' || *fmt == 'L' || *fmt == 'w') { + qualifier = *fmt; + ++fmt; + } else if (*fmt == 'I' && *(fmt+1) == '6' && *(fmt+2) == '4') { + qualifier = *fmt; + fmt += 3; + } + + // go fine with ll instead of L + if ( *fmt == 'l' ) { + ++fmt; + qualifier = 'L'; + } + + /* default base */ + base = 10; + + switch (*fmt) { + case 'c': + if (!(flags & LEFT)) + while (--field_width > 0) + { + f += ' '; + } + if (qualifier == 'l' || qualifier == 'w') + { + f += (char)(unsigned char)(wchar_t) va_arg(args,int); + } + else + { + f += (char)(unsigned char) va_arg(args,int); + } + while (--field_width > 0) + { + f += ' '; + } + continue; + + case 'C': + if (!(flags & LEFT)) + while (--field_width > 0) + { + f += ' '; + } + if (qualifier == 'h') + { + f += (char)(unsigned char) va_arg(args,int); + } + else + { + f += (char)(unsigned char)(wchar_t) va_arg(args,int); + } + while (--field_width > 0) + { + f += ' '; + } + continue; + + case 's': + if (qualifier == 'l' || qualifier == 'w') { + /* print unicode string */ + sw = va_arg(args, wchar_t *); + result = stringw(f, sw, -1, field_width, precision, flags); + } else { + /* print ascii string */ + s = va_arg(args, char *); + result = do_string(f, s, -1, field_width, precision, flags); + } + if (result < 0) + { + assert(!"TODO FIXME handle error better"); + return f; + } + continue; + + case 'S': + if (qualifier == 'h') { + /* print ascii string */ + s = va_arg(args, char *); + result = do_string(f, s, -1, field_width, precision, flags); + } else { + /* print unicode string */ + sw = va_arg(args, wchar_t *); + result = stringw(f, sw, -1, field_width, precision, flags); + } + if (result < 0) + { + assert(!"TODO FIXME handle error better"); + return f; + } + continue; + + /*case 'Z': + if (qualifier == 'w') { + // print counted unicode string + PUNICODE_STRING pus = va_arg(args, PUNICODE_STRING); + if ((pus == NULL) || (pus->Buffer == NULL)) { + sw = NULL; + len = -1; + } else { + sw = pus->Buffer; + len = pus->Length / sizeof(WCHAR); + } + result = stringw(f, sw, len, field_width, precision, flags); + } else { + // print counted ascii string + PANSI_STRING pas = va_arg(args, PANSI_STRING); + if ((pas == NULL) || (pas->Buffer == NULL)) { + s = NULL; + len = -1; + } else { + s = pas->Buffer; + len = pas->Length; + } + result = string(f, s, -1, field_width, precision, flags); + } + if (result < 0) + return -1; + continue;*/ + + case 'e': + case 'E': + case 'f': + case 'g': + case 'G': + if (qualifier == 'l' || qualifier == 'L' ) { + _ldouble = va_arg(args, long double); + + if ( _isnanl(_ldouble) ) + { + f += "Nan"; + } + else if ( !_finitel(_ldouble) ) + { + if ( _ldouble < 0 ) + f += "-Inf"; + else + f += "+Inf"; + } else { + if ( precision == -1 ) + precision = 6; + result = numberfl(f,_ldouble,*fmt,field_width,precision,flags); + if (result < 0) + { + assert(!"TODO FIXME handle error better"); + return f; + } + } + } else { + _double = (double)va_arg(args, double); + + if ( _isnan(_double) ) + { + f += "Nan"; + } + else if ( !_finite(_double) ) + { + if ( _double < 0 ) + f += "-Inf"; + else + f += "+Inf"; + } + else + { + if ( precision == -1 ) + precision = 6; + result = numberf(f,_double,*fmt,field_width,precision,flags); + if (result < 0) + { + assert(!"TODO FIXME handle error better"); + return f; + } + } + } + continue; + + case 'p': + if (field_width == -1) { + field_width = 2*sizeof(void *); + flags |= ZEROPAD; + } + result = number(f, + (size_t) va_arg(args, void *), 16, + field_width, precision, flags); + if (result < 0) + { + assert(!"TODO FIXME handle error better"); + return f; + } + continue; + + case 'n': + if (qualifier == 'l') { + long * ip = va_arg(args, long *); + *ip = 0; + } else { + int * ip = va_arg(args, int *); + *ip = 0; + } + continue; + + /* integer number formats - set up the flags and "break" */ + case 'o': + base = 8; + break; + + case 'b': + base = 2; + break; + + case 'X': + flags |= LARGE; + case 'x': + base = 16; + break; + + case 'd': + case 'i': + flags |= SIGN; + case 'u': + break; + + default: + if (*fmt != '%') + { + f += '%'; + } + if (*fmt) + { + f += *fmt; + } + else + --fmt; + continue; + } + + if (qualifier == 'I') + num = va_arg(args, ULONGLONG); + else if (qualifier == 'l') { + if (flags & SIGN) + num = va_arg(args, long); + else + num = va_arg(args, unsigned long); + } + else if (qualifier == 'h') { + if (flags & SIGN) + num = va_arg(args, int); + else + num = va_arg(args, unsigned int); + } + else if (flags & SIGN) + num = va_arg(args, int); + else + num = va_arg(args, unsigned int); + result = number(f, num, base, field_width, precision, flags); + if (result < 0) + { + assert(!"TODO FIXME handle error better"); + return f; + } + } + //putc('\0',f); + return f; +} + +std::wstring +sswvprintf ( const wchar_t* fmt, va_list args ) +{ + ULONGLONG num; + int base; + long double _ldouble; + double _double; + const wchar_t* s; + const char* sa; + int result; + std::wstring f; + + int flags; /* flags to number() */ + + int field_width; /* width of output field */ + int precision; /* min. # of digits for integers; max + number of chars for from string */ + int qualifier = 0; /* 'h', 'l', 'L' or 'I64' for integer fields */ + + for (; *fmt ; ++fmt) + { + if (*fmt != L'%') + { + f += *fmt; + continue; + } + + /* process flags */ + flags = 0; + repeat: + ++fmt; /* this also skips first '%' */ + switch (*fmt) { + case L'-': flags |= LEFT; goto repeat; + case L'+': flags |= PLUS; goto repeat; + case L' ': flags |= SPACE; goto repeat; + case L'#': flags |= SPECIAL; goto repeat; + case L'0': flags |= ZEROPAD; goto repeat; + } + + /* get field width */ + field_width = -1; + if (isdigit(*fmt)) + field_width = skip_wtoi(&fmt); + else if (*fmt == L'*') { + ++fmt; + /* it's the next argument */ + field_width = va_arg(args, int); + if (field_width < 0) { + field_width = -field_width; + flags |= LEFT; + } + } + + /* get the precision */ + precision = -1; + if (*fmt == L'.') { + ++fmt; + if (iswdigit(*fmt)) + precision = skip_wtoi(&fmt); + else if (*fmt == L'*') { + ++fmt; + /* it's the next argument */ + precision = va_arg(args, int); + } + if (precision < 0) + precision = 0; + } + + /* get the conversion qualifier */ + qualifier = 0; + // %Z can be just stand alone or as size_t qualifier + if ( *fmt == L'Z' ) { + qualifier = *fmt; + switch ( *(fmt+1)) { + case L'o': + case L'b': + case L'X': + case L'x': + case L'd': + case L'i': + case L'u': + ++fmt; + break; + default: + break; + } + } else if (*fmt == L'h' || *fmt == L'l' || *fmt == L'L' || *fmt == L'w') { + qualifier = *fmt; + ++fmt; + } else if (*fmt == L'I' && *(fmt+1) == L'6' && *(fmt+2) == L'4') { + qualifier = *fmt; + fmt += 3; + } + + // go fine with ll instead of L + if ( *fmt == L'l' ) { + ++fmt; + qualifier = L'L'; + } + + /* default base */ + base = 10; + + switch (*fmt) { + case L'c': + if (!(flags & LEFT)) + while (--field_width > 0) + { + f += L' '; + } + if ( qualifier == L'h' ) + { + f += (wchar_t)(char)(unsigned char) va_arg(args,int); + } + else + { + f += (wchar_t) va_arg(args,int); + } + while (--field_width > 0) + { + f += ' '; + } + continue; + + case 'C': + if (!(flags & LEFT)) + while (--field_width > 0) + { + f += L' '; + } + if (qualifier == L'l' || qualifier == L'w') + { + f += (wchar_t) va_arg(args,int); + } + else + { + f += (wchar_t)(char)(unsigned char) va_arg(args,int); + } + while (--field_width > 0) + { + f += L' '; + } + continue; + + case 's': + if (qualifier == L'h') { + /* print ascii string */ + sa = va_arg(args, char *); + result = wstringa(f, sa, -1, field_width, precision, flags); + } else { + /* print unicode string */ + s = va_arg(args, wchar_t *); + result = do_wstring(f, s, -1, field_width, precision, flags); + } + if (result < 0) + { + assert(!"TODO FIXME handle error better"); + return f; + } + continue; + + case 'S': + if (qualifier == L'l' || qualifier == L'w') { + /* print unicode string */ + s = va_arg(args, wchar_t *); + result = do_wstring(f, s, -1, field_width, precision, flags); + } else { + /* print ascii string */ + sa = va_arg(args, char *); + result = wstringa(f, sa, -1, field_width, precision, flags); + } + if (result < 0) + { + assert(!"TODO FIXME handle error better"); + return f; + } + continue; + + case L'e': + case L'E': + case L'f': + case L'g': + case L'G': + if (qualifier == L'l' || qualifier == L'L' ) + { + _ldouble = va_arg(args, long double); + + if ( _isnanl(_ldouble) ) + { + f += L"Nan"; + } + else if ( !_finitel(_ldouble) ) + { + if ( _ldouble < 0 ) + f += L"-Inf"; + else + f += L"+Inf"; + } else { + if ( precision == -1 ) + precision = 6; + result = wnumberfl(f,_ldouble,*fmt,field_width,precision,flags); + if (result < 0) + { + assert(!"TODO FIXME handle error better"); + return f; + } + } + } else { + _double = (double)va_arg(args, double); + + if ( _isnan(_double) ) + { + f += L"Nan"; + } + else if ( !_finite(_double) ) + { + if ( _double < 0 ) + f += L"-Inf"; + else + f += L"+Inf"; + } + else + { + if ( precision == -1 ) + precision = 6; + result = wnumberf(f,_double,*fmt,field_width,precision,flags); + if (result < 0) + { + assert(!"TODO FIXME handle error better"); + return f; + } + } + } + continue; + + case L'p': + if (field_width == -1) { + field_width = 2*sizeof(void *); + flags |= ZEROPAD; + } + result = wnumber(f, + (size_t) va_arg(args, void *), 16, + field_width, precision, flags); + if (result < 0) + { + assert(!"TODO FIXME handle error better"); + return f; + } + continue; + + case L'n': + if (qualifier == L'l') { + long * ip = va_arg(args, long *); + *ip = 0; + } else { + int * ip = va_arg(args, int *); + *ip = 0; + } + continue; + + /* integer number formats - set up the flags and "break" */ + case L'o': + base = 8; + break; + + case L'b': + base = 2; + break; + + case L'X': + flags |= LARGE; + case L'x': + base = 16; + break; + + case L'd': + case L'i': + flags |= SIGN; + case L'u': + break; + + default: + if (*fmt != L'%') + { + f += L'%'; + } + if (*fmt) + { + f += *fmt; + } + else + --fmt; + continue; + } + + if (qualifier == L'I') + num = va_arg(args, ULONGLONG); + else if (qualifier == L'l') { + if (flags & SIGN) + num = va_arg(args, long); + else + num = va_arg(args, unsigned long); + } + else if (qualifier == L'h') { + if (flags & SIGN) + num = va_arg(args, int); + else + num = va_arg(args, unsigned int); + } + else if (flags & SIGN) + num = va_arg(args, int); + else + num = va_arg(args, unsigned int); + result = wnumber(f, num, base, field_width, precision, flags); + if (result < 0) + { + assert(!"TODO FIXME handle error better"); + return f; + } + } + //putc('\0',f); + return f; +} diff --git a/tools/ssprintf.h b/tools/ssprintf.h new file mode 100644 index 00000000000..6e105542be0 --- /dev/null +++ b/tools/ssprintf.h @@ -0,0 +1,40 @@ +/* + * This program is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation; either version 2 of the License, or + * (at your option) any later version. + * + * This program 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 General Public License for more details. + * + * You should have received a copy of the GNU General Public License along + * with this program; if not, write to the Free Software Foundation, Inc., + * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. + */ + +#pragma once + +#include +#include + +#ifdef __CYGWIN__ +namespace std { + typedef basic_string wstring; +} +#endif + +std::string ssprintf ( const char* fmt, ... ); +std::string ssvprintf ( const char* fmt, va_list args ); + +std::wstring sswprintf ( const wchar_t* fmt, ... ); +std::wstring sswvprintf ( const wchar_t* fmt, va_list args ); + +#ifdef _UNICODE +#define sstprintf sswprintf +#define sstvprintf sswvprintf +#else +#define sstprintf ssprintf +#define sstvprintf ssvprintf +#endif diff --git a/tools/tools.mak b/tools/tools.mak new file mode 100644 index 00000000000..d2d846c749c --- /dev/null +++ b/tools/tools.mak @@ -0,0 +1,54 @@ +TOOLS_BASE = tools +TOOLS_BASE_ = $(TOOLS_BASE)$(SEP) +TOOLS_INT = $(INTERMEDIATE_)$(TOOLS_BASE) +TOOLS_INT_ = $(TOOLS_INT)$(SEP) +TOOLS_OUT = $(OUTPUT_)$(TOOLS_BASE) +TOOLS_OUT_ = $(TOOLS_OUT)$(SEP) + +TOOLS_CFLAGS = -Wall -Wpointer-arith -Wno-strict-aliasing -D__REACTOS__ $(HOST_CFLAGS) +TOOLS_CPPFLAGS = -Wall -Wpointer-arith -D__REACTOS__ $(HOST_CPPFLAGS) +TOOLS_LFLAGS = $(HOST_LFLAGS) + +$(TOOLS_INT): | $(INTERMEDIATE) + $(ECHO_MKDIR) + ${mkdir} $@ + +ifneq ($(INTERMEDIATE),$(OUTPUT)) +$(TOOLS_OUT): | $(OUTPUT) + $(ECHO_MKDIR) + ${mkdir} $@ +endif + +XML_SSPRINTF_SOURCES = $(addprefix $(TOOLS_BASE_), \ + ssprintf.cpp \ + xml.cpp \ + ) + +XML_SSPRINTF_HEADERS = $(addprefix $(TOOLS_BASE_), \ + ssprintf.h \ + xml.h \ + ) + +XML_SSPRINTF_OBJECTS = \ + $(addprefix $(INTERMEDIATE_), $(XML_SSPRINTF_SOURCES:.cpp=.o)) + +$(TOOLS_INT_)ssprintf.o: $(TOOLS_BASE_)ssprintf.cpp $(XML_SSPRINTF_HEADERS) | $(TOOLS_INT) + $(ECHO_HOSTCC) + ${host_gpp} $(TOOLS_CPPFLAGS) -c $< -o $@ + +$(TOOLS_INT_)xml.o: $(TOOLS_BASE_)xml.cpp $(XML_SSPRINTF_HEADERS) | $(TOOLS_INT) + $(ECHO_HOSTCC) + ${host_gpp} $(TOOLS_CPPFLAGS) -c $< -o $@ + +include tools/bin2c.mak +include tools/buildno/buildno.mak +include tools/gendib/gendib.mak +include tools/log2lines/log2lines.mak +include tools/pipetools/pipetools.mak +ifeq ($(ARCH),powerpc) +include tools/ofw_interface/ofw_interface.mak +endif +include tools/pefixup.mak +include tools/rsym/raddr2line.mak +include tools/rbuild/rbuild.mak +include tools/rsym/rsym.mak diff --git a/tools/tools.rbuild b/tools/tools.rbuild new file mode 100644 index 00000000000..2681dbfa154 --- /dev/null +++ b/tools/tools.rbuild @@ -0,0 +1,49 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/tools/unicode/unicode.rbuild b/tools/unicode/unicode.rbuild new file mode 100644 index 00000000000..17c11935b2e --- /dev/null +++ b/tools/unicode/unicode.rbuild @@ -0,0 +1,74 @@ + + + + casemap.c + compose.c + cptable.c + mbtowc.c + string.c + wctomb.c + wctype.c + utf8.c + c_037.c + c_424.c + c_437.c + c_500.c + c_737.c + c_775.c + c_850.c + c_852.c + c_855.c + c_856.c + c_857.c + c_860.c + c_861.c + c_862.c + c_863.c + c_864.c + c_865.c + c_866.c + c_869.c + c_874.c + c_875.c + c_878.c + c_932.c + c_936.c + c_949.c + c_950.c + c_1006.c + c_1026.c + c_1250.c + c_1251.c + c_1252.c + c_1253.c + c_1254.c + c_1255.c + c_1256.c + c_1257.c + c_1258.c + c_1361.c + c_10000.c + c_10006.c + c_10007.c + c_10029.c + c_10079.c + c_10081.c + c_20866.c + c_20932.c + c_20127.c + c_21866.c + c_28591.c + c_28592.c + c_28593.c + c_28594.c + c_28595.c + c_28596.c + c_28597.c + c_28598.c + c_28599.c + c_28600.c + c_28603.c + c_28604.c + c_28605.c + c_28606.c + diff --git a/tools/utf16le/utf16le.rbuild b/tools/utf16le/utf16le.rbuild new file mode 100644 index 00000000000..e0d71a05fb0 --- /dev/null +++ b/tools/utf16le/utf16le.rbuild @@ -0,0 +1,5 @@ + + + + utf16le.cpp + diff --git a/tools/widl/widl.rbuild b/tools/widl/widl.rbuild new file mode 100644 index 00000000000..3e1382827f4 --- /dev/null +++ b/tools/widl/widl.rbuild @@ -0,0 +1,26 @@ + + + + SHORT + 1 + . + wpp + client.c + expr.c + hash.c + header.c + proxy.c + register.c + server.c + typegen.c + typelib.c + typetree.c + utils.c + widl.c + write_msft.c + parser.yy.c + parser.tab.c + + mkstemps.c + + diff --git a/tools/winebuild/Makefile.in b/tools/winebuild/Makefile.in new file mode 100644 index 00000000000..c4ae029efe8 --- /dev/null +++ b/tools/winebuild/Makefile.in @@ -0,0 +1,39 @@ +TOPSRCDIR = @top_srcdir@ +TOPOBJDIR = ../.. +SRCDIR = @srcdir@ +VPATH = @srcdir@ +EXEEXT = @EXEEXT@ +DEFS = -D__WINESRC__ $(EXTRADEFS) + +PROGRAMS = winebuild$(EXEEXT) +MANPAGES = winebuild.man +MODULE = none + +C_SRCS = \ + import.c \ + main.c \ + parser.c \ + relay.c \ + res16.c \ + res32.c \ + spec16.c \ + spec32.c \ + utils.c + +INSTALLDIRS = $(DESTDIR)$(bindir) $(DESTDIR)$(mandir)/man$(prog_manext) + +all: $(PROGRAMS) $(MANPAGES) + +@MAKE_RULES@ + +winebuild$(EXEEXT): $(OBJS) + $(CC) $(CFLAGS) -o $@ $(OBJS) $(LIBPORT) $(LDFLAGS) + +install install-dev:: $(PROGRAMS) $(MANPAGES) $(INSTALLDIRS) + $(INSTALL_PROGRAM) winebuild$(EXEEXT) $(DESTDIR)$(bindir)/winebuild$(EXEEXT) + $(INSTALL_DATA) winebuild.man $(DESTDIR)$(mandir)/man$(prog_manext)/winebuild.$(prog_manext) + +uninstall:: + $(RM) $(DESTDIR)$(bindir)/winebuild$(EXEEXT) $(DESTDIR)$(mandir)/man$(prog_manext)/winebuild.$(prog_manext) + +@DEPENDENCIES@ # everything below this line is overwritten by make depend diff --git a/tools/winebuild/build.h b/tools/winebuild/build.h new file mode 100644 index 00000000000..39e04b2a477 --- /dev/null +++ b/tools/winebuild/build.h @@ -0,0 +1,329 @@ +/* + * Copyright 1993 Robert J. Amstadt + * Copyright 1995 Martin von Loewis + * Copyright 1995, 1996, 1997 Alexandre Julliard + * Copyright 1997 Eric Youngdale + * Copyright 1999 Ulrich Weigand + * + * 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_BUILD_H +#define __WINE_BUILD_H + +#ifndef __WINE_CONFIG_H +# error You must include config.h to use this header +#endif + +#include +#include +#include + +#ifndef max +#define max(a,b) (((a) > (b)) ? (a) : (b)) +#endif +#ifndef min +#define min(a,b) (((a) < (b)) ? (a) : (b)) +#endif + +#define EXEEXT ".exe" + +typedef enum +{ + TYPE_VARIABLE, /* variable */ + TYPE_PASCAL, /* pascal function (Win16) */ + TYPE_ABS, /* absolute value (Win16) */ + TYPE_STUB, /* unimplemented stub */ + TYPE_STDCALL, /* stdcall function (Win32) */ + TYPE_CDECL, /* cdecl function (Win32) */ + TYPE_VARARGS, /* varargs function (Win32) */ + TYPE_FASTCALL, /* fastcall function (Win32) */ + TYPE_EXTERN, /* external symbol (Win32) */ + TYPE_NBTYPES +} ORD_TYPE; + +typedef enum +{ + SPEC_WIN16, + SPEC_WIN32 +} SPEC_TYPE; + +typedef struct +{ + int n_values; + int *values; +} ORD_VARIABLE; + +typedef struct +{ + char arg_types[21]; +} ORD_FUNCTION; + +typedef struct +{ + unsigned short value; +} ORD_ABS; + +typedef struct +{ + ORD_TYPE type; + int ordinal; + int lineno; + int flags; + char *name; /* public name of this function */ + char *link_name; /* name of the C symbol to link to */ + char *export_name; /* name exported under for noname exports */ + union + { + ORD_VARIABLE var; + ORD_FUNCTION func; + ORD_ABS abs; + } u; +} ORDDEF; + +typedef struct +{ + char *src_name; /* file name of the source spec file */ + char *file_name; /* file name of the dll */ + char *dll_name; /* internal name of the dll */ + char *init_func; /* initialization routine */ + char *main_module; /* main Win32 module for Win16 specs */ + SPEC_TYPE type; /* type of dll (Win16/Win32) */ + int base; /* ordinal base */ + int limit; /* ordinal limit */ + int stack_size; /* exe stack size */ + int heap_size; /* exe heap size */ + int nb_entry_points; /* number of used entry points */ + int alloc_entry_points; /* number of allocated entry points */ + int nb_names; /* number of entry points with names */ + unsigned int nb_resources; /* number of resources */ + int characteristics; /* characteristics for the PE header */ + int dll_characteristics;/* DLL characteristics for the PE header */ + int subsystem; /* subsystem id */ + int subsystem_major; /* subsystem version major number */ + int subsystem_minor; /* subsystem version minor number */ + ORDDEF *entry_points; /* dll entry points */ + ORDDEF **names; /* array of entry point names (points into entry_points) */ + ORDDEF **ordinals; /* array of dll ordinals (points into entry_points) */ + struct resource *resources; /* array of dll resources (format differs between Win16/Win32) */ +} DLLSPEC; + +enum target_cpu +{ + CPU_x86, CPU_x86_64, CPU_SPARC, CPU_ALPHA, CPU_POWERPC, CPU_ARM, CPU_LAST = CPU_ARM +}; + +enum target_platform +{ + PLATFORM_UNSPECIFIED, + PLATFORM_APPLE, + PLATFORM_FREEBSD, + PLATFORM_SOLARIS, + PLATFORM_WINDOWS +}; + +extern char *target_alias; +extern enum target_cpu target_cpu; +extern enum target_platform target_platform; + +/* entry point flags */ +#define FLAG_NORELAY 0x01 /* don't use relay debugging for this function */ +#define FLAG_NONAME 0x02 /* don't export function by name */ +#define FLAG_RET16 0x04 /* function returns a 16-bit value */ +#define FLAG_RET64 0x08 /* function returns a 64-bit value */ +#define FLAG_REGISTER 0x10 /* use register calling convention */ +#define FLAG_PRIVATE 0x20 /* function is private (cannot be imported) */ +#define FLAG_ORDINAL 0x40 /* function should be imported by ordinal */ + +#define FLAG_FORWARD 0x100 /* function is a forwarded name */ +#define FLAG_EXT_LINK 0x200 /* function links to an external symbol */ + +#define FLAG_CPU(cpu) (0x01000 << (cpu)) +#define FLAG_CPU_MASK (FLAG_CPU(CPU_LAST + 1) - FLAG_CPU(0)) +#define FLAG_CPU_WIN64 (FLAG_CPU(CPU_x86_64)) +#define FLAG_CPU_WIN32 (FLAG_CPU_MASK & ~FLAG_CPU_WIN64) + +#define MAX_ORDINALS 65535 + +/* some Windows constants */ + +#define IMAGE_FILE_RELOCS_STRIPPED 0x0001 /* No relocation info */ +#define IMAGE_FILE_EXECUTABLE_IMAGE 0x0002 +#define IMAGE_FILE_LINE_NUMS_STRIPPED 0x0004 +#define IMAGE_FILE_LOCAL_SYMS_STRIPPED 0x0008 +#define IMAGE_FILE_AGGRESIVE_WS_TRIM 0x0010 +#define IMAGE_FILE_LARGE_ADDRESS_AWARE 0x0020 +#define IMAGE_FILE_16BIT_MACHINE 0x0040 +#define IMAGE_FILE_BYTES_REVERSED_LO 0x0080 +#define IMAGE_FILE_32BIT_MACHINE 0x0100 +#define IMAGE_FILE_DEBUG_STRIPPED 0x0200 +#define IMAGE_FILE_REMOVABLE_RUN_FROM_SWAP 0x0400 +#define IMAGE_FILE_NET_RUN_FROM_SWAP 0x0800 +#define IMAGE_FILE_SYSTEM 0x1000 +#define IMAGE_FILE_DLL 0x2000 +#define IMAGE_FILE_UP_SYSTEM_ONLY 0x4000 +#define IMAGE_FILE_BYTES_REVERSED_HI 0x8000 + +#define IMAGE_DLLCHARACTERISTICS_NX_COMPAT 0x0100 + +#define IMAGE_SUBSYSTEM_NATIVE 1 +#define IMAGE_SUBSYSTEM_WINDOWS_GUI 2 +#define IMAGE_SUBSYSTEM_WINDOWS_CUI 3 + +/* global functions */ + +#ifndef __GNUC__ +#define __attribute__(X) +#endif + +#ifndef DECLSPEC_NORETURN +# if defined(_MSC_VER) && (_MSC_VER >= 1200) && !defined(MIDL_PASS) +# define DECLSPEC_NORETURN __declspec(noreturn) +# else +# define DECLSPEC_NORETURN __attribute__((noreturn)) +# endif +#endif + +extern void *xmalloc (size_t size); +extern void *xrealloc (void *ptr, size_t size); +extern char *xstrdup( const char *str ); +extern char *strupper(char *s); +extern int strendswith(const char* str, const char* end); +extern DECLSPEC_NORETURN void fatal_error( const char *msg, ... ) + __attribute__ ((__format__ (__printf__, 1, 2))); +extern DECLSPEC_NORETURN void fatal_perror( const char *msg, ... ) + __attribute__ ((__format__ (__printf__, 1, 2))); +extern void error( const char *msg, ... ) + __attribute__ ((__format__ (__printf__, 1, 2))); +extern void warning( const char *msg, ... ) + __attribute__ ((__format__ (__printf__, 1, 2))); +extern int output( const char *format, ... ) + __attribute__ ((__format__ (__printf__, 1, 2))); +extern const char *get_as_command(void); +extern const char *get_ld_command(void); +extern const char *get_nm_command(void); +extern const char *get_windres_command(void); +extern char *get_temp_file_name( const char *prefix, const char *suffix ); +extern void output_standard_file_header(void); +extern FILE *open_input_file( const char *srcdir, const char *name ); +extern void close_input_file( FILE *file ); +extern void dump_bytes( const void *buffer, unsigned int size ); +extern int remove_stdcall_decoration( char *name ); +extern void assemble_file( const char *src_file, const char *obj_file ); +extern DLLSPEC *alloc_dll_spec(void); +extern void free_dll_spec( DLLSPEC *spec ); +extern const char *make_c_identifier( const char *str ); +extern const char *get_stub_name( const ORDDEF *odp, const DLLSPEC *spec ); +extern enum target_cpu get_cpu_from_name( const char *name ); +extern unsigned int get_alignment(unsigned int align); +extern unsigned int get_page_size(void); +extern unsigned int get_ptr_size(void); +extern const char *asm_name( const char *func ); +extern const char *func_declaration( const char *func ); +extern const char *asm_globl( const char *func ); +extern const char *get_asm_ptr_keyword(void); +extern const char *get_asm_string_keyword(void); +extern const char *get_asm_short_keyword(void); +extern const char *get_asm_rodata_section(void); +extern const char *get_asm_string_section(void); +extern void output_function_size( const char *name ); +extern void output_gnu_stack_note(void); + +extern void add_import_dll( const char *name, const char *filename ); +extern void add_delayed_import( const char *name ); +extern void add_ignore_symbol( const char *name ); +extern void add_extra_ld_symbol( const char *name ); +extern void read_undef_symbols( DLLSPEC *spec, char **argv ); +extern int resolve_imports( DLLSPEC *spec ); +extern int has_imports(void); +extern int has_relays( DLLSPEC *spec ); +extern void output_get_pc_thunk(void); +extern void output_module( DLLSPEC *spec ); +extern void output_stubs( DLLSPEC *spec ); +extern void output_imports( DLLSPEC *spec ); +extern void output_exports( DLLSPEC *spec ); +extern int load_res32_file( const char *name, DLLSPEC *spec ); +extern void output_resources( DLLSPEC *spec ); +extern void output_bin_resources( DLLSPEC *spec, unsigned int start_rva ); +extern void output_fake_module( DLLSPEC *spec ); +extern void load_res16_file( const char *name, DLLSPEC *spec ); +extern void output_res16_data( DLLSPEC *spec ); +extern void output_bin_res16_data( DLLSPEC *spec ); +extern void output_res16_directory( DLLSPEC *spec ); +extern void output_bin_res16_directory( DLLSPEC *spec, unsigned int data_offset ); +extern void output_spec16_file( DLLSPEC *spec ); +extern void output_fake_module16( DLLSPEC *spec16 ); +extern void output_res_o_file( DLLSPEC *spec ); + +extern void BuildRelays16(void); +extern void BuildRelays32(void); +extern void BuildSpec16File( DLLSPEC *spec ); +extern void BuildSpec32File( DLLSPEC *spec ); +extern void BuildDef32File( DLLSPEC *spec ); +extern void BuildPedllFile( DLLSPEC *spec ); + +extern void add_16bit_exports( DLLSPEC *spec32, DLLSPEC *spec16 ); +extern int parse_spec_file( FILE *file, DLLSPEC *spec ); +extern int parse_def_file( FILE *file, DLLSPEC *spec ); + +/* buffer management */ + +extern int byte_swapped; +extern const char *input_buffer_filename; +extern const unsigned char *input_buffer; +extern size_t input_buffer_pos; +extern size_t input_buffer_size; +extern unsigned char *output_buffer; +extern size_t output_buffer_pos; +extern size_t output_buffer_size; + +extern void init_input_buffer( const char *file ); +extern void init_output_buffer(void); +extern void flush_output_buffer(void); +extern unsigned char get_byte(void); +extern unsigned short get_word(void); +extern unsigned int get_dword(void); +extern void put_data( const void *data, size_t size ); +extern void put_byte( unsigned char val ); +extern void put_word( unsigned short val ); +extern void put_dword( unsigned int val ); +extern void put_qword( unsigned int val ); +extern void put_pword( unsigned int val ); +extern void align_output( unsigned int align ); + +/* global variables */ + +extern int current_line; +extern int UsePIC; +extern int nb_lib_paths; +extern int nb_errors; +extern int display_warnings; +extern int kill_at; +extern int verbose; +extern int save_temps; +extern int link_ext_symbols; +extern int force_pointer_size; + +extern char *input_file_name; +extern char *spec_file_name; +extern FILE *output_file; +extern const char *output_file_name; +extern char **lib_path; + +extern char *as_command; +extern char *ld_command; +extern char *nm_command; + +#endif /* __WINE_BUILD_H */ diff --git a/tools/winebuild/import.c b/tools/winebuild/import.c new file mode 100644 index 00000000000..d41a754ac41 --- /dev/null +++ b/tools/winebuild/import.c @@ -0,0 +1,1306 @@ +/* + * DLL imports support + * + * Copyright 2000, 2004 Alexandre Julliard + * Copyright 2000 Eric Pouech + * + * 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 + */ + +#include "config.h" +#include "wine/port.h" + +#include +#include +#include +#include +#include +#include +#ifdef HAVE_SYS_STAT_H +# include +#endif +#ifdef HAVE_UNISTD_H +# include +#endif + +#include "build.h" + +struct import +{ + DLLSPEC *spec; /* description of the imported dll */ + char *full_name; /* full name of the input file */ + dev_t dev; /* device/inode of the input file */ + ino_t ino; + int delay; /* delay or not dll loading ? */ + ORDDEF **exports; /* functions exported from this dll */ + int nb_exports; /* number of exported functions */ + ORDDEF **imports; /* functions we want to import from this dll */ + int nb_imports; /* number of imported functions */ +}; + +struct name_table +{ + char **names; + unsigned int count, size; +}; + +static struct name_table undef_symbols; /* list of undefined symbols */ +static struct name_table ignore_symbols; /* list of symbols to ignore */ +static struct name_table extra_ld_symbols; /* list of extra symbols that ld should resolve */ +static struct name_table delayed_imports; /* list of delayed import dlls */ +static struct name_table ext_link_imports; /* list of external symbols to link to */ + +static struct import **dll_imports = NULL; +static int nb_imports = 0; /* number of imported dlls (delayed or not) */ +static int nb_delayed = 0; /* number of delayed dlls */ +static int total_imports = 0; /* total number of imported functions */ +static int total_delayed = 0; /* total number of imported functions in delayed DLLs */ + + +static inline const char *ppc_reg( int reg ) +{ + static const char * const ppc_regs[32] = { "r0", "r1", "r2", "r3", "r4", "r5", "r6", "r7", + "r8", "r9", "r10","r11","r12","r13","r14","r15", + "r16","r17","r18","r19","r20","r21","r22","r23", + "r24","r25","r26","r27","r28","r29","r30","r31" }; + if (target_platform == PLATFORM_APPLE) return ppc_regs[reg]; + return ppc_regs[reg] + 1; /* skip the 'r' */ +} + +/* compare function names; helper for resolve_imports */ +static int name_cmp( const void *name, const void *entry ) +{ + return strcmp( *(const char* const *)name, *(const char* const *)entry ); +} + +/* compare function names; helper for resolve_imports */ +static int func_cmp( const void *func1, const void *func2 ) +{ + const ORDDEF *odp1 = *(const ORDDEF * const *)func1; + const ORDDEF *odp2 = *(const ORDDEF * const *)func2; + return strcmp( odp1->name ? odp1->name : odp1->export_name, + odp2->name ? odp2->name : odp2->export_name ); +} + +/* add a name to a name table */ +static inline void add_name( struct name_table *table, const char *name ) +{ + if (table->count == table->size) + { + table->size += (table->size / 2); + if (table->size < 32) table->size = 32; + table->names = xrealloc( table->names, table->size * sizeof(*table->names) ); + } + table->names[table->count++] = xstrdup( name ); +} + +/* remove a name from a name table */ +static inline void remove_name( struct name_table *table, unsigned int idx ) +{ + assert( idx < table->count ); + free( table->names[idx] ); + memmove( table->names + idx, table->names + idx + 1, + (table->count - idx - 1) * sizeof(*table->names) ); + table->count--; +} + +/* make a name table empty */ +static inline void empty_name_table( struct name_table *table ) +{ + unsigned int i; + + for (i = 0; i < table->count; i++) free( table->names[i] ); + table->count = 0; +} + +/* locate a name in a (sorted) list */ +static inline const char *find_name( const char *name, const struct name_table *table ) +{ + char **res = NULL; + + if (table->count) res = bsearch( &name, table->names, table->count, sizeof(*table->names), name_cmp ); + return res ? *res : NULL; +} + +/* sort a name table */ +static inline void sort_names( struct name_table *table ) +{ + if (table->count) qsort( table->names, table->count, sizeof(*table->names), name_cmp ); +} + +/* locate an export in a (sorted) export list */ +static inline ORDDEF *find_export( const char *name, ORDDEF **table, int size ) +{ + ORDDEF func, *odp, **res = NULL; + + func.name = xstrdup(name); + func.ordinal = -1; + odp = &func; + if (table) res = bsearch( &odp, table, size, sizeof(*table), func_cmp ); + free( func.name ); + return res ? *res : NULL; +} + +/* free an import structure */ +static void free_imports( struct import *imp ) +{ + free( imp->exports ); + free( imp->imports ); + free_dll_spec( imp->spec ); + free( imp->full_name ); + free( imp ); +} + +/* check whether a given dll is imported in delayed mode */ +static int is_delayed_import( const char *name ) +{ + unsigned int i; + + for (i = 0; i < delayed_imports.count; i++) + { + if (!strcmp( delayed_imports.names[i], name )) return 1; + } + return 0; +} + +/* check whether a given dll has already been imported */ +static struct import *is_already_imported( const char *name ) +{ + int i; + + for (i = 0; i < nb_imports; i++) + { + if (!strcmp( dll_imports[i]->spec->file_name, name )) return dll_imports[i]; + } + return NULL; +} + +/* open the .so library for a given dll in a specified path */ +static char *try_library_path( const char *path, const char *name ) +{ + char *buffer; + int fd; + + buffer = xmalloc( strlen(path) + strlen(name) + 9 ); + sprintf( buffer, "%s/lib%s.def", path, name ); + + /* check if the file exists */ + if ((fd = open( buffer, O_RDONLY )) != -1) + { + close( fd ); + return buffer; + } + free( buffer ); + return NULL; +} + +/* find the .def import library for a given dll */ +static char *find_library( const char *name ) +{ + char *fullname; + int i; + + for (i = 0; i < nb_lib_paths; i++) + { + if ((fullname = try_library_path( lib_path[i], name ))) return fullname; + } + fatal_error( "could not open .def file for %s\n", name ); + return NULL; +} + +/* read in the list of exported symbols of an import library */ +static int read_import_lib( struct import *imp ) +{ + FILE *f; + int i, ret; + struct stat stat; + struct import *prev_imp; + DLLSPEC *spec = imp->spec; + + f = open_input_file( NULL, imp->full_name ); + fstat( fileno(f), &stat ); + imp->dev = stat.st_dev; + imp->ino = stat.st_ino; + ret = parse_def_file( f, spec ); + close_input_file( f ); + if (!ret) return 0; + + /* check if we already imported that library from a different file */ + if ((prev_imp = is_already_imported( spec->file_name ))) + { + if (prev_imp->dev != imp->dev || prev_imp->ino != imp->ino) + fatal_error( "%s and %s have the same export name '%s'\n", + prev_imp->full_name, imp->full_name, spec->file_name ); + return 0; /* the same file was already loaded, ignore this one */ + } + + if (is_delayed_import( spec->file_name )) + { + imp->delay = 1; + nb_delayed++; + } + + if (spec->nb_entry_points) + { + imp->exports = xmalloc( spec->nb_entry_points * sizeof(*imp->exports) ); + for (i = 0; i < spec->nb_entry_points; i++) + imp->exports[imp->nb_exports++] = &spec->entry_points[i]; + qsort( imp->exports, imp->nb_exports, sizeof(*imp->exports), func_cmp ); + } + return 1; +} + +/* build the dll exported name from the import lib name or path */ +static char *get_dll_name( const char *name, const char *filename ) +{ + char *ret; + + if (filename) + { + const char *basename = strrchr( filename, '/' ); + if (!basename) basename = filename; + else basename++; + if (!strncmp( basename, "lib", 3 )) basename += 3; + ret = xmalloc( strlen(basename) + 5 ); + strcpy( ret, basename ); + if (strendswith( ret, ".def" )) ret[strlen(ret)-4] = 0; + } + else + { + ret = xmalloc( strlen(name) + 5 ); + strcpy( ret, name ); + } + if (!strchr( ret, '.' )) strcat( ret, ".dll" ); + return ret; +} + +/* add a dll to the list of imports */ +void add_import_dll( const char *name, const char *filename ) +{ + struct import *imp = xmalloc( sizeof(*imp) ); + + imp->spec = alloc_dll_spec(); + imp->spec->file_name = get_dll_name( name, filename ); + imp->delay = 0; + imp->imports = NULL; + imp->nb_imports = 0; + imp->exports = NULL; + imp->nb_exports = 0; + + if (filename) imp->full_name = xstrdup( filename ); + else imp->full_name = find_library( name ); + + if (read_import_lib( imp )) + { + dll_imports = xrealloc( dll_imports, (nb_imports+1) * sizeof(*dll_imports) ); + dll_imports[nb_imports++] = imp; + } + else + { + free_imports( imp ); + if (nb_errors) exit(1); + } +} + +/* add a library to the list of delayed imports */ +void add_delayed_import( const char *name ) +{ + struct import *imp; + char *fullname = get_dll_name( name, NULL ); + + add_name( &delayed_imports, fullname ); + if ((imp = is_already_imported( fullname )) && !imp->delay) + { + imp->delay = 1; + nb_delayed++; + } + free( fullname ); +} + +/* remove an imported dll, based on its index in the dll_imports array */ +static void remove_import_dll( int index ) +{ + struct import *imp = dll_imports[index]; + + memmove( &dll_imports[index], &dll_imports[index+1], sizeof(imp) * (nb_imports - index - 1) ); + nb_imports--; + if (imp->delay) nb_delayed--; + free_imports( imp ); +} + +/* add a symbol to the ignored symbol list */ +/* if the name starts with '-' the symbol is removed instead */ +void add_ignore_symbol( const char *name ) +{ + unsigned int i; + + if (name[0] == '-') /* remove it */ + { + if (!name[1]) empty_name_table( &ignore_symbols ); /* remove everything */ + else for (i = 0; i < ignore_symbols.count; i++) + { + if (!strcmp( ignore_symbols.names[i], name+1 )) remove_name( &ignore_symbols, i-- ); + } + } + else add_name( &ignore_symbols, name ); +} + +/* add a symbol to the list of extra symbols that ld must resolve */ +void add_extra_ld_symbol( const char *name ) +{ + add_name( &extra_ld_symbols, name ); +} + +/* add a function to the list of imports from a given dll */ +static void add_import_func( struct import *imp, ORDDEF *func ) +{ + imp->imports = xrealloc( imp->imports, (imp->nb_imports+1) * sizeof(*imp->imports) ); + imp->imports[imp->nb_imports++] = func; + total_imports++; + if (imp->delay) total_delayed++; +} + +/* get the default entry point for a given spec file */ +static const char *get_default_entry_point( const DLLSPEC *spec ) +{ + if (spec->characteristics & IMAGE_FILE_DLL) return "__wine_spec_dll_entry"; + if (spec->subsystem == IMAGE_SUBSYSTEM_NATIVE) return "__wine_spec_drv_entry"; + if (spec->type == SPEC_WIN16) return "__wine_spec_exe16_entry"; + return "__wine_spec_exe_entry"; +} + +/* check if the spec file exports any stubs */ +static int has_stubs( const DLLSPEC *spec ) +{ + int i; + for (i = 0; i < spec->nb_entry_points; i++) + { + ORDDEF *odp = &spec->entry_points[i]; + if (odp->type == TYPE_STUB) return 1; + } + return 0; +} + +/* add the extra undefined symbols that will be contained in the generated spec file itself */ +static void add_extra_undef_symbols( DLLSPEC *spec ) +{ + if (!spec->init_func) spec->init_func = xstrdup( get_default_entry_point(spec) ); + add_extra_ld_symbol( spec->init_func ); + if (has_stubs( spec )) add_extra_ld_symbol( "__wine_spec_unimplemented_stub" ); + if (nb_delayed) add_extra_ld_symbol( "__wine_spec_delay_load" ); +} + +/* check if a given imported dll is not needed, taking forwards into account */ +static int check_unused( const struct import* imp, const DLLSPEC *spec ) +{ + int i; + const char *file_name = imp->spec->file_name; + size_t len = strlen( file_name ); + const char *p = strchr( file_name, '.' ); + if (p && !strcasecmp( p, ".dll" )) len = p - file_name; + + for (i = spec->base; i <= spec->limit; i++) + { + ORDDEF *odp = spec->ordinals[i]; + if (!odp || !(odp->flags & FLAG_FORWARD)) continue; + if (!strncasecmp( odp->link_name, file_name, len ) && + odp->link_name[len] == '.') + return 0; /* found a forward, it is used */ + } + return 1; +} + +/* check if a given forward does exist in one of the imported dlls */ +static void check_undefined_forwards( DLLSPEC *spec ) +{ + char *link_name, *api_name, *dll_name, *p; + int i, j; + + for (i = 0; i < spec->nb_entry_points; i++) + { + ORDDEF *odp = &spec->entry_points[i]; + + if (!(odp->flags & FLAG_FORWARD)) continue; + + link_name = xstrdup( odp->link_name ); + p = strrchr( link_name, '.' ); + *p = 0; + api_name = p + 1; + dll_name = get_dll_name( link_name, NULL ); + + for (j = 0; j < nb_imports; j++) + { + struct import *imp = dll_imports[j]; + + if (strcasecmp( imp->spec->file_name, dll_name )) continue; + if (!find_export( api_name, imp->exports, imp->nb_exports )) + warning( "%s:%d: forward '%s' not found in %s\n", + spec->src_name, odp->lineno, odp->link_name, imp->spec->file_name ); + break; + } + if (j == nb_imports) + warning( "%s:%d: forward '%s' not found in the imported dll list\n", + spec->src_name, odp->lineno, odp->link_name ); + free( link_name ); + free( dll_name ); + } +} + +/* flag the dll exports that link to an undefined symbol */ +static void check_undefined_exports( DLLSPEC *spec ) +{ + int i; + + for (i = 0; i < spec->nb_entry_points; i++) + { + ORDDEF *odp = &spec->entry_points[i]; + if (odp->type == TYPE_STUB || odp->type == TYPE_ABS) continue; + if (odp->flags & FLAG_FORWARD) continue; + if (find_name( odp->link_name, &undef_symbols )) + { + switch(odp->type) + { + case TYPE_PASCAL: + case TYPE_STDCALL: + case TYPE_CDECL: + case TYPE_VARARGS: + if (link_ext_symbols) + { + odp->flags |= FLAG_EXT_LINK; + add_name( &ext_link_imports, odp->link_name ); + } + else error( "%s:%d: function '%s' not defined\n", + spec->src_name, odp->lineno, odp->link_name ); + break; + default: + error( "%s:%d: external symbol '%s' is not a function\n", + spec->src_name, odp->lineno, odp->link_name ); + break; + } + } + } +} + +/* create a .o file that references all the undefined symbols we want to resolve */ +static char *create_undef_symbols_file( DLLSPEC *spec ) +{ + char *as_file, *obj_file; + int i; + unsigned int j; + FILE *f; + + as_file = get_temp_file_name( output_file_name, ".s" ); + if (!(f = fopen( as_file, "w" ))) fatal_error( "Cannot create %s\n", as_file ); + fprintf( f, "\t.data\n" ); + + for (i = 0; i < spec->nb_entry_points; i++) + { + ORDDEF *odp = &spec->entry_points[i]; + if (odp->type == TYPE_STUB || odp->type == TYPE_ABS) continue; + if (odp->flags & FLAG_FORWARD) continue; + fprintf( f, "\t%s %s\n", get_asm_ptr_keyword(), asm_name(odp->link_name) ); + } + for (j = 0; j < extra_ld_symbols.count; j++) + fprintf( f, "\t%s %s\n", get_asm_ptr_keyword(), asm_name(extra_ld_symbols.names[j]) ); + fclose( f ); + + obj_file = get_temp_file_name( output_file_name, ".o" ); + assemble_file( as_file, obj_file ); + return obj_file; +} + +/* combine a list of object files with ld into a single object file */ +/* returns the name of the combined file */ +static const char *ldcombine_files( DLLSPEC *spec, char **argv ) +{ + unsigned int i, len = 0; + const char *prog = get_ld_command(); + char *cmd, *p, *ld_tmp_file, *undef_file; + int err; + + undef_file = create_undef_symbols_file( spec ); + len += strlen(undef_file) + 1; + ld_tmp_file = get_temp_file_name( output_file_name, ".o" ); + for (i = 0; argv[i]; i++) len += strlen(argv[i]) + 1; + cmd = p = xmalloc( len + strlen(ld_tmp_file) + 8 + strlen(prog) ); + p += sprintf( cmd, "%s -r -o %s %s", prog, ld_tmp_file, undef_file ); + for (i = 0; argv[i]; i++) + p += sprintf( p, " %s", argv[i] ); + if (verbose) fprintf( stderr, "%s\n", cmd ); + err = system( cmd ); + if (err) fatal_error( "%s -r failed with status %d\n", prog, err ); + free( cmd ); + return ld_tmp_file; +} + +/* read in the list of undefined symbols */ +void read_undef_symbols( DLLSPEC *spec, char **argv ) +{ + size_t prefix_len; + FILE *f; + const char *prog = get_nm_command(); + char *cmd, buffer[1024], name_prefix[16]; + int err; + const char *name; + + if (!argv[0]) return; + + add_extra_undef_symbols( spec ); + + strcpy( name_prefix, asm_name("") ); + prefix_len = strlen( name_prefix ); + + name = ldcombine_files( spec, argv ); + + cmd = xmalloc( strlen(prog) + strlen(name) + 5 ); + sprintf( cmd, "%s -u %s", prog, name ); + if (!(f = popen( cmd, "r" ))) + fatal_error( "Cannot execute '%s'\n", cmd ); + + while (fgets( buffer, sizeof(buffer), f )) + { + char *p = buffer + strlen(buffer) - 1; + if (p < buffer) continue; + if (*p == '\n') *p-- = 0; + p = buffer; + while (*p == ' ') p++; + if (p[0] == 'U' && p[1] == ' ' && p[2]) p += 2; + if (prefix_len && !strncmp( p, name_prefix, prefix_len )) p += prefix_len; + add_name( &undef_symbols, p ); + } + if ((err = pclose( f ))) warning( "%s failed with status %d\n", cmd, err ); + free( cmd ); +} + +/* resolve the imports for a Win32 module */ +int resolve_imports( DLLSPEC *spec ) +{ + int i; + unsigned int j, removed; + ORDDEF *odp; + + sort_names( &ignore_symbols ); + check_undefined_forwards( spec ); + + for (i = 0; i < nb_imports; i++) + { + struct import *imp = dll_imports[i]; + + for (j = removed = 0; j < undef_symbols.count; j++) + { + if (find_name( undef_symbols.names[j], &ignore_symbols )) continue; + odp = find_export( undef_symbols.names[j], imp->exports, imp->nb_exports ); + if (odp) + { + if (odp->flags & FLAG_PRIVATE) continue; + if (odp->type != TYPE_STDCALL && odp->type != TYPE_CDECL) + warning( "winebuild: Data export '%s' cannot be imported from %s\n", + odp->link_name, imp->spec->file_name ); + else + { + add_import_func( imp, odp ); + remove_name( &undef_symbols, j-- ); + removed++; + } + } + } + if (!removed) + { + /* the dll is not used, get rid of it */ + if (check_unused( imp, spec )) + warning( "winebuild: %s imported but no symbols used\n", imp->spec->file_name ); + remove_import_dll( i ); + i--; + } + } + + sort_names( &undef_symbols ); + check_undefined_exports( spec ); + + return 1; +} + +/* output the get_pc thunk if needed */ +void output_get_pc_thunk(void) +{ + if (target_cpu != CPU_x86) return; + if (!UsePIC) return; + output( "\n\t.text\n" ); + output( "\t.align %d\n", get_alignment(4) ); + output( "\t%s\n", func_declaration("__wine_spec_get_pc_thunk_eax") ); + output( "%s:\n", asm_name("__wine_spec_get_pc_thunk_eax") ); + output( "\tpopl %%eax\n" ); + output( "\tpushl %%eax\n" ); + output( "\tret\n" ); + output_function_size( "__wine_spec_get_pc_thunk_eax" ); +} + +/* output a single import thunk */ +static void output_import_thunk( const char *name, const char *table, int pos ) +{ + output( "\n\t.align %d\n", get_alignment(4) ); + output( "\t%s\n", func_declaration(name) ); + output( "%s\n", asm_globl(name) ); + + switch(target_cpu) + { + case CPU_x86: + if (!UsePIC) + { + output( "\tjmp *(%s+%d)\n", table, pos ); + } + else + { + output( "\tcall %s\n", asm_name("__wine_spec_get_pc_thunk_eax") ); + output( "1:\tjmp *%s+%d-1b(%%eax)\n", table, pos ); + } + break; + case CPU_x86_64: + output( "\t.cfi_startproc\n" ); + output( "\tjmpq *%s+%d(%%rip)\n", table, pos ); + output( "\t.cfi_endproc\n" ); + break; + case CPU_SPARC: + if ( !UsePIC ) + { + output( "\tsethi %%hi(%s+%d), %%g1\n", table, pos ); + output( "\tld [%%g1+%%lo(%s+%d)], %%g1\n", table, pos ); + output( "\tjmp %%g1\n" ); + output( "\tnop\n" ); + } + else + { + /* Hmpf. Stupid sparc assembler always interprets global variable + names as GOT offsets, so we have to do it the long way ... */ + output( "\tsave %%sp, -96, %%sp\n" ); + output( "0:\tcall 1f\n" ); + output( "\tnop\n" ); + output( "1:\tsethi %%hi(%s+%d-0b), %%g1\n", table, pos ); + output( "\tor %%g1, %%lo(%s+%d-0b), %%g1\n", table, pos ); + output( "\tld [%%g1+%%o7], %%g1\n" ); + output( "\tjmp %%g1\n" ); + output( "\trestore\n" ); + } + break; + case CPU_ALPHA: + output( "\tlda $0,%s\n", table ); + output( "\tlda $0,%d($0)\n", pos ); + output( "\tjmp $31,($0)\n" ); + break; + case CPU_ARM: + output( "\tmov r4, #%s\n", table ); + output( "\tldr r15, [r4, #%d]\n", pos ); + break; + case CPU_POWERPC: + output( "\tmr %s, %s\n", ppc_reg(0), ppc_reg(31) ); + if (target_platform == PLATFORM_APPLE) + { + output( "\tlis %s, ha16(%s+%d+32768)\n", ppc_reg(31), table, pos ); + output( "\tla %s, lo16(%s+%d)(%s)\n", ppc_reg(31), table, pos, ppc_reg(31) ); + } + else + { + output( "\tlis %s, (%s+%d+32768)@h\n", ppc_reg(31), table, pos ); + output( "\tla %s, (%s+%d)@l(%s)\n", ppc_reg(31), table, pos, ppc_reg(31) ); + } + output( "\tlwz %s, 0(%s)\n", ppc_reg(31), ppc_reg(31) ); + output( "\tmtctr %s\n", ppc_reg(31) ); + output( "\tmr %s, %s\n", ppc_reg(31), ppc_reg(0) ); + output( "\tbctr\n" ); + break; + } + output_function_size( name ); +} + +/* check if we need an import directory */ +int has_imports(void) +{ + return (nb_imports - nb_delayed) > 0; +} + +/* output the import table of a Win32 module */ +static void output_immediate_imports(void) +{ + int i, j; + const char *dll_name; + + if (nb_imports == nb_delayed) return; /* no immediate imports */ + + /* main import header */ + + output( "\n/* import table */\n" ); + output( "\n\t.data\n" ); + output( "\t.align %d\n", get_alignment(4) ); + output( ".L__wine_spec_imports:\n" ); + + /* list of dlls */ + + for (i = j = 0; i < nb_imports; i++) + { + if (dll_imports[i]->delay) continue; + dll_name = make_c_identifier( dll_imports[i]->spec->file_name ); + output( "\t.long .L__wine_spec_import_data_names+%d-.L__wine_spec_rva_base\n", /* OriginalFirstThunk */ + j * get_ptr_size() ); + output( "\t.long 0\n" ); /* TimeDateStamp */ + output( "\t.long 0\n" ); /* ForwarderChain */ + output( "\t.long .L__wine_spec_import_name_%s-.L__wine_spec_rva_base\n", /* Name */ + dll_name ); + output( "\t.long .L__wine_spec_import_data_ptrs+%d-.L__wine_spec_rva_base\n", /* FirstThunk */ + j * get_ptr_size() ); + j += dll_imports[i]->nb_imports + 1; + } + output( "\t.long 0\n" ); /* OriginalFirstThunk */ + output( "\t.long 0\n" ); /* TimeDateStamp */ + output( "\t.long 0\n" ); /* ForwarderChain */ + output( "\t.long 0\n" ); /* Name */ + output( "\t.long 0\n" ); /* FirstThunk */ + + output( "\n\t.align %d\n", get_alignment(get_ptr_size()) ); + output( ".L__wine_spec_import_data_names:\n" ); + for (i = 0; i < nb_imports; i++) + { + if (dll_imports[i]->delay) continue; + dll_name = make_c_identifier( dll_imports[i]->spec->file_name ); + for (j = 0; j < dll_imports[i]->nb_imports; j++) + { + ORDDEF *odp = dll_imports[i]->imports[j]; + if (!(odp->flags & FLAG_NONAME)) + output( "\t%s .L__wine_spec_import_data_%s_%s-.L__wine_spec_rva_base\n", + get_asm_ptr_keyword(), dll_name, odp->name ); + else + { + if (get_ptr_size() == 8) + output( "\t.quad 0x800000000000%04x\n", odp->ordinal ); + else + output( "\t.long 0x8000%04x\n", odp->ordinal ); + } + } + output( "\t%s 0\n", get_asm_ptr_keyword() ); + } + output( ".L__wine_spec_import_data_ptrs:\n" ); + for (i = 0; i < nb_imports; i++) + { + if (dll_imports[i]->delay) continue; + for (j = 0; j < dll_imports[i]->nb_imports; j++) output( "\t%s 0\n", get_asm_ptr_keyword() ); + output( "\t%s 0\n", get_asm_ptr_keyword() ); + } + output( ".L__wine_spec_imports_end:\n" ); + + for (i = 0; i < nb_imports; i++) + { + if (dll_imports[i]->delay) continue; + dll_name = make_c_identifier( dll_imports[i]->spec->file_name ); + for (j = 0; j < dll_imports[i]->nb_imports; j++) + { + ORDDEF *odp = dll_imports[i]->imports[j]; + if (!(odp->flags & FLAG_NONAME)) + { + output( "\t.align %d\n", get_alignment(2) ); + output( ".L__wine_spec_import_data_%s_%s:\n", dll_name, odp->name ); + output( "\t%s %d\n", get_asm_short_keyword(), odp->ordinal ); + output( "\t%s \"%s\"\n", get_asm_string_keyword(), odp->name ); + } + } + } + + for (i = 0; i < nb_imports; i++) + { + if (dll_imports[i]->delay) continue; + dll_name = make_c_identifier( dll_imports[i]->spec->file_name ); + output( ".L__wine_spec_import_name_%s:\n\t%s \"%s\"\n", + dll_name, get_asm_string_keyword(), dll_imports[i]->spec->file_name ); + } +} + +/* output the import thunks of a Win32 module */ +static void output_immediate_import_thunks(void) +{ + int i, j, pos; + int nb_imm = nb_imports - nb_delayed; + static const char import_thunks[] = "__wine_spec_import_thunks"; + + if (!nb_imm) return; + + output( "\n/* immediate import thunks */\n\n" ); + output( "\t.text\n" ); + output( "\t.align %d\n", get_alignment(8) ); + output( "%s:\n", asm_name(import_thunks)); + + for (i = pos = 0; i < nb_imports; i++) + { + if (dll_imports[i]->delay) continue; + for (j = 0; j < dll_imports[i]->nb_imports; j++, pos += get_ptr_size()) + { + ORDDEF *odp = dll_imports[i]->imports[j]; + output_import_thunk( odp->name ? odp->name : odp->export_name, + ".L__wine_spec_import_data_ptrs", pos ); + } + pos += get_ptr_size(); + } + output_function_size( import_thunks ); +} + +/* output the delayed import table of a Win32 module */ +static void output_delayed_imports( const DLLSPEC *spec ) +{ + int i, j, mod; + + if (!nb_delayed) return; + + output( "\n/* delayed imports */\n\n" ); + output( "\t.data\n" ); + output( "\t.align %d\n", get_alignment(get_ptr_size()) ); + output( "%s\n", asm_globl("__wine_spec_delay_imports") ); + + /* list of dlls */ + + for (i = j = mod = 0; i < nb_imports; i++) + { + if (!dll_imports[i]->delay) continue; + output( "\t%s 0\n", get_asm_ptr_keyword() ); /* grAttrs */ + output( "\t%s .L__wine_delay_name_%d\n", /* szName */ + get_asm_ptr_keyword(), i ); + output( "\t%s .L__wine_delay_modules+%d\n", /* phmod */ + get_asm_ptr_keyword(), mod * get_ptr_size() ); + output( "\t%s .L__wine_delay_IAT+%d\n", /* pIAT */ + get_asm_ptr_keyword(), j * get_ptr_size() ); + output( "\t%s .L__wine_delay_INT+%d\n", /* pINT */ + get_asm_ptr_keyword(), j * get_ptr_size() ); + output( "\t%s 0\n", get_asm_ptr_keyword() ); /* pBoundIAT */ + output( "\t%s 0\n", get_asm_ptr_keyword() ); /* pUnloadIAT */ + output( "\t%s 0\n", get_asm_ptr_keyword() ); /* dwTimeStamp */ + j += dll_imports[i]->nb_imports; + mod++; + } + output( "\t%s 0\n", get_asm_ptr_keyword() ); /* grAttrs */ + output( "\t%s 0\n", get_asm_ptr_keyword() ); /* szName */ + output( "\t%s 0\n", get_asm_ptr_keyword() ); /* phmod */ + output( "\t%s 0\n", get_asm_ptr_keyword() ); /* pIAT */ + output( "\t%s 0\n", get_asm_ptr_keyword() ); /* pINT */ + output( "\t%s 0\n", get_asm_ptr_keyword() ); /* pBoundIAT */ + output( "\t%s 0\n", get_asm_ptr_keyword() ); /* pUnloadIAT */ + output( "\t%s 0\n", get_asm_ptr_keyword() ); /* dwTimeStamp */ + + output( "\n.L__wine_delay_IAT:\n" ); + for (i = 0; i < nb_imports; i++) + { + if (!dll_imports[i]->delay) continue; + for (j = 0; j < dll_imports[i]->nb_imports; j++) + { + ORDDEF *odp = dll_imports[i]->imports[j]; + const char *name = odp->name ? odp->name : odp->export_name; + output( "\t%s .L__wine_delay_imp_%d_%s\n", + get_asm_ptr_keyword(), i, name ); + } + } + + output( "\n.L__wine_delay_INT:\n" ); + for (i = 0; i < nb_imports; i++) + { + if (!dll_imports[i]->delay) continue; + for (j = 0; j < dll_imports[i]->nb_imports; j++) + { + ORDDEF *odp = dll_imports[i]->imports[j]; + if (!odp->name) + output( "\t%s %d\n", get_asm_ptr_keyword(), odp->ordinal ); + else + output( "\t%s .L__wine_delay_data_%d_%s\n", + get_asm_ptr_keyword(), i, odp->name ); + } + } + + output( "\n.L__wine_delay_modules:\n" ); + for (i = 0; i < nb_imports; i++) + { + if (dll_imports[i]->delay) output( "\t%s 0\n", get_asm_ptr_keyword() ); + } + + for (i = 0; i < nb_imports; i++) + { + if (!dll_imports[i]->delay) continue; + output( ".L__wine_delay_name_%d:\n", i ); + output( "\t%s \"%s\"\n", + get_asm_string_keyword(), dll_imports[i]->spec->file_name ); + } + + for (i = 0; i < nb_imports; i++) + { + if (!dll_imports[i]->delay) continue; + for (j = 0; j < dll_imports[i]->nb_imports; j++) + { + ORDDEF *odp = dll_imports[i]->imports[j]; + if (!odp->name) continue; + output( ".L__wine_delay_data_%d_%s:\n", i, odp->name ); + output( "\t%s \"%s\"\n", get_asm_string_keyword(), odp->name ); + } + } + output_function_size( "__wine_spec_delay_imports" ); +} + +/* output the delayed import thunks of a Win32 module */ +static void output_delayed_import_thunks( const DLLSPEC *spec ) +{ + int i, idx, j, pos, extra_stack_storage = 0; + static const char delayed_import_loaders[] = "__wine_spec_delayed_import_loaders"; + static const char delayed_import_thunks[] = "__wine_spec_delayed_import_thunks"; + + if (!nb_delayed) return; + + output( "\n/* delayed import thunks */\n\n" ); + output( "\t.text\n" ); + output( "\t.align %d\n", get_alignment(8) ); + output( "%s:\n", asm_name(delayed_import_loaders)); + output( "\t%s\n", func_declaration("__wine_delay_load_asm") ); + output( "%s:\n", asm_name("__wine_delay_load_asm") ); + switch(target_cpu) + { + case CPU_x86: + output( "\tpushl %%ecx\n" ); + output( "\tpushl %%edx\n" ); + output( "\tpushl %%eax\n" ); + output( "\tcall %s\n", asm_name("__wine_spec_delay_load") ); + output( "\tpopl %%edx\n" ); + output( "\tpopl %%ecx\n" ); + output( "\tjmp *%%eax\n" ); + break; + case CPU_x86_64: + output( "\t.cfi_startproc\n" ); + output( "\tsubq $88,%%rsp\n" ); + output( "\t.cfi_adjust_cfa_offset 88\n" ); + output( "\tmovq %%rdx,80(%%rsp)\n" ); + output( "\tmovq %%rcx,72(%%rsp)\n" ); + output( "\tmovq %%r8,64(%%rsp)\n" ); + output( "\tmovq %%r9,56(%%rsp)\n" ); + output( "\tmovq %%r10,48(%%rsp)\n" ); + output( "\tmovq %%r11,40(%%rsp)\n" ); + output( "\tmovq %%rax,%%rcx\n" ); + output( "\tcall %s\n", asm_name("__wine_spec_delay_load") ); + output( "\tmovq 40(%%rsp),%%r11\n" ); + output( "\tmovq 48(%%rsp),%%r10\n" ); + output( "\tmovq 56(%%rsp),%%r9\n" ); + output( "\tmovq 64(%%rsp),%%r8\n" ); + output( "\tmovq 72(%%rsp),%%rcx\n" ); + output( "\tmovq 80(%%rsp),%%rdx\n" ); + output( "\taddq $88,%%rsp\n" ); + output( "\t.cfi_adjust_cfa_offset -88\n" ); + output( "\tjmp *%%rax\n" ); + output( "\t.cfi_endproc\n" ); + break; + case CPU_SPARC: + output( "\tsave %%sp, -96, %%sp\n" ); + output( "\tcall %s\n", asm_name("__wine_spec_delay_load") ); + output( "\tmov %%g1, %%o0\n" ); + output( "\tjmp %%o0\n" ); + output( "\trestore\n" ); + break; + case CPU_ALPHA: + output( "\tjsr $26,%s\n", asm_name("__wine_spec_delay_load") ); + output( "\tjmp $31,($0)\n" ); + break; + case CPU_ARM: + output( "\tstmfd sp!, {r4, r5, r6, r7, r8, r9, r10, lr}\n" ); + output( "\tblx %s\n", asm_name("__wine_spec_delay_load") ); + output( "\tldmfd sp!, {r4, r5, r6, r7, r8, r9, r10, pc}\n" ); + break; + case CPU_POWERPC: + if (target_platform == PLATFORM_APPLE) extra_stack_storage = 56; + + /* Save all callee saved registers into a stackframe. */ + output( "\tstwu %s, -%d(%s)\n",ppc_reg(1), 48+extra_stack_storage, ppc_reg(1)); + output( "\tstw %s, %d(%s)\n", ppc_reg(3), 4+extra_stack_storage, ppc_reg(1)); + output( "\tstw %s, %d(%s)\n", ppc_reg(4), 8+extra_stack_storage, ppc_reg(1)); + output( "\tstw %s, %d(%s)\n", ppc_reg(5), 12+extra_stack_storage, ppc_reg(1)); + output( "\tstw %s, %d(%s)\n", ppc_reg(6), 16+extra_stack_storage, ppc_reg(1)); + output( "\tstw %s, %d(%s)\n", ppc_reg(7), 20+extra_stack_storage, ppc_reg(1)); + output( "\tstw %s, %d(%s)\n", ppc_reg(8), 24+extra_stack_storage, ppc_reg(1)); + output( "\tstw %s, %d(%s)\n", ppc_reg(9), 28+extra_stack_storage, ppc_reg(1)); + output( "\tstw %s, %d(%s)\n", ppc_reg(10),32+extra_stack_storage, ppc_reg(1)); + output( "\tstw %s, %d(%s)\n", ppc_reg(11),36+extra_stack_storage, ppc_reg(1)); + output( "\tstw %s, %d(%s)\n", ppc_reg(12),40+extra_stack_storage, ppc_reg(1)); + + /* r0 -> r3 (arg1) */ + output( "\tmr %s, %s\n", ppc_reg(3), ppc_reg(0)); + + /* save return address */ + output( "\tmflr %s\n", ppc_reg(0)); + output( "\tstw %s, %d(%s)\n", ppc_reg(0), 44+extra_stack_storage, ppc_reg(1)); + + /* Call the __wine_delay_load function, arg1 is arg1. */ + output( "\tbl %s\n", asm_name("__wine_spec_delay_load") ); + + /* Load return value from call into ctr register */ + output( "\tmtctr %s\n", ppc_reg(3)); + + /* restore all saved registers and drop stackframe. */ + output( "\tlwz %s, %d(%s)\n", ppc_reg(3), 4+extra_stack_storage, ppc_reg(1)); + output( "\tlwz %s, %d(%s)\n", ppc_reg(4), 8+extra_stack_storage, ppc_reg(1)); + output( "\tlwz %s, %d(%s)\n", ppc_reg(5), 12+extra_stack_storage, ppc_reg(1)); + output( "\tlwz %s, %d(%s)\n", ppc_reg(6), 16+extra_stack_storage, ppc_reg(1)); + output( "\tlwz %s, %d(%s)\n", ppc_reg(7), 20+extra_stack_storage, ppc_reg(1)); + output( "\tlwz %s, %d(%s)\n", ppc_reg(8), 24+extra_stack_storage, ppc_reg(1)); + output( "\tlwz %s, %d(%s)\n", ppc_reg(9), 28+extra_stack_storage, ppc_reg(1)); + output( "\tlwz %s, %d(%s)\n", ppc_reg(10),32+extra_stack_storage, ppc_reg(1)); + output( "\tlwz %s, %d(%s)\n", ppc_reg(11),36+extra_stack_storage, ppc_reg(1)); + output( "\tlwz %s, %d(%s)\n", ppc_reg(12),40+extra_stack_storage, ppc_reg(1)); + + /* Load return value from call into return register */ + output( "\tlwz %s, %d(%s)\n", ppc_reg(0), 44+extra_stack_storage, ppc_reg(1)); + output( "\tmtlr %s\n", ppc_reg(0)); + output( "\taddi %s, %s, %d\n", ppc_reg(1), ppc_reg(1), 48+extra_stack_storage); + + /* branch to ctr register. */ + output( "\tbctr\n"); + break; + } + output_function_size( "__wine_delay_load_asm" ); + output( "\n" ); + + for (i = idx = 0; i < nb_imports; i++) + { + if (!dll_imports[i]->delay) continue; + for (j = 0; j < dll_imports[i]->nb_imports; j++) + { + ORDDEF *odp = dll_imports[i]->imports[j]; + const char *name = odp->name ? odp->name : odp->export_name; + + output( ".L__wine_delay_imp_%d_%s:\n", i, name ); + switch(target_cpu) + { + case CPU_x86: + output( "\tmovl $%d, %%eax\n", (idx << 16) | j ); + output( "\tjmp %s\n", asm_name("__wine_delay_load_asm") ); + break; + case CPU_x86_64: + output( "\t.cfi_startproc\n" ); + output( "\tmovq $%d,%%rax\n", (idx << 16) | j ); + output( "\tjmp %s\n", asm_name("__wine_delay_load_asm") ); + output( "\t.cfi_endproc\n" ); + break; + case CPU_SPARC: + output( "\tset %d, %%g1\n", (idx << 16) | j ); + output( "\tb,a %s\n", asm_name("__wine_delay_load_asm") ); + break; + case CPU_ALPHA: + output( "\tlda $0,%d($31)\n", j); + output( "\tldah $0,%d($0)\n", idx); + output( "\tjmp $31,%s\n", asm_name("__wine_delay_load_asm") ); + break; + case CPU_ARM: + output( "\tb %s\n", asm_name("__wine_delay_load_asm") ); + break; + case CPU_POWERPC: + switch(target_platform) + { + case PLATFORM_APPLE: + /* On Darwin we can use r0 and r2 */ + /* Upper part in r2 */ + output( "\tlis %s, %d\n", ppc_reg(2), idx); + /* Lower part + r2 -> r0, Note we can't use r0 directly */ + output( "\taddi %s, %s, %d\n", ppc_reg(0), ppc_reg(2), j); + output( "\tb %s\n", asm_name("__wine_delay_load_asm") ); + break; + default: + /* On linux we can't use r2 since r2 is not a scratch register (hold the TOC) */ + /* Save r13 on the stack */ + output( "\taddi %s, %s, -0x4\n", ppc_reg(1), ppc_reg(1)); + output( "\tstw %s, 0(%s)\n", ppc_reg(13), ppc_reg(1)); + /* Upper part in r13 */ + output( "\tlis %s, %d\n", ppc_reg(13), idx); + /* Lower part + r13 -> r0, Note we can't use r0 directly */ + output( "\taddi %s, %s, %d\n", ppc_reg(0), ppc_reg(13), j); + /* Restore r13 */ + output( "\tstw %s, 0(%s)\n", ppc_reg(13), ppc_reg(1)); + output( "\taddic %s, %s, 0x4\n", ppc_reg(1), ppc_reg(1)); + output( "\tb %s\n", asm_name("__wine_delay_load_asm") ); + break; + } + break; + } + } + idx++; + } + output_function_size( delayed_import_loaders ); + + output( "\n\t.align %d\n", get_alignment(get_ptr_size()) ); + output( "%s:\n", asm_name(delayed_import_thunks)); + for (i = pos = 0; i < nb_imports; i++) + { + if (!dll_imports[i]->delay) continue; + for (j = 0; j < dll_imports[i]->nb_imports; j++, pos += get_ptr_size()) + { + ORDDEF *odp = dll_imports[i]->imports[j]; + output_import_thunk( odp->name ? odp->name : odp->export_name, + ".L__wine_delay_IAT", pos ); + } + } + output_function_size( delayed_import_thunks ); +} + +/* output import stubs for exported entry points that link to external symbols */ +static void output_external_link_imports( DLLSPEC *spec ) +{ + unsigned int i, pos; + + if (!ext_link_imports.count) return; /* nothing to do */ + + sort_names( &ext_link_imports ); + + /* get rid of duplicate names */ + for (i = 1; i < ext_link_imports.count; i++) + { + if (!strcmp( ext_link_imports.names[i-1], ext_link_imports.names[i] )) + remove_name( &ext_link_imports, i-- ); + } + + output( "\n/* external link thunks */\n\n" ); + output( "\t.data\n" ); + output( "\t.align %d\n", get_alignment(get_ptr_size()) ); + output( ".L__wine_spec_external_links:\n" ); + for (i = 0; i < ext_link_imports.count; i++) + output( "\t%s %s\n", get_asm_ptr_keyword(), asm_name(ext_link_imports.names[i]) ); + + output( "\n\t.text\n" ); + output( "\t.align %d\n", get_alignment(get_ptr_size()) ); + output( "%s:\n", asm_name("__wine_spec_external_link_thunks") ); + + for (i = pos = 0; i < ext_link_imports.count; i++) + { + char buffer[256]; + sprintf( buffer, "__wine_spec_ext_link_%s", ext_link_imports.names[i] ); + output_import_thunk( buffer, ".L__wine_spec_external_links", pos ); + pos += get_ptr_size(); + } + output_function_size( "__wine_spec_external_link_thunks" ); +} + +/******************************************************************* + * output_stubs + * + * Output the functions for stub entry points + */ +void output_stubs( DLLSPEC *spec ) +{ + const char *name, *exp_name; + int i, count; + + if (!has_stubs( spec )) return; + + output( "\n/* stub functions */\n\n" ); + output( "\t.text\n" ); + + for (i = count = 0; i < spec->nb_entry_points; i++) + { + ORDDEF *odp = &spec->entry_points[i]; + if (odp->type != TYPE_STUB) continue; + + name = get_stub_name( odp, spec ); + exp_name = odp->name ? odp->name : odp->export_name; + output( "\t.align %d\n", get_alignment(4) ); + output( "\t%s\n", func_declaration(name) ); + output( "%s:\n", asm_name(name) ); + + switch (target_cpu) + { + case CPU_x86: + /* flesh out the stub a bit to make safedisc happy */ + output(" \tnop\n" ); + output(" \tnop\n" ); + output(" \tnop\n" ); + output(" \tnop\n" ); + output(" \tnop\n" ); + output(" \tnop\n" ); + output(" \tnop\n" ); + output(" \tnop\n" ); + output(" \tnop\n" ); + + output( "\tsubl $4,%%esp\n" ); + if (UsePIC) + { + output( "\tcall %s\n", asm_name("__wine_spec_get_pc_thunk_eax") ); + output( "1:" ); + if (exp_name) + { + output( "\tleal .L%s_string-1b(%%eax),%%ecx\n", name ); + output( "\tpushl %%ecx\n" ); + count++; + } + else + output( "\tpushl $%d\n", odp->ordinal ); + output( "\tleal .L__wine_spec_file_name-1b(%%eax),%%ecx\n" ); + output( "\tpushl %%ecx\n" ); + } + else + { + if (exp_name) + { + output( "\tpushl $.L%s_string\n", name ); + count++; + } + else + output( "\tpushl $%d\n", odp->ordinal ); + output( "\tpushl $.L__wine_spec_file_name\n" ); + } + output( "\tcall %s\n", asm_name("__wine_spec_unimplemented_stub") ); + break; + case CPU_x86_64: + output( "\t.cfi_startproc\n" ); + output( "\tsubq $8,%%rsp\n" ); + output( "\t.cfi_adjust_cfa_offset 8\n" ); + output( "\tleaq .L__wine_spec_file_name(%%rip),%%rdi\n" ); + if (exp_name) + { + output( "leaq .L%s_string(%%rip),%%rsi\n", name ); + count++; + } + else + output( "\tmovq $%d,%%rsi\n", odp->ordinal ); + output( "\tcall %s\n", asm_name("__wine_spec_unimplemented_stub") ); + output( "\t.cfi_endproc\n" ); + break; + default: + assert(0); + } + output_function_size( name ); + } + + if (count) + { + output( "\t%s\n", get_asm_string_section() ); + for (i = 0; i < spec->nb_entry_points; i++) + { + ORDDEF *odp = &spec->entry_points[i]; + if (odp->type != TYPE_STUB) continue; + exp_name = odp->name ? odp->name : odp->export_name; + if (exp_name) + { + name = get_stub_name( odp, spec ); + output( ".L%s_string:\n", name ); + output( "\t%s \"%s\"\n", get_asm_string_keyword(), exp_name ); + } + } + } +} + +/* output the import and delayed import tables of a Win32 module */ +void output_imports( DLLSPEC *spec ) +{ + output_immediate_imports(); + output_delayed_imports( spec ); + output_immediate_import_thunks(); + output_delayed_import_thunks( spec ); + output_external_link_imports( spec ); + if (nb_imports || ext_link_imports.count || has_stubs(spec) || has_relays(spec)) + output_get_pc_thunk(); +} diff --git a/tools/winebuild/main.c b/tools/winebuild/main.c new file mode 100644 index 00000000000..24807032fcc --- /dev/null +++ b/tools/winebuild/main.c @@ -0,0 +1,685 @@ +/* + * Main function + * + * Copyright 1993 Robert J. Amstadt + * Copyright 1995 Martin von Loewis + * Copyright 1995, 1996, 1997 Alexandre Julliard + * Copyright 1997 Eric Youngdale + * Copyright 1999 Ulrich Weigand + * + * 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 + */ + +#include "config.h" +#include "wine/port.h" + +#include +#include +#include +#include +#include +#include +#include +#ifdef HAVE_GETOPT_H +# include +#endif + +#include "build.h" + +int UsePIC = 0; +int nb_lib_paths = 0; +int nb_errors = 0; +int display_warnings = 0; +int kill_at = 0; +int verbose = 0; +int save_temps = 0; +int link_ext_symbols = 0; +int force_pointer_size = 0; + +#if defined(TARGET_i386) +enum target_cpu target_cpu = CPU_x86; +#elif defined(TARGET_amd64) +enum target_cpu target_cpu = CPU_x86_64; +#elif defined(__sparc__) +enum target_cpu target_cpu = CPU_SPARC; +#elif defined(__ALPHA__) +enum target_cpu target_cpu = CPU_ALPHA; +#elif defined(__powerpc__) +enum target_cpu target_cpu = CPU_POWERPC; +#elif defined(TARGET_arm) +enum target_cpu target_cpu = CPU_ARM; +#else +#error Unsupported CPU +#endif + +#ifdef __APPLE__ +enum target_platform target_platform = PLATFORM_APPLE; +#elif defined(__FreeBSD__) +enum target_platform target_platform = PLATFORM_FREEBSD; +#elif defined(__sun) +enum target_platform target_platform = PLATFORM_SOLARIS; +#elif defined(_WIN32) +enum target_platform target_platform = PLATFORM_WINDOWS; +#else +enum target_platform target_platform = PLATFORM_UNSPECIFIED; +#endif + +char *target_alias = NULL; +char **lib_path = NULL; + +char *input_file_name = NULL; +char *spec_file_name = NULL; +FILE *output_file = NULL; +const char *output_file_name = NULL; +static const char *output_file_source_name; +static int fake_module; + +char *as_command = NULL; +char *ld_command = NULL; +char *nm_command = NULL; + +static int nb_res_files; +static char **res_files; + +/* execution mode */ +enum exec_mode_values +{ + MODE_NONE, + MODE_DLL, + MODE_EXE, + MODE_DEF, + MODE_RELAY16, + MODE_RELAY32, + MODE_RESOURCES, + MODE_PEDLL +}; + +static enum exec_mode_values exec_mode = MODE_NONE; + +static const struct +{ + const char *name; + enum target_platform platform; +} platform_names[] = +{ + { "macos", PLATFORM_APPLE }, + { "darwin", PLATFORM_APPLE }, + { "freebsd", PLATFORM_FREEBSD }, + { "solaris", PLATFORM_SOLARIS }, + { "windows", PLATFORM_WINDOWS }, + { "winnt", PLATFORM_WINDOWS } +}; + +/* set the dll file name from the input file name */ +static void set_dll_file_name( const char *name, DLLSPEC *spec ) +{ + char *p; + + if (spec->file_name) return; + + if ((p = strrchr( name, '\\' ))) name = p + 1; + if ((p = strrchr( name, '/' ))) name = p + 1; + spec->file_name = xmalloc( strlen(name) + 5 ); + strcpy( spec->file_name, name ); + if ((p = strrchr( spec->file_name, '.' ))) + { + if (!strcmp( p, ".spec" ) || !strcmp( p, ".def" )) *p = 0; + } +} + +/* set the dll subsystem */ +static void set_subsystem( const char *subsystem, DLLSPEC *spec ) +{ + char *major, *minor, *str = xstrdup( subsystem ); + + if ((major = strchr( str, ':' ))) *major++ = 0; + if (!strcmp( str, "native" )) spec->subsystem = IMAGE_SUBSYSTEM_NATIVE; + else if (!strcmp( str, "windows" )) spec->subsystem = IMAGE_SUBSYSTEM_WINDOWS_GUI; + else if (!strcmp( str, "console" )) spec->subsystem = IMAGE_SUBSYSTEM_WINDOWS_CUI; + else if (!strcmp( str, "win16" )) spec->type = SPEC_WIN16; + else fatal_error( "Invalid subsystem name '%s'\n", subsystem ); + if (major) + { + if ((minor = strchr( major, '.' ))) + { + *minor++ = 0; + spec->subsystem_minor = atoi( minor ); + } + spec->subsystem_major = atoi( major ); + } + free( str ); +} + +/* set the target CPU and platform */ +static void set_target( const char *target ) +{ + unsigned int i; + char *p, *platform, *spec = xstrdup( target ); + + /* target specification is in the form CPU-MANUFACTURER-OS or CPU-MANUFACTURER-KERNEL-OS */ + + target_alias = xstrdup( target ); + + /* get the CPU part */ + + if (!(p = strchr( spec, '-' ))) fatal_error( "Invalid target specification '%s'\n", target ); + *p++ = 0; + if ((target_cpu = get_cpu_from_name( spec )) == -1) + fatal_error( "Unrecognized CPU '%s'\n", spec ); + platform = p; + if ((p = strrchr( p, '-' ))) platform = p + 1; + + /* get the OS part */ + + target_platform = PLATFORM_UNSPECIFIED; /* default value */ + for (i = 0; i < sizeof(platform_names)/sizeof(platform_names[0]); i++) + { + if (!strncmp( platform_names[i].name, platform, strlen(platform_names[i].name) )) + { + target_platform = platform_names[i].platform; + break; + } + } + + free( spec ); +} + +/* cleanup on program exit */ +static void cleanup(void) +{ + if (output_file_name) unlink( output_file_name ); +} + +/* clean things up when aborting on a signal */ +static void exit_on_signal( int sig ) +{ + exit(1); /* this will call atexit functions */ +} + +/******************************************************************* + * command-line option handling + */ +static const char usage_str[] = +"Usage: winebuild [OPTIONS] [FILES]\n\n" +"Options:\n" +" --as-cmd=AS Command to use for assembling (default: as)\n" +" -b, --target=TARGET Specify target CPU and platform for cross-compiling\n" +" -d, --delay-lib=LIB Import the specified library in delayed mode\n" +" -D SYM Ignored for C flags compatibility\n" +" -e, --entry=FUNC Set the DLL entry point function (default: DllMain)\n" +" -E, --export=FILE Export the symbols defined in the .spec or .def file\n" +" --external-symbols Allow linking to external symbols\n" +" -f FLAGS Compiler flags (only -fPIC is supported)\n" +" -F, --filename=DLLFILE Set the DLL filename (default: from input file name)\n" +" --fake-module Create a fake binary module\n" +" -h, --help Display this help message\n" +" -H, --heap=SIZE Set the heap size for a Win16 dll\n" +" -i, --ignore=SYM[,SYM] Ignore specified symbols when resolving imports\n" +" -I DIR Ignored for C flags compatibility\n" +" -k, --kill-at Kill stdcall decorations in generated .def files\n" +" -K, FLAGS Compiler flags (only -KPIC is supported)\n" +" --large-address-aware Support an address space larger than 2Gb\n" +" --ld-cmd=LD Command to use for linking (default: ld)\n" +" -l, --library=LIB Import the specified library\n" +" -L, --library-path=DIR Look for imports libraries in DIR\n" +" -m32, -m64 Force building 32-bit resp. 64-bit code\n" +" -M, --main-module=MODULE Set the name of the main module for a Win16 dll\n" +" --nm-cmd=NM Command to use to get undefined symbols (default: nm)\n" +" --nxcompat=y|n Set the NX compatibility flag (default: yes)\n" +" -N, --dll-name=DLLNAME Set the DLL name (default: from input file name)\n" +" -o, --output=NAME Set the output file name (default: stdout)\n" +" -r, --res=RSRC.RES Load resources from RSRC.RES\n" +" --save-temps Do not delete the generated intermediate files\n" +" --subsystem=SUBSYS Set the subsystem (one of native, windows, console)\n" +" -u, --undefined=SYMBOL Add an undefined reference to SYMBOL when linking\n" +" -v, --verbose Display the programs invoked\n" +" --version Print the version and exit\n" +" -w, --warnings Turn on warnings\n" +"\nMode options:\n" +" --dll Build a .c file from a .spec or .def file\n" +" --def Build a .def file from a .spec file\n" +" --exe Build a .c file for an executable\n" +" --relay16 Build the 16-bit relay assembly routines\n" +" --relay32 Build the 32-bit relay assembly routines\n" +" --resources Build a .o file for the resource files\n\n" +" --pedll Build a .c file for PE dll\n\n" +"The mode options are mutually exclusive; you must specify one and only one.\n\n"; + +enum long_options_values +{ + LONG_OPT_DLL = 1, + LONG_OPT_DEF, + LONG_OPT_EXE, + LONG_OPT_ASCMD, + LONG_OPT_EXTERNAL_SYMS, + LONG_OPT_FAKE_MODULE, + LONG_OPT_LARGE_ADDRESS_AWARE, + LONG_OPT_LDCMD, + LONG_OPT_NMCMD, + LONG_OPT_NXCOMPAT, + LONG_OPT_RELAY16, + LONG_OPT_RELAY32, + LONG_OPT_RESOURCES, + LONG_OPT_SAVE_TEMPS, + LONG_OPT_SUBSYSTEM, + LONG_OPT_VERSION, + LONG_OPT_PEDLL +}; + +static const char short_options[] = "C:D:E:F:H:I:K:L:M:N:b:d:e:f:hi:kl:m:o:r:u:vw"; + +static const struct option long_options[] = +{ + { "dll", 0, 0, LONG_OPT_DLL }, + { "def", 0, 0, LONG_OPT_DEF }, + { "exe", 0, 0, LONG_OPT_EXE }, + { "as-cmd", 1, 0, LONG_OPT_ASCMD }, + { "external-symbols", 0, 0, LONG_OPT_EXTERNAL_SYMS }, + { "fake-module", 0, 0, LONG_OPT_FAKE_MODULE }, + { "large-address-aware", 0, 0, LONG_OPT_LARGE_ADDRESS_AWARE }, + { "ld-cmd", 1, 0, LONG_OPT_LDCMD }, + { "nm-cmd", 1, 0, LONG_OPT_NMCMD }, + { "nxcompat", 1, 0, LONG_OPT_NXCOMPAT }, + { "relay16", 0, 0, LONG_OPT_RELAY16 }, + { "relay32", 0, 0, LONG_OPT_RELAY32 }, + { "resources", 0, 0, LONG_OPT_RESOURCES }, + { "save-temps", 0, 0, LONG_OPT_SAVE_TEMPS }, + { "subsystem", 1, 0, LONG_OPT_SUBSYSTEM }, + { "version", 0, 0, LONG_OPT_VERSION }, + { "pedll", 1, 0, LONG_OPT_PEDLL }, + /* aliases for short options */ + { "target", 1, 0, 'b' }, + { "delay-lib", 1, 0, 'd' }, + { "export", 1, 0, 'E' }, + { "entry", 1, 0, 'e' }, + { "filename", 1, 0, 'F' }, + { "help", 0, 0, 'h' }, + { "heap", 1, 0, 'H' }, + { "ignore", 1, 0, 'i' }, + { "kill-at", 0, 0, 'k' }, + { "library", 1, 0, 'l' }, + { "library-path", 1, 0, 'L' }, + { "main-module", 1, 0, 'M' }, + { "dll-name", 1, 0, 'N' }, + { "output", 1, 0, 'o' }, + { "res", 1, 0, 'r' }, + { "undefined", 1, 0, 'u' }, + { "verbose", 0, 0, 'v' }, + { "warnings", 0, 0, 'w' }, + { NULL, 0, 0, 0 } +}; + +static void usage( int exit_code ) +{ + fprintf( stderr, "%s", usage_str ); + exit( exit_code ); +} + +static void set_exec_mode( enum exec_mode_values mode ) +{ + if (exec_mode != MODE_NONE) usage(1); + exec_mode = mode; +} + +/* parse options from the argv array and remove all the recognized ones */ +static char **parse_options( int argc, char **argv, DLLSPEC *spec ) +{ + char *p; + int optc; + + while ((optc = getopt_long( argc, argv, short_options, long_options, NULL )) != -1) + { + switch(optc) + { + case 'D': + /* ignored */ + break; + case 'E': + spec_file_name = xstrdup( optarg ); + set_dll_file_name( optarg, spec ); + break; + case 'F': + spec->file_name = xstrdup( optarg ); + break; + case 'H': + if (!isdigit(optarg[0])) + fatal_error( "Expected number argument with -H option instead of '%s'\n", optarg ); + spec->heap_size = atoi(optarg); + if (spec->heap_size > 65535) + fatal_error( "Invalid heap size %d, maximum is 65535\n", spec->heap_size ); + break; + case 'I': + /* ignored */ + break; + case 'K': + /* ignored, because cc generates correct code. */ + break; + case 'L': + lib_path = xrealloc( lib_path, (nb_lib_paths+1) * sizeof(*lib_path) ); + lib_path[nb_lib_paths++] = xstrdup( optarg ); + break; + case 'm': + if (strcmp( optarg, "32" ) && strcmp( optarg, "64" )) + fatal_error( "Invalid -m option '%s', expected -m32 or -m64\n", optarg ); + if (!strcmp( optarg, "32" )) force_pointer_size = 4; + else force_pointer_size = 8; + break; + case 'M': + spec->main_module = xstrdup( optarg ); + break; + case 'N': + spec->dll_name = xstrdup( optarg ); + break; + case 'b': + set_target( optarg ); + break; + case 'd': + add_delayed_import( optarg ); + break; + case 'e': + spec->init_func = xstrdup( optarg ); + if ((p = strchr( spec->init_func, '@' ))) *p = 0; /* kill stdcall decoration */ + break; + case 'f': + if (!strcmp( optarg, "PIC") || !strcmp( optarg, "pic")) UsePIC = 1; + /* ignore all other flags */ + break; + case 'h': + usage(0); + break; + case 'i': + { + char *str = xstrdup( optarg ); + char *token = strtok( str, "," ); + while (token) + { + add_ignore_symbol( token ); + token = strtok( NULL, "," ); + } + free( str ); + } + break; + case 'k': + kill_at = 1; + break; + case 'l': + add_import_dll( optarg, NULL ); + break; + case 'o': + { + char *ext = strrchr( optarg, '.' ); + + if (unlink( optarg ) == -1 && errno != ENOENT) + fatal_error( "Unable to create output file '%s'\n", optarg ); + if (ext && !strcmp( ext, ".o" )) + { + output_file_source_name = get_temp_file_name( optarg, ".s" ); + if (!(output_file = fopen( output_file_source_name, "w" ))) + fatal_error( "Unable to create output file '%s'\n", optarg ); + } + else + { + if (!(output_file = fopen( optarg, "w" ))) + fatal_error( "Unable to create output file '%s'\n", optarg ); + } + output_file_name = xstrdup(optarg); + atexit( cleanup ); /* make sure we remove the output file on exit */ + } + break; + case 'r': + res_files = xrealloc( res_files, (nb_res_files+1) * sizeof(*res_files) ); + res_files[nb_res_files++] = xstrdup( optarg ); + break; + case 'u': + add_extra_ld_symbol( optarg ); + break; + case 'v': + verbose++; + break; + case 'w': + display_warnings = 1; + break; + case LONG_OPT_DLL: + set_exec_mode( MODE_DLL ); + break; + case LONG_OPT_DEF: + set_exec_mode( MODE_DEF ); + break; + case LONG_OPT_EXE: + set_exec_mode( MODE_EXE ); + if (!spec->subsystem) spec->subsystem = IMAGE_SUBSYSTEM_WINDOWS_GUI; + break; + case LONG_OPT_ASCMD: + as_command = xstrdup( optarg ); + break; + case LONG_OPT_FAKE_MODULE: + fake_module = 1; + break; + case LONG_OPT_EXTERNAL_SYMS: + link_ext_symbols = 1; + break; + case LONG_OPT_LARGE_ADDRESS_AWARE: + spec->characteristics |= IMAGE_FILE_LARGE_ADDRESS_AWARE; + break; + case LONG_OPT_LDCMD: + ld_command = xstrdup( optarg ); + break; + case LONG_OPT_NMCMD: + nm_command = xstrdup( optarg ); + break; + case LONG_OPT_NXCOMPAT: + if (optarg[0] == 'n' || optarg[0] == 'N') + spec->dll_characteristics &= ~IMAGE_DLLCHARACTERISTICS_NX_COMPAT; + break; + case LONG_OPT_RELAY16: + set_exec_mode( MODE_RELAY16 ); + break; + case LONG_OPT_RELAY32: + set_exec_mode( MODE_RELAY32 ); + break; + case LONG_OPT_RESOURCES: + set_exec_mode( MODE_RESOURCES ); + break; + case LONG_OPT_SAVE_TEMPS: + save_temps = 1; + break; + case LONG_OPT_SUBSYSTEM: + set_subsystem( optarg, spec ); + break; + case LONG_OPT_VERSION: + printf( "winebuild version " PACKAGE_VERSION "\n" ); + exit(0); + case LONG_OPT_PEDLL: + set_exec_mode( MODE_PEDLL ); + spec_file_name = xstrdup( optarg ); + set_dll_file_name( optarg, spec ); + break; + case '?': + usage(1); + break; + } + } + + if (spec->file_name && !strchr( spec->file_name, '.' )) + strcat( spec->file_name, exec_mode == MODE_EXE ? ".exe" : ".dll" ); + + switch (target_cpu) + { + case CPU_x86: + if (force_pointer_size == 8) target_cpu = CPU_x86_64; + break; + case CPU_x86_64: + if (force_pointer_size == 4) target_cpu = CPU_x86; + break; + default: + if (force_pointer_size == 8) + fatal_error( "Cannot build 64-bit code for this CPU\n" ); + break; + } + + return &argv[optind]; +} + + +/* load all specified resource files */ +static void load_resources( char *argv[], DLLSPEC *spec ) +{ + int i; + char **ptr, **last; + + switch (spec->type) + { + case SPEC_WIN16: + for (i = 0; i < nb_res_files; i++) load_res16_file( res_files[i], spec ); + break; + + case SPEC_WIN32: + for (i = 0; i < nb_res_files; i++) + { + if (!load_res32_file( res_files[i], spec )) + fatal_error( "%s is not a valid Win32 resource file\n", res_files[i] ); + } + + /* load any resource file found in the remaining arguments */ + for (ptr = last = argv; *ptr; ptr++) + { + if (!load_res32_file( *ptr, spec )) + *last++ = *ptr; /* not a resource file, keep it in the list */ + } + *last = NULL; + break; + } +} + +/* add input files that look like import libs to the import list */ +static void load_import_libs( char *argv[] ) +{ + char **ptr, **last; + + for (ptr = last = argv; *ptr; ptr++) + { + if (strendswith( *ptr, ".def" )) + add_import_dll( NULL, *ptr ); + else + *last++ = *ptr; /* not an import dll, keep it in the list */ + } + *last = NULL; +} + +static int parse_input_file( DLLSPEC *spec ) +{ + FILE *input_file = open_input_file( NULL, spec_file_name ); + char *extension = strrchr( spec_file_name, '.' ); + int result; + + spec->src_name = xstrdup( input_file_name ); + if (extension && !strcmp( extension, ".def" )) + result = parse_def_file( input_file, spec ); + else + result = parse_spec_file( input_file, spec ); + close_input_file( input_file ); + return result; +} + + +/******************************************************************* + * main + */ +int main(int argc, char **argv) +{ + DLLSPEC *spec = alloc_dll_spec(); + +#ifdef SIGHUP + signal( SIGHUP, exit_on_signal ); +#endif + signal( SIGTERM, exit_on_signal ); + signal( SIGINT, exit_on_signal ); + + output_file = stdout; + argv = parse_options( argc, argv, spec ); + + switch(exec_mode) + { + case MODE_DLL: + if (spec->subsystem != IMAGE_SUBSYSTEM_NATIVE) + spec->characteristics |= IMAGE_FILE_DLL; + if (!spec_file_name) fatal_error( "missing .spec file\n" ); + if (spec->type == SPEC_WIN32 && spec->main_module) /* embedded 16-bit module */ + { + spec->type = SPEC_WIN16; + load_resources( argv, spec ); + if (parse_input_file( spec )) BuildSpec16File( spec ); + break; + } + /* fall through */ + case MODE_EXE: + load_resources( argv, spec ); + load_import_libs( argv ); + if (spec_file_name && !parse_input_file( spec )) break; + if (fake_module) + { + if (spec->type == SPEC_WIN16) output_fake_module16( spec ); + else output_fake_module( spec ); + break; + } + read_undef_symbols( spec, argv ); + switch (spec->type) + { + case SPEC_WIN16: + output_spec16_file( spec ); + break; + case SPEC_WIN32: + BuildSpec32File( spec ); + break; + default: assert(0); + } + break; + case MODE_DEF: + if (argv[0]) fatal_error( "file argument '%s' not allowed in this mode\n", argv[0] ); + if (spec->type == SPEC_WIN16) fatal_error( "Cannot yet build .def file for 16-bit dlls\n" ); + if (!spec_file_name) fatal_error( "missing .spec file\n" ); + if (!parse_input_file( spec )) break; + BuildDef32File( spec ); + break; + case MODE_RELAY16: + if (argv[0]) fatal_error( "file argument '%s' not allowed in this mode\n", argv[0] ); + BuildRelays16(); + break; + case MODE_RELAY32: + if (argv[0]) fatal_error( "file argument '%s' not allowed in this mode\n", argv[0] ); + BuildRelays32(); + break; + case MODE_PEDLL: + if (argv[0]) fatal_error( "file argument '%s' not allowed in this mode\n", argv[0] ); + if (!parse_input_file( spec )) break; + BuildPedllFile( spec ); + break; + case MODE_RESOURCES: + load_resources( argv, spec ); + output_res_o_file( spec ); + break; + default: + usage(1); + break; + } + if (nb_errors) exit(1); + if (output_file_name) + { + if (fclose( output_file ) < 0) fatal_perror( "fclose" ); + if (output_file_source_name) assemble_file( output_file_source_name, output_file_name ); + output_file_name = NULL; + } + return 0; +} diff --git a/tools/winebuild/mkstemps.c b/tools/winebuild/mkstemps.c new file mode 100644 index 00000000000..5558a6e78f0 --- /dev/null +++ b/tools/winebuild/mkstemps.c @@ -0,0 +1,139 @@ +/* Copyright (C) 1991, 1992, 1996, 1998 Free Software Foundation, Inc. + This file is derived from mkstemp.c from the GNU C Library. + + The GNU C 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. + + The GNU C 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 the GNU C Library; if not, write to the Free + Software Foundation, Inc., 51 Franklin Street, Fifth Floor, + Boston, MA 02110-1301, USA. +*/ + +#include "config.h" + +#include +#include +#include +#include +#include +#include +#ifdef HAVE_UNISTD_H +#include +#endif +#ifdef HAVE_SYS_TIME_H +#include +#endif +#ifdef HAVE_PROCESS_H +#include +#endif + +/* We need to provide a type for gcc_uint64_t. */ +#ifdef __GNUC__ +__extension__ typedef unsigned long long gcc_uint64_t; +#else +typedef unsigned long gcc_uint64_t; +#endif + +#ifndef TMP_MAX +#define TMP_MAX 16384 +#endif + +/* + +@deftypefn Replacement int mkstemps (char *@var{template}, int @var{suffix_len}) + +Generate a unique temporary file name from @var{template}. +@var{template} has the form: + +@example + @var{path}/ccXXXXXX@var{suffix} +@end example + +@var{suffix_len} tells us how long @var{suffix} is (it can be zero +length). The last six characters of @var{template} before @var{suffix} +must be @samp{XXXXXX}; they are replaced with a string that makes the +filename unique. Returns a file descriptor open on the file for +reading and writing. + +@end deftypefn + +*/ + +int +mkstemps ( + char *template, + int suffix_len) +{ + static const char letters[] + = "abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789"; + static gcc_uint64_t value; +#ifdef HAVE_GETTIMEOFDAY + struct timeval tv; +#endif + char *XXXXXX; + size_t len; + int count; + + len = strlen (template); + + if ((int) len < 6 + suffix_len + || strncmp (&template[len - 6 - suffix_len], "XXXXXX", 6)) + { + return -1; + } + + XXXXXX = &template[len - 6 - suffix_len]; + +#ifdef HAVE_GETTIMEOFDAY + /* Get some more or less random data. */ + gettimeofday (&tv, NULL); + value += ((gcc_uint64_t) tv.tv_usec << 16) ^ tv.tv_sec ^ getpid (); +#else + value += getpid (); +#endif + + for (count = 0; count < TMP_MAX; ++count) + { + gcc_uint64_t v = value; + int fd; + + /* Fill in the random bits. */ + XXXXXX[0] = letters[v % 62]; + v /= 62; + XXXXXX[1] = letters[v % 62]; + v /= 62; + XXXXXX[2] = letters[v % 62]; + v /= 62; + XXXXXX[3] = letters[v % 62]; + v /= 62; + XXXXXX[4] = letters[v % 62]; + v /= 62; + XXXXXX[5] = letters[v % 62]; + +#ifdef VMS + fd = open (template, O_RDWR|O_CREAT|O_EXCL, 0600, "fop=tmd"); +#else + fd = open (template, O_RDWR|O_CREAT|O_EXCL, 0600); +#endif + if (fd >= 0) + /* The file does not exist. */ + return fd; + + /* This is a random value. It is only necessary that the next + TMP_MAX values generated by adding 7777 to VALUE are different + with (module 2^32). */ + value += 7777; + } + + /* We return the null string if we can't find a unique file name. */ + template[0] = '\0'; + return -1; +} diff --git a/tools/winebuild/parser.c b/tools/winebuild/parser.c new file mode 100644 index 00000000000..ba813a4d30d --- /dev/null +++ b/tools/winebuild/parser.c @@ -0,0 +1,1048 @@ +/* + * Spec file parser + * + * Copyright 1993 Robert J. Amstadt + * Copyright 1995 Martin von Loewis + * Copyright 1995, 1996, 1997, 2004 Alexandre Julliard + * Copyright 1997 Eric Youngdale + * Copyright 1999 Ulrich Weigand + * + * 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 + */ + +#include "config.h" +#include "wine/port.h" + +#include +#include +#include +#include +#include +#include + +#include "build.h" + +int current_line = 0; + +static char ParseBuffer[512]; +static char TokenBuffer[512]; +static char *ParseNext = ParseBuffer; +static FILE *input_file; + +static const char *separator_chars; +static const char *comment_chars; + +/* valid characters in ordinal names */ +static const char valid_ordname_chars[] = "/$:-_@?abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789"; + +static const char * const TypeNames[TYPE_NBTYPES] = +{ + "variable", /* TYPE_VARIABLE */ + "pascal", /* TYPE_PASCAL */ + "equate", /* TYPE_ABS */ + "stub", /* TYPE_STUB */ + "stdcall", /* TYPE_STDCALL */ + "cdecl", /* TYPE_CDECL */ + "varargs", /* TYPE_VARARGS */ + "fastcall", /* TYPE_FASTCALL */ + "extern" /* TYPE_EXTERN */ +}; + +static const char * const FlagNames[] = +{ + "norelay", /* FLAG_NORELAY */ + "noname", /* FLAG_NONAME */ + "ret16", /* FLAG_RET16 */ + "ret64", /* FLAG_RET64 */ + "register", /* FLAG_REGISTER */ + "private", /* FLAG_PRIVATE */ + "ordinal", /* FLAG_ORDINAL */ + NULL +}; + +static int IsNumberString(const char *s) +{ + while (*s) if (!isdigit(*s++)) return 0; + return 1; +} + +static inline int is_token_separator( char ch ) +{ + return strchr( separator_chars, ch ) != NULL; +} + +static inline int is_token_comment( char ch ) +{ + return strchr( comment_chars, ch ) != NULL; +} + +/* get the next line from the input file, or return 0 if at eof */ +static int get_next_line(void) +{ + ParseNext = ParseBuffer; + current_line++; + return (fgets(ParseBuffer, sizeof(ParseBuffer), input_file) != NULL); +} + +static const char * GetToken( int allow_eol ) +{ + char *p = ParseNext; + char *token = TokenBuffer; + + for (;;) + { + /* remove initial white space */ + p = ParseNext; + while (isspace(*p)) p++; + + if (*p == '\\' && p[1] == '\n') /* line continuation */ + { + if (!get_next_line()) + { + if (!allow_eol) error( "Unexpected end of file\n" ); + return NULL; + } + } + else break; + } + + if ((*p == '\0') || is_token_comment(*p)) + { + if (!allow_eol) error( "Declaration not terminated properly\n" ); + return NULL; + } + + /* + * Find end of token. + */ + if (is_token_separator(*p)) + { + /* a separator is always a complete token */ + *token++ = *p++; + } + else while (*p != '\0' && !is_token_separator(*p) && !isspace(*p)) + { + if (*p == '\\') p++; + if (*p) *token++ = *p++; + } + *token = '\0'; + ParseNext = p; + return TokenBuffer; +} + + +static ORDDEF *add_entry_point( DLLSPEC *spec ) +{ + ORDDEF *ret; + + if (spec->nb_entry_points == spec->alloc_entry_points) + { + spec->alloc_entry_points += 128; + spec->entry_points = xrealloc( spec->entry_points, + spec->alloc_entry_points * sizeof(*spec->entry_points) ); + } + ret = &spec->entry_points[spec->nb_entry_points++]; + memset( ret, 0, sizeof(*ret) ); + return ret; +} + +/******************************************************************* + * parse_spec_variable + * + * Parse a variable definition in a .spec file. + */ +static int parse_spec_variable( ORDDEF *odp, DLLSPEC *spec ) +{ + char *endptr; + int *value_array; + int n_values; + int value_array_size; + const char *token; + + if (spec->type == SPEC_WIN32) + { + error( "'variable' not supported in Win32, use 'extern' instead\n" ); + return 0; + } + + if (!(token = GetToken(0))) return 0; + if (*token != '(') + { + error( "Expected '(' got '%s'\n", token ); + return 0; + } + + n_values = 0; + value_array_size = 25; + value_array = xmalloc(sizeof(*value_array) * value_array_size); + + for (;;) + { + if (!(token = GetToken(0))) + { + free( value_array ); + return 0; + } + if (*token == ')') + break; + + value_array[n_values++] = strtol(token, &endptr, 0); + if (n_values == value_array_size) + { + value_array_size += 25; + value_array = xrealloc(value_array, + sizeof(*value_array) * value_array_size); + } + + if (endptr == NULL || *endptr != '\0') + { + error( "Expected number value, got '%s'\n", token ); + free( value_array ); + return 0; + } + } + + odp->u.var.n_values = n_values; + odp->u.var.values = xrealloc(value_array, sizeof(*value_array) * n_values); + return 1; +} + + +/******************************************************************* + * parse_spec_export + * + * Parse an exported function definition in a .spec file. + */ +static int parse_spec_export( ORDDEF *odp, DLLSPEC *spec ) +{ + const char *token; + unsigned int i; + + switch(spec->type) + { + case SPEC_WIN16: + if (odp->type == TYPE_STDCALL) + { + error( "'stdcall' not supported for Win16\n" ); + return 0; + } + break; + case SPEC_WIN32: + if (odp->type == TYPE_PASCAL) + { + error( "'pascal' not supported for Win32\n" ); + return 0; + } + break; + default: + break; + } + + if (!(token = GetToken(0))) return 0; + if (*token != '(') + { + error( "Expected '(' got '%s'\n", token ); + return 0; + } + + for (i = 0; i < sizeof(odp->u.func.arg_types); i++) + { + if (!(token = GetToken(0))) return 0; + if (*token == ')') + break; + + if (!strcmp(token, "word")) + odp->u.func.arg_types[i] = 'w'; + else if (!strcmp(token, "s_word")) + odp->u.func.arg_types[i] = 's'; + else if (!strcmp(token, "long") || !strcmp(token, "segptr")) + odp->u.func.arg_types[i] = 'l'; + else if (!strcmp(token, "ptr")) + odp->u.func.arg_types[i] = 'p'; + else if (!strcmp(token, "str")) + odp->u.func.arg_types[i] = 't'; + else if (!strcmp(token, "wstr")) + odp->u.func.arg_types[i] = 'W'; + else if (!strcmp(token, "segstr")) + odp->u.func.arg_types[i] = 'T'; + else if (!strcmp(token, "double")) + { + odp->u.func.arg_types[i++] = 'l'; + if (get_ptr_size() == 4 && i < sizeof(odp->u.func.arg_types)) + odp->u.func.arg_types[i] = 'l'; + } + else + { + error( "Unknown argument type '%s'\n", token ); + return 0; + } + + if (spec->type == SPEC_WIN32) + { + if (strcmp(token, "long") && + strcmp(token, "ptr") && + strcmp(token, "str") && + strcmp(token, "wstr") && + strcmp(token, "double")) + { + error( "Type '%s' not supported for Win32\n", token ); + return 0; + } + } + } + if ((*token != ')') || (i >= sizeof(odp->u.func.arg_types))) + { + error( "Too many arguments\n" ); + return 0; + } + + odp->u.func.arg_types[i] = '\0'; + if (odp->type == TYPE_VARARGS) + odp->flags |= FLAG_NORELAY; /* no relay debug possible for varags entry point */ + + if (!(token = GetToken(1))) + { + if (!strcmp( odp->name, "@" )) + { + error( "Missing handler name for anonymous function\n" ); + return 0; + } + odp->link_name = xstrdup( odp->name ); + } + else + { + odp->link_name = xstrdup( token ); + if (strchr( odp->link_name, '.' )) + { + if (spec->type == SPEC_WIN16) + { + error( "Forwarded functions not supported for Win16\n" ); + return 0; + } + odp->flags |= FLAG_FORWARD; + } + } + return 1; +} + + +/******************************************************************* + * parse_spec_equate + * + * Parse an 'equate' definition in a .spec file. + */ +static int parse_spec_equate( ORDDEF *odp, DLLSPEC *spec ) +{ + char *endptr; + int value; + const char *token; + + if (spec->type == SPEC_WIN32) + { + error( "'equate' not supported for Win32\n" ); + return 0; + } + if (!(token = GetToken(0))) return 0; + value = strtol(token, &endptr, 0); + if (endptr == NULL || *endptr != '\0') + { + error( "Expected number value, got '%s'\n", token ); + return 0; + } + if (value < -0x8000 || value > 0xffff) + { + error( "Value %d for absolute symbol doesn't fit in 16 bits\n", value ); + value = 0; + } + odp->u.abs.value = value; + return 1; +} + + +/******************************************************************* + * parse_spec_stub + * + * Parse a 'stub' definition in a .spec file + */ +static int parse_spec_stub( ORDDEF *odp, DLLSPEC *spec ) +{ + odp->u.func.arg_types[0] = '\0'; + odp->link_name = xstrdup(""); + odp->flags |= FLAG_CPU(CPU_x86) | FLAG_CPU(CPU_x86_64); /* don't bother generating stubs for Winelib */ + return 1; +} + + +/******************************************************************* + * parse_spec_extern + * + * Parse an 'extern' definition in a .spec file. + */ +static int parse_spec_extern( ORDDEF *odp, DLLSPEC *spec ) +{ + const char *token; + + if (spec->type == SPEC_WIN16) + { + error( "'extern' not supported for Win16, use 'variable' instead\n" ); + return 0; + } + if (!(token = GetToken(1))) + { + if (!strcmp( odp->name, "@" )) + { + error( "Missing handler name for anonymous extern\n" ); + return 0; + } + odp->link_name = xstrdup( odp->name ); + } + else + { + odp->link_name = xstrdup( token ); + if (strchr( odp->link_name, '.' )) odp->flags |= FLAG_FORWARD; + } + return 1; +} + + +/******************************************************************* + * parse_spec_flags + * + * Parse the optional flags for an entry point in a .spec file. + */ +static const char *parse_spec_flags( ORDDEF *odp ) +{ + unsigned int i; + const char *token; + + do + { + if (!(token = GetToken(0))) break; + if (!strncmp( token, "arch=", 5)) + { + char *args = xstrdup( token + 5 ); + char *cpu_name = strtok( args, "," ); + while (cpu_name) + { + if (!strcmp( cpu_name, "win32" )) + odp->flags |= FLAG_CPU_WIN32; + else if (!strcmp( cpu_name, "win64" )) + odp->flags |= FLAG_CPU_WIN64; + else + { + enum target_cpu cpu = get_cpu_from_name( cpu_name ); + if (cpu == -1) + { + error( "Unknown architecture '%s'\n", cpu_name ); + return NULL; + } + odp->flags |= FLAG_CPU( cpu ); + } + cpu_name = strtok( NULL, "," ); + } + free( args ); + } + else if (!strcmp( token, "i386" )) /* backwards compatibility */ + { + odp->flags |= FLAG_CPU(CPU_x86); + } + else + { + for (i = 0; FlagNames[i]; i++) + if (!strcmp( FlagNames[i], token )) break; + if (!FlagNames[i]) + { + error( "Unknown flag '%s'\n", token ); + return NULL; + } + odp->flags |= 1 << i; + } + token = GetToken(0); + } while (token && *token == '-'); + + return token; +} + + +/******************************************************************* + * parse_spec_ordinal + * + * Parse an ordinal definition in a .spec file. + */ +static int parse_spec_ordinal( int ordinal, DLLSPEC *spec ) +{ + const char *token; + size_t len; + ORDDEF *odp = add_entry_point( spec ); + + if (!(token = GetToken(0))) goto error; + + for (odp->type = 0; odp->type < TYPE_NBTYPES; odp->type++) + if (TypeNames[odp->type] && !strcmp( token, TypeNames[odp->type] )) + break; + + if (odp->type >= TYPE_NBTYPES) + { + error( "Expected type after ordinal, found '%s' instead\n", token ); + goto error; + } + + if (!(token = GetToken(0))) goto error; + if (*token == '-' && !(token = parse_spec_flags( odp ))) goto error; + + odp->name = xstrdup( token ); + odp->lineno = current_line; + odp->ordinal = ordinal; + + len = strspn( odp->name, valid_ordname_chars ); + if (len < strlen( odp->name )) + { + error( "Character '%c' is not allowed in exported name '%s'\n", odp->name[len], odp->name ); + goto error; + } + + switch(odp->type) + { + case TYPE_VARIABLE: + if (!parse_spec_variable( odp, spec )) goto error; + break; + case TYPE_PASCAL: + case TYPE_STDCALL: + case TYPE_VARARGS: + case TYPE_CDECL: + case TYPE_FASTCALL: + if (!parse_spec_export( odp, spec )) goto error; + break; + case TYPE_ABS: + if (!parse_spec_equate( odp, spec )) goto error; + break; + case TYPE_STUB: + if (!parse_spec_stub( odp, spec )) goto error; + break; + case TYPE_EXTERN: + if (!parse_spec_extern( odp, spec )) goto error; + break; + default: + assert( 0 ); + } + + if ((odp->flags & FLAG_CPU_MASK) && !(odp->flags & FLAG_CPU(target_cpu))) + { + /* ignore this entry point */ + spec->nb_entry_points--; + return 1; + } + + if (ordinal != -1) + { + if (!ordinal) + { + error( "Ordinal 0 is not valid\n" ); + goto error; + } + if (ordinal >= MAX_ORDINALS) + { + error( "Ordinal number %d too large\n", ordinal ); + goto error; + } + if (ordinal > spec->limit) spec->limit = ordinal; + if (ordinal < spec->base) spec->base = ordinal; + odp->ordinal = ordinal; + } + + if (odp->type == TYPE_STDCALL && !(odp->flags & FLAG_PRIVATE)) + { + if (!strcmp( odp->name, "DllRegisterServer" ) || + !strcmp( odp->name, "DllUnregisterServer" ) || + !strcmp( odp->name, "DllGetClassObject" ) || + !strcmp( odp->name, "DllGetVersion" ) || + !strcmp( odp->name, "DllInstall" ) || + !strcmp( odp->name, "DllCanUnloadNow" )) + { + warning( "Function %s should be marked private\n", odp->name ); + if (strcmp( odp->name, odp->link_name )) + warning( "Function %s should not use a different internal name (%s)\n", + odp->name, odp->link_name ); + } + } + + if (!strcmp( odp->name, "@" ) || odp->flags & (FLAG_NONAME | FLAG_ORDINAL)) + { + if (ordinal == -1) + { + if (!strcmp( odp->name, "@" )) + error( "Nameless function needs an explicit ordinal number\n" ); + else + error( "Function imported by ordinal needs an explicit ordinal number\n" ); + goto error; + } + if (spec->type != SPEC_WIN32) + { + error( "Nameless functions not supported for Win16\n" ); + goto error; + } + if (!strcmp( odp->name, "@" )) + { + free( odp->name ); + odp->name = NULL; + } + else if (!(odp->flags & FLAG_ORDINAL)) /* -ordinal only affects the import library */ + { + odp->export_name = odp->name; + odp->name = NULL; + } + } + return 1; + +error: + spec->nb_entry_points--; + free( odp->name ); + return 0; +} + + +static int name_compare( const void *ptr1, const void *ptr2 ) +{ + const ORDDEF *odp1 = *(const ORDDEF * const *)ptr1; + const ORDDEF *odp2 = *(const ORDDEF * const *)ptr2; + const char *name1 = odp1->name ? odp1->name : odp1->export_name; + const char *name2 = odp2->name ? odp2->name : odp2->export_name; + return strcmp( name1, name2 ); +} + +/******************************************************************* + * assign_names + * + * Build the name array and catch duplicates. + */ +static void assign_names( DLLSPEC *spec ) +{ + int i, j, nb_exp_names = 0; + ORDDEF **all_names; + + spec->nb_names = 0; + for (i = 0; i < spec->nb_entry_points; i++) + if (spec->entry_points[i].name) spec->nb_names++; + else if (spec->entry_points[i].export_name) nb_exp_names++; + + if (!spec->nb_names && !nb_exp_names) return; + + /* check for duplicates */ + + all_names = xmalloc( (spec->nb_names + nb_exp_names) * sizeof(all_names[0]) ); + for (i = j = 0; i < spec->nb_entry_points; i++) + if (spec->entry_points[i].name || spec->entry_points[i].export_name) + all_names[j++] = &spec->entry_points[i]; + + qsort( all_names, j, sizeof(all_names[0]), name_compare ); + + for (i = 0; i < j - 1; i++) + { + const char *name1 = all_names[i]->name ? all_names[i]->name : all_names[i]->export_name; + const char *name2 = all_names[i+1]->name ? all_names[i+1]->name : all_names[i+1]->export_name; + if (!strcmp( name1, name2 )) + { + current_line = max( all_names[i]->lineno, all_names[i+1]->lineno ); + error( "'%s' redefined\n%s:%d: First defined here\n", + name1, input_file_name, + min( all_names[i]->lineno, all_names[i+1]->lineno ) ); + } + } + free( all_names ); + + if (spec->nb_names) + { + spec->names = xmalloc( spec->nb_names * sizeof(spec->names[0]) ); + for (i = j = 0; i < spec->nb_entry_points; i++) + if (spec->entry_points[i].name) spec->names[j++] = &spec->entry_points[i]; + + /* sort the list of names */ + qsort( spec->names, spec->nb_names, sizeof(spec->names[0]), name_compare ); + } +} + +/******************************************************************* + * assign_ordinals + * + * Build the ordinal array. + */ +static void assign_ordinals( DLLSPEC *spec ) +{ + int i, count, ordinal; + + /* start assigning from base, or from 1 if no ordinal defined yet */ + + spec->base = MAX_ORDINALS; + spec->limit = 0; + for (i = 0; i < spec->nb_entry_points; i++) + { + ordinal = spec->entry_points[i].ordinal; + if (ordinal == -1) continue; + if (ordinal > spec->limit) spec->limit = ordinal; + if (ordinal < spec->base) spec->base = ordinal; + } + if (spec->base == MAX_ORDINALS) spec->base = 1; + if (spec->limit < spec->base) spec->limit = spec->base; + + count = max( spec->limit + 1, spec->base + spec->nb_entry_points ); + spec->ordinals = xmalloc( count * sizeof(spec->ordinals[0]) ); + memset( spec->ordinals, 0, count * sizeof(spec->ordinals[0]) ); + + /* fill in all explicitly specified ordinals */ + for (i = 0; i < spec->nb_entry_points; i++) + { + ordinal = spec->entry_points[i].ordinal; + if (ordinal == -1) continue; + if (spec->ordinals[ordinal]) + { + current_line = max( spec->entry_points[i].lineno, spec->ordinals[ordinal]->lineno ); + error( "ordinal %d redefined\n%s:%d: First defined here\n", + ordinal, input_file_name, + min( spec->entry_points[i].lineno, spec->ordinals[ordinal]->lineno ) ); + } + else spec->ordinals[ordinal] = &spec->entry_points[i]; + } + + /* now assign ordinals to the rest */ + for (i = 0, ordinal = spec->base; i < spec->nb_entry_points; i++) + { + if (spec->entry_points[i].ordinal != -1) continue; + while (spec->ordinals[ordinal]) ordinal++; + if (ordinal >= MAX_ORDINALS) + { + current_line = spec->entry_points[i].lineno; + fatal_error( "Too many functions defined (max %d)\n", MAX_ORDINALS ); + } + spec->entry_points[i].ordinal = ordinal; + spec->ordinals[ordinal] = &spec->entry_points[i]; + } + if (ordinal > spec->limit) spec->limit = ordinal; +} + + +/******************************************************************* + * add_16bit_exports + * + * Add the necessary exports to the 32-bit counterpart of a 16-bit module. + */ +void add_16bit_exports( DLLSPEC *spec32, DLLSPEC *spec16 ) +{ + ORDDEF *odp; + + /* add an export for the NE module */ + + odp = add_entry_point( spec32 ); + odp->type = TYPE_EXTERN; + odp->name = xstrdup( "__wine_spec_dos_header" ); + odp->lineno = 0; + odp->ordinal = 1; + odp->link_name = xstrdup( ".L__wine_spec_dos_header" ); + + if (spec16->main_module) + { + odp = add_entry_point( spec32 ); + odp->type = TYPE_EXTERN; + odp->name = xstrdup( "__wine_spec_main_module" ); + odp->lineno = 0; + odp->ordinal = 2; + odp->link_name = xstrdup( ".L__wine_spec_main_module" ); + } + + assign_names( spec32 ); + assign_ordinals( spec32 ); +} + + +/******************************************************************* + * parse_spec_file + * + * Parse a .spec file. + */ +int parse_spec_file( FILE *file, DLLSPEC *spec ) +{ + const char *token; + + input_file = file; + current_line = 0; + + comment_chars = "#;"; + separator_chars = "()-"; + + while (get_next_line()) + { + if (!(token = GetToken(1))) continue; + if (strcmp(token, "@") == 0) + { + if (spec->type != SPEC_WIN32) + { + error( "'@' ordinals not supported for Win16\n" ); + continue; + } + if (!parse_spec_ordinal( -1, spec )) continue; + } + else if (IsNumberString(token)) + { + if (!parse_spec_ordinal( atoi(token), spec )) continue; + } + else + { + error( "Expected ordinal declaration, got '%s'\n", token ); + continue; + } + if ((token = GetToken(1))) error( "Syntax error near '%s'\n", token ); + } + + current_line = 0; /* no longer parsing the input file */ + assign_names( spec ); + assign_ordinals( spec ); + return !nb_errors; +} + + +/******************************************************************* + * parse_def_library + * + * Parse a LIBRARY declaration in a .def file. + */ +static int parse_def_library( DLLSPEC *spec ) +{ + const char *token = GetToken(1); + + if (!token) return 1; + if (strcmp( token, "BASE" )) + { + free( spec->file_name ); + spec->file_name = xstrdup( token ); + if (!(token = GetToken(1))) return 1; + } + if (strcmp( token, "BASE" )) + { + error( "Expected library name or BASE= declaration, got '%s'\n", token ); + return 0; + } + if (!(token = GetToken(0))) return 0; + if (strcmp( token, "=" )) + { + error( "Expected '=' after BASE, got '%s'\n", token ); + return 0; + } + if (!(token = GetToken(0))) return 0; + /* FIXME: do something with base address */ + + return 1; +} + + +/******************************************************************* + * parse_def_stack_heap_size + * + * Parse a STACKSIZE or HEAPSIZE declaration in a .def file. + */ +static int parse_def_stack_heap_size( int is_stack, DLLSPEC *spec ) +{ + const char *token = GetToken(0); + char *end; + unsigned long size; + + if (!token) return 0; + size = strtoul( token, &end, 0 ); + if (*end) + { + error( "Invalid number '%s'\n", token ); + return 0; + } + if (is_stack) spec->stack_size = size / 1024; + else spec->heap_size = size / 1024; + if (!(token = GetToken(1))) return 1; + if (strcmp( token, "," )) + { + error( "Expected ',' after size, got '%s'\n", token ); + return 0; + } + if (!(token = GetToken(0))) return 0; + /* FIXME: do something with reserve size */ + return 1; +} + + +/******************************************************************* + * parse_def_export + * + * Parse an export declaration in a .def file. + */ +static int parse_def_export( char *name, DLLSPEC *spec ) +{ + int i, args; + const char *token = GetToken(1); + ORDDEF *odp = add_entry_point( spec ); + + odp->lineno = current_line; + odp->ordinal = -1; + odp->name = name; + args = remove_stdcall_decoration( odp->name ); + if (args == -1) odp->type = TYPE_CDECL; + else + { + odp->type = TYPE_STDCALL; + args /= get_ptr_size(); + if (args >= sizeof(odp->u.func.arg_types)) + { + error( "Too many arguments in stdcall function '%s'\n", odp->name ); + return 0; + } + for (i = 0; i < args; i++) odp->u.func.arg_types[i] = 'l'; + } + + /* check for optional internal name */ + + if (token && !strcmp( token, "=" )) + { + if (!(token = GetToken(0))) goto error; + odp->link_name = xstrdup( token ); + remove_stdcall_decoration( odp->link_name ); + token = GetToken(1); + } + else + { + odp->link_name = xstrdup( name ); + } + + /* check for optional ordinal */ + + if (token && token[0] == '@') + { + int ordinal; + + if (!IsNumberString( token+1 )) + { + error( "Expected number after '@', got '%s'\n", token+1 ); + goto error; + } + ordinal = atoi( token+1 ); + if (!ordinal) + { + error( "Ordinal 0 is not valid\n" ); + goto error; + } + if (ordinal >= MAX_ORDINALS) + { + error( "Ordinal number %d too large\n", ordinal ); + goto error; + } + odp->ordinal = ordinal; + token = GetToken(1); + } + + /* check for other optional keywords */ + + if (token && !strcmp( token, "NONAME" )) + { + if (odp->ordinal == -1) + { + error( "NONAME requires an ordinal\n" ); + goto error; + } + odp->export_name = odp->name; + odp->name = NULL; + odp->flags |= FLAG_NONAME; + token = GetToken(1); + } + if (token && !strcmp( token, "PRIVATE" )) + { + odp->flags |= FLAG_PRIVATE; + token = GetToken(1); + } + if (token && !strcmp( token, "DATA" )) + { + odp->type = TYPE_EXTERN; + token = GetToken(1); + } + if (token) + { + error( "Garbage text '%s' found at end of export declaration\n", token ); + goto error; + } + return 1; + +error: + spec->nb_entry_points--; + free( odp->name ); + return 0; +} + + +/******************************************************************* + * parse_def_file + * + * Parse a .def file. + */ +int parse_def_file( FILE *file, DLLSPEC *spec ) +{ + const char *token; + int in_exports = 0; + + input_file = file; + current_line = 0; + + comment_chars = ";"; + separator_chars = ",="; + + while (get_next_line()) + { + if (!(token = GetToken(1))) continue; + + if (!strcmp( token, "LIBRARY" ) || !strcmp( token, "NAME" )) + { + if (!parse_def_library( spec )) continue; + goto end_of_line; + } + else if (!strcmp( token, "STACKSIZE" )) + { + if (!parse_def_stack_heap_size( 1, spec )) continue; + goto end_of_line; + } + else if (!strcmp( token, "HEAPSIZE" )) + { + if (!parse_def_stack_heap_size( 0, spec )) continue; + goto end_of_line; + } + else if (!strcmp( token, "EXPORTS" )) + { + in_exports = 1; + if (!(token = GetToken(1))) continue; + } + else if (!strcmp( token, "IMPORTS" )) + { + in_exports = 0; + if (!(token = GetToken(1))) continue; + } + else if (!strcmp( token, "SECTIONS" )) + { + in_exports = 0; + if (!(token = GetToken(1))) continue; + } + + if (!in_exports) continue; /* ignore this line */ + if (!parse_def_export( xstrdup(token), spec )) continue; + + end_of_line: + if ((token = GetToken(1))) error( "Syntax error near '%s'\n", token ); + } + + current_line = 0; /* no longer parsing the input file */ + assign_names( spec ); + assign_ordinals( spec ); + return !nb_errors; +} diff --git a/tools/winebuild/relay.c b/tools/winebuild/relay.c new file mode 100644 index 00000000000..3f955451562 --- /dev/null +++ b/tools/winebuild/relay.c @@ -0,0 +1,1182 @@ +/* + * Relay calls helper routines + * + * Copyright 1993 Robert J. Amstadt + * Copyright 1995 Martin von Loewis + * Copyright 1995, 1996, 1997 Alexandre Julliard + * Copyright 1997 Eric Youngdale + * Copyright 1999 Ulrich Weigand + * + * 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 + */ + +#include "config.h" +#include "wine/port.h" + +#include +#include + +#include "build.h" + +/* offset of the stack pointer relative to %fs:(0) */ +#define STACKOFFSET 0xc0 /* FIELD_OFFSET(TEB,WOW32Reserved) */ + +/* fix this if the ntdll_thread_regs structure is changed */ +#define GS_OFFSET 0x1d8 /* FIELD_OFFSET(TEB,SystemReserved2) + FIELD_OFFSET(ntdll_thread_data,gs) */ + +#define DPMI_VIF_OFFSET (0x1fc + 0) /* FIELD_OFFSET(TEB,GdiTebBatch) + FIELD_OFFSET(WINE_VM86_TEB_INFO,dpmi_vif) */ +#define VM86_PENDING_OFFSET (0x1fc + 4) /* FIELD_OFFSET(TEB,GdiTebBatch) + FIELD_OFFSET(WINE_VM86_TEB_INFO,vm86_pending) */ + +static void function_header( const char *name ) +{ + output( "\n\t.align %d\n", get_alignment(4) ); + output( "\t%s\n", func_declaration(name) ); + output( "%s\n", asm_globl(name) ); +} + + +/******************************************************************* + * BuildCallFrom16Core + * + * This routine builds the core routines used in 16->32 thunks: + * CallFrom16Word, CallFrom16Long, CallFrom16Register, and CallFrom16Thunk. + * + * These routines are intended to be called via a far call (with 32-bit + * operand size) from 16-bit code. The 16-bit code stub must push %bp, + * the 32-bit entry point to be called, and the argument conversion + * routine to be used (see stack layout below). + * + * The core routine completes the STACK16FRAME on the 16-bit stack and + * switches to the 32-bit stack. Then, the argument conversion routine + * is called; it gets passed the 32-bit entry point and a pointer to the + * 16-bit arguments (on the 16-bit stack) as parameters. (You can either + * use conversion routines automatically generated by BuildCallFrom16, + * or write your own for special purposes.) + * + * The conversion routine must call the 32-bit entry point, passing it + * the converted arguments, and return its return value to the core. + * After the conversion routine has returned, the core switches back + * to the 16-bit stack, converts the return value to the DX:AX format + * (CallFrom16Long), and returns to the 16-bit call stub. All parameters, + * including %bp, are popped off the stack. + * + * The 16-bit call stub now returns to the caller, popping the 16-bit + * arguments if necessary (pascal calling convention). + * + * In the case of a 'register' function, CallFrom16Register fills a + * CONTEXT86 structure with the values all registers had at the point + * the first instruction of the 16-bit call stub was about to be + * executed. A pointer to this CONTEXT86 is passed as third parameter + * to the argument conversion routine, which typically passes it on + * to the called 32-bit entry point. + * + * CallFrom16Thunk is a special variant used by the implementation of + * the Win95 16->32 thunk functions C16ThkSL and C16ThkSL01 and is + * implemented as follows: + * On entry, the EBX register is set up to contain a flat pointer to the + * 16-bit stack such that EBX+22 points to the first argument. + * Then, the entry point is called, while EBP is set up to point + * to the return address (on the 32-bit stack). + * The called function returns with CX set to the number of bytes + * to be popped of the caller's stack. + * + * Stack layout upon entry to the core routine (STACK16FRAME): + * ... ... + * (sp+24) word first 16-bit arg + * (sp+22) word cs + * (sp+20) word ip + * (sp+18) word bp + * (sp+14) long 32-bit entry point (reused for Win16 mutex recursion count) + * (sp+12) word ip of actual entry point (necessary for relay debugging) + * (sp+8) long relay (argument conversion) function entry point + * (sp+4) long cs of 16-bit entry point + * (sp) long ip of 16-bit entry point + * + * Added on the stack: + * (sp-2) word saved gs + * (sp-4) word saved fs + * (sp-6) word saved es + * (sp-8) word saved ds + * (sp-12) long saved ebp + * (sp-16) long saved ecx + * (sp-20) long saved edx + * (sp-24) long saved previous stack + */ +static void BuildCallFrom16Core( int reg_func, int thunk ) +{ + /* Function header */ + if (thunk) function_header( "__wine_call_from_16_thunk" ); + else if (reg_func) function_header( "__wine_call_from_16_regs" ); + else function_header( "__wine_call_from_16" ); + + /* Create STACK16FRAME (except STACK32FRAME link) */ + output( "\tpushw %%gs\n" ); + output( "\tpushw %%fs\n" ); + output( "\tpushw %%es\n" ); + output( "\tpushw %%ds\n" ); + output( "\tpushl %%ebp\n" ); + output( "\tpushl %%ecx\n" ); + output( "\tpushl %%edx\n" ); + + /* Save original EFlags register */ + if (reg_func) output( "\tpushfl\n" ); + + if ( UsePIC ) + { + output( "\tcall 1f\n" ); + output( "1:\tpopl %%ecx\n" ); + output( "\t.byte 0x2e\n\tmovl %s-1b(%%ecx),%%edx\n", asm_name("CallTo16_DataSelector") ); + } + else + output( "\t.byte 0x2e\n\tmovl %s,%%edx\n", asm_name("CallTo16_DataSelector") ); + + /* Load 32-bit segment registers */ + output( "\tmovw %%dx, %%ds\n" ); + output( "\tmovw %%dx, %%es\n" ); + + if ( UsePIC ) + output( "\tmovw %s-1b(%%ecx), %%fs\n", asm_name("CallTo16_TebSelector") ); + else + output( "\tmovw %s, %%fs\n", asm_name("CallTo16_TebSelector") ); + + output( "\t.byte 0x64\n\tmov (%d),%%gs\n", GS_OFFSET ); + + /* Translate STACK16FRAME base to flat offset in %edx */ + output( "\tmovw %%ss, %%dx\n" ); + output( "\tandl $0xfff8, %%edx\n" ); + output( "\tshrl $1, %%edx\n" ); + if (UsePIC) + { + output( "\taddl wine_ldt_copy_ptr-1b(%%ecx),%%edx\n" ); + output( "\tmovl (%%edx), %%edx\n" ); + } + else + output( "\tmovl %s(%%edx), %%edx\n", asm_name("wine_ldt_copy") ); + output( "\tmovzwl %%sp, %%ebp\n" ); + output( "\tleal %d(%%ebp,%%edx), %%edx\n", reg_func ? 0 : -4 ); + + /* Get saved flags into %ecx */ + if (reg_func) output( "\tpopl %%ecx\n" ); + + /* Get the 32-bit stack pointer from the TEB and complete STACK16FRAME */ + output( "\t.byte 0x64\n\tmovl (%d), %%ebp\n", STACKOFFSET ); + output( "\tpushl %%ebp\n" ); + + /* Switch stacks */ + output( "\t.byte 0x64\n\tmovw %%ss, (%d)\n", STACKOFFSET + 2 ); + output( "\t.byte 0x64\n\tmovw %%sp, (%d)\n", STACKOFFSET ); + output( "\tpushl %%ds\n" ); + output( "\tpopl %%ss\n" ); + output( "\tmovl %%ebp, %%esp\n" ); + output( "\taddl $0x20,%%ebp\n"); /* FIELD_OFFSET(STACK32FRAME,ebp) */ + + + /* At this point: + STACK16FRAME is completely set up + DS, ES, SS: flat data segment + FS: current TEB + ESP: points to last STACK32FRAME + EBP: points to ebp member of last STACK32FRAME + EDX: points to current STACK16FRAME + ECX: contains saved flags + all other registers: unchanged */ + + /* Special case: C16ThkSL stub */ + if ( thunk ) + { + /* Set up registers as expected and call thunk */ + output( "\tleal 0x1a(%%edx),%%ebx\n" ); /* sizeof(STACK16FRAME)-22 */ + output( "\tleal -4(%%esp), %%ebp\n" ); + + output( "\tcall *0x26(%%edx)\n"); /* FIELD_OFFSET(STACK16FRAME,entry_point) */ + + /* Switch stack back */ + output( "\t.byte 0x64\n\tmovw (%d), %%ss\n", STACKOFFSET+2 ); + output( "\t.byte 0x64\n\tmovzwl (%d), %%esp\n", STACKOFFSET ); + output( "\t.byte 0x64\n\tpopl (%d)\n", STACKOFFSET ); + + /* Restore registers and return directly to caller */ + output( "\taddl $8, %%esp\n" ); + output( "\tpopl %%ebp\n" ); + output( "\tpopw %%ds\n" ); + output( "\tpopw %%es\n" ); + output( "\tpopw %%fs\n" ); + output( "\tpopw %%gs\n" ); + output( "\taddl $20, %%esp\n" ); + + output( "\txorb %%ch, %%ch\n" ); + output( "\tpopl %%ebx\n" ); + output( "\taddw %%cx, %%sp\n" ); + output( "\tpush %%ebx\n" ); + + output( "\t.byte 0x66\n" ); + output( "\tlret\n" ); + + return; + } + + + /* Build register CONTEXT */ + if ( reg_func ) + { + output( "\tsubl $0x2cc,%%esp\n" ); /* sizeof(CONTEXT86) */ + + output( "\tmovl %%ecx,0xc0(%%esp)\n" ); /* EFlags */ + + output( "\tmovl %%eax,0xb0(%%esp)\n" ); /* Eax */ + output( "\tmovl %%ebx,0xa4(%%esp)\n" ); /* Ebx */ + output( "\tmovl %%esi,0xa0(%%esp)\n" ); /* Esi */ + output( "\tmovl %%edi,0x9c(%%esp)\n" ); /* Edi */ + + output( "\tmovl 0x0c(%%edx),%%eax\n"); /* FIELD_OFFSET(STACK16FRAME,ebp) */ + output( "\tmovl %%eax,0xb4(%%esp)\n" ); /* Ebp */ + output( "\tmovl 0x08(%%edx),%%eax\n"); /* FIELD_OFFSET(STACK16FRAME,ecx) */ + output( "\tmovl %%eax,0xac(%%esp)\n" ); /* Ecx */ + output( "\tmovl 0x04(%%edx),%%eax\n"); /* FIELD_OFFSET(STACK16FRAME,edx) */ + output( "\tmovl %%eax,0xa8(%%esp)\n" ); /* Edx */ + + output( "\tmovzwl 0x10(%%edx),%%eax\n"); /* FIELD_OFFSET(STACK16FRAME,ds) */ + output( "\tmovl %%eax,0x98(%%esp)\n" ); /* SegDs */ + output( "\tmovzwl 0x12(%%edx),%%eax\n"); /* FIELD_OFFSET(STACK16FRAME,es) */ + output( "\tmovl %%eax,0x94(%%esp)\n" ); /* SegEs */ + output( "\tmovzwl 0x14(%%edx),%%eax\n"); /* FIELD_OFFSET(STACK16FRAME,fs) */ + output( "\tmovl %%eax,0x90(%%esp)\n" ); /* SegFs */ + output( "\tmovzwl 0x16(%%edx),%%eax\n"); /* FIELD_OFFSET(STACK16FRAME,gs) */ + output( "\tmovl %%eax,0x8c(%%esp)\n" ); /* SegGs */ + + output( "\tmovzwl 0x2e(%%edx),%%eax\n"); /* FIELD_OFFSET(STACK16FRAME,cs) */ + output( "\tmovl %%eax,0xbc(%%esp)\n" ); /* SegCs */ + output( "\tmovzwl 0x2c(%%edx),%%eax\n"); /* FIELD_OFFSET(STACK16FRAME,ip) */ + output( "\tmovl %%eax,0xb8(%%esp)\n" ); /* Eip */ + + output( "\t.byte 0x64\n\tmovzwl (%d), %%eax\n", STACKOFFSET+2 ); + output( "\tmovl %%eax,0xc8(%%esp)\n" ); /* SegSs */ + output( "\t.byte 0x64\n\tmovzwl (%d), %%eax\n", STACKOFFSET ); + output( "\taddl $0x2c,%%eax\n"); /* FIELD_OFFSET(STACK16FRAME,ip) */ + output( "\tmovl %%eax,0xc4(%%esp)\n" ); /* Esp */ +#if 0 + output( "\tfsave 0x1c(%%esp)\n" ); /* FloatSave */ +#endif + + /* Push address of CONTEXT86 structure -- popped by the relay routine */ + output( "\tmovl %%esp,%%eax\n" ); + output( "\tandl $~15,%%esp\n" ); + output( "\tsubl $4,%%esp\n" ); + output( "\tpushl %%eax\n" ); + } + else + { + output( "\tsubl $8,%%esp\n" ); + output( "\tandl $~15,%%esp\n" ); + output( "\taddl $8,%%esp\n" ); + } + + /* Call relay routine (which will call the API entry point) */ + output( "\tleal 0x30(%%edx),%%eax\n" ); /* sizeof(STACK16FRAME) */ + output( "\tpushl %%eax\n" ); + output( "\tpushl 0x26(%%edx)\n"); /* FIELD_OFFSET(STACK16FRAME,entry_point) */ + output( "\tcall *0x20(%%edx)\n"); /* FIELD_OFFSET(STACK16FRAME,relay) */ + + if ( reg_func ) + { + output( "\tleal -748(%%ebp),%%ebx\n" ); /* sizeof(CONTEXT) + FIELD_OFFSET(STACK32FRAME,ebp) */ + + /* Switch stack back */ + output( "\t.byte 0x64\n\tmovw (%d), %%ss\n", STACKOFFSET+2 ); + output( "\t.byte 0x64\n\tmovzwl (%d), %%esp\n", STACKOFFSET ); + output( "\t.byte 0x64\n\tpopl (%d)\n", STACKOFFSET ); + + /* Get return address to CallFrom16 stub */ + output( "\taddw $0x14,%%sp\n" ); /* FIELD_OFFSET(STACK16FRAME,callfrom_ip)-4 */ + output( "\tpopl %%eax\n" ); + output( "\tpopl %%edx\n" ); + + /* Restore all registers from CONTEXT */ + output( "\tmovw 0xc8(%%ebx),%%ss\n"); /* SegSs */ + output( "\tmovl 0xc4(%%ebx),%%esp\n"); /* Esp */ + output( "\taddl $4, %%esp\n" ); /* room for final return address */ + + output( "\tpushw 0xbc(%%ebx)\n"); /* SegCs */ + output( "\tpushw 0xb8(%%ebx)\n"); /* Eip */ + output( "\tpushl %%edx\n" ); + output( "\tpushl %%eax\n" ); + output( "\tpushl 0xc0(%%ebx)\n"); /* EFlags */ + output( "\tpushl 0x98(%%ebx)\n"); /* SegDs */ + + output( "\tpushl 0x94(%%ebx)\n"); /* SegEs */ + output( "\tpopl %%es\n" ); + output( "\tpushl 0x90(%%ebx)\n"); /* SegFs */ + output( "\tpopl %%fs\n" ); + output( "\tpushl 0x8c(%%ebx)\n"); /* SegGs */ + output( "\tpopl %%gs\n" ); + + output( "\tmovl 0xb4(%%ebx),%%ebp\n"); /* Ebp */ + output( "\tmovl 0xa0(%%ebx),%%esi\n"); /* Esi */ + output( "\tmovl 0x9c(%%ebx),%%edi\n"); /* Edi */ + output( "\tmovl 0xb0(%%ebx),%%eax\n"); /* Eax */ + output( "\tmovl 0xa8(%%ebx),%%edx\n"); /* Edx */ + output( "\tmovl 0xac(%%ebx),%%ecx\n"); /* Ecx */ + output( "\tmovl 0xa4(%%ebx),%%ebx\n"); /* Ebx */ + + output( "\tpopl %%ds\n" ); + output( "\tpopfl\n" ); + output( "\tlret\n" ); + } + else + { + /* Switch stack back */ + output( "\t.byte 0x64\n\tmovw (%d), %%ss\n", STACKOFFSET+2 ); + output( "\t.byte 0x64\n\tmovzwl (%d), %%esp\n", STACKOFFSET ); + output( "\t.byte 0x64\n\tpopl (%d)\n", STACKOFFSET ); + + /* Restore registers */ + output( "\tpopl %%edx\n" ); + output( "\tpopl %%ecx\n" ); + output( "\tpopl %%ebp\n" ); + output( "\tpopw %%ds\n" ); + output( "\tpopw %%es\n" ); + output( "\tpopw %%fs\n" ); + output( "\tpopw %%gs\n" ); + + /* Return to return stub which will return to caller */ + output( "\tlret $12\n" ); + } + if (thunk) output_function_size( "__wine_call_from_16_thunk" ); + else if (reg_func) output_function_size( "__wine_call_from_16_regs" ); + else output_function_size( "__wine_call_from_16" ); +} + + +/******************************************************************* + * BuildCallTo16Core + * + * This routine builds the core routines used in 32->16 thunks: + * + * extern DWORD WINAPI wine_call_to_16( FARPROC16 target, DWORD cbArgs, PEXCEPTION_HANDLER handler ); + * extern void WINAPI wine_call_to_16_regs( CONTEXT86 *context, DWORD cbArgs, PEXCEPTION_HANDLER handler ); + * + * These routines can be called directly from 32-bit code. + * + * All routines expect that the 16-bit stack contents (arguments) and the + * return address (segptr to CallTo16_Ret) were already set up by the + * caller; nb_args must contain the number of bytes to be conserved. The + * 16-bit SS:SP will be set accordingly. + * + * All other registers are either taken from the CONTEXT86 structure + * or else set to default values. The target routine address is either + * given directly or taken from the CONTEXT86. + */ +static void BuildCallTo16Core( int reg_func ) +{ + const char *name = reg_func ? "wine_call_to_16_regs" : "wine_call_to_16"; + + /* Function header */ + function_header( name ); + + /* Function entry sequence */ + output( "\tpushl %%ebp\n" ); + output( "\tmovl %%esp, %%ebp\n" ); + + /* Save the 32-bit registers */ + output( "\tpushl %%ebx\n" ); + output( "\tpushl %%esi\n" ); + output( "\tpushl %%edi\n" ); + output( "\t.byte 0x64\n\tmov %%gs,(%d)\n", GS_OFFSET ); + + /* Setup exception frame */ + output( "\t.byte 0x64\n\tpushl (%d)\n", STACKOFFSET ); + output( "\tpushl 16(%%ebp)\n" ); /* handler */ + output( "\t.byte 0x64\n\tpushl (0)\n" ); + output( "\t.byte 0x64\n\tmovl %%esp,(0)\n" ); + + /* Call the actual CallTo16 routine (simulate a lcall) */ + output( "\tpushl %%cs\n" ); + output( "\tcall .L%s\n", name ); + + /* Remove exception frame */ + output( "\t.byte 0x64\n\tpopl (0)\n" ); + output( "\taddl $4, %%esp\n" ); + output( "\t.byte 0x64\n\tpopl (%d)\n", STACKOFFSET ); + + if ( !reg_func ) + { + /* Convert return value */ + output( "\tandl $0xffff,%%eax\n" ); + output( "\tshll $16,%%edx\n" ); + output( "\torl %%edx,%%eax\n" ); + } + else + { + /* + * Modify CONTEXT86 structure to contain new values + * + * NOTE: We restore only EAX, EBX, EDX, EDX, EBP, and ESP. + * The segment registers as well as ESI and EDI should + * not be modified by a well-behaved 16-bit routine in + * any case. [If necessary, we could restore them as well, + * at the cost of a somewhat less efficient return path.] + */ + + output( "\tmovl 0x14(%%esp),%%edi\n" ); /* FIELD_OFFSET(STACK32FRAME,target) - FIELD_OFFSET(STACK32FRAME,edi) */ + /* everything above edi has been popped already */ + + output( "\tmovl %%eax,0xb0(%%edi)\n"); /* Eax */ + output( "\tmovl %%ebx,0xa4(%%edi)\n"); /* Ebx */ + output( "\tmovl %%ecx,0xac(%%edi)\n"); /* Ecx */ + output( "\tmovl %%edx,0xa8(%%edi)\n"); /* Edx */ + output( "\tmovl %%ebp,0xb4(%%edi)\n"); /* Ebp */ + output( "\tmovl %%esi,0xc4(%%edi)\n"); /* Esp */ + /* The return glue code saved %esp into %esi */ + } + + /* Restore the 32-bit registers */ + output( "\tpopl %%edi\n" ); + output( "\tpopl %%esi\n" ); + output( "\tpopl %%ebx\n" ); + + /* Function exit sequence */ + output( "\tpopl %%ebp\n" ); + output( "\tret $12\n" ); + + + /* Start of the actual CallTo16 routine */ + + output( ".L%s:\n", name ); + + /* Switch to the 16-bit stack */ + output( "\tmovl %%esp,%%edx\n" ); + output( "\t.byte 0x64\n\tmovw (%d),%%ss\n", STACKOFFSET + 2); + output( "\t.byte 0x64\n\tmovw (%d),%%sp\n", STACKOFFSET ); + output( "\t.byte 0x64\n\tmovl %%edx,(%d)\n", STACKOFFSET ); + + /* Make %bp point to the previous stackframe (built by CallFrom16) */ + output( "\tmovzwl %%sp,%%ebp\n" ); + output( "\tleal 0x2a(%%ebp),%%ebp\n"); /* FIELD_OFFSET(STACK16FRAME,bp) */ + + /* Add the specified offset to the new sp */ + output( "\tsubw 0x2c(%%edx), %%sp\n"); /* FIELD_OFFSET(STACK32FRAME,nb_args) */ + + if (reg_func) + { + /* Push the called routine address */ + output( "\tmovl 0x28(%%edx),%%edx\n"); /* FIELD_OFFSET(STACK32FRAME,target) */ + output( "\tpushw 0xbc(%%edx)\n"); /* SegCs */ + output( "\tpushw 0xb8(%%edx)\n"); /* Eip */ + + /* Get the registers */ + output( "\tpushw 0x98(%%edx)\n"); /* SegDs */ + output( "\tpushl 0x94(%%edx)\n"); /* SegEs */ + output( "\tpopl %%es\n" ); + output( "\tpushl 0x90(%%edx)\n"); /* SegFs */ + output( "\tpopl %%fs\n" ); + output( "\tpushl 0x8c(%%edx)\n"); /* SegGs */ + output( "\tpopl %%gs\n" ); + output( "\tmovl 0xb4(%%edx),%%ebp\n"); /* Ebp */ + output( "\tmovl 0xa0(%%edx),%%esi\n"); /* Esi */ + output( "\tmovl 0x9c(%%edx),%%edi\n"); /* Edi */ + output( "\tmovl 0xb0(%%edx),%%eax\n"); /* Eax */ + output( "\tmovl 0xa4(%%edx),%%ebx\n"); /* Ebx */ + output( "\tmovl 0xac(%%edx),%%ecx\n"); /* Ecx */ + output( "\tmovl 0xa8(%%edx),%%edx\n"); /* Edx */ + + /* Get the 16-bit ds */ + output( "\tpopw %%ds\n" ); + } + else /* not a register function */ + { + /* Push the called routine address */ + output( "\tpushl 0x28(%%edx)\n"); /* FIELD_OFFSET(STACK32FRAME,target) */ + + /* Set %fs and %gs to the value saved by the last CallFrom16 */ + output( "\tpushw -22(%%ebp)\n" ); /* FIELD_OFFSET(STACK16FRAME,fs)-FIELD_OFFSET(STACK16FRAME,bp) */ + output( "\tpopw %%fs\n" ); + output( "\tpushw -20(%%ebp)\n" ); /* FIELD_OFFSET(STACK16FRAME,gs)-FIELD_OFFSET(STACK16FRAME,bp) */ + output( "\tpopw %%gs\n" ); + + /* Set %ds and %es (and %ax just in case) equal to %ss */ + output( "\tmovw %%ss,%%ax\n" ); + output( "\tmovw %%ax,%%ds\n" ); + output( "\tmovw %%ax,%%es\n" ); + } + + /* Jump to the called routine */ + output( "\t.byte 0x66\n" ); + output( "\tlret\n" ); + + /* Function footer */ + output_function_size( name ); +} + + +/******************************************************************* + * BuildRet16Func + * + * Build the return code for 16-bit callbacks + */ +static void BuildRet16Func(void) +{ + function_header( "__wine_call_to_16_ret" ); + + /* Save %esp into %esi */ + output( "\tmovl %%esp,%%esi\n" ); + + /* Restore 32-bit segment registers */ + + output( "\t.byte 0x2e\n\tmovl %s", asm_name("CallTo16_DataSelector") ); + output( "-%s,%%edi\n", asm_name("__wine_call16_start") ); + output( "\tmovw %%di,%%ds\n" ); + output( "\tmovw %%di,%%es\n" ); + + output( "\t.byte 0x2e\n\tmov %s", asm_name("CallTo16_TebSelector") ); + output( "-%s,%%fs\n", asm_name("__wine_call16_start") ); + + output( "\t.byte 0x64\n\tmov (%d),%%gs\n", GS_OFFSET ); + + /* Restore the 32-bit stack */ + + output( "\tmovw %%di,%%ss\n" ); + output( "\t.byte 0x64\n\tmovl (%d),%%esp\n", STACKOFFSET ); + + /* Return to caller */ + + output( "\tlret\n" ); + output_function_size( "__wine_call_to_16_ret" ); +} + + +/******************************************************************* + * BuildCallTo32CBClient + * + * Call a CBClient relay stub from 32-bit code (KERNEL.620). + * + * Since the relay stub is itself 32-bit, this should not be a problem; + * unfortunately, the relay stubs are expected to switch back to a + * 16-bit stack (and 16-bit code) after completion :-( + * + * This would conflict with our 16- vs. 32-bit stack handling, so + * we simply switch *back* to our 32-bit stack before returning to + * the caller ... + * + * The CBClient relay stub expects to be called with the following + * 16-bit stack layout, and with ebp and ebx pointing into the 16-bit + * stack at the designated places: + * + * ... + * (ebp+14) original arguments to the callback routine + * (ebp+10) far return address to original caller + * (ebp+6) Thunklet target address + * (ebp+2) Thunklet relay ID code + * (ebp) BP (saved by CBClientGlueSL) + * (ebp-2) SI (saved by CBClientGlueSL) + * (ebp-4) DI (saved by CBClientGlueSL) + * (ebp-6) DS (saved by CBClientGlueSL) + * + * ... buffer space used by the 16-bit side glue for temp copies + * + * (ebx+4) far return address to 16-bit side glue code + * (ebx) saved 16-bit ss:sp (pointing to ebx+4) + * + * The 32-bit side glue code accesses both the original arguments (via ebp) + * and the temporary copies prepared by the 16-bit side glue (via ebx). + * After completion, the stub will load ss:sp from the buffer at ebx + * and perform a far return to 16-bit code. + * + * To trick the relay stub into returning to us, we replace the 16-bit + * return address to the glue code by a cs:ip pair pointing to our + * return entry point (the original return address is saved first). + * Our return stub thus called will then reload the 32-bit ss:esp and + * return to 32-bit code (by using and ss:esp value that we have also + * pushed onto the 16-bit stack before and a cs:eip values found at + * that position on the 32-bit stack). The ss:esp to be restored is + * found relative to the 16-bit stack pointer at: + * + * (ebx-4) ss (flat) + * (ebx-8) sp (32-bit stack pointer) + * + * The second variant of this routine, CALL32_CBClientEx, which is used + * to implement KERNEL.621, has to cope with yet another problem: Here, + * the 32-bit side directly returns to the caller of the CBClient thunklet, + * restoring registers saved by CBClientGlueSL and cleaning up the stack. + * As we have to return to our 32-bit code first, we have to adapt the + * layout of our temporary area so as to include values for the registers + * that are to be restored, and later (in the implementation of KERNEL.621) + * we *really* restore them. The return stub restores DS, DI, SI, and BP + * from the stack, skips the next 8 bytes (CBClient relay code / target), + * and then performs a lret NN, where NN is the number of arguments to be + * removed. Thus, we prepare our temporary area as follows: + * + * (ebx+22) 16-bit cs (this segment) + * (ebx+20) 16-bit ip ('16-bit' return entry point) + * (ebx+16) 32-bit ss (flat) + * (ebx+12) 32-bit sp (32-bit stack pointer) + * (ebx+10) 16-bit bp (points to ebx+24) + * (ebx+8) 16-bit si (ignored) + * (ebx+6) 16-bit di (ignored) + * (ebx+4) 16-bit ds (we actually use the flat DS here) + * (ebx+2) 16-bit ss (16-bit stack segment) + * (ebx+0) 16-bit sp (points to ebx+4) + * + * Note that we ensure that DS is not changed and remains the flat segment, + * and the 32-bit stack pointer our own return stub needs fits just + * perfectly into the 8 bytes that are skipped by the Windows stub. + * One problem is that we have to determine the number of removed arguments, + * as these have to be really removed in KERNEL.621. Thus, the BP value + * that we place in the temporary area to be restored, contains the value + * that SP would have if no arguments were removed. By comparing the actual + * value of SP with this value in our return stub we can compute the number + * of removed arguments. This is then returned to KERNEL.621. + * + * The stack layout of this function: + * (ebp+20) nArgs pointer to variable receiving nr. of args (Ex only) + * (ebp+16) esi pointer to caller's esi value + * (ebp+12) arg ebp value to be set for relay stub + * (ebp+8) func CBClient relay stub address + * (ebp+4) ret addr + * (ebp) ebp + */ +static void BuildCallTo32CBClient( int isEx ) +{ + function_header( isEx ? "CALL32_CBClientEx" : "CALL32_CBClient" ); + + /* Entry code */ + + output( "\tpushl %%ebp\n" ); + output( "\tmovl %%esp,%%ebp\n" ); + output( "\tpushl %%edi\n" ); + output( "\tpushl %%esi\n" ); + output( "\tpushl %%ebx\n" ); + + /* Get pointer to temporary area and save the 32-bit stack pointer */ + + output( "\tmovl 16(%%ebp), %%ebx\n" ); + output( "\tleal -8(%%esp), %%eax\n" ); + + if ( !isEx ) + output( "\tmovl %%eax, -8(%%ebx)\n" ); + else + output( "\tmovl %%eax, 12(%%ebx)\n" ); + + /* Set up registers and call CBClient relay stub (simulating a far call) */ + + output( "\tmovl 20(%%ebp), %%esi\n" ); + output( "\tmovl (%%esi), %%esi\n" ); + + output( "\tmovl 8(%%ebp), %%eax\n" ); + output( "\tmovl 12(%%ebp), %%ebp\n" ); + + output( "\tpushl %%cs\n" ); + output( "\tcall *%%eax\n" ); + + /* Return new esi value to caller */ + + output( "\tmovl 32(%%esp), %%edi\n" ); + output( "\tmovl %%esi, (%%edi)\n" ); + + /* Return argument size to caller */ + if ( isEx ) + { + output( "\tmovl 36(%%esp), %%ebx\n" ); + output( "\tmovl %%ebp, (%%ebx)\n" ); + } + + /* Restore registers and return */ + + output( "\tpopl %%ebx\n" ); + output( "\tpopl %%esi\n" ); + output( "\tpopl %%edi\n" ); + output( "\tpopl %%ebp\n" ); + output( "\tret\n" ); + output_function_size( isEx ? "CALL32_CBClientEx" : "CALL32_CBClient" ); + + /* '16-bit' return stub */ + + function_header( isEx ? "CALL32_CBClientEx_Ret" : "CALL32_CBClient_Ret" ); + if ( !isEx ) + { + output( "\tmovzwl %%sp, %%ebx\n" ); + output( "\tlssl %%ss:-16(%%ebx), %%esp\n" ); + } + else + { + output( "\tmovzwl %%bp, %%ebx\n" ); + output( "\tsubw %%bp, %%sp\n" ); + output( "\tmovzwl %%sp, %%ebp\n" ); + output( "\tlssl %%ss:-12(%%ebx), %%esp\n" ); + } + output( "\tlret\n" ); + output_function_size( isEx ? "CALL32_CBClientEx_Ret" : "CALL32_CBClient_Ret" ); +} + + +/******************************************************************* + * BuildCallFrom32Regs + * + * Build a 32-bit-to-Wine call-back function for a 'register' function. + * 'args' is the number of dword arguments. + * + * Stack layout: + * ... + * (ebp+20) first arg + * (ebp+16) ret addr to user code + * (ebp+12) func to call (relative to relay code ret addr) + * (ebp+8) number of args + * (ebp+4) ret addr to relay code + * (ebp+0) saved ebp + * (ebp-128) buffer area to allow stack frame manipulation + * (ebp-332) CONTEXT86 struct + * (ebp-336) padding for stack alignment + * (ebp-336-n) CONTEXT86 *argument + * .... other arguments copied from (ebp+12) + * + * The entry point routine is called with a CONTEXT* extra argument, + * following the normal args. In this context structure, EIP_reg + * contains the return address to user code, and ESP_reg the stack + * pointer on return (with the return address and arguments already + * removed). + */ +static void BuildCallFrom32Regs(void) +{ + static const int STACK_SPACE = 128 + 0x2cc /* sizeof(CONTEXT86) */; + + /* Function header */ + + function_header( "__wine_call_from_32_regs" ); + + /* Allocate some buffer space on the stack */ + + output( "\tpushl %%ebp\n" ); + output( "\tmovl %%esp,%%ebp\n "); + output( "\tleal -%d(%%esp),%%esp\n", STACK_SPACE ); + + /* Build the context structure */ + + output( "\tmovl %%eax,0xb0(%%esp)\n" ); /* Eax */ + output( "\tpushfl\n" ); + output( "\tpopl %%eax\n" ); + output( "\tmovl %%eax,0xc0(%%esp)\n"); /* EFlags */ + output( "\tmovl 0(%%ebp),%%eax\n" ); + output( "\tmovl %%eax,0xb4(%%esp)\n"); /* Ebp */ + output( "\tmovl %%ebx,0xa4(%%esp)\n"); /* Ebx */ + output( "\tmovl %%ecx,0xac(%%esp)\n"); /* Ecx */ + output( "\tmovl %%edx,0xa8(%%esp)\n"); /* Edx */ + output( "\tmovl %%esi,0xa0(%%esp)\n"); /* Esi */ + output( "\tmovl %%edi,0x9c(%%esp)\n"); /* Edi */ + + output( "\txorl %%eax,%%eax\n" ); + output( "\tmovw %%cs,%%ax\n" ); + output( "\tmovl %%eax,0xbc(%%esp)\n"); /* SegCs */ + output( "\tmovw %%es,%%ax\n" ); + output( "\tmovl %%eax,0x94(%%esp)\n"); /* SegEs */ + output( "\tmovw %%fs,%%ax\n" ); + output( "\tmovl %%eax,0x90(%%esp)\n"); /* SegFs */ + output( "\tmovw %%gs,%%ax\n" ); + output( "\tmovl %%eax,0x8c(%%esp)\n"); /* SegGs */ + output( "\tmovw %%ss,%%ax\n" ); + output( "\tmovl %%eax,0xc8(%%esp)\n"); /* SegSs */ + output( "\tmovw %%ds,%%ax\n" ); + output( "\tmovl %%eax,0x98(%%esp)\n"); /* SegDs */ + output( "\tmovw %%ax,%%es\n" ); /* set %es equal to %ds just in case */ + + output( "\tmovl $0x10007,0(%%esp)\n"); /* ContextFlags */ + + output( "\tmovl 16(%%ebp),%%eax\n" ); /* Get %eip at time of call */ + output( "\tmovl %%eax,0xb8(%%esp)\n"); /* Eip */ + + /* Transfer the arguments */ + + output( "\tmovl 8(%%ebp),%%ecx\n" ); /* fetch number of args to copy */ + output( "\tleal 4(,%%ecx,4),%%edx\n" ); /* add 4 for context arg */ + output( "\tsubl %%edx,%%esp\n" ); + output( "\tandl $~15,%%esp\n" ); + output( "\tleal 20(%%ebp),%%esi\n" ); /* get %esp at time of call */ + output( "\tmovl %%esp,%%edi\n" ); + output( "\ttest %%ecx,%%ecx\n" ); + output( "\tjz 1f\n" ); + output( "\tcld\n" ); + output( "\trep\n\tmovsl\n" ); /* copy args */ + output( "1:\tleal %d(%%ebp),%%eax\n", -STACK_SPACE ); /* get addr of context struct */ + output( "\tmovl %%eax,(%%edi)\n" ); /* and pass it as extra arg */ + output( "\tmovl %%esi,%d(%%ebp)\n", 0xc4 /* Esp */ - STACK_SPACE ); + + /* Call the entry point */ + + output( "\tmovl 4(%%ebp),%%eax\n" ); /* get relay code addr */ + output( "\taddl 12(%%ebp),%%eax\n" ); + output( "\tcall *%%eax\n" ); + output( "\tleal -%d(%%ebp),%%ecx\n", STACK_SPACE ); + + /* Restore the context structure */ + + output( "2:\tpushl 0x94(%%ecx)\n"); /* SegEs */ + output( "\tpopl %%es\n" ); + output( "\tpushl 0x90(%%ecx)\n"); /* SegFs */ + output( "\tpopl %%fs\n" ); + output( "\tpushl 0x8c(%%ecx)\n"); /* SegGs */ + output( "\tpopl %%gs\n" ); + + output( "\tmovl 0x9c(%%ecx),%%edi\n"); /* Edi */ + output( "\tmovl 0xa0(%%ecx),%%esi\n"); /* Esi */ + output( "\tmovl 0xa8(%%ecx),%%edx\n"); /* Edx */ + output( "\tmovl 0xa4(%%ecx),%%ebx\n"); /* Ebx */ + output( "\tmovl 0xb0(%%ecx),%%eax\n"); /* Eax */ + output( "\tmovl 0xb4(%%ecx),%%ebp\n"); /* Ebp */ + + output( "\tpushl 0xc8(%%ecx)\n"); /* SegSs */ + output( "\tpopl %%ss\n" ); + output( "\tmovl 0xc4(%%ecx),%%esp\n"); /* Esp */ + + output( "\tpushl 0xc0(%%ecx)\n"); /* EFlags */ + output( "\tpushl 0xbc(%%ecx)\n"); /* SegCs */ + output( "\tpushl 0xb8(%%ecx)\n"); /* Eip */ + output( "\tpushl 0x98(%%ecx)\n"); /* SegDs */ + output( "\tmovl 0xac(%%ecx),%%ecx\n"); /* Ecx */ + + output( "\tpopl %%ds\n" ); + output( "\tiret\n" ); + output_function_size( "__wine_call_from_32_regs" ); + + function_header( "__wine_call_from_32_restore_regs" ); + output( "\tmovl 4(%%esp),%%ecx\n" ); + output( "\tjmp 2b\n" ); + output_function_size( "__wine_call_from_32_restore_regs" ); +} + + +/******************************************************************* + * BuildPendingEventCheck + * + * Build a function that checks whether there are any + * pending DPMI events. + * + * Stack layout: + * + * (sp+12) long eflags + * (sp+6) long cs + * (sp+2) long ip + * (sp) word fs + * + * On entry to function, fs register points to a valid TEB. + * On exit from function, stack will be popped. + */ +static void BuildPendingEventCheck(void) +{ + /* Function header */ + + function_header( "DPMI_PendingEventCheck" ); + + /* Check for pending events. */ + + output( "\t.byte 0x64\n\ttestl $0xffffffff,(%d)\n", VM86_PENDING_OFFSET ); + output( "\tje %s\n", asm_name("DPMI_PendingEventCheck_Cleanup") ); + output( "\t.byte 0x64\n\ttestl $0xffffffff,(%d)\n", DPMI_VIF_OFFSET ); + output( "\tje %s\n", asm_name("DPMI_PendingEventCheck_Cleanup") ); + + /* Process pending events. */ + + output( "\tsti\n" ); + + /* Start cleanup. Restore fs register. */ + + output( "%s\n", asm_globl("DPMI_PendingEventCheck_Cleanup") ); + output( "\tpopw %%fs\n" ); + + /* Return from function. */ + + output( "%s\n", asm_globl("DPMI_PendingEventCheck_Return") ); + output( "\tiret\n" ); + + output_function_size( "DPMI_PendingEventCheck" ); +} + + +/******************************************************************* + * BuildRelays16 + * + * Build all the 16-bit relay callbacks + */ +void BuildRelays16(void) +{ + if (target_cpu != CPU_x86) + { + output( "/* File not used with this architecture. Do not edit! */\n\n" ); + return; + } + + /* File header */ + + output( "/* File generated automatically. Do not edit! */\n\n" ); + output( "\t.text\n" ); + + output( "%s:\n\n", asm_name("__wine_spec_thunk_text_16") ); + + output( "%s\n", asm_globl("__wine_call16_start") ); + + /* Standard CallFrom16 routine */ + BuildCallFrom16Core( 0, 0 ); + + /* Register CallFrom16 routine */ + BuildCallFrom16Core( 1, 0 ); + + /* C16ThkSL CallFrom16 routine */ + BuildCallFrom16Core( 0, 1 ); + + /* Standard CallTo16 routine */ + BuildCallTo16Core( 0 ); + + /* Register CallTo16 routine */ + BuildCallTo16Core( 1 ); + + /* Standard CallTo16 return stub */ + BuildRet16Func(); + + /* CBClientThunkSL routine */ + BuildCallTo32CBClient( 0 ); + + /* CBClientThunkSLEx routine */ + BuildCallTo32CBClient( 1 ); + + /* Pending DPMI events check stub */ + BuildPendingEventCheck(); + + output( "%s\n", asm_globl("__wine_call16_end") ); + output_function_size( "__wine_spec_thunk_text_16" ); + + /* Declare the return address and data selector variables */ + output( "\n\t.data\n\t.align %d\n", get_alignment(4) ); + output( "%s\n\t.long 0\n", asm_globl("CallTo16_DataSelector") ); + output( "%s\n\t.long 0\n", asm_globl("CallTo16_TebSelector") ); + if (UsePIC) output( "wine_ldt_copy_ptr:\t.long %s\n", asm_name("wine_ldt_copy") ); + + output( "\t.text\n" ); + output( "%s:\n\n", asm_name("__wine_spec_thunk_text_32") ); + BuildCallFrom32Regs(); + output_function_size( "__wine_spec_thunk_text_32" ); + + output_gnu_stack_note(); +} + + +/******************************************************************* + * build_call_from_regs_x86_64 + * + * Build the register saving code for a 'register' entry point. + * + * Stack layout: + * ... + * (rsp+16) first arg + * (rsp+8) ret addr to user code + * (rsp) ret addr to relay code + * (rsp-128) buffer area to allow stack frame manipulation + * + * Parameters: + * %rcx number of args + * %rdx entry point + */ +static void build_call_from_regs_x86_64(void) +{ + static const int STACK_SPACE = 128 + 0x4d0; /* size of x86_64 context */ + int i; + + /* Function header */ + + function_header( "__wine_call_from_regs" ); + + output( "\t.cfi_startproc\n" ); + output( "\tsubq $%u,%%rsp\n", STACK_SPACE ); + output( "\t.cfi_adjust_cfa_offset %u\n", STACK_SPACE ); + + /* save registers into the context */ + + output( "\tmovq %%rax,0x78(%%rsp)\n" ); + output( "\t.cfi_rel_offset %%rax,0x78\n" ); + output( "\tmovq %u(%%rsp),%%rax\n", STACK_SPACE + 16 ); /* saved %rcx on stack */ + output( "\tmovq %%rax,0x80(%%rsp)\n" ); + output( "\t.cfi_rel_offset %%rcx,0x80\n" ); + output( "\tmovq %u(%%rsp),%%rax\n", STACK_SPACE + 24 ); /* saved %rdx on stack */ + output( "\t.cfi_rel_offset %%rdx,0x88\n" ); + output( "\tmovq %%rax,0x88(%%rsp)\n" ); + output( "\tmovq %%rbx,0x90(%%rsp)\n" ); + output( "\t.cfi_rel_offset %%rbx,0x90\n" ); + output( "\tleaq %u(%%rsp),%%rax\n", STACK_SPACE + 16 ); + output( "\tmovq %%rax,0x98(%%rsp)\n" ); + output( "\tmovq %%rbp,0xa0(%%rsp)\n" ); + output( "\t.cfi_rel_offset %%rbp,0xa0\n" ); + output( "\tmovq %%rsi,0xa8(%%rsp)\n" ); + output( "\t.cfi_rel_offset %%rsi,0xa8\n" ); + output( "\tmovq %%rdi,0xb0(%%rsp)\n" ); + output( "\t.cfi_rel_offset %%rdi,0xb0\n" ); + output( "\tmovq %%r8,0xb8(%%rsp)\n" ); + output( "\t.cfi_rel_offset %%r8,0xb8\n" ); + output( "\tmovq %%r9,0xc0(%%rsp)\n" ); + output( "\t.cfi_rel_offset %%r9,0xc0\n" ); + output( "\tmovq %%r10,0xc8(%%rsp)\n" ); + output( "\t.cfi_rel_offset %%r10,0xc8\n" ); + output( "\tmovq %%r11,0xd0(%%rsp)\n" ); + output( "\t.cfi_rel_offset %%r11,0xd0\n" ); + output( "\tmovq %%r12,0xd8(%%rsp)\n" ); + output( "\t.cfi_rel_offset %%r12,0xd8\n" ); + output( "\tmovq %%r13,0xe0(%%rsp)\n" ); + output( "\t.cfi_rel_offset %%r13,0xe0\n" ); + output( "\tmovq %%r14,0xe8(%%rsp)\n" ); + output( "\t.cfi_rel_offset %%r14,0xe8\n" ); + output( "\tmovq %%r15,0xf0(%%rsp)\n" ); + output( "\t.cfi_rel_offset %%r15,0xf0\n" ); + output( "\tmovq %u(%%rsp),%%rax\n", STACK_SPACE + 8 ); + output( "\tmovq %%rax,0xf8(%%rsp)\n" ); + + output( "\tstmxcsr 0x34(%%rsp)\n" ); + output( "\tfxsave 0x100(%%rsp)\n" ); + for (i = 0; i < 16; i++) + { + output( "\tmovdqa %%xmm%u,0x%x(%%rsp)\n", i, 0x1a0 + 16 * i ); + output( "\t.cfi_rel_offset %%xmm%u,0x%x\n", i, 0x1a0 + 16 * i ); + } + + output( "\tmovw %%cs,0x38(%%rsp)\n" ); + output( "\tmovw %%ds,0x3a(%%rsp)\n" ); + output( "\tmovw %%es,0x3c(%%rsp)\n" ); + output( "\tmovw %%fs,0x3e(%%rsp)\n" ); + output( "\tmovw %%gs,0x40(%%rsp)\n" ); + output( "\tmovw %%ss,0x42(%%rsp)\n" ); + output( "\tpushfq\n" ); + output( "\tpopq %%rax\n" ); + output( "\tmovl %%eax,0x44(%%rsp)\n" ); + + output( "\tmovl $0x%x,0x30(%%rsp)\n", 0x0010000f ); + + /* transfer the arguments */ + + output( "\tmovq %%r8,%u(%%rsp)\n", STACK_SPACE + 32 ); + output( "\tmovq %%r9,%u(%%rsp)\n", STACK_SPACE + 40 ); + output( "\tmovq $4,%%rax\n" ); + output( "\tleaq %u(%%rsp),%%rsi\n", STACK_SPACE + 16 ); + output( "\tcmpq %%rax,%%rcx\n" ); + output( "\tcmovgq %%rcx,%%rax\n" ); + output( "\tmovq %%rsp,%%rbx\n" ); + output( "\t.cfi_def_cfa_register %%rbx\n" ); + output( "\tleaq 16(,%%rax,8),%%rax\n" ); /* add 8 for context arg and 8 for rounding */ + output( "\tandq $~15,%%rax\n" ); + output( "\tsubq %%rax,%%rsp\n" ); + output( "\tmovq %%rsp,%%rdi\n" ); + output( "\tjrcxz 1f\n" ); + output( "\tcld\n" ); + output( "\trep\n\tmovsq\n" ); + output( "1:\tmovq %%rbx,0(%%rdi)\n" ); /* context arg */ + + /* call the entry point */ + + output( "\tmovq %%rdx,%%rax\n" ); + output( "\tmovq 0(%%rsp),%%rcx\n" ); + output( "\tmovq 8(%%rsp),%%rdx\n" ); + output( "\tmovq 16(%%rsp),%%r8\n" ); + output( "\tmovq 24(%%rsp),%%r9\n" ); + output( "\tcallq *%%rax\n" ); + + /* restore the context structure */ + + output( "1:\tmovq 0x80(%%rbx),%%rcx\n" ); + output( "\t.cfi_same_value %%rcx\n" ); + output( "\tmovq 0x88(%%rbx),%%rdx\n" ); + output( "\t.cfi_same_value %%rdx\n" ); + output( "\tmovq 0xa0(%%rbx),%%rbp\n" ); + output( "\t.cfi_same_value %%rbp\n" ); + output( "\tmovq 0xa8(%%rbx),%%rsi\n" ); + output( "\t.cfi_same_value %%rsi\n" ); + output( "\tmovq 0xb0(%%rbx),%%rdi\n" ); + output( "\t.cfi_same_value %%rdi\n" ); + output( "\tmovq 0xb8(%%rbx),%%r8\n" ); + output( "\t.cfi_same_value %%r8\n" ); + output( "\tmovq 0xc0(%%rbx),%%r9\n" ); + output( "\t.cfi_same_value %%r9\n" ); + output( "\tmovq 0xc8(%%rbx),%%r10\n" ); + output( "\t.cfi_same_value %%r10\n" ); + output( "\tmovq 0xd0(%%rbx),%%r11\n" ); + output( "\t.cfi_same_value %%r11\n" ); + output( "\tmovq 0xd8(%%rbx),%%r12\n" ); + output( "\t.cfi_same_value %%r12\n" ); + output( "\tmovq 0xe0(%%rbx),%%r13\n" ); + output( "\t.cfi_same_value %%r13\n" ); + output( "\tmovq 0xe8(%%rbx),%%r14\n" ); + output( "\t.cfi_same_value %%r14\n" ); + output( "\tmovq 0xf0(%%rbx),%%r15\n" ); + output( "\t.cfi_same_value %%r15\n" ); + + for (i = 0; i < 16; i++) + { + output( "\tmovdqa 0x%x(%%rbx),%%xmm%u\n", 0x1a0 + 16 * i, i ); + output( "\t.cfi_same_value %%xmm%u\n", i ); + } + output( "\tfxrstor 0x100(%%rbx)\n" ); + output( "\tldmxcsr 0x34(%%rbx)\n" ); + + output( "\tmovq 0xf8(%%rbx),%%rax\n" ); /* rip */ + output( "\tmovq %%rax,0(%%rsp)\n" ); + output( "\tmovw 0x38(%%rbx),%%ax\n" ); /* cs */ + output( "\tmovq %%rax,0x8(%%rsp)\n" ); + output( "\tmovl 0x44(%%rbx),%%eax\n" ); /* flags */ + output( "\tmovq %%rax,0x10(%%rsp)\n" ); + output( "\tmovq 0x98(%%rbx),%%rax\n" ); /* rsp */ + output( "\tmovq %%rax,0x18(%%rsp)\n" ); + output( "\tmovw 0x42(%%rbx),%%ax\n" ); /* ss */ + output( "\tmovq %%rax,0x20(%%rsp)\n" ); + output( "\tmovq 0x78(%%rbx),%%rax\n" ); + output( "\tmovq 0x90(%%rbx),%%rbx\n" ); + output( "\tiretq\n" ); + output( "\t.cfi_endproc\n" ); + + output_function_size( "__wine_call_from_regs" ); + + function_header( "__wine_restore_regs" ); + output( "\t.cfi_startproc\n" ); + output( "\tmovq %%rcx,%%rbx\n" ); + output( "\tjmp 1b\n" ); + output( "\t.cfi_endproc\n" ); + output_function_size( "__wine_restore_regs" ); +} + + +/******************************************************************* + * BuildRelays32 + * + * Build all the 32-bit relay callbacks + */ +void BuildRelays32(void) +{ + switch (target_cpu) + { + case CPU_x86: + output( "/* File generated automatically. Do not edit! */\n\n" ); + output( "\t.text\n" ); + output( "%s:\n\n", asm_name("__wine_spec_thunk_text_32") ); + + /* 32-bit register entry point */ + BuildCallFrom32Regs(); + + output_function_size( "__wine_spec_thunk_text_32" ); + output_gnu_stack_note(); + break; + + case CPU_x86_64: + output( "/* File generated automatically. Do not edit! */\n\n" ); + output( "\t.text\n" ); + build_call_from_regs_x86_64(); + output_gnu_stack_note(); + break; + + default: + output( "/* File not used with this architecture. Do not edit! */\n\n" ); + return; + } +} diff --git a/tools/winebuild/res16.c b/tools/winebuild/res16.c new file mode 100644 index 00000000000..4a6dddd24db --- /dev/null +++ b/tools/winebuild/res16.c @@ -0,0 +1,334 @@ +/* + * Builtin dlls resource support + * + * Copyright 2000 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 + */ + +#include "config.h" +#include "wine/port.h" + +#include +#include +#include +#include +#include +#include +#ifdef HAVE_SYS_TYPES_H +# include +#endif +#include + +#include "build.h" + +/* Unicode string or integer id */ +struct string_id +{ + char *str; /* ptr to string */ + unsigned short id; /* integer id if str is NULL */ +}; + +/* descriptor for a resource */ +struct resource +{ + struct string_id type; + struct string_id name; + const void *data; + unsigned int name_offset; + unsigned int data_size; + unsigned int memopt; +}; + +/* type level of the resource tree */ +struct res_type +{ + const struct string_id *type; /* type name */ + struct resource *res; /* first resource of this type */ + unsigned int name_offset; /* name offset if string */ + unsigned int nb_names; /* total number of names */ +}; + +/* top level of the resource tree */ +struct res_tree +{ + struct res_type *types; /* types array */ + unsigned int nb_types; /* total number of types */ +}; + + +static inline struct resource *add_resource( DLLSPEC *spec ) +{ + spec->resources = xrealloc( spec->resources, (spec->nb_resources + 1) * sizeof(*spec->resources) ); + return &spec->resources[spec->nb_resources++]; +} + +static struct res_type *add_type( struct res_tree *tree, struct resource *res ) +{ + struct res_type *type; + tree->types = xrealloc( tree->types, (tree->nb_types + 1) * sizeof(*tree->types) ); + type = &tree->types[tree->nb_types++]; + type->type = &res->type; + type->res = res; + type->nb_names = 0; + return type; +} + +/* get a string from the current resource file */ +static void get_string( struct string_id *str ) +{ + unsigned char c = get_byte(); + + if (c == 0xff) + { + str->str = NULL; + str->id = get_word(); + } + else + { + str->str = (char *)input_buffer + input_buffer_pos - 1; + str->id = 0; + while (get_byte()) /* nothing */; + } +} + +/* load the next resource from the current file */ +static void load_next_resource( DLLSPEC *spec ) +{ + struct resource *res = add_resource( spec ); + + get_string( &res->type ); + get_string( &res->name ); + res->memopt = get_word(); + res->data_size = get_dword(); + res->data = input_buffer + input_buffer_pos; + input_buffer_pos += res->data_size; + if (input_buffer_pos > input_buffer_size) + fatal_error( "%s is a truncated/corrupted file\n", input_buffer_filename ); +} + +/* load a Win16 .res file */ +void load_res16_file( const char *name, DLLSPEC *spec ) +{ + init_input_buffer( name ); + while (input_buffer_pos < input_buffer_size) load_next_resource( spec ); +} + +/* compare two strings/ids */ +static int cmp_string( const struct string_id *str1, const struct string_id *str2 ) +{ + if (!str1->str) + { + if (!str2->str) return str1->id - str2->id; + return 1; /* an id compares larger than a string */ + } + if (!str2->str) return -1; + return strcasecmp( str1->str, str2->str ); +} + +/* compare two resources for sorting the resource directory */ +/* resources are stored first by type, then by name */ +static int cmp_res( const void *ptr1, const void *ptr2 ) +{ + const struct resource *res1 = ptr1; + const struct resource *res2 = ptr2; + int ret; + + if ((ret = cmp_string( &res1->type, &res2->type ))) return ret; + return cmp_string( &res1->name, &res2->name ); +} + +/* build the 2-level (type,name) resource tree */ +static struct res_tree *build_resource_tree( DLLSPEC *spec ) +{ + unsigned int i, j, offset; + struct res_tree *tree; + struct res_type *type = NULL; + struct resource *res; + + qsort( spec->resources, spec->nb_resources, sizeof(*spec->resources), cmp_res ); + + offset = 2; /* alignment */ + tree = xmalloc( sizeof(*tree) ); + tree->types = NULL; + tree->nb_types = 0; + + for (i = 0; i < spec->nb_resources; i++) + { + if (!i || cmp_string( &spec->resources[i].type, &spec->resources[i-1].type )) /* new type */ + { + type = add_type( tree, &spec->resources[i] ); + offset += 8; + } + type->nb_names++; + offset += 12; + } + offset += 2; /* terminator */ + + for (i = 0, type = tree->types; i < tree->nb_types; i++, type++) + { + if (type->type->str) + { + type->name_offset = offset; + offset += strlen(type->type->str) + 1; + } + else type->name_offset = type->type->id | 0x8000; + + for (j = 0, res = type->res; j < type->nb_names; j++, res++) + { + if (res->name.str) + { + res->name_offset = offset; + offset += strlen(res->name.str) + 1; + } + else res->name_offset = res->name.id | 0x8000; + } + } + return tree; +} + +/* free the resource tree */ +static void free_resource_tree( struct res_tree *tree ) +{ + free( tree->types ); + free( tree ); +} + +/* output a string preceded by its length */ +static void output_string( const char *str ) +{ + unsigned int i, len = strlen(str); + output( "\t.byte 0x%02x", len ); + for (i = 0; i < len; i++) output( ",0x%02x", (unsigned char)str[i] ); + output( " /* %s */\n", str ); +} + +/* output a string preceded by its length in binary format*/ +static void output_bin_string( const char *str ) +{ + put_byte( strlen(str) ); + while (*str) put_byte( *str++ ); +} + +/* output the resource data */ +void output_res16_data( DLLSPEC *spec ) +{ + const struct resource *res; + unsigned int i; + + for (i = 0, res = spec->resources; i < spec->nb_resources; i++, res++) + { + output( ".L__wine_spec_resource_%u:\n", i ); + dump_bytes( res->data, res->data_size ); + } +} + +/* output the resource definitions */ +void output_res16_directory( DLLSPEC *spec ) +{ + unsigned int i, j; + struct res_tree *tree; + const struct res_type *type; + const struct resource *res; + + tree = build_resource_tree( spec ); + + output( "\n.L__wine_spec_ne_rsrctab:\n" ); + output( "\t%s 0\n", get_asm_short_keyword() ); /* alignment */ + + /* type and name structures */ + + for (i = 0, type = tree->types; i < tree->nb_types; i++, type++) + { + output( "\t%s 0x%04x,%u,0,0\n", get_asm_short_keyword(), type->name_offset, type->nb_names ); + + for (j = 0, res = type->res; j < type->nb_names; j++, res++) + { + output( "\t%s .L__wine_spec_resource_%lu-.L__wine_spec_dos_header,%u\n", + get_asm_short_keyword(), (unsigned long)(res - spec->resources), res->data_size ); + output( "\t%s 0x%04x,0x%04x,0,0\n", get_asm_short_keyword(), res->memopt, res->name_offset ); + } + } + output( "\t%s 0\n", get_asm_short_keyword() ); /* terminator */ + + /* name strings */ + + for (i = 0, type = tree->types; i < tree->nb_types; i++, type++) + { + if (type->type->str) output_string( type->type->str ); + for (j = 0, res = type->res; j < type->nb_names; j++, res++) + if (res->name.str) output_string( res->name.str ); + } + output( "\t.byte 0\n" ); /* names terminator */ + + free_resource_tree( tree ); +} + +/* output the resource data in binary format */ +void output_bin_res16_data( DLLSPEC *spec ) +{ + const struct resource *res; + unsigned int i; + + for (i = 0, res = spec->resources; i < spec->nb_resources; i++, res++) + put_data( res->data, res->data_size ); +} + +/* output the resource definitions in binary format */ +void output_bin_res16_directory( DLLSPEC *spec, unsigned int data_offset ) +{ + unsigned int i, j; + struct res_tree *tree; + const struct res_type *type; + const struct resource *res; + + tree = build_resource_tree( spec ); + + put_word( 0 ); /* alignment */ + + /* type and name structures */ + + for (i = 0, type = tree->types; i < tree->nb_types; i++, type++) + { + put_word( type->name_offset ); + put_word( type->nb_names ); + put_word( 0 ); + put_word( 0 ); + + for (j = 0, res = type->res; j < type->nb_names; j++, res++) + { + put_word( data_offset ); + put_word( res->data_size ); + put_word( res->memopt ); + put_word( res->name_offset ); + put_word( 0 ); + put_word( 0 ); + data_offset += res->data_size; + } + } + put_word( 0 ); /* terminator */ + + /* name strings */ + + for (i = 0, type = tree->types; i < tree->nb_types; i++, type++) + { + if (type->type->str) output_bin_string( type->type->str ); + for (j = 0, res = type->res; j < type->nb_names; j++, res++) + if (res->name.str) output_bin_string( res->name.str ); + } + put_byte( 0 ); /* names terminator */ + + free_resource_tree( tree ); +} diff --git a/tools/winebuild/res32.c b/tools/winebuild/res32.c new file mode 100644 index 00000000000..ecda0b874ea --- /dev/null +++ b/tools/winebuild/res32.c @@ -0,0 +1,666 @@ +/* + * Builtin dlls resource support + * + * Copyright 2000 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 + */ + +#include "config.h" +#include "wine/port.h" + +#include +#include +#include +#include +#include +#include +#ifdef HAVE_SYS_TYPES_H +# include +#endif +#include + +#include "build.h" + +typedef unsigned short WCHAR; +typedef unsigned short WORD; +typedef unsigned int DWORD; + +/* Unicode string or integer id */ +struct string_id +{ + WCHAR *str; /* ptr to Unicode string */ + WORD id; /* integer id if str is NULL */ +}; + +/* descriptor for a resource */ +struct resource +{ + struct string_id type; + struct string_id name; + const void *data; + unsigned int data_size; + unsigned int data_offset; + unsigned short mem_options; + unsigned short lang; +}; + +/* name level of the resource tree */ +struct res_name +{ + const struct string_id *name; /* name */ + struct resource *res; /* resource */ + int nb_languages; /* number of languages */ + unsigned int dir_offset; /* offset of directory in resource dir */ + unsigned int name_offset; /* offset of name in resource dir */ +}; + +/* type level of the resource tree */ +struct res_type +{ + const struct string_id *type; /* type name */ + struct res_name *names; /* names array */ + unsigned int nb_names; /* total number of names */ + unsigned int nb_id_names; /* number of names that have a numeric id */ + unsigned int dir_offset; /* offset of directory in resource dir */ + unsigned int name_offset; /* offset of type name in resource dir */ +}; + +/* top level of the resource tree */ +struct res_tree +{ + struct res_type *types; /* types array */ + unsigned int nb_types; /* total number of types */ +}; + +/* size of a resource directory with n entries */ +#define RESOURCE_DIR_SIZE (4 * sizeof(unsigned int)) +#define RESOURCE_DIR_ENTRY_SIZE (2 * sizeof(unsigned int)) +#define RESOURCE_DATA_ENTRY_SIZE (4 * sizeof(unsigned int)) +#define RESDIR_SIZE(n) (RESOURCE_DIR_SIZE + (n) * RESOURCE_DIR_ENTRY_SIZE) + + +static inline struct resource *add_resource( DLLSPEC *spec ) +{ + spec->resources = xrealloc( spec->resources, (spec->nb_resources + 1) * sizeof(spec->resources[0]) ); + return &spec->resources[spec->nb_resources++]; +} + +static inline unsigned int strlenW( const WCHAR *str ) +{ + const WCHAR *s = str; + while (*s) s++; + return s - str; +} + +static inline int strcmpW( const WCHAR *str1, const WCHAR *str2 ) +{ + while (*str1 && (*str1 == *str2)) { str1++; str2++; } + return *str1 - *str2; +} + +static struct res_name *add_name( struct res_type *type, struct resource *res ) +{ + struct res_name *name; + type->names = xrealloc( type->names, (type->nb_names + 1) * sizeof(*type->names) ); + name = &type->names[type->nb_names++]; + name->name = &res->name; + name->res = res; + name->nb_languages = 1; + if (!name->name->str) type->nb_id_names++; + return name; +} + +static struct res_type *add_type( struct res_tree *tree, struct resource *res ) +{ + struct res_type *type; + tree->types = xrealloc( tree->types, (tree->nb_types + 1) * sizeof(*tree->types) ); + type = &tree->types[tree->nb_types++]; + type->type = &res->type; + type->names = NULL; + type->nb_names = 0; + type->nb_id_names = 0; + return type; +} + +/* get a string from the current resource file */ +static void get_string( struct string_id *str ) +{ + WCHAR wc = get_word(); + + if (wc == 0xffff) + { + str->str = NULL; + str->id = get_word(); + } + else + { + WCHAR *p = xmalloc( (strlenW( (const WCHAR *)(input_buffer + input_buffer_pos) - 1) + 1) * sizeof(WCHAR) ); + str->str = p; + str->id = 0; + if ((*p++ = wc)) while ((*p++ = get_word())); + } +} + +/* put a string into the resource file */ +static void put_string( const struct string_id *str ) +{ + if (str->str) + { + const WCHAR *p = str->str; + while (*p) put_word( *p++ ); + put_word( 0 ); + } + else + { + put_word( 0xffff ); + put_word( str->id ); + } +} + +static void dump_res_data( const struct resource *res ) +{ + unsigned int i = 0; + unsigned int size = (res->data_size + 3) & ~3; + + if (!size) return; + + input_buffer = res->data; + input_buffer_pos = 0; + input_buffer_size = size; + + output( "\t.long " ); + while (size > 4) + { + if ((i++ % 16) == 15) output( "0x%08x\n\t.long ", get_dword() ); + else output( "0x%08x,", get_dword() ); + size -= 4; + } + output( "0x%08x\n", get_dword() ); + size -= 4; + assert( input_buffer_pos == input_buffer_size ); +} + +/* check the file header */ +/* all values must be zero except header size */ +static int check_header(void) +{ + DWORD size; + + if (get_dword()) return 0; /* data size */ + size = get_dword(); /* header size */ + if (size == 0x20000000) byte_swapped = 1; + else if (size != 0x20) return 0; + if (get_word() != 0xffff || get_word()) return 0; /* type, must be id 0 */ + if (get_word() != 0xffff || get_word()) return 0; /* name, must be id 0 */ + if (get_dword()) return 0; /* data version */ + if (get_word()) return 0; /* mem options */ + if (get_word()) return 0; /* language */ + if (get_dword()) return 0; /* version */ + if (get_dword()) return 0; /* characteristics */ + return 1; +} + +/* load the next resource from the current file */ +static void load_next_resource( DLLSPEC *spec ) +{ + DWORD hdr_size; + struct resource *res = add_resource( spec ); + + res->data_size = get_dword(); + hdr_size = get_dword(); + if (hdr_size & 3) fatal_error( "%s header size not aligned\n", input_buffer_filename ); + + res->data = input_buffer + input_buffer_pos - 2*sizeof(DWORD) + hdr_size; + get_string( &res->type ); + get_string( &res->name ); + if (input_buffer_pos & 2) get_word(); /* align to dword boundary */ + get_dword(); /* skip data version */ + res->mem_options = get_word(); + res->lang = get_word(); + get_dword(); /* skip version */ + get_dword(); /* skip characteristics */ + + input_buffer_pos = ((const unsigned char *)res->data - input_buffer) + ((res->data_size + 3) & ~3); + input_buffer_pos = (input_buffer_pos + 3) & ~3; + if (input_buffer_pos > input_buffer_size) + fatal_error( "%s is a truncated file\n", input_buffer_filename ); +} + +/* load a Win32 .res file */ +int load_res32_file( const char *name, DLLSPEC *spec ) +{ + int ret; + + init_input_buffer( name ); + + if ((ret = check_header())) + { + while (input_buffer_pos < input_buffer_size) load_next_resource( spec ); + } + return ret; +} + +/* compare two unicode strings/ids */ +static int cmp_string( const struct string_id *str1, const struct string_id *str2 ) +{ + if (!str1->str) + { + if (!str2->str) return str1->id - str2->id; + return 1; /* an id compares larger than a string */ + } + if (!str2->str) return -1; + return strcmpW( str1->str, str2->str ); +} + +/* compare two resources for sorting the resource directory */ +/* resources are stored first by type, then by name, then by language */ +static int cmp_res( const void *ptr1, const void *ptr2 ) +{ + const struct resource *res1 = ptr1; + const struct resource *res2 = ptr2; + int ret; + + if ((ret = cmp_string( &res1->type, &res2->type ))) return ret; + if ((ret = cmp_string( &res1->name, &res2->name ))) return ret; + return res1->lang - res2->lang; +} + +static char *format_res_string( const struct string_id *str ) +{ + int i, len = str->str ? strlenW(str->str) + 1 : 5; + char *ret = xmalloc( len ); + + if (!str->str) sprintf( ret, "%04x", str->id ); + else for (i = 0; i < len; i++) ret[i] = str->str[i]; /* dumb W->A conversion */ + return ret; +} + +/* build the 3-level (type,name,language) resource tree */ +static struct res_tree *build_resource_tree( DLLSPEC *spec, unsigned int *dir_size ) +{ + unsigned int i, k, n, offset, data_offset; + struct res_tree *tree; + struct res_type *type = NULL; + struct res_name *name = NULL; + struct resource *res; + + qsort( spec->resources, spec->nb_resources, sizeof(*spec->resources), cmp_res ); + + tree = xmalloc( sizeof(*tree) ); + tree->types = NULL; + tree->nb_types = 0; + + for (i = 0; i < spec->nb_resources; i++) + { + if (!i || cmp_string( &spec->resources[i].type, &spec->resources[i-1].type )) /* new type */ + { + type = add_type( tree, &spec->resources[i] ); + name = add_name( type, &spec->resources[i] ); + } + else if (cmp_string( &spec->resources[i].name, &spec->resources[i-1].name )) /* new name */ + { + name = add_name( type, &spec->resources[i] ); + } + else if (spec->resources[i].lang == spec->resources[i-1].lang) + { + char *type_str = format_res_string( &spec->resources[i].type ); + char *name_str = format_res_string( &spec->resources[i].name ); + error( "winebuild: duplicate resource type %s name %s language %04x\n", + type_str, name_str, spec->resources[i].lang ); + } + else name->nb_languages++; + } + + /* compute the offsets */ + + offset = RESDIR_SIZE( tree->nb_types ); + for (i = 0, type = tree->types; i < tree->nb_types; i++, type++) + { + type->dir_offset = offset; + offset += RESDIR_SIZE( type->nb_names ); + for (n = 0, name = type->names; n < type->nb_names; n++, name++) + { + name->dir_offset = offset; + offset += RESDIR_SIZE( name->nb_languages ); + } + } + data_offset = offset; + offset += spec->nb_resources * RESOURCE_DATA_ENTRY_SIZE; + + for (i = 0, type = tree->types; i < tree->nb_types; i++, type++) + { + if (type->type->str) + { + type->name_offset = offset | 0x80000000; + offset += (strlenW(type->type->str)+1) * sizeof(WCHAR); + } + else type->name_offset = type->type->id; + + for (n = 0, name = type->names; n < type->nb_names; n++, name++) + { + if (name->name->str) + { + name->name_offset = offset | 0x80000000; + offset += (strlenW(name->name->str)+1) * sizeof(WCHAR); + } + else name->name_offset = name->name->id; + for (k = 0, res = name->res; k < name->nb_languages; k++, res++) + { + unsigned int entry_offset = (res - spec->resources) * RESOURCE_DATA_ENTRY_SIZE; + res->data_offset = data_offset + entry_offset; + } + } + } + if (dir_size) *dir_size = (offset + 3) & ~3; + return tree; +} + +/* free the resource tree */ +static void free_resource_tree( struct res_tree *tree ) +{ + unsigned int i; + + for (i = 0; i < tree->nb_types; i++) free( tree->types[i].names ); + free( tree->types ); + free( tree ); +} + +/* output a Unicode string */ +static void output_string( const WCHAR *name ) +{ + int i, len = strlenW(name); + output( "\t%s 0x%04x", get_asm_short_keyword(), len ); + for (i = 0; i < len; i++) output( ",0x%04x", name[i] ); + output( " /* " ); + for (i = 0; i < len; i++) output( "%c", isprint((char)name[i]) ? (char)name[i] : '?' ); + output( " */\n" ); +} + +/* output a resource directory */ +static inline void output_res_dir( unsigned int nb_names, unsigned int nb_ids ) +{ + output( "\t.long 0\n" ); /* Characteristics */ + output( "\t.long 0\n" ); /* TimeDateStamp */ + output( "\t%s 0,0\n", /* Major/MinorVersion */ + get_asm_short_keyword() ); + output( "\t%s %u,%u\n", /* NumberOfNamed/IdEntries */ + get_asm_short_keyword(), nb_names, nb_ids ); +} + +/* output the resource definitions */ +void output_resources( DLLSPEC *spec ) +{ + int k, nb_id_types; + unsigned int i, n; + struct res_tree *tree; + struct res_type *type; + struct res_name *name; + const struct resource *res; + + if (!spec->nb_resources) return; + + tree = build_resource_tree( spec, NULL ); + + /* output the resource directories */ + + output( "\n/* resources */\n\n" ); + output( "\t.data\n" ); + output( "\t.align %d\n", get_alignment(get_ptr_size()) ); + output( ".L__wine_spec_resources:\n" ); + + for (i = nb_id_types = 0, type = tree->types; i < tree->nb_types; i++, type++) + if (!type->type->str) nb_id_types++; + + output_res_dir( tree->nb_types - nb_id_types, nb_id_types ); + + /* dump the type directory */ + + for (i = 0, type = tree->types; i < tree->nb_types; i++, type++) + output( "\t.long 0x%08x,0x%08x\n", + type->name_offset, type->dir_offset | 0x80000000 ); + + /* dump the names and languages directories */ + + for (i = 0, type = tree->types; i < tree->nb_types; i++, type++) + { + output_res_dir( type->nb_names - type->nb_id_names, type->nb_id_names ); + for (n = 0, name = type->names; n < type->nb_names; n++, name++) + output( "\t.long 0x%08x,0x%08x\n", + name->name_offset, name->dir_offset | 0x80000000 ); + + for (n = 0, name = type->names; n < type->nb_names; n++, name++) + { + output_res_dir( 0, name->nb_languages ); + for (k = 0, res = name->res; k < name->nb_languages; k++, res++) + output( "\t.long 0x%08x,0x%08x\n", res->lang, res->data_offset ); + } + } + + /* dump the resource data entries */ + + for (i = 0, res = spec->resources; i < spec->nb_resources; i++, res++) + output( "\t.long .L__wine_spec_res_%d-.L__wine_spec_rva_base,%u,0,0\n", + i, (res->data_size + 3) & ~3 ); + + /* dump the name strings */ + + for (i = 0, type = tree->types; i < tree->nb_types; i++, type++) + { + if (type->type->str) output_string( type->type->str ); + for (n = 0, name = type->names; n < type->nb_names; n++, name++) + if (name->name->str) output_string( name->name->str ); + } + + /* resource data */ + + for (i = 0, res = spec->resources; i < spec->nb_resources; i++, res++) + { + output( "\n\t.align %d\n", get_alignment(get_ptr_size()) ); + output( ".L__wine_spec_res_%d:\n", i ); + dump_res_data( res ); + } + output( ".L__wine_spec_resources_end:\n" ); + output( "\t.byte 0\n" ); + + free_resource_tree( tree ); +} + +/* output a Unicode string in binary format */ +static void output_bin_string( const WCHAR *name ) +{ + int i, len = strlenW(name); + put_word( len ); + for (i = 0; i < len; i++) put_word( name[i] ); +} + +/* output a resource directory in binary format */ +static inline void output_bin_res_dir( unsigned int nb_names, unsigned int nb_ids ) +{ + put_dword( 0 ); /* Characteristics */ + put_dword( 0 ); /* TimeDateStamp */ + put_word( 0 ); /* MajorVersion */ + put_word( 0 ); /* MinorVersion */ + put_word( nb_names ); /* NumberOfNamedEntries */ + put_word( nb_ids ); /* NumberOfIdEntries */ +} + +/* output the resource definitions in binary format */ +void output_bin_resources( DLLSPEC *spec, unsigned int start_rva ) +{ + int k, nb_id_types; + unsigned int i, n, data_offset; + struct res_tree *tree; + struct res_type *type; + struct res_name *name; + const struct resource *res; + + if (!spec->nb_resources) return; + + tree = build_resource_tree( spec, &data_offset ); + init_output_buffer(); + + /* output the resource directories */ + + for (i = nb_id_types = 0, type = tree->types; i < tree->nb_types; i++, type++) + if (!type->type->str) nb_id_types++; + + output_bin_res_dir( tree->nb_types - nb_id_types, nb_id_types ); + + /* dump the type directory */ + + for (i = 0, type = tree->types; i < tree->nb_types; i++, type++) + { + put_dword( type->name_offset ); + put_dword( type->dir_offset | 0x80000000 ); + } + + /* dump the names and languages directories */ + + for (i = 0, type = tree->types; i < tree->nb_types; i++, type++) + { + output_bin_res_dir( type->nb_names - type->nb_id_names, type->nb_id_names ); + for (n = 0, name = type->names; n < type->nb_names; n++, name++) + { + put_dword( name->name_offset ); + put_dword( name->dir_offset | 0x80000000 ); + } + + for (n = 0, name = type->names; n < type->nb_names; n++, name++) + { + output_bin_res_dir( 0, name->nb_languages ); + for (k = 0, res = name->res; k < name->nb_languages; k++, res++) + { + put_dword( res->lang ); + put_dword( res->data_offset ); + } + } + } + + /* dump the resource data entries */ + + for (i = 0, res = spec->resources; i < spec->nb_resources; i++, res++) + { + put_dword( data_offset + start_rva ); + put_dword( (res->data_size + 3) & ~3 ); + put_dword( 0 ); + put_dword( 0 ); + data_offset += (res->data_size + 3) & ~3; + } + + /* dump the name strings */ + + for (i = 0, type = tree->types; i < tree->nb_types; i++, type++) + { + if (type->type->str) output_bin_string( type->type->str ); + for (n = 0, name = type->names; n < type->nb_names; n++, name++) + if (name->name->str) output_bin_string( name->name->str ); + } + + /* resource data */ + + align_output( 4 ); + for (i = 0, res = spec->resources; i < spec->nb_resources; i++, res++) + { + put_data( res->data, res->data_size ); + align_output( 4 ); + } + + free_resource_tree( tree ); +} + +static unsigned int get_resource_header_size( const struct resource *res ) +{ + unsigned int size = 5 * sizeof(unsigned int) + 2 * sizeof(unsigned short); + + if (!res->type.str) size += 2 * sizeof(unsigned short); + else size += (strlenW(res->type.str) + 1) * sizeof(WCHAR); + + if (!res->name.str) size += 2 * sizeof(unsigned short); + else size += (strlenW(res->name.str) + 1) * sizeof(WCHAR); + + return size; +} + +/* output the resources into a .o file */ +void output_res_o_file( DLLSPEC *spec ) +{ + unsigned int i; + char *res_file = NULL; + int fd, err; + + if (!spec->nb_resources) fatal_error( "--resources mode needs at least one resource file as input\n" ); + if (!output_file_name) fatal_error( "No output file name specified\n" ); + + byte_swapped = 0; + init_output_buffer(); + + put_dword( 0 ); /* ResSize */ + put_dword( 32 ); /* HeaderSize */ + put_word( 0xffff ); /* ResType */ + put_word( 0x0000 ); + put_word( 0xffff ); /* ResName */ + put_word( 0x0000 ); + put_dword( 0 ); /* DataVersion */ + put_word( 0 ); /* Memory options */ + put_word( 0 ); /* Language */ + put_dword( 0 ); /* Version */ + put_dword( 0 ); /* Characteristics */ + + for (i = 0; i < spec->nb_resources; i++) + { + unsigned int header_size = get_resource_header_size( &spec->resources[i] ); + + put_dword( spec->resources[i].data_size ); + put_dword( (header_size + 3) & ~3 ); + put_string( &spec->resources[i].type ); + put_string( &spec->resources[i].name ); + align_output( 4 ); + put_dword( 0 ); + put_word( spec->resources[i].mem_options ); + put_word( spec->resources[i].lang ); + put_dword( 0 ); + put_dword( 0 ); + put_data( spec->resources[i].data, spec->resources[i].data_size ); + align_output( 4 ); + } + + /* if the output file name is a .res too, don't run the results through windres */ + if (strendswith( output_file_name, ".res")) + { + flush_output_buffer(); + return; + } + + res_file = get_temp_file_name( output_file_name, ".res" ); + if ((fd = open( res_file, O_WRONLY|O_CREAT|O_TRUNC|O_BINARY, 0600 )) == -1) + fatal_error( "Cannot create %s\n", res_file ); + if (write( fd, output_buffer, output_buffer_pos ) != output_buffer_pos) + fatal_error( "Error writing to %s\n", res_file ); + close( fd ); + free( output_buffer ); + + if (res_file) + { + const char *prog = get_windres_command(); + char *cmd = xmalloc( strlen(prog) + strlen(res_file) + strlen(output_file_name) + 9 ); + sprintf( cmd, "%s -i %s -o %s", prog, res_file, output_file_name ); + if (verbose) fprintf( stderr, "%s\n", cmd ); + err = system( cmd ); + if (err) fatal_error( "%s failed with status %d\n", prog, err ); + free( cmd ); + } + output_file_name = NULL; /* so we don't try to assemble it */ +} diff --git a/tools/winebuild/ros_diff.patch b/tools/winebuild/ros_diff.patch new file mode 100644 index 00000000000..7247ac10299 --- /dev/null +++ b/tools/winebuild/ros_diff.patch @@ -0,0 +1,388 @@ +Index: build.h +=================================================================== +--- build.h (Revision 4) ++++ build.h (Arbeitskopie) +@@ -38,6 +38,8 @@ + #define min(a,b) (((a) < (b)) ? (a) : (b)) + #endif + ++#define EXEEXT ".exe" ++ + typedef enum + { + TYPE_VARIABLE, /* variable */ +@@ -47,6 +49,7 @@ + TYPE_STDCALL, /* stdcall function (Win32) */ + TYPE_CDECL, /* cdecl function (Win32) */ + TYPE_VARARGS, /* varargs function (Win32) */ ++ TYPE_FASTCALL, /* fastcall function (Win32) */ + TYPE_EXTERN, /* external symbol (Win32) */ + TYPE_NBTYPES + } ORD_TYPE; +@@ -269,6 +272,7 @@ + extern void BuildSpec16File( DLLSPEC *spec ); + extern void BuildSpec32File( DLLSPEC *spec ); + extern void BuildDef32File( DLLSPEC *spec ); ++extern void BuildPedllFile( DLLSPEC *spec ); + + extern void add_16bit_exports( DLLSPEC *spec32, DLLSPEC *spec16 ); + extern int parse_spec_file( FILE *file, DLLSPEC *spec ); +Index: main.c +=================================================================== +--- main.c (Revision 4) ++++ main.c (Arbeitskopie) +@@ -48,9 +48,9 @@ + int link_ext_symbols = 0; + int force_pointer_size = 0; + +-#ifdef __i386__ ++#if defined(TARGET_i386) + enum target_cpu target_cpu = CPU_x86; +-#elif defined(__x86_64__) ++#elif defined(TARGET_amd64) + enum target_cpu target_cpu = CPU_x86_64; + #elif defined(__sparc__) + enum target_cpu target_cpu = CPU_SPARC; +@@ -58,7 +58,7 @@ + enum target_cpu target_cpu = CPU_ALPHA; + #elif defined(__powerpc__) + enum target_cpu target_cpu = CPU_POWERPC; +-#elif defined(__arm__) ++#elif defined(TARGET_arm) + enum target_cpu target_cpu = CPU_ARM; + #else + #error Unsupported CPU +@@ -102,7 +102,8 @@ + MODE_DEF, + MODE_RELAY16, + MODE_RELAY32, +- MODE_RESOURCES ++ MODE_RESOURCES, ++ MODE_PEDLL + }; + + static enum exec_mode_values exec_mode = MODE_NONE; +@@ -253,6 +254,7 @@ + " --relay16 Build the 16-bit relay assembly routines\n" + " --relay32 Build the 32-bit relay assembly routines\n" + " --resources Build a .o file for the resource files\n\n" ++" --pedll Build a .c file for PE dll\n\n" + "The mode options are mutually exclusive; you must specify one and only one.\n\n"; + + enum long_options_values +@@ -272,7 +274,8 @@ + LONG_OPT_RESOURCES, + LONG_OPT_SAVE_TEMPS, + LONG_OPT_SUBSYSTEM, +- LONG_OPT_VERSION ++ LONG_OPT_VERSION, ++ LONG_OPT_PEDLL + }; + + static const char short_options[] = "C:D:E:F:H:I:K:L:M:N:b:d:e:f:hi:kl:m:o:r:u:vw"; +@@ -295,6 +298,7 @@ + { "save-temps", 0, 0, LONG_OPT_SAVE_TEMPS }, + { "subsystem", 1, 0, LONG_OPT_SUBSYSTEM }, + { "version", 0, 0, LONG_OPT_VERSION }, ++ { "pedll", 1, 0, LONG_OPT_PEDLL }, + /* aliases for short options */ + { "target", 1, 0, 'b' }, + { "delay-lib", 1, 0, 'd' }, +@@ -497,6 +501,11 @@ + case LONG_OPT_VERSION: + printf( "winebuild version " PACKAGE_VERSION "\n" ); + exit(0); ++ case LONG_OPT_PEDLL: ++ set_exec_mode( MODE_PEDLL ); ++ spec_file_name = xstrdup( optarg ); ++ set_dll_file_name( optarg, spec ); ++ break; + case '?': + usage(1); + break; +@@ -652,6 +661,11 @@ + if (argv[0]) fatal_error( "file argument '%s' not allowed in this mode\n", argv[0] ); + BuildRelays32(); + break; ++ case MODE_PEDLL: ++ if (argv[0]) fatal_error( "file argument '%s' not allowed in this mode\n", argv[0] ); ++ if (!parse_input_file( spec )) break; ++ BuildPedllFile( spec ); ++ break; + case MODE_RESOURCES: + load_resources( argv, spec ); + output_res_o_file( spec ); +Index: parser.c +=================================================================== +--- parser.c (Revision 4) ++++ parser.c (Arbeitskopie) +@@ -56,6 +56,7 @@ + "stdcall", /* TYPE_STDCALL */ + "cdecl", /* TYPE_CDECL */ + "varargs", /* TYPE_VARARGS */ ++ "fastcall", /* TYPE_FASTCALL */ + "extern" /* TYPE_EXTERN */ + }; + +@@ -521,6 +522,7 @@ + case TYPE_STDCALL: + case TYPE_VARARGS: + case TYPE_CDECL: ++ case TYPE_FASTCALL: + if (!parse_spec_export( odp, spec )) goto error; + break; + case TYPE_ABS: +Index: res32.c +=================================================================== +--- res32.c (Revision 4) ++++ res32.c (Arbeitskopie) +@@ -35,12 +35,14 @@ + #include "build.h" + + typedef unsigned short WCHAR; ++typedef unsigned short WORD; ++typedef unsigned int DWORD; + + /* Unicode string or integer id */ + struct string_id + { + WCHAR *str; /* ptr to Unicode string */ +- unsigned short id; /* integer id if str is NULL */ ++ WORD id; /* integer id if str is NULL */ + }; + + /* descriptor for a resource */ +@@ -195,7 +197,7 @@ + /* all values must be zero except header size */ + static int check_header(void) + { +- unsigned int size; ++ DWORD size; + + if (get_dword()) return 0; /* data size */ + size = get_dword(); /* header size */ +@@ -214,14 +216,14 @@ + /* load the next resource from the current file */ + static void load_next_resource( DLLSPEC *spec ) + { +- unsigned int hdr_size; ++ DWORD hdr_size; + struct resource *res = add_resource( spec ); + + res->data_size = get_dword(); + hdr_size = get_dword(); + if (hdr_size & 3) fatal_error( "%s header size not aligned\n", input_buffer_filename ); + +- res->data = input_buffer + input_buffer_pos - 2*sizeof(unsigned int) + hdr_size; ++ res->data = input_buffer + input_buffer_pos - 2*sizeof(DWORD) + hdr_size; + get_string( &res->type ); + get_string( &res->name ); + if (input_buffer_pos & 2) get_word(); /* align to dword boundary */ +Index: spec32.c +=================================================================== +--- spec32.c (Revision 4) ++++ spec32.c (Arbeitskopie) +@@ -74,6 +74,28 @@ + } + + /******************************************************************* ++ * make_internal_name ++ * ++ * Generate an internal name for an entry point. Used for stubs etc. ++ */ ++static const char *make_internal_name( const ORDDEF *odp, DLLSPEC *spec, const char *prefix ) ++{ ++ static char buffer[256]; ++ if (odp->name || odp->export_name) ++ { ++ char *p; ++ sprintf( buffer, "__wine_%s_%s_%s", prefix, spec->file_name, ++ odp->name ? odp->name : odp->export_name ); ++ /* make sure name is a legal C identifier */ ++ for (p = buffer; *p; p++) if (!isalnum(*p) && *p != '_') break; ++ if (!*p) return buffer; ++ } ++ sprintf( buffer, "__wine_%s_%s_%d", prefix, make_c_identifier(spec->file_name), odp->ordinal ); ++ return buffer; ++} ++ ++ ++/******************************************************************* + * output_relay_debug + * + * Output entry points for relay debugging +@@ -341,6 +363,44 @@ + + + /******************************************************************* ++ * output_stub_funcs ++ * ++ * Output the functions for stub entry points ++ */ ++static void output_stub_funcs( DLLSPEC *spec ) ++{ ++ int i; ++ ++#if 0 ++ for (i = 0; i < spec->nb_entry_points; i++) ++ { ++ ORDDEF *odp = &spec->entry_points[i]; ++ if (odp->type != TYPE_STUB) continue; ++ fprintf( outfile, "#ifdef __GNUC__\n" ); ++ fprintf( outfile, "extern void __wine_spec_unimplemented_stub( const char *module, const char *func ) __attribute__((noreturn));\n" ); ++ fprintf( outfile, "#else\n" ); ++ fprintf( outfile, "extern void __wine_spec_unimplemented_stub( const char *module, const char *func );\n" ); ++ fprintf( outfile, "#endif\n\n" ); ++ break; ++ } ++#endif ++ ++ for (i = 0; i < spec->nb_entry_points; i++) ++ { ++ const ORDDEF *odp = &spec->entry_points[i]; ++ if (odp->type != TYPE_STUB) continue; ++ output( "void %s(void) ", make_internal_name( odp, spec, "stub" ) ); ++ if (odp->name) ++ output( "{ __wine_spec_unimplemented_stub(__wine_spec_file_name, \"%s\"); }\n", odp->name ); ++ else if (odp->export_name) ++ output( "{ __wine_spec_unimplemented_stub(__wine_spec_file_name, \"%s\"); }\n", odp->export_name ); ++ else ++ output( "{ __wine_spec_unimplemented_stub(__wine_spec_file_name, \"%d\"); }\n", odp->ordinal ); ++ } ++} ++ ++ ++/******************************************************************* + * output_asm_constructor + * + * Output code for calling a dll constructor. +@@ -795,10 +855,6 @@ + + if (!(odp->flags & FLAG_PRIVATE)) total++; + +- if (odp->type == TYPE_STUB) continue; +- +- output( " %s", name ); +- + switch(odp->type) + { + case TYPE_EXTERN: +@@ -807,12 +863,14 @@ + case TYPE_VARARGS: + case TYPE_CDECL: + /* try to reduce output */ ++ output( " %s", name ); + if(strcmp(name, odp->link_name) || (odp->flags & FLAG_FORWARD)) + output( "=%s", odp->link_name ); + break; + case TYPE_STDCALL: + { + int at_param = strlen(odp->u.func.arg_types) * get_ptr_size(); ++ output( " %s", name ); + if (!kill_at && target_cpu == CPU_x86) output( "@%d", at_param ); + if (odp->flags & FLAG_FORWARD) + { +@@ -825,6 +883,50 @@ + } + break; + } ++ case TYPE_FASTCALL: ++ { ++ int at_param = strlen(odp->u.func.arg_types) * get_ptr_size(); ++ output( " " ); ++ if (!kill_at) output( "@" ); ++ output( "%s", name ); ++ if (!kill_at) output( "@%d", at_param ); ++ if (odp->flags & FLAG_FORWARD) ++ { ++ output( "=" ); ++ output( "%s", odp->link_name ); ++ } ++ else if (strcmp(name, odp->link_name)) /* try to reduce output */ ++ { ++ output( "=" ); ++ if (!kill_at) output( "@" ); ++ output( "%s", odp->link_name ); ++ if (!kill_at) output( "@%d", at_param ); ++ } ++ break; ++ } ++ case TYPE_STUB: ++ { ++ output( " %s", name ); ++ if (!kill_at) ++ { ++ const char *check = name + strlen(name); ++ while (name != check && ++ '0' <= check[-1] && check[-1] <= '9') ++ { ++ check--; ++ } ++ if (name != check && check != name + strlen(name) && ++ '@' == check[-1]) ++ { ++ output("%s", check - 1); ++ } ++ } ++ if (odp->name || odp->export_name) ++ { ++ output("=%s", make_internal_name( odp, spec, "stub" )); ++ } ++ break; ++ } + default: + assert(0); + } +@@ -836,3 +939,52 @@ + } + if (!total) warning( "%s: Import library doesn't export anything\n", spec->file_name ); + } ++ ++ ++/******************************************************************* ++ * BuildPedllFile ++ * ++ * Build a PE DLL C file from a spec file. ++ */ ++void BuildPedllFile( DLLSPEC *spec ) ++{ ++ int i, has_stubs = 0; ++ ++ output_standard_file_header(); ++ ++ for (i = 0; i < spec->nb_entry_points; i++) ++ { ++ const ORDDEF *odp = &spec->entry_points[i]; ++ if (odp->type == TYPE_STUB) ++ { ++ has_stubs = 1; ++ break; ++ } ++ } ++ ++ if (!has_stubs) ++ { ++ output( "/* This file is intentionally left blank */\n"); ++ return; ++ } ++ ++ output( "#include \n"); ++ output( "#include \"windef.h\"\n"); ++ output( "#include \"winbase.h\"\n"); ++ output( "#include \"wine/config.h\"\n"); ++ output( "#include \"wine/exception.h\"\n\n"); ++ ++ output( "void __wine_spec_unimplemented_stub( const char *module, const char *function )\n"); ++ output( "{\n"); ++ output( " ULONG_PTR args[2];\n"); ++ output( "\n"); ++ output( " args[0] = (ULONG_PTR)module;\n"); ++ output( " args[1] = (ULONG_PTR)function;\n"); ++ output( " RaiseException( EXCEPTION_WINE_STUB, EH_NONCONTINUABLE, 2, args );\n"); ++ output( "}\n\n"); ++ ++ output( "static const char __wine_spec_file_name[] = \"%s\";\n\n", spec->file_name ); ++ ++ /* Output the stub functions */ ++ output_stub_funcs( spec ); ++} diff --git a/tools/winebuild/spec16.c b/tools/winebuild/spec16.c new file mode 100644 index 00000000000..a0a962f7251 --- /dev/null +++ b/tools/winebuild/spec16.c @@ -0,0 +1,1047 @@ +/* + * 16-bit spec files + * + * Copyright 1993 Robert J. Amstadt + * Copyright 1995 Martin von Loewis + * Copyright 1995, 1996, 1997 Alexandre Julliard + * Copyright 1997 Eric Youngdale + * Copyright 1999 Ulrich Weigand + * + * 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 + */ + +#include "config.h" +#include "wine/port.h" + +#include +#include + +#include "build.h" + +#define NE_FFLAGS_SINGLEDATA 0x0001 +#define NE_FFLAGS_LIBMODULE 0x8000 + +/* argument type flags for relay debugging */ +enum arg_types +{ + ARG_NONE = 0, /* indicates end of arg list */ + ARG_WORD, /* unsigned word */ + ARG_SWORD, /* signed word */ + ARG_LONG, /* long or segmented pointer */ + ARG_PTR, /* linear pointer */ + ARG_STR, /* linear pointer to null-terminated string */ + ARG_SEGSTR, /* segmented pointer to null-terminated string */ + ARG_VARARG /* start of varargs */ +}; + +/* sequences of nops to fill a certain number of words */ +static const char * const nop_sequence[4] = +{ + ".byte 0x89,0xf6", /* mov %esi,%esi */ + ".byte 0x8d,0x74,0x26,0x00", /* lea 0x00(%esi),%esi */ + ".byte 0x8d,0xb6,0x00,0x00,0x00,0x00", /* lea 0x00000000(%esi),%esi */ + ".byte 0x8d,0x74,0x26,0x00,0x8d,0x74,0x26,0x00" /* lea 0x00(%esi),%esi; lea 0x00(%esi),%esi */ +}; + +static inline int is_function( const ORDDEF *odp ) +{ + return (odp->type == TYPE_CDECL || + odp->type == TYPE_PASCAL || + odp->type == TYPE_VARARGS || + odp->type == TYPE_STUB); +} + +static void init_dll_name( DLLSPEC *spec ) +{ + if (!spec->file_name) + { + char *p; + spec->file_name = xstrdup( output_file_name ); + if ((p = strrchr( spec->file_name, '.' ))) *p = 0; + } + if (!spec->dll_name) /* set default name from file name */ + { + char *p; + spec->dll_name = xstrdup( spec->file_name ); + if ((p = strrchr( spec->dll_name, '.' ))) *p = 0; + } +} + +/******************************************************************* + * output_entries + * + * Output entries for individual symbols in the entry table. + */ +static void output_entries( DLLSPEC *spec, int first, int count ) +{ + int i; + + for (i = 0; i < count; i++) + { + ORDDEF *odp = spec->ordinals[first + i]; + output( "\t.byte 0x03\n" ); /* flags: exported & public data */ + switch (odp->type) + { + case TYPE_CDECL: + case TYPE_PASCAL: + case TYPE_VARARGS: + case TYPE_STUB: + output( "\t%s .L__wine_%s_%u-.L__wine_spec_code_segment\n", + get_asm_short_keyword(), + make_c_identifier(spec->dll_name), first + i ); + break; + case TYPE_VARIABLE: + output( "\t%s .L__wine_%s_%u-.L__wine_spec_data_segment\n", + get_asm_short_keyword(), + make_c_identifier(spec->dll_name), first + i ); + break; + case TYPE_ABS: + output( "\t%s 0x%04x /* %s */\n", + get_asm_short_keyword(), odp->u.abs.value, odp->name ); + break; + default: + assert(0); + } + } +} + + +/******************************************************************* + * output_entry_table + */ +static void output_entry_table( DLLSPEC *spec ) +{ + int i, prev = 0, prev_sel = -1, bundle_count = 0; + + for (i = 1; i <= spec->limit; i++) + { + int selector = 0; + ORDDEF *odp = spec->ordinals[i]; + if (!odp) continue; + + switch (odp->type) + { + case TYPE_CDECL: + case TYPE_PASCAL: + case TYPE_VARARGS: + case TYPE_STUB: + selector = 1; /* Code selector */ + break; + case TYPE_VARIABLE: + selector = 2; /* Data selector */ + break; + case TYPE_ABS: + selector = 0xfe; /* Constant selector */ + break; + default: + continue; + } + + if (prev + 1 != i || prev_sel != selector || bundle_count == 255) + { + /* need to start a new bundle */ + + /* flush previous bundle */ + if (bundle_count) + { + output( "\t/* %s.%d - %s.%d */\n", + spec->dll_name, prev - bundle_count + 1, spec->dll_name, prev ); + output( "\t.byte 0x%02x,0x%02x\n", bundle_count, prev_sel ); + output_entries( spec, prev - bundle_count + 1, bundle_count ); + } + + if (prev + 1 != i) + { + int skip = i - (prev + 1); + while (skip > 255) + { + output( "\t.byte 0xff,0x00\n" ); + skip -= 255; + } + output( "\t.byte 0x%02x,0x00\n", skip ); + } + + bundle_count = 0; + prev_sel = selector; + } + bundle_count++; + prev = i; + } + + /* flush last bundle */ + if (bundle_count) + { + output( "\t.byte 0x%02x,0x%02x\n", bundle_count, prev_sel ); + output_entries( spec, prev - bundle_count + 1, bundle_count ); + } + output( "\t.byte 0x00\n" ); +} + + +/******************************************************************* + * output_resident_name + */ +static void output_resident_name( const char *string, int ordinal ) +{ + unsigned int i, len = strlen(string); + + output( "\t.byte 0x%02x", len ); + for (i = 0; i < len; i++) output( ",0x%02x", (unsigned char)toupper(string[i]) ); + output( " /* %s */\n", string ); + output( "\t%s %u\n", get_asm_short_keyword(), ordinal ); +} + + +/******************************************************************* + * get_callfrom16_name + */ +static const char *get_callfrom16_name( const ORDDEF *odp ) +{ + static char buffer[80]; + + sprintf( buffer, "%s_%s_%s", + (odp->type == TYPE_PASCAL) ? "p" : + (odp->type == TYPE_VARARGS) ? "v" : "c", + (odp->flags & FLAG_REGISTER) ? "regs" : + (odp->flags & FLAG_RET16) ? "word" : "long", + odp->u.func.arg_types ); + return buffer; +} + + +/******************************************************************* + * get_relay_name + */ +static const char *get_relay_name( const ORDDEF *odp ) +{ + static char buffer[80]; + char *p; + + switch(odp->type) + { + case TYPE_PASCAL: + strcpy( buffer, "p_" ); + break; + case TYPE_VARARGS: + strcpy( buffer, "v_" ); + break; + case TYPE_CDECL: + case TYPE_STUB: + strcpy( buffer, "c_" ); + break; + default: + assert(0); + } + strcat( buffer, odp->u.func.arg_types ); + for (p = buffer + 2; *p; p++) + { + /* map string types to the corresponding plain pointer type */ + if (*p == 't') *p = 'p'; + else if (*p == 'T') *p = 'l'; + } + if (odp->flags & FLAG_REGISTER) strcat( buffer, "_regs" ); + return buffer; +} + + +/******************************************************************* + * get_function_argsize + */ +static int get_function_argsize( const ORDDEF *odp ) +{ + const char *args; + int argsize = 0; + + for (args = odp->u.func.arg_types; *args; args++) + { + switch (*args) + { + case 'w': /* word */ + case 's': /* s_word */ + argsize += 2; + break; + case 'l': /* long or segmented pointer */ + case 'T': /* segmented pointer to null-terminated string */ + case 'p': /* linear pointer */ + case 't': /* linear pointer to null-terminated string */ + argsize += 4; + break; + default: + assert(0); + } + } + return argsize; +} + + +/******************************************************************* + * output_call16_function + * + * Build a 16-bit-to-Wine callback glue function. + * + * The generated routines are intended to be used as argument conversion + * routines to be called by the CallFrom16... core. Thus, the prototypes of + * the generated routines are (see also CallFrom16): + * + * extern WORD WINAPI __wine_spec_call16_C_xxx( FARPROC func, LPBYTE args ); + * extern LONG WINAPI __wine_spec_call16_C_xxx( FARPROC func, LPBYTE args ); + * extern void WINAPI __wine_spec_call16_C_xxx_regs( FARPROC func, LPBYTE args, CONTEXT86 *context ); + * + * where 'C' is the calling convention ('p' for pascal or 'c' for cdecl), + * and each 'x' is an argument ('w'=word, 's'=signed word, 'l'=long, + * 'p'=linear pointer, 't'=linear pointer to null-terminated string, + * 'T'=segmented pointer to null-terminated string). + * + * The generated routines fetch the arguments from the 16-bit stack (pointed + * to by 'args'); the offsets of the single argument values are computed + * according to the calling convention and the argument types. Then, the + * 32-bit entry point is called with these arguments. + * + * For register functions, the arguments (if present) are converted just + * the same as for normal functions, but in addition the CONTEXT86 pointer + * filled with the current register values is passed to the 32-bit routine. + */ +static void output_call16_function( ORDDEF *odp ) +{ + char name[256]; + int i, pos, stack_words; + const char *args = odp->u.func.arg_types; + int argsize = get_function_argsize( odp ); + int needs_ldt = strchr( args, 'p' ) || strchr( args, 't' ); + + sprintf( name, ".L__wine_spec_call16_%s", get_relay_name(odp) ); + + output( "\t.align %d\n", get_alignment(4) ); + output( "\t%s\n", func_declaration(name) ); + output( "%s:\n", name ); + output( "\tpushl %%ebp\n" ); + output( "\tmovl %%esp,%%ebp\n" ); + stack_words = 2; + if (needs_ldt) + { + output( "\tpushl %%esi\n" ); + stack_words++; + if (UsePIC) + { + output( "\tcall %s\n", asm_name("__wine_spec_get_pc_thunk_eax") ); + output( "1:\tmovl wine_ldt_copy_ptr-1b(%%eax),%%esi\n" ); + } + else + output( "\tmovl $%s,%%esi\n", asm_name("wine_ldt_copy") ); + } + + /* preserve 16-byte stack alignment */ + stack_words += strlen(args); + if ((odp->flags & FLAG_REGISTER) || (odp->type == TYPE_VARARGS)) stack_words++; + if (stack_words % 4) output( "\tsubl $%d,%%esp\n", 16 - 4 * (stack_words % 4) ); + + if (args[0] || odp->type == TYPE_VARARGS) + output( "\tmovl 12(%%ebp),%%ecx\n" ); /* args */ + + if (odp->flags & FLAG_REGISTER) + { + output( "\tpushl 16(%%ebp)\n" ); /* context */ + } + else if (odp->type == TYPE_VARARGS) + { + output( "\tleal %d(%%ecx),%%eax\n", argsize ); + output( "\tpushl %%eax\n" ); /* va_list16 */ + } + + pos = (odp->type == TYPE_PASCAL) ? 0 : argsize; + for (i = strlen(args) - 1; i >= 0; i--) + { + switch (args[i]) + { + case 'w': /* word */ + if (odp->type != TYPE_PASCAL) pos -= 2; + output( "\tmovzwl %d(%%ecx),%%eax\n", pos ); + output( "\tpushl %%eax\n" ); + if (odp->type == TYPE_PASCAL) pos += 2; + break; + + case 's': /* s_word */ + if (odp->type != TYPE_PASCAL) pos -= 2; + output( "\tmovswl %d(%%ecx),%%eax\n", pos ); + output( "\tpushl %%eax\n" ); + if (odp->type == TYPE_PASCAL) pos += 2; + break; + + case 'l': /* long or segmented pointer */ + case 'T': /* segmented pointer to null-terminated string */ + if (odp->type != TYPE_PASCAL) pos -= 4; + output( "\tpushl %d(%%ecx)\n", pos ); + if (odp->type == TYPE_PASCAL) pos += 4; + break; + + case 'p': /* linear pointer */ + case 't': /* linear pointer to null-terminated string */ + if (odp->type != TYPE_PASCAL) pos -= 4; + output( "\tmovzwl %d(%%ecx),%%edx\n", pos + 2 ); /* sel */ + output( "\tshr $3,%%edx\n" ); + output( "\tmovzwl %d(%%ecx),%%eax\n", pos ); /* offset */ + output( "\taddl (%%esi,%%edx,4),%%eax\n" ); + output( "\tpushl %%eax\n" ); + if (odp->type == TYPE_PASCAL) pos += 4; + break; + + default: + assert(0); + } + } + + output( "\tcall *8(%%ebp)\n" ); + + if (needs_ldt) output( "\tmovl -4(%%ebp),%%esi\n" ); + + output( "\tleave\n" ); + output( "\tret\n" ); + output_function_size( name ); +} + + +/******************************************************************* + * callfrom16_type_compare + * + * Compare two callfrom16 sequences. + */ +static int callfrom16_type_compare( const void *e1, const void *e2 ) +{ + const ORDDEF *odp1 = *(const ORDDEF * const *)e1; + const ORDDEF *odp2 = *(const ORDDEF * const *)e2; + int retval; + int type1 = odp1->type; + int type2 = odp2->type; + + if (type1 == TYPE_STUB) type1 = TYPE_CDECL; + if (type2 == TYPE_STUB) type2 = TYPE_CDECL; + + if ((retval = type1 - type2) != 0) return retval; + + type1 = odp1->flags & (FLAG_RET16|FLAG_REGISTER); + type2 = odp2->flags & (FLAG_RET16|FLAG_REGISTER); + + if ((retval = type1 - type2) != 0) return retval; + + return strcmp( odp1->u.func.arg_types, odp2->u.func.arg_types ); +} + + +/******************************************************************* + * relay_type_compare + * + * Same as callfrom16_type_compare but ignores differences that don't affect the resulting relay function. + */ +static int relay_type_compare( const void *e1, const void *e2 ) +{ + const ORDDEF *odp1 = *(const ORDDEF * const *)e1; + const ORDDEF *odp2 = *(const ORDDEF * const *)e2; + char name1[80]; + + strcpy( name1, get_relay_name(odp1) ); + return strcmp( name1, get_relay_name(odp2) ); +} + + +/******************************************************************* + * sort_func_list + * + * Sort a list of functions, removing duplicates. + */ +static int sort_func_list( ORDDEF **list, int count, + int (*compare)(const void *, const void *) ) +{ + int i, j; + + if (!count) return 0; + qsort( list, count, sizeof(*list), compare ); + + for (i = j = 0; i < count; i++) + { + if (compare( &list[j], &list[i] )) list[++j] = list[i]; + } + return j + 1; +} + + +/******************************************************************* + * output_init_code + * + * Output the dll initialization code. + */ +static void output_init_code( const DLLSPEC *spec ) +{ + char name[80]; + + sprintf( name, ".L__wine_spec_%s_init", make_c_identifier(spec->dll_name) ); + + output( "\n/* dll initialization code */\n\n" ); + output( "\t.text\n" ); + output( "\t.align 4\n" ); + output( "\t%s\n", func_declaration(name) ); + output( "%s:\n", name ); + output( "\tsubl $4,%%esp\n" ); + if (UsePIC) + { + output( "\tcall %s\n", asm_name("__wine_spec_get_pc_thunk_eax") ); + output( "1:\tleal .L__wine_spec_file_name-1b(%%eax),%%ecx\n" ); + output( "\tpushl %%ecx\n" ); + output( "\tleal .L__wine_spec_dos_header-1b(%%eax),%%ecx\n" ); + output( "\tpushl %%ecx\n" ); + } + else + { + output( "\tpushl $.L__wine_spec_file_name\n" ); + output( "\tpushl $.L__wine_spec_dos_header\n" ); + } + output( "\tcall %s\n", asm_name("__wine_dll_register_16") ); + output( "\taddl $12,%%esp\n" ); + output( "\tret\n" ); + output_function_size( name ); + + sprintf( name, ".L__wine_spec_%s_fini", make_c_identifier(spec->dll_name) ); + + output( "\t.align 4\n" ); + output( "\t%s\n", func_declaration(name) ); + output( "%s:\n", name ); + output( "\tsubl $8,%%esp\n" ); + if (UsePIC) + { + output( "\tcall %s\n", asm_name("__wine_spec_get_pc_thunk_eax") ); + output( "1:\tleal .L__wine_spec_dos_header-1b(%%eax),%%ecx\n" ); + output( "\tpushl %%ecx\n" ); + } + else + { + output( "\tpushl $.L__wine_spec_dos_header\n" ); + } + output( "\tcall %s\n", asm_name("__wine_dll_unregister_16") ); + output( "\taddl $12,%%esp\n" ); + output( "\tret\n" ); + output_function_size( name ); + + if (target_platform == PLATFORM_APPLE) + { + output( "\t.mod_init_func\n" ); + output( "\t.align %d\n", get_alignment(4) ); + output( "\t.long .L__wine_spec_%s_init\n", make_c_identifier(spec->dll_name) ); + output( "\t.mod_term_func\n" ); + output( "\t.align %d\n", get_alignment(4) ); + output( "\t.long .L__wine_spec_%s_fini\n", make_c_identifier(spec->dll_name) ); + } + else + { + output( "\t.section \".init\",\"ax\"\n" ); + output( "\tcall .L__wine_spec_%s_init\n", make_c_identifier(spec->dll_name) ); + output( "\t.section \".fini\",\"ax\"\n" ); + output( "\tcall .L__wine_spec_%s_fini\n", make_c_identifier(spec->dll_name) ); + } +} + + +/******************************************************************* + * output_module16 + * + * Output code for a 16-bit module. + */ +static void output_module16( DLLSPEC *spec ) +{ + ORDDEF **typelist; + ORDDEF *entry_point = NULL; + int i, j, nb_funcs; + + /* store the main entry point as ordinal 0 */ + + if (!spec->ordinals) + { + assert(spec->limit == 0); + spec->ordinals = xmalloc( sizeof(spec->ordinals[0]) ); + spec->ordinals[0] = NULL; + } + if (spec->init_func && !(spec->characteristics & IMAGE_FILE_DLL)) + { + entry_point = xmalloc( sizeof(*entry_point) ); + entry_point->type = TYPE_PASCAL; + entry_point->ordinal = 0; + entry_point->lineno = 0; + entry_point->flags = FLAG_REGISTER; + entry_point->name = NULL; + entry_point->link_name = xstrdup( spec->init_func ); + entry_point->export_name = NULL; + entry_point->u.func.arg_types[0] = 0; + assert( !spec->ordinals[0] ); + spec->ordinals[0] = entry_point; + } + + /* Build sorted list of all argument types, without duplicates */ + + typelist = xmalloc( (spec->limit + 1) * sizeof(*typelist) ); + + for (i = nb_funcs = 0; i <= spec->limit; i++) + { + ORDDEF *odp = spec->ordinals[i]; + if (!odp) continue; + if (is_function( odp )) typelist[nb_funcs++] = odp; + } + + nb_funcs = sort_func_list( typelist, nb_funcs, callfrom16_type_compare ); + + /* Output the module structure */ + + output( "\n/* module data */\n\n" ); + output( "\t.data\n" ); + output( "\t.align %d\n", get_alignment(4) ); + output( ".L__wine_spec_dos_header:\n" ); + output( "\t%s 0x5a4d\n", get_asm_short_keyword() ); /* e_magic */ + output( "\t%s 0\n", get_asm_short_keyword() ); /* e_cblp */ + output( "\t%s 0\n", get_asm_short_keyword() ); /* e_cp */ + output( "\t%s 0\n", get_asm_short_keyword() ); /* e_crlc */ + output( "\t%s 0\n", get_asm_short_keyword() ); /* e_cparhdr */ + output( "\t%s 0\n", get_asm_short_keyword() ); /* e_minalloc */ + output( "\t%s 0\n", get_asm_short_keyword() ); /* e_maxalloc */ + output( "\t%s 0\n", get_asm_short_keyword() ); /* e_ss */ + output( "\t%s 0\n", get_asm_short_keyword() ); /* e_sp */ + output( "\t%s 0\n", get_asm_short_keyword() ); /* e_csum */ + output( "\t%s 0\n", get_asm_short_keyword() ); /* e_ip */ + output( "\t%s 0\n", get_asm_short_keyword() ); /* e_cs */ + output( "\t%s 0\n", get_asm_short_keyword() ); /* e_lfarlc */ + output( "\t%s 0\n", get_asm_short_keyword() ); /* e_ovno */ + output( "\t%s 0,0,0,0\n", get_asm_short_keyword() ); /* e_res */ + output( "\t%s 0\n", get_asm_short_keyword() ); /* e_oemid */ + output( "\t%s 0\n", get_asm_short_keyword() ); /* e_oeminfo */ + output( "\t%s 0,0,0,0,0,0,0,0,0,0\n", get_asm_short_keyword() ); /* e_res2 */ + output( "\t.long .L__wine_spec_ne_header-.L__wine_spec_dos_header\n" );/* e_lfanew */ + + output( ".L__wine_spec_ne_header:\n" ); + output( "\t%s 0x454e\n", get_asm_short_keyword() ); /* ne_magic */ + output( "\t.byte 0\n" ); /* ne_ver */ + output( "\t.byte 0\n" ); /* ne_rev */ + output( "\t%s .L__wine_spec_ne_enttab-.L__wine_spec_ne_header\n", /* ne_enttab */ + get_asm_short_keyword() ); + output( "\t%s .L__wine_spec_ne_enttab_end-.L__wine_spec_ne_enttab\n", /* ne_cbenttab */ + get_asm_short_keyword() ); + output( "\t.long 0\n" ); /* ne_crc */ + output( "\t%s 0x%04x\n", get_asm_short_keyword(), /* ne_flags */ + NE_FFLAGS_SINGLEDATA | + ((spec->characteristics & IMAGE_FILE_DLL) ? NE_FFLAGS_LIBMODULE : 0) ); + output( "\t%s 2\n", get_asm_short_keyword() ); /* ne_autodata */ + output( "\t%s %u\n", get_asm_short_keyword(), spec->heap_size ); /* ne_heap */ + output( "\t%s 0\n", get_asm_short_keyword() ); /* ne_stack */ + if (!entry_point) output( "\t.long 0\n" ); /* ne_csip */ + else output( "\t%s .L__wine_%s_0-.L__wine_spec_code_segment,1\n", + get_asm_short_keyword(), make_c_identifier(spec->dll_name) ); + output( "\t%s 0,2\n", get_asm_short_keyword() ); /* ne_sssp */ + output( "\t%s 2\n", get_asm_short_keyword() ); /* ne_cseg */ + output( "\t%s 0\n", get_asm_short_keyword() ); /* ne_cmod */ + output( "\t%s 0\n", get_asm_short_keyword() ); /* ne_cbnrestab */ + output( "\t%s .L__wine_spec_ne_segtab-.L__wine_spec_ne_header\n", /* ne_segtab */ + get_asm_short_keyword() ); + output( "\t%s .L__wine_spec_ne_rsrctab-.L__wine_spec_ne_header\n", /* ne_rsrctab */ + get_asm_short_keyword() ); + output( "\t%s .L__wine_spec_ne_restab-.L__wine_spec_ne_header\n", /* ne_restab */ + get_asm_short_keyword() ); + output( "\t%s .L__wine_spec_ne_modtab-.L__wine_spec_ne_header\n", /* ne_modtab */ + get_asm_short_keyword() ); + output( "\t%s .L__wine_spec_ne_imptab-.L__wine_spec_ne_header\n", /* ne_imptab */ + get_asm_short_keyword() ); + output( "\t.long 0\n" ); /* ne_nrestab */ + output( "\t%s 0\n", get_asm_short_keyword() ); /* ne_cmovent */ + output( "\t%s 0\n", get_asm_short_keyword() ); /* ne_align */ + output( "\t%s 0\n", get_asm_short_keyword() ); /* ne_cres */ + output( "\t.byte 0x02\n" ); /* ne_exetyp = NE_OSFLAGS_WINDOWS */ + output( "\t.byte 0x08\n" ); /* ne_flagsothers = NE_AFLAGS_FASTLOAD */ + output( "\t%s 0\n", get_asm_short_keyword() ); /* ne_pretthunks */ + output( "\t%s 0\n", get_asm_short_keyword() ); /* ne_psegrefbytes */ + output( "\t%s 0\n", get_asm_short_keyword() ); /* ne_swaparea */ + output( "\t%s 0\n", get_asm_short_keyword() ); /* ne_expver */ + + /* segment table */ + + output( "\n.L__wine_spec_ne_segtab:\n" ); + + /* code segment entry */ + + output( "\t%s .L__wine_spec_code_segment-.L__wine_spec_dos_header\n", /* filepos */ + get_asm_short_keyword() ); + output( "\t%s .L__wine_spec_code_segment_end-.L__wine_spec_code_segment\n", /* size */ + get_asm_short_keyword() ); + output( "\t%s 0x2000\n", get_asm_short_keyword() ); /* flags = NE_SEGFLAGS_32BIT */ + output( "\t%s .L__wine_spec_code_segment_end-.L__wine_spec_code_segment\n", /* minsize */ + get_asm_short_keyword() ); + + /* data segment entry */ + + output( "\t%s .L__wine_spec_data_segment-.L__wine_spec_dos_header\n", /* filepos */ + get_asm_short_keyword() ); + output( "\t%s .L__wine_spec_data_segment_end-.L__wine_spec_data_segment\n", /* size */ + get_asm_short_keyword() ); + output( "\t%s 0x0001\n", get_asm_short_keyword() ); /* flags = NE_SEGFLAGS_DATA */ + output( "\t%s .L__wine_spec_data_segment_end-.L__wine_spec_data_segment\n", /* minsize */ + get_asm_short_keyword() ); + + /* resource directory */ + + output_res16_directory( spec ); + + /* resident names table */ + + output( "\n\t.align %d\n", get_alignment(2) ); + output( ".L__wine_spec_ne_restab:\n" ); + output_resident_name( spec->dll_name, 0 ); + for (i = 1; i <= spec->limit; i++) + { + ORDDEF *odp = spec->ordinals[i]; + if (!odp || !odp->name[0]) continue; + output_resident_name( odp->name, i ); + } + output( "\t.byte 0\n" ); + + /* imported names table */ + + output( "\n\t.align %d\n", get_alignment(2) ); + output( ".L__wine_spec_ne_modtab:\n" ); + output( ".L__wine_spec_ne_imptab:\n" ); + output( "\t.byte 0,0\n" ); + + /* entry table */ + + output( "\n.L__wine_spec_ne_enttab:\n" ); + output_entry_table( spec ); + output( ".L__wine_spec_ne_enttab_end:\n" ); + + /* code segment */ + + output( "\n\t.align %d\n", get_alignment(2) ); + output( ".L__wine_spec_code_segment:\n" ); + + for ( i = 0; i < nb_funcs; i++ ) + { + unsigned int arg_types[2]; + int nop_words, argsize = 0; + + if ( typelist[i]->type == TYPE_PASCAL ) + argsize = get_function_argsize( typelist[i] ); + + /* build the arg types bit fields */ + arg_types[0] = arg_types[1] = 0; + for (j = 0; typelist[i]->u.func.arg_types[j]; j++) + { + int type = 0; + switch(typelist[i]->u.func.arg_types[j]) + { + case 'w': type = ARG_WORD; break; + case 's': type = ARG_SWORD; break; + case 'l': type = ARG_LONG; break; + case 'p': type = ARG_PTR; break; + case 't': type = ARG_STR; break; + case 'T': type = ARG_SEGSTR; break; + } + arg_types[j / 10] |= type << (3 * (j % 10)); + } + if (typelist[i]->type == TYPE_VARARGS) arg_types[j / 10] |= ARG_VARARG << (3 * (j % 10)); + + output( ".L__wine_spec_callfrom16_%s:\n", get_callfrom16_name(typelist[i]) ); + output( "\tpushl $.L__wine_spec_call16_%s\n", get_relay_name(typelist[i]) ); + output( "\tlcall $0,$0\n" ); + + if (typelist[i]->flags & FLAG_REGISTER) + { + nop_words = 4; + } + else if (typelist[i]->flags & FLAG_RET16) + { + output( "\torw %%ax,%%ax\n" ); + output( "\tnop\n" ); /* so that the lretw is aligned */ + nop_words = 2; + } + else + { + output( "\tshld $16,%%eax,%%edx\n" ); + output( "\torl %%eax,%%eax\n" ); + nop_words = 1; + } + + if (argsize) + { + output( "\tlretw $%u\n", argsize ); + nop_words--; + } + else output( "\tlretw\n" ); + + if (nop_words) output( "\t%s\n", nop_sequence[nop_words-1] ); + + /* the movl is here so that the code contains only valid instructions, */ + /* it's never actually executed, we only care about the arg_types[] values */ + output( "\t%s 0x86c7\n", get_asm_short_keyword() ); + output( "\t.long 0x%08x,0x%08x\n", arg_types[0], arg_types[1] ); + } + + for (i = 0; i <= spec->limit; i++) + { + ORDDEF *odp = spec->ordinals[i]; + if (!odp || !is_function( odp )) continue; + output( ".L__wine_%s_%u:\n", make_c_identifier(spec->dll_name), i ); + output( "\tpushw %%bp\n" ); + output( "\tpushl $%s\n", + asm_name( odp->type == TYPE_STUB ? get_stub_name( odp, spec ) : odp->link_name )); + output( "\tcallw .L__wine_spec_callfrom16_%s\n", get_callfrom16_name( odp ) ); + } + output( ".L__wine_spec_code_segment_end:\n" ); + + /* data segment */ + + output( "\n.L__wine_spec_data_segment:\n" ); + output( "\t.byte 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0\n" ); /* instance data */ + for (i = 0; i <= spec->limit; i++) + { + ORDDEF *odp = spec->ordinals[i]; + if (!odp || odp->type != TYPE_VARIABLE) continue; + output( ".L__wine_%s_%u:\n", make_c_identifier(spec->dll_name), i ); + output( "\t.long " ); + for (j = 0; j < odp->u.var.n_values-1; j++) + output( "0x%08x,", odp->u.var.values[j] ); + output( "0x%08x\n", odp->u.var.values[j] ); + } + output( ".L__wine_spec_data_segment_end:\n" ); + + /* resource data */ + + if (spec->nb_resources) + { + output( "\n.L__wine_spec_resource_data:\n" ); + output_res16_data( spec ); + } + + output( "\t.byte 0\n" ); /* make sure the last symbol points to something */ + + /* relay functions */ + + nb_funcs = sort_func_list( typelist, nb_funcs, relay_type_compare ); + if (nb_funcs) + { + output( "\n/* relay functions */\n\n" ); + output( "\t.text\n" ); + for ( i = 0; i < nb_funcs; i++ ) output_call16_function( typelist[i] ); + output( "\t.data\n" ); + output( "wine_ldt_copy_ptr:\n" ); + output( "\t.long %s\n", asm_name("wine_ldt_copy") ); + } + + free( typelist ); +} + + +/******************************************************************* + * BuildSpec16File + * + * Build a Win16 assembly file from a spec file. + */ +void BuildSpec16File( DLLSPEC *spec ) +{ + init_dll_name( spec ); + output_standard_file_header(); + output_module16( spec ); + output_init_code( spec ); + + output( "\n\t%s\n", get_asm_string_section() ); + output( ".L__wine_spec_file_name:\n" ); + output( "\t%s \"%s\"\n", get_asm_string_keyword(), spec->file_name ); + + output_stubs( spec ); + output_get_pc_thunk(); + output_gnu_stack_note(); +} + + +/******************************************************************* + * output_spec16_file + * + * Output the complete data for a spec 16-bit file. + */ +void output_spec16_file( DLLSPEC *spec16 ) +{ + DLLSPEC *spec32 = alloc_dll_spec(); + + init_dll_name( spec16 ); + spec32->file_name = xstrdup( spec16->file_name ); + + if (spec16->characteristics & IMAGE_FILE_DLL) + { + spec32->characteristics = IMAGE_FILE_DLL; + spec32->init_func = xstrdup( "__wine_spec_dll_entry" ); + } + + resolve_imports( spec16 ); + add_16bit_exports( spec32, spec16 ); + + output_standard_file_header(); + output_module( spec32 ); + output_module16( spec16 ); + output_stubs( spec16 ); + output_exports( spec32 ); + output_imports( spec16 ); + if (spec16->main_module) + { + output( "\n\t%s\n", get_asm_string_section() ); + output( ".L__wine_spec_main_module:\n" ); + output( "\t%s \"%s\"\n", get_asm_string_keyword(), spec16->main_module ); + } + output_gnu_stack_note(); + free_dll_spec( spec32 ); +} + +/******************************************************************* + * output_fake_module16 + * + * Create a fake 16-bit binary module. + */ +void output_fake_module16( DLLSPEC *spec ) +{ + static const unsigned char code_segment[] = { 0x90, 0xc3 }; + static const unsigned char data_segment[16] = { 0 }; + static const char fakedll_signature[] = "Wine placeholder DLL"; + const unsigned int cseg = 2; + const unsigned int lfanew = (0x40 + sizeof(fakedll_signature) + 15) & ~15; + const unsigned int segtab = lfanew + 0x40; + + unsigned int i, rsrctab, restab, namelen, modtab, imptab, enttab, cbenttab, codeseg, dataseg, rsrcdata; + + init_dll_name( spec ); + init_output_buffer(); + + rsrctab = lfanew; + restab = segtab + 8 * cseg; + if (spec->nb_resources) + { + output_bin_res16_directory( spec, 0 ); + align_output( 2 ); + rsrctab = restab; + restab += output_buffer_pos; + free( output_buffer ); + init_output_buffer(); + } + + namelen = strlen( spec->dll_name ); + modtab = restab + ((namelen + 3) & ~1); + imptab = modtab; + enttab = modtab + 2; + cbenttab = 1; + codeseg = (enttab + cbenttab + 1) & ~1; + dataseg = codeseg + sizeof(code_segment); + rsrcdata = dataseg + sizeof(data_segment); + + init_output_buffer(); + + put_word( 0x5a4d ); /* e_magic */ + put_word( 0x40 ); /* e_cblp */ + put_word( 0x01 ); /* e_cp */ + put_word( 0 ); /* e_crlc */ + put_word( lfanew / 16 ); /* e_cparhdr */ + put_word( 0x0000 ); /* e_minalloc */ + put_word( 0xffff ); /* e_maxalloc */ + put_word( 0x0000 ); /* e_ss */ + put_word( 0x00b8 ); /* e_sp */ + put_word( 0 ); /* e_csum */ + put_word( 0 ); /* e_ip */ + put_word( 0 ); /* e_cs */ + put_word( lfanew ); /* e_lfarlc */ + put_word( 0 ); /* e_ovno */ + put_dword( 0 ); /* e_res */ + put_dword( 0 ); + put_word( 0 ); /* e_oemid */ + put_word( 0 ); /* e_oeminfo */ + put_dword( 0 ); /* e_res2 */ + put_dword( 0 ); + put_dword( 0 ); + put_dword( 0 ); + put_dword( 0 ); + put_dword( lfanew ); + + put_data( fakedll_signature, sizeof(fakedll_signature) ); + align_output( 16 ); + + put_word( 0x454e ); /* ne_magic */ + put_byte( 0 ); /* ne_ver */ + put_byte( 0 ); /* ne_rev */ + put_word( enttab - lfanew ); /* ne_enttab */ + put_word( cbenttab ); /* ne_cbenttab */ + put_dword( 0 ); /* ne_crc */ + put_word( NE_FFLAGS_SINGLEDATA | /* ne_flags */ + ((spec->characteristics & IMAGE_FILE_DLL) ? NE_FFLAGS_LIBMODULE : 0) ); + put_word( 2 ); /* ne_autodata */ + put_word( spec->heap_size ); /* ne_heap */ + put_word( 0 ); /* ne_stack */ + put_word( 0 ); put_word( 0 ); /* ne_csip */ + put_word( 0 ); put_word( 2 ); /* ne_sssp */ + put_word( cseg ); /* ne_cseg */ + put_word( 0 ); /* ne_cmod */ + put_word( 0 ); /* ne_cbnrestab */ + put_word( segtab - lfanew ); /* ne_segtab */ + put_word( rsrctab - lfanew ); /* ne_rsrctab */ + put_word( restab - lfanew ); /* ne_restab */ + put_word( modtab - lfanew ); /* ne_modtab */ + put_word( imptab - lfanew ); /* ne_imptab */ + put_dword( 0 ); /* ne_nrestab */ + put_word( 0 ); /* ne_cmovent */ + put_word( 0 ); /* ne_align */ + put_word( 0 ); /* ne_cres */ + put_byte( 2 /*NE_OSFLAGS_WINDOWS*/ ); /* ne_exetyp */ + put_byte( 8 /*NE_AFLAGS_FASTLOAD*/ ); /* ne_flagsothers */ + put_word( 0 ); /* ne_pretthunks */ + put_word( 0 ); /* ne_psegrefbytes */ + put_word( 0 ); /* ne_swaparea */ + put_word( 0 ); /* ne_expver */ + + /* segment table */ + put_word( codeseg ); + put_word( sizeof(code_segment) ); + put_word( 0x2000 /* NE_SEGFLAGS_32BIT */ ); + put_word( sizeof(code_segment) ); + put_word( dataseg ); + put_word( sizeof(data_segment) ); + put_word( 0x0001 /* NE_SEGFLAGS_DATA */ ); + put_word( sizeof(data_segment) ); + + /* resource directory */ + if (spec->nb_resources) + { + output_bin_res16_directory( spec, rsrcdata ); + align_output( 2 ); + } + + /* resident names table */ + put_byte( namelen ); + for (i = 0; i < namelen; i++) put_byte( toupper(spec->dll_name[i]) ); + put_byte( 0 ); + align_output( 2 ); + + /* imported names table */ + put_word( 0 ); + + /* entry table */ + put_byte( 0 ); + align_output( 2 ); + + /* code segment */ + put_data( code_segment, sizeof(code_segment) ); + + /* data segment */ + put_data( data_segment, sizeof(data_segment) ); + + /* resource data */ + output_bin_res16_data( spec ); + + flush_output_buffer(); +} diff --git a/tools/winebuild/spec32.c b/tools/winebuild/spec32.c new file mode 100644 index 00000000000..f00ad120937 --- /dev/null +++ b/tools/winebuild/spec32.c @@ -0,0 +1,989 @@ +/* + * 32-bit spec files + * + * Copyright 1993 Robert J. Amstadt + * Copyright 1995 Martin von Loewis + * Copyright 1995, 1996, 1997 Alexandre Julliard + * Copyright 1997 Eric Youngdale + * Copyright 1999 Ulrich Weigand + * + * 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 + */ + +#include "config.h" +#include "wine/port.h" + +#include +#include +#include +#include + +#include "build.h" + +#define IMAGE_FILE_MACHINE_UNKNOWN 0 +#define IMAGE_FILE_MACHINE_I386 0x014c +#define IMAGE_FILE_MACHINE_ALPHA 0x0184 +#define IMAGE_FILE_MACHINE_POWERPC 0x01f0 +#define IMAGE_FILE_MACHINE_AMD64 0x8664 +#define IMAGE_FILE_MACHINE_ARM 0x01C0 + +#define IMAGE_SIZEOF_NT_OPTIONAL32_HEADER 224 +#define IMAGE_SIZEOF_NT_OPTIONAL64_HEADER 240 + +#define IMAGE_NT_OPTIONAL_HDR32_MAGIC 0x10b +#define IMAGE_NT_OPTIONAL_HDR64_MAGIC 0x20b +#define IMAGE_ROM_OPTIONAL_HDR_MAGIC 0x107 + +/* check if entry point needs a relay thunk */ +static inline int needs_relay( const ORDDEF *odp ) +{ + /* skip nonexistent entry points */ + if (!odp) return 0; + /* skip non-functions */ + if ((odp->type != TYPE_STDCALL) && (odp->type != TYPE_CDECL)) return 0; + /* skip norelay and forward entry points */ + if (odp->flags & (FLAG_NORELAY|FLAG_FORWARD)) return 0; + return 1; +} + +/* check if dll will output relay thunks */ +int has_relays( DLLSPEC *spec ) +{ + int i; + + if (target_cpu != CPU_x86 && target_cpu != CPU_x86_64) return 0; + + for (i = spec->base; i <= spec->limit; i++) + { + ORDDEF *odp = spec->ordinals[i]; + if (needs_relay( odp )) return 1; + } + return 0; +} + +/******************************************************************* + * make_internal_name + * + * Generate an internal name for an entry point. Used for stubs etc. + */ +static const char *make_internal_name( const ORDDEF *odp, DLLSPEC *spec, const char *prefix ) +{ + static char buffer[256]; + if (odp->name || odp->export_name) + { + char *p; + sprintf( buffer, "__wine_%s_%s_%s", prefix, spec->file_name, + odp->name ? odp->name : odp->export_name ); + /* make sure name is a legal C identifier */ + for (p = buffer; *p; p++) if (!isalnum(*p) && *p != '_') break; + if (!*p) return buffer; + } + sprintf( buffer, "__wine_%s_%s_%d", prefix, make_c_identifier(spec->file_name), odp->ordinal ); + return buffer; +} + + +/******************************************************************* + * output_relay_debug + * + * Output entry points for relay debugging + */ +static void output_relay_debug( DLLSPEC *spec ) +{ + int i; + unsigned int j, args, flags; + + /* first the table of entry point offsets */ + + output( "\t%s\n", get_asm_rodata_section() ); + output( "\t.align %d\n", get_alignment(4) ); + output( ".L__wine_spec_relay_entry_point_offsets:\n" ); + + for (i = spec->base; i <= spec->limit; i++) + { + ORDDEF *odp = spec->ordinals[i]; + + if (needs_relay( odp )) + output( "\t.long .L__wine_spec_relay_entry_point_%d-__wine_spec_relay_entry_points\n", i ); + else + output( "\t.long 0\n" ); + } + + /* then the table of argument types */ + + output( "\t.align %d\n", get_alignment(4) ); + output( ".L__wine_spec_relay_arg_types:\n" ); + + for (i = spec->base; i <= spec->limit; i++) + { + ORDDEF *odp = spec->ordinals[i]; + unsigned int mask = 0; + + if (needs_relay( odp )) + { + for (j = 0; j < 16 && odp->u.func.arg_types[j]; j++) + { + if (odp->u.func.arg_types[j] == 't') mask |= 1<< (j*2); + if (odp->u.func.arg_types[j] == 'W') mask |= 2<< (j*2); + } + } + output( "\t.long 0x%08x\n", mask ); + } + + /* then the relay thunks */ + + output( "\t.text\n" ); + output( "__wine_spec_relay_entry_points:\n" ); + output( "\tnop\n" ); /* to avoid 0 offset */ + + for (i = spec->base; i <= spec->limit; i++) + { + ORDDEF *odp = spec->ordinals[i]; + + if (!needs_relay( odp )) continue; + + output( "\t.align %d\n", get_alignment(4) ); + output( ".L__wine_spec_relay_entry_point_%d:\n", i ); + + args = strlen(odp->u.func.arg_types); + flags = 0; + + switch (target_cpu) + { + case CPU_x86: + if (odp->flags & FLAG_REGISTER) + output( "\tpushl %%eax\n" ); + else + output( "\tpushl %%esp\n" ); + + if (odp->flags & FLAG_RET64) flags |= 1; + output( "\tpushl $%u\n", (flags << 24) | (args << 16) | (i - spec->base) ); + + if (UsePIC) + { + output( "\tcall %s\n", asm_name("__wine_spec_get_pc_thunk_eax") ); + output( "1:\tleal .L__wine_spec_relay_descr-1b(%%eax),%%eax\n" ); + } + else output( "\tmovl $.L__wine_spec_relay_descr,%%eax\n" ); + output( "\tpushl %%eax\n" ); + + if (odp->flags & FLAG_REGISTER) + { + output( "\tcall *8(%%eax)\n" ); + } + else + { + output( "\tcall *4(%%eax)\n" ); + if (odp->type == TYPE_STDCALL) + output( "\tret $%u\n", args * get_ptr_size() ); + else + output( "\tret\n" ); + } + break; + + case CPU_x86_64: + output( "\t.cfi_startproc\n" ); + output( "\tsubq $40,%%rsp\n" ); + output( "\t.cfi_adjust_cfa_offset 40\n" ); + output( "\tmovq %%rcx,48(%%rsp)\n" ); + output( "\tmovq %%rdx,56(%%rsp)\n" ); + output( "\tmovq %%r8,64(%%rsp)\n" ); + output( "\tmovq %%r9,72(%%rsp)\n" ); + output( "\tleaq 40(%%rsp),%%r8\n" ); + output( "\tmovq $%u,%%rdx\n", (flags << 24) | (args << 16) | (i - spec->base) ); + output( "\tleaq .L__wine_spec_relay_descr(%%rip),%%rcx\n" ); + output( "\tcallq *%u(%%rcx)\n", (odp->flags & FLAG_REGISTER) ? 16 : 8 ); + output( "\taddq $40,%%rsp\n" ); + output( "\t.cfi_adjust_cfa_offset -40\n" ); + output( "\tret\n" ); + output( "\t.cfi_endproc\n" ); + break; + + default: + assert(0); + } + } +} + +/******************************************************************* + * output_exports + * + * Output the export table for a Win32 module. + */ +void output_exports( DLLSPEC *spec ) +{ + int i, fwd_size = 0; + int nr_exports = spec->base <= spec->limit ? spec->limit - spec->base + 1 : 0; + + if (!nr_exports) return; + + output( "\n/* export table */\n\n" ); + output( "\t.data\n" ); + output( "\t.align %d\n", get_alignment(4) ); + output( ".L__wine_spec_exports:\n" ); + + /* export directory header */ + + output( "\t.long 0\n" ); /* Characteristics */ + output( "\t.long 0\n" ); /* TimeDateStamp */ + output( "\t.long 0\n" ); /* MajorVersion/MinorVersion */ + output( "\t.long .L__wine_spec_exp_names-.L__wine_spec_rva_base\n" ); /* Name */ + output( "\t.long %u\n", spec->base ); /* Base */ + output( "\t.long %u\n", nr_exports ); /* NumberOfFunctions */ + output( "\t.long %u\n", spec->nb_names ); /* NumberOfNames */ + output( "\t.long .L__wine_spec_exports_funcs-.L__wine_spec_rva_base\n" ); /* AddressOfFunctions */ + if (spec->nb_names) + { + output( "\t.long .L__wine_spec_exp_name_ptrs-.L__wine_spec_rva_base\n" ); /* AddressOfNames */ + output( "\t.long .L__wine_spec_exp_ordinals-.L__wine_spec_rva_base\n" ); /* AddressOfNameOrdinals */ + } + else + { + output( "\t.long 0\n" ); /* AddressOfNames */ + output( "\t.long 0\n" ); /* AddressOfNameOrdinals */ + } + + /* output the function pointers */ + + output( "\n.L__wine_spec_exports_funcs:\n" ); + for (i = spec->base; i <= spec->limit; i++) + { + ORDDEF *odp = spec->ordinals[i]; + if (!odp) output( "\t%s 0\n", get_asm_ptr_keyword() ); + else switch(odp->type) + { + case TYPE_EXTERN: + case TYPE_STDCALL: + case TYPE_VARARGS: + case TYPE_CDECL: + if (odp->flags & FLAG_FORWARD) + { + output( "\t%s .L__wine_spec_forwards+%u\n", get_asm_ptr_keyword(), fwd_size ); + fwd_size += strlen(odp->link_name) + 1; + } + else if (odp->flags & FLAG_EXT_LINK) + { + output( "\t%s %s_%s\n", + get_asm_ptr_keyword(), asm_name("__wine_spec_ext_link"), odp->link_name ); + } + else + { + output( "\t%s %s\n", get_asm_ptr_keyword(), asm_name(odp->link_name) ); + } + break; + case TYPE_STUB: + output( "\t%s %s\n", get_asm_ptr_keyword(), + asm_name( get_stub_name( odp, spec )) ); + break; + default: + assert(0); + } + } + + if (spec->nb_names) + { + /* output the function name pointers */ + + int namepos = strlen(spec->file_name) + 1; + + output( "\n.L__wine_spec_exp_name_ptrs:\n" ); + for (i = 0; i < spec->nb_names; i++) + { + output( "\t.long .L__wine_spec_exp_names+%u-.L__wine_spec_rva_base\n", namepos ); + namepos += strlen(spec->names[i]->name) + 1; + } + + /* output the function ordinals */ + + output( "\n.L__wine_spec_exp_ordinals:\n" ); + for (i = 0; i < spec->nb_names; i++) + { + output( "\t%s %d\n", + get_asm_short_keyword(), spec->names[i]->ordinal - spec->base ); + } + if (spec->nb_names % 2) + { + output( "\t%s 0\n", get_asm_short_keyword() ); + } + } + + /* output the export name strings */ + + output( "\n.L__wine_spec_exp_names:\n" ); + output( "\t%s \"%s\"\n", get_asm_string_keyword(), spec->file_name ); + for (i = 0; i < spec->nb_names; i++) + output( "\t%s \"%s\"\n", + get_asm_string_keyword(), spec->names[i]->name ); + + /* output forward strings */ + + if (fwd_size) + { + output( "\n.L__wine_spec_forwards:\n" ); + for (i = spec->base; i <= spec->limit; i++) + { + ORDDEF *odp = spec->ordinals[i]; + if (odp && (odp->flags & FLAG_FORWARD)) + output( "\t%s \"%s\"\n", get_asm_string_keyword(), odp->link_name ); + } + } + output( "\t.align %d\n", get_alignment(get_ptr_size()) ); + output( ".L__wine_spec_exports_end:\n" ); + + /* output relays */ + + if (!has_relays( spec )) + { + output( "\t%s 0\n", get_asm_ptr_keyword() ); + return; + } + + output( ".L__wine_spec_relay_descr:\n" ); + output( "\t%s 0xdeb90001\n", get_asm_ptr_keyword() ); /* magic */ + output( "\t%s 0,0\n", get_asm_ptr_keyword() ); /* relay funcs */ + output( "\t%s 0\n", get_asm_ptr_keyword() ); /* private data */ + output( "\t%s __wine_spec_relay_entry_points\n", get_asm_ptr_keyword() ); + output( "\t%s .L__wine_spec_relay_entry_point_offsets\n", get_asm_ptr_keyword() ); + output( "\t%s .L__wine_spec_relay_arg_types\n", get_asm_ptr_keyword() ); + + output_relay_debug( spec ); +} + + +/******************************************************************* + * output_stub_funcs + * + * Output the functions for stub entry points + */ +static void output_stub_funcs( DLLSPEC *spec ) +{ + int i; + +#if 0 + for (i = 0; i < spec->nb_entry_points; i++) + { + ORDDEF *odp = &spec->entry_points[i]; + if (odp->type != TYPE_STUB) continue; + fprintf( outfile, "#ifdef __GNUC__\n" ); + fprintf( outfile, "extern void __wine_spec_unimplemented_stub( const char *module, const char *func ) __attribute__((noreturn));\n" ); + fprintf( outfile, "#else\n" ); + fprintf( outfile, "extern void __wine_spec_unimplemented_stub( const char *module, const char *func );\n" ); + fprintf( outfile, "#endif\n\n" ); + break; + } +#endif + + for (i = 0; i < spec->nb_entry_points; i++) + { + const ORDDEF *odp = &spec->entry_points[i]; + if (odp->type != TYPE_STUB) continue; + output( "void %s(void) ", make_internal_name( odp, spec, "stub" ) ); + if (odp->name) + output( "{ __wine_spec_unimplemented_stub(__wine_spec_file_name, \"%s\"); }\n", odp->name ); + else if (odp->export_name) + output( "{ __wine_spec_unimplemented_stub(__wine_spec_file_name, \"%s\"); }\n", odp->export_name ); + else + output( "{ __wine_spec_unimplemented_stub(__wine_spec_file_name, \"%d\"); }\n", odp->ordinal ); + } +} + + +/******************************************************************* + * output_asm_constructor + * + * Output code for calling a dll constructor. + */ +static void output_asm_constructor( const char *constructor ) +{ + if (target_platform == PLATFORM_APPLE) + { + /* Mach-O doesn't have an init section */ + output( "\n\t.mod_init_func\n" ); + output( "\t.align %d\n", get_alignment(4) ); + output( "\t.long %s\n", asm_name(constructor) ); + } + else + { + output( "\n\t.section \".init\",\"ax\"\n" ); + switch(target_cpu) + { + case CPU_x86: + case CPU_x86_64: + output( "\tcall %s\n", asm_name(constructor) ); + break; + case CPU_SPARC: + output( "\tcall %s\n", asm_name(constructor) ); + output( "\tnop\n" ); + break; + case CPU_ALPHA: + output( "\tjsr $26,%s\n", asm_name(constructor) ); + break; + case CPU_ARM: + output( "\tblx %s\n", asm_name(constructor) ); + break; + case CPU_POWERPC: + output( "\tbl %s\n", asm_name(constructor) ); + break; + } + } +} + + +/******************************************************************* + * output_module + * + * Output the module data. + */ +void output_module( DLLSPEC *spec ) +{ + int machine = 0; + unsigned int page_size = get_page_size(); + + /* Reserve some space for the PE header */ + + switch (target_platform) + { + case PLATFORM_APPLE: + output( "\t.text\n" ); + output( "\t.align %d\n", get_alignment(page_size) ); + output( "__wine_spec_pe_header:\n" ); + output( "\t.space 65536\n" ); + break; + case PLATFORM_SOLARIS: + output( "\n\t.section \".text\",\"ax\"\n" ); + output( "__wine_spec_pe_header:\n" ); + output( "\t.skip %u\n", 65536 + page_size ); + break; + default: + output( "\n\t.section \".init\",\"ax\"\n" ); + switch(target_cpu) + { + case CPU_x86: + case CPU_x86_64: + case CPU_ALPHA: + case CPU_SPARC: + output( "\tjmp 1f\n" ); + break; + case CPU_ARM: + case CPU_POWERPC: + output( "\tb 1f\n" ); + break; + } + output( "__wine_spec_pe_header:\n" ); + output( "\t.skip %u\n", 65536 + page_size ); + output( "1:\n" ); + break; + } + + /* Output the NT header */ + + output( "\n\t.data\n" ); + output( "\t.align %d\n", get_alignment(get_ptr_size()) ); + output( "%s\n", asm_globl("__wine_spec_nt_header") ); + output( ".L__wine_spec_rva_base:\n" ); + + output( "\t.long 0x4550\n" ); /* Signature */ + switch(target_cpu) + { + case CPU_x86: machine = IMAGE_FILE_MACHINE_I386; break; + case CPU_x86_64: machine = IMAGE_FILE_MACHINE_AMD64; break; + case CPU_ARM: machine = IMAGE_FILE_MACHINE_ARM; break; + case CPU_POWERPC: machine = IMAGE_FILE_MACHINE_POWERPC; break; + case CPU_ALPHA: machine = IMAGE_FILE_MACHINE_ALPHA; break; + case CPU_SPARC: machine = IMAGE_FILE_MACHINE_UNKNOWN; break; + } + output( "\t%s 0x%04x\n", /* Machine */ + get_asm_short_keyword(), machine ); + output( "\t%s 0\n", /* NumberOfSections */ + get_asm_short_keyword() ); + output( "\t.long 0\n" ); /* TimeDateStamp */ + output( "\t.long 0\n" ); /* PointerToSymbolTable */ + output( "\t.long 0\n" ); /* NumberOfSymbols */ + output( "\t%s %d\n", /* SizeOfOptionalHeader */ + get_asm_short_keyword(), + get_ptr_size() == 8 ? IMAGE_SIZEOF_NT_OPTIONAL64_HEADER : IMAGE_SIZEOF_NT_OPTIONAL32_HEADER ); + output( "\t%s 0x%04x\n", /* Characteristics */ + get_asm_short_keyword(), spec->characteristics ); + output( "\t%s 0x%04x\n", /* Magic */ + get_asm_short_keyword(), + get_ptr_size() == 8 ? IMAGE_NT_OPTIONAL_HDR64_MAGIC : IMAGE_NT_OPTIONAL_HDR32_MAGIC ); + output( "\t.byte 0\n" ); /* MajorLinkerVersion */ + output( "\t.byte 0\n" ); /* MinorLinkerVersion */ + output( "\t.long 0\n" ); /* SizeOfCode */ + output( "\t.long 0\n" ); /* SizeOfInitializedData */ + output( "\t.long 0\n" ); /* SizeOfUninitializedData */ + /* note: we expand the AddressOfEntryPoint field on 64-bit by overwriting the BaseOfCode field */ + output( "\t%s %s\n", /* AddressOfEntryPoint */ + get_asm_ptr_keyword(), spec->init_func ? asm_name(spec->init_func) : "0" ); + if (get_ptr_size() == 4) + { + output( "\t.long 0\n" ); /* BaseOfCode */ + output( "\t.long 0\n" ); /* BaseOfData */ + } + output( "\t%s __wine_spec_pe_header\n", /* ImageBase */ + get_asm_ptr_keyword() ); + output( "\t.long %u\n", page_size ); /* SectionAlignment */ + output( "\t.long %u\n", page_size ); /* FileAlignment */ + output( "\t%s 1,0\n", /* Major/MinorOperatingSystemVersion */ + get_asm_short_keyword() ); + output( "\t%s 0,0\n", /* Major/MinorImageVersion */ + get_asm_short_keyword() ); + output( "\t%s %u,%u\n", /* Major/MinorSubsystemVersion */ + get_asm_short_keyword(), spec->subsystem_major, spec->subsystem_minor ); + output( "\t.long 0\n" ); /* Win32VersionValue */ + output( "\t.long %s-.L__wine_spec_rva_base\n", /* SizeOfImage */ + asm_name("_end") ); + output( "\t.long %u\n", page_size ); /* SizeOfHeaders */ + output( "\t.long 0\n" ); /* CheckSum */ + output( "\t%s 0x%04x\n", /* Subsystem */ + get_asm_short_keyword(), spec->subsystem ); + output( "\t%s 0x%04x\n", /* DllCharacteristics */ + get_asm_short_keyword(), spec->dll_characteristics ); + output( "\t%s %u,%u\n", /* SizeOfStackReserve/Commit */ + get_asm_ptr_keyword(), (spec->stack_size ? spec->stack_size : 1024) * 1024, page_size ); + output( "\t%s %u,%u\n", /* SizeOfHeapReserve/Commit */ + get_asm_ptr_keyword(), (spec->heap_size ? spec->heap_size : 1024) * 1024, page_size ); + output( "\t.long 0\n" ); /* LoaderFlags */ + output( "\t.long 16\n" ); /* NumberOfRvaAndSizes */ + + if (spec->base <= spec->limit) /* DataDirectory[IMAGE_DIRECTORY_ENTRY_EXPORT] */ + output( "\t.long .L__wine_spec_exports-.L__wine_spec_rva_base," + ".L__wine_spec_exports_end-.L__wine_spec_exports\n" ); + else + output( "\t.long 0,0\n" ); + + if (has_imports()) /* DataDirectory[IMAGE_DIRECTORY_ENTRY_IMPORT] */ + output( "\t.long .L__wine_spec_imports-.L__wine_spec_rva_base," + ".L__wine_spec_imports_end-.L__wine_spec_imports\n" ); + else + output( "\t.long 0,0\n" ); + + if (spec->nb_resources) /* DataDirectory[IMAGE_DIRECTORY_ENTRY_RESOURCE] */ + output( "\t.long .L__wine_spec_resources-.L__wine_spec_rva_base," + ".L__wine_spec_resources_end-.L__wine_spec_resources\n" ); + else + output( "\t.long 0,0\n" ); + + output( "\t.long 0,0\n" ); /* DataDirectory[3] */ + output( "\t.long 0,0\n" ); /* DataDirectory[4] */ + output( "\t.long 0,0\n" ); /* DataDirectory[5] */ + output( "\t.long 0,0\n" ); /* DataDirectory[6] */ + output( "\t.long 0,0\n" ); /* DataDirectory[7] */ + output( "\t.long 0,0\n" ); /* DataDirectory[8] */ + output( "\t.long 0,0\n" ); /* DataDirectory[9] */ + output( "\t.long 0,0\n" ); /* DataDirectory[10] */ + output( "\t.long 0,0\n" ); /* DataDirectory[11] */ + output( "\t.long 0,0\n" ); /* DataDirectory[12] */ + output( "\t.long 0,0\n" ); /* DataDirectory[13] */ + output( "\t.long 0,0\n" ); /* DataDirectory[14] */ + output( "\t.long 0,0\n" ); /* DataDirectory[15] */ + + output( "\n\t%s\n", get_asm_string_section() ); + output( "%s\n", asm_globl("__wine_spec_file_name") ); + output( ".L__wine_spec_file_name:\n" ); + output( "\t%s \"%s\"\n", get_asm_string_keyword(), spec->file_name ); + if (target_platform == PLATFORM_APPLE) + output( "\t.lcomm %s,4\n", asm_name("_end") ); + + output_asm_constructor( "__wine_spec_init_ctor" ); +} + + +/******************************************************************* + * BuildSpec32File + * + * Build a Win32 C file from a spec file. + */ +void BuildSpec32File( DLLSPEC *spec ) +{ + resolve_imports( spec ); + output_standard_file_header(); + output_module( spec ); + output_stubs( spec ); + output_exports( spec ); + output_imports( spec ); + output_resources( spec ); + output_gnu_stack_note(); +} + + +/******************************************************************* + * output_fake_module + * + * Build a fake binary module from a spec file. + */ +void output_fake_module( DLLSPEC *spec ) +{ + static const unsigned char dll_code_section[] = { 0x31, 0xc0, /* xor %eax,%eax */ + 0xc2, 0x0c, 0x00 }; /* ret $12 */ + + static const unsigned char exe_code_section[] = { 0xb8, 0x01, 0x00, 0x00, 0x00, /* movl $1,%eax */ + 0xc2, 0x04, 0x00 }; /* ret $4 */ + + static const char fakedll_signature[] = "Wine placeholder DLL"; + const unsigned int page_size = get_page_size(); + const unsigned int section_align = page_size; + const unsigned int file_align = 0x200; + const unsigned int reloc_size = 8; + const unsigned int lfanew = (0x40 + sizeof(fakedll_signature) + 15) & ~15; + const unsigned int nb_sections = 2 + (spec->nb_resources != 0); + const unsigned int text_size = (spec->characteristics & IMAGE_FILE_DLL) ? + sizeof(dll_code_section) : sizeof(exe_code_section); + unsigned char *resources; + unsigned int resources_size; + unsigned int image_size = 3 * section_align; + + resolve_imports( spec ); + output_bin_resources( spec, 3 * section_align ); + resources = output_buffer; + resources_size = output_buffer_pos; + if (resources_size) image_size += (resources_size + section_align - 1) & ~(section_align - 1); + + init_output_buffer(); + + put_word( 0x5a4d ); /* e_magic */ + put_word( 0x40 ); /* e_cblp */ + put_word( 0x01 ); /* e_cp */ + put_word( 0 ); /* e_crlc */ + put_word( lfanew / 16 ); /* e_cparhdr */ + put_word( 0x0000 ); /* e_minalloc */ + put_word( 0xffff ); /* e_maxalloc */ + put_word( 0x0000 ); /* e_ss */ + put_word( 0x00b8 ); /* e_sp */ + put_word( 0 ); /* e_csum */ + put_word( 0 ); /* e_ip */ + put_word( 0 ); /* e_cs */ + put_word( lfanew ); /* e_lfarlc */ + put_word( 0 ); /* e_ovno */ + put_dword( 0 ); /* e_res */ + put_dword( 0 ); + put_word( 0 ); /* e_oemid */ + put_word( 0 ); /* e_oeminfo */ + put_dword( 0 ); /* e_res2 */ + put_dword( 0 ); + put_dword( 0 ); + put_dword( 0 ); + put_dword( 0 ); + put_dword( lfanew ); + + put_data( fakedll_signature, sizeof(fakedll_signature) ); + align_output( 16 ); + + put_dword( 0x4550 ); /* Signature */ + switch(target_cpu) + { + case CPU_x86: put_word( IMAGE_FILE_MACHINE_I386 ); break; + case CPU_x86_64: put_word( IMAGE_FILE_MACHINE_AMD64 ); break; + case CPU_POWERPC: put_word( IMAGE_FILE_MACHINE_POWERPC ); break; + case CPU_ALPHA: put_word( IMAGE_FILE_MACHINE_ALPHA ); break; + case CPU_SPARC: put_word( IMAGE_FILE_MACHINE_UNKNOWN ); break; + case CPU_ARM: put_word( IMAGE_FILE_MACHINE_ARM ); break; + } + put_word( nb_sections ); /* NumberOfSections */ + put_dword( 0 ); /* TimeDateStamp */ + put_dword( 0 ); /* PointerToSymbolTable */ + put_dword( 0 ); /* NumberOfSymbols */ + put_word( get_ptr_size() == 8 ? + IMAGE_SIZEOF_NT_OPTIONAL64_HEADER : + IMAGE_SIZEOF_NT_OPTIONAL32_HEADER ); /* SizeOfOptionalHeader */ + put_word( spec->characteristics ); /* Characteristics */ + put_word( get_ptr_size() == 8 ? + IMAGE_NT_OPTIONAL_HDR64_MAGIC : + IMAGE_NT_OPTIONAL_HDR32_MAGIC ); /* Magic */ + put_byte( 0 ); /* MajorLinkerVersion */ + put_byte( 0 ); /* MinorLinkerVersion */ + put_dword( text_size ); /* SizeOfCode */ + put_dword( 0 ); /* SizeOfInitializedData */ + put_dword( 0 ); /* SizeOfUninitializedData */ + put_dword( section_align ); /* AddressOfEntryPoint */ + put_dword( section_align ); /* BaseOfCode */ + if (get_ptr_size() == 4) put_dword( 0 ); /* BaseOfData */ + put_pword( 0x10000000 ); /* ImageBase */ + put_dword( section_align ); /* SectionAlignment */ + put_dword( file_align ); /* FileAlignment */ + put_word( 1 ); /* MajorOperatingSystemVersion */ + put_word( 0 ); /* MinorOperatingSystemVersion */ + put_word( 0 ); /* MajorImageVersion */ + put_word( 0 ); /* MinorImageVersion */ + put_word( spec->subsystem_major ); /* MajorSubsystemVersion */ + put_word( spec->subsystem_minor ); /* MinorSubsystemVersion */ + put_dword( 0 ); /* Win32VersionValue */ + put_dword( image_size ); /* SizeOfImage */ + put_dword( file_align ); /* SizeOfHeaders */ + put_dword( 0 ); /* CheckSum */ + put_word( spec->subsystem ); /* Subsystem */ + put_word( spec->dll_characteristics ); /* DllCharacteristics */ + put_pword( (spec->stack_size ? spec->stack_size : 1024) * 1024 ); /* SizeOfStackReserve */ + put_pword( page_size ); /* SizeOfStackCommit */ + put_pword( (spec->heap_size ? spec->heap_size : 1024) * 1024 ); /* SizeOfHeapReserve */ + put_pword( page_size ); /* SizeOfHeapCommit */ + put_dword( 0 ); /* LoaderFlags */ + put_dword( 16 ); /* NumberOfRvaAndSizes */ + + put_dword( 0 ); put_dword( 0 ); /* DataDirectory[IMAGE_DIRECTORY_ENTRY_EXPORT] */ + put_dword( 0 ); put_dword( 0 ); /* DataDirectory[IMAGE_DIRECTORY_ENTRY_IMPORT] */ + if (resources_size) /* DataDirectory[IMAGE_DIRECTORY_ENTRY_RESOURCE] */ + { + put_dword( 3 * section_align ); + put_dword( resources_size ); + } + else + { + put_dword( 0 ); + put_dword( 0 ); + } + + put_dword( 0 ); put_dword( 0 ); /* DataDirectory[IMAGE_DIRECTORY_ENTRY_EXCEPTION] */ + put_dword( 0 ); put_dword( 0 ); /* DataDirectory[IMAGE_DIRECTORY_ENTRY_SECURITY] */ + put_dword( 2 * section_align ); /* DataDirectory[IMAGE_DIRECTORY_ENTRY_BASERELOC] */ + put_dword( reloc_size ); + put_dword( 0 ); put_dword( 0 ); /* DataDirectory[IMAGE_DIRECTORY_ENTRY_DEBUG] */ + put_dword( 0 ); put_dword( 0 ); /* DataDirectory[IMAGE_DIRECTORY_ENTRY_COPYRIGHT] */ + put_dword( 0 ); put_dword( 0 ); /* DataDirectory[IMAGE_DIRECTORY_ENTRY_GLOBALPTR] */ + put_dword( 0 ); put_dword( 0 ); /* DataDirectory[IMAGE_DIRECTORY_ENTRY_TLS] */ + put_dword( 0 ); put_dword( 0 ); /* DataDirectory[IMAGE_DIRECTORY_ENTRY_LOAD_CONFIG] */ + put_dword( 0 ); put_dword( 0 ); /* DataDirectory[IMAGE_DIRECTORY_ENTRY_BOUND_IMPORT] */ + put_dword( 0 ); put_dword( 0 ); /* DataDirectory[IMAGE_DIRECTORY_ENTRY_IAT] */ + put_dword( 0 ); put_dword( 0 ); /* DataDirectory[IMAGE_DIRECTORY_ENTRY_DELAY_IMPORT] */ + put_dword( 0 ); put_dword( 0 ); /* DataDirectory[IMAGE_DIRECTORY_ENTRY_COM_DESCRIPTOR] */ + put_dword( 0 ); put_dword( 0 ); /* DataDirectory[15] */ + + /* .text section */ + put_data( ".text\0\0", 8 ); /* Name */ + put_dword( section_align ); /* VirtualSize */ + put_dword( section_align ); /* VirtualAddress */ + put_dword( text_size ); /* SizeOfRawData */ + put_dword( file_align ); /* PointerToRawData */ + put_dword( 0 ); /* PointerToRelocations */ + put_dword( 0 ); /* PointerToLinenumbers */ + put_word( 0 ); /* NumberOfRelocations */ + put_word( 0 ); /* NumberOfLinenumbers */ + put_dword( 0x60000020 /* CNT_CODE|MEM_EXECUTE|MEM_READ */ ); /* Characteristics */ + + /* .reloc section */ + put_data( ".reloc\0", 8 ); /* Name */ + put_dword( section_align ); /* VirtualSize */ + put_dword( 2 * section_align );/* VirtualAddress */ + put_dword( reloc_size ); /* SizeOfRawData */ + put_dword( 2 * file_align ); /* PointerToRawData */ + put_dword( 0 ); /* PointerToRelocations */ + put_dword( 0 ); /* PointerToLinenumbers */ + put_word( 0 ); /* NumberOfRelocations */ + put_word( 0 ); /* NumberOfLinenumbers */ + put_dword( 0x42000040 /* CNT_INITIALIZED_DATA|MEM_DISCARDABLE|MEM_READ */ ); /* Characteristics */ + + /* .rsrc section */ + if (resources_size) + { + put_data( ".rsrc\0\0", 8 ); /* Name */ + put_dword( (resources_size + section_align - 1) & ~(section_align - 1) ); /* VirtualSize */ + put_dword( 3 * section_align );/* VirtualAddress */ + put_dword( resources_size ); /* SizeOfRawData */ + put_dword( 3 * file_align ); /* PointerToRawData */ + put_dword( 0 ); /* PointerToRelocations */ + put_dword( 0 ); /* PointerToLinenumbers */ + put_word( 0 ); /* NumberOfRelocations */ + put_word( 0 ); /* NumberOfLinenumbers */ + put_dword( 0x40000040 /* CNT_INITIALIZED_DATA|MEM_READ */ ); /* Characteristics */ + } + + /* .text contents */ + align_output( file_align ); + if (spec->characteristics & IMAGE_FILE_DLL) + put_data( dll_code_section, sizeof(dll_code_section) ); + else + put_data( exe_code_section, sizeof(exe_code_section) ); + + /* .reloc contents */ + align_output( file_align ); + put_dword( 0 ); /* VirtualAddress */ + put_dword( 0 ); /* SizeOfBlock */ + + /* .rsrc contents */ + if (resources_size) + { + align_output( file_align ); + put_data( resources, resources_size ); + } + flush_output_buffer(); +} + + +/******************************************************************* + * BuildDef32File + * + * Build a Win32 def file from a spec file. + */ +void BuildDef32File( DLLSPEC *spec ) +{ + const char *name; + int i, total; + + if (spec_file_name) + output( "; File generated automatically from %s; do not edit!\n\n", + spec_file_name ); + else + output( "; File generated automatically; do not edit!\n\n" ); + + output( "LIBRARY %s\n\n", spec->file_name); + output( "EXPORTS\n"); + + /* Output the exports and relay entry points */ + + for (i = total = 0; i < spec->nb_entry_points; i++) + { + const ORDDEF *odp = &spec->entry_points[i]; + int is_data = 0; + + if (!odp) continue; + + if (odp->name) name = odp->name; + else if (odp->export_name) name = odp->export_name; + else continue; + + if (!(odp->flags & FLAG_PRIVATE)) total++; + + switch(odp->type) + { + case TYPE_EXTERN: + is_data = 1; + /* fall through */ + case TYPE_VARARGS: + case TYPE_CDECL: + /* try to reduce output */ + output( " %s", name ); + if(strcmp(name, odp->link_name) || (odp->flags & FLAG_FORWARD)) + output( "=%s", odp->link_name ); + break; + case TYPE_STDCALL: + { + int at_param = strlen(odp->u.func.arg_types) * get_ptr_size(); + output( " %s", name ); + if (!kill_at && target_cpu == CPU_x86) output( "@%d", at_param ); + if (odp->flags & FLAG_FORWARD) + { + output( "=%s", odp->link_name ); + } + else if (strcmp(name, odp->link_name)) /* try to reduce output */ + { + output( "=%s", odp->link_name ); + if (!kill_at && target_cpu == CPU_x86) output( "@%d", at_param ); + } + break; + } + case TYPE_FASTCALL: + { + int at_param = strlen(odp->u.func.arg_types) * get_ptr_size(); + output( " " ); + if (!kill_at) output( "@" ); + output( "%s", name ); + if (!kill_at) output( "@%d", at_param ); + if (odp->flags & FLAG_FORWARD) + { + output( "=" ); + output( "%s", odp->link_name ); + } + else if (strcmp(name, odp->link_name)) /* try to reduce output */ + { + output( "=" ); + if (!kill_at) output( "@" ); + output( "%s", odp->link_name ); + if (!kill_at) output( "@%d", at_param ); + } + break; + } + case TYPE_STUB: + { + output( " %s", name ); + if (!kill_at) + { + const char *check = name + strlen(name); + while (name != check && + '0' <= check[-1] && check[-1] <= '9') + { + check--; + } + if (name != check && check != name + strlen(name) && + '@' == check[-1]) + { + output("%s", check - 1); + } + } + if (odp->name || odp->export_name) + { + output("=%s", make_internal_name( odp, spec, "stub" )); + } + break; + } + default: + assert(0); + } + output( " @%d", odp->ordinal ); + if (!odp->name || (odp->flags & FLAG_ORDINAL)) output( " NONAME" ); + if (is_data) output( " DATA" ); + if (odp->flags & FLAG_PRIVATE) output( " PRIVATE" ); + output( "\n" ); + } + if (!total) warning( "%s: Import library doesn't export anything\n", spec->file_name ); +} + + +/******************************************************************* + * BuildPedllFile + * + * Build a PE DLL C file from a spec file. + */ +void BuildPedllFile( DLLSPEC *spec ) +{ + int i, has_stubs = 0; + + output_standard_file_header(); + + for (i = 0; i < spec->nb_entry_points; i++) + { + const ORDDEF *odp = &spec->entry_points[i]; + if (odp->type == TYPE_STUB) + { + has_stubs = 1; + break; + } + } + + if (!has_stubs) + { + output( "/* This file is intentionally left blank */\n"); + return; + } + + output( "#include \n"); + output( "#include \"windef.h\"\n"); + output( "#include \"winbase.h\"\n"); + output( "#include \"wine/config.h\"\n"); + output( "#include \"wine/exception.h\"\n\n"); + + output( "void __wine_spec_unimplemented_stub( const char *module, const char *function )\n"); + output( "{\n"); + output( " ULONG_PTR args[2];\n"); + output( "\n"); + output( " args[0] = (ULONG_PTR)module;\n"); + output( " args[1] = (ULONG_PTR)function;\n"); + output( " RaiseException( EXCEPTION_WINE_STUB, EH_NONCONTINUABLE, 2, args );\n"); + output( "}\n\n"); + + output( "static const char __wine_spec_file_name[] = \"%s\";\n\n", spec->file_name ); + + /* Output the stub functions */ + output_stub_funcs( spec ); +} diff --git a/tools/winebuild/utils.c b/tools/winebuild/utils.c new file mode 100644 index 00000000000..c0b93710e6c --- /dev/null +++ b/tools/winebuild/utils.c @@ -0,0 +1,995 @@ +/* + * Small utility functions for winebuild + * + * Copyright 2000 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 + */ + +#include "config.h" +#include "wine/port.h" + +#include +#include +#include +#include +#include +#include +#ifdef HAVE_UNISTD_H +# include +#endif +#ifdef HAVE_SYS_STAT_H +# include +#endif +#ifdef HAVE_SYS_MMAN_H +#include +#endif + +#include "build.h" + +#define MAX_TMP_FILES 8 +static const char *tmp_files[MAX_TMP_FILES]; +static unsigned int nb_tmp_files; + +static const struct +{ + const char *name; + enum target_cpu cpu; +} cpu_names[] = +{ + { "i386", CPU_x86 }, + { "i486", CPU_x86 }, + { "i586", CPU_x86 }, + { "i686", CPU_x86 }, + { "i786", CPU_x86 }, + { "x86_64", CPU_x86_64 }, + { "sparc", CPU_SPARC }, + { "alpha", CPU_ALPHA }, + { "powerpc", CPU_POWERPC }, + { "arm", CPU_ARM } +}; + +/* atexit handler to clean tmp files */ +static void cleanup_tmp_files(void) +{ + unsigned int i; + for (i = 0; i < MAX_TMP_FILES; i++) if (tmp_files[i]) unlink( tmp_files[i] ); +} + + +void *xmalloc (size_t size) +{ + void *res; + + res = malloc (size ? size : 1); + if (res == NULL) + { + fprintf (stderr, "Virtual memory exhausted.\n"); + exit (1); + } + return res; +} + +void *xrealloc (void *ptr, size_t size) +{ + void *res = realloc (ptr, size); + if (size && res == NULL) + { + fprintf (stderr, "Virtual memory exhausted.\n"); + exit (1); + } + return res; +} + +char *xstrdup( const char *str ) +{ + char *res = strdup( str ); + if (!res) + { + fprintf (stderr, "Virtual memory exhausted.\n"); + exit (1); + } + return res; +} + +char *strupper(char *s) +{ + char *p; + for (p = s; *p; p++) *p = toupper(*p); + return s; +} + +int strendswith(const char* str, const char* end) +{ + int l = strlen(str); + int m = strlen(end); + return l >= m && strcmp(str + l - m, end) == 0; +} + +void fatal_error( const char *msg, ... ) +{ + va_list valist; + va_start( valist, msg ); + if (input_file_name) + { + fprintf( stderr, "%s:", input_file_name ); + if (current_line) + fprintf( stderr, "%d:", current_line ); + fputc( ' ', stderr ); + } + else fprintf( stderr, "winebuild: " ); + vfprintf( stderr, msg, valist ); + va_end( valist ); + exit(1); +} + +void fatal_perror( const char *msg, ... ) +{ + va_list valist; + va_start( valist, msg ); + if (input_file_name) + { + fprintf( stderr, "%s:", input_file_name ); + if (current_line) + fprintf( stderr, "%d:", current_line ); + fputc( ' ', stderr ); + } + vfprintf( stderr, msg, valist ); + perror( " " ); + va_end( valist ); + exit(1); +} + +void error( const char *msg, ... ) +{ + va_list valist; + va_start( valist, msg ); + if (input_file_name) + { + fprintf( stderr, "%s:", input_file_name ); + if (current_line) + fprintf( stderr, "%d:", current_line ); + fputc( ' ', stderr ); + } + vfprintf( stderr, msg, valist ); + va_end( valist ); + nb_errors++; +} + +void warning( const char *msg, ... ) +{ + va_list valist; + + if (!display_warnings) return; + va_start( valist, msg ); + if (input_file_name) + { + fprintf( stderr, "%s:", input_file_name ); + if (current_line) + fprintf( stderr, "%d:", current_line ); + fputc( ' ', stderr ); + } + fprintf( stderr, "warning: " ); + vfprintf( stderr, msg, valist ); + va_end( valist ); +} + +int output( const char *format, ... ) +{ + int ret; + va_list valist; + + va_start( valist, format ); + ret = vfprintf( output_file, format, valist ); + va_end( valist ); + if (ret < 0) fatal_perror( "Output error" ); + return ret; +} + +/* find a build tool in the path, trying the various names */ +static char *find_tool( const char * const *names ) +{ + static char **dirs; + static unsigned int count, maxlen; + + char *p, *file; + unsigned int i, len; + struct stat st; + + if (!dirs) + { + char *path; + + /* split the path in directories */ + + if (!getenv( "PATH" )) return NULL; + path = xstrdup( getenv( "PATH" )); + for (p = path, count = 2; *p; p++) if (*p == ':') count++; + dirs = xmalloc( count * sizeof(*dirs) ); + count = 0; + dirs[count++] = p = path; + while (*p) + { + while (*p && *p != ':') p++; + if (!*p) break; + *p++ = 0; + dirs[count++] = p; + } + for (i = 0; i < count; i++) maxlen = max( maxlen, strlen(dirs[i])+2 ); + } + + while (*names) + { + len = strlen(*names) + sizeof(EXEEXT) + 1; + file = xmalloc( maxlen + len ); + + for (i = 0; i < count; i++) + { + strcpy( file, dirs[i] ); + p = file + strlen(file); + if (p == file) *p++ = '.'; + if (p[-1] != '/') *p++ = '/'; + strcpy( p, *names ); + strcat( p, EXEEXT ); + + if (!stat( file, &st ) && S_ISREG(st.st_mode) && (st.st_mode & 0111)) return file; + } + free( file ); + names++; + } + return NULL; +} + +const char *get_as_command(void) +{ + if (!as_command) + { + if (target_alias) + { + as_command = xmalloc( strlen(target_alias) + sizeof("-as") ); + strcpy( as_command, target_alias ); + strcat( as_command, "-as" ); + } + else + { + static const char * const commands[] = { "gas", "as", NULL }; + if (!(as_command = find_tool( commands ))) as_command = xstrdup("as"); + } + + if (force_pointer_size) + { + const char *args = (target_platform == PLATFORM_APPLE) ? + ((force_pointer_size == 8) ? " -arch x86_64" : " -arch i386") : + ((force_pointer_size == 8) ? " --64" : " --32"); + as_command = xrealloc( as_command, strlen(as_command) + strlen(args) + 1 ); + strcat( as_command, args ); + } + } + return as_command; +} + +const char *get_ld_command(void) +{ + if (!ld_command) + { + if (target_alias) + { + ld_command = xmalloc( strlen(target_alias) + sizeof("-ld") ); + strcpy( ld_command, target_alias ); + strcat( ld_command, "-ld" ); + } + else + { + static const char * const commands[] = { "ld", "gld", NULL }; + if (!(ld_command = find_tool( commands ))) ld_command = xstrdup("ld"); + } + + if (force_pointer_size) + { + const char *args; + + switch (target_platform) + { + case PLATFORM_APPLE: + args = (force_pointer_size == 8) ? " -arch x86_64" : " -arch i386"; + break; + case PLATFORM_FREEBSD: + args = (force_pointer_size == 8) ? " -m elf_x86_64" : " -m elf_i386_fbsd"; + break; + default: + args = (force_pointer_size == 8) ? " -m elf_x86_64" : " -m elf_i386"; + break; + } + ld_command = xrealloc( ld_command, strlen(ld_command) + strlen(args) + 1 ); + strcat( ld_command, args ); + } + } + return ld_command; +} + +const char *get_nm_command(void) +{ + if (!nm_command) + { + if (target_alias) + { + nm_command = xmalloc( strlen(target_alias) + sizeof("-nm") ); + strcpy( nm_command, target_alias ); + strcat( nm_command, "-nm" ); + } + else + { + static const char * const commands[] = { "nm", "gnm", NULL }; + if (!(nm_command = find_tool( commands ))) nm_command = xstrdup("nm"); + } + } + return nm_command; +} + +const char *get_windres_command(void) +{ + static char *windres_command; + + if (!windres_command) + { + if (target_alias) + { + windres_command = xmalloc( strlen(target_alias) + sizeof("-windres") ); + strcpy( windres_command, target_alias ); + strcat( windres_command, "-windres" ); + } + else + { + static const char * const commands[] = { "windres", NULL }; + if (!(windres_command = find_tool( commands ))) windres_command = xstrdup("windres"); + } + } + return windres_command; +} + +/* get a name for a temp file, automatically cleaned up on exit */ +char *get_temp_file_name( const char *prefix, const char *suffix ) +{ + char *name; + const char *ext; + int fd; + + assert( nb_tmp_files < MAX_TMP_FILES ); + if (!nb_tmp_files && !save_temps) atexit( cleanup_tmp_files ); + + if (!prefix || !prefix[0]) prefix = "winebuild"; + if (!suffix) suffix = ""; + if (!(ext = strchr( prefix, '.' ))) ext = prefix + strlen(prefix); + name = xmalloc( sizeof("/tmp/") + (ext - prefix) + sizeof(".XXXXXX") + strlen(suffix) ); + strcpy( name, "/tmp/" ); + memcpy( name + 5, prefix, ext - prefix ); + strcpy( name + 5 + (ext - prefix), ".XXXXXX" ); + strcat( name, suffix ); + + /* first try without the /tmp/ prefix */ + if ((fd = mkstemps( name + 5, strlen(suffix) )) != -1) + name += 5; + else if ((fd = mkstemps( name, strlen(suffix) )) == -1) + fatal_error( "could not generate a temp file\n" ); + + close( fd ); + tmp_files[nb_tmp_files++] = name; + return name; +} + +/******************************************************************* + * buffer management + * + * Function for reading from/writing to a memory buffer. + */ + +int byte_swapped = 0; +const char *input_buffer_filename; +const unsigned char *input_buffer; +size_t input_buffer_pos; +size_t input_buffer_size; +unsigned char *output_buffer; +size_t output_buffer_pos; +size_t output_buffer_size; + +static void check_output_buffer_space( size_t size ) +{ + if (output_buffer_pos + size >= output_buffer_size) + { + output_buffer_size = max( output_buffer_size * 2, output_buffer_pos + size ); + output_buffer = xrealloc( output_buffer, output_buffer_size ); + } +} + +void init_input_buffer( const char *file ) +{ + int fd; + struct stat st; + + if ((fd = open( file, O_RDONLY | O_BINARY )) == -1) fatal_perror( "Cannot open %s", file ); + if ((fstat( fd, &st ) == -1)) fatal_perror( "Cannot stat %s", file ); + if (!st.st_size) fatal_error( "%s is an empty file\n", file ); +#ifdef HAVE_MMAP + if ((input_buffer = mmap( NULL, st.st_size, PROT_READ, MAP_PRIVATE, fd, 0 )) == (void*)-1) +#endif + { + unsigned char *buffer = xmalloc( st.st_size ); + if (read( fd, buffer, st.st_size ) != st.st_size) fatal_error( "Cannot read %s\n", file ); + input_buffer = buffer; + } + close( fd ); + input_buffer_filename = xstrdup( file ); + input_buffer_size = st.st_size; + input_buffer_pos = 0; + byte_swapped = 0; +} + +void init_output_buffer(void) +{ + output_buffer_size = 1024; + output_buffer_pos = 0; + output_buffer = xmalloc( output_buffer_size ); +} + +void flush_output_buffer(void) +{ + if (fwrite( output_buffer, 1, output_buffer_pos, output_file ) != output_buffer_pos) + fatal_error( "Error writing to %s\n", output_file_name ); + free( output_buffer ); +} + +unsigned char get_byte(void) +{ + if (input_buffer_pos >= input_buffer_size) + fatal_error( "%s is a truncated file\n", input_buffer_filename ); + return input_buffer[input_buffer_pos++]; +} + +unsigned short get_word(void) +{ + unsigned short ret; + + if (input_buffer_pos + sizeof(ret) > input_buffer_size) + fatal_error( "%s is a truncated file\n", input_buffer_filename ); + memcpy( &ret, input_buffer + input_buffer_pos, sizeof(ret) ); + if (byte_swapped) ret = (ret << 8) | (ret >> 8); + input_buffer_pos += sizeof(ret); + return ret; +} + +unsigned int get_dword(void) +{ + unsigned int ret; + + if (input_buffer_pos + sizeof(ret) > input_buffer_size) + fatal_error( "%s is a truncated file\n", input_buffer_filename ); + memcpy( &ret, input_buffer + input_buffer_pos, sizeof(ret) ); + if (byte_swapped) + ret = ((ret << 24) | ((ret << 8) & 0x00ff0000) | ((ret >> 8) & 0x0000ff00) | (ret >> 24)); + input_buffer_pos += sizeof(ret); + return ret; +} + +void put_data( const void *data, size_t size ) +{ + check_output_buffer_space( size ); + memcpy( output_buffer + output_buffer_pos, data, size ); + output_buffer_pos += size; +} + +void put_byte( unsigned char val ) +{ + check_output_buffer_space( 1 ); + output_buffer[output_buffer_pos++] = val; +} + +void put_word( unsigned short val ) +{ + if (byte_swapped) val = (val << 8) | (val >> 8); + put_data( &val, sizeof(val) ); +} + +void put_dword( unsigned int val ) +{ + if (byte_swapped) + val = ((val << 24) | ((val << 8) & 0x00ff0000) | ((val >> 8) & 0x0000ff00) | (val >> 24)); + put_data( &val, sizeof(val) ); +} + +void put_qword( unsigned int val ) +{ + if (byte_swapped) + { + put_dword( 0 ); + put_dword( val ); + } + else + { + put_dword( val ); + put_dword( 0 ); + } +} + +/* pointer-sized word */ +void put_pword( unsigned int val ) +{ + if (get_ptr_size() == 8) put_qword( val ); + else put_dword( val ); +} + +void align_output( unsigned int align ) +{ + size_t size = align - (output_buffer_pos % align); + + if (size == align) return; + check_output_buffer_space( size ); + memset( output_buffer + output_buffer_pos, 0, size ); + output_buffer_pos += size; +} + +/* output a standard header for generated files */ +void output_standard_file_header(void) +{ + if (spec_file_name) + output( "/* File generated automatically from %s; do not edit! */\n", spec_file_name ); + else + output( "/* File generated automatically; do not edit! */\n" ); + output( "/* This file can be copied, modified and distributed without restriction. */\n\n" ); +} + +/* dump a byte stream into the assembly code */ +void dump_bytes( const void *buffer, unsigned int size ) +{ + unsigned int i; + const unsigned char *ptr = buffer; + + if (!size) return; + output( "\t.byte " ); + for (i = 0; i < size - 1; i++, ptr++) + { + if ((i % 16) == 15) output( "0x%02x\n\t.byte ", *ptr ); + else output( "0x%02x,", *ptr ); + } + output( "0x%02x\n", *ptr ); +} + + +/******************************************************************* + * open_input_file + * + * Open a file in the given srcdir and set the input_file_name global variable. + */ +FILE *open_input_file( const char *srcdir, const char *name ) +{ + char *fullname; + FILE *file = fopen( name, "r" ); + + if (!file && srcdir) + { + fullname = xmalloc( strlen(srcdir) + strlen(name) + 2 ); + strcpy( fullname, srcdir ); + strcat( fullname, "/" ); + strcat( fullname, name ); + file = fopen( fullname, "r" ); + } + else fullname = xstrdup( name ); + + if (!file) fatal_error( "Cannot open file '%s'\n", fullname ); + input_file_name = fullname; + current_line = 1; + return file; +} + + +/******************************************************************* + * close_input_file + * + * Close the current input file (must have been opened with open_input_file). + */ +void close_input_file( FILE *file ) +{ + fclose( file ); + free( input_file_name ); + input_file_name = NULL; + current_line = 0; +} + + +/******************************************************************* + * remove_stdcall_decoration + * + * Remove a possible @xx suffix from a function name. + * Return the numerical value of the suffix, or -1 if none. + */ +int remove_stdcall_decoration( char *name ) +{ + char *p, *end = strrchr( name, '@' ); + if (!end || !end[1] || end == name) return -1; + /* make sure all the rest is digits */ + for (p = end + 1; *p; p++) if (!isdigit(*p)) return -1; + *end = 0; + return atoi( end + 1 ); +} + + +/******************************************************************* + * assemble_file + * + * Run a file through the assembler. + */ +void assemble_file( const char *src_file, const char *obj_file ) +{ + const char *prog = get_as_command(); + char *cmd; + int err; + + cmd = xmalloc( strlen(prog) + strlen(obj_file) + strlen(src_file) + 6 ); + sprintf( cmd, "%s -o %s %s", prog, obj_file, src_file ); + if (verbose) fprintf( stderr, "%s\n", cmd ); + err = system( cmd ); + if (err) fatal_error( "%s failed with status %d\n", prog, err ); + free( cmd ); +} + + +/******************************************************************* + * alloc_dll_spec + * + * Create a new dll spec file descriptor + */ +DLLSPEC *alloc_dll_spec(void) +{ + DLLSPEC *spec; + + spec = xmalloc( sizeof(*spec) ); + spec->file_name = NULL; + spec->dll_name = NULL; + spec->init_func = NULL; + spec->main_module = NULL; + spec->type = SPEC_WIN32; + spec->base = MAX_ORDINALS; + spec->limit = 0; + spec->stack_size = 0; + spec->heap_size = 0; + spec->nb_entry_points = 0; + spec->alloc_entry_points = 0; + spec->nb_names = 0; + spec->nb_resources = 0; + spec->characteristics = IMAGE_FILE_EXECUTABLE_IMAGE; + if (get_ptr_size() > 4) + spec->characteristics |= IMAGE_FILE_LARGE_ADDRESS_AWARE; + else + spec->characteristics |= IMAGE_FILE_32BIT_MACHINE; + spec->dll_characteristics = IMAGE_DLLCHARACTERISTICS_NX_COMPAT; + spec->subsystem = 0; + spec->subsystem_major = 4; + spec->subsystem_minor = 0; + spec->entry_points = NULL; + spec->names = NULL; + spec->ordinals = NULL; + spec->resources = NULL; + return spec; +} + + +/******************************************************************* + * free_dll_spec + * + * Free dll spec file descriptor + */ +void free_dll_spec( DLLSPEC *spec ) +{ + int i; + + for (i = 0; i < spec->nb_entry_points; i++) + { + ORDDEF *odp = &spec->entry_points[i]; + free( odp->name ); + free( odp->export_name ); + free( odp->link_name ); + } + free( spec->file_name ); + free( spec->dll_name ); + free( spec->init_func ); + free( spec->entry_points ); + free( spec->names ); + free( spec->ordinals ); + free( spec->resources ); + free( spec ); +} + + +/******************************************************************* + * make_c_identifier + * + * Map a string to a valid C identifier. + */ +const char *make_c_identifier( const char *str ) +{ + static char buffer[256]; + char *p; + + for (p = buffer; *str && p < buffer+sizeof(buffer)-1; p++, str++) + { + if (isalnum(*str)) *p = *str; + else *p = '_'; + } + *p = 0; + return buffer; +} + + +/******************************************************************* + * get_stub_name + * + * Generate an internal name for a stub entry point. + */ +const char *get_stub_name( const ORDDEF *odp, const DLLSPEC *spec ) +{ + static char buffer[256]; + if (odp->name || odp->export_name) + { + char *p; + sprintf( buffer, "__wine_stub_%s", odp->name ? odp->name : odp->export_name ); + /* make sure name is a legal C identifier */ + for (p = buffer; *p; p++) if (!isalnum(*p) && *p != '_') break; + if (!*p) return buffer; + } + sprintf( buffer, "__wine_stub_%s_%d", make_c_identifier(spec->file_name), odp->ordinal ); + return buffer; +} + +/* parse a cpu name and return the corresponding value */ +enum target_cpu get_cpu_from_name( const char *name ) +{ + unsigned int i; + + for (i = 0; i < sizeof(cpu_names)/sizeof(cpu_names[0]); i++) + if (!strcmp( cpu_names[i].name, name )) return cpu_names[i].cpu; + return -1; +} + +/***************************************************************** + * Function: get_alignment + * + * Description: + * According to the info page for gas, the .align directive behaves + * differently on different systems. On some architectures, the + * argument of a .align directive is the number of bytes to pad to, so + * to align on an 8-byte boundary you'd say + * .align 8 + * On other systems, the argument is "the number of low-order zero bits + * that the location counter must have after advancement." So to + * align on an 8-byte boundary you'd say + * .align 3 + * + * The reason gas is written this way is that it's trying to mimick + * native assemblers for the various architectures it runs on. gas + * provides other directives that work consistently across + * architectures, but of course we want to work on all arches with or + * without gas. Hence this function. + * + * + * Parameters: + * align -- the number of bytes to align to. Must be a power of 2. + */ +unsigned int get_alignment(unsigned int align) +{ + unsigned int n; + + assert( !(align & (align - 1)) ); + + switch(target_cpu) + { + case CPU_x86: + case CPU_x86_64: + case CPU_SPARC: + case CPU_ARM: + if (target_platform != PLATFORM_APPLE) return align; + /* fall through */ + case CPU_POWERPC: + case CPU_ALPHA: + n = 0; + while ((1u << n) != align) n++; + return n; + } + /* unreached */ + assert(0); + return 0; +} + +/* return the page size for the target CPU */ +unsigned int get_page_size(void) +{ + switch(target_cpu) + { + case CPU_x86: return 4096; + case CPU_x86_64: return 4096; + case CPU_POWERPC: return 4096; + case CPU_ARM: return 4096; + case CPU_SPARC: return 8192; + case CPU_ALPHA: return 8192; + } + /* unreached */ + assert(0); + return 0; +} + +/* return the size of a pointer on the target CPU */ +unsigned int get_ptr_size(void) +{ + switch(target_cpu) + { + case CPU_x86: + case CPU_POWERPC: + case CPU_SPARC: + case CPU_ALPHA: + case CPU_ARM: + return 4; + case CPU_x86_64: + return 8; + } + /* unreached */ + assert(0); + return 0; +} + +/* return the assembly name for a C symbol */ +const char *asm_name( const char *sym ) +{ + static char buffer[256]; + + switch (target_platform) + { + case PLATFORM_APPLE: + case PLATFORM_WINDOWS: + if (sym[0] == '.' && sym[1] == 'L') return sym; + buffer[0] = '_'; + strcpy( buffer + 1, sym ); + return buffer; + default: + return sym; + } +} + +/* return an assembly function declaration for a C function name */ +const char *func_declaration( const char *func ) +{ + static char buffer[256]; + + switch (target_platform) + { + case PLATFORM_APPLE: + return ""; + case PLATFORM_WINDOWS: + sprintf( buffer, ".def _%s; .scl 2; .type 32; .endef", func ); + break; + default: + switch(target_cpu) + { + case CPU_ARM: + sprintf( buffer, ".type %s,%%function", func ); + break; + default: + sprintf( buffer, ".type %s,@function", func ); + break; + } + break; + } + return buffer; +} + +/* output a size declaration for an assembly function */ +void output_function_size( const char *name ) +{ + switch (target_platform) + { + case PLATFORM_APPLE: + case PLATFORM_WINDOWS: + break; + default: + output( "\t.size %s, .-%s\n", name, name ); + break; + } +} + +/* output the GNU note for non-exec stack */ +void output_gnu_stack_note(void) +{ + switch (target_platform) + { + case PLATFORM_WINDOWS: + case PLATFORM_APPLE: + break; + default: + switch(target_cpu) + { + case CPU_ARM: + output( "\t.section .note.GNU-stack,\"\",%%progbits\n" ); + break; + default: + output( "\t.section .note.GNU-stack,\"\",@progbits\n" ); + break; + } + break; + } +} + +/* return a global symbol declaration for an assembly symbol */ +const char *asm_globl( const char *func ) +{ + static char buffer[256]; + + switch (target_platform) + { + case PLATFORM_APPLE: + sprintf( buffer, "\t.globl _%s\n\t.private_extern _%s\n_%s:", func, func, func ); + return buffer; + case PLATFORM_WINDOWS: + sprintf( buffer, "\t.globl _%s\n_%s:", func, func ); + return buffer; + default: + sprintf( buffer, "\t.globl %s\n\t.hidden %s\n%s:", func, func, func ); + return buffer; + } +} + +const char *get_asm_ptr_keyword(void) +{ + switch(get_ptr_size()) + { + case 4: return ".long"; + case 8: return ".quad"; + } + assert(0); + return NULL; +} + +const char *get_asm_string_keyword(void) +{ + switch (target_platform) + { + case PLATFORM_APPLE: + return ".asciz"; + default: + return ".string"; + } +} + +const char *get_asm_short_keyword(void) +{ + switch (target_platform) + { + default: return ".short"; + } +} + +const char *get_asm_rodata_section(void) +{ + switch (target_platform) + { + case PLATFORM_APPLE: return ".const"; + default: return ".section .rodata"; + } +} + +const char *get_asm_string_section(void) +{ + switch (target_platform) + { + case PLATFORM_APPLE: return ".cstring"; + default: return ".section .rodata"; + } +} diff --git a/tools/winebuild/winebuild.man.in b/tools/winebuild/winebuild.man.in new file mode 100644 index 00000000000..d41fae7a8c9 --- /dev/null +++ b/tools/winebuild/winebuild.man.in @@ -0,0 +1,491 @@ +.\" -*- nroff -*- +.TH WINEBUILD 1 "October 2005" "@PACKAGE_STRING@" "Wine Developers Manual" +.SH NAME +winebuild \- Wine dll builder +.SH SYNOPSIS +.BI winebuild\ [options]\ [input\ files] +.SH DESCRIPTION +.B winebuild +generates the assembly files that are necessary to build a Wine dll, +which is basically a Win32 dll encapsulated inside a Unix library. +.PP +.B winebuild +has different modes, depending on what kind of file it is asked to +generate. The mode is specified by one of the mode options specified +below. In addition to the mode option, various other command-line +option can be specified, as described in the \fBOPTIONS\fR section. +.SH "MODE OPTIONS" +You have to specify exactly one of the following options, depending on +what you want winebuild to generate. +.TP +.BI \--dll +Build an assembly file from a .spec file (see \fBSPEC FILE SYNTAX\fR +for details), or from a standard Windows .def file. The .spec/.def +file is specified via the -E option. The resulting file must be +assembled and linked to the other object files to build a working Wine +dll. In this mode, the +.I input files +should be the list of all object files that will be linked into the +final dll, to allow +.B winebuild +to get the list of all undefined symbols that need to be imported from +other dlls. +.TP +.BI \--exe +Build an assembly file for an executable. This is basically the same as +the --dll mode except that it doesn't require a .spec/.def file as input, +since an executable need not export functions. Some executables however +do export functions, and for those a .spec/.def file can be specified via +the -E option. The executable is named from the .spec/.def file name if +present, or explicitly through the -F option. The resulting file must be +assembled and linked to the other object files to build a working Wine +executable, and all the other object files must be listed as +.I input files. +.TP +.BI \--def +Build a .def file from a spec file. The .spec file is specified via the +-E option. This is used when building dlls with a PE (Win32) compiler. +.TP +.B \--relay16 +Generate the assembly code for the 16-bit relay routines. This is for +Wine internal usage only, you should never need to use this option. +.TP +.B \--relay32 +Generate the assembly code for the 32-bit relay routines. This is for +Wine internal usage only, you should never need to use this option. +.TP +.B \--resources +Generate a .o file containing all the input resources. This is useful +when building with a PE compiler, since the PE binutils cannot handle +multiple resource files as input. For a standard Unix build, the +resource files are automatically included when building the spec file, +so there's no need for an intermediate .o file. +.SH OPTIONS +.TP +.BI \--as-cmd= as-command +Specify the command to use to compile assembly files; the default is +\fBas\fR. +.TP +.BI \-b,\ --target= cpu-manufacturer[-kernel]-os +Specify the target CPU and platform on which the generated code will +be built. The target specification is in the standard autoconf format +as returned by config.sub. +.TP +.BI \-d,\ --delay-lib= name +Set the delayed import mode for the specified library, which must be +one of the libraries imported with the \fB-l\fR option. Delayed mode +means that the library won't be loaded until a function imported from +it is actually called. +.TP +.BI \-D\ symbol +Ignored for compatibility with the C compiler. +.TP +.BI \-e,\ --entry= function +Specify the module entry point function; if not specified, the default +is +.B DllMain +for dlls, and +.B main +for executables (if the standard C +.B main +is not defined, +.B WinMain +is used instead). This is only valid for Win32 modules. +.TP +.BI \-E,\ --export= filename +Specify a .spec file (see \fBSPEC FILE SYNTAX\fR for details), +or a standard Windows .def file that defines the exports +of the DLL or executable that is being built. +.TP +.B \--external-symbols +Allow linking to external symbols directly from the spec +file. Normally symbols exported by a dll have to be defined in the dll +itself; this option makes it possible to use symbols defined in +another Unix library (for symbols defined in another dll, a +.I forward +specification must be used instead). +.TP +.BI \-f\ flags +Ignored for compatibility with the C compiler. +.TP +.B \--fake-module +Create a fake PE module for a dll or exe, instead of the normal +assembly or object file. The PE module contains the resources for the +module, but no executable code. +.TP +.BI \-F,\ --filename= filename +Set the file name of the module. The default is to use the base name +of the spec file (without any extension). +.TP +.B \-h, --help +Display a usage message and exit. +.TP +.BI \-H,\ --heap= size +Specify the size of the module local heap in bytes (only valid for +Win16 modules); default is no local heap. +.TP +.BI \-i,\ --ignore= [-]symbol[,[-]symbol] +Specify a list of symbols that should be ignored when resolving +undefined symbols against the imported libraries. This forces these +symbols to be resolved from the Unix C library (or from another Unix +library linked with the application). If a symbol is prefixed by '-' +it is removed from the list instead of being added; a stand-alone '-' +clears the whole list. +.TP +.BI \-I\ directory +Ignored for compatibility with the C compiler. +.TP +.B \-k, --kill-at +Remove the stdcall decorations from the symbol names in the +generated .def file. Only meaningful in \fB--def\fR mode. +.TP +.BI \-K\ flags +Ignored for compatibility with the C compiler. +.TP +.BI \--large-address-aware +Set a flag in the executable to notify the loader that this +application supports address spaces larger than 2 gigabytes. +.TP +.BI \--ld-cmd= ld-command +Specify the command to use to link the object files; the default is +\fBld\fR. +.TP +.BI \-L,\ --library-path= directory +Append the specified directory to the list of directories that are +searched for import libraries. +.TP +.BI \-l,\ --library= name +Import the specified library, looking for a corresponding +\fIlibname.def\fR file in the directories specified with the \fB-L\fR +option. +.TP +.B \-m32, -m64 +Generate 32-bit, respectively 64-bit code. +.TP +.BI \-M,\ --main-module= module +Specify that we are building a 16-bit dll, that will ultimately be +linked together with the 32-bit dll specified in \fImodule\fR. Only +meaningful in \fB--dll\fR mode. +.TP +.BI \-N,\ --dll-name= dllname +Set the internal name of the module. It is only used in Win16 +modules. The default is to use the base name of the spec file (without +any extension). This is used for KERNEL, since it lives in +KRNL386.EXE. It shouldn't be needed otherwise. +.TP +.BI \--nm-cmd= nm-command +Specify the command to use to get the list of undefined symbols; the +default is \fBnm\fR. +.TP +.BI --nxcompat= yes|no +Specify whether the module is compatible with no-exec support. The +default is yes. +.TP +.BI \-o,\ --output= file +Set the name of the output file (default is standard output). If the +output file name end in \fB.o\fR, the text output is sent to a +temporary file that is then assembled to produce the specified .o +file. +.TP +.BI \-r,\ --res= rsrc.res +Load resources from the specified binary resource file. The +\fIrsrc.res\fR file can be produced from a source resource file with +.BR wrc(1) +(or with a Windows resource compiler). +.br +This option is only necessary for Win16 resource files, the Win32 ones +can simply listed as +.I input files +and will automatically be handled correctly (though the +.B \-r +option will also work for Win32 files). +.TP +.B --save-temps +Do not delete the various temporary files that \fBwinebuild\fR generates. +.TP +.BI --subsystem= subsystem[:major[.minor]] +Set the subsystem of the executable, which can be one of the following: +.br +.B console +for a command line executable, +.br +.B windows +for a graphical executable, +.br +.B native +for a native-mode dll, +.br +.B win16 +for a 16-bit module. +.br +The entry point of a command line executable is a normal C \fBmain\fR +function. A \fBwmain\fR function can be used instead if you need the +argument array to use Unicode strings. A graphical executable has a +\fBWinMain\fR entry point. +.br +Optionally a major and minor subsystem version can also be specified; +the default subsystem version is 4.0. +.TP +.BI \-u,\ --undefined= symbol +Add \fIsymbol\fR to the list of undefined symbols when invoking the +linker. This makes it possible to force a specific module of a static +library to be included when resolving imports. +.TP +.B \-v, --verbose +Display the various subcommands being invoked by +.B winebuild. +.TP +.B \--version +Display the program version and exit. +.TP +.B \-w, --warnings +Turn on warnings. +.SH "SPEC FILE SYNTAX" +.SS "General syntax" +A spec file should contain a list of ordinal declarations. The general +syntax is the following: +.PP +.I ordinal functype +.RI [ flags ]\ exportname \ \fB(\fR\ [ args... ] \ \fB) \ [ handler ] +.br +.IB ordinal\ variable +.RI [ flags ]\ exportname \ \fB(\fR\ [ data... ] \ \fB) +.br +.IB ordinal\ extern +.RI [ flags ]\ exportname \ [ symbolname ] +.br +.IB ordinal\ stub +.RI [ flags ]\ exportname +.br +.IB ordinal\ equate +.RI [ flags ]\ exportname\ data +.br +.BI #\ comments +.PP +Declarations must fit on a single line, except if the end of line is +escaped using a backslash character. The +.B # +character anywhere in a line causes the rest of the line to be ignored +as a comment. +.PP +.I ordinal +specifies the ordinal number corresponding to the entry point, or '@' +for automatic ordinal allocation (Win32 only). +.PP +.I flags +is a series of optional flags, preceded by a '-' character. The +supported flags are: +.RS +.TP +.B -norelay +The entry point is not displayed in relay debugging traces (Win32 +only). +.TP +.B -noname +The entry point will be exported by ordinal instead of by name. The +name is still available for importing. +.TP +.B -ret16 +The function returns a 16-bit value (Win16 only). +.TP +.B -ret64 +The function returns a 64-bit value (Win32 only). +.TP +.B -register +The function uses CPU register to pass arguments. +.TP +.B -private +The function cannot be imported from other dlls, it can only be +accessed through GetProcAddress. +.TP +.B -ordinal +The entry point will be imported by ordinal instead of by name. The +name is still exported. +.TP +.BI -arch= cpu[,cpu] +The entry point is only available on the specified CPU architecture(s). +.SS "Function ordinals" +Syntax: +.br +.I ordinal functype +.RI [ flags ]\ exportname \ \fB(\fR\ [ args... ] \ \fB) \ [ handler ] +.br + +This declaration defines a function entry point. The prototype defined by +.IR exportname \ \fB(\fR\ [ args... ] \ \fB) +specifies the name available for dynamic linking and the format of the +arguments. '@' can be used instead of +.I exportname +for ordinal-only exports. +.PP +.I functype +should be one of: +.RS +.TP +.B stdcall +for a normal Win32 function +.TP +.B pascal +for a normal Win16 function +.TP +.B cdecl +for a Win16 or Win32 function using the C calling convention +.TP +.B varargs +for a Win16 or Win32 function using the C calling convention with a +variable number of arguments +.RE +.PP +.I args +should be one or several of: +.RS +.TP +.B word +(16-bit unsigned value) +.TP +.B s_word +(16-bit signed word) +.TP +.B long +(32-bit value) +.TP +.B double +(64-bit value) +.TP +.B ptr +(linear pointer) +.TP +.B str +(linear pointer to a null-terminated ASCII string) +.TP +.B wstr +(linear pointer to a null-terminated Unicode string) +.TP +.B segptr +(segmented pointer) +.TP +.B segstr +(segmented pointer to a null-terminated ASCII string). +.HP +.RB Only\ ptr ,\ str ,\ wstr ,\ long\ and\ double +are valid for Win32 functions. +.RE +.PP +.I handler +is the name of the actual C function that will implement that entry +point in 32-bit mode. The handler can also be specified as +.IB dllname . function +to define a forwarded function (one whose implementation is in another +dll). If +.I handler +is not specified, it is assumed to be identical to +.I exportname. +.PP +This first example defines an entry point for the 32-bit GetFocus() +call: +.IP +@ stdcall GetFocus() GetFocus +.PP +This second example defines an entry point for the 16-bit +CreateWindow() call (the ordinal 100 is just an example); it also +shows how long lines can be split using a backslash: +.IP +100 pascal CreateWindow(ptr ptr long s_word s_word s_word \\ + s_word word word word ptr) WIN_CreateWindow +.PP +To declare a function using a variable number of arguments, specify +the function as +.B varargs +and declare it in the C file with a '...' parameter for a Win32 +function, or with an extra VA_LIST16 argument for a Win16 function. +See the wsprintf* functions in user.exe.spec and user32.spec for an +example. +.SS "Variable ordinals" +Syntax: +.br +.IB ordinal\ variable +.RI [ flags ]\ exportname \ \fB(\fR\ [ data... ] \ \fB) +.PP +This declaration defines data storage as 32-bit words at the ordinal +specified. +.I exportname +will be the name available for dynamic +linking. +.I data +can be a decimal number or a hex number preceded by "0x". The +following example defines the variable VariableA at ordinal 2 and +containing 4 ints: +.IP +2 variable VariableA(-1 0xff 0 0) +.PP +This declaration only works in Win16 spec files. In Win32 you should +use +.B extern +instead (see below). +.SS "Extern ordinals" +Syntax: +.br +.IB ordinal\ extern +.RI [ flags ]\ exportname \ [ symbolname ] +.PP +This declaration defines an entry that simply maps to a C symbol +(variable or function). It only works in Win32 spec files. +.I exportname +will point to the symbol +.I symbolname +that must be defined in the C code. Alternatively, it can be of the +form +.IB dllname . symbolname +to define a forwarded symbol (one whose implementation is in another +dll). If +.I symbolname +is not specified, it is assumed to be identical to +.I exportname. +.SS "Stub ordinals" +Syntax: +.br +.IB ordinal\ stub +.RI [ flags ]\ exportname +.PP +This declaration defines a stub function. It makes the name and +ordinal available for dynamic linking, but will terminate execution +with an error message if the function is ever called. +.SS "Equate ordinals" +Syntax: +.br +.IB ordinal\ equate +.RI [ flags ]\ exportname\ data +.PP +This declaration defines an ordinal as an absolute value. +.I exportname +will be the name available for dynamic linking. +.I data +can be a decimal number or a hex number preceded by "0x". +.SH AUTHORS +.B winebuild +has been worked on by many people over the years. The main authors are +Robert J. Amstadt, Alexandre Julliard, Martin von Loewis, Ulrich +Weigand and Eric Youngdale. Many other Wine developers have +contributed, please check the file Changelog in the Wine distribution +for the complete details. +.SH BUGS +It is not yet possible to use a PE-format dll in an import +specification; only Wine dlls can be imported. +.PP +If you find a bug, please submit a bug report at +.UR http://bugs.winehq.org +.B http://bugs.winehq.org. +.UE +.SH AVAILABILITY +.B winebuild +is part of the wine distribution, which is available through WineHQ, +the +.B wine +development headquarters, at +.UR http://www.winehq.org/ +.B http://www.winehq.org/. +.UE +.SH "SEE ALSO" +.BR wine (1), +.BR winegcc (1), +.BR wrc (1). diff --git a/tools/winebuild/winebuild.rbuild b/tools/winebuild/winebuild.rbuild new file mode 100644 index 00000000000..a8862149e29 --- /dev/null +++ b/tools/winebuild/winebuild.rbuild @@ -0,0 +1,14 @@ + + + + import.c + main.c + parser.c + relay.c + res16.c + res32.c + spec16.c + spec32.c + utils.c + mkstemps.c + diff --git a/tools/wmc/wmc.rbuild b/tools/wmc/wmc.rbuild new file mode 100644 index 00000000000..9dd4eade4ec --- /dev/null +++ b/tools/wmc/wmc.rbuild @@ -0,0 +1,11 @@ + + + + unicode + lang.c + mcl.c + utils.c + wmc.c + write.c + mcy.tab.c + diff --git a/tools/wpp/wpp.rbuild b/tools/wpp/wpp.rbuild new file mode 100644 index 00000000000..360aae86b7b --- /dev/null +++ b/tools/wpp/wpp.rbuild @@ -0,0 +1,8 @@ + + + + lex.yy.c + preproc.c + wpp.c + ppy.tab.c + diff --git a/tools/wrc/wrc.rbuild b/tools/wrc/wrc.rbuild new file mode 100644 index 00000000000..0bbfb1cfe82 --- /dev/null +++ b/tools/wrc/wrc.rbuild @@ -0,0 +1,19 @@ + + + + unicode + wpp + dumpres.c + genres.c + newstruc.c + readres.c + translation.c + utils.c + wrc.c + writeres.c + parser.tab.c + lex.yy.c + + mkstemps.c + + diff --git a/tools/xml.cpp b/tools/xml.cpp new file mode 100644 index 00000000000..8400ce131ed --- /dev/null +++ b/tools/xml.cpp @@ -0,0 +1,966 @@ +/* + * Copyright (C) 2005 Casper S. Hornstrup + * + * This program is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation; either version 2 of the License, or + * (at your option) any later version. + * + * This program 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 General Public License for more details. + * + * You should have received a copy of the GNU General Public License along + * with this program; if not, write to the Free Software Foundation, Inc., + * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. + */ + +#ifdef _MSC_VER +#pragma warning ( disable : 4786 ) +#endif//_MSC_VER + +#ifdef WIN32 + #include + #include +#else + #include + #include + + // Some hosts don't define PATH_MAX in unistd.h + #if !defined(PATH_MAX) + #include + #endif + + #define MAX_PATH PATH_MAX +#endif + +#include +#include +#include +#include +#include +#include "xml.h" +#include "ssprintf.h" + +#ifndef MAX_PATH +#define MAX_PATH _MAX_PATH +#endif + +using std::string; +using std::vector; + +#ifdef WIN32 +#define getcwd _getcwd +#endif//WIN32 + +static const char* WS = " \t\r\n"; +static const char* WSEQ = " =\t\r\n"; + +string working_directory; + +std::vector vectorize(const std::string &str) +{ + std::vector result( str.size() + 1 ); + strcpy( &result[0], str.c_str() ); + return result; +} + +void vectappend(std::vector &strvec, const char *str) +{ + if (*str) { strvec[strlen(&strvec[0])] = *str; str++; } + while (*str) + { + strvec.push_back(*str); + str++; + } + strvec.push_back(0); +} + +void vectappend(std::vector &strvec, const std::string &str) +{ + vectappend(strvec, str.c_str()); +} + +void vectappend(std::vector &strvec, char ch) +{ + strvec[strlen(&strvec[0])] = ch; + strvec.push_back(0); +} + +XMLException::XMLException ( + const std::string& location, + const char* format, ... ) +{ + va_list args; + va_start ( args, format ); + SetExceptionV ( location, format, args ); + va_end ( args ); +} + +void XMLException::SetExceptionV ( const std::string& location, const char* format, va_list args ) +{ + _e = location + ": " + ssvprintf(format,args); +} + +void XMLException::SetException ( const std::string& location, const char* format, ... ) +{ + va_list args; + va_start ( args, format ); + SetExceptionV ( location, format, args ); + va_end ( args ); +} + +XMLIncludes::~XMLIncludes() +{ + for ( size_t i = 0; i < this->size(); i++ ) + delete (*this)[i]; +} + +void +InitWorkingDirectory() +{ + // store the current directory for path calculations + working_directory.resize ( MAX_PATH ); + working_directory[0] = 0; + getcwd ( &working_directory[0], working_directory.size() ); + working_directory.resize ( strlen ( working_directory.c_str() ) ); +} + +#ifdef _MSC_VER +unsigned __int64 +#else +unsigned long long +#endif +filelen ( FILE* f ) +{ +#ifdef WIN32 + return _filelengthi64 ( _fileno(f) ); +#else +# if defined(__FreeBSD__) || defined(__APPLE__) || defined(__CYGWIN__) + struct stat file_stat; + if ( fstat(fileno(f), &file_stat) != 0 ) +# else + struct stat64 file_stat; + if ( fstat64(fileno(f), &file_stat) != 0 ) +# endif // __FreeBSD__ + return 0; + return file_stat.st_size; +#endif // WIN32 +} + +Path::Path() +{ + if ( !working_directory.size() ) + InitWorkingDirectory(); + string s ( working_directory ); + const char* p = strtok ( &s[0], "/\\" ); + while ( p ) + { + if ( *p ) + path.push_back ( p ); + p = strtok ( NULL, "/\\" ); + } +} + +Path::Path ( const Path& cwd, const string& file ) +{ + string s ( cwd.Fixup ( file, false ) ); + const char* p = strtok ( &s[0], "/\\" ); + while ( p ) + { + if ( *p ) + path.push_back ( p ); + p = strtok ( NULL, "/\\" ); + } +} + +string +Path::Fixup ( const string& file, bool include_filename ) const +{ + if ( strchr ( "/\\", file[0] ) +#ifdef WIN32 + // this squirreliness is b/c win32 has drive letters and *nix doesn't... + || file[1] == ':' +#endif//WIN32 + ) + { + return file; + } + vector pathtmp ( path ); + vector tmp = vectorize( file ); + const char* prev = strtok ( &tmp[0], "/\\" ); + const char* p = strtok ( NULL, "/\\" ); + while ( p ) + { + if ( !strcmp ( prev, "." ) ) + ; // do nothing + else if ( !strcmp ( prev, ".." ) ) + { + // this squirreliness is b/c win32 has drive letters and *nix doesn't... +#ifdef WIN32 + if ( pathtmp.size() > 1 ) +#else + if ( pathtmp.size() ) +#endif + pathtmp.resize ( pathtmp.size() - 1 ); + } + else + pathtmp.push_back ( prev ); + prev = p; + p = strtok ( NULL, "/\\" ); + } + if ( include_filename ) + pathtmp.push_back ( prev ); + + // reuse tmp variable to return recombined path + tmp = vectorize(""); + for ( size_t i = 0; i < pathtmp.size(); i++ ) + { + // this squirreliness is b/c win32 has drive letters and *nix doesn't... +#ifdef WIN32 + if ( i ) vectappend(tmp, "/"); +#else + vectappend(tmp, "/"); +#endif + vectappend(tmp, pathtmp[i]); + } + return &tmp[0]; +} + +string +Path::RelativeFromWorkingDirectory () +{ + string out = ""; + for ( size_t i = 0; i < path.size(); i++ ) + { + out += "/" + path[i]; + } + return RelativeFromWorkingDirectory ( out ); +} + +string +Path::RelativeFromWorkingDirectory ( const string& path ) +{ + return Path::RelativeFromDirectory ( path, working_directory ); +} + +string +Path::RelativeFromDirectory ( + const string& path, + const string& base_directory ) +{ + vector vbase, vpath, vout; + Path::Split ( vbase, base_directory, true ); + Path::Split ( vpath, path, true ); +#ifdef WIN32 + // this squirreliness is b/c win32 has drive letters and *nix doesn't... + // not possible to do relative across different drive letters + { + char path_driveletter = (path[1] == ':') ? toupper(path[0]) : 0; + char base_driveletter = (base_directory[1] == ':') ? toupper(base_directory[0]) : 0; + if ( path_driveletter != base_driveletter ) + return path; + } +#endif + size_t i = 0; + while ( i < vbase.size() && i < vpath.size() && vbase[i] == vpath[i] ) + ++i; + + // did we go through all of the path? + if ( vbase.size() == vpath.size() && i == vpath.size() ) + return "."; + + if ( i < vbase.size() ) + { + // path goes above our base directory, we will need some ..'s + for ( size_t j = i; j < vbase.size(); j++ ) + vout.push_back ( ".." ); + } + + while ( i < vpath.size() ) + vout.push_back ( vpath[i++] ); + + // now merge vout into a string again + string out = vout[0]; + for ( i = 1; i < vout.size(); i++ ) + { + out += "/" + vout[i]; + } + return out; +} + +void +Path::Split ( + vector& out, + const string& path, + bool include_last ) +{ + string s ( path ); + const char* prev = strtok ( &s[0], "/\\" ); + const char* p = strtok ( NULL, "/\\" ); + out.resize ( 0 ); + while ( p ) + { + if ( strcmp ( prev, "." ) ) + out.push_back ( prev ); + prev = p; + p = strtok ( NULL, "/\\" ); + } + if ( include_last && strcmp ( prev, "." ) ) + out.push_back ( prev ); + // special-case where path only has "." + // don't move this check up higher as it might miss + // some funny paths... + if ( !out.size() && !strcmp ( prev, "." ) ) + out.push_back ( "." ); +} + +XMLFile::XMLFile() +{ +} + +void +XMLFile::close() +{ + _buf.resize(0); + _p = _end = NULL; +} + +bool +XMLFile::open ( const string& filename_ ) +{ + close(); + FILE* f = fopen ( filename_.c_str(), "rb" ); + if ( !f ) + return false; + unsigned long len = (unsigned long)filelen(f); + _buf.resize ( len ); + fread ( &_buf[0], 1, len, f ); + fclose ( f ); + _p = _buf.c_str(); + _end = _p + len; + _filename = filename_; + next_token(); + return true; +} + +// next_token() moves the pointer to next token, which may be +// an xml element or a text element, basically it's a glorified +// skipspace, normally the user of this class won't need to call +// this function +void +XMLFile::next_token() +{ + _p += strspn ( _p, WS ); +} + +bool +XMLFile::next_is_text() +{ + return *_p != '<'; +} + +bool +XMLFile::more_tokens () +{ + return _p != _end; +} + +// get_token() is used to return a token, and move the pointer +// past the token +bool +XMLFile::get_token ( string& token ) +{ + const char* tokend; + if ( !strncmp ( _p, "" ); + if ( !tokend ) + tokend = _end; + else + tokend += 3; + } + else if ( !strncmp ( _p, "" ); + if ( !tokend ) + tokend = _end; + else + tokend += 2; + } + else if ( *_p == '<' ) + { + tokend = strchr ( _p, '>' ); + if ( !tokend ) + tokend = _end; + else + ++tokend; + } + else + { + tokend = strchr ( _p, '<' ); + if ( !tokend ) + tokend = _end; + while ( tokend > _p && isspace(tokend[-1]) ) + --tokend; + } + if ( tokend == _p ) + return false; + token = string ( _p, tokend-_p ); + _p = tokend; + next_token(); + return true; +} + +bool +XMLFile::get_token ( string& token, string& location ) +{ + location = Location(); + return get_token ( token ); +} + +string +XMLFile::Location() const +{ + int line = 1; + const char* p = strchr ( _buf.c_str(), '\n' ); + while ( p && p < _p ) + { + ++line; + p = strchr ( p+1, '\n' ); + } + return ssprintf ( "%s(%i)",_filename.c_str(), line ); +} + +XMLAttribute::XMLAttribute() +{ +} + +XMLAttribute::XMLAttribute( + const string& name_, + const string& value_ ) + : name(name_), value(value_) +{ +} + +XMLAttribute::XMLAttribute ( const XMLAttribute& src ) + : name(src.name), value(src.value) +{ + +} + +XMLAttribute& XMLAttribute::operator = ( const XMLAttribute& src ) +{ + name = src.name; + value = src.value; + return *this; +} + +XMLElement::XMLElement ( + XMLFile* xmlFile, + const string& location ) + : xmlFile ( xmlFile ), + location ( location ), + parentElement ( NULL ) +{ +} + +XMLElement::~XMLElement() +{ + size_t i; + for ( i = 0; i < attributes.size(); i++ ) + delete attributes[i]; + for ( i = 0; i < subElements.size(); i++ ) + delete subElements[i]; +} + +void +XMLElement::AddSubElement ( XMLElement* e ) +{ + subElements.push_back ( e ); + e->parentElement = this; +} + +// Parse() +// This function takes a single xml tag ( i.e. beginning with '<' and +// ending with '>', and parses out it's tag name and constituent +// attributes. +// Return Value: returns true if you need to look for a for +// the one it just parsed... +bool +XMLElement::Parse ( + const string& token, + bool& end_tag ) +{ + const char* p = token.c_str(); + assert ( *p == '<' ); + ++p; + p += strspn ( p, WS ); + + // check if this is a comment + if ( !strncmp ( p, "!--", 3 ) ) + { + name = "!--"; + end_tag = false; + return false; // never look for end tag to a comment + } + + end_tag = ( *p == '/' ); + if ( end_tag ) + { + ++p; + p += strspn ( p, WS ); + } + const char* end = strpbrk ( p, WS ); + if ( !end ) + { + end = strpbrk ( p, "/>" ); + assert ( end ); + } + name = string ( p, end-p ); + p = end; + p += strspn ( p, WS ); + while ( *p != '>' && *p != '/' ) + { + end = strpbrk ( p, WSEQ ); + if ( !end ) + { + end = strpbrk ( p, "/>" ); + assert ( end ); + } + string attribute ( p, end-p ), value; + p = end; + p += strspn ( p, WS ); + if ( *p == '=' ) + { + ++p; + p += strspn ( p, WS ); + char quote = 0; + if ( strchr ( "\"'", *p ) ) + { + quote = *p++; + end = strchr ( p, quote ); + } + else + { + end = strpbrk ( p, WS ); + } + if ( !end ) + { + end = strchr ( p, '>' ); + assert(end); + if ( end[-1] == '/' ) + end--; + } + value = string ( p, end-p ); + p = end; + if ( quote && *p == quote ) + p++; + p += strspn ( p, WS ); + } + else if ( name[0] != '!' ) + { + throw XMLSyntaxErrorException ( + location, + "attributes must have values" ); + } + attributes.push_back ( new XMLAttribute ( attribute, value ) ); + } + return !( *p == '/' ) && !end_tag; +} + +XMLAttribute* +XMLElement::GetAttribute ( + const string& attribute, + bool required ) +{ + // this would be faster with a tree-based container, but our attribute + // lists are likely to stay so short as to not be an issue. + for ( size_t i = 0; i < attributes.size(); i++ ) + { + if ( attribute == attributes[i]->name ) + return attributes[i]; + } + if ( required ) + { + throw XMLRequiredAttributeNotFoundException ( + location, + attribute, + name ); + } + return NULL; +} + +const XMLAttribute* +XMLElement::GetAttribute ( + const string& attribute, + bool required ) const +{ + // this would be faster with a tree-based container, but our attribute + // lists are likely to stay so short as to not be an issue. + for ( size_t i = 0; i < attributes.size(); i++ ) + { + if ( attribute == attributes[i]->name ) + return attributes[i]; + } + if ( required ) + { + throw XMLRequiredAttributeNotFoundException ( + location, + attribute, + name ); + } + return NULL; +} + +int +XMLElement::FindElement ( const std::string& type, int prev ) const +{ + int done = subElements.size(); + while ( ++prev < done ) + { + XMLElement* e = subElements[prev]; + if ( e->name == type ) + return prev; + } + return -1; +} + +int +XMLElement::GetElements ( + const std::string& type, + std::vector& v ) +{ + int find = FindElement ( type ); + v.resize ( 0 ); + while ( find != -1 ) + { + v.push_back ( subElements[find] ); + find = FindElement ( type, find ); + } + return v.size(); +} + +int +XMLElement::GetElements ( + const std::string& type, + std::vector& v ) const +{ + int find = FindElement ( type ); + v.resize ( 0 ); + while ( find != -1 ) + { + v.push_back ( subElements[find] ); + find = FindElement ( type, find ); + } + return v.size(); +} + +// XMLParse() +// This function reads a "token" from the file loaded in XMLFile +// if it finds a tag that is non-singular, it parses sub-elements and/or +// inner text into the XMLElement that it is building to return. +// Return Value: an XMLElement allocated via the new operator that contains +// it's parsed data. Keep calling this function until it returns NULL +// (no more data) +XMLElement* +XMLParse ( + XMLFile& f, + XMLIncludes* includes, + const Path& path, + bool* pend_tag = NULL ) +{ + string token, location; + if ( !f.get_token(token,location) ) + return NULL; + bool end_tag, is_include = false; + + while + ( + token[0] != '<' + || !strncmp ( token.c_str (), "