[Pkg-virtualbox-commits] [virtualbox] 01/03: Imported Upstream version 5.0.4-dfsg
Gianfranco Costamagna
locutusofborg-guest at moszumanska.debian.org
Tue Sep 8 19:25:27 UTC 2015
This is an automated email from the git hooks/post-receive script.
locutusofborg-guest pushed a commit to branch master
in repository virtualbox.
commit 58e550bca92b3b8f76c3ee551e56f25a485c5c3f
Author: Gianfranco Costamagna <costamagnagianfranco at yahoo.it>
Date: Tue Sep 8 19:46:56 2015 +0200
Imported Upstream version 5.0.4-dfsg
---
Config.kmk | 16 +-
Makefile.kmk | 1 -
doc/manual/ChangeLog.xml | 11 +
doc/manual/common-html-formatcfg.xsl | 174 ++
doc/manual/docbook-changelog-formatcfg.xsl | 80 +
doc/manual/docbook-html-chunks-formatcfg.xsl | 41 +
doc/manual/docbook-html-one-page-formatcfg.xsl | 20 +
doc/manual/en_US/user_GuestAdditions.xml | 6 +-
doc/manual/en_US/user_Security.xml | 13 +-
doc/manual/en_US/user_Technical.xml | 4 +-
doc/manual/en_US/user_Troubleshooting.xml | 20 +
doc/manual/en_US/user_VBoxManage.xml | 4 +-
doc/manual/user_ChangeLogImpl.xml | 175 +-
include/VBox/GuestHost/DragAndDrop.h | 2 +
include/VBox/HostServices/DragAndDropSvc.h | 4 +-
include/VBox/vd-image-backend.h | 12 +-
include/VBox/vmm/hm_vmx.h | 25 +-
include/VBox/vmm/pdmaudioifs.h | 32 +-
include/VBox/vmm/pdmdev.h | 2 +-
include/VBox/vmm/pdmins.h | 2 +-
include/VBox/vmm/pdmthread.h | 16 +-
include/VBox/vmm/pgm.h | 2 +-
include/VBox/vmm/vm.h | 11 +-
include/iprt/asm.h | 2 +-
include/iprt/asn1.h | 6 +-
include/iprt/cdefs.h | 61 +-
include/iprt/cpp/mem.h | 271 ---
include/iprt/crypto/pem.h | 36 +-
include/iprt/crypto/store.h | 240 +++
include/iprt/crypto/x509.h | 2 +-
include/iprt/dir.h | 2 +-
include/iprt/err.h | 16 +-
include/iprt/file.h | 14 +
include/iprt/fs.h | 13 +
include/iprt/http.h | 162 +-
include/iprt/log.h | 3 +-
include/iprt/mangling.h | 25 +
include/iprt/mem.h | 102 +-
include/iprt/mempool.h | 18 +-
include/iprt/memsafer.h | 10 +-
include/iprt/path.h | 83 +-
include/iprt/rand.h | 54 +-
include/iprt/sha.h | 45 +
include/iprt/types.h | 15 +
include/iprt/zip.h | 4 +-
.../Additions/common/VBoxControl/VBoxControl.cpp | 55 +-
.../common/VBoxControl/testcase/tstVBoxControl.cpp | 6 +-
.../Additions/common/VBoxGuest/VBoxDev-haiku.c | 14 +-
.../common/VBoxGuest/VBoxGuest-darwin.cpp | 31 +-
.../Additions/common/VBoxGuest/VBoxGuest-haiku.c | 7 +-
.../Additions/common/VBoxGuest/VBoxGuest-linux.c | 27 +-
.../Additions/common/VBoxGuest/VBoxGuest-os2.cpp | 18 +-
.../Additions/common/VBoxGuest/VBoxGuest-solaris.c | 38 +-
.../common/VBoxGuest/VBoxGuest-win-legacy.cpp | 19 +-
.../common/VBoxGuest/VBoxGuest-win-pnp.cpp | 13 +-
.../Additions/common/VBoxGuest/VBoxGuest-win.cpp | 25 +-
src/VBox/Additions/common/VBoxGuest/VBoxGuest.cpp | 24 +-
.../common/VBoxGuest/win/VBoxGuestInst.cpp | 6 +-
.../Additions/common/VBoxGuestLib/HGCMInternal.cpp | 20 +-
src/VBox/Additions/common/VBoxGuestLib/Init.cpp | 14 +-
.../VBoxGuestLib/VBoxGuestR0LibSharedFolders.c | 13 +-
.../common/VBoxGuestLib/VBoxGuestR3Lib.cpp | 12 +-
.../VBoxGuestLib/VBoxGuestR3LibAdditions.cpp | 6 +-
.../VBoxGuestLib/VBoxGuestR3LibAutoLogon.cpp | 6 +-
.../common/VBoxGuestLib/VBoxGuestR3LibBalloon.cpp | 6 +-
.../VBoxGuestLib/VBoxGuestR3LibClipboard.cpp | 6 +-
.../common/VBoxGuestLib/VBoxGuestR3LibCoreDump.cpp | 6 +-
.../VBoxGuestLib/VBoxGuestR3LibCpuHotPlug.cpp | 6 +-
.../VBoxGuestLib/VBoxGuestR3LibCredentials.cpp | 6 +-
.../VBoxGuestLib/VBoxGuestR3LibDaemonize.cpp | 6 +-
.../VBoxGuestLib/VBoxGuestR3LibDragAndDrop.cpp | 55 +-
.../common/VBoxGuestLib/VBoxGuestR3LibEvent.cpp | 6 +-
.../common/VBoxGuestLib/VBoxGuestR3LibGR.cpp | 8 +-
.../VBoxGuestLib/VBoxGuestR3LibGuestCtrl.cpp | 12 +-
.../VBoxGuestLib/VBoxGuestR3LibGuestProp.cpp | 101 +-
.../VBoxGuestLib/VBoxGuestR3LibGuestUser.cpp | 6 +-
.../VBoxGuestLib/VBoxGuestR3LibHostVersion.cpp | 6 +-
.../common/VBoxGuestLib/VBoxGuestR3LibLog.cpp | 6 +-
.../common/VBoxGuestLib/VBoxGuestR3LibMisc.cpp | 6 +-
.../common/VBoxGuestLib/VBoxGuestR3LibModule.cpp | 6 +-
.../common/VBoxGuestLib/VBoxGuestR3LibMouse.cpp | 6 +-
.../VBoxGuestLib/VBoxGuestR3LibRuntimeXF86.cpp | 6 +-
.../common/VBoxGuestLib/VBoxGuestR3LibSeamless.cpp | 6 +-
.../VBoxGuestLib/VBoxGuestR3LibSharedFolders.cpp | 6 +-
.../common/VBoxGuestLib/VBoxGuestR3LibStat.cpp | 6 +-
.../common/VBoxGuestLib/VBoxGuestR3LibTime.cpp | 6 +-
.../common/VBoxGuestLib/VBoxGuestR3LibVideo.cpp | 6 +-
.../common/VBoxService/VBoxService-win.cpp | 18 +-
.../Additions/common/VBoxService/VBoxService.cpp | 14 +-
.../common/VBoxService/VBoxServiceAutoMount.cpp | 13 +-
.../common/VBoxService/VBoxServiceBalloon.cpp | 12 +-
.../VBoxService/VBoxServiceClipboard-os2.cpp | 18 +-
.../common/VBoxService/VBoxServiceControl.cpp | 20 +-
.../VBoxService/VBoxServiceControlProcess.cpp | 13 +-
.../VBoxService/VBoxServiceControlSession.cpp | 20 +-
.../common/VBoxService/VBoxServiceCpuHotPlug.cpp | 13 +-
.../common/VBoxService/VBoxServicePageSharing.cpp | 12 +-
.../common/VBoxService/VBoxServicePropCache.cpp | 6 +-
.../common/VBoxService/VBoxServiceStats.cpp | 19 +-
.../common/VBoxService/VBoxServiceTimeSync.cpp | 13 +-
.../common/VBoxService/VBoxServiceToolBox.cpp | 18 +-
.../common/VBoxService/VBoxServiceUtils.cpp | 6 +-
.../common/VBoxService/VBoxServiceVMInfo-win.cpp | 13 +-
.../common/VBoxService/VBoxServiceVMInfo.cpp | 18 +-
.../common/VBoxService/testcase/tstUserInfo.cpp | 6 +-
src/VBox/Additions/common/crOpenGL/DD_glc.py | 0
src/VBox/Additions/common/crOpenGL/DD_glh.py | 0
src/VBox/Additions/common/crOpenGL/NULLfuncs.py | 0
src/VBox/Additions/common/crOpenGL/cr_gl.py | 0
src/VBox/Additions/common/crOpenGL/entrypoints.py | 0
.../Additions/common/crOpenGL/feedback/feedback.py | 0
.../common/crOpenGL/feedback/feedback_funcs.py | 0
.../common/crOpenGL/feedback/feedback_state.py | 0
.../common/crOpenGL/feedback/feedbackspu_proto.py | 0
.../Additions/common/crOpenGL/getprocaddress.py | 0
src/VBox/Additions/common/crOpenGL/load.c | 2 +-
src/VBox/Additions/common/crOpenGL/pack/pack.py | 0
.../common/crOpenGL/pack/packspu_beginend.py | 0
.../common/crOpenGL/pack/packspu_flush.py | 0
.../common/crOpenGL/pack/packspu_proto.py | 0
.../common/crOpenGL/passthrough/passthrough.py | 0
src/VBox/Additions/common/crOpenGL/tsfuncs.py | 0
.../common/crOpenGL/windows_getprocaddress.py | 0
src/VBox/Additions/common/pam/pam_vbox.cpp | 7 +-
.../Additions/common/testcase/tstPageFusion.cpp | 12 +-
.../Additions/darwin/VBoxClient/VBoxClient.cpp | 13 +-
.../darwin/VBoxClient/VBoxClientClipboard.cpp | 24 +-
.../VBoxClient/VBoxClientClipboardGuestToHost.cpp | 6 +-
.../VBoxClient/VBoxClientClipboardHostToGuest.cpp | 6 +-
src/VBox/Additions/darwin/vboxfs/VBoxVFS.cpp | 12 +-
.../haiku/VBoxTray/VBoxGuestApplication.cpp | 7 +-
.../haiku/VBoxTray/VBoxGuestDeskbarView.cpp | 8 +-
.../haiku/VBoxVideo/accelerant/accelerant.cpp | 14 +-
.../Additions/haiku/VBoxVideo/driver/driver.cpp | 21 +-
src/VBox/Additions/linux/installer/vboxadd.sh | 8 +-
.../linux/lightdm-greeter/vbox-greeter.cpp | 7 +-
src/VBox/Additions/solaris/DRM/vboxvideo_drm.c | 33 +-
.../solaris/Mouse/testcase/tstVBoxMouse-solaris.c | 14 +-
src/VBox/Additions/solaris/Mouse/vboxms.c | 52 +-
.../Additions/solaris/SharedFolders/vboxfs_mount.c | 14 +-
src/VBox/Additions/solaris/Virtio/Virtio-solaris.c | 7 +-
.../Additions/solaris/Virtio/VirtioNet-solaris.c | 26 +-
.../Additions/solaris/Virtio/VirtioPci-solaris.c | 20 +-
.../Additions/solaris/Virtio/VirtioRing-solaris.c | 7 +-
src/VBox/Additions/x11/Installer/98vboxadd-xclient | 2 +-
src/VBox/Additions/x11/VBoxClient/VBoxClient.h | 10 -
src/VBox/Additions/x11/VBoxClient/clipboard.cpp | 16 +-
src/VBox/Additions/x11/VBoxClient/display.cpp | 112 +-
src/VBox/Additions/x11/VBoxClient/draganddrop.cpp | 10 +-
src/VBox/Additions/x11/VBoxClient/hostversion.cpp | 2 -
src/VBox/Additions/x11/VBoxClient/main.cpp | 87 +-
src/VBox/Additions/x11/VBoxClient/seamless-x11.cpp | 36 +-
src/VBox/Additions/x11/VBoxClient/seamless.cpp | 111 +-
src/VBox/Additions/x11/VBoxClient/seamless.h | 6 -
.../VBoxClient/testcase/tstSeamlessX11-auto.cpp | 6 +
src/VBox/Additions/x11/undefined_xfree86 | 1 +
src/VBox/Additions/x11/vboxmouse/vboxmouse.c | 9 +-
src/VBox/Additions/x11/vboxvideo/vboxvideo.c | 138 +-
src/VBox/Additions/x11/vboxvideo/vbva.c | 3 +-
src/VBox/Debugger/DBGCBuiltInSymbols.cpp | 7 +-
src/VBox/Debugger/DBGCCmdHlp.cpp | 7 +-
src/VBox/Debugger/DBGCCmdWorkers.cpp | 7 +-
src/VBox/Debugger/DBGCCommands.cpp | 19 +-
src/VBox/Debugger/DBGCEmulateCodeView.cpp | 19 +-
src/VBox/Debugger/DBGCEval.cpp | 19 +-
src/VBox/Debugger/DBGCFunctions.cpp | 13 +-
src/VBox/Debugger/DBGCGdbRemoteStub.cpp | 6 +-
src/VBox/Debugger/DBGCOps.cpp | 24 +-
src/VBox/Debugger/DBGCTcp.cpp | 20 +-
src/VBox/Debugger/DBGConsole.cpp | 12 +-
src/VBox/Debugger/DBGPlugInCommonELF.cpp | 12 +-
src/VBox/Debugger/DBGPlugInDarwin.cpp | 24 +-
src/VBox/Debugger/DBGPlugInDiggers.cpp | 6 +-
src/VBox/Debugger/DBGPlugInLinux.cpp | 30 +-
src/VBox/Debugger/DBGPlugInOS2.cpp | 31 +-
src/VBox/Debugger/DBGPlugInSolaris.cpp | 30 +-
src/VBox/Debugger/DBGPlugInWinNt.cpp | 30 +-
src/VBox/Debugger/VBoxDbg.cpp | 19 +-
src/VBox/Debugger/VBoxDbgBase.cpp | 7 +-
src/VBox/Debugger/VBoxDbgConsole.cpp | 6 +-
src/VBox/Debugger/VBoxDbgGui.cpp | 7 +-
src/VBox/Debugger/VBoxDbgStatsQt4.cpp | 24 +-
src/VBox/Debugger/testcase/tstDBGCParser.cpp | 19 +-
src/VBox/Debugger/testcase/tstVBoxDbg.cpp | 6 +-
src/VBox/Devices/Audio/AudioMixBuffer.cpp | 50 +-
src/VBox/Devices/Audio/AudioMixBuffer.h | 2 +
src/VBox/Devices/Audio/DevIchAc97.cpp | 20 +-
src/VBox/Devices/Audio/DevIchHda.cpp | 38 +-
src/VBox/Devices/Audio/DevIchHdaCodec.cpp | 30 +-
src/VBox/Devices/Audio/DrvAudio.cpp | 288 ++-
src/VBox/Devices/Audio/DrvAudio.h | 4 +-
src/VBox/Devices/Audio/DrvAudioCommon.cpp | 65 +-
src/VBox/Devices/Audio/DrvHostALSAAudio.cpp | 89 +-
src/VBox/Devices/Audio/DrvHostCoreAudio.cpp | 82 +-
src/VBox/Devices/Audio/DrvHostDSound.cpp | 632 +++---
src/VBox/Devices/Audio/DrvHostNullAudio.cpp | 2 +-
src/VBox/Devices/Audio/DrvHostOSSAudio.cpp | 7 +-
src/VBox/Devices/Audio/DrvHostPulseAudio.cpp | 8 +-
.../Devices/Audio/testcase/tstAudioMixBuffer.cpp | 12 +-
.../BiosCommonCode/MakeAlternativeSource.cpp | 18 +-
src/VBox/Devices/Bus/DevPCI.cpp | 31 +-
src/VBox/Devices/Bus/DevPciIch9.cpp | 24 +-
src/VBox/Devices/Bus/SrvPciRawR0.cpp | 12 +-
src/VBox/Devices/EFI/DevEFI.cpp | 25 +-
src/VBox/Devices/EFI/DevSmc.cpp | 30 +-
.../BaseTools/Source/Python/BPDG/StringTable.py | 0
.../Source/Python/Common/FdfParserLite.py | 0
.../Source/Python/Common/Identification.py | 0
.../BaseTools/Source/Python/Common/VpdInfoFile.py | 0
.../Source/Python/CommonDataClass/CommonClass.py | 0
.../Source/Python/CommonDataClass/FdfClass.py | 0
.../BaseTools/Source/Python/Ecc/CodeFragment.py | 0
.../BaseTools/Source/Python/Ecc/ParserWarning.py | 0
.../BaseTools/Source/Python/Ecc/Xml/XmlRoutines.py | 0
.../BaseTools/Source/Python/Ecc/Xml/__init__.py | 0
.../BaseTools/Source/Python/Eot/CodeFragment.py | 0
.../BaseTools/Source/Python/Eot/ParserWarning.py | 0
.../Firmware/BaseTools/Source/Python/Eot/Report.py | 0
.../BaseTools/Source/Python/GenFds/Attribute.py | 0
.../BaseTools/Source/Python/Table/Table.py | 0
.../BaseTools/Source/Python/UPT/BuildVersion.py | 0
.../BaseTools/Source/Python/UPT/Core/__init__.py | 0
.../Source/Python/UPT/GenMetaFile/GenXmlFile.py | 0
.../Source/Python/UPT/GenMetaFile/__init__.py | 0
.../Source/Python/UPT/Library/DataType.py | 0
.../Source/Python/UPT/Library/GlobalData.py | 0
.../Source/Python/UPT/Library/Xml/__init__.py | 0
.../Source/Python/UPT/Library/__init__.py | 0
.../Source/Python/UPT/Logger/StringTable.py | 0
.../BaseTools/Source/Python/UPT/Logger/__init__.py | 0
.../Source/Python/UPT/Object/POM/__init__.py | 0
.../Python/UPT/Object/Parser/InfCommonObject.py | 0
.../Python/UPT/Object/Parser/InfHeaderObject.py | 0
.../Source/Python/UPT/Object/Parser/__init__.py | 0
.../BaseTools/Source/Python/UPT/Object/__init__.py | 0
.../BaseTools/Source/Python/UPT/Parser/__init__.py | 0
.../Source/Python/UPT/PomAdapter/__init__.py | 0
.../BaseTools/Source/Python/UPT/Xml/__init__.py | 0
.../Firmware/UefiCpuPkg/ResetVector/Vtf0/Build.py | 0
.../ResetVector/Vtf0/Tools/FixupForRawSection.py | 0
src/VBox/Devices/EFI/FirmwareBin/VBoxEFI32.fd | Bin 1048576 -> 1048576 bytes
src/VBox/Devices/EFI/FirmwareBin/VBoxEFI64.fd | Bin 1048576 -> 1048576 bytes
src/VBox/Devices/EFI/VBoxSmcUtil-darwin.cpp | 18 +-
src/VBox/Devices/GIMDev/GIMDev.cpp | 6 +-
.../Graphics/BIOS/VBoxVgaBiosAlternative.asm | 16 +-
.../Graphics/BIOS/VBoxVgaBiosAlternative.md5sum | 2 +-
src/VBox/Devices/Graphics/DevVGA-SVGA.cpp | 68 +-
src/VBox/Devices/Graphics/DevVGA-SVGA.h | 7 +
src/VBox/Devices/Graphics/DevVGA-SVGA3d-cocoa.m | 87 +-
src/VBox/Devices/Graphics/DevVGA-SVGA3d-info.cpp | 6 +-
src/VBox/Devices/Graphics/DevVGA-SVGA3d-ogl.cpp | 460 +++--
.../Devices/Graphics/DevVGA-SVGA3d-savedstate.cpp | 6 +-
src/VBox/Devices/Graphics/DevVGA-SVGA3d-shared.cpp | 47 +-
src/VBox/Devices/Graphics/DevVGA-SVGA3d-win.cpp | 241 ++-
src/VBox/Devices/Graphics/DevVGA-SVGA3d.cpp | 6 +-
src/VBox/Devices/Graphics/DevVGA.cpp | 38 +-
src/VBox/Devices/Graphics/DevVGA.h | 69 +-
src/VBox/Devices/Graphics/DevVGA_VBVA.cpp | 16 +-
src/VBox/Devices/Graphics/DevVGA_VDMA.cpp | 4 +-
src/VBox/Devices/Graphics/testcase/dump-vmwgfx.c | 24 +-
src/VBox/Devices/Input/DevPS2.cpp | 15 +-
src/VBox/Devices/Input/DrvKeyboardQueue.cpp | 18 +-
src/VBox/Devices/Input/DrvMouseQueue.cpp | 12 +-
src/VBox/Devices/Input/PS2K.cpp | 34 +-
src/VBox/Devices/Input/PS2M.cpp | 33 +-
src/VBox/Devices/Input/UsbKbd.cpp | 35 +-
src/VBox/Devices/Input/UsbMouse.cpp | 35 +-
src/VBox/Devices/Input/testcase/tstUsbMouse.cpp | 7 +-
src/VBox/Devices/Makefile.kmk | 1 -
src/VBox/Devices/Misc/VirtualKD.cpp | 25 +-
src/VBox/Devices/Network/DevE1000.cpp | 7 +-
src/VBox/Devices/Network/DevINIP.cpp | 43 +-
src/VBox/Devices/Network/DevPCNet.cpp | 26 +-
src/VBox/Devices/Network/DevVirtioNet.cpp | 18 +-
src/VBox/Devices/Network/DrvDedicatedNic.cpp | 13 +-
src/VBox/Devices/Network/DrvIntNet.cpp | 19 +-
src/VBox/Devices/Network/DrvNAT.cpp | 120 +-
src/VBox/Devices/Network/DrvNetShaper.cpp | 13 +-
src/VBox/Devices/Network/DrvNetSniffer.cpp | 12 +-
src/VBox/Devices/Network/DrvTAP.cpp | 19 +-
src/VBox/Devices/Network/DrvUDPTunnel.cpp | 20 +-
src/VBox/Devices/Network/DrvVDE.cpp | 19 +-
src/VBox/Devices/Network/Pcap.cpp | 19 +-
src/VBox/Devices/Network/SrvIntNetR0.cpp | 30 +-
.../Devices/Network/lwip-new/vbox/VBoxLwipCore.cpp | 6 +-
src/VBox/Devices/Network/lwip-new/vbox/sys_arch.c | 2 +-
src/VBox/Devices/Network/slirp/ip_icmp.c | 5 +-
src/VBox/Devices/Network/slirp/slirp.c | 3 +
src/VBox/Devices/Network/slirp/udp.c | 4 +
src/VBox/Devices/Network/testcase/tstIntNet-1.cpp | 15 +-
src/VBox/Devices/Network/testcase/tstIntNetR0.cpp | 22 +-
src/VBox/Devices/PC/ACPI/VBoxAcpi.cpp | 6 +-
src/VBox/Devices/PC/BIOS/VBoxBiosAlternative.asm | 4 +-
.../Devices/PC/BIOS/VBoxBiosAlternative.md5sum | 2 +-
src/VBox/Devices/PC/DevACPI.cpp | 27 +-
src/VBox/Devices/PC/DevAPIC.cpp | 26 +-
src/VBox/Devices/PC/DevDMA.cpp | 9 +-
src/VBox/Devices/PC/DevFwCommon.cpp | 19 +-
src/VBox/Devices/PC/DevHPET.cpp | 19 +-
src/VBox/Devices/PC/DevIoApic.cpp | 26 +-
src/VBox/Devices/PC/DevLPC.cpp | 7 +-
src/VBox/Devices/PC/DevPIC.cpp | 12 +-
src/VBox/Devices/PC/DevPcArch.cpp | 13 +-
src/VBox/Devices/PC/DevPcBios.cpp | 13 +-
src/VBox/Devices/PC/DevPit-i8254.cpp | 27 +-
src/VBox/Devices/PC/DevRTC.cpp | 19 +-
src/VBox/Devices/PC/DrvACPI.cpp | 13 +-
src/VBox/Devices/PC/DrvAcpiCpu.cpp | 7 +-
src/VBox/Devices/Parallel/DevParallel.cpp | 25 +-
src/VBox/Devices/Parallel/DrvHostParallel.cpp | 19 +-
src/VBox/Devices/Samples/DrvStorageFilter.cpp | 12 +-
src/VBox/Devices/Samples/VBoxSampleDevice.cpp | 12 +-
src/VBox/Devices/Serial/DevSerial.cpp | 20 +-
src/VBox/Devices/Serial/DrvChar.cpp | 18 +-
src/VBox/Devices/Serial/DrvHostSerial.cpp | 12 +-
src/VBox/Devices/Serial/DrvNamedPipe.cpp | 24 +-
src/VBox/Devices/Serial/DrvRawFile.cpp | 18 +-
src/VBox/Devices/Serial/DrvTCP.cpp | 26 +-
src/VBox/Devices/Storage/DevAHCI.cpp | 11 +-
src/VBox/Devices/Storage/DevATA.cpp | 33 +-
src/VBox/Devices/Storage/DevBusLogic.cpp | 25 +-
src/VBox/Devices/Storage/DevFdc.cpp | 6 +-
src/VBox/Devices/Storage/DevLsiLogicSCSI.cpp | 33 +-
src/VBox/Devices/Storage/DrvBlock.cpp | 12 +-
src/VBox/Devices/Storage/DrvDiskIntegrity.cpp | 19 +-
src/VBox/Devices/Storage/DrvHostBase.cpp | 8 +-
src/VBox/Devices/Storage/DrvHostDVD.cpp | 24 +-
src/VBox/Devices/Storage/DrvHostFloppy.cpp | 6 +-
src/VBox/Devices/Storage/DrvMediaISO.cpp | 19 +-
src/VBox/Devices/Storage/DrvRawImage.cpp | 12 +-
src/VBox/Devices/Storage/DrvSCSI.cpp | 19 +-
src/VBox/Devices/Storage/DrvSCSIHost.cpp | 11 +-
src/VBox/Devices/Storage/DrvVD.cpp | 117 +-
src/VBox/Devices/Storage/HBDMgmt-darwin.cpp | 38 +-
src/VBox/Devices/Storage/HBDMgmt-win.cpp | 29 +-
src/VBox/Devices/Storage/HBDMgmt.h | 4 +-
src/VBox/Devices/Storage/UsbMsd.cpp | 35 +-
src/VBox/Devices/Storage/VBoxSCSI.cpp | 7 +-
src/VBox/Devices/Storage/VSCSI/VSCSIDevice.cpp | 8 +-
src/VBox/Devices/Storage/VSCSI/VSCSILunMmc.cpp | 13 +-
src/VBox/Devices/Storage/VSCSI/VSCSILunSbc.cpp | 13 +-
.../Devices/Storage/VSCSI/VSCSIVpdPagePool.cpp | 21 +-
src/VBox/Devices/USB/DevOHCI.cpp | 26 +-
src/VBox/Devices/USB/DrvVUSBRootHub.cpp | 9 +-
src/VBox/Devices/USB/USBProxyDevice-stub.cpp | 13 +-
src/VBox/Devices/USB/USBProxyDevice.cpp | 12 +-
src/VBox/Devices/USB/VUSBDevice.cpp | 31 +-
src/VBox/Devices/USB/VUSBReadAhead.cpp | 18 +-
src/VBox/Devices/USB/VUSBSniffer.cpp | 30 +-
src/VBox/Devices/USB/VUSBUrb.cpp | 19 +-
.../Devices/USB/darwin/USBProxyDevice-darwin.cpp | 25 +-
.../Devices/USB/freebsd/USBProxyDevice-freebsd.cpp | 21 +-
.../Devices/USB/linux/USBProxyDevice-linux.cpp | 32 +-
src/VBox/Devices/USB/os2/USBProxyDevice-os2.cpp | 30 +-
.../Devices/USB/solaris/USBProxyDevice-solaris.cpp | 19 +-
.../Devices/USB/testcase/tstOhciRegisterAccess.cpp | 12 +-
.../Devices/USB/usbip/USBProxyDevice-usbip.cpp | 454 +++--
src/VBox/Devices/USB/win/USBProxyDevice-win.cpp | 19 +-
src/VBox/Devices/VMMDev/VMMDev.cpp | 90 +-
src/VBox/Devices/VMMDev/VMMDevHGCM.cpp | 12 +-
src/VBox/Devices/VMMDev/VMMDevHGCM.h | 12 +-
src/VBox/Devices/VMMDev/VMMDevTesting.cpp | 6 +-
src/VBox/Devices/VirtIO/Virtio.cpp | 14 +-
src/VBox/Devices/build/VBoxDD.cpp | 12 +-
src/VBox/Devices/build/VBoxDD2.cpp | 12 +-
src/VBox/Devices/build/VBoxDD2R0.cpp | 13 +-
src/VBox/Devices/build/VBoxDDR0.cpp | 13 +-
src/VBox/Devices/build/VBoxDDUDeps.cpp | 7 +-
src/VBox/Devices/testcase/tstDeviceStructSize.cpp | 16 +-
.../Devices/testcase/tstDeviceStructSizeRC.cpp | 6 +-
src/VBox/Disassembler/Disasm.cpp | 6 +-
src/VBox/Disassembler/DisasmCore.cpp | 24 +-
src/VBox/Disassembler/DisasmFormatBytes.cpp | 6 +-
src/VBox/Disassembler/DisasmFormatYasm.cpp | 12 +-
src/VBox/Disassembler/DisasmReg.cpp | 12 +-
src/VBox/Disassembler/DisasmTables.cpp | 6 +-
src/VBox/Disassembler/DisasmTablesX64.cpp | 6 +-
src/VBox/Disassembler/testcase/tstDisasm-1.cpp | 7 +-
src/VBox/Disassembler/testcase/tstDisasm-2.cpp | 15 +-
src/VBox/ExtPacks/BusMouseSample/BusMouse.cpp | 19 +-
.../ExtPacks/BusMouseSample/VBoxBusMouseMain.cpp | 12 +-
src/VBox/ExtPacks/Skeleton/VBoxSkeletonMain.cpp | 12 +-
src/VBox/ExtPacks/VBoxDTrace/VBoxDTraceMain.cpp | 12 +-
src/VBox/ExtPacks/VBoxDTrace/VBoxDTraceR0.cpp | 24 +-
src/VBox/ExtPacks/VBoxDTrace/VBoxDTraceWrapper.cpp | 18 +-
.../dtrace/test/tst/common/funcs/tst.index.d.out | 0
.../dtrace/test/tst/common/funcs/tst.substr.d.out | 0
src/VBox/ExtPacks/VNC/VBoxVNC.cpp | 19 +-
src/VBox/ExtPacks/VNC/VBoxVNCMain.cpp | 12 +-
.../VBoxAutostart/VBoxAutostart-posix.cpp | 6 +-
.../Frontends/VBoxAutostart/VBoxAutostart-win.cpp | 27 +-
.../Frontends/VBoxAutostart/VBoxAutostartCfg.cpp | 21 +-
.../VBoxBalloonCtrl/VBoxModAPIMonitor.cpp | 6 +-
.../VBoxBalloonCtrl/VBoxModBallooning.cpp | 6 +-
.../Frontends/VBoxBalloonCtrl/VBoxWatchdog.cpp | 6 +-
.../VBoxBalloonCtrl/VBoxWatchdogUtils.cpp | 6 +-
.../Frontends/VBoxManage/VBoxInternalManage.cpp | 8 +-
src/VBox/Frontends/VBoxManage/VBoxManage.cpp | 24 +-
.../Frontends/VBoxManage/VBoxManageAppliance.cpp | 7 +-
.../VBoxManage/VBoxManageBandwidthControl.cpp | 7 +-
.../Frontends/VBoxManage/VBoxManageControlVM.cpp | 7 +-
.../Frontends/VBoxManage/VBoxManageDHCPServer.cpp | 7 +-
.../Frontends/VBoxManage/VBoxManageDebugVM.cpp | 6 +-
src/VBox/Frontends/VBoxManage/VBoxManageDisk.cpp | 7 +-
.../Frontends/VBoxManage/VBoxManageGuestCtrl.cpp | 33 +-
.../VBoxManage/VBoxManageGuestCtrlListener.cpp | 6 +-
.../Frontends/VBoxManage/VBoxManageGuestProp.cpp | 6 +-
src/VBox/Frontends/VBoxManage/VBoxManageHelp.cpp | 21 +-
.../Frontends/VBoxManage/VBoxManageHostonly.cpp | 7 +-
src/VBox/Frontends/VBoxManage/VBoxManageInfo.cpp | 7 +-
src/VBox/Frontends/VBoxManage/VBoxManageList.cpp | 7 +-
.../Frontends/VBoxManage/VBoxManageMetrics.cpp | 7 +-
src/VBox/Frontends/VBoxManage/VBoxManageMisc.cpp | 6 +-
.../Frontends/VBoxManage/VBoxManageModifyVM.cpp | 7 +-
.../Frontends/VBoxManage/VBoxManageNATNetwork.cpp | 7 +-
.../Frontends/VBoxManage/VBoxManageSnapshot.cpp | 7 +-
.../VBoxManage/VBoxManageStorageController.cpp | 7 +-
src/VBox/Frontends/VBoxSDL/Framebuffer-darwin.m | 7 +-
src/VBox/Frontends/VBoxSDL/VBoxSDL.cpp | 34 +-
src/VBox/Frontends/VBoxShell/vboxshell.py | 28 +-
src/VBox/Frontends/VirtualBox/Makefile.kmk | 3 +
src/VBox/Frontends/VirtualBox/nls/VirtualBox_nl.ts | 19 +-
.../Frontends/VirtualBox/src/UIVMInfoDialog.cpp | 4 +-
.../Frontends/VirtualBox/src/UIVMLogViewer.cpp | 95 +-
src/VBox/Frontends/VirtualBox/src/UIVMLogViewer.h | 9 +
.../VirtualBox/src/extensions/QIArrowSplitter.cpp | 4 +-
.../VirtualBox/src/extradata/UIExtraDataDefs.cpp | 3 +
.../VirtualBox/src/extradata/UIExtraDataDefs.h | 7 +
.../src/extradata/UIExtraDataManager.cpp | 98 +-
.../VirtualBox/src/extradata/UIExtraDataManager.h | 11 +
.../src/globals/UIDesktopWidgetWatchdog.cpp | 212 ++
.../src/globals/UIDesktopWidgetWatchdog.h | 81 +
.../VirtualBox/src/globals/UIMainEventListener.cpp | 9 +
.../VirtualBox/src/globals/UIMessageCenter.cpp | 19 +-
.../VirtualBox/src/globals/UIMessageCenter.h | 2 +
.../VirtualBox/src/globals/VBoxGlobal.cpp | 117 +-
.../Frontends/VirtualBox/src/globals/VBoxGlobal.h | 79 +-
src/VBox/Frontends/VirtualBox/src/main.cpp | 80 +-
.../Frontends/VirtualBox/src/medium/UIMedium.cpp | 6 +-
.../VirtualBox/src/net/UINetworkReply.cpp | 1056 ++++++----
.../VirtualBox/src/net/UINetworkRequestWidget.cpp | 4 +
.../src/platform/darwin/DarwinKeyboard.cpp | 27 +-
.../src/platform/darwin/tstDarwinKeyboard.cpp | 6 +-
.../VirtualBox/src/platform/win/WinKeyboard.cpp | 5 +
.../VirtualBox/src/runtime/UIActionPoolRuntime.cpp | 1 +
.../VirtualBox/src/runtime/UIMachineLogic.cpp | 1 -
.../VirtualBox/src/runtime/UIMachineView.cpp | 22 +-
.../VirtualBox/src/runtime/UIMouseHandler.cpp | 4 +-
.../VirtualBox/src/runtime/UIMultiScreenLayout.cpp | 10 +-
.../Frontends/VirtualBox/src/runtime/UISession.cpp | 36 +-
.../Frontends/VirtualBox/src/runtime/UISession.h | 7 +
.../fullscreen/UIMachineLogicFullscreen.cpp | 5 +-
.../runtime/fullscreen/UIMachineViewFullscreen.cpp | 5 +-
.../fullscreen/UIMachineWindowFullscreen.cpp | 7 +-
.../src/runtime/normal/UIMachineViewNormal.cpp | 17 +-
.../src/runtime/normal/UIMachineWindowNormal.cpp | 11 +-
.../src/runtime/scale/UIMachineViewScale.cpp | 3 +-
.../src/runtime/scale/UIMachineWindowScale.cpp | 5 +-
.../runtime/seamless/UIMachineLogicSeamless.cpp | 1 -
.../src/runtime/seamless/UIMachineViewSeamless.cpp | 5 +-
.../runtime/seamless/UIMachineWindowSeamless.cpp | 7 +-
.../VirtualBox/src/selector/UISelectorWindow.cpp | 4 +-
.../global/UIGlobalSettingsPortForwardingDlg.cpp | 11 +-
.../settings/machine/UIMachineSettingsDisplay.cpp | 6 +-
.../machine/UIMachineSettingsPortForwardingDlg.cpp | 9 +-
.../VirtualBox/src/widgets/UIMiniToolBar.cpp | 1 -
.../src/widgets/UINameAndSystemEditor.cpp | 8 +-
.../src/widgets/UIPortForwardingTable.cpp | 85 +-
.../VirtualBox/src/widgets/UIPortForwardingTable.h | 35 +-
.../src/wizards/newvm/UIWizardNewVMPageBasic1.cpp | 10 +-
src/VBox/GuestHost/DragAndDrop/DnDDir.cpp | 9 +-
src/VBox/GuestHost/DragAndDrop/DnDMIME.cpp | 7 +-
src/VBox/GuestHost/DragAndDrop/DnDPath.cpp | 7 +-
src/VBox/GuestHost/DragAndDrop/DnDURIList.cpp | 27 +-
src/VBox/GuestHost/DragAndDrop/DnDURIObject.cpp | 19 +-
src/VBox/GuestHost/OpenGL/error/error.py | 0
src/VBox/GuestHost/OpenGL/glapi_parser/apiutil.py | 0
src/VBox/GuestHost/OpenGL/packer/pack_header.py | 0
src/VBox/GuestHost/OpenGL/packer/packer_bbox.py | 0
src/VBox/GuestHost/OpenGL/spu_loader/dispatch.py | 0
.../GuestHost/OpenGL/spu_loader/dispatchheader.py | 0
src/VBox/GuestHost/OpenGL/spu_loader/glloader.py | 0
src/VBox/GuestHost/OpenGL/spu_loader/spuchange.py | 0
src/VBox/GuestHost/OpenGL/spu_loader/spucopy.py | 0
.../GuestHost/OpenGL/state_tracker/state_defs.py | 0
.../GuestHost/OpenGL/state_tracker/state_funcs.py | 0
.../GuestHost/OpenGL/state_tracker/state_init.c | 2 +-
.../OpenGL/state_tracker/state_isenabled.py | 0
src/VBox/GuestHost/OpenGL/util/debug_opcodes.py | 0
src/VBox/GuestHost/OpenGL/util/vboxhgcm.c | 4 +-
src/VBox/GuestHost/OpenGL/util/vboxhgsmi.c | 4 +-
src/VBox/GuestHost/SharedClipboard/Makefile.kmk | 2 +-
.../GuestHost/SharedClipboard/x11-clipboard.cpp | 2 +-
src/VBox/HostDrivers/Support/SUPDrv-dtrace.cpp | 24 +-
src/VBox/HostDrivers/Support/SUPDrv.cpp | 117 +-
src/VBox/HostDrivers/Support/SUPDrvGip.cpp | 25 +-
src/VBox/HostDrivers/Support/SUPDrvIOC.h | 20 +-
src/VBox/HostDrivers/Support/SUPDrvInternal.h | 3 +-
src/VBox/HostDrivers/Support/SUPDrvSem.cpp | 7 +-
src/VBox/HostDrivers/Support/SUPDrvTracer.cpp | 30 +-
src/VBox/HostDrivers/Support/SUPLib.cpp | 31 +-
src/VBox/HostDrivers/Support/SUPLibAll.cpp | 7 +-
src/VBox/HostDrivers/Support/SUPLibLdr.cpp | 92 +-
src/VBox/HostDrivers/Support/SUPLibSem.cpp | 6 +-
src/VBox/HostDrivers/Support/SUPR0-def-lx.sed | 4 +-
src/VBox/HostDrivers/Support/SUPR0-def-pe.sed | 4 +-
src/VBox/HostDrivers/Support/SUPR0IdcClient.c | 13 +-
.../HostDrivers/Support/SUPR0IdcClientComponent.c | 7 +-
src/VBox/HostDrivers/Support/SUPR0IdcClientStubs.c | 7 +-
src/VBox/HostDrivers/Support/SUPR3HardenedIPRT.cpp | 7 +-
src/VBox/HostDrivers/Support/SUPR3HardenedMain.cpp | 31 +-
.../HostDrivers/Support/SUPR3HardenedNoCrt.cpp | 7 +-
.../HostDrivers/Support/SUPR3HardenedVerify.cpp | 23 +-
src/VBox/HostDrivers/Support/SUPSvc.cpp | 19 +-
src/VBox/HostDrivers/Support/SUPSvcGlobal.cpp | 7 +-
src/VBox/HostDrivers/Support/SUPSvcGrant.cpp | 19 +-
.../HostDrivers/Support/darwin/SUPDrv-darwin.cpp | 65 +-
.../HostDrivers/Support/darwin/SUPLib-darwin.cpp | 13 +-
.../Support/darwin/SUPR0IdcClient-darwin.c | 7 +-
.../HostDrivers/Support/freebsd/SUPDrv-freebsd.c | 20 +-
.../HostDrivers/Support/freebsd/SUPLib-freebsd.cpp | 14 +-
.../Support/freebsd/SUPR0IdcClient-freebsd.c | 7 +-
src/VBox/HostDrivers/Support/linux/SUPDrv-linux.c | 27 +-
.../HostDrivers/Support/linux/SUPLib-linux.cpp | 13 +-
.../Support/linux/SUPR0IdcClient-linux.c | 7 +-
src/VBox/HostDrivers/Support/os2/SUPDrv-os2.cpp | 19 +-
src/VBox/HostDrivers/Support/os2/SUPLib-os2.cpp | 13 +-
.../HostDrivers/Support/os2/SUPR0IdcClient-os2.c | 7 +-
.../HostDrivers/Support/solaris/SUPDrv-solaris.c | 25 +-
.../HostDrivers/Support/solaris/SUPLib-solaris.cpp | 13 +-
.../Support/solaris/SUPR0IdcClient-solaris.c | 7 +-
src/VBox/HostDrivers/Support/testcase/Makefile.kmk | 26 +-
.../HostDrivers/Support/testcase/SUPInstall.cpp | 6 +-
.../HostDrivers/Support/testcase/SUPLoggerCtl.cpp | 7 +-
.../HostDrivers/Support/testcase/SUPUninstall.cpp | 6 +-
.../HostDrivers/Support/testcase/tstContiguous.cpp | 6 +-
src/VBox/HostDrivers/Support/testcase/tstGIP-2.cpp | 131 +-
.../Support/testcase/tstGetPagingMode.cpp | 6 +-
src/VBox/HostDrivers/Support/testcase/tstInit.cpp | 6 +-
src/VBox/HostDrivers/Support/testcase/tstInt.cpp | 6 +-
src/VBox/HostDrivers/Support/testcase/tstLow.cpp | 6 +-
.../Support/testcase/tstNtQueryStuff.cpp | 18 +-
src/VBox/HostDrivers/Support/testcase/tstPage.cpp | 6 +-
src/VBox/HostDrivers/Support/testcase/tstPin.cpp | 6 +-
.../Support/testcase/tstSupLoadModule.cpp | 8 +-
.../Support/testcase/tstSupSem-Zombie.cpp | 12 +-
.../HostDrivers/Support/testcase/tstSupSem.cpp | 12 +-
.../Support/testcase/tstSupTscDelta.cpp | 7 +-
src/VBox/HostDrivers/Support/win/SUPDrv-win.cpp | 143 +-
.../Support/win/SUPHardenedVerifyImage-win.cpp | 53 +-
.../Support/win/SUPHardenedVerifyProcess-win.cpp | 23 +-
src/VBox/HostDrivers/Support/win/SUPLib-win.cpp | 26 +-
.../HostDrivers/Support/win/SUPR0IdcClient-win.c | 13 +-
.../Support/win/SUPR3HardenedMain-win.cpp | 37 +-
.../Support/win/SUPR3HardenedMainA-win.asm | 12 +
.../Support/win/SUPR3HardenedMainImports-win.cpp | 89 +-
.../Support/win/SUPR3HardenedNoCrt-win.cpp | 27 +-
src/VBox/HostDrivers/Support/win/SUPSvc-win.cpp | 25 +-
.../HostDrivers/Support/win/VBoxSupLib-win.cpp | 6 +-
src/VBox/HostDrivers/VBoxNetAdp/VBoxNetAdp.c | 13 +-
.../VBoxNetAdp/darwin/VBoxNetAdp-darwin.cpp | 28 +-
.../VBoxNetAdp/freebsd/VBoxNetAdp-freebsd.c | 7 +-
.../VBoxNetAdp/linux/VBoxNetAdp-linux.c | 28 +-
.../VBoxNetAdp/solaris/VBoxNetAdp-solaris.c | 38 +-
src/VBox/HostDrivers/VBoxNetFlt/VBoxNetFlt.c | 13 +-
.../VBoxNetFlt/darwin/VBoxNetFlt-darwin.cpp | 31 +-
.../VBoxNetFlt/freebsd/VBoxNetFlt-freebsd.c | 7 +-
.../VBoxNetFlt/linux/VBoxNetFlt-linux.c | 28 +-
.../VBoxNetFlt/solaris/VBoxNetFlt-solaris.c | 39 +-
.../VBoxNetFlt/solaris/VBoxNetFltBow-solaris.c | 38 +-
.../HostDrivers/VBoxNetFlt/win/cfg/VBoxNetCfg.cpp | 37 +-
.../VBoxNetFlt/win/drv/VBoxNetLwf-win.cpp | 50 +-
src/VBox/HostDrivers/VBoxPci/linux/VBoxPci-linux.c | 22 +-
src/VBox/HostDrivers/VBoxUSB/USBFilter.cpp | 6 +-
src/VBox/HostDrivers/VBoxUSB/USBLib.cpp | 6 +-
src/VBox/HostDrivers/VBoxUSB/VBoxUSBFilterMgr.cpp | 25 +-
.../HostDrivers/VBoxUSB/darwin/USBLib-darwin.cpp | 19 +-
src/VBox/HostDrivers/VBoxUSB/darwin/VBoxUSB.cpp | 30 +-
.../VBoxUSB/darwin/testcase/tstOpenUSBDev.cpp | 8 +-
.../HostDrivers/VBoxUSB/solaris/USBLib-solaris.cpp | 24 +-
.../HostDrivers/VBoxUSB/solaris/VBoxUSB-solaris.c | 38 +-
.../VBoxUSB/solaris/VBoxUSBMon-solaris.c | 46 +-
.../HostDrivers/VBoxUSB/testcase/tstUSBFilter.cpp | 20 +-
.../HostDrivers/VBoxUSB/win/Install/USBInstall.cpp | 6 +-
.../VBoxUSB/win/Install/USBUninstall.cpp | 6 +-
.../HostDrivers/VBoxUSB/win/lib/VBoxUsbLib-win.cpp | 20 +-
.../HostDrivers/VBoxUSB/win/mon/VBoxUsbFlt.cpp | 6 +-
.../HostDrivers/VBoxUSB/win/testcase/USBTest.cpp | 6 +-
src/VBox/HostServices/DragAndDrop/dndmanager.cpp | 14 +-
src/VBox/HostServices/DragAndDrop/service.cpp | 21 +-
src/VBox/HostServices/GuestControl/gctrl.cpp | 7 +-
src/VBox/HostServices/GuestControl/service.cpp | 7 +-
.../GuestControl/testcase/tstGuestControlSvc.cpp | 16 +-
src/VBox/HostServices/GuestProperties/service.cpp | 7 +-
.../GuestProperties/testcase/tstGuestPropSvc.cpp | 15 +-
.../testcase/tstSharedFolderService.cpp | 46 +-
.../SharedFolders/testcase/tstShflCase.cpp | 19 +-
.../SharedFolders/testcase/tstShflSizes.cpp | 7 +-
src/VBox/HostServices/SharedFolders/vbsf.cpp | 21 +
src/VBox/HostServices/SharedFolders/vbsfpath.h | 2 +-
src/VBox/HostServices/SharedOpenGL/Makefile.kmk | 4 -
.../SharedOpenGL/crserverlib/server_dispatch.py | 0
.../crserverlib/server_dispatch_header.py | 0
.../SharedOpenGL/crserverlib/server_get.py | 0
.../SharedOpenGL/crserverlib/server_retval.py | 0
.../HostServices/SharedOpenGL/dlm/dlm_generated.py | 0
.../HostServices/SharedOpenGL/expando/expando.py | 0
.../HostServices/SharedOpenGL/unpacker/unpack.py | 0
.../SharedOpenGL/unpacker/unpack_extend.py | 0
.../SharedOpenGL/unpacker/unpack_header.py | 0
src/VBox/HostServices/testcase/tstHGCMSvc.cpp | 7 +-
src/VBox/ImageMounter/VBoxFUSE/VBoxFUSE.cpp | 24 +-
src/VBox/Installer/darwin/Makefile.kmk | 11 +-
src/VBox/Installer/solaris/Makefile.kmk | 4 +-
src/VBox/Installer/solaris/VBoxISAExec.c | 7 +-
src/VBox/Installer/solaris/VBoxZoneAccess.c | 14 +-
.../Installer/win/InstallHelper/VBoxCommon.cpp | 6 +-
.../win/InstallHelper/VBoxInstallHelper.cpp | 12 +-
src/VBox/Installer/win/Stub/VBoxStub.cpp | 26 +-
src/VBox/Installer/win/Stub/VBoxStubCertUtil.cpp | 7 +-
src/VBox/Installer/win/StubBld/VBoxStubBld.cpp | 7 +-
src/VBox/Main/Makefile.kmk | 2 +-
src/VBox/Main/cbinding/VBoxCAPIGlue.c | 19 +-
src/VBox/Main/cbinding/tstCAPIGlue.c | 13 +-
src/VBox/Main/glue/AutoLock.cpp | 12 +-
src/VBox/Main/glue/com.cpp | 2 +-
src/VBox/Main/glue/constants-python.xsl | 0
src/VBox/Main/idl/VirtualBox.xidl | 6 +
src/VBox/Main/include/ApplianceImplPrivate.h | 2 +-
src/VBox/Main/include/GuestDnDPrivate.h | 71 +-
src/VBox/Main/include/GuestDnDSourceImpl.h | 4 +-
src/VBox/Main/include/GuestDnDTargetImpl.h | 6 +-
src/VBox/Main/include/GuestImpl.h | 5 +-
src/VBox/Main/include/GuestSessionImpl.h | 8 +-
src/VBox/Main/include/PerformanceImpl.h | 2 +-
src/VBox/Main/include/USBIdDatabase.h | 8 +-
src/VBox/Main/src-all/ExtPackManagerImpl.cpp | 18 +-
src/VBox/Main/src-all/ExtPackUtil.cpp | 6 +-
src/VBox/Main/src-all/HashedPw.cpp | 13 +-
src/VBox/Main/src-client/ConsoleImpl.cpp | 6 +-
src/VBox/Main/src-client/ConsoleImpl2.cpp | 15 +-
src/VBox/Main/src-client/ConsoleImplTeleporter.cpp | 18 +-
src/VBox/Main/src-client/DrvAudioVRDE.cpp | 15 +-
src/VBox/Main/src-client/GuestCtrlPrivate.cpp | 7 +-
src/VBox/Main/src-client/GuestDirectoryImpl.cpp | 6 +-
src/VBox/Main/src-client/GuestDnDPrivate.cpp | 2 +-
src/VBox/Main/src-client/GuestDnDSourceImpl.cpp | 109 +-
src/VBox/Main/src-client/GuestDnDTargetImpl.cpp | 249 ++-
src/VBox/Main/src-client/GuestFileImpl.cpp | 6 +-
src/VBox/Main/src-client/GuestFsObjInfoImpl.cpp | 6 +-
src/VBox/Main/src-client/GuestImpl.cpp | 5 +-
src/VBox/Main/src-client/GuestProcessImpl.cpp | 7 +-
src/VBox/Main/src-client/GuestSessionImpl.cpp | 6 +-
src/VBox/Main/src-client/GuestSessionImplTasks.cpp | 20 +-
src/VBox/Main/src-client/MachineDebuggerImpl.cpp | 7 +-
src/VBox/Main/src-client/Nvram.cpp | 19 +-
src/VBox/Main/src-client/UsbCardReader.cpp | 15 +-
src/VBox/Main/src-client/VBoxDriversRegister.cpp | 6 +-
src/VBox/Main/src-client/win/dllmain.cpp | 18 +-
.../Main/src-helper-apps/VBoxExtPackHelperApp.cpp | 18 +-
src/VBox/Main/src-helper-apps/VBoxVolInfo.cpp | 13 +-
src/VBox/Main/src-server/ApplianceImpl.cpp | 2 +-
src/VBox/Main/src-server/ApplianceImplIO.cpp | 86 +-
src/VBox/Main/src-server/HostDnsService.cpp | 2 +-
src/VBox/Main/src-server/HostDnsService.h | 2 +-
src/VBox/Main/src-server/HostPower.cpp | 6 +-
src/VBox/Main/src-server/HostUSBDeviceImpl.cpp | 3 +-
src/VBox/Main/src-server/MachineImpl.cpp | 1 +
src/VBox/Main/src-server/MachineImplCloneVM.cpp | 6 +-
src/VBox/Main/src-server/MediumImpl.cpp | 2 +-
src/VBox/Main/src-server/PerformanceImpl.cpp | 4 +-
.../Main/src-server/USBIdDatabaseGenerator.cpp | 157 +-
src/VBox/Main/src-server/USBIdDatabaseStub.cpp | 4 +-
src/VBox/Main/src-server/VFSExplorerImpl.cpp | 6 +-
src/VBox/Main/src-server/VirtualBoxImpl.cpp | 4 +-
src/VBox/Main/src-server/darwin/NetIf-darwin.cpp | 6 +-
.../src-server/darwin/USBProxyServiceDarwin.cpp | 6 +-
src/VBox/Main/src-server/darwin/iokit.cpp | 18 +-
.../src-server/freebsd/HostHardwareFreeBSD.cpp | 14 +-
src/VBox/Main/src-server/freebsd/NetIf-freebsd.cpp | 7 +-
.../src-server/freebsd/USBProxyServiceFreeBSD.cpp | 19 +-
.../Main/src-server/linux/HostHardwareLinux.cpp | 21 +-
src/VBox/Main/src-server/linux/HostPowerLinux.cpp | 18 +-
src/VBox/Main/src-server/linux/NetIf-linux.cpp | 6 +-
src/VBox/Main/src-server/linux/USBGetDevices.cpp | 20 +-
.../Main/src-server/linux/USBProxyServiceLinux.cpp | 6 +-
src/VBox/Main/src-server/os2/NetIf-os2.cpp | 6 +-
.../Main/src-server/os2/USBProxyServiceOs2.cpp | 6 +-
src/VBox/Main/src-server/solaris/NetIf-solaris.cpp | 6 +-
.../src-server/solaris/USBProxyServiceSolaris.cpp | 19 +-
src/VBox/Main/src-server/win/HostPowerWin.cpp | 7 +-
src/VBox/Main/src-server/win/NetIf-win.cpp | 335 ++-
.../Main/src-server/win/USBProxyServiceWindows.cpp | 6 +-
src/VBox/Main/src-server/xpcom/server.cpp | 2 +-
src/VBox/Main/testcase/tstCollector.cpp | 11 +-
src/VBox/Main/testcase/tstGuid.cpp | 7 +-
src/VBox/Main/testcase/tstUSBProxyLinux.cpp | 7 +-
src/VBox/Main/testcase/tstVBoxAPI.cpp | 12 +-
src/VBox/Main/testcase/tstVBoxAPIPerf.cpp | 12 +-
src/VBox/Main/webservice/Makefile.kmk | 5 +-
src/VBox/Main/webservice/vboxweb.cpp | 9 +-
.../NetworkServices/DHCP/NetworkManagerDhcp.cpp | 7 +-
src/VBox/NetworkServices/DHCP/VBoxNetDHCP.cpp | 22 +-
src/VBox/NetworkServices/NAT/VBoxNetLwipNAT.cpp | 75 +-
src/VBox/NetworkServices/NetLib/ComHostUtils.cpp | 7 +-
src/VBox/NetworkServices/NetLib/VBoxNetARP.cpp | 7 +-
.../NetworkServices/NetLib/VBoxNetBaseService.cpp | 24 +-
src/VBox/NetworkServices/NetLib/VBoxNetIntIf.cpp | 7 +-
.../NetLib/VBoxNetPortForwardString.cpp | 7 +-
src/VBox/NetworkServices/NetLib/VBoxNetUDP.cpp | 7 +-
src/VBox/RDP/client-1.8.3/rdesktop.c | 2 +-
src/VBox/Runtime/Makefile.kmk | 21 +-
src/VBox/Runtime/VBox/RTAssertShouldPanic-vbox.cpp | 6 +-
src/VBox/Runtime/VBox/VBoxRTDeps.cpp | 13 +-
src/VBox/Runtime/VBox/log-vbox.cpp | 12 +-
src/VBox/Runtime/VBox/logbackdoor-redirect.cpp | 6 +-
src/VBox/Runtime/VBox/logbackdoor.cpp | 13 +-
src/VBox/Runtime/common/alloc/alloc.cpp | 10 +-
src/VBox/Runtime/common/alloc/heapoffset.cpp | 24 +-
src/VBox/Runtime/common/alloc/heapsimple.cpp | 24 +-
src/VBox/Runtime/common/alloc/memcache.cpp | 18 +-
src/VBox/Runtime/common/alloc/memtracker.cpp | 18 +-
src/VBox/Runtime/common/asm/asm-fake.cpp | 6 +-
src/VBox/Runtime/common/asn1/asn1-basics.cpp | 13 +-
src/VBox/Runtime/common/asn1/asn1-cursor.cpp | 19 +-
.../Runtime/common/asn1/asn1-default-allocator.cpp | 7 +-
src/VBox/Runtime/common/asn1/asn1-dump.cpp | 13 +-
.../Runtime/common/asn1/asn1-efence-allocator.cpp | 7 +-
src/VBox/Runtime/common/asn1/asn1-encode.cpp | 13 +-
.../common/asn1/asn1-ut-bitstring-decode.cpp | 7 +-
src/VBox/Runtime/common/asn1/asn1-ut-bitstring.cpp | 13 +-
.../Runtime/common/asn1/asn1-ut-boolean-decode.cpp | 7 +-
src/VBox/Runtime/common/asn1/asn1-ut-boolean.cpp | 13 +-
.../Runtime/common/asn1/asn1-ut-core-decode.cpp | 7 +-
src/VBox/Runtime/common/asn1/asn1-ut-core.cpp | 7 +-
.../Runtime/common/asn1/asn1-ut-dyntype-decode.cpp | 7 +-
src/VBox/Runtime/common/asn1/asn1-ut-dyntype.cpp | 7 +-
.../Runtime/common/asn1/asn1-ut-integer-decode.cpp | 7 +-
src/VBox/Runtime/common/asn1/asn1-ut-integer.cpp | 13 +-
.../Runtime/common/asn1/asn1-ut-null-decode.cpp | 7 +-
src/VBox/Runtime/common/asn1/asn1-ut-null.cpp | 7 +-
.../Runtime/common/asn1/asn1-ut-objid-decode.cpp | 19 +-
src/VBox/Runtime/common/asn1/asn1-ut-objid.cpp | 19 +-
.../common/asn1/asn1-ut-octetstring-decode.cpp | 7 +-
.../Runtime/common/asn1/asn1-ut-octetstring.cpp | 13 +-
.../Runtime/common/asn1/asn1-ut-string-decode.cpp | 7 +-
src/VBox/Runtime/common/asn1/asn1-ut-string.cpp | 13 +-
.../Runtime/common/asn1/asn1-ut-time-decode.cpp | 7 +-
src/VBox/Runtime/common/asn1/asn1-ut-time.cpp | 13 +-
src/VBox/Runtime/common/checksum/RTSha1Digest.cpp | 6 +-
.../Runtime/common/checksum/RTSha256Digest.cpp | 6 +-
src/VBox/Runtime/common/checksum/adler32.cpp | 12 +-
src/VBox/Runtime/common/checksum/alt-md2.cpp | 18 +-
src/VBox/Runtime/common/checksum/alt-md5.cpp | 13 +-
src/VBox/Runtime/common/checksum/alt-sha1.cpp | 41 +-
src/VBox/Runtime/common/checksum/alt-sha256.cpp | 48 +-
src/VBox/Runtime/common/checksum/alt-sha512.cpp | 78 +-
src/VBox/Runtime/common/checksum/crc32-zlib.cpp | 6 +-
src/VBox/Runtime/common/checksum/crc64.cpp | 12 +-
src/VBox/Runtime/common/checksum/ipv4.cpp | 6 +-
src/VBox/Runtime/common/checksum/ipv6.cpp | 6 +-
src/VBox/Runtime/common/checksum/manifest-file.cpp | 6 +-
src/VBox/Runtime/common/checksum/manifest.cpp | 14 +-
src/VBox/Runtime/common/checksum/manifest2.cpp | 12 +-
src/VBox/Runtime/common/checksum/manifest3.cpp | 12 +-
src/VBox/Runtime/common/checksum/md2str.cpp | 6 +-
src/VBox/Runtime/common/checksum/md5str.cpp | 6 +-
src/VBox/Runtime/common/checksum/openssl-md2.cpp | 6 +-
src/VBox/Runtime/common/checksum/openssl-md5.cpp | 6 +-
src/VBox/Runtime/common/checksum/openssl-sha1.cpp | 24 +-
.../Runtime/common/checksum/openssl-sha256.cpp | 36 +-
.../Runtime/common/checksum/openssl-sha512.cpp | 36 +-
src/VBox/Runtime/common/checksum/sha1str.cpp | 6 +-
src/VBox/Runtime/common/checksum/sha224str.cpp | 6 +-
src/VBox/Runtime/common/checksum/sha256str.cpp | 6 +-
src/VBox/Runtime/common/checksum/sha384str.cpp | 6 +-
src/VBox/Runtime/common/checksum/sha512str.cpp | 6 +-
src/VBox/Runtime/common/checksum/sha512t224str.cpp | 6 +-
src/VBox/Runtime/common/checksum/sha512t256str.cpp | 6 +-
src/VBox/Runtime/common/checksum/x509.cpp | 6 +-
.../common/crypto/RTCrStoreCertAddFromFile.cpp | 114 --
.../crypto/RTCrStoreCertAddFromJavaKeyStore.cpp | 310 +++
...RTCrStoreCertAddWantedFromFishingExpedition.cpp | 237 +++
.../common/crypto/RTCrStoreCertExportAsPem.cpp | 137 ++
src/VBox/Runtime/common/crypto/digest-builtin.cpp | 6 +-
src/VBox/Runtime/common/crypto/digest-core.cpp | 12 +-
src/VBox/Runtime/common/crypto/iprt-openssl.cpp | 6 +-
src/VBox/Runtime/common/crypto/pemfile.cpp | 254 ++-
.../Runtime/common/crypto/pkcs7-asn1-decoder.cpp | 6 +-
src/VBox/Runtime/common/crypto/pkcs7-core.cpp | 6 +-
src/VBox/Runtime/common/crypto/pkcs7-init.cpp | 6 +-
src/VBox/Runtime/common/crypto/pkcs7-sanity.cpp | 6 +-
src/VBox/Runtime/common/crypto/pkcs7-verify.cpp | 6 +-
.../common/crypto/pkix-signature-builtin.cpp | 12 +-
.../Runtime/common/crypto/pkix-signature-core.cpp | 12 +-
.../Runtime/common/crypto/pkix-signature-rsa.cpp | 18 +-
src/VBox/Runtime/common/crypto/pkix-util.cpp | 6 +-
src/VBox/Runtime/common/crypto/pkix-verify.cpp | 6 +-
.../Runtime/common/crypto/rsa-asn1-decoder.cpp | 6 +-
src/VBox/Runtime/common/crypto/rsa-core.cpp | 6 +-
src/VBox/Runtime/common/crypto/rsa-init.cpp | 6 +-
src/VBox/Runtime/common/crypto/rsa-sanity.cpp | 6 +-
.../Runtime/common/crypto/spc-asn1-decoder.cpp | 6 +-
src/VBox/Runtime/common/crypto/spc-core.cpp | 6 +-
src/VBox/Runtime/common/crypto/spc-init.cpp | 6 +-
src/VBox/Runtime/common/crypto/spc-sanity.cpp | 6 +-
.../Runtime/common/crypto/store-cert-add-basic.cpp | 849 ++++++++
src/VBox/Runtime/common/crypto/store-inmem.cpp | 43 +-
src/VBox/Runtime/common/crypto/store-internal.h | 3 +
src/VBox/Runtime/common/crypto/store.cpp | 40 +-
.../Runtime/common/crypto/taf-asn1-decoder.cpp | 6 +-
src/VBox/Runtime/common/crypto/taf-core.cpp | 6 +-
src/VBox/Runtime/common/crypto/taf-init.cpp | 6 +-
src/VBox/Runtime/common/crypto/taf-sanity.cpp | 6 +-
.../Runtime/common/crypto/tsp-asn1-decoder.cpp | 6 +-
src/VBox/Runtime/common/crypto/tsp-core.cpp | 6 +-
src/VBox/Runtime/common/crypto/tsp-init.cpp | 6 +-
src/VBox/Runtime/common/crypto/tsp-sanity.cpp | 6 +-
.../Runtime/common/crypto/x509-asn1-decoder.cpp | 6 +-
src/VBox/Runtime/common/crypto/x509-certpaths.cpp | 18 +-
src/VBox/Runtime/common/crypto/x509-core.cpp | 9 +-
src/VBox/Runtime/common/crypto/x509-file.cpp | 12 +-
src/VBox/Runtime/common/crypto/x509-init.cpp | 6 +-
src/VBox/Runtime/common/crypto/x509-sanity.cpp | 6 +-
src/VBox/Runtime/common/crypto/x509-verify.cpp | 6 +-
src/VBox/Runtime/common/dbg/dbg.cpp | 7 +-
src/VBox/Runtime/common/dbg/dbgas.cpp | 24 +-
src/VBox/Runtime/common/dbg/dbgcfg.cpp | 24 +-
src/VBox/Runtime/common/dbg/dbgmod.cpp | 24 +-
src/VBox/Runtime/common/dbg/dbgmodcodeview.cpp | 18 +-
src/VBox/Runtime/common/dbg/dbgmodcontainer.cpp | 12 +-
src/VBox/Runtime/common/dbg/dbgmoddbghelp.cpp | 12 +-
src/VBox/Runtime/common/dbg/dbgmoddeferred.cpp | 6 +-
src/VBox/Runtime/common/dbg/dbgmoddwarf.cpp | 36 +-
src/VBox/Runtime/common/dbg/dbgmodexports.cpp | 12 +-
src/VBox/Runtime/common/dbg/dbgmodldr.cpp | 12 +-
src/VBox/Runtime/common/dbg/dbgmodnm.cpp | 12 +-
src/VBox/Runtime/common/dvm/dvm.cpp | 20 +-
src/VBox/Runtime/common/dvm/dvmbsdlabel.cpp | 45 +-
src/VBox/Runtime/common/dvm/dvmgpt.cpp | 26 +-
src/VBox/Runtime/common/dvm/dvmmbr.cpp | 26 +-
src/VBox/Runtime/common/dvm/dvmvfs.cpp | 13 +-
.../Runtime/common/err/RTErrConvertFromErrno.cpp | 6 +-
.../Runtime/common/err/RTErrConvertToErrno.cpp | 6 +-
src/VBox/Runtime/common/err/errinfo-alloc.cpp | 6 +-
src/VBox/Runtime/common/err/errinfo.cpp | 6 +-
src/VBox/Runtime/common/err/errmsg.cpp | 12 +-
src/VBox/Runtime/common/err/errmsgxpcom.cpp | 13 +-
src/VBox/Runtime/common/filesystem/filesystem.cpp | 13 +-
.../Runtime/common/filesystem/filesystemext.cpp | 19 +-
src/VBox/Runtime/common/ldr/ldr.cpp | 6 +-
src/VBox/Runtime/common/ldr/ldrELF.cpp | 18 +-
src/VBox/Runtime/common/ldr/ldrEx.cpp | 6 +-
src/VBox/Runtime/common/ldr/ldrFile.cpp | 12 +-
src/VBox/Runtime/common/ldr/ldrMemory.cpp | 12 +-
src/VBox/Runtime/common/ldr/ldrNative.cpp | 6 +-
src/VBox/Runtime/common/ldr/ldrPE.cpp | 24 +-
src/VBox/Runtime/common/ldr/ldrkStuff.cpp | 12 +-
src/VBox/Runtime/common/log/log.cpp | 30 +-
src/VBox/Runtime/common/log/logcom.cpp | 18 +-
src/VBox/Runtime/common/log/logellipsis.cpp | 6 +-
src/VBox/Runtime/common/log/logformat.cpp | 12 +-
src/VBox/Runtime/common/log/logrel.cpp | 12 +-
src/VBox/Runtime/common/log/logrelellipsis.cpp | 6 +-
src/VBox/Runtime/common/log/tracebuf.cpp | 18 +-
src/VBox/Runtime/common/log/tracedefault.cpp | 12 +-
src/VBox/Runtime/common/math/bignum.cpp | 24 +-
src/VBox/Runtime/common/misc/RTAssertMsg1Weak.cpp | 6 +-
src/VBox/Runtime/common/misc/RTAssertMsg2.cpp | 6 +-
src/VBox/Runtime/common/misc/RTAssertMsg2Add.cpp | 6 +-
.../Runtime/common/misc/RTAssertMsg2AddWeak.cpp | 6 +-
.../Runtime/common/misc/RTAssertMsg2AddWeakV.cpp | 6 +-
src/VBox/Runtime/common/misc/RTAssertMsg2Weak.cpp | 6 +-
src/VBox/Runtime/common/misc/RTAssertMsg2WeakV.cpp | 6 +-
src/VBox/Runtime/common/misc/RTFileModeToFlags.cpp | 6 +-
src/VBox/Runtime/common/misc/RTFileOpenF.cpp | 6 +-
src/VBox/Runtime/common/misc/RTFileOpenV.cpp | 6 +-
.../Runtime/common/misc/RTMemWipeThoroughly.cpp | 8 +-
.../common/misc/RTSystemIsInsideVM-amd64-x86.cpp | 7 +-
src/VBox/Runtime/common/misc/aiomgr.cpp | 28 +-
src/VBox/Runtime/common/misc/assert.cpp | 12 +-
src/VBox/Runtime/common/misc/buildconfig.cpp | 6 +-
src/VBox/Runtime/common/misc/cidr.cpp | 6 +-
src/VBox/Runtime/common/misc/circbuf.cpp | 12 +-
src/VBox/Runtime/common/misc/getopt.cpp | 13 +-
src/VBox/Runtime/common/misc/getoptargv.cpp | 13 +-
src/VBox/Runtime/common/misc/handle.cpp | 6 +-
src/VBox/Runtime/common/misc/handletable.cpp | 6 +-
src/VBox/Runtime/common/misc/handletablectx.cpp | 6 +-
src/VBox/Runtime/common/misc/handletablesimple.cpp | 6 +-
src/VBox/Runtime/common/misc/http.cpp | 843 +++++---
src/VBox/Runtime/common/misc/lockvalidator.cpp | 31 +-
src/VBox/Runtime/common/misc/message.cpp | 13 +-
src/VBox/Runtime/common/misc/once.cpp | 12 +-
src/VBox/Runtime/common/misc/req.cpp | 12 +-
src/VBox/Runtime/common/misc/reqpool.cpp | 18 +-
src/VBox/Runtime/common/misc/reqqueue.cpp | 6 +-
src/VBox/Runtime/common/misc/s3.cpp | 38 +-
src/VBox/Runtime/common/misc/semspingpong.cpp | 12 +-
src/VBox/Runtime/common/misc/sg.cpp | 6 +-
src/VBox/Runtime/common/misc/term.cpp | 19 +-
src/VBox/Runtime/common/misc/thread.cpp | 24 +-
src/VBox/Runtime/common/misc/uri.cpp | 33 +-
src/VBox/Runtime/common/net/macstr.cpp | 7 +-
src/VBox/Runtime/common/net/netaddrstr.cpp | 6 +-
src/VBox/Runtime/common/net/netaddrstr2.cpp | 7 +-
src/VBox/Runtime/common/path/RTPathAbsDup.cpp | 6 +-
src/VBox/Runtime/common/path/RTPathAbsEx.cpp | 6 +-
src/VBox/Runtime/common/path/RTPathAbsExDup.cpp | 6 +-
src/VBox/Runtime/common/path/RTPathAppend.cpp | 6 +-
src/VBox/Runtime/common/path/RTPathAppendEx.cpp | 6 +-
.../Runtime/common/path/RTPathCalcRelative.cpp | 6 +-
.../common/path/RTPathChangeToDosSlashes.cpp | 6 +-
.../common/path/RTPathChangeToUnixSlashes.cpp | 6 +-
.../Runtime/common/path/RTPathCopyComponents.cpp | 6 +-
.../Runtime/common/path/RTPathCountComponents.cpp | 6 +-
...Slash.cpp => RTPathEnsureTrailingSeparator.cpp} | 46 +-
src/VBox/Runtime/common/path/RTPathExt.cpp | 6 +-
src/VBox/Runtime/common/path/RTPathFilename.cpp | 6 +-
src/VBox/Runtime/common/path/RTPathGlob.cpp | 2140 ++++++++++++++++++++
src/VBox/Runtime/common/path/RTPathHasExt.cpp | 6 +-
src/VBox/Runtime/common/path/RTPathHasPath.cpp | 6 +-
src/VBox/Runtime/common/path/RTPathJoin.cpp | 6 +-
src/VBox/Runtime/common/path/RTPathJoinA.cpp | 6 +-
src/VBox/Runtime/common/path/RTPathJoinEx.cpp | 6 +-
src/VBox/Runtime/common/path/RTPathParse.cpp | 6 +-
src/VBox/Runtime/common/path/RTPathParseSimple.cpp | 6 +-
.../Runtime/common/path/RTPathParsedReassemble.cpp | 6 +-
src/VBox/Runtime/common/path/RTPathRealDup.cpp | 6 +-
src/VBox/Runtime/common/path/RTPathRmCmd.cpp | 24 +-
src/VBox/Runtime/common/path/RTPathSplit.cpp | 6 +-
src/VBox/Runtime/common/path/RTPathSplitA.cpp | 6 +-
.../Runtime/common/path/RTPathSplitReassemble.cpp | 6 +-
.../Runtime/common/path/RTPathStartsWithRoot.cpp | 6 +-
src/VBox/Runtime/common/path/RTPathStripExt.cpp | 6 +-
.../Runtime/common/path/RTPathStripFilename.cpp | 6 +-
.../common/path/RTPathStripTrailingSlash.cpp | 6 +-
.../Runtime/common/path/RTPathTraverseList.cpp | 6 +-
src/VBox/Runtime/common/path/comparepaths.cpp | 6 +-
src/VBox/Runtime/common/path/rtPathRootSpecLen.cpp | 6 +-
.../Runtime/common/path/rtPathVolumeSpecLen.cpp | 6 +-
src/VBox/Runtime/common/rand/rand.cpp | 30 +-
src/VBox/Runtime/common/rand/randadv.cpp | 32 +-
src/VBox/Runtime/common/rand/randparkmiller.cpp | 9 +-
src/VBox/Runtime/common/sort/RTSortApvIsSorted.cpp | 6 +-
src/VBox/Runtime/common/sort/RTSortIsSorted.cpp | 6 +-
src/VBox/Runtime/common/sort/shellsort.cpp | 6 +-
src/VBox/Runtime/common/string/RTStrCat.cpp | 6 +-
src/VBox/Runtime/common/string/RTStrCatEx.cpp | 6 +-
src/VBox/Runtime/common/string/RTStrCatP.cpp | 6 +-
src/VBox/Runtime/common/string/RTStrCatPEx.cpp | 6 +-
src/VBox/Runtime/common/string/RTStrCmp.cpp | 6 +-
src/VBox/Runtime/common/string/RTStrCopy.cpp | 6 +-
src/VBox/Runtime/common/string/RTStrCopyEx.cpp | 6 +-
src/VBox/Runtime/common/string/RTStrCopyP.cpp | 6 +-
src/VBox/Runtime/common/string/RTStrCopyPEx.cpp | 6 +-
src/VBox/Runtime/common/string/RTStrNCmp.cpp | 6 +-
src/VBox/Runtime/common/string/RTStrNLen.cpp | 6 +-
src/VBox/Runtime/common/string/RTStrNLenEx.cpp | 7 +-
.../Runtime/common/string/RTStrPrintHexBytes.cpp | 6 +-
src/VBox/Runtime/common/string/RTStrStr.cpp | 6 +-
src/VBox/Runtime/common/string/RTUtf16Cat.cpp | 6 +-
src/VBox/Runtime/common/string/RTUtf16CatAscii.cpp | 6 +-
src/VBox/Runtime/common/string/RTUtf16CmpAscii.cpp | 6 +-
src/VBox/Runtime/common/string/RTUtf16Copy.cpp | 6 +-
.../Runtime/common/string/RTUtf16CopyAscii.cpp | 6 +-
src/VBox/Runtime/common/string/RTUtf16End.cpp | 6 +-
.../Runtime/common/string/RTUtf16ICmpAscii.cpp | 6 +-
src/VBox/Runtime/common/string/RTUtf16NLen.cpp | 6 +-
src/VBox/Runtime/common/string/RTUtf16NLenEx.cpp | 7 +-
.../Runtime/common/string/RTUtf16PrintHexBytes.cpp | 6 +-
src/VBox/Runtime/common/string/base64.cpp | 18 +-
src/VBox/Runtime/common/string/memchr.cpp | 6 +-
src/VBox/Runtime/common/string/memchr_alias.c | 6 +-
src/VBox/Runtime/common/string/memcmp.cpp | 6 +-
src/VBox/Runtime/common/string/memcmp_alias.c | 6 +-
src/VBox/Runtime/common/string/memcpy.cpp | 6 +-
src/VBox/Runtime/common/string/memcpy_alias.c | 6 +-
src/VBox/Runtime/common/string/memmove_alias.c | 6 +-
src/VBox/Runtime/common/string/memset.cpp | 6 +-
src/VBox/Runtime/common/string/memset_alias.c | 6 +-
src/VBox/Runtime/common/string/ministring.cpp | 18 +-
src/VBox/Runtime/common/string/simplepattern.cpp | 6 +-
src/VBox/Runtime/common/string/straprintf.cpp | 18 +-
src/VBox/Runtime/common/string/strcache.cpp | 24 +-
src/VBox/Runtime/common/string/strchr_alias.c | 6 +-
src/VBox/Runtime/common/string/strcmp_alias.c | 6 +-
src/VBox/Runtime/common/string/strcpy.cpp | 6 +-
src/VBox/Runtime/common/string/strcpy_alias.c | 6 +-
src/VBox/Runtime/common/string/strformat.cpp | 18 +-
src/VBox/Runtime/common/string/strformatnum.cpp | 6 +-
src/VBox/Runtime/common/string/strformatrt.cpp | 13 +-
src/VBox/Runtime/common/string/strformattype.cpp | 24 +-
src/VBox/Runtime/common/string/strhash1.cpp | 6 +-
src/VBox/Runtime/common/string/stringalloc.cpp | 6 +-
src/VBox/Runtime/common/string/strlen.cpp | 6 +-
src/VBox/Runtime/common/string/strlen_alias.c | 6 +-
src/VBox/Runtime/common/string/strpbrk.cpp | 6 +-
src/VBox/Runtime/common/string/strprintf.cpp | 18 +-
src/VBox/Runtime/common/string/strspace.cpp | 12 +-
src/VBox/Runtime/common/string/strstrip.cpp | 6 +-
src/VBox/Runtime/common/string/strtonum.cpp | 12 +-
src/VBox/Runtime/common/string/strversion.cpp | 12 +-
src/VBox/Runtime/common/string/uni.cpp | 6 +-
src/VBox/Runtime/common/string/uniread.cpp | 13 +-
src/VBox/Runtime/common/string/utf-16-case.cpp | 6 +-
src/VBox/Runtime/common/string/utf-16-latin-1.cpp | 6 +-
src/VBox/Runtime/common/string/utf-16.cpp | 6 +-
src/VBox/Runtime/common/string/utf-8-case.cpp | 6 +-
src/VBox/Runtime/common/string/utf-8-case2.cpp | 6 +-
src/VBox/Runtime/common/string/utf-8.cpp | 6 +-
src/VBox/Runtime/common/table/avlgcphys.cpp | 13 +-
src/VBox/Runtime/common/table/avlgcptr.cpp | 13 +-
src/VBox/Runtime/common/table/avlhcphys.cpp | 13 +-
src/VBox/Runtime/common/table/avllu32.cpp | 13 +-
src/VBox/Runtime/common/table/avlogcphys.cpp | 13 +-
src/VBox/Runtime/common/table/avlogcptr.cpp | 13 +-
src/VBox/Runtime/common/table/avlohcphys.cpp | 13 +-
src/VBox/Runtime/common/table/avloioport.cpp | 13 +-
src/VBox/Runtime/common/table/avlou32.cpp | 13 +-
src/VBox/Runtime/common/table/avlpv.cpp | 13 +-
src/VBox/Runtime/common/table/avlrfoff.cpp | 13 +-
src/VBox/Runtime/common/table/avlrgcptr.cpp | 13 +-
src/VBox/Runtime/common/table/avlrogcphys.cpp | 13 +-
src/VBox/Runtime/common/table/avlrogcptr.cpp | 13 +-
src/VBox/Runtime/common/table/avlroioport.cpp | 13 +-
src/VBox/Runtime/common/table/avlroogcptr.cpp | 13 +-
src/VBox/Runtime/common/table/avlrpv.cpp | 13 +-
src/VBox/Runtime/common/table/avlru64.cpp | 13 +-
src/VBox/Runtime/common/table/avlruintptr.cpp | 13 +-
src/VBox/Runtime/common/table/avlu32.cpp | 13 +-
src/VBox/Runtime/common/table/avluintptr.cpp | 13 +-
src/VBox/Runtime/common/table/avlul.cpp | 13 +-
src/VBox/Runtime/common/table/table.cpp | 7 +-
src/VBox/Runtime/common/time/time.cpp | 18 +-
src/VBox/Runtime/common/time/timeprog.cpp | 6 +-
src/VBox/Runtime/common/time/timesup.cpp | 18 +-
src/VBox/Runtime/common/time/timesupref.cpp | 7 +-
src/VBox/Runtime/common/time/timesysalias.cpp | 6 +-
src/VBox/Runtime/common/vfs/vfsbase.cpp | 18 +-
src/VBox/Runtime/common/vfs/vfschain.cpp | 12 +-
src/VBox/Runtime/common/vfs/vfsiosmisc.cpp | 6 +-
src/VBox/Runtime/common/vfs/vfsmemory.cpp | 24 +-
src/VBox/Runtime/common/vfs/vfsmisc.cpp | 6 +-
src/VBox/Runtime/common/vfs/vfsstdfile.cpp | 15 +-
src/VBox/Runtime/common/zip/gzipvfs.cpp | 18 +-
src/VBox/Runtime/common/zip/pkzip.cpp | 12 +-
src/VBox/Runtime/common/zip/pkzipvfs.cpp | 12 +-
src/VBox/Runtime/common/zip/tar.cpp | 18 +-
src/VBox/Runtime/common/zip/tarcmd.cpp | 18 +-
src/VBox/Runtime/common/zip/tarvfs.cpp | 12 +-
src/VBox/Runtime/common/zip/unzipcmd.cpp | 18 +-
src/VBox/Runtime/common/zip/xarvfs.cpp | 18 +-
src/VBox/Runtime/common/zip/zip.cpp | 22 +-
src/VBox/Runtime/darwin/RTErrConvertFromDarwin.cpp | 7 +-
.../Runtime/darwin/RTErrConvertFromDarwinCOM.cpp | 7 +-
.../Runtime/darwin/RTErrConvertFromDarwinIO.cpp | 7 +-
.../Runtime/darwin/RTErrConvertFromDarwinKern.cpp | 7 +-
src/VBox/Runtime/gc/initterm-gc.cpp | 12 +-
.../generic/RTAssertShouldPanic-generic.cpp | 6 +-
.../RTCrStoreCreateSnapshotById-generic.cpp | 152 ++
.../generic/RTDirCreateUniqueNumbered-generic.cpp | 6 +-
src/VBox/Runtime/generic/RTDirExists-generic.cpp | 6 +-
.../Runtime/generic/RTDirQueryInfo-generic.cpp | 6 +-
src/VBox/Runtime/generic/RTDirSetTimes-generic.cpp | 6 +-
src/VBox/Runtime/generic/RTEnvDupEx-generic.cpp | 6 +-
src/VBox/Runtime/generic/RTFileCopy-generic.cpp | 6 +-
src/VBox/Runtime/generic/RTFileExists-generic.cpp | 6 +-
src/VBox/Runtime/generic/RTFileMove-generic.cpp | 6 +-
.../Runtime/generic/RTFileQuerySize-generic.cpp | 6 +-
src/VBox/Runtime/generic/RTFileReadAll-generic.cpp | 6 +-
.../generic/RTFileReadAllByHandle-generic.cpp | 6 +-
.../generic/RTFileReadAllByHandleEx-generic.cpp | 6 +-
.../Runtime/generic/RTFileReadAllEx-generic.cpp | 6 +-
.../Runtime/generic/RTFileReadAllFree-generic.cpp | 6 +-
.../Runtime/generic/RTLogDefaultInit-generic.cpp | 6 +-
.../Runtime/generic/RTLogWriteDebugger-generic.cpp | 6 +-
.../Runtime/generic/RTLogWriteStdErr-generic.cpp | 6 +-
.../generic/RTLogWriteStdErr-stub-generic.cpp | 6 +-
.../Runtime/generic/RTLogWriteStdOut-generic.cpp | 6 +-
.../generic/RTLogWriteStdOut-stub-generic.cpp | 6 +-
.../Runtime/generic/RTLogWriteUser-generic.cpp | 6 +-
src/VBox/Runtime/generic/RTMpCpuId-generic.cpp | 6 +-
.../generic/RTMpCpuIdFromSetIndex-generic.cpp | 6 +-
.../generic/RTMpCpuIdToSetIndex-generic.cpp | 6 +-
.../Runtime/generic/RTMpGetArraySize-generic.cpp | 6 +-
.../Runtime/generic/RTMpGetCoreCount-generic.cpp | 6 +-
src/VBox/Runtime/generic/RTMpGetCount-generic.cpp | 6 +-
.../generic/RTMpGetCurFrequency-generic.cpp | 6 +-
.../generic/RTMpGetDescription-generic-stub.cpp | 6 +-
.../Runtime/generic/RTMpGetDescription-generic.cpp | 6 +-
.../Runtime/generic/RTMpGetMaxCpuId-generic.cpp | 6 +-
.../generic/RTMpGetMaxFrequency-generic.cpp | 6 +-
.../generic/RTMpGetOnlineCoreCount-generic.cpp | 6 +-
.../Runtime/generic/RTMpGetOnlineCount-generic.cpp | 6 +-
.../Runtime/generic/RTMpGetOnlineSet-generic.cpp | 6 +-
src/VBox/Runtime/generic/RTMpGetSet-generic.cpp | 6 +-
.../Runtime/generic/RTMpIsCpuOnline-generic.cpp | 6 +-
.../Runtime/generic/RTMpIsCpuPossible-generic.cpp | 6 +-
src/VBox/Runtime/generic/RTMpOnPair-generic.cpp | 12 +-
src/VBox/Runtime/generic/RTPathAbs-generic.cpp | 6 +-
.../generic/RTPathGetCurrentDrive-generic.cpp | 6 +-
.../generic/RTPathGetCurrentOnDrive-generic.cpp | 6 +-
src/VBox/Runtime/generic/RTPathIsSame-generic.cpp | 6 +-
.../Runtime/generic/RTProcDaemonize-generic.cpp | 6 +-
.../generic/RTProcIsRunningByName-generic.cpp | 6 +-
.../generic/RTProcessQueryUsernameA-generic.cpp | 6 +-
.../RTRandAdvCreateSystemFaster-generic.cpp | 8 +-
.../generic/RTRandAdvCreateSystemTruer-generic.cpp | 8 +-
.../generic/RTSemEventMultiWait-2-ex-generic.cpp | 6 +-
.../generic/RTSemEventMultiWait-generic.cpp | 6 +-
.../RTSemEventMultiWaitNoResume-2-ex-generic.cpp | 6 +-
.../generic/RTSemEventWait-2-ex-generic.cpp | 6 +-
.../Runtime/generic/RTSemEventWait-generic.cpp | 6 +-
.../RTSemEventWaitNoResume-2-ex-generic.cpp | 6 +-
.../Runtime/generic/RTSemMutexRequest-generic.cpp | 6 +-
.../generic/RTSemMutexRequestDebug-generic.cpp | 6 +-
.../generic/RTSystemQueryDmiString-generic.cpp | 6 +-
.../generic/RTSystemQueryOSInfo-generic.cpp | 6 +-
.../Runtime/generic/RTSystemShutdown-generic.cpp | 6 +-
.../generic/RTThreadGetAffinity-stub-generic.cpp | 6 +-
.../generic/RTThreadGetNativeState-generic.cpp | 6 +-
.../generic/RTThreadSetAffinity-stub-generic.cpp | 6 +-
.../generic/RTThreadSetAffinityToCpu-generic.cpp | 6 +-
.../generic/RTTimeLocalDeltaNano-generic.cpp | 6 +-
.../Runtime/generic/RTTimeLocalExplode-generic.cpp | 6 +-
.../Runtime/generic/RTTimeLocalNow-generic.cpp | 6 +-
src/VBox/Runtime/generic/RTTimerCreate-generic.cpp | 6 +-
.../Runtime/generic/RTTimerLRCreate-generic.cpp | 6 +-
src/VBox/Runtime/generic/RTUuidCreate-generic.cpp | 6 +-
src/VBox/Runtime/generic/cdrom-generic.cpp | 6 +-
src/VBox/Runtime/generic/createtemp-generic.cpp | 52 +-
src/VBox/Runtime/generic/critsect-generic.cpp | 6 +-
src/VBox/Runtime/generic/critsectrw-generic.cpp | 6 +-
src/VBox/Runtime/generic/env-generic.cpp | 18 +-
src/VBox/Runtime/generic/errvars-generic.cpp | 6 +-
src/VBox/Runtime/generic/fs-stubs-generic.cpp | 20 +-
src/VBox/Runtime/generic/mempool-generic.cpp | 42 +-
src/VBox/Runtime/generic/memsafer-generic.cpp | 28 +-
src/VBox/Runtime/generic/mppresent-generic.cpp | 6 +-
src/VBox/Runtime/generic/pathhost-generic.cpp | 6 +-
src/VBox/Runtime/generic/sched-generic.cpp | 6 +-
src/VBox/Runtime/generic/semfastmutex-generic.cpp | 6 +-
src/VBox/Runtime/generic/semrw-generic.cpp | 12 +-
.../Runtime/generic/semrw-lockless-generic.cpp | 18 +-
src/VBox/Runtime/generic/semxroads-generic.cpp | 18 +-
src/VBox/Runtime/generic/spinlock-generic.cpp | 18 +-
.../Runtime/generic/strcache-stubs-generic.cpp | 6 +-
src/VBox/Runtime/generic/timer-generic.cpp | 18 +-
src/VBox/Runtime/generic/timerlr-generic.cpp | 18 +-
src/VBox/Runtime/generic/tls-generic.cpp | 12 +-
src/VBox/Runtime/generic/utf16locale-generic.cpp | 6 +-
src/VBox/Runtime/generic/uuid-generic.cpp | 12 +-
src/VBox/Runtime/nt/NtProcessStartup-stub.cpp | 7 +-
src/VBox/Runtime/nt/RTErrConvertFromNtStatus.cpp | 6 +-
src/VBox/Runtime/os2/RTErrConvertFromOS2.cpp | 7 +-
.../Runtime/os2/rtSemWaitOs2ConvertTimeout.cpp | 12 +-
src/VBox/Runtime/r0drv/alloc-r0drv.cpp | 40 +-
.../darwin/RTLogWriteDebugger-r0drv-darwin.cpp | 6 +-
.../r0drv/darwin/RTLogWriteStdOut-r0drv-darwin.cpp | 6 +-
.../Runtime/r0drv/darwin/alloc-r0drv-darwin.cpp | 12 +-
.../Runtime/r0drv/darwin/assert-r0drv-darwin.cpp | 6 +-
.../r0drv/darwin/dbgkrnlinfo-r0drv-darwin.cpp | 18 +-
.../Runtime/r0drv/darwin/initterm-r0drv-darwin.cpp | 12 +-
.../Runtime/r0drv/darwin/memobj-r0drv-darwin.cpp | 12 +-
.../r0drv/darwin/memuserkernel-r0drv-darwin.cpp | 6 +-
src/VBox/Runtime/r0drv/darwin/mp-r0drv-darwin.cpp | 12 +-
.../Runtime/r0drv/darwin/process-r0drv-darwin.cpp | 6 +-
.../Runtime/r0drv/darwin/semevent-r0drv-darwin.cpp | 12 +-
.../r0drv/darwin/semeventmulti-r0drv-darwin.cpp | 18 +-
.../r0drv/darwin/semfastmutex-r0drv-darwin.cpp | 12 +-
.../Runtime/r0drv/darwin/semmutex-r0drv-darwin.cpp | 12 +-
.../Runtime/r0drv/darwin/spinlock-r0drv-darwin.cpp | 12 +-
.../Runtime/r0drv/darwin/thread-r0drv-darwin.cpp | 6 +-
.../Runtime/r0drv/darwin/thread2-r0drv-darwin.cpp | 6 +-
.../r0drv/darwin/threadpreempt-r0drv-darwin.cpp | 18 +-
.../Runtime/r0drv/darwin/time-r0drv-darwin.cpp | 6 +-
.../Runtime/r0drv/freebsd/alloc-r0drv-freebsd.c | 13 +-
.../Runtime/r0drv/freebsd/assert-r0drv-freebsd.c | 7 +-
.../Runtime/r0drv/freebsd/initterm-r0drv-freebsd.c | 7 +-
.../Runtime/r0drv/freebsd/memobj-r0drv-freebsd.c | 12 +-
.../r0drv/freebsd/memuserkernel-r0drv-freebsd.c | 6 +-
src/VBox/Runtime/r0drv/freebsd/mp-r0drv-freebsd.c | 6 +-
.../Runtime/r0drv/freebsd/process-r0drv-freebsd.c | 7 +-
.../Runtime/r0drv/freebsd/semevent-r0drv-freebsd.c | 13 +-
.../r0drv/freebsd/semeventmulti-r0drv-freebsd.c | 20 +-
.../r0drv/freebsd/semfastmutex-r0drv-freebsd.c | 13 +-
.../Runtime/r0drv/freebsd/semmutex-r0drv-freebsd.c | 12 +-
.../Runtime/r0drv/freebsd/spinlock-r0drv-freebsd.c | 13 +-
.../Runtime/r0drv/freebsd/thread-r0drv-freebsd.c | 7 +-
.../Runtime/r0drv/freebsd/thread2-r0drv-freebsd.c | 7 +-
.../Runtime/r0drv/freebsd/time-r0drv-freebsd.c | 6 +-
.../Runtime/r0drv/freebsd/timer-r0drv-freebsd.c | 18 +-
.../generic/RTMpIsCpuWorkPending-r0drv-generic.cpp | 6 +-
.../Runtime/r0drv/generic/RTMpOn-r0drv-generic.cpp | 6 +-
.../r0drv/generic/RTMpPokeCpu-r0drv-generic.cpp | 6 +-
.../RTThreadPreemptDisable-r0drv-generic.cpp | 6 +-
.../RTThreadPreemptIsEnabled-r0drv-generic.cpp | 6 +-
.../RTThreadPreemptIsPending-r0drv-generic.cpp | 6 +-
...TThreadPreemptIsPendingTrusty-r0drv-generic.cpp | 6 +-
.../RTThreadPreemptRestore-r0drv-generic.cpp | 6 +-
.../r0drv/generic/mpnotification-r0drv-generic.cpp | 6 +-
.../r0drv/generic/semspinmutex-r0drv-generic.c | 18 +-
.../r0drv/generic/threadctxhooks-r0drv-generic.cpp | 6 +-
.../r0drv/haiku/RTLogWriteDebugger-r0drv-haiku.c | 6 +-
.../r0drv/haiku/RTLogWriteStdOut-r0drv-haiku.c | 6 +-
src/VBox/Runtime/r0drv/haiku/alloc-r0drv-haiku.c | 10 +-
src/VBox/Runtime/r0drv/haiku/assert-r0drv-haiku.c | 6 +-
.../Runtime/r0drv/haiku/initterm-r0drv-haiku.c | 6 +-
src/VBox/Runtime/r0drv/haiku/memobj-r0drv-haiku.c | 13 +-
src/VBox/Runtime/r0drv/haiku/mp-r0drv-haiku.c | 6 +-
src/VBox/Runtime/r0drv/haiku/process-r0drv-haiku.c | 6 +-
.../Runtime/r0drv/haiku/semevent-r0drv-haiku.c | 12 +-
.../r0drv/haiku/semeventmulti-r0drv-haiku.c | 13 +-
.../Runtime/r0drv/haiku/semfastmutex-r0drv-haiku.c | 12 +-
.../Runtime/r0drv/haiku/semmutex-r0drv-haiku.c | 12 +-
.../Runtime/r0drv/haiku/spinlock-r0drv-haiku.c | 12 +-
src/VBox/Runtime/r0drv/haiku/thread-r0drv-haiku.c | 6 +-
src/VBox/Runtime/r0drv/haiku/thread2-r0drv-haiku.c | 6 +-
src/VBox/Runtime/r0drv/haiku/time-r0drv-haiku.c | 6 +-
src/VBox/Runtime/r0drv/initterm-r0drv.cpp | 12 +-
.../r0drv/linux/RTLogWriteDebugger-r0drv-linux.c | 6 +-
src/VBox/Runtime/r0drv/linux/alloc-r0drv-linux.c | 18 +-
src/VBox/Runtime/r0drv/linux/assert-r0drv-linux.c | 6 +-
.../Runtime/r0drv/linux/initterm-r0drv-linux.c | 18 +-
src/VBox/Runtime/r0drv/linux/memobj-r0drv-linux.c | 18 +-
.../r0drv/linux/memuserkernel-r0drv-linux.c | 6 +-
src/VBox/Runtime/r0drv/linux/mp-r0drv-linux.c | 6 +-
.../r0drv/linux/mpnotification-r0drv-linux.c | 19 +-
src/VBox/Runtime/r0drv/linux/process-r0drv-linux.c | 6 +-
.../Runtime/r0drv/linux/semevent-r0drv-linux.c | 12 +-
.../r0drv/linux/semeventmulti-r0drv-linux.c | 18 +-
.../Runtime/r0drv/linux/semfastmutex-r0drv-linux.c | 12 +-
.../Runtime/r0drv/linux/semmutex-r0drv-linux.c | 12 +-
.../Runtime/r0drv/linux/spinlock-r0drv-linux.c | 12 +-
src/VBox/Runtime/r0drv/linux/thread-r0drv-linux.c | 12 +-
src/VBox/Runtime/r0drv/linux/thread2-r0drv-linux.c | 6 +-
.../r0drv/linux/threadctxhooks-r0drv-linux.c | 13 +-
src/VBox/Runtime/r0drv/linux/time-r0drv-linux.c | 6 +-
src/VBox/Runtime/r0drv/linux/timer-r0drv-linux.c | 18 +-
src/VBox/Runtime/r0drv/memobj-r0drv.cpp | 6 +-
src/VBox/Runtime/r0drv/mpnotification-r0drv.c | 18 +-
.../nt/RTTimerGetSystemGranularity-r0drv-nt.cpp | 7 +-
src/VBox/Runtime/r0drv/nt/alloc-r0drv-nt.cpp | 6 +-
src/VBox/Runtime/r0drv/nt/assert-r0drv-nt.cpp | 7 +-
src/VBox/Runtime/r0drv/nt/initterm-r0drv-nt.cpp | 13 +-
src/VBox/Runtime/r0drv/nt/memobj-r0drv-nt.cpp | 18 +-
.../Runtime/r0drv/nt/memuserkernel-r0drv-nt.cpp | 6 +-
src/VBox/Runtime/r0drv/nt/mp-r0drv-nt.cpp | 12 +-
.../Runtime/r0drv/nt/mpnotification-r0drv-nt.cpp | 19 +-
src/VBox/Runtime/r0drv/nt/ntBldSymDb.cpp | 20 +-
src/VBox/Runtime/r0drv/nt/process-r0drv-nt.cpp | 7 +-
src/VBox/Runtime/r0drv/nt/semevent-r0drv-nt.cpp | 12 +-
.../Runtime/r0drv/nt/semeventmulti-r0drv-nt.cpp | 12 +-
.../Runtime/r0drv/nt/semfastmutex-r0drv-nt.cpp | 12 +-
src/VBox/Runtime/r0drv/nt/semmutex-r0drv-nt.cpp | 12 +-
src/VBox/Runtime/r0drv/nt/spinlock-r0drv-nt.cpp | 18 +-
src/VBox/Runtime/r0drv/nt/thread-r0drv-nt.cpp | 13 +-
src/VBox/Runtime/r0drv/nt/thread2-r0drv-nt.cpp | 7 +-
src/VBox/Runtime/r0drv/nt/time-r0drv-nt.cpp | 6 +-
src/VBox/Runtime/r0drv/nt/timer-r0drv-nt.cpp | 13 +-
src/VBox/Runtime/r0drv/os2/alloc-r0drv-os2.cpp | 6 +-
src/VBox/Runtime/r0drv/os2/assert-r0drv-os2.cpp | 18 +-
src/VBox/Runtime/r0drv/os2/initterm-r0drv-os2.cpp | 13 +-
src/VBox/Runtime/r0drv/os2/memobj-r0drv-os2.cpp | 18 +-
.../Runtime/r0drv/os2/memuserkernel-r0drv-os2.cpp | 6 +-
src/VBox/Runtime/r0drv/os2/process-r0drv-os2.cpp | 6 +-
src/VBox/Runtime/r0drv/os2/semevent-r0drv-os2.cpp | 12 +-
.../Runtime/r0drv/os2/semeventmulti-r0drv-os2.cpp | 12 +-
.../Runtime/r0drv/os2/semfastmutex-r0drv-os2.cpp | 13 +-
src/VBox/Runtime/r0drv/os2/spinlock-r0drv-os2.cpp | 13 +-
src/VBox/Runtime/r0drv/os2/thread-r0drv-os2.cpp | 13 +-
src/VBox/Runtime/r0drv/os2/thread2-r0drv-os2.cpp | 7 +-
src/VBox/Runtime/r0drv/os2/time-r0drv-os2.cpp | 6 +-
src/VBox/Runtime/r0drv/os2/timer-r0drv-os2.cpp | 24 +-
src/VBox/Runtime/r0drv/powernotification-r0drv.c | 18 +-
.../solaris/RTLogWriteDebugger-r0drv-solaris.c | 6 +-
.../r0drv/solaris/RTMpPokeCpu-r0drv-solaris.c | 6 +-
.../Runtime/r0drv/solaris/alloc-r0drv-solaris.c | 12 +-
.../Runtime/r0drv/solaris/assert-r0drv-solaris.c | 6 +-
.../r0drv/solaris/dbgkrnlinfo-r0drv-solaris.c | 12 +-
.../Runtime/r0drv/solaris/initterm-r0drv-solaris.c | 12 +-
.../Runtime/r0drv/solaris/memobj-r0drv-solaris.c | 25 +-
.../r0drv/solaris/memuserkernel-r0drv-solaris.c | 6 +-
.../r0drv/solaris/modulestub-r0drv-solaris.c | 12 +-
src/VBox/Runtime/r0drv/solaris/mp-r0drv-solaris.c | 6 +-
.../r0drv/solaris/mpnotification-r0drv-solaris.c | 13 +-
.../Runtime/r0drv/solaris/process-r0drv-solaris.c | 6 +-
.../Runtime/r0drv/solaris/semevent-r0drv-solaris.c | 12 +-
.../r0drv/solaris/semeventmulti-r0drv-solaris.c | 18 +-
.../r0drv/solaris/semfastmutex-r0drv-solaris.c | 12 +-
.../Runtime/r0drv/solaris/semmutex-r0drv-solaris.c | 12 +-
.../Runtime/r0drv/solaris/spinlock-r0drv-solaris.c | 12 +-
.../Runtime/r0drv/solaris/thread-r0drv-solaris.c | 6 +-
.../Runtime/r0drv/solaris/thread2-r0drv-solaris.c | 6 +-
.../r0drv/solaris/threadctxhooks-r0drv-solaris.c | 18 +-
.../Runtime/r0drv/solaris/time-r0drv-solaris.c | 6 +-
.../Runtime/r0drv/solaris/timer-r0drv-solaris.c | 24 +-
src/VBox/Runtime/r3/alloc-ef-cpp.cpp | 28 +-
src/VBox/Runtime/r3/alloc-ef.cpp | 68 +-
src/VBox/Runtime/r3/alloc.cpp | 30 +-
src/VBox/Runtime/r3/allocex.cpp | 10 +-
.../darwin/RTCrStoreCreateSnapshotById-darwin.cpp | 249 +++
.../r3/darwin/RTPathUserDocuments-darwin.cpp | 7 +-
.../r3/darwin/RTSystemQueryDmiString-darwin.cpp | 12 +-
src/VBox/Runtime/r3/darwin/filelock-darwin.cpp | 6 +-
src/VBox/Runtime/r3/darwin/mp-darwin.cpp | 6 +-
src/VBox/Runtime/r3/darwin/pathhost-darwin.cpp | 6 +-
.../Runtime/r3/darwin/rtProcInitExePath-darwin.cpp | 7 +-
src/VBox/Runtime/r3/darwin/sched-darwin.cpp | 18 +-
src/VBox/Runtime/r3/darwin/systemmem-darwin.cpp | 6 +-
src/VBox/Runtime/r3/darwin/time-darwin.cpp | 12 +-
src/VBox/Runtime/r3/dir.cpp | 6 +-
src/VBox/Runtime/r3/dir2.cpp | 6 +-
src/VBox/Runtime/r3/fileio.cpp | 13 +-
src/VBox/Runtime/r3/freebsd/fileaio-freebsd.cpp | 19 +-
src/VBox/Runtime/r3/freebsd/mp-freebsd.cpp | 7 +-
.../r3/freebsd/rtProcInitExePath-freebsd.cpp | 7 +-
src/VBox/Runtime/r3/freebsd/systemmem-freebsd.cpp | 6 +-
src/VBox/Runtime/r3/fs.cpp | 6 +-
src/VBox/Runtime/r3/generic/allocex-r3-generic.cpp | 6 +-
.../Runtime/r3/generic/semspinmutex-r3-generic.cpp | 6 +-
.../Runtime/r3/haiku/rtProcInitExePath-haiku.cpp | 7 +-
src/VBox/Runtime/r3/haiku/time-haiku.cpp | 6 +-
src/VBox/Runtime/r3/init.cpp | 12 +-
src/VBox/Runtime/r3/isofs.cpp | 6 +-
.../r3/linux/RTProcIsRunningByName-linux.cpp | 7 +-
.../r3/linux/RTSystemQueryDmiString-linux.cpp | 6 +-
.../Runtime/r3/linux/RTSystemShutdown-linux.cpp | 6 +-
.../r3/linux/RTThreadGetNativeState-linux.cpp | 6 +-
src/VBox/Runtime/r3/linux/fileaio-linux.cpp | 19 +-
src/VBox/Runtime/r3/linux/mp-linux.cpp | 6 +-
.../Runtime/r3/linux/rtProcInitExePath-linux.cpp | 7 +-
src/VBox/Runtime/r3/linux/sched-linux.cpp | 24 +-
src/VBox/Runtime/r3/linux/semevent-linux.cpp | 13 +-
src/VBox/Runtime/r3/linux/semeventmulti-linux.cpp | 13 +-
src/VBox/Runtime/r3/linux/semmutex-linux.cpp | 13 +-
src/VBox/Runtime/r3/linux/sysfs.cpp | 6 +-
src/VBox/Runtime/r3/linux/systemmem-linux.cpp | 6 +-
.../Runtime/r3/linux/thread-affinity-linux.cpp | 6 +-
src/VBox/Runtime/r3/linux/time-linux.cpp | 6 +-
src/VBox/Runtime/r3/memsafer-r3.cpp | 34 +-
src/VBox/Runtime/r3/nt/RTProcQueryParent-r3-nt.cpp | 6 +-
src/VBox/Runtime/r3/nt/direnum-r3-nt.cpp | 12 +-
src/VBox/Runtime/r3/nt/fs-nt.cpp | 11 +-
src/VBox/Runtime/r3/nt/pathint-nt.cpp | 12 +-
src/VBox/Runtime/r3/nt/time-nt.cpp | 12 +-
src/VBox/Runtime/r3/os2/filelock-os2.cpp | 6 +-
src/VBox/Runtime/r3/os2/mp-os2.cpp | 6 +-
src/VBox/Runtime/r3/os2/pipe-os2.cpp | 18 +-
src/VBox/Runtime/r3/os2/rtProcInitExePath-os2.cpp | 7 +-
src/VBox/Runtime/r3/os2/sched-os2.cpp | 18 +-
src/VBox/Runtime/r3/os2/sems-os2.cpp | 6 +-
src/VBox/Runtime/r3/os2/systemmem-os2.cpp | 6 +-
src/VBox/Runtime/r3/os2/thread-os2.cpp | 18 +-
src/VBox/Runtime/r3/os2/time-os2.cpp | 6 +-
src/VBox/Runtime/r3/path.cpp | 6 +-
src/VBox/Runtime/r3/poll.cpp | 18 +-
.../Runtime/r3/posix/RTFileQueryFsSizes-posix.cpp | 6 +-
.../Runtime/r3/posix/RTHandleGetStandard-posix.cpp | 6 +-
src/VBox/Runtime/r3/posix/RTMemProtect-posix.cpp | 8 +-
src/VBox/Runtime/r3/posix/RTMpGetCount-posix.cpp | 6 +-
.../Runtime/r3/posix/RTPathUserDocuments-posix.cpp | 7 +-
src/VBox/Runtime/r3/posix/RTPathUserHome-posix.cpp | 6 +-
.../Runtime/r3/posix/RTSystemQueryOSInfo-posix.cpp | 7 +-
.../r3/posix/RTSystemQueryTotalRam-posix.cpp | 6 +-
src/VBox/Runtime/r3/posix/RTTimeNow-posix.cpp | 6 +-
src/VBox/Runtime/r3/posix/RTTimeSet-posix.cpp | 6 +-
src/VBox/Runtime/r3/posix/allocex-r3-posix.cpp | 6 +-
src/VBox/Runtime/r3/posix/dir-posix.cpp | 6 +-
src/VBox/Runtime/r3/posix/env-posix.cpp | 6 +-
src/VBox/Runtime/r3/posix/errvars-posix.cpp | 6 +-
src/VBox/Runtime/r3/posix/fileaio-posix.cpp | 13 +-
src/VBox/Runtime/r3/posix/fileio-posix.cpp | 12 +-
src/VBox/Runtime/r3/posix/fileio2-posix.cpp | 6 +-
src/VBox/Runtime/r3/posix/filelock-posix.cpp | 6 +-
src/VBox/Runtime/r3/posix/fs-posix.cpp | 20 +-
src/VBox/Runtime/r3/posix/fs2-posix.cpp | 6 +-
src/VBox/Runtime/r3/posix/fs3-posix.cpp | 6 +-
src/VBox/Runtime/r3/posix/ldrNative-posix.cpp | 7 +-
src/VBox/Runtime/r3/posix/path-posix.cpp | 6 +-
src/VBox/Runtime/r3/posix/path2-posix.cpp | 6 +-
src/VBox/Runtime/r3/posix/pathhost-posix.cpp | 12 +-
src/VBox/Runtime/r3/posix/pipe-posix.cpp | 18 +-
.../Runtime/r3/posix/process-creation-posix.cpp | 6 +-
src/VBox/Runtime/r3/posix/process-posix.cpp | 6 +-
src/VBox/Runtime/r3/posix/rand-posix.cpp | 12 +-
.../r3/posix/rtmempage-exec-mmap-heap-posix.cpp | 34 +-
.../Runtime/r3/posix/rtmempage-exec-mmap-posix.cpp | 16 +-
src/VBox/Runtime/r3/posix/sched-posix.cpp | 25 +-
src/VBox/Runtime/r3/posix/semevent-posix.cpp | 13 +-
src/VBox/Runtime/r3/posix/semeventmulti-posix.cpp | 19 +-
src/VBox/Runtime/r3/posix/semmutex-posix.cpp | 13 +-
src/VBox/Runtime/r3/posix/semrw-posix.cpp | 19 +-
src/VBox/Runtime/r3/posix/symlink-posix.cpp | 6 +-
src/VBox/Runtime/r3/posix/thread-posix.cpp | 24 +-
src/VBox/Runtime/r3/posix/thread2-posix.cpp | 6 +-
src/VBox/Runtime/r3/posix/time-posix.cpp | 6 +-
src/VBox/Runtime/r3/posix/timelocal-posix.cpp | 6 +-
src/VBox/Runtime/r3/posix/timer-posix.cpp | 25 +-
src/VBox/Runtime/r3/posix/tls-posix.cpp | 10 +-
src/VBox/Runtime/r3/posix/utf8-posix.cpp | 6 +-
src/VBox/Runtime/r3/process.cpp | 6 +-
src/VBox/Runtime/r3/socket.cpp | 18 +-
.../r3/solaris/RTSystemQueryDmiString-solaris.cpp | 6 +-
.../r3/solaris/RTSystemShutdown-solaris.cpp | 6 +-
src/VBox/Runtime/r3/solaris/coredumper-solaris.cpp | 18 +-
src/VBox/Runtime/r3/solaris/fileaio-solaris.cpp | 19 +-
src/VBox/Runtime/r3/solaris/mp-solaris.cpp | 13 +-
.../r3/solaris/rtProcInitExePath-solaris.cpp | 7 +-
src/VBox/Runtime/r3/solaris/systemmem-solaris.cpp | 12 +-
.../Runtime/r3/solaris/thread-affinity-solaris.cpp | 6 +-
src/VBox/Runtime/r3/stream.cpp | 19 +-
src/VBox/Runtime/r3/tcp.cpp | 24 +-
src/VBox/Runtime/r3/test.cpp | 30 +-
src/VBox/Runtime/r3/testi.cpp | 6 +-
src/VBox/Runtime/r3/udp.cpp | 24 +-
.../r3/win/RTCrStoreCreateSnapshotById-win.cpp | 169 ++
.../Runtime/r3/win/RTHandleGetStandard-win.cpp | 6 +-
src/VBox/Runtime/r3/win/RTLogWriteDebugger-win.cpp | 6 +-
.../Runtime/r3/win/RTSystemQueryDmiString-win.cpp | 6 +-
.../Runtime/r3/win/RTSystemQueryOSInfo-win.cpp | 13 +-
.../Runtime/r3/win/RTSystemQueryTotalRam-win.cpp | 6 +-
src/VBox/Runtime/r3/win/RTSystemShutdown-win.cpp | 6 +-
src/VBox/Runtime/r3/win/RTUuidCreate-win.cpp | 6 +-
src/VBox/Runtime/r3/win/VBoxRT-openssl.def | 2 +-
src/VBox/Runtime/r3/win/alloc-win.cpp | 18 +-
src/VBox/Runtime/r3/win/allocex-win.cpp | 6 +-
src/VBox/Runtime/r3/win/dir-win.cpp | 6 +-
src/VBox/Runtime/r3/win/direnum-win.cpp | 6 +-
src/VBox/Runtime/r3/win/dllmain-win.cpp | 6 +-
src/VBox/Runtime/r3/win/env-win.cpp | 6 +-
src/VBox/Runtime/r3/win/errvars-win.cpp | 6 +-
src/VBox/Runtime/r3/win/fileaio-win.cpp | 20 +-
src/VBox/Runtime/r3/win/fileio-win.cpp | 57 +-
src/VBox/Runtime/r3/win/fs-win.cpp | 12 +-
src/VBox/Runtime/r3/win/init-win.cpp | 12 +-
src/VBox/Runtime/r3/win/ldrNative-win.cpp | 7 +-
src/VBox/Runtime/r3/win/localipc-win.cpp | 25 +-
src/VBox/Runtime/r3/win/mp-win.cpp | 6 +-
src/VBox/Runtime/r3/win/path-win.cpp | 6 +-
src/VBox/Runtime/r3/win/pipe-win.cpp | 27 +-
src/VBox/Runtime/r3/win/process-win.cpp | 18 +-
.../r3/win/rtFileNativeSetAttributes-win.cpp | 7 +-
src/VBox/Runtime/r3/win/rtProcInitExePath-win.cpp | 7 +-
src/VBox/Runtime/r3/win/sched-win.cpp | 18 +-
src/VBox/Runtime/r3/win/semevent-win.cpp | 12 +-
src/VBox/Runtime/r3/win/semeventmulti-win.cpp | 12 +-
src/VBox/Runtime/r3/win/semmutex-win.cpp | 12 +-
src/VBox/Runtime/r3/win/symlink-win.cpp | 12 +-
src/VBox/Runtime/r3/win/thread-win.cpp | 18 +-
src/VBox/Runtime/r3/win/thread2-win.cpp | 6 +-
src/VBox/Runtime/r3/win/time-win.cpp | 6 +-
src/VBox/Runtime/r3/win/time2-win.cpp | 6 +-
src/VBox/Runtime/r3/win/timer-win.cpp | 12 +-
src/VBox/Runtime/r3/win/tls-win.cpp | 6 +-
src/VBox/Runtime/r3/win/utf16locale-win.cpp | 6 +-
src/VBox/Runtime/r3/win/utf8-win.cpp | 6 +-
src/VBox/Runtime/r3/win/uuid-win.cpp | 6 +-
src/VBox/Runtime/r3/win/vcc100-kernel32-fakes.cpp | 6 +-
src/VBox/Runtime/r3/xml.cpp | 12 +-
src/VBox/Runtime/testcase/Makefile.kmk | 8 +-
src/VBox/Runtime/testcase/ntGetTimerResolution.cpp | 6 +-
src/VBox/Runtime/testcase/tstDarwinSched.cpp | 6 +-
src/VBox/Runtime/testcase/tstEnv.cpp | 7 +-
src/VBox/Runtime/testcase/tstFile.cpp | 6 +-
src/VBox/Runtime/testcase/tstFileAppendWin-1.cpp | 12 +-
src/VBox/Runtime/testcase/tstFileLock.cpp | 6 +-
src/VBox/Runtime/testcase/tstFork.cpp | 6 +-
src/VBox/Runtime/testcase/tstHandleTable.cpp | 15 +-
src/VBox/Runtime/testcase/tstIprtList.cpp | 13 +-
src/VBox/Runtime/testcase/tstIprtMiniString.cpp | 7 +-
src/VBox/Runtime/testcase/tstLdr-2.cpp | 6 +-
src/VBox/Runtime/testcase/tstLdr-3.cpp | 12 +-
src/VBox/Runtime/testcase/tstLdr-4.cpp | 6 +-
src/VBox/Runtime/testcase/tstLdr.cpp | 12 +-
src/VBox/Runtime/testcase/tstLdrDisasmTest.cpp | 12 +-
src/VBox/Runtime/testcase/tstLdrObj.cpp | 12 +-
src/VBox/Runtime/testcase/tstLdrObjR0.cpp | 12 +-
src/VBox/Runtime/testcase/tstLog.cpp | 7 +-
src/VBox/Runtime/testcase/tstMemAutoPtr.cpp | 291 ---
src/VBox/Runtime/testcase/tstMove.cpp | 7 +-
src/VBox/Runtime/testcase/tstNoCrt-1.cpp | 19 +-
src/VBox/Runtime/testcase/tstOnce.cpp | 13 +-
src/VBox/Runtime/testcase/tstPrfRT.cpp | 7 +-
src/VBox/Runtime/testcase/tstRTAssertCompile.cpp | 6 +-
src/VBox/Runtime/testcase/tstRTAvl.cpp | 19 +-
src/VBox/Runtime/testcase/tstRTBase64.cpp | 19 +-
src/VBox/Runtime/testcase/tstRTBigNum.cpp | 13 +-
src/VBox/Runtime/testcase/tstRTBitOperations.cpp | 20 +-
src/VBox/Runtime/testcase/tstRTCType.cpp | 13 +-
src/VBox/Runtime/testcase/tstRTCidr.cpp | 12 +-
src/VBox/Runtime/testcase/tstRTCircBuf.cpp | 7 +-
src/VBox/Runtime/testcase/tstRTCoreDump.cpp | 13 +-
src/VBox/Runtime/testcase/tstRTCritSect.cpp | 21 +-
src/VBox/Runtime/testcase/tstRTCritSectRw.cpp | 13 +-
.../Runtime/testcase/tstRTDarwinMachKernel.cpp | 6 +-
src/VBox/Runtime/testcase/tstRTDigest-2.cpp | 19 +-
src/VBox/Runtime/testcase/tstRTDigest.cpp | 6 +-
.../testcase/tstRTDirCreateUniqueNumbered.cpp | 13 +-
src/VBox/Runtime/testcase/tstRTDvm.cpp | 16 +-
src/VBox/Runtime/testcase/tstRTErrUnique.cpp | 12 +-
src/VBox/Runtime/testcase/tstRTFileAio.cpp | 18 +-
src/VBox/Runtime/testcase/tstRTFileAppend-1.cpp | 6 +-
src/VBox/Runtime/testcase/tstRTFileGetSize-1.cpp | 7 +-
.../testcase/tstRTFileModeStringToFlags.cpp | 7 +-
src/VBox/Runtime/testcase/tstRTFilesystem.cpp | 12 +-
src/VBox/Runtime/testcase/tstRTFsQueries.cpp | 7 +-
src/VBox/Runtime/testcase/tstRTGetOpt.cpp | 6 +-
src/VBox/Runtime/testcase/tstRTGetOptArgv.cpp | 13 +-
src/VBox/Runtime/testcase/tstRTHeapOffset.cpp | 7 +-
src/VBox/Runtime/testcase/tstRTHeapSimple.cpp | 7 +-
src/VBox/Runtime/testcase/tstRTHttp.cpp | 24 +-
src/VBox/Runtime/testcase/tstRTInlineAsm.cpp | 19 +-
.../Runtime/testcase/tstRTLdrVerifyPeImage.cpp | 12 +-
src/VBox/Runtime/testcase/tstRTList.cpp | 12 +-
src/VBox/Runtime/testcase/tstRTLocalIpc.cpp | 6 +-
src/VBox/Runtime/testcase/tstRTLockValidator.cpp | 18 +-
src/VBox/Runtime/testcase/tstRTManifest.cpp | 7 +-
src/VBox/Runtime/testcase/tstRTMemCache.cpp | 19 +-
src/VBox/Runtime/testcase/tstRTMemEf.cpp | 13 +-
src/VBox/Runtime/testcase/tstRTMemPool.cpp | 13 +-
src/VBox/Runtime/testcase/tstRTMemSafer.cpp | 6 +-
src/VBox/Runtime/testcase/tstRTMemWipe.cpp | 12 +-
src/VBox/Runtime/testcase/tstRTMp-1.cpp | 7 +-
src/VBox/Runtime/testcase/tstRTNetIPv4.cpp | 12 +-
src/VBox/Runtime/testcase/tstRTNetIPv6.cpp | 13 +-
src/VBox/Runtime/testcase/tstRTPath.cpp | 7 +-
.../testcase/{tstRTZip.cpp => tstRTPathGlob.cpp} | 77 +-
src/VBox/Runtime/testcase/tstRTPipe.cpp | 12 +-
src/VBox/Runtime/testcase/tstRTPoll.cpp | 6 +-
src/VBox/Runtime/testcase/tstRTPrfIO.cpp | 20 +-
src/VBox/Runtime/testcase/tstRTProcCreateEx.cpp | 13 +-
src/VBox/Runtime/testcase/tstRTProcCreatePrf.cpp | 6 +-
.../Runtime/testcase/tstRTProcIsRunningByName.cpp | 7 +-
.../Runtime/testcase/tstRTProcQueryUsername.cpp | 6 +-
src/VBox/Runtime/testcase/tstRTProcWait.cpp | 6 +-
src/VBox/Runtime/testcase/tstRTR0DbgKrnlInfo.cpp | 7 +-
.../Runtime/testcase/tstRTR0DbgKrnlInfoDriver.cpp | 7 +-
src/VBox/Runtime/testcase/tstRTR0MemUserKernel.cpp | 7 +-
.../testcase/tstRTR0MemUserKernelDriver.cpp | 7 +-
src/VBox/Runtime/testcase/tstRTR0SemMutex.cpp | 13 +-
.../Runtime/testcase/tstRTR0SemMutexDriver.cpp | 20 +-
src/VBox/Runtime/testcase/tstRTR0Thread.cpp | 7 +-
src/VBox/Runtime/testcase/tstRTR0ThreadDriver.cpp | 7 +-
.../Runtime/testcase/tstRTR0ThreadPreemption.cpp | 7 +-
.../testcase/tstRTR0ThreadPreemptionDriver.cpp | 14 +-
src/VBox/Runtime/testcase/tstRTR0Timer.cpp | 18 +-
src/VBox/Runtime/testcase/tstRTR0TimerDriver.cpp | 7 +-
src/VBox/Runtime/testcase/tstRTReqPool.cpp | 12 +-
src/VBox/Runtime/testcase/tstRTS3.cpp | 14 +-
src/VBox/Runtime/testcase/tstRTSemEventMulti.cpp | 12 +-
src/VBox/Runtime/testcase/tstRTSemRW.cpp | 13 +-
src/VBox/Runtime/testcase/tstRTSemXRoads.cpp | 12 +-
src/VBox/Runtime/testcase/tstRTSort.cpp | 13 +-
src/VBox/Runtime/testcase/tstRTStrAlloc.cpp | 7 +-
src/VBox/Runtime/testcase/tstRTStrCache.cpp | 7 +-
src/VBox/Runtime/testcase/tstRTStrCatCopy.cpp | 7 +-
src/VBox/Runtime/testcase/tstRTStrFormat.cpp | 7 +-
src/VBox/Runtime/testcase/tstRTStrVersion.cpp | 7 +-
src/VBox/Runtime/testcase/tstRTSymlink.cpp | 6 +-
src/VBox/Runtime/testcase/tstRTSystemQueryDmi.cpp | 7 +-
.../Runtime/testcase/tstRTSystemQueryOsInfo.cpp | 13 +-
src/VBox/Runtime/testcase/tstRTTcp-1.cpp | 6 +-
src/VBox/Runtime/testcase/tstRTTemp.cpp | 13 +-
.../Runtime/testcase/tstRTThreadExecutionTime.cpp | 13 +-
src/VBox/Runtime/testcase/tstRTThreadPoke.cpp | 13 +-
src/VBox/Runtime/testcase/tstRTTime.cpp | 7 +-
src/VBox/Runtime/testcase/tstRTTimeSpec.cpp | 7 +-
src/VBox/Runtime/testcase/tstRTUri.cpp | 14 +-
src/VBox/Runtime/testcase/tstRTUuid.cpp | 6 +-
src/VBox/Runtime/testcase/tstRTZip.cpp | 6 +-
src/VBox/Runtime/testcase/tstRand.cpp | 26 +-
src/VBox/Runtime/testcase/tstSemMutex.cpp | 15 +-
src/VBox/Runtime/testcase/tstSemPingPong.cpp | 20 +-
src/VBox/Runtime/testcase/tstStrSimplePattern.cpp | 6 +-
src/VBox/Runtime/testcase/tstTSC.cpp | 27 +-
src/VBox/Runtime/testcase/tstTermCallbacks.cpp | 13 +-
src/VBox/Runtime/testcase/tstThread-1.cpp | 13 +-
src/VBox/Runtime/testcase/tstTime-2.cpp | 7 +-
src/VBox/Runtime/testcase/tstTime-3.cpp | 7 +-
src/VBox/Runtime/testcase/tstTime-4.cpp | 7 +-
src/VBox/Runtime/testcase/tstTimer.cpp | 13 +-
src/VBox/Runtime/testcase/tstTimerLR.cpp | 13 +-
src/VBox/Runtime/testcase/tstUtf8.cpp | 7 +-
src/VBox/Runtime/testcase/tstVector.cpp | 7 +-
src/VBox/Runtime/tools/RTSignTool.cpp | 7 +-
src/VBox/Runtime/win/RTErrConvertFromWin32.cpp | 7 +-
src/VBox/Runtime/win/errmsgwin.cpp | 13 +-
src/VBox/Storage/DMG.cpp | 38 +-
src/VBox/Storage/Debug/VDDbgIoLog.cpp | 28 +-
src/VBox/Storage/ISCSI.cpp | 132 +-
src/VBox/Storage/Parallels.cpp | 105 +-
src/VBox/Storage/QCOW.cpp | 118 +-
src/VBox/Storage/QED.cpp | 145 +-
src/VBox/Storage/RAW.cpp | 124 +-
src/VBox/Storage/VCICache.cpp | 90 +-
src/VBox/Storage/VD.cpp | 273 +--
src/VBox/Storage/VDI.cpp | 127 +-
src/VBox/Storage/VDIfVfs.cpp | 13 +-
src/VBox/Storage/VDVfs.cpp | 13 +-
src/VBox/Storage/VHD.cpp | 145 +-
src/VBox/Storage/VHDX.cpp | 115 +-
src/VBox/Storage/VMDK.cpp | 128 +-
src/VBox/Storage/testcase/Makefile.kmk | 11 -
src/VBox/Storage/testcase/VDIoBackendMem.cpp | 4 +-
src/VBox/Storage/testcase/VDMemDisk.cpp | 4 +-
src/VBox/Storage/testcase/VDScript.cpp | 3 +-
src/VBox/Storage/testcase/tstVD-2.cpp | 13 +-
src/VBox/Storage/testcase/tstVD.cpp | 19 +-
src/VBox/Storage/testcase/tstVDCopy.cpp | 12 +-
src/VBox/Storage/testcase/tstVDIo.cpp | 9 +-
src/VBox/Storage/testcase/tstVDShareable.cpp | 35 +-
src/VBox/Storage/testcase/tstVDSnap.cpp | 16 +-
src/VBox/Storage/testcase/vbox-img.cpp | 78 +-
src/VBox/Storage/testcase/vditool.cpp | 471 -----
src/VBox/VMM/Makefile.kmk | 26 +-
src/VBox/VMM/VMMAll/CPUMAllMsrs.cpp | 19 +-
src/VBox/VMM/VMMAll/CPUMAllRegs.cpp | 24 +-
src/VBox/VMM/VMMAll/CPUMStack.cpp | 6 +-
src/VBox/VMM/VMMAll/CSAMAll.cpp | 6 +-
src/VBox/VMM/VMMAll/DBGFAll.cpp | 6 +-
src/VBox/VMM/VMMAll/EMAll.cpp | 39 +-
src/VBox/VMM/VMMAll/EMAllA.asm | 232 ---
src/VBox/VMM/VMMAll/FTMAll.cpp | 6 +-
src/VBox/VMM/VMMAll/GIMAll.cpp | 6 +-
src/VBox/VMM/VMMAll/GIMAllHv.cpp | 7 +-
src/VBox/VMM/VMMAll/GIMAllKvm.cpp | 11 +-
src/VBox/VMM/VMMAll/HMAll.cpp | 14 +-
src/VBox/VMM/VMMAll/IEMAll.cpp | 43 +-
src/VBox/VMM/VMMAll/IEMAllAImplC.cpp | 13 +-
src/VBox/VMM/VMMAll/IOMAll.cpp | 7 +-
src/VBox/VMM/VMMAll/IOMAllMMIO.cpp | 19 +-
src/VBox/VMM/VMMAll/MMAll.cpp | 6 +-
src/VBox/VMM/VMMAll/MMAllHyper.cpp | 18 +-
src/VBox/VMM/VMMAll/MMAllPagePool.cpp | 7 +-
src/VBox/VMM/VMMAll/PATMAll.cpp | 7 +-
src/VBox/VMM/VMMAll/PDMAll.cpp | 6 +-
src/VBox/VMM/VMMAll/PDMAllCritSect.cpp | 12 +-
src/VBox/VMM/VMMAll/PDMAllCritSectBoth.cpp | 6 +-
src/VBox/VMM/VMMAll/PDMAllCritSectRw.cpp | 12 +-
src/VBox/VMM/VMMAll/PDMAllNetShaper.cpp | 6 +-
src/VBox/VMM/VMMAll/PDMAllQueue.cpp | 6 +-
src/VBox/VMM/VMMAll/PGMAll.cpp | 19 +-
src/VBox/VMM/VMMAll/PGMAllHandler.cpp | 12 +-
src/VBox/VMM/VMMAll/PGMAllMap.cpp | 7 +-
src/VBox/VMM/VMMAll/PGMAllPhys.cpp | 13 +-
src/VBox/VMM/VMMAll/PGMAllPool.cpp | 12 +-
src/VBox/VMM/VMMAll/REMAll.cpp | 6 +-
src/VBox/VMM/VMMAll/SELMAll.cpp | 16 +-
src/VBox/VMM/VMMAll/TMAll.cpp | 12 +-
src/VBox/VMM/VMMAll/TMAllCpu.cpp | 6 +-
src/VBox/VMM/VMMAll/TMAllReal.cpp | 6 +-
src/VBox/VMM/VMMAll/TMAllVirtual.cpp | 12 +-
src/VBox/VMM/VMMAll/TRPMAll.cpp | 6 +-
src/VBox/VMM/VMMAll/VMAll.cpp | 6 +-
src/VBox/VMM/VMMAll/VMMAll.cpp | 12 +-
src/VBox/VMM/VMMR0/CPUMR0.cpp | 66 +-
src/VBox/VMM/VMMR0/CPUMR0A.asm | 314 +--
src/VBox/VMM/VMMR0/CPUMR0UnusedA.asm | 134 +-
src/VBox/VMM/VMMR0/GIMR0.cpp | 7 +-
src/VBox/VMM/VMMR0/GIMR0Hv.cpp | 7 +-
src/VBox/VMM/VMMR0/GIMR0Kvm.cpp | 7 +-
src/VBox/VMM/VMMR0/GMMR0.cpp | 30 +-
src/VBox/VMM/VMMR0/GVMMR0.cpp | 30 +-
src/VBox/VMM/VMMR0/HMR0.cpp | 29 +-
src/VBox/VMM/VMMR0/HMR0A.asm | 1494 +++++++++-----
src/VBox/VMM/VMMR0/HMR0Mixed.mac | 973 ---------
src/VBox/VMM/VMMR0/HMSVMR0.cpp | 68 +-
src/VBox/VMM/VMMR0/HMSVMR0.h | 4 +-
src/VBox/VMM/VMMR0/HMVMXR0.cpp | 753 +++----
src/VBox/VMM/VMMR0/HMVMXR0.h | 13 +-
src/VBox/VMM/VMMR0/PDMR0Device.cpp | 18 +-
src/VBox/VMM/VMMR0/PDMR0Driver.cpp | 7 +-
src/VBox/VMM/VMMR0/PGMR0.cpp | 7 +-
src/VBox/VMM/VMMR0/PGMR0SharedPage.cpp | 7 +-
src/VBox/VMM/VMMR0/TRPMR0.cpp | 23 +-
src/VBox/VMM/VMMR0/VMMR0.cpp | 55 +-
src/VBox/VMM/VMMR0/VMMR0TripleFaultHack.cpp | 19 +-
src/VBox/VMM/VMMR3/CFGM.cpp | 13 +-
src/VBox/VMM/VMMR3/CPUM.cpp | 138 +-
src/VBox/VMM/VMMR3/CPUMDbg.cpp | 6 +-
src/VBox/VMM/VMMR3/CPUMR3CpuId.cpp | 42 +-
src/VBox/VMM/VMMR3/CPUMR3Db.cpp | 19 +-
src/VBox/VMM/VMMR3/CSAM.cpp | 24 +-
src/VBox/VMM/VMMR3/DBGF.cpp | 12 +-
src/VBox/VMM/VMMR3/DBGFAddr.cpp | 6 +-
src/VBox/VMM/VMMR3/DBGFAddrSpace.cpp | 19 +-
src/VBox/VMM/VMMR3/DBGFBp.cpp | 12 +-
src/VBox/VMM/VMMR3/DBGFCoreWrite.cpp | 25 +-
src/VBox/VMM/VMMR3/DBGFCpu.cpp | 6 +-
src/VBox/VMM/VMMR3/DBGFDisas.cpp | 19 +-
src/VBox/VMM/VMMR3/DBGFInfo.cpp | 18 +-
src/VBox/VMM/VMMR3/DBGFLog.cpp | 6 +-
src/VBox/VMM/VMMR3/DBGFMem.cpp | 6 +-
src/VBox/VMM/VMMR3/DBGFOS.cpp | 18 +-
src/VBox/VMM/VMMR3/DBGFR3PlugIn.cpp | 24 +-
src/VBox/VMM/VMMR3/DBGFR3Trace.cpp | 18 +-
src/VBox/VMM/VMMR3/DBGFReg.cpp | 18 +-
src/VBox/VMM/VMMR3/DBGFStack.cpp | 6 +-
src/VBox/VMM/VMMR3/EM.cpp | 19 +-
src/VBox/VMM/VMMR3/EMHM.cpp | 19 +-
src/VBox/VMM/VMMR3/EMR3Dbg.cpp | 7 +-
src/VBox/VMM/VMMR3/EMRaw.cpp | 12 +-
src/VBox/VMM/VMMR3/FTM.cpp | 13 +-
src/VBox/VMM/VMMR3/GIM.cpp | 14 +-
src/VBox/VMM/VMMR3/GIMHv.cpp | 48 +-
src/VBox/VMM/VMMR3/GIMKvm.cpp | 20 +-
src/VBox/VMM/VMMR3/GIMMinimal.cpp | 14 +-
src/VBox/VMM/VMMR3/GMM.cpp | 6 +-
src/VBox/VMM/VMMR3/HM.cpp | 30 +-
src/VBox/VMM/VMMR3/IEMR3.cpp | 7 +-
src/VBox/VMM/VMMR3/IOM.cpp | 12 +-
src/VBox/VMM/VMMR3/MM.cpp | 18 +-
src/VBox/VMM/VMMR3/MMHeap.cpp | 12 +-
src/VBox/VMM/VMMR3/MMHyper.cpp | 12 +-
src/VBox/VMM/VMMR3/MMPagePool.cpp | 13 +-
src/VBox/VMM/VMMR3/MMUkHeap.cpp | 12 +-
src/VBox/VMM/VMMR3/PATM.cpp | 28 +-
src/VBox/VMM/VMMR3/PATMGuest.cpp | 9 +-
src/VBox/VMM/VMMR3/PATMPatch.cpp | 19 +-
src/VBox/VMM/VMMR3/PATMR3Dbg.cpp | 13 +-
src/VBox/VMM/VMMR3/PATMSSM.cpp | 20 +-
src/VBox/VMM/VMMR3/PDM.cpp | 24 +-
src/VBox/VMM/VMMR3/PDMAsyncCompletion.cpp | 18 +-
src/VBox/VMM/VMMR3/PDMAsyncCompletionFile.cpp | 58 +-
.../VMM/VMMR3/PDMAsyncCompletionFileFailsafe.cpp | 7 +-
.../VMM/VMMR3/PDMAsyncCompletionFileNormal.cpp | 13 +-
src/VBox/VMM/VMMR3/PDMBlkCache.cpp | 18 +-
src/VBox/VMM/VMMR3/PDMCritSect.cpp | 12 +-
src/VBox/VMM/VMMR3/PDMDevHlp.cpp | 12 +-
src/VBox/VMM/VMMR3/PDMDevMiscHlp.cpp | 6 +-
src/VBox/VMM/VMMR3/PDMDevice.cpp | 18 +-
src/VBox/VMM/VMMR3/PDMDriver.cpp | 18 +-
src/VBox/VMM/VMMR3/PDMLdr.cpp | 23 +-
src/VBox/VMM/VMMR3/PDMNetShaper.cpp | 12 +-
src/VBox/VMM/VMMR3/PDMQueue.cpp | 12 +-
src/VBox/VMM/VMMR3/PDMThread.cpp | 13 +-
src/VBox/VMM/VMMR3/PDMUsb.cpp | 30 +-
src/VBox/VMM/VMMR3/PGM.cpp | 27 +-
src/VBox/VMM/VMMR3/PGMDbg.cpp | 37 +-
src/VBox/VMM/VMMR3/PGMHandler.cpp | 12 +-
src/VBox/VMM/VMMR3/PGMMap.cpp | 12 +-
src/VBox/VMM/VMMR3/PGMPhys.cpp | 12 +-
src/VBox/VMM/VMMR3/PGMPool.cpp | 12 +-
src/VBox/VMM/VMMR3/PGMSavedState.cpp | 24 +-
src/VBox/VMM/VMMR3/PGMSharedPage.cpp | 13 +-
src/VBox/VMM/VMMR3/SELM.cpp | 19 +-
src/VBox/VMM/VMMR3/SSM.cpp | 30 +-
src/VBox/VMM/VMMR3/STAM.cpp | 31 +-
src/VBox/VMM/VMMR3/TM.cpp | 21 +-
src/VBox/VMM/VMMR3/TRPM.cpp | 25 +-
src/VBox/VMM/VMMR3/VM.cpp | 32 +-
src/VBox/VMM/VMMR3/VMEmt.cpp | 12 +-
src/VBox/VMM/VMMR3/VMM.cpp | 24 +-
src/VBox/VMM/VMMR3/VMMGuruMeditation.cpp | 13 +-
src/VBox/VMM/VMMR3/VMMSwitcher.cpp | 34 +-
src/VBox/VMM/VMMR3/VMMTests.cpp | 7 +-
src/VBox/VMM/VMMR3/VMReq.cpp | 12 +-
src/VBox/VMM/VMMRC/CPUMRC.cpp | 12 +-
src/VBox/VMM/VMMRC/CSAMRC.cpp | 6 +-
src/VBox/VMM/VMMRC/IOMRC.cpp | 6 +-
src/VBox/VMM/VMMRC/MMRamRC.cpp | 12 +-
src/VBox/VMM/VMMRC/PATMRC.cpp | 6 +-
src/VBox/VMM/VMMRC/PDMRCDevice.cpp | 18 +-
src/VBox/VMM/VMMRC/PGMRC.cpp | 12 +-
src/VBox/VMM/VMMRC/SELMRC.cpp | 13 +-
src/VBox/VMM/VMMRC/TRPMRC.cpp | 6 +-
src/VBox/VMM/VMMRC/TRPMRCHandlers.cpp | 31 +-
src/VBox/VMM/VMMRC/VMMRC.cpp | 18 +-
src/VBox/VMM/VMMRZ/DBGFRZ.cpp | 6 +-
src/VBox/VMM/VMMRZ/PGMRZDynMap.cpp | 30 +-
src/VBox/VMM/VMMRZ/VMMRZ.cpp | 6 +-
src/VBox/VMM/VMMSwitcher/AMD64Stub.asm | 5 +-
src/VBox/VMM/VMMSwitcher/AMD64andLegacy.mac | 74 -
src/VBox/VMM/include/CPUMInternal.h | 24 +-
src/VBox/VMM/include/CPUMInternal.mac | 16 +-
src/VBox/VMM/include/HMInternal.h | 40 +-
src/VBox/VMM/include/HMInternal.mac | 5 +-
src/VBox/VMM/include/PATMInternal.h | 2 +-
.../VMM/include/PDMAsyncCompletionFileInternal.h | 2 -
src/VBox/VMM/include/PGMInternal.h | 4 -
src/VBox/VMM/include/TMInternal.h | 9 +-
src/VBox/VMM/include/VMMInternal.h | 4 +
.../VMM/testcase/Instructions/tstVBInsTstR3.cpp | 18 +-
src/VBox/VMM/testcase/Makefile.kmk | 15 -
src/VBox/VMM/testcase/tstAnimate.cpp | 13 +-
src/VBox/VMM/testcase/tstAsmStructs.cpp | 7 +-
src/VBox/VMM/testcase/tstCFGM.cpp | 6 +-
src/VBox/VMM/testcase/tstCompressionBenchmark.cpp | 12 +-
src/VBox/VMM/testcase/tstGlobalConfig.cpp | 6 +-
src/VBox/VMM/testcase/tstIEMCheckMc.cpp | 19 +-
src/VBox/VMM/testcase/tstInstrEmul.cpp | 7 +-
src/VBox/VMM/testcase/tstMMHyperHeap.cpp | 7 +-
src/VBox/VMM/testcase/tstMicro.cpp | 13 +-
src/VBox/VMM/testcase/tstMicroRC.cpp | 13 +-
src/VBox/VMM/testcase/tstPDMAsyncCompletion.cpp | 11 +-
.../VMM/testcase/tstPDMAsyncCompletionStress.cpp | 16 +-
src/VBox/VMM/testcase/tstSSM-2.cpp | 6 +-
src/VBox/VMM/testcase/tstSSM.cpp | 18 +-
src/VBox/VMM/testcase/tstVMM-HM.cpp | 12 +-
src/VBox/VMM/testcase/tstVMM.cpp | 26 +-
src/VBox/VMM/testcase/tstVMMFork.cpp | 12 +-
src/VBox/VMM/testcase/tstVMMR0CallHost-1.cpp | 19 +-
src/VBox/VMM/testcase/tstVMREQ.cpp | 19 +-
src/VBox/VMM/testcase/tstVMStruct.h | 6 +-
src/VBox/VMM/testcase/tstVMStructDTrace.cpp | 6 +-
src/VBox/VMM/testcase/tstVMStructRC.cpp | 6 +-
src/VBox/VMM/testcase/tstVMStructSize.cpp | 7 +-
src/VBox/VMM/testcase/tstX86-1.cpp | 24 +-
src/VBox/VMM/testcase/tstX86-FpuSaveRestore.cpp | 6 +-
.../ValidationKit/bootsectors/VBoxBs2Linker.cpp | 8 +-
src/VBox/ValidationKit/common/constants/result.py | 0
.../ValidationKit/common/constants/rtexitcode.py | 0
src/VBox/ValidationKit/common/constants/tbreq.py | 0
src/VBox/ValidationKit/common/constants/tbresp.py | 0
.../ValidationKit/common/constants/valueunit.py | 0
src/VBox/ValidationKit/snippets/alloc-1.c | 7 +-
src/VBox/ValidationKit/snippets/time-1.c | 7 +-
src/VBox/ValidationKit/testanalysis/__init__.py | 0
src/VBox/ValidationKit/testanalysis/reader.py | 0
src/VBox/ValidationKit/testanalysis/reporting.py | 0
.../ValidationKit/testboxscript/TestBoxHelper.cpp | 6 +-
src/VBox/ValidationKit/testdriver/__init__.py | 0
src/VBox/ValidationKit/testdriver/vboxcon.py | 0
src/VBox/ValidationKit/testmanager/__init__.py | 0
src/VBox/ValidationKit/testmanager/config.py | 0
.../ValidationKit/testmanager/core/__init__.py | 0
.../ValidationKit/testmanager/core/coreconsts.py | 0
.../ValidationKit/testmanager/debug/__init__.py | 0
.../ValidationKit/testmanager/webui/__init__.py | 0
.../ValidationKit/testmanager/webui/wuihlpgraph.py | 0
.../testmanager/webui/wuihlpgraphbase.py | 0
src/VBox/ValidationKit/tests/usb/usbgadget.py | 0
.../utils/TestExecServ/TestExecService.cpp | 20 +-
.../utils/TestExecServ/TestExecServiceTcp.cpp | 18 +-
src/VBox/ValidationKit/utils/cpu/cidet-app.cpp | 30 +-
src/VBox/ValidationKit/utils/cpu/cidet-core.cpp | 18 +-
src/VBox/ValidationKit/utils/cpu/cidet-instr-1.cpp | 18 +-
src/VBox/ValidationKit/utils/cpu/cidet.h | 2 +-
.../ValidationKit/utils/cpu/cpu-alloc-all-mem.cpp | 12 +-
src/VBox/ValidationKit/utils/cpu/cpu-numa.cpp | 12 +-
src/VBox/ValidationKit/utils/cpu/exceptionsR3.cpp | 24 +-
src/VBox/ValidationKit/utils/cpu/xmmsaving.cpp | 12 +-
.../ValidationKit/utils/misc/loadgenerator.cpp | 20 +-
.../ValidationKit/utils/misc/loadgeneratorR0.cpp | 6 +-
src/VBox/ValidationKit/utils/misc/vts_rm.cpp | 6 +-
src/VBox/ValidationKit/utils/misc/vts_tar.cpp | 6 +-
src/VBox/ValidationKit/utils/network/NetPerf.cpp | 28 +-
src/VBox/ValidationKit/utils/nt/ntsetfreq.cpp | 6 +-
src/VBox/ValidationKit/utils/nt/nttimesources.cpp | 12 +-
src/VBox/ValidationKit/utils/usb/UsbTest.cpp | 27 +-
src/apps/adpctl/VBoxNetAdpCtl.cpp | 6 +-
src/bldprogs/VBoxCPP.cpp | 26 +-
src/bldprogs/VBoxCmp.cpp | 6 +-
src/bldprogs/VBoxCompilerPlugInsGcc.cpp | 1 +
src/bldprogs/VBoxDef2LazyLoad.cpp | 21 +-
src/bldprogs/VBoxPeSetVersion.cpp | 6 +-
src/bldprogs/VBoxTpG.cpp | 20 +-
src/bldprogs/bin2c.c | 7 +-
src/bldprogs/filesplitter.cpp | 12 +-
src/bldprogs/preload.cpp | 9 +-
src/bldprogs/scm.cpp | 215 +-
src/bldprogs/scm.h | 15 +-
src/bldprogs/scmdiff.cpp | 13 +-
src/bldprogs/scmrw.cpp | 231 ++-
src/bldprogs/scmstream.cpp | 25 +-
src/bldprogs/scmstream.h | 1 +
src/bldprogs/scmsubversion.cpp | 25 +-
src/libs/xpcom18a4/python/__init__.py | 0
src/libs/xpcom18a4/python/components.py | 0
src/libs/xpcom18a4/python/nsError.py | 0
src/libs/xpcom18a4/python/tools/tracer_demo.py | 0
src/recompiler/Sun/testmath.c | 6 +-
src/recompiler/VBoxREMWrapper.cpp | 30 +-
src/recompiler/VBoxRecompiler.c | 30 +-
1876 files changed, 24123 insertions(+), 17720 deletions(-)
diff --git a/Config.kmk b/Config.kmk
index 179c46e..1bfeaa6 100644
--- a/Config.kmk
+++ b/Config.kmk
@@ -208,7 +208,7 @@ VBOX_VERSION_MINOR = 0
# This is the current build number. It should be increased every time we publish a
# new build. The define is available in every source file. Only even build numbers
# will be published, odd numbers are set during development.
-VBOX_VERSION_BUILD = 2
+VBOX_VERSION_BUILD = 4
# The raw version string. This *must not* contain any other information/fields than
# major, minor and build revision (as it is now) -- also will be used for host/guest version
# comparison.
@@ -2237,6 +2237,11 @@ ifdef VBOX_WITH_CROGL
ifdef VBOX_WITH_WDDM
VBOX_WITH_CRHGSMI = 1
endif
+
+ #if1of ($(KBUILD_TARGET),darwin)
+ # VBOX_WITH_CR_DISPLAY_LISTS = 1
+ #endif
+
VBOX_PATH_CROGL_GLAPI = $(PATH_ROOT)/src/VBox/GuestHost/OpenGL/glapi_parser
VBOX_PATH_CROGL_GENFILES = $(PATH_OBJ)/VBoxOGLgen
VBOX_PATH_CROGL_INCLUDE = $(PATH_ROOT)/src/VBox/GuestHost/OpenGL/include
@@ -3694,9 +3699,8 @@ TEMPLATE_VBOXR0DRV_CFLAGS = -nostdinc -iwithprefix include $(VBOX_L
-fno-strict-aliasing -fno-common -Werror-implicit-function-declaration
TEMPLATE_VBOXR0DRV_CFLAGS.x86 = -mpreferred-stack-boundary=2 -msoft-float
TEMPLATE_VBOXR0DRV_CFLAGS.amd64 = -m64 -mno-red-zone -mcmodel=kernel -mno-sse -mno-mmx -mno-sse2 -mno-3dnow \
- -fno-reorder-blocks -ffreestanding -fno-asynchronous-unwind-tables -funit-at-a-time \
- -Wno-sign-compare -Wdeclaration-after-statement
-TEMPLATE_VBOXR0DRV_CXXFLAGS = $(filter-out -Wstrict-prototypes -Wno-pointer-sign -ffreestanding -Wdeclaration-after-statement -Werror-implicit-function-declaration,$(TEMPLATE_VBOXR0DRV_CFLAGS) $(TEMPLATE_VBOXR0DRV_CFLAGS.$(KBUILD_TARGET_ARCH))) -fno-exceptions -fno-rtti
+ -fno-reorder-blocks -ffreestanding -fno-asynchronous-unwind-tables -funit-at-a-time -Wno-sign-compare
+TEMPLATE_VBOXR0DRV_CXXFLAGS = $(filter-out -Wstrict-prototypes -Wno-pointer-sign -ffreestanding -Werror-implicit-function-declaration,$(TEMPLATE_VBOXR0DRV_CFLAGS) $(TEMPLATE_VBOXR0DRV_CFLAGS.$(KBUILD_TARGET_ARCH))) -fno-exceptions -fno-rtti
ifndef VBOX_LINUX_VERSION_2_4
# 2.6
TEMPLATE_VBOXR0DRV_SYSSUFF = .ko
@@ -3891,7 +3895,7 @@ TEMPLATE_VBOXR0DRV_CFLAGS.x86 = -mno-sse -mno-mmx -mno-sse2 -mno-3dnow
TEMPLATE_VBOXR0DRV_CFLAGS.x86 = -m32 -mno-sse -mno-mmx -mno-sse2 -mno-3dnow
TEMPLATE_VBOXR0DRV_CFLAGS.amd64 = -m64 -mno-sse -mno-mmx -mno-sse2 -mno-3dnow \
-fno-reorder-blocks -ffreestanding -fno-asynchronous-unwind-tables -funit-at-a-time \
- -Wno-sign-compare -Wdeclaration-after-statement
+ -Wno-sign-compare
TEMPLATE_VBOXR0DRV_CXXFLAGS = -fno-PIC -Wpointer-arith \
-Wshadow -Wuninitialized -Wunused-function -Wunused-label -Wunused-value -Wunused-variable \
-Wformat \
@@ -6100,7 +6104,7 @@ endif
SVN ?= svn$(HOSTSUFF_EXE)
VBOX_SVN_REV_KMK = $(PATH_OUT)/revision.kmk
ifndef VBOX_SVN_REV
- VBOX_SVN_REV_FALLBACK := $(patsubst %:,, $Rev: 102095 $ )
+ VBOX_SVN_REV_FALLBACK := $(patsubst %:,, $Rev: 102546 $ )
VBOX_SVN_DEP := $(firstword $(wildcard $(PATH_ROOT)/.svn/wc.db $(abspath $(PATH_ROOT)/../.svn/wc.db) $(abspath $(PATH_ROOT)/../../.svn/wc.db) $(PATH_ROOT)/.svn/entries))
ifeq ($(which $(SVN)),)
VBOX_SVN_DEP :=
diff --git a/Makefile.kmk b/Makefile.kmk
index 929db46..54a106b 100644
--- a/Makefile.kmk
+++ b/Makefile.kmk
@@ -1709,4 +1709,3 @@ sdk:
sdk-fetch:
+ $(KMK) VBOX_ONLY_SDK=1 -C tools
-
diff --git a/doc/manual/ChangeLog.xml b/doc/manual/ChangeLog.xml
new file mode 100644
index 0000000..cfd30a0
--- /dev/null
+++ b/doc/manual/ChangeLog.xml
@@ -0,0 +1,11 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!DOCTYPE book PUBLIC "-//OASIS//DTD DocBook XML V4.3//EN"
+"http://www.oasis-open.org/docbook/xml/4.3/docbookx.dtd" [
+<!ENTITY __ChangeLog__et8f0z3c SYSTEM "../user_ChangeLogImpl_1.xml">
+]>
+<book>
+
+ <xi:include href="../user_ChangeLogImpl.xml" xpointer="element(/1)"
+ xmlns:xi="http://www.w3.org/2001/XInclude" />
+
+</book>
diff --git a/doc/manual/common-html-formatcfg.xsl b/doc/manual/common-html-formatcfg.xsl
new file mode 100644
index 0000000..0fa3aec
--- /dev/null
+++ b/doc/manual/common-html-formatcfg.xsl
@@ -0,0 +1,174 @@
+<?xml version="1.0"?>
+<xsl:stylesheet xmlns:xsl="http://www.w3.org/1999/XSL/Transform" version="1.0">
+
+<!-- Must strip spaces in 'arg' elements too, we'll get extra spaces when
+ using 'replaceable'. Adding option too, just in case. -->
+<xsl:strip-space elements="arg option"/>
+
+<!-- Our hand written css styling. -->
+<xsl:template name="user.head.content">
+ <style type="text/css">
+ <xsl:comment>
+ body
+ {
+ font-family: Verdana, Sans-serif, Arial, 'Trebuchet MS', 'Times New Roman';
+ font-size: small;
+ }
+ h2.title
+ {
+ font-family: Verdana, Sans-serif, Arial, 'Trebuchet MS', 'Times New Roman';
+ margin: 5px 0 0;
+ padding: 1px 5px 1px;
+ border: 1px solid #6b89d4;
+ -moz-border-radius: 0.3em;
+ background: #e6edff;
+ }
+ .titlepage
+ {
+ text-align: center;
+ }
+ .refsynopsisdiv, .refsect1, .refsect2, .refsect3
+ {
+ text-align: left;
+ }
+ .warning
+ {
+ padding: 5px;
+ border: 1px solid #ff0011;
+ -moz-border-radius: 0.3em;
+ background: #ffbbbb;
+ }
+ .warning .title { margin: 0px 0px 5px 0px; }
+ .warning p { margin: 1px; }
+ .note
+ {
+ padding: 1px 5px 1px;
+ border: 1px solid #84c43b;
+ -moz-border-radius: 0.3em;
+ background: #d7e9a7;
+ }
+ .note .title { margin: 0px 0px 5px 0px; }
+ .note p { margin: 1px; }
+ .cmdsynopsis
+ {
+ font-family: monospace;
+ }
+ .refsynopsisdiv > .cmdsynopsis p, .refsect1 > .cmdsynopsis p,
+ .refsynopsisdiv .sect2 > .cmdsynopsis p, .refsect1 .sect2 > .cmdsynopsis p
+ {
+ margin-top: 0px;
+ margin-bottom: 0px;
+ }
+ .cmdsynopsis p
+ {
+ padding-left: 3.4em;
+ text-indent: -2.2em;
+ }
+ p.nextcommand
+ {
+ margin-top: 0px;
+ margin-bottom: 0px;
+ }
+ p.lastcommand
+ {
+ margin-top: 0px;
+ }
+ .refentry * h3
+ {
+ font-size: large;
+ }
+ .refentry * h4
+ {
+ font-size: larger;
+ }
+ .refentry * h5
+ {
+ font-size: larger;
+ }
+
+ </xsl:comment>
+ </style>
+</xsl:template>
+
+
+<!-- Ignore/skip the remark that the command overview inclusion file
+ uses as the root element. -->
+<xsl:template match="remark[@role='VBoxManage-overview']">
+ <xsl:apply-templates select="node()"/>
+</xsl:template>
+
+
+<!-- This is for allow special CSS rules to apply to the refsect stuff. -->
+<xsl:template match="sect2[ @role = 'not-in-toc']/title
+ | sect3[ @role = 'not-in-toc']/title
+ | sect4[ @role = 'not-in-toc']/title
+ | sect5[ @role = 'not-in-toc']/title
+ | section[ @role = 'not-in-toc']/title
+ | simplesect[@role = 'not-in-toc']/title
+ | sect1[ @condition = 'refentry']/title
+ | sect2[ @condition = 'refentry']/title
+ | sect1[ starts-with(@condition, 'refsect')]/title
+ | sect2[ starts-with(@condition, 'refsect')]/title
+ | sect3[ starts-with(@condition, 'refsect')]/title
+ | sect4[ starts-with(@condition, 'refsect')]/title
+ | sect5[ starts-with(@condition, 'refsect')]/title
+ | section[ starts-with(@condition, 'refsect')]/title
+ | simplesect[starts-with(@condition, 'refsect')]/title
+" mode="titlepage.mode">
+ <xsl:element name="div">
+ <xsl:attribute name="class">
+ <xsl:value-of select="../@role"/>
+ <xsl:if test="../@role and ../@condition">
+ <xsl:text> </xsl:text>
+ </xsl:if>
+ <xsl:value-of select="../@condition"/>
+ </xsl:attribute>
+ <xsl:apply-imports/>
+ </xsl:element>
+</xsl:template>
+
+<xsl:template match="sect2[ @role = 'not-in-toc']
+ | sect3[ @role = 'not-in-toc']
+ | sect4[ @role = 'not-in-toc']
+ | sect5[ @role = 'not-in-toc']
+ | section[ @role = 'not-in-toc']
+ | simplesect[@role = 'not-in-toc']
+ | sect1[ @condition = 'refentry']
+ | sect2[ @condition = 'refentry']
+ | sect1[ starts-with(@condition, 'refsect')]
+ | sect2[ starts-with(@condition, 'refsect')]
+ | sect3[ starts-with(@condition, 'refsect')]
+ | sect4[ starts-with(@condition, 'refsect')]
+ | sect5[ starts-with(@condition, 'refsect')]
+ | section[ starts-with(@condition, 'refsect')]
+ | simplesect[starts-with(@condition, 'refsect')]" >
+ <xsl:element name="div">
+ <xsl:attribute name="class">
+ <xsl:value-of select="@role"/>
+ <xsl:if test="@role and @condition">
+ <xsl:text> </xsl:text>
+ </xsl:if>
+ <xsl:value-of select="@condition"/>
+ </xsl:attribute>
+ <xsl:apply-imports/>
+ </xsl:element>
+</xsl:template>
+
+<!-- To use CSS to correctly insert hanging indent when soft wrapping and
+ <sbr>'ing a synopsis, we must place each command in its own <p>. The default
+ is to must issue a <br /> before each <command>, except the first one.
+ Note! This is a bit ugly as we're going contrary to the grain of XSLT here
+ starting with an closing . -->
+<xsl:template match="cmdsynopsis/command">
+ <xsl:text disable-output-escaping="yes"><![CDATA[</p><p class="nextcommand">]]></xsl:text>
+ <xsl:call-template name="inline.monoseq"/>
+ <xsl:text> </xsl:text>
+</xsl:template>
+<xsl:template match="cmdsynopsis/command[last()]">
+ <xsl:text disable-output-escaping="yes"><![CDATA[</p><p class="lastcommand">]]></xsl:text>
+ <xsl:call-template name="inline.monoseq"/>
+ <xsl:text> </xsl:text>
+</xsl:template>
+
+</xsl:stylesheet>
+
diff --git a/doc/manual/docbook-changelog-formatcfg.xsl b/doc/manual/docbook-changelog-formatcfg.xsl
new file mode 100644
index 0000000..38bbbcd
--- /dev/null
+++ b/doc/manual/docbook-changelog-formatcfg.xsl
@@ -0,0 +1,80 @@
+<?xml version="1.0"?>
+<xsl:stylesheet xmlns:xsl="http://www.w3.org/1999/XSL/Transform" version="1.0">
+
+<!-- Single html file template -->
+<xsl:import href="@VBOX_PATH_DOCBOOK@/html/docbook.xsl"/>
+<xsl:import href="@VBOX_PATH_MANUAL_SRC@/common-formatcfg.xsl"/>
+
+<!-- Adjust some params -->
+<!--
+<xsl:param name="draft.mode" select="'no'"/>
+<xsl:param name="generate.toc">book nop</xsl:param>
+<xsl:param name="generate.index" select="0"></xsl:param>
+<xsl:param name="suppress.navigation" select="1"></xsl:param>
+<xsl:param name="header.rule" select="0"></xsl:param>
+<xsl:param name="abstract.notitle.enabled" select="0"></xsl:param>
+<xsl:param name="footer.rule" select="0"></xsl:param>
+<xsl:param name="css.decoration" select="1"></xsl:param>
+<xsl:param name="html.cleanup" select="1"></xsl:param>
+<xsl:param name="css.decoration" select="1"></xsl:param>
+-->
+
+<!-- Our hand written css styling -->
+<xsl:template name="user.head.content">
+ <style type="text/css">
+ <xsl:comment>
+ <!--
+ body
+ {
+ height: 100%;
+ font-family: Verdana, Sans-serif, Arial, 'Trebuchet MS', 'Times New Roman';
+ font-size: small;
+ position: absolute;
+ margin: 0px 0 0 0;
+ }
+ h2
+ {
+ text-decoration: none;
+ font-size: 1.2em;
+ font-family: Verdana, Sans-serif, Arial, 'Trebuchet MS', 'Times New Roman';
+ margin: 5px 0 0;
+ padding: 1px 5px 1px;
+ border: 1px solid #6b89d4; /* #84C43B; */
+ -moz-border-radius: 0.3em;
+ background: #e6edff; /* #d7e9a7; */
+ }
+ #watermark
+ {
+ margin: 0;
+ position: fixed;
+ top: 40%;
+ color: #eeeeee;
+ width: 100%;
+ height: 100%;
+ text-align: center;
+ vertical-align: middle;
+ font-size: 9em;
+ font-weight: bold;
+ z-index:-1;
+ }
+ -->
+ </xsl:comment>
+ </style>
+</xsl:template>
+
+<!-- Remove the title page at all -->
+<!--
+<xsl:template name="book.titlepage">
+ -->
+ <!-- Doesn't work with Qt, grrr -->
+ <!--<xsl:text><div id="watermark">VirtualBox<br />Change Log</div></xsl:text>-->
+<!--
+</xsl:template>
+-->
+
+<!-- Disable any links into the manual -->
+<xsl:template match="xref" name="xref">
+ <xsl:text>the manual for more information</xsl:text>
+</xsl:template>
+
+</xsl:stylesheet>
diff --git a/doc/manual/docbook-html-chunks-formatcfg.xsl b/doc/manual/docbook-html-chunks-formatcfg.xsl
new file mode 100644
index 0000000..a02d4d9
--- /dev/null
+++ b/doc/manual/docbook-html-chunks-formatcfg.xsl
@@ -0,0 +1,41 @@
+<?xml version="1.0"?>
+<xsl:stylesheet xmlns:xsl="http://www.w3.org/1999/XSL/Transform" version="1.0">
+
+<!-- Single html file template -->
+<xsl:import href="@VBOX_PATH_DOCBOOK@/html/chunk.xsl"/>
+
+<xsl:import href="@VBOX_PATH_MANUAL_SRC@/common-formatcfg.xsl"/>
+<xsl:import href="@VBOX_PATH_MANUAL_SRC@/common-html-formatcfg.xsl"/>
+
+<!-- Adjust some params -->
+<xsl:param name="draft.mode" select="'no'"/>
+<xsl:param name="suppress.navigation" select="1"></xsl:param>
+<xsl:param name="header.rule" select="0"></xsl:param>
+<xsl:param name="abstract.notitle.enabled" select="0"></xsl:param>
+<xsl:param name="footer.rule" select="0"></xsl:param>
+<xsl:param name="css.decoration" select="1"></xsl:param>
+<xsl:param name="html.cleanup" select="1"></xsl:param>
+<xsl:param name="css.decoration" select="1"></xsl:param>
+
+<xsl:param name="generate.toc">
+appendix toc,title
+article/appendix nop
+article toc,title
+book toc,title,figure,table,example,equation
+chapter toc,title
+part toc,title
+preface toc,title
+qandadiv toc
+qandaset toc
+reference toc,title
+sect1 nop
+sect2 nop
+sect3 nop
+sect4 nop
+sect5 nop
+section nop
+set toc,title
+</xsl:param>
+
+
+</xsl:stylesheet>
diff --git a/doc/manual/docbook-html-one-page-formatcfg.xsl b/doc/manual/docbook-html-one-page-formatcfg.xsl
new file mode 100644
index 0000000..fd2b2c9
--- /dev/null
+++ b/doc/manual/docbook-html-one-page-formatcfg.xsl
@@ -0,0 +1,20 @@
+<?xml version="1.0"?>
+<xsl:stylesheet xmlns:xsl="http://www.w3.org/1999/XSL/Transform" version="1.0">
+
+<!-- Single html file template -->
+<xsl:import href="@VBOX_PATH_DOCBOOK@/html/docbook.xsl"/>
+
+<xsl:import href="@VBOX_PATH_MANUAL_SRC@/common-formatcfg.xsl"/>
+<xsl:import href="@VBOX_PATH_MANUAL_SRC@/common-html-formatcfg.xsl"/>
+
+<!-- Adjust some params -->
+<xsl:param name="draft.mode" select="'no'"/>
+<xsl:param name="suppress.navigation" select="1"></xsl:param>
+<xsl:param name="header.rule" select="0"></xsl:param>
+<xsl:param name="abstract.notitle.enabled" select="0"></xsl:param>
+<xsl:param name="footer.rule" select="0"></xsl:param>
+<xsl:param name="css.decoration" select="1"></xsl:param>
+<xsl:param name="html.cleanup" select="1"></xsl:param>
+<xsl:param name="css.decoration" select="1"></xsl:param>
+
+</xsl:stylesheet>
diff --git a/doc/manual/en_US/user_GuestAdditions.xml b/doc/manual/en_US/user_GuestAdditions.xml
index bfc06fd..5f98c98 100644
--- a/doc/manual/en_US/user_GuestAdditions.xml
+++ b/doc/manual/en_US/user_GuestAdditions.xml
@@ -1854,7 +1854,11 @@ Name: /VirtualBox/GuestInfo/OS/Version, value: #59-Ubuntu SMP Thu Jan 28 01:23:0
of fused pages, whereas the per-VM metric
<computeroutput>Guest/RAM/Usage/Shared</computeroutput> will return the
amount of fused memory for a given VM. Please refer to <xref
- linkend="metrics" /> for information on how to query metrics.</para>
+ linkend="metrics" /> for information on how to query metrics.</para>
+
+ <note><para>Enabling Page Fusion might indirectly increase the chances
+ for malicious guests to successfully attack other VMs running on the
+ same host, see <xref linkend="pot-insecure"/>.</para></note>
</sect2>
</sect1>
</chapter>
diff --git a/doc/manual/en_US/user_Security.xml b/doc/manual/en_US/user_Security.xml
index a033a53..bd08a11 100644
--- a/doc/manual/en_US/user_Security.xml
+++ b/doc/manual/en_US/user_Security.xml
@@ -305,7 +305,7 @@
</sect2>
-->
- <sect2>
+ <sect2 id="pot-insecure">
<title>Potentially insecure operations</title>
<para>The following features of VirtualBox can present security
@@ -328,6 +328,17 @@
</listitem>
<listitem>
+ <para>When Page Fusion (see <xref linkend="guestadd-pagefusion"/>)
+ is enabled, it is possible that a side-channel opens up that allows
+ a malicious guest to determin the address space layout (i.e. where
+ DLLs are typically loaded) of one other VM running on the same host.
+ This information leak in it self is harmless, however the malicious
+ guest may use it to optimize attack against that VM via unrelated
+ attack vectors. It is recommended to only enable Page Fusion if you
+ do not think this is a concern in your setup.</para>
+ </listitem>
+
+ <listitem>
<para>When using the VirtualBox web service to control a VirtualBox
host remotely, connections to the web service (through which the API
calls are transferred via SOAP XML) are not encrypted, but use plain
diff --git a/doc/manual/en_US/user_Technical.xml b/doc/manual/en_US/user_Technical.xml
index 158fa1b..7c1e4fa 100644
--- a/doc/manual/en_US/user_Technical.xml
+++ b/doc/manual/en_US/user_Technical.xml
@@ -622,8 +622,8 @@
Hyper-V hypervisor interface which is recognized by Windows 7 and newer
operating systems. VirtualBox's implementation currently supports
paravirtualized clocks, APIC frequency reporting, guest crash reporting
- and relaxed timer checks. This provider is recommended for Windows and
- FreeBSD guests.
+ and relaxed timer checks. This provider is recommended for Windows
+ guests.
</para>
</listitem>
</itemizedlist>
diff --git a/doc/manual/en_US/user_Troubleshooting.xml b/doc/manual/en_US/user_Troubleshooting.xml
index be35cf0..a91127b 100644
--- a/doc/manual/en_US/user_Troubleshooting.xml
+++ b/doc/manual/en_US/user_Troubleshooting.xml
@@ -952,6 +952,26 @@
</orderedlist>
</sect2>
+ <sect2>
+ <title>Windows 3.x limited to 64 MB RAM</title>
+
+ <para>Windows 3.x guests are typically limited to 64 MB RAM, even if a VM is assigned
+ much more memory. While Windows 3.1 is theoretically capable of using up to 512 MB RAM,
+ it only uses memory available through the XMS interface. Versions of HIMEM.SYS (the
+ Microsoft XMS manager) shipped with MS-DOS and Microsoft Windows 3.x can only use
+ up to 64 MB on standard PCs.</para>
+
+ <para>This is a HIMEM.SYS limitation documented by Microsoft in Knowledge base
+ article KB 116256.
+ Windows 3.1 memory limits are described in detail in Microsoft Knowledge base
+ article KB 84388.</para>
+
+ <para>It is possible for Windows 3.x guests to utilize more than 64 MB RAM if a
+ different XMS provider is used. That could be a newer HIMEM.SYS version (such as
+ that shipped with Windows 98), or a more capable third-party memory manager
+ (such as QEMM).</para>
+ </sect2>
+
</sect1>
<sect1 id="ts_lin-x11-guests">
diff --git a/doc/manual/en_US/user_VBoxManage.xml b/doc/manual/en_US/user_VBoxManage.xml
index 1ff417d..0c64070 100644
--- a/doc/manual/en_US/user_VBoxManage.xml
+++ b/doc/manual/en_US/user_VBoxManage.xml
@@ -1617,11 +1617,11 @@ Virtual system 0:
<computeroutput>--legacy09</computeroutput> option.</para>
<para>To specify options controlling the exact content of the appliance
- file, you can use <computeroutput>--option</computeroutput> to request the
+ file, you can use <computeroutput>--options</computeroutput> to request the
creation of a manifest file (encouraged, allows detection of corrupted
appliances on import), the additional export of DVD images, and the
exclusion of MAC addresses. You can specify a list of options, e.g.
- <computeroutput>--option manifest,nomacs</computeroutput>. For details,
+ <computeroutput>--options manifest,nomacs</computeroutput>. For details,
check the help output of <computeroutput>VBoxManage export</computeroutput>.</para>
</sect1>
diff --git a/doc/manual/user_ChangeLogImpl.xml b/doc/manual/user_ChangeLogImpl.xml
index 07b4b50..9b30833 100644
--- a/doc/manual/user_ChangeLogImpl.xml
+++ b/doc/manual/user_ChangeLogImpl.xml
@@ -3,6 +3,178 @@
<chapter> <!-- HACK ALERT! Seems we must have a single top level element for xi:include to work.
So, we use chapter and xpointer="xpointer(/chapter/)" with xi:include. -->
<sect1>
+ <title>Version 5.0.4 (2015-09-08)</title>
+
+ <para>This is a maintenance release. The following items were fixed and/or
+ added:</para>
+
+ <itemizedlist>
+
+ <listitem>
+ <para>VMM: fixed an issue with Windows 10 guest kernel debugging over the
+ network for Hyper-V paravirtualized VMs</para>
+ </listitem>
+
+ <listitem>
+ <para>VMM: fixed a bug which prevented reading the saved state of the
+ 'PATM' unit from VirtualBox 4.3.x (bug #14512)</para>
+ </listitem>
+
+ <listitem>
+ <para>GUI: changed default OS type for Windows from Windows XP to Windows 7</para>
+ </listitem>
+
+ <listitem>
+ <para>GUI: added another pre-defined guest screen resolution (bug #14384)</para>
+ </listitem>
+
+ <listitem>
+ <para>GUI: fixed update check which was broken due to changing the
+ location of the root certificates (bug #13096)</para>
+ </listitem>
+
+ <listitem>
+ <para>GUI: fixed issues with synchronization of Caps lock / Num lock / Scroll
+ lock on Windows hosts (bug #14302)</para>
+ </listitem>
+
+ <listitem>
+ <para>GUI: don't crash during VM shutdown if 2D video acceleration and 3D support
+ are enabled (Mac OS X hosts only)</para>
+ </listitem>
+
+ <listitem>
+ <para>GUI: several seamless fixes for certain X11 window managers, also when
+ used in multi-screen setups</para>
+ </listitem>
+
+ <listitem>
+ <para>GUI: Log window size, position and cursor-position fixes</para>
+ </listitem>
+
+ <listitem>
+ <para>Audio: fixed playing leftover/deprecated audio samples</para>
+ </listitem>
+
+ <listitem>
+ <para>Audio: fixed playing audio after suspending the host (5.0 regression;
+ Linux hosts using the ALSA backend)</para>
+ </listitem>
+
+ <listitem>
+ <para>Audio: fixed playing short audio samples which were chopped off
+ formerly</para>
+ </listitem>
+
+ <listitem>
+ <para>Audio: fixed distortions on OS X when the sample rate of the guest stream
+ and host device don't match</para>
+ </listitem>
+
+ <listitem>
+ <para>Storage: fixed raw disk access and flat VMDK image access which would
+ be always opened readonly (5.0.2 regression; bugs #14425, #14461)</para>
+ </listitem>
+
+ <listitem>
+ <para>Storage: fixed initial encryption of VDI images after they were
+ compacted (bug #14496)</para>
+ </listitem>
+
+ <listitem>
+ <para>VGA: fix for certain graphics modes (bug #14516)</para>
+ </listitem>
+
+ <listitem>
+ <para>NAT: don't freeze while the VM is paused if the network attachment
+ mode is changed from/to NAT with activated port forwarding</para>
+ </listitem>
+
+ <listitem>
+ <para>OVF: fixed duplicate USB controller entries in exported OVA/OVF
+ (bug #14462)</para>
+ </listitem>
+
+ <listitem>
+ <para>Shared Folders: fixed a path separator issue (bug #14434)</para>
+ </listitem>
+
+ <listitem>
+ <para>Drag and drop: fixed crashes on OS X hosts when doing host-to-guest
+ transfers</para>
+ </listitem>
+
+ <listitem>
+ <para>VBoxManage: another attempt to not deny changing the network adapter
+ type at VM runtime (5.0 regression; bug #14308)</para>
+ </listitem>
+
+ <listitem>
+ <para>VBoxManage: fixed broken <computeroutput>guestcontrol <VM-Name> list</computeroutput>
+ command (5.0 regression)</para>
+ </listitem>
+
+ <listitem>
+ <para>VBoxManage: fixed broken Guest Control stdout/stderr output (5.0 regression)</para>
+ </listitem>
+
+ <listitem>
+ <para>Mac OS X hosts: fixed remaining problems with activated SMAP (Broadwell
+ and later; bug #14412)</para>
+ </listitem>
+
+ <listitem>
+ <para>Mac OS X hosts: fixed broken 3D support (5.0.2 regression;
+ bug #14476)</para>
+ </listitem>
+
+ <listitem>
+ <para>Linux hosts: Linux 4.2 fix</para>
+ </listitem>
+
+ <listitem>
+ <para>Linux hosts: don't crash on older Linux distributions if the DBus
+ service isn't running (bug #14543)</para>
+ </listitem>
+
+ <listitem>
+ <para>Windows hosts: fixed the <emphasis>VERR_LDR_MISMATCH_NATIVE</emphasis>
+ error message (bug #14420)</para>
+ </listitem>
+
+ <listitem>
+ <para>Windows hosts: fix for Windows 10 build 10525 and later (bug #14502)</para>
+ </listitem>
+
+ <listitem>
+ <para>Windows hosts: fixed network adapter enumeration on Windows 10 (bug #14437)</para>
+ </listitem>
+
+ <listitem>
+ <para>Windows hosts: prevent intermittent host network disconnects during
+ VM start/shutdown with bridged networking (bug #14500)</para>
+ </listitem>
+
+ <listitem>
+ <para>Windows Additions: fixed the call to the memory allocation function
+ (bug #14415)</para>
+ </listitem>
+
+ <listitem>
+ <para>Linux Additions: be more forgiving if the compilation of the
+ vboxvideo module fails (bug #14547)</para>
+ </listitem>
+
+ <listitem>
+ <para>X11 Additions: fixed a number of small issues with dynamic
+ resizing and full-screen and seamless modes.</para>
+ </listitem>
+
+ </itemizedlist>
+
+ </sect1>
+
+ <sect1>
<title>Version 5.0.2 (2015-08-13)</title>
<para>This is a maintenance release. The following items were fixed and/or
@@ -57,7 +229,7 @@
<listitem>
<para>GUI: X11: fixed various mini-toolbar geometry quirks like positioning, z-order,
- transiency issues on certain window managers (bug #14257)</para>
+ transparency issues on certain window managers (bug #14257)</para>
</listitem>
<listitem>
@@ -2942,4 +3114,3 @@
</sect1>
</chapter>
-
diff --git a/include/VBox/GuestHost/DragAndDrop.h b/include/VBox/GuestHost/DragAndDrop.h
index a62f8b7..247ec14 100644
--- a/include/VBox/GuestHost/DragAndDrop.h
+++ b/include/VBox/GuestHost/DragAndDrop.h
@@ -72,6 +72,8 @@ bool DnDMIMENeedsDropDir(const char *pcszFormat, size_t cchFormatMax);
int DnDPathSanitizeFilename(char *pszPath, size_t cbPath);
int DnDPathSanitize(char *pszPath, size_t cbPath);
+/** No flags specified. */
+#define DNDURILIST_FLAGS_NONE 0
/** Keep the original paths, don't convert paths to relative ones. */
#define DNDURILIST_FLAGS_ABSOLUTE_PATHS RT_BIT(0)
/** Resolve all symlinks. */
diff --git a/include/VBox/HostServices/DragAndDropSvc.h b/include/VBox/HostServices/DragAndDropSvc.h
index ab102b0..85615fa 100644
--- a/include/VBox/HostServices/DragAndDropSvc.h
+++ b/include/VBox/HostServices/DragAndDropSvc.h
@@ -438,7 +438,7 @@ typedef struct VBOXDNDNEXTMSGMSG
* Used by:
* GUEST_DND_CONNECT
*/
-typedef struct VBOXDNDCONNECTPMSG
+typedef struct VBOXDNDCONNECTMSG
{
VBoxGuestHGCMCallInfo hdr;
@@ -447,7 +447,7 @@ typedef struct VBOXDNDCONNECTPMSG
/** Connection flags. Optional. */
HGCMFunctionParameter uFlags; /* OUT uint32_t */
-} VBOXDNDCONNECTPMSG;
+} VBOXDNDCONNECTMSG;
/**
* HG Acknowledge Operation event.
diff --git a/include/VBox/vd-image-backend.h b/include/VBox/vd-image-backend.h
index 2ca9f72..560cc01 100644
--- a/include/VBox/vd-image-backend.h
+++ b/include/VBox/vd-image-backend.h
@@ -592,16 +592,8 @@ typedef VBOXHDDBACKEND *PVBOXHDDBACKEND;
typedef const VBOXHDDBACKEND *PCVBOXHDDBACKEND;
/** @copydoc VBOXHDDBACKEND::pfnComposeLocation */
-DECLINLINE(int) genericFileComposeLocation(PVDINTERFACE pConfig, char **pszLocation)
-{
- *pszLocation = NULL;
- return VINF_SUCCESS;
-}
+DECLCALLBACK(int) genericFileComposeLocation(PVDINTERFACE pConfig, char **pszLocation);
/** @copydoc VBOXHDDBACKEND::pfnComposeName */
-DECLINLINE(int) genericFileComposeName(PVDINTERFACE pConfig, char **pszName)
-{
- *pszName = NULL;
- return VINF_SUCCESS;
-}
+DECLCALLBACK(int) genericFileComposeName(PVDINTERFACE pConfig, char **pszName);
#endif
diff --git a/include/VBox/vmm/hm_vmx.h b/include/VBox/vmm/hm_vmx.h
index efbb630..2d745ee 100644
--- a/include/VBox/vmm/hm_vmx.h
+++ b/include/VBox/vmm/hm_vmx.h
@@ -1852,7 +1852,7 @@ DECLASM(int) VMXDispatchHostNmi(void);
* @returns VBox status code.
* @param HCPhysVmxOn Physical address of VMXON structure.
*/
-#if ((RT_INLINE_ASM_EXTERNAL || !defined(RT_ARCH_X86)) && !VMX_USE_MSC_INTRINSICS) || defined(VBOX_WITH_HYBRID_32BIT_KERNEL)
+#if ((RT_INLINE_ASM_EXTERNAL || !defined(RT_ARCH_X86)) && !VMX_USE_MSC_INTRINSICS)
DECLASM(int) VMXEnable(RTHCPHYS HCPhysVmxOn);
#else
DECLINLINE(int) VMXEnable(RTHCPHYS HCPhysVmxOn)
@@ -1915,7 +1915,7 @@ the_end:
/**
* Executes VMXOFF.
*/
-#if ((RT_INLINE_ASM_EXTERNAL || !defined(RT_ARCH_X86)) && !VMX_USE_MSC_INTRINSICS) || defined(VBOX_WITH_HYBRID_32BIT_KERNEL)
+#if ((RT_INLINE_ASM_EXTERNAL || !defined(RT_ARCH_X86)) && !VMX_USE_MSC_INTRINSICS)
DECLASM(void) VMXDisable(void);
#else
DECLINLINE(void) VMXDisable(void)
@@ -1946,7 +1946,7 @@ DECLINLINE(void) VMXDisable(void)
* @returns VBox status code.
* @param HCPhysVmcs Physical address of VM control structure.
*/
-#if ((RT_INLINE_ASM_EXTERNAL || !defined(RT_ARCH_X86)) && !VMX_USE_MSC_INTRINSICS) || defined(VBOX_WITH_HYBRID_32BIT_KERNEL)
+#if ((RT_INLINE_ASM_EXTERNAL || !defined(RT_ARCH_X86)) && !VMX_USE_MSC_INTRINSICS)
DECLASM(int) VMXClearVmcs(RTHCPHYS HCPhysVmcs);
#else
DECLINLINE(int) VMXClearVmcs(RTHCPHYS HCPhysVmcs)
@@ -2003,7 +2003,7 @@ success:
* @returns VBox status code.
* @param HCPhysVmcs Physical address of VMCS structure.
*/
-#if ((RT_INLINE_ASM_EXTERNAL || !defined(RT_ARCH_X86)) && !VMX_USE_MSC_INTRINSICS) || defined(VBOX_WITH_HYBRID_32BIT_KERNEL)
+#if ((RT_INLINE_ASM_EXTERNAL || !defined(RT_ARCH_X86)) && !VMX_USE_MSC_INTRINSICS)
DECLASM(int) VMXActivateVmcs(RTHCPHYS HCPhysVmcs);
#else
DECLINLINE(int) VMXActivateVmcs(RTHCPHYS HCPhysVmcs)
@@ -2075,7 +2075,7 @@ DECLASM(int) VMXGetActivatedVmcs(RTHCPHYS *pHCPhysVmcs);
* @remarks The values of the two status codes can be OR'ed together, the result
* will be VERR_VMX_INVALID_VMCS_PTR.
*/
-#if ((RT_INLINE_ASM_EXTERNAL || !defined(RT_ARCH_X86)) && !VMX_USE_MSC_INTRINSICS) || defined(VBOX_WITH_HYBRID_32BIT_KERNEL)
+#if ((RT_INLINE_ASM_EXTERNAL || !defined(RT_ARCH_X86)) && !VMX_USE_MSC_INTRINSICS)
DECLASM(int) VMXWriteVmcs32(uint32_t idxField, uint32_t u32Val);
#else
DECLINLINE(int) VMXWriteVmcs32(uint32_t idxField, uint32_t u32Val)
@@ -2143,7 +2143,7 @@ the_end:
* @remarks The values of the two status codes can be OR'ed together, the result
* will be VERR_VMX_INVALID_VMCS_PTR.
*/
-#if !defined(RT_ARCH_X86) || defined(VBOX_WITH_HYBRID_32BIT_KERNEL)
+#if !defined(RT_ARCH_X86)
# if !VMX_USE_MSC_INTRINSICS || ARCH_BITS != 64
DECLASM(int) VMXWriteVmcs64(uint32_t idxField, uint64_t u64Val);
# else /* VMX_USE_MSC_INTRINSICS */
@@ -2160,14 +2160,7 @@ DECLINLINE(int) VMXWriteVmcs64(uint32_t idxField, uint64_t u64Val)
VMMR0DECL(int) VMXWriteVmcs64Ex(PVMCPU pVCpu, uint32_t idxField, uint64_t u64Val);
#endif
-#ifdef VBOX_WITH_HYBRID_32BIT_KERNEL
-# define VMXWriteVmcsHstN(idxField, uVal) HMVMX_IS_64BIT_HOST_MODE() ? \
- VMXWriteVmcs64(idxField, uVal) \
- : VMXWriteVmcs32(idxField, uVal)
-# define VMXWriteVmcsGstN(idxField, u64Val) (pVCpu->CTX_SUFF(pVM)->hm.s.fAllow64BitGuests) ? \
- VMXWriteVmcs64(idxField, u64Val) \
- : VMXWriteVmcs32(idxField, u64Val)
-#elif ARCH_BITS == 32
+#if ARCH_BITS == 32
# define VMXWriteVmcsHstN VMXWriteVmcs32
# define VMXWriteVmcsGstN(idxField, u64Val) VMXWriteVmcs64Ex(pVCpu, idxField, u64Val)
#else /* ARCH_BITS == 64 */
@@ -2208,7 +2201,7 @@ DECLASM(int) VMXR0InvVPID(VMXFLUSHVPID enmFlush, uint64_t *pDescriptor);
* @remarks The values of the two status codes can be OR'ed together, the result
* will be VERR_VMX_INVALID_VMCS_PTR.
*/
-#if ((RT_INLINE_ASM_EXTERNAL || !defined(RT_ARCH_X86)) && !VMX_USE_MSC_INTRINSICS) || defined(VBOX_WITH_HYBRID_32BIT_KERNEL)
+#if ((RT_INLINE_ASM_EXTERNAL || !defined(RT_ARCH_X86)) && !VMX_USE_MSC_INTRINSICS)
DECLASM(int) VMXReadVmcs32(uint32_t idxField, uint32_t *pData);
#else
DECLINLINE(int) VMXReadVmcs32(uint32_t idxField, uint32_t *pData)
@@ -2286,7 +2279,7 @@ the_end:
* @remarks The values of the two status codes can be OR'ed together, the result
* will be VERR_VMX_INVALID_VMCS_PTR.
*/
-#if (!defined(RT_ARCH_X86) && !VMX_USE_MSC_INTRINSICS) || defined(VBOX_WITH_HYBRID_32BIT_KERNEL)
+#if (!defined(RT_ARCH_X86) && !VMX_USE_MSC_INTRINSICS)
DECLASM(int) VMXReadVmcs64(uint32_t idxField, uint64_t *pData);
#else
DECLINLINE(int) VMXReadVmcs64(uint32_t idxField, uint64_t *pData)
diff --git a/include/VBox/vmm/pdmaudioifs.h b/include/VBox/vmm/pdmaudioifs.h
index 7a4ee3c..08c53c6 100644
--- a/include/VBox/vmm/pdmaudioifs.h
+++ b/include/VBox/vmm/pdmaudioifs.h
@@ -111,14 +111,22 @@ typedef struct PDMAUDIOSTREAMCFG
# error "Port me!"
#endif
+/**
+ * Audio direction.
+ */
typedef enum PDMAUDIODIR
{
- PDMAUDIODIR_UNKNOWN = 0,
- PDMAUDIODIR_IN = 1,
- PDMAUDIODIR_OUT = 2,
- PDMAUDIODIR_BOTH = 3
+ PDMAUDIODIR_UNKNOWN = 0,
+ PDMAUDIODIR_IN = 1,
+ PDMAUDIODIR_OUT = 2,
+ PDMAUDIODIR_DUPLEX = 3,
+ /** Hack to blow the type up to 32-bit. */
+ PDMAUDIODIR_32BIT_HACK = 0x7fffffff
} PDMAUDIODIR;
+/**
+ * Audio mixer controls.
+ */
typedef enum PDMAUDIOMIXERCTL
{
PDMAUDIOMIXERCTL_UNKNOWN = 0,
@@ -130,6 +138,9 @@ typedef enum PDMAUDIOMIXERCTL
PDMAUDIOMIXERCTL_32BIT_HACK = 0x7fffffff
} PDMAUDIOMIXERCTL;
+/**
+ * Audio recording sources.
+ */
typedef enum PDMAUDIORECSOURCE
{
PDMAUDIORECSOURCE_UNKNOWN = 0,
@@ -501,6 +512,13 @@ typedef struct PDMIAUDIOCONNECTOR
DECLR3CALLBACKMEMBER(int, pfnOpenOut, (PPDMIAUDIOCONNECTOR pInterface, const char *pszName,
PPDMAUDIOSTREAMCFG pCfg, PPDMAUDIOGSTSTRMOUT *ppGstStrmOut));
+ /**
+ * Plays (transfers) all available samples via the connected host backend.
+ *
+ * @returns VBox status code.
+ * @param pInterface Pointer to the interface structure containing the called function pointer.
+ * @param pcSamplesPlayed Number of samples played. Optional.
+ */
DECLR3CALLBACKMEMBER(int, pfnPlayOut, (PPDMIAUDIOCONNECTOR pInterface, uint32_t *pcSamplesPlayed));
/**
@@ -625,6 +643,12 @@ typedef struct PDMIHOSTAUDIO
*/
DECLR3CALLBACKMEMBER(int, pfnFiniOut, (PPDMIHOSTAUDIO pInterface, PPDMAUDIOHSTSTRMOUT pHstStrmOut));
+ /**
+ * Returns whether the specified audio direction in the backend is enabled or not.
+ *
+ * @param pInterface Pointer to the interface structure containing the called function pointer.
+ * @param enmDir Audio direction to check status for.
+ */
DECLR3CALLBACKMEMBER(bool, pfnIsEnabled, (PPDMIHOSTAUDIO pInterface, PDMAUDIODIR enmDir));
/**
diff --git a/include/VBox/vmm/pdmdev.h b/include/VBox/vmm/pdmdev.h
index a393b9d..b302e66 100644
--- a/include/VBox/vmm/pdmdev.h
+++ b/include/VBox/vmm/pdmdev.h
@@ -4989,7 +4989,7 @@ DECLINLINE(int) PDMDevHlpSetDeviceCritSect(PPDMDEVINS pDevIns, PPDMCRITSECT pCri
* @copydoc PDMDEVHLPR3::pfnThreadCreate
*/
DECLINLINE(int) PDMDevHlpThreadCreate(PPDMDEVINS pDevIns, PPPDMTHREAD ppThread, void *pvUser, PFNPDMTHREADDEV pfnThread,
- PFNPDMTHREADWAKEUPDEV pfnWakeup, size_t cbStack, RTTHREADTYPE enmType, const char *pszName)
+ PFNPDMTHREADWAKEUPDEV pfnWakeup, size_t cbStack, RTTHREADTYPE enmType, const char *pszName)
{
return pDevIns->pHlpR3->pfnThreadCreate(pDevIns, ppThread, pvUser, pfnThread, pfnWakeup, cbStack, enmType, pszName);
}
diff --git a/include/VBox/vmm/pdmins.h b/include/VBox/vmm/pdmins.h
index 7ff8d3f..af44d3c 100644
--- a/include/VBox/vmm/pdmins.h
+++ b/include/VBox/vmm/pdmins.h
@@ -42,7 +42,7 @@
# define PDMBOTHCBDECL(type) DECLEXPORT(type)
# endif
#else
-# define PDMBOTHCBDECL(type) static type
+# define PDMBOTHCBDECL(type) static DECLCALLBACK(type)
#endif
/** @def PDMINS_2_DATA
diff --git a/include/VBox/vmm/pdmthread.h b/include/VBox/vmm/pdmthread.h
index 1513c59..af745dd 100644
--- a/include/VBox/vmm/pdmthread.h
+++ b/include/VBox/vmm/pdmthread.h
@@ -90,7 +90,7 @@ typedef PPDMTHREAD *PPPDMTHREAD;
* @param pDevIns The device instance.
* @param pThread The PDM thread data.
*/
-typedef int FNPDMTHREADDEV(PPDMDEVINS pDevIns, PPDMTHREAD pThread);
+typedef DECLCALLBACK(int) FNPDMTHREADDEV(PPDMDEVINS pDevIns, PPDMTHREAD pThread);
/** Pointer to a FNPDMTHREADDEV(). */
typedef FNPDMTHREADDEV *PFNPDMTHREADDEV;
@@ -101,7 +101,7 @@ typedef FNPDMTHREADDEV *PFNPDMTHREADDEV;
* @param pUsbIns The USB device instance.
* @param pThread The PDM thread data.
*/
-typedef int FNPDMTHREADUSB(PPDMUSBINS pUsbIns, PPDMTHREAD pThread);
+typedef DECLCALLBACK(int) FNPDMTHREADUSB(PPDMUSBINS pUsbIns, PPDMTHREAD pThread);
/** Pointer to a FNPDMTHREADUSB(). */
typedef FNPDMTHREADUSB *PFNPDMTHREADUSB;
@@ -112,7 +112,7 @@ typedef FNPDMTHREADUSB *PFNPDMTHREADUSB;
* @param pDrvIns The driver instance.
* @param pThread The PDM thread data.
*/
-typedef int FNPDMTHREADDRV(PPDMDRVINS pDrvIns, PPDMTHREAD pThread);
+typedef DECLCALLBACK(int) FNPDMTHREADDRV(PPDMDRVINS pDrvIns, PPDMTHREAD pThread);
/** Pointer to a FNPDMTHREADDRV(). */
typedef FNPDMTHREADDRV *PFNPDMTHREADDRV;
@@ -123,7 +123,7 @@ typedef FNPDMTHREADDRV *PFNPDMTHREADDRV;
* @param pVM The VM handle.
* @param pThread The PDM thread data.
*/
-typedef int FNPDMTHREADINT(PVM pVM, PPDMTHREAD pThread);
+typedef DECLCALLBACK(int) FNPDMTHREADINT(PVM pVM, PPDMTHREAD pThread);
/** Pointer to a FNPDMTHREADINT(). */
typedef FNPDMTHREADINT *PFNPDMTHREADINT;
@@ -146,7 +146,7 @@ typedef FNPDMTHREADEXT *PFNPDMTHREADEXT;
* @param pDevIns The device instance.
* @param pThread The PDM thread data.
*/
-typedef int FNPDMTHREADWAKEUPDEV(PPDMDEVINS pDevIns, PPDMTHREAD pThread);
+typedef DECLCALLBACK(int) FNPDMTHREADWAKEUPDEV(PPDMDEVINS pDevIns, PPDMTHREAD pThread);
/** Pointer to a FNPDMTHREADDEV(). */
typedef FNPDMTHREADWAKEUPDEV *PFNPDMTHREADWAKEUPDEV;
@@ -157,7 +157,7 @@ typedef FNPDMTHREADWAKEUPDEV *PFNPDMTHREADWAKEUPDEV;
* @param pUsbIns The USB device instance.
* @param pThread The PDM thread data.
*/
-typedef int FNPDMTHREADWAKEUPUSB(PPDMUSBINS pUsbIns, PPDMTHREAD pThread);
+typedef DECLCALLBACK(int) FNPDMTHREADWAKEUPUSB(PPDMUSBINS pUsbIns, PPDMTHREAD pThread);
/** Pointer to a FNPDMTHREADUSB(). */
typedef FNPDMTHREADWAKEUPUSB *PFNPDMTHREADWAKEUPUSB;
@@ -168,7 +168,7 @@ typedef FNPDMTHREADWAKEUPUSB *PFNPDMTHREADWAKEUPUSB;
* @param pDrvIns The driver instance.
* @param pThread The PDM thread data.
*/
-typedef int FNPDMTHREADWAKEUPDRV(PPDMDRVINS pDrvIns, PPDMTHREAD pThread);
+typedef DECLCALLBACK(int) FNPDMTHREADWAKEUPDRV(PPDMDRVINS pDrvIns, PPDMTHREAD pThread);
/** Pointer to a FNPDMTHREADDRV(). */
typedef FNPDMTHREADWAKEUPDRV *PFNPDMTHREADWAKEUPDRV;
@@ -179,7 +179,7 @@ typedef FNPDMTHREADWAKEUPDRV *PFNPDMTHREADWAKEUPDRV;
* @param pVM The VM handle.
* @param pThread The PDM thread data.
*/
-typedef int FNPDMTHREADWAKEUPINT(PVM pVM, PPDMTHREAD pThread);
+typedef DECLCALLBACK(int) FNPDMTHREADWAKEUPINT(PVM pVM, PPDMTHREAD pThread);
/** Pointer to a FNPDMTHREADWAKEUPINT(). */
typedef FNPDMTHREADWAKEUPINT *PFNPDMTHREADWAKEUPINT;
diff --git a/include/VBox/vmm/pgm.h b/include/VBox/vmm/pgm.h
index bcab354..8babb51 100644
--- a/include/VBox/vmm/pgm.h
+++ b/include/VBox/vmm/pgm.h
@@ -737,7 +737,7 @@ VMMR3DECL(int) PGMR3MappingsSize(PVM pVM, uint32_t *pcb);
VMMR3DECL(int) PGMR3MappingsFix(PVM pVM, RTGCPTR GCPtrBase, uint32_t cb);
VMMR3DECL(int) PGMR3MappingsUnfix(PVM pVM);
VMMR3DECL(bool) PGMR3MappingsNeedReFixing(PVM pVM);
-#if defined(VBOX_WITH_RAW_MODE) || (HC_ARCH_BITS != 64 && !defined(VBOX_WITH_HYBRID_32BIT_KERNEL))
+#if defined(VBOX_WITH_RAW_MODE) || HC_ARCH_BITS == 32 /* (latter for 64-bit guests on 32-bit hosts) */
VMMR3DECL(int) PGMR3MapIntermediate(PVM pVM, RTUINTPTR Addr, RTHCPHYS HCPhys, unsigned cbPages);
#endif
VMMR3DECL(int) PGMR3MapRead(PVM pVM, void *pvDst, RTGCPTR GCPtrSrc, size_t cb);
diff --git a/include/VBox/vmm/vm.h b/include/VBox/vmm/vm.h
index 3d520cd..5bc086a 100644
--- a/include/VBox/vmm/vm.h
+++ b/include/VBox/vmm/vm.h
@@ -391,10 +391,10 @@ typedef struct VMCPU
/** Same as VM_FF_PGM_SYNC_CR3 except that global pages can be skipped.
* (NON-GLOBAL FLUSH) */
#define VMCPU_FF_PGM_SYNC_CR3_NON_GLOBAL RT_BIT_32(17)
-/** Check for pending TLB shootdown actions.
- * Consumer: HM
- * @todo rename to VMCPU_FF_HM_TLB_SHOOTDOWN */
-#define VMCPU_FF_TLB_SHOOTDOWN RT_BIT_32(18)
+/** Check for pending TLB shootdown actions (deprecated)
+ * Reserved for furture HM re-use if necessary / safe.
+ * Consumer: HM */
+#define VMCPU_FF_TLB_SHOOTDOWN_UNUSED RT_BIT_32(18)
/** Check for pending TLB flush action.
* Consumer: HM
* @todo rename to VMCPU_FF_HM_TLB_FLUSH */
@@ -507,8 +507,7 @@ typedef struct VMCPU
/** All the forced VMCPU flags except those related to raw-mode and hardware
* assisted execution. */
#define VMCPU_FF_ALL_REM_MASK (~( VMCPU_FF_HIGH_PRIORITY_PRE_RAW_MASK | VMCPU_FF_PDM_CRITSECT \
- | VMCPU_FF_TLB_FLUSH | VMCPU_FF_TLB_SHOOTDOWN \
- | VM_WHEN_RAW_MODE(VMCPU_FF_CSAM_PENDING_ACTION, 0) ))
+ | VMCPU_FF_TLB_FLUSH | VM_WHEN_RAW_MODE(VMCPU_FF_CSAM_PENDING_ACTION, 0) ))
/** @} */
/** @def VM_FF_SET
diff --git a/include/iprt/asm.h b/include/iprt/asm.h
index cc7ea3e..72ba7cb 100644
--- a/include/iprt/asm.h
+++ b/include/iprt/asm.h
@@ -4362,7 +4362,7 @@ DECLINLINE(void) ASMBitSetRange(volatile void *pvBitmap, int32_t iBitStart, int3
int iStart = iBitStart & ~31;
int iEnd = iBitEnd & ~31;
if (iStart == iEnd)
- *pu32 |= ((1 << (iBitEnd - iBitStart)) - 1) << iBitStart;
+ *pu32 |= ((1 << (iBitEnd - iBitStart)) - 1) << (iBitStart & 31);
else
{
/* bits in first dword. */
diff --git a/include/iprt/asn1.h b/include/iprt/asn1.h
index 2ee2cd7..cbbc344 100644
--- a/include/iprt/asn1.h
+++ b/include/iprt/asn1.h
@@ -604,6 +604,7 @@ RTDECL(int) RTAsn1Dummy_InitEx(PRTASN1DUMMY pThis);
*/
DECLINLINE(int) RTAsn1Dummy_Init(PRTASN1DUMMY pThis, PCRTASN1ALLOCATORVTABLE pAllocator)
{
+ NOREF(pAllocator);
return RTAsn1Dummy_InitEx(pThis);
}
@@ -1213,7 +1214,10 @@ RTDECL(int) RTAsn1ContextTagN_Clone(PRTASN1CONTEXTTAG pThis, PCRTASN1CONTEXTTAG
typedef RT_CONCAT(RTASN1CONTEXTTAG,a_uTag) *RT_CONCAT(PRTASN1CONTEXTTAG,a_uTag); \
DECLINLINE(int) RT_CONCAT3(RTAsn1ContextTag,a_uTag,_Init)(RT_CONCAT(PRTASN1CONTEXTTAG,a_uTag) pThis, \
PCRTASN1ALLOCATORVTABLE pAllocator) \
- { return RTAsn1ContextTagN_Init((PRTASN1CONTEXTTAG)pThis, a_uTag); } \
+ { \
+ NOREF(pAllocator); \
+ return RTAsn1ContextTagN_Init((PRTASN1CONTEXTTAG)pThis, a_uTag); \
+ } \
DECLINLINE(int) RT_CONCAT3(RTAsn1ContextTag,a_uTag,_Clone)(RT_CONCAT(PRTASN1CONTEXTTAG,a_uTag) pThis, \
RT_CONCAT(RTASN1CONTEXTTAG,a_uTag) const *pSrc) \
{ return RTAsn1ContextTagN_Clone((PRTASN1CONTEXTTAG)pThis, (PCRTASN1CONTEXTTAG)pSrc, a_uTag); } \
diff --git a/include/iprt/cdefs.h b/include/iprt/cdefs.h
index 1287f07..0c74e59 100644
--- a/include/iprt/cdefs.h
+++ b/include/iprt/cdefs.h
@@ -876,16 +876,37 @@
# define RT_EXCEPTIONS_ENABLED
#endif
-/** @def RT_NO_THROW
+/** @def RT_NO_THROW_PROTO
* How to express that a function doesn't throw C++ exceptions
* and the compiler can thus save itself the bother of trying
* to catch any of them. Put this between the closing parenthesis
* and the semicolon in function prototypes (and implementation if C++).
+ *
+ * @remarks May not work on C++ methods, mainly intented for C-style APIs.
+ *
+ * @remarks The use of the nothrow attribute with GCC is because old compilers
+ * (4.1.1, 32-bit) leaking the nothrow into global space or something
+ * when used with RTDECL or similar. Using this forces use to have two
+ * macros, as the nothrow attribute is not for the function definition.
*/
#ifdef RT_EXCEPTIONS_ENABLED
-# define RT_NO_THROW throw()
+# ifdef __GNUC__
+# define RT_NO_THROW_PROTO __attribute__((__nothrow__))
+# else
+# define RT_NO_THROW_PROTO throw()
+# endif
+#else
+# define RT_NO_THROW_PROTO
+#endif
+
+/** @def RT_NO_THROW_DEF
+ * The counter part to RT_NO_THROW_PROTO that is added to the function
+ * definition.
+ */
+#if defined(RT_EXCEPTIONS_ENABLED) && !defined(__GNUC__)
+# define RT_NO_THROW_DEF RT_NO_THROW_PROTO
#else
-# define RT_NO_THROW
+# define RT_NO_THROW_DEF
#endif
/** @def RT_THROW
@@ -949,13 +970,16 @@
/** @def RTCALL
* The standard calling convention for the Runtime interfaces.
+ *
+ * @remarks The regparm(0) in the X86/GNUC variant deals with -mregparm=x use in
+ * the linux kernel and potentially elsewhere (3rd party).
*/
#ifdef _MSC_VER
-# define RTCALL __cdecl
+# define RTCALL __cdecl
#elif defined(RT_OS_OS2)
-# define RTCALL __cdecl
-#elif defined(__GNUC__) && defined(IN_RING0) && defined(RT_ARCH_X86) /** @todo consider dropping IN_RING0 here. */
-# define RTCALL __attribute__((cdecl,regparm(0))) /* regparm(0) deals with -mregparm=x use in the linux kernel. */
+# define RTCALL __cdecl
+#elif defined(__GNUC__) && defined(RT_ARCH_X86)
+# define RTCALL __attribute__((cdecl,regparm(0)))
#else
# define RTCALL
#endif
@@ -1023,32 +1047,16 @@
* @param type The return type of the function declaration.
*/
#ifdef __cplusplus
-# if defined(_MSC_VER) || defined(RT_OS_OS2)
-# define DECLASM(type) extern "C" type __cdecl
-# elif defined(__GNUC__) && defined(RT_ARCH_X86)
-# define DECLASM(type) extern "C" type __attribute__((cdecl,regparm(0)))
-# else
-# define DECLASM(type) extern "C" type
-# endif
+# define DECLASM(type) extern "C" type RTCALL
#else
-# if defined(_MSC_VER) || defined(RT_OS_OS2)
-# define DECLASM(type) type __cdecl
-# elif defined(__GNUC__) && defined(RT_ARCH_X86)
-# define DECLASM(type) type __attribute__((cdecl,regparm(0)))
-# else
-# define DECLASM(type) type
-# endif
+# define DECLASM(type) type RTCALL
#endif
/** @def DECLASMTYPE
* How to declare an internal assembly function type.
* @param type The return type of the function.
*/
-# if defined(_MSC_VER) || defined(RT_OS_OS2)
-# define DECLASMTYPE(type) type __cdecl
-#else
-# define DECLASMTYPE(type) type
-#endif
+#define DECLASMTYPE(type) type RTCALL
/** @def DECLNORETURN
* How to declare a function which does not return.
@@ -1443,6 +1451,7 @@
* String constant tuple - string constant, strlen(string constant).
*
* @param a_szConst String constant.
+ * @sa RTSTRTUPLE
*/
#define RT_STR_TUPLE(a_szConst) a_szConst, (sizeof(a_szConst) - 1)
diff --git a/include/iprt/cpp/mem.h b/include/iprt/cpp/mem.h
deleted file mode 100644
index 1e70ecf..0000000
--- a/include/iprt/cpp/mem.h
+++ /dev/null
@@ -1,271 +0,0 @@
-/** @file
- * IPRT - C++ Memory Resource Management.
- */
-
-/*
- * Copyright (C) 2006-2015 Oracle Corporation
- *
- * This file is part of VirtualBox Open Source Edition (OSE), as
- * available from http://www.virtualbox.org. This file is free software;
- * you can redistribute it and/or modify it under the terms of the GNU
- * General Public License (GPL) as published by the Free Software
- * Foundation, in version 2 as it comes in the "COPYING" file of the
- * VirtualBox OSE distribution. VirtualBox OSE is distributed in the
- * hope that it will be useful, but WITHOUT ANY WARRANTY of any kind.
- *
- * The contents of this file may alternatively be used under the terms
- * of the Common Development and Distribution License Version 1.0
- * (CDDL) only, as it comes in the "COPYING.CDDL" file of the
- * VirtualBox OSE distribution, in which case the provisions of the
- * CDDL are applicable instead of those of the GPL.
- *
- * You may elect to license modified versions of this file under the
- * terms and conditions of either the GPL or the CDDL or both.
- */
-
-#ifndef ___iprt_cpp_mem_h
-#define ___iprt_cpp_mem_h
-
-#include <iprt/cpp/autores.h>
-#include <iprt/assert.h>
-#include <iprt/mem.h>
-#include <iprt/string.h> /* for memset */
-
-/** @defgroup grp_rt_cpp_autores_mem C++ Memory Resource Management
- * @ingroup grp_rt_cpp_autores
- * @{
- */
-
-/**
- * Template function wrapping RTMemFree to get the correct a_fnDestruct
- * signature for RTCAutoRes.
- *
- * We can't use a more complex template here, because the g++ on RHEL 3
- * chokes on it with an internal compiler error.
- *
- * @tparam T The data type that's being managed.
- * @param aMem Pointer to the memory that should be free.
- */
-template <class T>
-inline void RTCMemAutoDestructor(T *aMem) RT_NO_THROW
-{
- RTMemFree(aMem);
-}
-
-
-/**
- * RTCMemAutoPtr allocator which uses RTMemTmpAlloc().
- *
- * @returns Allocated memory on success, NULL on failure.
- * @param pvOld What to reallocate, shall always be NULL.
- * @param cbNew The amount of memory to allocate (in bytes).
- */
-inline void *RTCMemTmpAutoAllocator(void *pvOld, size_t cbNew) RT_NO_THROW
-{
- AssertReturn(!pvOld, NULL);
- return RTMemTmpAlloc(cbNew);
-}
-
-
-/**
- * Template function wrapping RTMemTmpFree to get the correct a_fnDestruct
- * signature for RTCAutoRes.
- *
- * We can't use a more complex template here, because the g++ on RHEL 3
- * chokes on it with an internal compiler error.
- *
- * @tparam T The data type that's being managed.
- * @param aMem Pointer to the memory that should be free.
- */
-template <class T>
-inline void RTCMemTmpAutoDestructor(T *aMem) RT_NO_THROW
-{
- RTMemTmpFree(aMem);
-}
-
-
-/**
- * Template function wrapping RTMemEfFree to get the correct a_fnDestruct
- * signature for RTCAutoRes.
- *
- * We can't use a more complex template here, because the g++ on RHEL 3
- * chokes on it with an internal compiler error.
- *
- * @tparam T The data type that's being managed.
- * @param aMem Pointer to the memory that should be free.
- */
-template <class T>
-inline void RTCMemEfAutoFree(T *aMem) RT_NO_THROW
-{
- RTMemEfFreeNP(aMem);
-}
-
-
-/**
- * Template function wrapping NULL to get the correct NilRes signature
- * for RTCAutoRes.
- *
- * @tparam T The data type that's being managed.
- * @returns NULL with the right type.
- */
-template <class T>
-inline T *RTCMemAutoNil(void) RT_NO_THROW
-{
- return (T *)(NULL);
-}
-
-
-/**
- * An auto pointer-type template class for managing memory allocating
- * via C APIs like RTMem (the default).
- *
- * The main purpose of this class is to automatically free memory that
- * isn't explicitly used (release()'ed) when the object goes out of scope.
- *
- * As an additional service it can also make the allocations and
- * reallocations for you if you like, but it can also take of memory
- * you hand it.
- *
- * @tparam T The data type to manage allocations for.
- * @tparam a_fnDestruct The function to be used to free the resource.
- * This will default to RTMemFree.
- * @tparam a_fnAllocator The function to be used to allocate or reallocate
- * the managed memory.
- * This is standard realloc() like stuff, so it's
- * possible to support simple allocation without
- * actually having to support reallocating memory if
- * that's a problem. This will default to
- * RTMemRealloc.
- */
-template <class T,
- void a_fnDestruct(T *) = RTCMemAutoDestructor<T>,
-# if defined(RTMEM_WRAP_TO_EF_APIS) && !defined(RTMEM_NO_WRAP_TO_EF_APIS)
- void *a_fnAllocator(void *, size_t, const char *) = RTMemEfReallocNP
-# else
- void *a_fnAllocator(void *, size_t, const char *) = RTMemReallocTag
-# endif
- >
-class RTCMemAutoPtr
- : public RTCAutoRes<T *, a_fnDestruct, RTCMemAutoNil<T> >
-{
-public:
- /**
- * Constructor.
- *
- * @param aPtr Memory pointer to manage. Defaults to NULL.
- */
- RTCMemAutoPtr(T *aPtr = NULL)
- : RTCAutoRes<T *, a_fnDestruct, RTCMemAutoNil<T> >(aPtr)
- {
- }
-
- /**
- * Constructor that allocates memory.
- *
- * @param a_cElements The number of elements (of the data type) to allocate.
- * @param a_fZeroed Whether the memory should be memset with zeros after
- * the allocation. Defaults to false.
- */
- RTCMemAutoPtr(size_t a_cElements, bool a_fZeroed = false)
- : RTCAutoRes<T *, a_fnDestruct, RTCMemAutoNil<T> >((T *)a_fnAllocator(NULL, a_cElements * sizeof(T), RTMEM_TAG))
- {
- if (a_fZeroed && RT_LIKELY(this->get() != NULL))
- memset(this->get(), '\0', a_cElements * sizeof(T));
- }
-
- /**
- * Free current memory and start managing aPtr.
- *
- * @param aPtr Memory pointer to manage.
- */
- RTCMemAutoPtr &operator=(T *aPtr)
- {
- this->RTCAutoRes<T *, a_fnDestruct, RTCMemAutoNil<T> >::operator=(aPtr);
- return *this;
- }
-
- /**
- * Dereference with * operator.
- */
- T &operator*()
- {
- return *this->get();
- }
-
- /**
- * Dereference with -> operator.
- */
- T *operator->()
- {
- return this->get();
- }
-
- /**
- * Accessed with the subscript operator ([]).
- *
- * @returns Reference to the element.
- * @param a_i The element to access.
- */
- T &operator[](size_t a_i)
- {
- return this->get()[a_i];
- }
-
- /**
- * Allocates memory and start manage it.
- *
- * Any previously managed memory will be freed before making
- * the new allocation.
- *
- * @returns Success indicator.
- * @retval true if the new allocation succeeds.
- * @retval false on failure, no memory is associated with the object.
- *
- * @param a_cElements The number of elements (of the data type) to allocate.
- * This defaults to 1.
- * @param a_fZeroed Whether the memory should be memset with zeros after
- * the allocation. Defaults to false.
- */
- bool alloc(size_t a_cElements = 1, bool a_fZeroed = false)
- {
- this->reset(NULL);
- T *pNewMem = (T *)a_fnAllocator(NULL, a_cElements * sizeof(T), RTMEM_TAG);
- if (a_fZeroed && RT_LIKELY(pNewMem != NULL))
- memset(pNewMem, '\0', a_cElements * sizeof(T));
- this->reset(pNewMem);
- return pNewMem != NULL;
- }
-
- /**
- * Reallocate or allocates the memory resource.
- *
- * Free the old value if allocation fails.
- *
- * The content of any additional memory that was allocated is
- * undefined when using the default allocator.
- *
- * @returns Success indicator.
- * @retval true if the new allocation succeeds.
- * @retval false on failure, no memory is associated with the object.
- *
- * @param a_cElements The new number of elements (of the data type) to
- * allocate. The size of the allocation is the number of
- * elements times the size of the data type - this is
- * currently what's passed down to the a_fnAllocator.
- * This defaults to 1.
- */
- bool realloc(size_t a_cElements = 1)
- {
- T *aNewValue = (T *)a_fnAllocator(this->get(), a_cElements * sizeof(T), RTMEM_TAG);
- if (RT_LIKELY(aNewValue != NULL))
- this->release();
- /* We want this both if aNewValue is non-NULL and if it is NULL. */
- this->reset(aNewValue);
- return aNewValue != NULL;
- }
-};
-
-/** @} */
-
-#endif
-
diff --git a/include/iprt/crypto/pem.h b/include/iprt/crypto/pem.h
index b1350ad..f8e5e51 100644
--- a/include/iprt/crypto/pem.h
+++ b/include/iprt/crypto/pem.h
@@ -101,13 +101,34 @@ typedef RTCRPEMSECTION const *PCRTCRPEMSECTION;
/**
- * Frees sections returned by RTCrPemReadFile.
+ * Frees sections returned by RTCrPemReadFile and RTCrPemParseContent.
* @returns IPRT status code.
* @param pSectionHead The first section.
*/
RTDECL(int) RTCrPemFreeSections(PCRTCRPEMSECTION pSectionHead);
/**
+ * Parses the given data and returns a list of binary sections.
+ *
+ * If the file isn't an ASCII file or if no markers were found, the entire file
+ * content is returned as one single section (with pMarker = NULL).
+ *
+ * @returns IPRT status code.
+ * @retval VINF_EOF if the file is empty. The ppSectionHead value will be NULL.
+ *
+ * @param pvContent The content bytes to parse.
+ * @param cbContent The number of content bytes.
+ * @param fFlags RTCRPEMREADFILE_F_XXX.
+ * @param paMarkers Array of one or more section markers to look for.
+ * @param cMarkers Number of markers in the array.
+ * @param ppSectionHead Where to return the head of the section list. Call
+ * RTCrPemFreeSections to free.
+ * @param pErrInfo Where to return extend error info. Optional.
+ */
+RTDECL(int) RTCrPemParseContent(void const *pvContent, size_t cbContent, uint32_t fFlags,
+ PCRTCRPEMMARKER paMarkers, size_t cMarkers, PCRTCRPEMSECTION *ppSectionHead, PRTERRINFO pErrInfo);
+
+/**
* Reads the content of the given file and returns a list of binary sections
* found in the file.
*
@@ -115,15 +136,24 @@ RTDECL(int) RTCrPemFreeSections(PCRTCRPEMSECTION pSectionHead);
* content is returned as one single section (with pMarker = NULL).
*
* @returns IPRT status code.
+ * @retval VINF_EOF if the file is empty. The ppSectionHead value will be NULL.
+ *
* @param pszFilename The path to the file to read.
- * @param fFlags Flags reserved for future hacks.
+ * @param fFlags RTCRPEMREADFILE_F_XXX.
* @param paMarkers Array of one or more section markers to look for.
* @param cMarkers Number of markers in the array.
- * @param ppSectionHead Where to return the head of the section list.
+ * @param ppSectionHead Where to return the head of the section list. Call
+ * RTCrPemFreeSections to free.
* @param pErrInfo Where to return extend error info. Optional.
*/
RTDECL(int) RTCrPemReadFile(const char *pszFilename, uint32_t fFlags, PCRTCRPEMMARKER paMarkers, size_t cMarkers,
PCRTCRPEMSECTION *ppSectionHead, PRTERRINFO pErrInfo);
+/** @name RTCRPEMREADFILE_F_XXX - Flags for RTCrPemReadFile and
+ * RTCrPemParseContent.
+ * @{ */
+/** Continue on encoding error. */
+#define RTCRPEMREADFILE_F_CONTINUE_ON_ENCODING_ERROR RT_BIT(0)
+/** @} */
/** @} */
diff --git a/include/iprt/crypto/store.h b/include/iprt/crypto/store.h
index b974285..024fc1b 100644
--- a/include/iprt/crypto/store.h
+++ b/include/iprt/crypto/store.h
@@ -28,6 +28,7 @@
#include <iprt/crypto/x509.h>
#include <iprt/crypto/taf.h>
+#include <iprt/sha.h>
RT_C_DECLS_BEGIN
@@ -57,14 +58,246 @@ typedef struct RTCRSTORECERTSEARCH
typedef RTCRSTORECERTSEARCH *PRTCRSTORECERTSEARCH;
+/**
+ * Info about a wanted certificate.
+ *
+ * All the search criteria are optional, but for a safe and efficient search
+ * it's recommended to specify all possible ones. If none are given, the search
+ * function will fail.
+ *
+ * For use with RTCrStoreCertAddFromFishingExpedition and others.
+ */
+typedef struct RTCRCERTWANTED
+{
+ /** The certificate subject name, optional.
+ * The format is: "C=US, ST=California, L=Redwood Shores, O=Oracle Corporation" */
+ const char *pszSubject;
+ /** The size of the DER (ASN.1) encoded certificate, optional (0). */
+ uint16_t cbEncoded;
+ /** Set if abSha1 contains a valid SHA-1 fingerprint. */
+ bool fSha1Fingerprint;
+ /** Set if abSha512 contains a valid SHA-512 fingerprint. */
+ bool fSha512Fingerprint;
+ /** The SHA-1 fingerprint (of the encoded data). */
+ uint8_t abSha1[RTSHA1_HASH_SIZE];
+ /** The SHA-512 fingerprint (of the encoded data). */
+ uint8_t abSha512[RTSHA512_HASH_SIZE];
+ /** User pointer for directly associating other data with the entry.
+ * Subclassing the structure isn't possible because it's passed as an array. */
+ void const *pvUser;
+} RTCRCERTWANTED;
+/** Pointer to a const certificat wanted structure. */
+typedef RTCRCERTWANTED const *PCRTCRCERTWANTED;
+
+
+/**
+ * Standard store identifiers.
+ *
+ * This is a least common denominator approach to system specific certificate
+ * stores, could be extended to include things other than certificates later if
+ * we need it.
+ *
+ * Windows has lots of different stores, they'll be combined by the
+ * implementation, possibly leading to duplicates. The user stores on Windows
+ * seems to be unioned with the system (machine) stores.
+ *
+ * Linux may have different stores depending on the distro/version/installation,
+ * in which case we'll combine them, which will most likely lead to
+ * duplicates just like on windows. Haven't found any easily accessible
+ * per-user certificate stores on linux yet, so they'll all be empty.
+ *
+ * Mac OS X seems a lot simpler, at least from the GUI point of view. Each
+ * keychains as a "Certificates" folder (the "My Certificates" folder seems to
+ * only be a matching of "Keys" and "Certificates"). However, there are two
+ * system keychains that we need to combine, "System" and "System Roots". As
+ * with Windows and Linux, there is a possibility for duplicates here.
+ *
+ * On solaris we have currently no idea where to look for a certificate store,
+ * so that doesn't yet work.
+ *
+ * Because of the OS X setup, we do not provide any purpose specific
+ */
+typedef enum RTCRSTOREID
+{
+ /** Mandatory invalid zero value. */
+ RTCRSTOREID_INVALID = 0,
+ /** Open the certificate store of the current user containing trusted
+ * CAs and certificates.
+ * @remarks This may or may not include all the certificates in the system
+ * store, that's host dependent. So, you better look in both. */
+ RTCRSTOREID_USER_TRUSTED_CAS_AND_CERTIFICATES,
+ /** Open the certificate store of the system containg trusted CAs
+ * and certificates. */
+ RTCRSTOREID_SYSTEM_TRUSTED_CAS_AND_CERTIFICATES,
+ /** End of valid values. */
+ RTCRSTOREID_END,
+ /** Traditional enum type compression prevention hack. */
+ RTCRSTOREID_32BIT_HACK = 0x7fffffff
+} RTCRSTOREID;
+
+/**
+ * Creates a snapshot of a standard store.
+ *
+ * This will return an in-memory store containing all data from the given store.
+ * There will be no duplicates in this one.
+ *
+ * @returns IPRT status code.
+ * @retval VWRN_ALREADY_EXISTS if the certificate is already present and
+ * RTCRCERTCTX_F_ADD_IF_NOT_FOUND was specified.
+ * @param phStore Where to return the store handle. Use
+ * RTCrStoreRelease to release it.
+ * @param enmStoreId The store to snapshot.
+ * @param pErrInfo Where to return additional error/warning info.
+ * Optional.
+ */
+RTDECL(int) RTCrStoreCreateSnapshotById(PRTCRSTORE phStore, RTCRSTOREID enmStoreId, PRTERRINFO pErrInfo);
+
RTDECL(int) RTCrStoreCreateInMem(PRTCRSTORE phStore, uint32_t cSizeHint);
RTDECL(uint32_t) RTCrStoreRetain(RTCRSTORE hStore);
RTDECL(uint32_t) RTCrStoreRelease(RTCRSTORE hStore);
RTDECL(PCRTCRCERTCTX) RTCrStoreCertByIssuerAndSerialNo(RTCRSTORE hStore, PCRTCRX509NAME pIssuer, PCRTASN1INTEGER pSerialNo);
+
+/**
+ * Add a certificate to the store.
+ *
+ * @returns IPRT status code.
+ * @retval VWRN_ALREADY_EXISTS if the certificate is already present and
+ * RTCRCERTCTX_F_ADD_IF_NOT_FOUND was specified.
+ * @retval VERR_WRITE_PROTECT if the store doesn't support adding.
+ * @param hStore The store to add the certificate to.
+ * @param fFlags RTCRCERTCTX_F_XXX. Encoding must be specified.
+ * RTCRCERTCTX_F_ADD_IF_NOT_FOUND is supported.
+ * @param pvSrc The encoded certificate bytes.
+ * @param cbSrc The size of the encoded certificate.
+ * @param pErrInfo Where to return additional error/warning info.
+ * Optional.
+ */
RTDECL(int) RTCrStoreCertAddEncoded(RTCRSTORE hStore, uint32_t fFlags, void const *pvSrc, size_t cbSrc, PRTERRINFO pErrInfo);
+
+/**
+ * Adds certificates from files in the specified directory.
+ *
+ * @returns IPRT status code. Even when RTCRCERTCTX_F_ADD_CONTINUE_ON_ERROR is
+ * used, an error is returned as an error (and not a warning).
+ *
+ * @param hStore The store to add the certificate(s) to.
+ * @param fFlags RTCRCERTCTX_F_ADD_IF_NOT_FOUND and/or
+ * RTCRCERTCTX_F_ADD_CONTINUE_ON_ERROR.
+ * @param pszDir The path to the directory.
+ * @param paSuffixes List of suffixes of files to process.
+ * @param cSuffixes Number of suffixes. If this is 0, all files are
+ * processed.
+ * @param pErrInfo Where to return additional error/warning info.
+ * Optional.
+ */
+RTDECL(int) RTCrStoreCertAddFromDir(RTCRSTORE hStore, uint32_t fFlags, const char *pszDir,
+ PCRTSTRTUPLE paSuffixes, size_t cSuffixes, PRTERRINFO pErrInfo);
+
+RTDECL(int) RTCrStoreCertAddWantedFromDir(RTCRSTORE hStore, uint32_t fFlags,
+ const char *pszDir, PCRTSTRTUPLE paSuffixes, size_t cSuffixes,
+ PCRTCRCERTWANTED paWanted, size_t cWanted, bool *pafFound, PRTERRINFO pErrInfo);
+
+/**
+ * Adds certificates from the specified file.
+ *
+ * The supported file formats are:
+ * - PEM (base 64 blobs wrapped in -----BEGIN / END----). Support multiple
+ * certificates in one file.
+ * - Binary DER ASN.1 certificate. Only one per file.
+ * - Java key store version 2.
+ *
+ * @returns IPRT status code. Even when RTCRCERTCTX_F_ADD_CONTINUE_ON_ERROR is
+ * used, an error is returned as an error (and not a warning).
+ *
+ * @param hStore The store to add the certificate(s) to.
+ * @param fFlags RTCRCERTCTX_F_ADD_IF_NOT_FOUND and/or
+ * RTCRCERTCTX_F_ADD_CONTINUE_ON_ERROR.
+ * @param pszFilename The filename.
+ * @param pErrInfo Where to return additional error/warning info.
+ * Optional.
+ */
RTDECL(int) RTCrStoreCertAddFromFile(RTCRSTORE hStore, uint32_t fFlags, const char *pszFilename, PRTERRINFO pErrInfo);
+RTDECL(int) RTCrStoreCertAddWantedFromFile(RTCRSTORE hStore, uint32_t fFlags, const char *pszFilename,
+ PCRTCRCERTWANTED paWanted, size_t cWanted, bool *pafFound, PRTERRINFO pErrInfo);
+
+/**
+ * Adds certificates from the specified java key store file.
+ *
+ * @returns IPRT status code. Even when RTCRCERTCTX_F_ADD_CONTINUE_ON_ERROR is
+ * used, an error is returned as an error (and not a warning).
+ *
+ * @param hStore The store to add the certificate(s) to.
+ * @param fFlags RTCRCERTCTX_F_ADD_IF_NOT_FOUND and/or
+ * RTCRCERTCTX_F_ADD_CONTINUE_ON_ERROR.
+ * @param pszFilename The path to the JKS file.
+ * @param pErrInfo Where to return additional error/warning info.
+ * Optional.
+ */
+RTDECL(int) RTCrStoreCertAddFromJavaKeyStore(RTCRSTORE hStore, uint32_t fFlags, const char *pszFilename, PRTERRINFO pErrInfo);
+
+/**
+ * Adds certificates from an in-memory java key store.
+ *
+ * @returns IPRT status code. Even when RTCRCERTCTX_F_ADD_CONTINUE_ON_ERROR is
+ * used, an error is returned as an error (and not a warning).
+ *
+ * @param hStore The store to add the certificate(s) to.
+ * @param fFlags RTCRCERTCTX_F_ADD_IF_NOT_FOUND and/or
+ * RTCRCERTCTX_F_ADD_CONTINUE_ON_ERROR.
+ * @param pvContent Pointer to the key store bytes.
+ * @param cbContent The size of the key store.
+ * @param pszErrorName The file name or whatever helpful indicator the
+ * caller want in the error messages.
+ * @param pErrInfo Where to return additional error/warning info.
+ * Optional.
+ */
+RTDECL(int) RTCrStoreCertAddFromJavaKeyStoreInMem(RTCRSTORE hStore, uint32_t fFlags, void const *pvContent, size_t cbContent,
+ const char *pszErrorName, PRTERRINFO pErrInfo);
+
+/**
+ * Adds all certificates from @a hStoreSrc into @a hStore.
+ *
+ * @returns IPRT status code. Even when RTCRCERTCTX_F_ADD_CONTINUE_ON_ERROR is
+ * used, an error is returned as an error (and not a warning).
+ *
+ * @param hStore The destination store.
+ * @param fFlags RTCRCERTCTX_F_ADD_IF_NOT_FOUND and/or
+ * RTCRCERTCTX_F_ADD_CONTINUE_ON_ERROR.
+ * @param hStoreSrc The source store.
+ */
+RTDECL(int) RTCrStoreCertAddFromStore(RTCRSTORE hStore, uint32_t fFlags, RTCRSTORE hStoreSrc);
+
+RTDECL(int) RTCrStoreCertAddWantedFromStore(RTCRSTORE hStore, uint32_t fFlags, RTCRSTORE hSrcStore,
+ PCRTCRCERTWANTED paWanted, size_t cWanted, bool *pafFound);
+
+RTDECL(int) RTCrStoreCertCheckWanted(RTCRSTORE hStore, PCRTCRCERTWANTED paWanted, size_t cWanted, bool *pafFound);
+
+
+RTDECL(int) RTCrStoreCertAddWantedFromFishingExpedition(RTCRSTORE hStore, uint32_t fFlags,
+ PCRTCRCERTWANTED paWanted, size_t cWanted,
+ bool *pafFound, PRTERRINFO pErrInfo);
+
+/**
+ * Exports the certificates in the store to a PEM file
+ *
+ * @returns IPRT status code.
+ * @param hStore The store which certificates should be exported.
+ * @param fFlags Reserved for the future, MBZ.
+ * @param pszFilename The name of the destination PEM file. This will
+ * be truncated.
+ */
+RTDECL(int) RTCrStoreCertExportAsPem(RTCRSTORE hStore, uint32_t fFlags, const char *pszFilename);
+
+/**
+ * Counts the number of certificates in the store.
+ *
+ * @returns Certificate count on success, UINT32_MAX on failure.
+ * @param hStore The store which certificates should be counted.
+ */
+RTDECL(uint32_t) RTCrStoreCertCount(RTCRSTORE hStore);
+
RTDECL(int) RTCrStoreCertFindAll(RTCRSTORE hStore, PRTCRSTORECERTSEARCH pSearch);
RTDECL(int) RTCrStoreCertFindBySubjectOrAltSubjectByRfc5280(RTCRSTORE hStore, PCRTCRX509NAME pSubject,
PRTCRSTORECERTSEARCH pSearch);
@@ -118,6 +351,13 @@ typedef struct RTCRCERTCTX
/** Extended certificate, DER encoded. */
#define RTCRCERTCTX_F_ENC_PKCS6_DER UINT32_C(0x00000002)
#endif
+/** Mask containing the flags that ends up in the certificate context. */
+#define RTCRCERTCTX_F_MASK UINT32_C(0x000000ff)
+
+/** Add APIs: Add the certificate if not found. */
+#define RTCRCERTCTX_F_ADD_IF_NOT_FOUND UINT32_C(0x00010000)
+/** Add APIs: Continue on error when possible. */
+#define RTCRCERTCTX_F_ADD_CONTINUE_ON_ERROR UINT32_C(0x00020000)
/** @} */
diff --git a/include/iprt/crypto/x509.h b/include/iprt/crypto/x509.h
index 68a5a88..1744f04 100644
--- a/include/iprt/crypto/x509.h
+++ b/include/iprt/crypto/x509.h
@@ -164,7 +164,7 @@ RTDECL(bool) RTCrX509Name_ConstraintMatch(PCRTCRX509NAME pConstraint, PCRTCRX509
RTDECL(int) RTCrX509Name_RecodeAsUtf8(PRTCRX509NAME pThis, PCRTASN1ALLOCATORVTABLE pAllocator);
/**
- * Matches the directory name against a comma separated list of the comonent
+ * Matches the directory name against a comma separated list of the component
* strings (case sensitive).
*
* @returns true if match, false if mismatch.
diff --git a/include/iprt/dir.h b/include/iprt/dir.h
index 73aa559..3667613 100644
--- a/include/iprt/dir.h
+++ b/include/iprt/dir.h
@@ -235,7 +235,7 @@ typedef enum RTDIRFILTER
* Directory entry type.
*
* This is the RTFS_TYPE_MASK stuff shifted down 12 bits and
- * identical to the BSD/LINUX ABI.
+ * identical to the BSD/LINUX ABI. See RTFS_TYPE_DIRENTRYTYPE_SHIFT.
*/
typedef enum RTDIRENTRYTYPE
{
diff --git a/include/iprt/err.h b/include/iprt/err.h
index 7a7c47f..b4a4236 100644
--- a/include/iprt/err.h
+++ b/include/iprt/err.h
@@ -1691,6 +1691,8 @@ RT_C_DECLS_END
#define VERR_HTTP_ABORTED (-893)
/** Request was redirected. */
#define VERR_HTTP_REDIRECTED (-894)
+/** Proxy couldn't be resolved. */
+#define VERR_HTTP_PROXY_NOT_FOUND (-895)
/** @} */
/** @name RTManifest status codes
@@ -2475,12 +2477,24 @@ RT_C_DECLS_END
/** @name RTCrDigest status codes.
* @{ */
-/** OpenSSL failed to initialize the digest algorithm contextn. */
+/** OpenSSL failed to initialize the digest algorithm context. */
#define VERR_CR_DIGEST_OSSL_DIGEST_INIT_ERROR (-24200)
/** OpenSSL failed to clone the digest algorithm context. */
#define VERR_CR_DIGEST_OSSL_DIGEST_CTX_COPY_ERROR (-24201)
/** @} */
+/** @name RTPath status codes.
+ * @{ */
+/** Unknown glob variable. */
+#define VERR_PATH_MATCH_UNKNOWN_VARIABLE (-24400)
+/** The specified glob variable must be first in the pattern. */
+#define VERR_PATH_MATCH_VARIABLE_MUST_BE_FIRST (-24401)
+/** Hit unimplemented glob pattern matching feature. */
+#define VERR_PATH_MATCH_FEATURE_NOT_IMPLEMENTED (-24402)
+/** Unknown character class in glob pattern. */
+#define VERR_PATH_GLOB_UNKNOWN_CHAR_CLASS (-24403)
+/** @} */
+
/* SED-END */
/** @} */
diff --git a/include/iprt/file.h b/include/iprt/file.h
index 3a4dd0b..877c4a6 100644
--- a/include/iprt/file.h
+++ b/include/iprt/file.h
@@ -777,6 +777,20 @@ RTDECL(int) RTFileCreateTemp(char *pszTemplate, RTFMODE fMode);
*/
RTDECL(int) RTFileCreateTempSecure(char *pszTemplate);
+/**
+ * Opens a new file with a unique name in the temp directory.
+ *
+ * @returns iprt status code.
+ * @param pszTemplate The file name template on input. The actual file
+ * name on success. Empty string on failure.
+ * @param fMode The mode to create the file with. Use 0600 unless
+ * you have reason not to.
+ *
+ * @remarks If actual control over the filename or location is required, we'll
+ * create an extended edition of this API.
+ */
+RTDECL(int) RTFileOpenTemp(PRTFILE pFile, char *pszFilename, size_t cbFilename, uint64_t fOpen);
+
/** @page pg_rt_filelock RT File locking API description
*
diff --git a/include/iprt/fs.h b/include/iprt/fs.h
index 7b720be..8220ce6 100644
--- a/include/iprt/fs.h
+++ b/include/iprt/fs.h
@@ -116,6 +116,8 @@ RT_C_DECLS_BEGIN
#define RTFS_TYPE_WHITEOUT 0160000U
/** Type mask (S_IFMT). */
#define RTFS_TYPE_MASK 0170000U
+/** The shift count to convert between RTFS_TYPE_MASK and DIRENTRYTYPE. */
+#define RTFS_TYPE_DIRENTRYTYPE_SHIFT 12
/** Unix attribute mask. */
#define RTFS_UNIX_MASK 0xffffU
@@ -592,6 +594,17 @@ typedef RTFSPROPERTIES const *PCRTFSPROPERTIES;
*/
RTR3DECL(int) RTFsQueryProperties(const char *pszFsPath, PRTFSPROPERTIES pProperties);
+/**
+ * Checks if the given volume is case sensitive or not.
+ *
+ * This may be misleading in some cases as we lack the necessary APIs to query
+ * the information on some system (or choose not to use them) and are instead
+ * returning the general position on case sensitive file name of the system.
+ *
+ * @returns @c true if case sensitive, @c false if not.
+ * @param pszFsPath Path within the mounted file system.
+ */
+RTR3DECL(bool) RTFsIsCaseSensitive(const char *pszFsPath);
/**
* Mountpoint enumerator callback.
diff --git a/include/iprt/http.h b/include/iprt/http.h
index ca7cc5b..de42cd0 100644
--- a/include/iprt/http.h
+++ b/include/iprt/http.h
@@ -1,6 +1,6 @@
/* $Id: http.h $ */
/** @file
- * IPRT - Simple HTTP Communication API.
+ * IPRT - Simple HTTP/HTTPS Client API.
*/
/*
@@ -31,22 +31,22 @@
RT_C_DECLS_BEGIN
-/** @defgroup grp_rt_http RTHttp - Simple HTTP API
+/** @defgroup grp_rt_http RTHttp - Simple HTTP/HTTPS Client API
* @ingroup grp_rt
* @{
*/
/** @todo the following three definitions may move the iprt/types.h later. */
-/** RTHTTP interface handle. */
+/** HTTP/HTTPS client handle. */
typedef R3PTRTYPE(struct RTHTTPINTERNAL *) RTHTTP;
-/** Pointer to a RTHTTP interface handle. */
-typedef RTHTTP *PRTHTTP;
-/** Nil RTHTTP interface handle. */
+/** Pointer to a HTTP/HTTPS client handle. */
+typedef RTHTTP *PRTHTTP;
+/** Nil HTTP/HTTPS client handle. */
#define NIL_RTHTTP ((RTHTTP)0)
/**
- * Creates a HTTP interface handle.
+ * Creates a HTTP client instance.
*
* @returns iprt status code.
*
@@ -55,7 +55,7 @@ typedef RTHTTP *PRTHTTP;
RTR3DECL(int) RTHttpCreate(PRTHTTP phHttp);
/**
- * Destroys a HTTP interface handle.
+ * Destroys a HTTP client instance.
*
* @param hHttp Handle to the HTTP interface.
*/
@@ -65,8 +65,8 @@ RTR3DECL(void) RTHttpDestroy(RTHTTP hHttp);
/**
* Retrieve the redir location for 301 responses.
*
- * @param hHttp Handle to the HTTP interface.
- * @para ppszRedirLocation Where to store the string. To be freed with
+ * @param hHttp Handle to the HTTP interface.
+ * @param ppszRedirLocation Where to store the string. To be freed with
* RTStrFree().
*/
RTR3DECL(int) RTHttpGetRedirLocation(RTHTTP hHttp, char **ppszRedirLocation);
@@ -74,34 +74,66 @@ RTR3DECL(int) RTHttpGetRedirLocation(RTHTTP hHttp, char **ppszRedirLocation);
/**
* Perform a simple blocking HTTP request.
*
+ * This is a just a convenient wrapper around RTHttpGetBinary that returns a
+ * different type and sheds a parameter.
+ *
* @returns iprt status code.
*
- * @param hHttp HTTP interface handle.
- * @param pcszUrl URL.
- * @param ppszResponse HTTP response. It is guaranteed that this string is
- * '\0'-terminated.
+ * @param hHttp The HTTP client instance.
+ * @param pszUrl URL.
+ * @param ppszNotUtf8 Where to return the poitner to the HTTP response.
+ * The string is of course zero terminated. Use
+ * RTHttpFreeReponseText to free.
+ *
+ * @remarks BIG FAT WARNING!
+ *
+ * This function does not guarantee the that returned string is valid UTF-8 or
+ * any other kind of text encoding!
+ *
+ * The caller must determine and validate the string encoding _before_
+ * passing it along to functions that expect UTF-8!
+ *
+ * Also, this function does not guarantee that the returned string
+ * doesn't have embedded zeros and provides the caller no way of
+ * finding out! If you are worried about the response from the HTTPD
+ * containing embedded zero's, use RTHttpGetBinary instead.
*/
-RTR3DECL(int) RTHttpGetText(RTHTTP hHttp, const char *pcszUrl, char **ppszResponse);
+RTR3DECL(int) RTHttpGetText(RTHTTP hHttp, const char *pszUrl, char **ppszNotUtf8);
+
+/**
+ * Frees memory returned by RTHttpGetText.
+ *
+ * @param pszNotUtf8 What RTHttpGetText returned.
+ */
+RTR3DECL(void) RTHttpFreeResponseText(char *pszNotUtf8);
/**
* Perform a simple blocking HTTP request.
*
* @returns iprt status code.
*
- * @param hHttp HTTP interface handle.
- * @param pcszUrl URL.
- * @param ppvResponse HTTP response.
- * @param pcb Size of the returned buffer.
+ * @param hHttp The HTTP client instance.
+ * @param pszUrl The URL.
+ * @param ppvResponse Where to store the HTTP response data. Use
+ * RTHttpFreeResponse to free.
+ * @param pcb Size of the returned buffer.
+ */
+RTR3DECL(int) RTHttpGetBinary(RTHTTP hHttp, const char *pszUrl, void **ppvResponse, size_t *pcb);
+
+/**
+ * Frees memory returned by RTHttpGetBinary.
+ *
+ * @param pvResponse What RTHttpGetBinary returned.
*/
-RTR3DECL(int) RTHttpGetBinary(RTHTTP hHttp, const char *pcszUrl, void **ppvResponse, size_t *pcb);
+RTR3DECL(void) RTHttpFreeResponse(void *pvResponse);
/**
* Perform a simple blocking HTTP request, writing the output to a file.
*
* @returns iprt status code.
*
- * @param hHttp HTTP interface handle.
- * @param pszUrl URL.
+ * @param hHttp The HTTP client instance.
+ * @param pszUrl The URL.
* @param pszDstFile The destination file name.
*/
RTR3DECL(int) RTHttpGetFile(RTHTTP hHttp, const char *pszUrl, const char *pszDstFile);
@@ -113,7 +145,7 @@ RTR3DECL(int) RTHttpGetFile(RTHTTP hHttp, const char *pszUrl, const char *pszDst
*
* @returns iprt status code.
*
- * @param hHttp HTTP interface handle.
+ * @param hHttp The HTTP client instance.
*/
RTR3DECL(int) RTHttpAbort(RTHTTP hHttp);
@@ -121,7 +153,7 @@ RTR3DECL(int) RTHttpAbort(RTHTTP hHttp);
* Tells the HTTP interface to use the system proxy configuration.
*
* @returns iprt status code.
- * @param hHttp HTTP interface handle.
+ * @param hHttp The HTTP client instance.
*/
RTR3DECL(int) RTHttpUseSystemProxySettings(RTHTTP hHttp);
@@ -130,58 +162,80 @@ RTR3DECL(int) RTHttpUseSystemProxySettings(RTHTTP hHttp);
*
* @returns iprt status code.
*
- * @param hHttp HTTP interface handle.
- * @param pcszProxy URL of the proxy
- * @param uPort port number of the proxy, use 0 for not specifying a port.
- * @param pcszUser username, pass NULL for no authentication
- * @param pcszPwd password, pass NULL for no authentication
+ * @param hHttp The HTTP client instance.
+ * @param pszProxy URL of the proxy.
+ * @param uPort port number of the proxy, use 0 for not specifying a port.
+ * @param pszProxyUser Username, pass NULL for no authentication.
+ * @param pszProxyPwd Password, pass NULL for no authentication.
*/
-RTR3DECL(int) RTHttpSetProxy(RTHTTP hHttp, const char *pcszProxyUrl, uint32_t uPort,
- const char *pcszProxyUser, const char *pcszProxyPwd);
+RTR3DECL(int) RTHttpSetProxy(RTHTTP hHttp, const char *pszProxyUrl, uint32_t uPort,
+ const char *pszProxyUser, const char *pszProxyPwd);
/**
* Set custom headers.
*
* @returns iprt status code.
*
- * @param hHttp HTTP interface handle.
- * @param cHeaders number of custom headers.
- * @param pcszHeaders array of headers in form "foo: bar".
+ * @param hHttp The HTTP client instance.
+ * @param cHeaders Number of custom headers.
+ * @param papszHeaders Array of headers in form "foo: bar".
*/
RTR3DECL(int) RTHttpSetHeaders(RTHTTP hHttp, size_t cHeaders, const char * const *papszHeaders);
/**
+ * Tells the HTTP client instance to gather system CA certificates into a
+ * temporary file and use it for HTTPS connections.
+ *
+ * This will be called automatically if a 'https' URL is presented and
+ * RTHttpSetCaFile hasn't been called yet.
+ *
+ * @returns IPRT status code.
+ * @param hHttp The HTTP client instance.
+ * @param pErrInfo Where to store additional error/warning information.
+ * Optional.
+ */
+RTR3DECL(int) RTHttpUseTemporaryCaFile(RTHTTP hHttp, PRTERRINFO pErrInfo);
+
+/**
* Set a custom certification authority file, containing root certificates.
*
* @returns iprt status code.
*
- * @param hHttp HTTP interface handle.
- * @param pcszCAFile File name containing root certificates.
+ * @param hHttp The HTTP client instance.
+ * @param pszCAFile File name containing root certificates.
+ *
+ * @remarks For portable HTTPS support, use RTHttpGatherCaCertsInFile and pass
*/
-RTR3DECL(int) RTHttpSetCAFile(RTHTTP hHttp, const char *pcszCAFile);
-
+RTR3DECL(int) RTHttpSetCAFile(RTHTTP hHttp, const char *pszCAFile);
/**
- * Determine the digest (fingerprint) of a certificate. Allocate memory for
- * storing the SHA1 fingerprint as well as the SHA512 fingerprint. This
- * memory has to be freed by RTMemFree().
- *
- * @todo Move this function to somewhere else.
+ * Gathers certificates into a cryptographic (certificate) store
*
- * @returns iprt status code.
+ * This is a just a combination of RTHttpGatherCaCertsInStore and
+ * RTCrStoreCertExportAsPem.
*
- * @param hHttp HTTP interface handle (ignored).
- * @param pcszCert The certificate in PEM format.
- * @param cbCert Size of the certificate.
- * @param pabSha1 Where to store the pointer to the SHA1 fingerprint.
- * @param pcbSha1 Where to store the size of the SHA1 fingerprint.
- * @param pabSha512 Where to store the pointer to the SHA512 fingerprint.
- * @param pcbSha512 Where to store the size of the SHA512 fingerprint.
+ * @returns IPRT status code.
+ * @param hStore The certificate store to gather the certificates
+ * in.
+ * @param fFlags RTHTTPGATHERCACERT_F_XXX.
+ * @param pErrInfo Where to store additional error/warning information.
+ * Optional.
*/
-RTR3DECL(int) RTHttpCertDigest(RTHTTP hHttp, char *pcszCert, size_t cbCert,
- uint8_t **pabSha1, size_t *pcbSha1,
- uint8_t **pabSha512, size_t *pcbSha512);
+RTR3DECL(int) RTHttpGatherCaCertsInStore(RTCRSTORE hStore, uint32_t fFlags, PRTERRINFO pErrInfo);
+/**
+ * Gathers certificates into a file that can be used with RTHttpSetCAFile.
+ *
+ * This is a just a combination of RTHttpGatherCaCertsInStore and
+ * RTCrStoreCertExportAsPem.
+ *
+ * @returns IPRT status code.
+ * @param pszCaFile The output file.
+ * @param fFlags RTHTTPGATHERCACERT_F_XXX.
+ * @param pErrInfo Where to store additional error/warning information.
+ * Optional.
+ */
+RTR3DECL(int) RTHttpGatherCaCertsInFile(const char *pszCaFile, uint32_t fFlags, PRTERRINFO pErrInfo);
/** @} */
diff --git a/include/iprt/log.h b/include/iprt/log.h
index a8a98bb..d5b9ee9 100644
--- a/include/iprt/log.h
+++ b/include/iprt/log.h
@@ -64,6 +64,7 @@ typedef enum RTLOGGROUP
RTLOGGROUP_THREAD,
RTLOGGROUP_TIME,
RTLOGGROUP_TIMER,
+ RTLOGGROUP_CRYPTO,
RTLOGGROUP_ZIP = 31,
RTLOGGROUP_FIRST_USER = 32
} RTLOGGROUP;
@@ -95,7 +96,7 @@ typedef enum RTLOGGROUP
"RT_THREAD", \
"RT_TIME", \
"RT_TIMER", \
- "RT_13", \
+ "RT_CRYPTO", \
"RT_14", \
"RT_15", \
"RT_16", \
diff --git a/include/iprt/mangling.h b/include/iprt/mangling.h
index 0392f3e..73d1bb3 100644
--- a/include/iprt/mangling.h
+++ b/include/iprt/mangling.h
@@ -602,6 +602,7 @@
# define RTFileOpenBitBucket RT_MANGLER(RTFileOpenBitBucket)
# define RTFileOpenF RT_MANGLER(RTFileOpenF)
# define RTFileOpenV RT_MANGLER(RTFileOpenV)
+# define RTFileOpenTemp RT_MANGLER(RTFileOpenTemp)
# define RTFileQueryFsSizes RT_MANGLER(RTFileQueryFsSizes)
# define RTFileQueryInfo RT_MANGLER(RTFileQueryInfo)
# define RTFileQuerySize RT_MANGLER(RTFileQuerySize)
@@ -627,6 +628,7 @@
# define RTFileWrite RT_MANGLER(RTFileWrite)
# define RTFileWriteAt RT_MANGLER(RTFileWriteAt)
# define RTFilesystemVfsFromFile RT_MANGLER(RTFilesystemVfsFromFile)
+# define RTFsIsCaseSensitive RT_MANGLER(RTFsIsCaseSensitive)
# define RTFsQueryProperties RT_MANGLER(RTFsQueryProperties)
# define RTFsQuerySerial RT_MANGLER(RTFsQuerySerial)
# define RTFsQuerySizes RT_MANGLER(RTFsQuerySizes)
@@ -1049,6 +1051,7 @@
# define RTPathCompare RT_MANGLER(RTPathCompare)
# define RTPathCopyComponents RT_MANGLER(RTPathCopyComponents)
# define RTPathCountComponents RT_MANGLER(RTPathCountComponents)
+# define RTPathEnsureTrailingSeparator RT_MANGLER(RTPathEnsureTrailingSeparator)
# define RTPathExecDir RT_MANGLER(RTPathExecDir)
# define RTPathExists RT_MANGLER(RTPathExists)
# define RTPathExistsEx RT_MANGLER(RTPathExistsEx)
@@ -1059,6 +1062,8 @@
# define RTPathGetCurrentDrive RT_MANGLER(RTPathGetCurrentDrive)
# define RTPathGetCurrentOnDrive RT_MANGLER(RTPathGetCurrentOnDrive)
# define RTPathGetMode RT_MANGLER(RTPathGetMode)
+# define RTPathGlob RT_MANGLER(RTPathGlob)
+# define RTPathGlobFree RT_MANGLER(RTPathGlobFree)
# define RTPathHasSuffix RT_MANGLER(RTPathHasSuffix)
# define RTPathHasPath RT_MANGLER(RTPathHasPath)
# define RTPathIsSame RT_MANGLER(RTPathIsSame)
@@ -1343,6 +1348,7 @@
# define RTSgBufSet RT_MANGLER(RTSgBufSet)
# define RTSgBufGetNextSegment RT_MANGLER(RTSgBufGetNextSegment)
# define RTSha1 RT_MANGLER(RTSha1)
+# define RTSha1Check RT_MANGLER(RTSha1Check)
# define RTSha1Digest RT_MANGLER(RTSha1Digest)
# define RTSha1DigestFromFile RT_MANGLER(RTSha1DigestFromFile)
# define RTSha1Final RT_MANGLER(RTSha1Final)
@@ -1351,6 +1357,7 @@
# define RTSha1ToString RT_MANGLER(RTSha1ToString)
# define RTSha1Update RT_MANGLER(RTSha1Update)
# define RTSha224 RT_MANGLER(RTSha224)
+# define RTSha224Check RT_MANGLER(RTSha224Check)
# define RTSha224Final RT_MANGLER(RTSha224Final)
# define RTSha224FromString RT_MANGLER(RTSha224FromString)
# define RTSha224Init RT_MANGLER(RTSha224Init)
@@ -1359,6 +1366,7 @@
# define RTSha224Digest RT_MANGLER(RTSha224Digest)
# define RTSha224DigestFromFile RT_MANGLER(RTSha224DigestFromFile)
# define RTSha256 RT_MANGLER(RTSha256)
+# define RTSha256Check RT_MANGLER(RTSha256Check)
# define RTSha256Final RT_MANGLER(RTSha256Final)
# define RTSha256FromString RT_MANGLER(RTSha256FromString)
# define RTSha256Init RT_MANGLER(RTSha256Init)
@@ -1367,24 +1375,28 @@
# define RTSha256Digest RT_MANGLER(RTSha256Digest)
# define RTSha256DigestFromFile RT_MANGLER(RTSha256DigestFromFile)
# define RTSha384 RT_MANGLER(RTSha384)
+# define RTSha384Check RT_MANGLER(RTSha384Check)
# define RTSha384Final RT_MANGLER(RTSha384Final)
# define RTSha384FromString RT_MANGLER(RTSha384FromString)
# define RTSha384Init RT_MANGLER(RTSha384Init)
# define RTSha384ToString RT_MANGLER(RTSha384ToString)
# define RTSha384Update RT_MANGLER(RTSha384Update)
# define RTSha512 RT_MANGLER(RTSha512)
+# define RTSha512Check RT_MANGLER(RTSha512Check)
# define RTSha512Final RT_MANGLER(RTSha512Final)
# define RTSha512FromString RT_MANGLER(RTSha512FromString)
# define RTSha512Init RT_MANGLER(RTSha512Init)
# define RTSha512ToString RT_MANGLER(RTSha512ToString)
# define RTSha512Update RT_MANGLER(RTSha512Update)
# define RTSha512t224 RT_MANGLER(RTSha512t224)
+# define RTSha512t224Check RT_MANGLER(RTSha512t224Check)
# define RTSha512t224Final RT_MANGLER(RTSha512t224Final)
# define RTSha512t224FromString RT_MANGLER(RTSha512t224FromString)
# define RTSha512t224Init RT_MANGLER(RTSha512t224Init)
# define RTSha512t224ToString RT_MANGLER(RTSha512t224ToString)
# define RTSha512t224Update RT_MANGLER(RTSha512t224Update)
# define RTSha512t256 RT_MANGLER(RTSha512t256)
+# define RTSha512t256Check RT_MANGLER(RTSha512t256Check)
# define RTSha512t256Final RT_MANGLER(RTSha512t256Final)
# define RTSha512t256FromString RT_MANGLER(RTSha512t256FromString)
# define RTSha512t256Init RT_MANGLER(RTSha512t256Init)
@@ -2424,6 +2436,7 @@
# define RTCrRsaPrivateKey_CheckSanity RT_MANGLER(RTCrRsaPrivateKey_CheckSanity)
# define RTCrRsaPublicKey_CheckSanity RT_MANGLER(RTCrRsaPublicKey_CheckSanity)
# define RTCrPemFreeSections RT_MANGLER(RTCrPemFreeSections)
+# define RTCrPemParseContent RT_MANGLER(RTCrPemParseContent)
# define RTCrPemReadFile RT_MANGLER(RTCrPemReadFile)
# define RTCrPkcs7Attribute_DecodeAsn1 RT_MANGLER(RTCrPkcs7Attribute_DecodeAsn1)
# define RTCrPkcs7Attributes_DecodeAsn1 RT_MANGLER(RTCrPkcs7Attributes_DecodeAsn1)
@@ -2882,6 +2895,7 @@
# define RTCrCertCtxRetain RT_MANGLER(RTCrCertCtxRetain)
# define RTCrStoreCertAddEncoded RT_MANGLER(RTCrStoreCertAddEncoded)
# define RTCrStoreCertByIssuerAndSerialNo RT_MANGLER(RTCrStoreCertByIssuerAndSerialNo)
+# define RTCrStoreCertCount RT_MANGLER(RTCrStoreCertCount)
# define RTCrStoreCertFindAll RT_MANGLER(RTCrStoreCertFindAll)
# define RTCrStoreCertFindBySubjectOrAltSubjectByRfc5280 RT_MANGLER(RTCrStoreCertFindBySubjectOrAltSubjectByRfc5280)
# define RTCrStoreCertSearchDestroy RT_MANGLER(RTCrStoreCertSearchDestroy)
@@ -2891,7 +2905,18 @@
# define RTCrStoreRelease RT_MANGLER(RTCrStoreRelease)
# define RTCrStoreRetain RT_MANGLER(RTCrStoreRetain)
# define RTCrStoreCreateInMem RT_MANGLER(RTCrStoreCreateInMem)
+# define RTCrStoreCreateSnapshotById RT_MANGLER(RTCrStoreCreateSnapshotById)
+# define RTCrStoreCertAddFromDir RT_MANGLER(RTCrStoreCertAddFromDir)
# define RTCrStoreCertAddFromFile RT_MANGLER(RTCrStoreCertAddFromFile)
+# define RTCrStoreCertAddFromJavaKeyStore RT_MANGLER(RTCrStoreCertAddFromJavaKeyStore)
+# define RTCrStoreCertAddFromJavaKeyStoreInMem RT_MANGLER(RTCrStoreCertAddFromJavaKeyStoreInMem)
+# define RTCrStoreCertAddFromStore RT_MANGLER(RTCrStoreCertAddFromStore)
+# define RTCrStoreCertAddWantedFromDir RT_MANGLER(RTCrStoreCertAddWantedFromDir)
+# define RTCrStoreCertAddWantedFromFile RT_MANGLER(RTCrStoreCertAddWantedFromFile)
+# define RTCrStoreCertAddWantedFromStore RT_MANGLER(RTCrStoreCertAddWantedFromStore)
+# define RTCrStoreCertAddWantedFromFishingExpedition RT_MANGLER(RTCrStoreCertAddWantedFromFishingExpedition)
+# define RTCrStoreCertCheckWanted RT_MANGLER(RTCrStoreCertCheckWanted)
+# define RTCrStoreCertExportAsPem RT_MANGLER(RTCrStoreCertExportAsPem)
# define RTErrInfoAdd RT_MANGLER(RTErrInfoAdd)
# define RTErrInfoAddF RT_MANGLER(RTErrInfoAddF)
# define RTErrInfoAddV RT_MANGLER(RTErrInfoAddV)
diff --git a/include/iprt/mem.h b/include/iprt/mem.h
index c5fd037..405fbd6 100644
--- a/include/iprt/mem.h
+++ b/include/iprt/mem.h
@@ -102,7 +102,7 @@ RT_C_DECLS_BEGIN
* @param cb Size in bytes of the memory block to allocated.
* @param pszTag Allocation tag used for statistics and such.
*/
-RTDECL(void *) RTMemTmpAllocTag(size_t cb, const char *pszTag) RT_NO_THROW;
+RTDECL(void *) RTMemTmpAllocTag(size_t cb, const char *pszTag) RT_NO_THROW_PROTO;
/**
* Allocates zero'd temporary memory with default tag.
@@ -125,14 +125,14 @@ RTDECL(void *) RTMemTmpAllocTag(size_t cb, const char *pszTag) RT_NO_THROW;
* @param cb Size in bytes of the memory block to allocated.
* @param pszTag Allocation tag used for statistics and such.
*/
-RTDECL(void *) RTMemTmpAllocZTag(size_t cb, const char *pszTag) RT_NO_THROW;
+RTDECL(void *) RTMemTmpAllocZTag(size_t cb, const char *pszTag) RT_NO_THROW_PROTO;
/**
* Free temporary memory.
*
* @param pv Pointer to memory block.
*/
-RTDECL(void) RTMemTmpFree(void *pv) RT_NO_THROW;
+RTDECL(void) RTMemTmpFree(void *pv) RT_NO_THROW_PROTO;
/** @} */
@@ -155,7 +155,7 @@ RTDECL(void) RTMemTmpFree(void *pv) RT_NO_THROW;
* @param cb Size in bytes of the memory block to allocated.
* @param pszTag Allocation tag used for statistics and such.
*/
-RTDECL(void *) RTMemAllocTag(size_t cb, const char *pszTag) RT_NO_THROW;
+RTDECL(void *) RTMemAllocTag(size_t cb, const char *pszTag) RT_NO_THROW_PROTO;
/**
* Allocates zero'd memory with default tag.
@@ -182,7 +182,7 @@ RTDECL(void *) RTMemAllocTag(size_t cb, const char *pszTag) RT_NO_THROW;
* @param cb Size in bytes of the memory block to allocated.
* @param pszTag Allocation tag used for statistics and such.
*/
-RTDECL(void *) RTMemAllocZTag(size_t cb, const char *pszTag) RT_NO_THROW;
+RTDECL(void *) RTMemAllocZTag(size_t cb, const char *pszTag) RT_NO_THROW_PROTO;
/**
* Wrapper around RTMemAlloc for automatically aligning variable sized
@@ -201,7 +201,7 @@ RTDECL(void *) RTMemAllocZTag(size_t cb, const char *pszTag) RT_NO_THROW;
* @param cbUnaligned The unaligned size.
* @param pszTag Allocation tag used for statistics and such.
*/
-RTDECL(void *) RTMemAllocVarTag(size_t cbUnaligned, const char *pszTag) RT_NO_THROW;
+RTDECL(void *) RTMemAllocVarTag(size_t cbUnaligned, const char *pszTag) RT_NO_THROW_PROTO;
/**
* Wrapper around RTMemAllocZ for automatically aligning variable sized
@@ -220,7 +220,7 @@ RTDECL(void *) RTMemAllocVarTag(size_t cbUnaligned, const char *pszTag) RT_NO_TH
* @param cbUnaligned The unaligned size.
* @param pszTag Allocation tag used for statistics and such.
*/
-RTDECL(void *) RTMemAllocZVarTag(size_t cbUnaligned, const char *pszTag) RT_NO_THROW;
+RTDECL(void *) RTMemAllocZVarTag(size_t cbUnaligned, const char *pszTag) RT_NO_THROW_PROTO;
/**
* Duplicates a chunk of memory into a new heap block (default tag).
@@ -241,7 +241,7 @@ RTDECL(void *) RTMemAllocZVarTag(size_t cbUnaligned, const char *pszTag) RT_NO_T
* @param cb The amount of memory to duplicate.
* @param pszTag Allocation tag used for statistics and such.
*/
-RTDECL(void *) RTMemDupTag(const void *pvSrc, size_t cb, const char *pszTag) RT_NO_THROW;
+RTDECL(void *) RTMemDupTag(const void *pvSrc, size_t cb, const char *pszTag) RT_NO_THROW_PROTO;
/**
* Duplicates a chunk of memory into a new heap block with some additional
@@ -266,7 +266,7 @@ RTDECL(void *) RTMemDupTag(const void *pvSrc, size_t cb, const char *pszTag) RT_
* @param cbExtra The amount of extra memory to allocate and zero.
* @param pszTag Allocation tag used for statistics and such.
*/
-RTDECL(void *) RTMemDupExTag(const void *pvSrc, size_t cbSrc, size_t cbExtra, const char *pszTag) RT_NO_THROW;
+RTDECL(void *) RTMemDupExTag(const void *pvSrc, size_t cbSrc, size_t cbExtra, const char *pszTag) RT_NO_THROW_PROTO;
/**
* Reallocates memory with default tag.
@@ -287,14 +287,14 @@ RTDECL(void *) RTMemDupExTag(const void *pvSrc, size_t cbSrc, size_t cbExtra, co
* @param cbNew The new block size (in bytes).
* @param pszTag Allocation tag used for statistics and such.
*/
-RTDECL(void *) RTMemReallocTag(void *pvOld, size_t cbNew, const char *pszTag) RT_NO_THROW;
+RTDECL(void *) RTMemReallocTag(void *pvOld, size_t cbNew, const char *pszTag) RT_NO_THROW_PROTO;
/**
* Frees memory.
*
* @param pv Pointer to memory block.
*/
-RTDECL(void) RTMemFree(void *pv) RT_NO_THROW;
+RTDECL(void) RTMemFree(void *pv) RT_NO_THROW_PROTO;
@@ -361,7 +361,7 @@ RTDECL(void) RTMemFree(void *pv) RT_NO_THROW;
* @param pszTag The tag.
* @param ppv Where to return the memory.
*/
-RTDECL(int) RTMemAllocExTag(size_t cb, size_t cbAlignment, uint32_t fFlags, const char *pszTag, void **ppv) RT_NO_THROW;
+RTDECL(int) RTMemAllocExTag(size_t cb, size_t cbAlignment, uint32_t fFlags, const char *pszTag, void **ppv) RT_NO_THROW_PROTO;
/**
* For freeing memory allocated by RTMemAllocEx or RTMemAllocExTag.
@@ -374,7 +374,7 @@ RTDECL(int) RTMemAllocExTag(size_t cb, size_t cbAlignment, uint32_t fFlags, cons
* doesn't require anything while ring-3 requires
* RTMEMALLOCEX_FLAGS_EXEC if used.
*/
-RTDECL(void) RTMemFreeEx(void *pv, size_t cb) RT_NO_THROW;
+RTDECL(void) RTMemFreeEx(void *pv, size_t cb) RT_NO_THROW_PROTO;
@@ -395,7 +395,7 @@ RTDECL(void) RTMemFreeEx(void *pv, size_t cb) RT_NO_THROW;
* @param cb Size in bytes of the memory block to allocate.
* @param pszTag Allocation tag used for statistics and such.
*/
-RTDECL(void *) RTMemExecAllocTag(size_t cb, const char *pszTag) RT_NO_THROW;
+RTDECL(void *) RTMemExecAllocTag(size_t cb, const char *pszTag) RT_NO_THROW_PROTO;
/**
* Free executable/read/write memory allocated by RTMemExecAlloc().
@@ -403,7 +403,7 @@ RTDECL(void *) RTMemExecAllocTag(size_t cb, const char *pszTag) RT_NO_THROW;
* @param pv Pointer to memory block.
* @param cb The allocation size.
*/
-RTDECL(void) RTMemExecFree(void *pv, size_t cb) RT_NO_THROW;
+RTDECL(void) RTMemExecFree(void *pv, size_t cb) RT_NO_THROW_PROTO;
#if defined(IN_RING0) && defined(RT_ARCH_AMD64) && defined(RT_OS_LINUX)
/**
@@ -421,7 +421,7 @@ RTDECL(void) RTMemExecFree(void *pv, size_t cb) RT_NO_THROW;
* @param pvMemory Pointer to the memory block.
* @param cb The size of the memory block.
*/
-RTR0DECL(int) RTR0MemExecDonate(void *pvMemory, size_t cb) RT_NO_THROW;
+RTR0DECL(int) RTR0MemExecDonate(void *pvMemory, size_t cb) RT_NO_THROW_PROTO;
#endif /* R0+AMD64+LINUX */
/**
@@ -441,7 +441,7 @@ RTR0DECL(int) RTR0MemExecDonate(void *pvMemory, size_t cb) RT_NO_THROW;
* @param cb Size of the memory block. Will be rounded up to page size.
* @param pszTag Allocation tag used for statistics and such.
*/
-RTDECL(void *) RTMemPageAllocTag(size_t cb, const char *pszTag) RT_NO_THROW;
+RTDECL(void *) RTMemPageAllocTag(size_t cb, const char *pszTag) RT_NO_THROW_PROTO;
/**
* Allocate zero'd page aligned memory with default tag.
@@ -460,7 +460,7 @@ RTDECL(void *) RTMemPageAllocTag(size_t cb, const char *pszTag) RT_NO_THROW;
* @param cb Size of the memory block. Will be rounded up to page size.
* @param pszTag Allocation tag used for statistics and such.
*/
-RTDECL(void *) RTMemPageAllocZTag(size_t cb, const char *pszTag) RT_NO_THROW;
+RTDECL(void *) RTMemPageAllocZTag(size_t cb, const char *pszTag) RT_NO_THROW_PROTO;
/**
* Free a memory block allocated with RTMemPageAlloc() or RTMemPageAllocZ().
@@ -470,7 +470,7 @@ RTDECL(void *) RTMemPageAllocZTag(size_t cb, const char *pszTag) RT_NO_THROW;
* @param cb The allocation size. Will be rounded up to page size.
* Ignored if @a pv is NULL.
*/
-RTDECL(void) RTMemPageFree(void *pv, size_t cb) RT_NO_THROW;
+RTDECL(void) RTMemPageFree(void *pv, size_t cb) RT_NO_THROW_PROTO;
/** Page level protection flags for RTMemProtect().
* @{
@@ -493,7 +493,7 @@ RTDECL(void) RTMemPageFree(void *pv, size_t cb) RT_NO_THROW;
* @param cb Size of the region. Will be rounded up to the nearest page boundary.
* @param fProtect The new protection, a combination of the RTMEM_PROT_* defines.
*/
-RTDECL(int) RTMemProtect(void *pv, size_t cb, unsigned fProtect) RT_NO_THROW;
+RTDECL(int) RTMemProtect(void *pv, size_t cb, unsigned fProtect) RT_NO_THROW_PROTO;
/**
* Goes thru some pains to make sure the specified memory block is thoroughly
@@ -503,7 +503,7 @@ RTDECL(int) RTMemProtect(void *pv, size_t cb, unsigned fProtect) RT_NO_THROW;
* @param cb The size of the memory block.
* @param cMinPasses The minimum number of passes to make.
*/
-RTDECL(void) RTMemWipeThoroughly(void *pv, size_t cb, size_t cMinPasses) RT_NO_THROW;
+RTDECL(void) RTMemWipeThoroughly(void *pv, size_t cb, size_t cMinPasses) RT_NO_THROW_PROTO;
#ifdef IN_RING0
@@ -516,7 +516,7 @@ RTDECL(void) RTMemWipeThoroughly(void *pv, size_t cb, size_t cMinPasses) RT_NO_T
* @param cb The allocation size in bytes. This is always
* rounded up to PAGE_SIZE.
*/
-RTR0DECL(void *) RTMemContAlloc(PRTCCPHYS pPhys, size_t cb) RT_NO_THROW;
+RTR0DECL(void *) RTMemContAlloc(PRTCCPHYS pPhys, size_t cb) RT_NO_THROW_PROTO;
/**
* Frees memory allocated ysing RTMemContAlloc().
@@ -524,7 +524,7 @@ RTR0DECL(void *) RTMemContAlloc(PRTCCPHYS pPhys, size_t cb) RT_NO_THROW;
* @param pv Pointer to return from RTMemContAlloc().
* @param cb The cb parameter passed to RTMemContAlloc().
*/
-RTR0DECL(void) RTMemContFree(void *pv, size_t cb) RT_NO_THROW;
+RTR0DECL(void) RTMemContFree(void *pv, size_t cb) RT_NO_THROW_PROTO;
/**
* Copy memory from an user mode buffer into a kernel buffer.
@@ -636,7 +636,7 @@ RTR0DECL(int) RTR0MemKernelCopyTo(void *pvDst, void const *pvSrc, size_t cb);
* @param cb Size in bytes of the memory block to allocate.
* @param pszTag Allocation tag used for statistics and such.
*/
-RTDECL(void *) RTMemEfTmpAlloc(size_t cb, const char *pszTag, RT_SRC_POS_DECL) RT_NO_THROW;
+RTDECL(void *) RTMemEfTmpAlloc(size_t cb, const char *pszTag, RT_SRC_POS_DECL) RT_NO_THROW_PROTO;
/**
* Same as RTMemTmpAllocZTag() except that it's fenced.
@@ -646,14 +646,14 @@ RTDECL(void *) RTMemEfTmpAlloc(size_t cb, const char *pszTag, RT_SRC_POS_DECL)
* @param cb Size in bytes of the memory block to allocate.
* @param pszTag Allocation tag used for statistics and such.
*/
-RTDECL(void *) RTMemEfTmpAllocZ(size_t cb, const char *pszTag, RT_SRC_POS_DECL) RT_NO_THROW;
+RTDECL(void *) RTMemEfTmpAllocZ(size_t cb, const char *pszTag, RT_SRC_POS_DECL) RT_NO_THROW_PROTO;
/**
* Same as RTMemTmpFree() except that it's for fenced memory.
*
* @param pv Pointer to memory block.
*/
-RTDECL(void) RTMemEfTmpFree(void *pv, RT_SRC_POS_DECL) RT_NO_THROW;
+RTDECL(void) RTMemEfTmpFree(void *pv, RT_SRC_POS_DECL) RT_NO_THROW_PROTO;
/**
* Same as RTMemAllocTag() except that it's fenced.
@@ -663,7 +663,7 @@ RTDECL(void) RTMemEfTmpFree(void *pv, RT_SRC_POS_DECL) RT_NO_THROW;
* @param cb Size in bytes of the memory block to allocate.
* @param pszTag Allocation tag used for statistics and such.
*/
-RTDECL(void *) RTMemEfAlloc(size_t cb, const char *pszTag, RT_SRC_POS_DECL) RT_NO_THROW;
+RTDECL(void *) RTMemEfAlloc(size_t cb, const char *pszTag, RT_SRC_POS_DECL) RT_NO_THROW_PROTO;
/**
* Same as RTMemAllocZTag() except that it's fenced.
@@ -673,7 +673,7 @@ RTDECL(void *) RTMemEfAlloc(size_t cb, const char *pszTag, RT_SRC_POS_DECL) RT_
* @param cb Size in bytes of the memory block to allocate.
* @param pszTag Allocation tag used for statistics and such.
*/
-RTDECL(void *) RTMemEfAllocZ(size_t cb, const char *pszTag, RT_SRC_POS_DECL) RT_NO_THROW;
+RTDECL(void *) RTMemEfAllocZ(size_t cb, const char *pszTag, RT_SRC_POS_DECL) RT_NO_THROW_PROTO;
/**
* Same as RTMemAllocVarTag() except that it's fenced.
@@ -683,7 +683,7 @@ RTDECL(void *) RTMemEfAllocZ(size_t cb, const char *pszTag, RT_SRC_POS_DECL) RT
* @param cbUnaligned Size in bytes of the memory block to allocate.
* @param pszTag Allocation tag used for statistics and such.
*/
-RTDECL(void *) RTMemEfAllocVar(size_t cbUnaligned, const char *pszTag, RT_SRC_POS_DECL) RT_NO_THROW;
+RTDECL(void *) RTMemEfAllocVar(size_t cbUnaligned, const char *pszTag, RT_SRC_POS_DECL) RT_NO_THROW_PROTO;
/**
* Same as RTMemAllocZVarTag() except that it's fenced.
@@ -693,7 +693,7 @@ RTDECL(void *) RTMemEfAllocVar(size_t cbUnaligned, const char *pszTag, RT_SRC_P
* @param cbUnaligned Size in bytes of the memory block to allocate.
* @param pszTag Allocation tag used for statistics and such.
*/
-RTDECL(void *) RTMemEfAllocZVar(size_t cbUnaligned, const char *pszTag, RT_SRC_POS_DECL) RT_NO_THROW;
+RTDECL(void *) RTMemEfAllocZVar(size_t cbUnaligned, const char *pszTag, RT_SRC_POS_DECL) RT_NO_THROW_PROTO;
/**
* Same as RTMemReallocTag() except that it's fenced.
@@ -704,14 +704,14 @@ RTDECL(void *) RTMemEfAllocZVar(size_t cbUnaligned, const char *pszTag, RT_SRC_
* @param cbNew The new block size (in bytes).
* @param pszTag Allocation tag used for statistics and such.
*/
-RTDECL(void *) RTMemEfRealloc(void *pvOld, size_t cbNew, const char *pszTag, RT_SRC_POS_DECL) RT_NO_THROW;
+RTDECL(void *) RTMemEfRealloc(void *pvOld, size_t cbNew, const char *pszTag, RT_SRC_POS_DECL) RT_NO_THROW_PROTO;
/**
* Free memory allocated by any of the RTMemEf* allocators.
*
* @param pv Pointer to memory block.
*/
-RTDECL(void) RTMemEfFree(void *pv, RT_SRC_POS_DECL) RT_NO_THROW;
+RTDECL(void) RTMemEfFree(void *pv, RT_SRC_POS_DECL) RT_NO_THROW_PROTO;
/**
* Same as RTMemDupTag() except that it's fenced.
@@ -722,7 +722,7 @@ RTDECL(void) RTMemEfFree(void *pv, RT_SRC_POS_DECL) RT_NO_THROW;
* @param cb The amount of memory to duplicate.
* @param pszTag Allocation tag used for statistics and such.
*/
-RTDECL(void *) RTMemEfDup(const void *pvSrc, size_t cb, const char *pszTag, RT_SRC_POS_DECL) RT_NO_THROW;
+RTDECL(void *) RTMemEfDup(const void *pvSrc, size_t cb, const char *pszTag, RT_SRC_POS_DECL) RT_NO_THROW_PROTO;
/**
* Same as RTMemEfDupExTag except that it's fenced.
@@ -734,7 +734,7 @@ RTDECL(void *) RTMemEfDup(const void *pvSrc, size_t cb, const char *pszTag, RT_S
* @param cbExtra The amount of extra memory to allocate and zero.
* @param pszTag Allocation tag used for statistics and such.
*/
-RTDECL(void *) RTMemEfDupEx(const void *pvSrc, size_t cbSrc, size_t cbExtra, const char *pszTag, RT_SRC_POS_DECL) RT_NO_THROW;
+RTDECL(void *) RTMemEfDupEx(const void *pvSrc, size_t cbSrc, size_t cbExtra, const char *pszTag, RT_SRC_POS_DECL) RT_NO_THROW_PROTO;
/** @def RTMEM_WRAP_SOME_NEW_AND_DELETE_TO_EF
* Define RTMEM_WRAP_SOME_NEW_AND_DELETE_TO_EF to enable electric fence new and
@@ -755,7 +755,7 @@ RTDECL(void *) RTMemEfDupEx(const void *pvSrc, size_t cbSrc, size_t cbExtra, con
return pv; \
throw std::bad_alloc(); \
} \
- void *operator new(size_t cb, const std::nothrow_t ¬hrow_constant) RT_NO_THROW \
+ void *operator new(size_t cb, const std::nothrow_t ¬hrow_constant) RT_NO_THROW_DEF \
{ \
NOREF(nothrow_constant); \
return RTMemEfAlloc(cb, RTMEM_TAG, RT_SRC_POS); \
@@ -767,26 +767,26 @@ RTDECL(void *) RTMemEfDupEx(const void *pvSrc, size_t cbSrc, size_t cbExtra, con
return pv; \
throw std::bad_alloc(); \
} \
- void *operator new[](size_t cb, const std::nothrow_t ¬hrow_constant) RT_NO_THROW \
+ void *operator new[](size_t cb, const std::nothrow_t ¬hrow_constant) RT_NO_THROW_DEF \
{ \
NOREF(nothrow_constant); \
return RTMemEfAlloc(cb, RTMEM_TAG, RT_SRC_POS); \
} \
\
- void operator delete(void *pv) RT_NO_THROW \
+ void operator delete(void *pv) RT_NO_THROW_DEF \
{ \
RTMemEfFree(pv, RT_SRC_POS); \
} \
- void operator delete(void *pv, const std::nothrow_t ¬hrow_constant) RT_NO_THROW \
+ void operator delete(void *pv, const std::nothrow_t ¬hrow_constant) RT_NO_THROW_DEF \
{ \
NOREF(nothrow_constant); \
RTMemEfFree(pv, RT_SRC_POS); \
} \
- void operator delete[](void *pv) RT_NO_THROW \
+ void operator delete[](void *pv) RT_NO_THROW_DEF \
{ \
RTMemEfFree(pv, RT_SRC_POS); \
} \
- void operator delete[](void *pv, const std::nothrow_t ¬hrow_constant) RT_NO_THROW \
+ void operator delete[](void *pv, const std::nothrow_t ¬hrow_constant) RT_NO_THROW_DEF \
{ \
NOREF(nothrow_constant); \
RTMemEfFree(pv, RT_SRC_POS); \
@@ -867,67 +867,67 @@ RTDECL(void *) RTMemEfDupEx(const void *pvSrc, size_t cbSrc, size_t cbExtra, con
* Fenced drop-in replacement for RTMemTmpAllocTag.
* @copydoc RTMemTmpAllocTag
*/
-RTDECL(void *) RTMemEfTmpAllocNP(size_t cb, const char *pszTag) RT_NO_THROW;
+RTDECL(void *) RTMemEfTmpAllocNP(size_t cb, const char *pszTag) RT_NO_THROW_PROTO;
/**
* Fenced drop-in replacement for RTMemTmpAllocZTag.
* @copydoc RTMemTmpAllocZTag
*/
-RTDECL(void *) RTMemEfTmpAllocZNP(size_t cb, const char *pszTag) RT_NO_THROW;
+RTDECL(void *) RTMemEfTmpAllocZNP(size_t cb, const char *pszTag) RT_NO_THROW_PROTO;
/**
* Fenced drop-in replacement for RTMemTmpFreeTag.
* @copydoc RTMemTmpFreeTag
*/
-RTDECL(void) RTMemEfTmpFreeNP(void *pv) RT_NO_THROW;
+RTDECL(void) RTMemEfTmpFreeNP(void *pv) RT_NO_THROW_PROTO;
/**
* Fenced drop-in replacement for RTMemAllocTag.
* @copydoc RTMemAllocTag
*/
-RTDECL(void *) RTMemEfAllocNP(size_t cb, const char *pszTag) RT_NO_THROW;
+RTDECL(void *) RTMemEfAllocNP(size_t cb, const char *pszTag) RT_NO_THROW_PROTO;
/**
* Fenced drop-in replacement for RTMemAllocZTag.
* @copydoc RTMemAllocZTag
*/
-RTDECL(void *) RTMemEfAllocZNP(size_t cb, const char *pszTag) RT_NO_THROW;
+RTDECL(void *) RTMemEfAllocZNP(size_t cb, const char *pszTag) RT_NO_THROW_PROTO;
/**
* Fenced drop-in replacement for RTMemAllocVarTag
* @copydoc RTMemAllocVarTag
*/
-RTDECL(void *) RTMemEfAllocVarNP(size_t cbUnaligned, const char *pszTag) RT_NO_THROW;
+RTDECL(void *) RTMemEfAllocVarNP(size_t cbUnaligned, const char *pszTag) RT_NO_THROW_PROTO;
/**
* Fenced drop-in replacement for RTMemAllocZVarTag.
* @copydoc RTMemAllocZVarTag
*/
-RTDECL(void *) RTMemEfAllocZVarNP(size_t cbUnaligned, const char *pszTag) RT_NO_THROW;
+RTDECL(void *) RTMemEfAllocZVarNP(size_t cbUnaligned, const char *pszTag) RT_NO_THROW_PROTO;
/**
* Fenced drop-in replacement for RTMemReallocTag.
* @copydoc RTMemReallocTag
*/
-RTDECL(void *) RTMemEfReallocNP(void *pvOld, size_t cbNew, const char *pszTag) RT_NO_THROW;
+RTDECL(void *) RTMemEfReallocNP(void *pvOld, size_t cbNew, const char *pszTag) RT_NO_THROW_PROTO;
/**
* Fenced drop-in replacement for RTMemFree.
* @copydoc RTMemFree
*/
-RTDECL(void) RTMemEfFreeNP(void *pv) RT_NO_THROW;
+RTDECL(void) RTMemEfFreeNP(void *pv) RT_NO_THROW_PROTO;
/**
* Fenced drop-in replacement for RTMemDupExTag.
* @copydoc RTMemDupExTag
*/
-RTDECL(void *) RTMemEfDupNP(const void *pvSrc, size_t cb, const char *pszTag) RT_NO_THROW;
+RTDECL(void *) RTMemEfDupNP(const void *pvSrc, size_t cb, const char *pszTag) RT_NO_THROW_PROTO;
/**
* Fenced drop-in replacement for RTMemDupExTag.
* @copydoc RTMemDupExTag
*/
-RTDECL(void *) RTMemEfDupExNP(const void *pvSrc, size_t cbSrc, size_t cbExtra, const char *pszTag) RT_NO_THROW;
+RTDECL(void *) RTMemEfDupExNP(const void *pvSrc, size_t cbSrc, size_t cbExtra, const char *pszTag) RT_NO_THROW_PROTO;
/** @} */
diff --git a/include/iprt/mempool.h b/include/iprt/mempool.h
index da66c8f..222793a 100644
--- a/include/iprt/mempool.h
+++ b/include/iprt/mempool.h
@@ -61,7 +61,7 @@ RTDECL(int) RTMemPoolDestroy(RTMEMPOOL hMemPool);
* @param hMemPool Handle to the pool to allocate the memory from.
* @param cb Size in bytes of the memory block to allocated.
*/
-RTDECL(void *) RTMemPoolAlloc(RTMEMPOOL hMemPool, size_t cb) RT_NO_THROW;
+RTDECL(void *) RTMemPoolAlloc(RTMEMPOOL hMemPool, size_t cb) RT_NO_THROW_PROTO;
/**
* Allocates zero'd memory.
@@ -76,7 +76,7 @@ RTDECL(void *) RTMemPoolAlloc(RTMEMPOOL hMemPool, size_t cb) RT_NO_THROW;
* @param hMemPool Handle to the pool to allocate the memory from.
* @param cb Size in bytes of the memory block to allocated.
*/
-RTDECL(void *) RTMemPoolAllocZ(RTMEMPOOL hMemPool, size_t cb) RT_NO_THROW;
+RTDECL(void *) RTMemPoolAllocZ(RTMEMPOOL hMemPool, size_t cb) RT_NO_THROW_PROTO;
/**
* Duplicates a chunk of memory into a new heap block.
@@ -88,7 +88,7 @@ RTDECL(void *) RTMemPoolAllocZ(RTMEMPOOL hMemPool, size_t cb) RT_NO_THROW;
* @param pvSrc The memory to duplicate.
* @param cb The amount of memory to duplicate.
*/
-RTDECL(void *) RTMemPoolDup(RTMEMPOOL hMemPool, const void *pvSrc, size_t cb) RT_NO_THROW;
+RTDECL(void *) RTMemPoolDup(RTMEMPOOL hMemPool, const void *pvSrc, size_t cb) RT_NO_THROW_PROTO;
/**
* Duplicates a chunk of memory into a new heap block with some
@@ -102,7 +102,7 @@ RTDECL(void *) RTMemPoolDup(RTMEMPOOL hMemPool, const void *pvSrc, size_t cb) RT
* @param cbSrc The amount of memory to duplicate.
* @param cbExtra The amount of extra memory to allocate and zero.
*/
-RTDECL(void *) RTMemPoolDupEx(RTMEMPOOL hMemPool, const void *pvSrc, size_t cbSrc, size_t cbExtra) RT_NO_THROW;
+RTDECL(void *) RTMemPoolDupEx(RTMEMPOOL hMemPool, const void *pvSrc, size_t cbSrc, size_t cbExtra) RT_NO_THROW_PROTO;
/**
* Reallocates memory.
@@ -114,7 +114,7 @@ RTDECL(void *) RTMemPoolDupEx(RTMEMPOOL hMemPool, const void *pvSrc, size_t cbSr
* @param pvOld The memory block to reallocate.
* @param cbNew The new block size (in bytes).
*/
-RTDECL(void *) RTMemPoolRealloc(RTMEMPOOL hMemPool, void *pvOld, size_t cbNew) RT_NO_THROW;
+RTDECL(void *) RTMemPoolRealloc(RTMEMPOOL hMemPool, void *pvOld, size_t cbNew) RT_NO_THROW_PROTO;
/**
* Frees memory allocated from a pool.
@@ -127,7 +127,7 @@ RTDECL(void *) RTMemPoolRealloc(RTMEMPOOL hMemPool, void *pvOld, size_t cbNew) R
* @remarks This is the same a RTMemPoolRelease but included here as a separate
* function to simplify code migration.
*/
-RTDECL(void) RTMemPoolFree(RTMEMPOOL hMemPool, void *pv) RT_NO_THROW;
+RTDECL(void) RTMemPoolFree(RTMEMPOOL hMemPool, void *pv) RT_NO_THROW_PROTO;
/**
* Retains a reference to a memory block in a pool.
@@ -136,7 +136,7 @@ RTDECL(void) RTMemPoolFree(RTMEMPOOL hMemPool, void *pv) RT_NO_THROW;
*
* @param pv Pointer to memory block.
*/
-RTDECL(uint32_t) RTMemPoolRetain(void *pv) RT_NO_THROW;
+RTDECL(uint32_t) RTMemPoolRetain(void *pv) RT_NO_THROW_PROTO;
/**
* Releases a reference to a memory block in a pool.
@@ -148,7 +148,7 @@ RTDECL(uint32_t) RTMemPoolRetain(void *pv) RT_NO_THROW;
* performance cost.
* @param pv Pointer to memory block.
*/
-RTDECL(uint32_t) RTMemPoolRelease(RTMEMPOOL hMemPool, void *pv) RT_NO_THROW;
+RTDECL(uint32_t) RTMemPoolRelease(RTMEMPOOL hMemPool, void *pv) RT_NO_THROW_PROTO;
/**
* Get the current reference count.
@@ -156,7 +156,7 @@ RTDECL(uint32_t) RTMemPoolRelease(RTMEMPOOL hMemPool, void *pv) RT_NO_THROW;
* @returns The reference count, UINT32_MAX on error (asserted).
* @param pv Pointer to memory block.
*/
-RTDECL(uint32_t) RTMemPoolRefCount(void *pv) RT_NO_THROW;
+RTDECL(uint32_t) RTMemPoolRefCount(void *pv) RT_NO_THROW_PROTO;
RT_C_DECLS_END
diff --git a/include/iprt/memsafer.h b/include/iprt/memsafer.h
index d361a30..1978a86 100644
--- a/include/iprt/memsafer.h
+++ b/include/iprt/memsafer.h
@@ -107,7 +107,7 @@ RTDECL(int) RTMemSaferUnscramble(void *pv, size_t cb);
* RTMEMSAFER_F_XXX.
* @param pszTag Allocation tag used for statistics and such.
*/
-RTDECL(int) RTMemSaferAllocZExTag(void **ppvNew, size_t cb, uint32_t fFlags, const char *pszTag) RT_NO_THROW;
+RTDECL(int) RTMemSaferAllocZExTag(void **ppvNew, size_t cb, uint32_t fFlags, const char *pszTag) RT_NO_THROW_PROTO;
/**
* Allocates memory for sensitive data.
@@ -133,7 +133,7 @@ RTDECL(int) RTMemSaferAllocZExTag(void **ppvNew, size_t cb, uint32_t fFlags, con
* @param cb Number of bytes to allocate.
* @param pszTag Allocation tag used for statistics and such.
*/
-RTDECL(void *) RTMemSaferAllocZTag(size_t cb, const char *pszTag) RT_NO_THROW;
+RTDECL(void *) RTMemSaferAllocZTag(size_t cb, const char *pszTag) RT_NO_THROW_PROTO;
/**
* Allocates memory for sensitive data.
@@ -167,7 +167,7 @@ RTDECL(void *) RTMemSaferAllocZTag(size_t cb, const char *pszTag) RT_NO_THROW;
* requirments after the initial allocation.
* @param pszTag Allocation tag used for statistics and such.
*/
-RTDECL(int) RTMemSaferReallocZExTag(size_t cbOld, void *pvOld, size_t cbNew, void **ppvNew, uint32_t fFlags, const char *pszTag) RT_NO_THROW;
+RTDECL(int) RTMemSaferReallocZExTag(size_t cbOld, void *pvOld, size_t cbNew, void **ppvNew, uint32_t fFlags, const char *pszTag) RT_NO_THROW_PROTO;
/**
* Reallocates memory allocated by RTMemSaferAllocZEx, RTMemSaferAllocZ,
@@ -206,7 +206,7 @@ RTDECL(int) RTMemSaferReallocZExTag(size_t cbOld, void *pvOld, size_t cbNew, voi
* @param cbNew The size of the new allocation.
* @param pszTag Allocation tag used for statistics and such.
*/
-RTDECL(void *) RTMemSaferReallocZTag(size_t cbOld, void *pvOld, size_t cbNew, const char *pszTag) RT_NO_THROW;
+RTDECL(void *) RTMemSaferReallocZTag(size_t cbOld, void *pvOld, size_t cbNew, const char *pszTag) RT_NO_THROW_PROTO;
/**
* Reallocates memory allocated by RTMemSaferAllocZ or RTMemSaferAllocZTag.
@@ -235,7 +235,7 @@ RTDECL(void *) RTMemSaferReallocZTag(size_t cbOld, void *pvOld, size_t cbNew, co
* @param pv The allocation.
* @param cb The allocation size.
*/
-RTDECL(void) RTMemSaferFree(void *pv, size_t cb) RT_NO_THROW;
+RTDECL(void) RTMemSaferFree(void *pv, size_t cb) RT_NO_THROW_PROTO;
/** @} */
RT_C_DECLS_END
diff --git a/include/iprt/path.h b/include/iprt/path.h
index b27ec5a..7e9bf74 100644
--- a/include/iprt/path.h
+++ b/include/iprt/path.h
@@ -358,6 +358,21 @@ RTDECL(void) RTPathStripSuffix(char *pszPath);
RTDECL(size_t) RTPathStripTrailingSlash(char *pszPath);
/**
+ * Ensures that the path has a trailing path separator such that file names can
+ * be appended without further work.
+ *
+ * This can be helpful when preparing for efficiently combining a directory path
+ * with the filenames returned by RTDirRead. The return value gives you the
+ * position at which you copy the RTDIRENTRY::szName to construct a valid path
+ * to it.
+ *
+ * @returns The length of the path, 0 on buffer overflow.
+ * @param pszPath The path.
+ * @param cbPath The length of the path buffer @a pszPath points to.
+ */
+RTDECL(size_t) RTPathEnsureTrailingSeparator(char *pszPath, size_t cbPath);
+
+/**
* Changes all the slashes in the specified path to DOS style.
*
* Unless @a fForce is set, nothing will be done when on a UNIX flavored system
@@ -585,7 +600,7 @@ RTDECL(int) RTPathCopyComponents(char *pszDst, size_t cbDst, const char *pszSrc,
*
* The first component is the root, volume or UNC specifier, if present. Use
* RTPATH_PROP_HAS_ROOT_SPEC() on RTPATHPARSED::fProps to determine its
- * precense.
+ * presence.
*
* Other than the root component, no component will include directory separators
* (slashes).
@@ -1156,6 +1171,72 @@ RTDECL(int) RTPathAppDocs(char *pszPath, size_t cchPath);
*/
RTDECL(int) RTPathTemp(char *pszPath, size_t cchPath);
+
+/**
+ * RTPathGlobl result entry.
+ */
+typedef struct RTPATHGLOBENTRY
+{
+ /** List entry. */
+ struct RTPATHGLOBENTRY *pNext;
+ /** RTDIRENTRYTYPE value. */
+ uint8_t uType;
+ /** Unused explicit padding. */
+ uint8_t bUnused;
+ /** The length of the path. */
+ uint16_t cchPath;
+ /** The path to the file (variable length). */
+ char szPath[1];
+} RTPATHGLOBENTRY;
+/** Pointer to a GLOB result entry. */
+typedef RTPATHGLOBENTRY *PRTPATHGLOBENTRY;
+/** Pointer to a const GLOB result entry. */
+typedef RTPATHGLOBENTRY const *PCRTPATHGLOBENTRY;
+/** Pointer to a GLOB result entry pointer. */
+typedef PCRTPATHGLOBENTRY *PPCRTPATHGLOBENTRY;
+
+/**
+ * Performs wildcard expansion on a path pattern.
+ *
+ * @returns IPRT status code.
+ *
+ * @param pszPattern The pattern to expand.
+ * @param fFlags RTPATHGLOB_F_XXX.
+ * @param ppHead Where to return the head of the result list. This
+ * is always set to NULL on failure.
+ * @param pcResults Where to return the number of the result. Optional.
+ */
+RTDECL(int) RTPathGlob(const char *pszPattern, uint32_t fFlags, PPCRTPATHGLOBENTRY ppHead, uint32_t *pcResults);
+
+/** @name RTPATHGLOB_F_XXX - RTPathGlob flags
+ * @{ */
+/** Case insensitive. */
+#define RTPATHGLOB_F_IGNORE_CASE RT_BIT_32(0)
+/** Do not expand \${EnvOrSpecialVariable} in the pattern. */
+#define RTPATHGLOB_F_NO_VARIABLES RT_BIT_32(1)
+/** Do not interpret a leading tilde as a home directory reference. */
+#define RTPATHGLOB_F_NO_TILDE RT_BIT_32(2)
+/** Only return the first match. */
+#define RTPATHGLOB_F_FIRST_ONLY RT_BIT_32(3)
+/** Only match directories (implied if pattern ends with slash). */
+#define RTPATHGLOB_F_ONLY_DIRS RT_BIT_32(4)
+/** Do not match directories. (Can't be used with RTPATHGLOB_F_ONLY_DIRS or
+ * patterns containing a trailing slash.) */
+#define RTPATHGLOB_F_NO_DIRS RT_BIT_32(5)
+/** Disables the '**' wildcard pattern for matching zero or more subdirs. */
+#define RTPATHGLOB_F_NO_STARSTAR RT_BIT_32(6)
+/** Mask of valid flags. */
+#define RTPATHGLOB_F_MASK UINT32_C(0x0000007f)
+/** @} */
+
+/**
+ * Frees the results produced by RTPathGlob.
+ *
+ * @param pHead What RTPathGlob returned. NULL ignored.
+ */
+RTDECL(void) RTPathGlobFree(PCRTPATHGLOBENTRY pHead);
+
+
/**
* Query information about a file system object.
*
diff --git a/include/iprt/rand.h b/include/iprt/rand.h
index eb69c7b..bc6c687 100644
--- a/include/iprt/rand.h
+++ b/include/iprt/rand.h
@@ -42,7 +42,7 @@ RT_C_DECLS_BEGIN
* @param pv Where to store the random bytes.
* @param cb Number of bytes to generate.
*/
-RTDECL(void) RTRandBytes(void *pv, size_t cb) RT_NO_THROW;
+RTDECL(void) RTRandBytes(void *pv, size_t cb) RT_NO_THROW_PROTO;
/**
* Generate a 32-bit signed random number in the set [i32First..i32Last].
@@ -51,14 +51,14 @@ RTDECL(void) RTRandBytes(void *pv, size_t cb) RT_NO_THROW;
* @param i32First First number in the set.
* @param i32Last Last number in the set.
*/
-RTDECL(int32_t) RTRandS32Ex(int32_t i32First, int32_t i32Last) RT_NO_THROW;
+RTDECL(int32_t) RTRandS32Ex(int32_t i32First, int32_t i32Last) RT_NO_THROW_PROTO;
/**
* Generate a 32-bit signed random number.
*
* @returns The random number.
*/
-RTDECL(int32_t) RTRandS32(void) RT_NO_THROW;
+RTDECL(int32_t) RTRandS32(void) RT_NO_THROW_PROTO;
/**
* Generate a 32-bit unsigned random number in the set [u32First..u32Last].
@@ -67,14 +67,14 @@ RTDECL(int32_t) RTRandS32(void) RT_NO_THROW;
* @param u32First First number in the set.
* @param u32Last Last number in the set.
*/
-RTDECL(uint32_t) RTRandU32Ex(uint32_t u32First, uint32_t u32Last) RT_NO_THROW;
+RTDECL(uint32_t) RTRandU32Ex(uint32_t u32First, uint32_t u32Last) RT_NO_THROW_PROTO;
/**
* Generate a 32-bit unsigned random number.
*
* @returns The random number.
*/
-RTDECL(uint32_t) RTRandU32(void) RT_NO_THROW;
+RTDECL(uint32_t) RTRandU32(void) RT_NO_THROW_PROTO;
/**
* Generate a 64-bit signed random number in the set [i64First..i64Last].
@@ -83,14 +83,14 @@ RTDECL(uint32_t) RTRandU32(void) RT_NO_THROW;
* @param i64First First number in the set.
* @param i64Last Last number in the set.
*/
-RTDECL(int64_t) RTRandS64Ex(int64_t i64First, int64_t i64Last) RT_NO_THROW;
+RTDECL(int64_t) RTRandS64Ex(int64_t i64First, int64_t i64Last) RT_NO_THROW_PROTO;
/**
* Generate a 64-bit signed random number.
*
* @returns The random number.
*/
-RTDECL(int64_t) RTRandS64(void) RT_NO_THROW;
+RTDECL(int64_t) RTRandS64(void) RT_NO_THROW_PROTO;
/**
* Generate a 64-bit unsigned random number in the set [u64First..u64Last].
@@ -99,14 +99,14 @@ RTDECL(int64_t) RTRandS64(void) RT_NO_THROW;
* @param u64First First number in the set.
* @param u64Last Last number in the set.
*/
-RTDECL(uint64_t) RTRandU64Ex(uint64_t u64First, uint64_t u64Last) RT_NO_THROW;
+RTDECL(uint64_t) RTRandU64Ex(uint64_t u64First, uint64_t u64Last) RT_NO_THROW_PROTO;
/**
* Generate a 64-bit unsigned random number.
*
* @returns The random number.
*/
-RTDECL(uint64_t) RTRandU64(void) RT_NO_THROW;
+RTDECL(uint64_t) RTRandU64(void) RT_NO_THROW_PROTO;
/**
@@ -116,7 +116,7 @@ RTDECL(uint64_t) RTRandU64(void) RT_NO_THROW;
* @param phRand Where to return the handle to the new random number
* generator.
*/
-RTDECL(int) RTRandAdvCreate(PRTRAND phRand) RT_NO_THROW;
+RTDECL(int) RTRandAdvCreate(PRTRAND phRand) RT_NO_THROW_PROTO;
/**
* Create an instance of the default pseudo random number generator.
@@ -124,7 +124,7 @@ RTDECL(int) RTRandAdvCreate(PRTRAND phRand) RT_NO_THROW;
* @returns IPRT status code.
* @param phRand Where to store the handle to the generator.
*/
-RTDECL(int) RTRandAdvCreatePseudo(PRTRAND phRand) RT_NO_THROW;
+RTDECL(int) RTRandAdvCreatePseudo(PRTRAND phRand) RT_NO_THROW_PROTO;
/**
* Create an instance of the Park-Miller pseudo random number generator.
@@ -132,7 +132,7 @@ RTDECL(int) RTRandAdvCreatePseudo(PRTRAND phRand) RT_NO_THROW;
* @returns IPRT status code.
* @param phRand Where to store the handle to the generator.
*/
-RTDECL(int) RTRandAdvCreateParkMiller(PRTRAND phRand) RT_NO_THROW;
+RTDECL(int) RTRandAdvCreateParkMiller(PRTRAND phRand) RT_NO_THROW_PROTO;
/**
* Create an instance of the faster random number generator for the OS.
@@ -147,7 +147,7 @@ RTDECL(int) RTRandAdvCreateParkMiller(PRTRAND phRand) RT_NO_THROW;
*
* @remarks Think /dev/urandom.
*/
-RTDECL(int) RTRandAdvCreateSystemFaster(PRTRAND phRand) RT_NO_THROW;
+RTDECL(int) RTRandAdvCreateSystemFaster(PRTRAND phRand) RT_NO_THROW_PROTO;
/**
* Create an instance of the truer random number generator for the OS.
@@ -166,7 +166,7 @@ RTDECL(int) RTRandAdvCreateSystemFaster(PRTRAND phRand) RT_NO_THROW;
*
* @remarks Think /dev/random.
*/
-RTDECL(int) RTRandAdvCreateSystemTruer(PRTRAND phRand) RT_NO_THROW;
+RTDECL(int) RTRandAdvCreateSystemTruer(PRTRAND phRand) RT_NO_THROW_PROTO;
/**
* Destroys a random number generator.
@@ -174,7 +174,7 @@ RTDECL(int) RTRandAdvCreateSystemTruer(PRTRAND phRand) RT_NO_THROW;
* @returns IPRT status code.
* @param hRand Handle to the random number generator.
*/
-RTDECL(int) RTRandAdvDestroy(RTRAND hRand) RT_NO_THROW;
+RTDECL(int) RTRandAdvDestroy(RTRAND hRand) RT_NO_THROW_PROTO;
/**
* Generic method for seeding of a random number generator.
@@ -189,7 +189,7 @@ RTDECL(int) RTRandAdvDestroy(RTRAND hRand) RT_NO_THROW;
* @param hRand Handle to the random number generator.
* @param u64Seed Seed.
*/
-RTDECL(int) RTRandAdvSeed(RTRAND hRand, uint64_t u64Seed) RT_NO_THROW;
+RTDECL(int) RTRandAdvSeed(RTRAND hRand, uint64_t u64Seed) RT_NO_THROW_PROTO;
/**
* Save the current state of a pseudo generator.
@@ -211,7 +211,7 @@ RTDECL(int) RTRandAdvSeed(RTRAND hRand, uint64_t u64Seed) RT_NO_THROW;
* size required / used on return (including the
* terminator, thus the 'cb' instead of 'cch').
*/
-RTDECL(int) RTRandAdvSaveState(RTRAND hRand, char *pszState, size_t *pcbState) RT_NO_THROW;
+RTDECL(int) RTRandAdvSaveState(RTRAND hRand, char *pszState, size_t *pcbState) RT_NO_THROW_PROTO;
/**
* Restores the state of a pseudo generator.
@@ -225,7 +225,7 @@ RTDECL(int) RTRandAdvSaveState(RTRAND hRand, char *pszState, size_t *pcbState) R
* @param hRand Handle to the random number generator.
* @param pszState The state to load.
*/
-RTDECL(int) RTRandAdvRestoreState(RTRAND hRand, char const *pszState) RT_NO_THROW;
+RTDECL(int) RTRandAdvRestoreState(RTRAND hRand, char const *pszState) RT_NO_THROW_PROTO;
/**
* Fills a buffer with random bytes.
@@ -234,7 +234,7 @@ RTDECL(int) RTRandAdvRestoreState(RTRAND hRand, char const *pszState) RT_NO_THRO
* @param pv Where to store the random bytes.
* @param cb Number of bytes to generate.
*/
-RTDECL(void) RTRandAdvBytes(RTRAND hRand, void *pv, size_t cb) RT_NO_THROW;
+RTDECL(void) RTRandAdvBytes(RTRAND hRand, void *pv, size_t cb) RT_NO_THROW_PROTO;
/**
* Generate a 32-bit signed random number in the set [i32First..i32Last].
@@ -244,7 +244,7 @@ RTDECL(void) RTRandAdvBytes(RTRAND hRand, void *pv, size_t cb) RT_NO_THROW;
* @param i32First First number in the set.
* @param i32Last Last number in the set.
*/
-RTDECL(int32_t) RTRandAdvS32Ex(RTRAND hRand, int32_t i32First, int32_t i32Last) RT_NO_THROW;
+RTDECL(int32_t) RTRandAdvS32Ex(RTRAND hRand, int32_t i32First, int32_t i32Last) RT_NO_THROW_PROTO;
/**
* Generate a 32-bit signed random number.
@@ -252,7 +252,7 @@ RTDECL(int32_t) RTRandAdvS32Ex(RTRAND hRand, int32_t i32First, int32_t i32Last)
* @returns The random number.
* @param hRand Handle to the random number generator.
*/
-RTDECL(int32_t) RTRandAdvS32(RTRAND hRand) RT_NO_THROW;
+RTDECL(int32_t) RTRandAdvS32(RTRAND hRand) RT_NO_THROW_PROTO;
/**
* Generate a 32-bit unsigned random number in the set [u32First..u32Last].
@@ -262,7 +262,7 @@ RTDECL(int32_t) RTRandAdvS32(RTRAND hRand) RT_NO_THROW;
* @param u32First First number in the set.
* @param u32Last Last number in the set.
*/
-RTDECL(uint32_t) RTRandAdvU32Ex(RTRAND hRand, uint32_t u32First, uint32_t u32Last) RT_NO_THROW;
+RTDECL(uint32_t) RTRandAdvU32Ex(RTRAND hRand, uint32_t u32First, uint32_t u32Last) RT_NO_THROW_PROTO;
/**
* Generate a 32-bit unsigned random number.
@@ -270,7 +270,7 @@ RTDECL(uint32_t) RTRandAdvU32Ex(RTRAND hRand, uint32_t u32First, uint32_t u32Las
* @returns The random number.
* @param hRand Handle to the random number generator.
*/
-RTDECL(uint32_t) RTRandAdvU32(RTRAND hRand) RT_NO_THROW;
+RTDECL(uint32_t) RTRandAdvU32(RTRAND hRand) RT_NO_THROW_PROTO;
/**
* Generate a 64-bit signed random number in the set [i64First..i64Last].
@@ -280,14 +280,14 @@ RTDECL(uint32_t) RTRandAdvU32(RTRAND hRand) RT_NO_THROW;
* @param i64First First number in the set.
* @param i64Last Last number in the set.
*/
-RTDECL(int64_t) RTRandAdvS64Ex(RTRAND hRand, int64_t i64First, int64_t i64Last) RT_NO_THROW;
+RTDECL(int64_t) RTRandAdvS64Ex(RTRAND hRand, int64_t i64First, int64_t i64Last) RT_NO_THROW_PROTO;
/**
* Generate a 64-bit signed random number.
*
* @returns The random number.
*/
-RTDECL(int64_t) RTRandAdvS64(RTRAND hRand) RT_NO_THROW;
+RTDECL(int64_t) RTRandAdvS64(RTRAND hRand) RT_NO_THROW_PROTO;
/**
* Generate a 64-bit unsigned random number in the set [u64First..u64Last].
@@ -297,7 +297,7 @@ RTDECL(int64_t) RTRandAdvS64(RTRAND hRand) RT_NO_THROW;
* @param u64First First number in the set.
* @param u64Last Last number in the set.
*/
-RTDECL(uint64_t) RTRandAdvU64Ex(RTRAND hRand, uint64_t u64First, uint64_t u64Last) RT_NO_THROW;
+RTDECL(uint64_t) RTRandAdvU64Ex(RTRAND hRand, uint64_t u64First, uint64_t u64Last) RT_NO_THROW_PROTO;
/**
* Generate a 64-bit unsigned random number.
@@ -305,7 +305,7 @@ RTDECL(uint64_t) RTRandAdvU64Ex(RTRAND hRand, uint64_t u64First, uint64_t u64Las
* @returns The random number.
* @param hRand Handle to the random number generator.
*/
-RTDECL(uint64_t) RTRandAdvU64(RTRAND hRand) RT_NO_THROW;
+RTDECL(uint64_t) RTRandAdvU64(RTRAND hRand) RT_NO_THROW_PROTO;
/** @} */
diff --git a/include/iprt/sha.h b/include/iprt/sha.h
index 6b01358..4caccaa 100644
--- a/include/iprt/sha.h
+++ b/include/iprt/sha.h
@@ -68,6 +68,17 @@ typedef RTSHA1CONTEXT *PRTSHA1CONTEXT;
RTDECL(void) RTSha1(const void *pvBuf, size_t cbBuf, uint8_t pabDigest[RTSHA1_HASH_SIZE]);
/**
+ * Computes the SHA-1 hash for the given data comparing it with the one given.
+ *
+ * @returns true on match, false on mismatch.
+ * @param pvBuf Pointer to the data.
+ * @param cbBuf The amount of data (in bytes).
+ * @param pabHash The hash to verify. (What is passed is a pointer to the
+ * caller's buffer.)
+ */
+RTDECL(bool) RTSha1Check(const void *pvBuf, size_t cbBuf, uint8_t const pabDigest[RTSHA1_HASH_SIZE]);
+
+/**
* Initializes the SHA-1 context.
*
* @param pCtx Pointer to the SHA-1 context.
@@ -176,6 +187,17 @@ typedef RTSHA256CONTEXT *PRTSHA256CONTEXT;
RTDECL(void) RTSha256(const void *pvBuf, size_t cbBuf, uint8_t pabDigest[RTSHA256_HASH_SIZE]);
/**
+ * Computes the SHA-256 hash for the given data comparing it with the one given.
+ *
+ * @returns true on match, false on mismatch.
+ * @param pvBuf Pointer to the data.
+ * @param cbBuf The amount of data (in bytes).
+ * @param pabHash The hash to verify. (What is passed is a pointer to the
+ * caller's buffer.)
+ */
+RTDECL(bool) RTSha256Check(const void *pvBuf, size_t cbBuf, uint8_t const pabDigest[RTSHA256_HASH_SIZE]);
+
+/**
* Initializes the SHA-256 context.
*
* @param pCtx Pointer to the SHA-256 context.
@@ -274,6 +296,17 @@ typedef RTSHA256CONTEXT *PRTSHA224CONTEXT;
RTDECL(void) RTSha224(const void *pvBuf, size_t cbBuf, uint8_t pabDigest[RTSHA224_HASH_SIZE]);
/**
+ * Computes the SHA-224 hash for the given data comparing it with the one given.
+ *
+ * @returns true on match, false on mismatch.
+ * @param pvBuf Pointer to the data.
+ * @param cbBuf The amount of data (in bytes).
+ * @param pabHash The hash to verify. (What is passed is a pointer to the
+ * caller's buffer.)
+ */
+RTDECL(bool) RTSha224Check(const void *pvBuf, size_t cbBuf, uint8_t const pabDigest[RTSHA224_HASH_SIZE]);
+
+/**
* Initializes the SHA-224 context.
*
* @param pCtx Pointer to the SHA-224 context.
@@ -382,6 +415,17 @@ typedef RTSHA512CONTEXT *PRTSHA512CONTEXT;
RTDECL(void) RTSha512(const void *pvBuf, size_t cbBuf, uint8_t pabDigest[RTSHA512_HASH_SIZE]);
/**
+ * Computes the SHA-512 hash for the given data comparing it with the one given.
+ *
+ * @returns true on match, false on mismatch.
+ * @param pvBuf Pointer to the data.
+ * @param cbBuf The amount of data (in bytes).
+ * @param pabHash The hash to verify. (What is passed is a pointer to the
+ * caller's buffer.)
+ */
+RTDECL(bool) RTSha512Check(const void *pvBuf, size_t cbBuf, uint8_t const pabDigest[RTSHA512_HASH_SIZE]);
+
+/**
* Initializes the SHA-512 context.
*
* @param pCtx Pointer to the SHA-512 context.
@@ -437,6 +481,7 @@ RTDECL(int) RTSha512FromString(char const *pszDigest, uint8_t pabDigest[RTSHA512
typedef RTSHA512CONTEXT RT_CONCAT3(RTSHA,a_UName,CONTEXT); \
typedef RTSHA512CONTEXT *RT_CONCAT3(PRTSHA,a_UName,CONTEXT); \
RTDECL(void) RT_CONCAT(RTSha,a_Name)(const void *pvBuf, size_t cbBuf, uint8_t pabDigest[RT_CONCAT3(RTSHA,a_UName,_HASH_SIZE)]); \
+ RTDECL(bool) RT_CONCAT3(RTSha,a_Name,Check)(const void *pvBuf, size_t cbBuf, uint8_t const pabDigest[RT_CONCAT3(RTSHA,a_UName,_HASH_SIZE)]); \
RTDECL(void) RT_CONCAT3(RTSha,a_Name,Init)(RT_CONCAT3(PRTSHA,a_UName,CONTEXT) pCtx); \
RTDECL(void) RT_CONCAT3(RTSha,a_Name,Update)(RT_CONCAT3(PRTSHA,a_UName,CONTEXT) pCtx, const void *pvBuf, size_t cbBuf); \
RTDECL(void) RT_CONCAT3(RTSha,a_Name,Final)(RT_CONCAT3(PRTSHA,a_UName,CONTEXT) pCtx, uint8_t pabDigest[RT_CONCAT3(RTSHA,a_UName,_HASH_SIZE)]); \
diff --git a/include/iprt/types.h b/include/iprt/types.h
index 2425e2e..c95e0db 100644
--- a/include/iprt/types.h
+++ b/include/iprt/types.h
@@ -2175,6 +2175,21 @@ typedef const RTUTF16 *PCRTUTF16;
/**
+ * String tuple to go with the RT_STR_TUPLE macro.
+ */
+typedef struct RTSTRTUPLE
+{
+ /** The string. */
+ const char *psz;
+ /** The string length. */
+ size_t cch;
+} RTSTRTUPLE;
+/** Pointer to a string tuple. */
+typedef RTSTRTUPLE *PRTSTRTUPLE;
+/** Pointer to a const string tuple. */
+typedef RTSTRTUPLE const *PCRTSTRTUPLE;
+
+/**
* Wait for ever if we have to.
*/
#define RT_INDEFINITE_WAIT (~0U)
diff --git a/include/iprt/zip.h b/include/iprt/zip.h
index 2633a67..37983f5 100644
--- a/include/iprt/zip.h
+++ b/include/iprt/zip.h
@@ -195,7 +195,7 @@ RTDECL(int) RTZipDecompDestroy(PRTZIPDECOMP pZip);
*/
RTDECL(int) RTZipBlockCompress(RTZIPTYPE enmType, RTZIPLEVEL enmLevel, uint32_t fFlags,
void const *pvSrc, size_t cbSrc,
- void *pvDst, size_t cbDst, size_t *pcbDstActual) RT_NO_THROW;
+ void *pvDst, size_t cbDst, size_t *pcbDstActual) RT_NO_THROW_PROTO;
/**
@@ -214,7 +214,7 @@ RTDECL(int) RTZipBlockCompress(RTZIPTYPE enmType, RTZIPLEVEL enmLevel, uint3
*/
RTDECL(int) RTZipBlockDecompress(RTZIPTYPE enmType, uint32_t fFlags,
void const *pvSrc, size_t cbSrc, size_t *pcbSrcActual,
- void *pvDst, size_t cbDst, size_t *pcbDstActual) RT_NO_THROW;
+ void *pvDst, size_t cbDst, size_t *pcbDstActual) RT_NO_THROW_PROTO;
/**
diff --git a/src/VBox/Additions/common/VBoxControl/VBoxControl.cpp b/src/VBox/Additions/common/VBoxControl/VBoxControl.cpp
index dc86989..62aaefe 100644
--- a/src/VBox/Additions/common/VBoxControl/VBoxControl.cpp
+++ b/src/VBox/Additions/common/VBoxControl/VBoxControl.cpp
@@ -15,9 +15,10 @@
* hope that it will be useful, but WITHOUT ANY WARRANTY of any kind.
*/
-/*******************************************************************************
-* Header Files *
-*******************************************************************************/
+
+/*********************************************************************************************************************************
+* Header Files *
+*********************************************************************************************************************************/
#include <iprt/alloca.h>
#include <iprt/cpp/autores.h>
#include <iprt/buildconfig.h>
@@ -43,9 +44,9 @@
#endif
-/*******************************************************************************
-* Global Variables *
-*******************************************************************************/
+/*********************************************************************************************************************************
+* Global Variables *
+*********************************************************************************************************************************/
/** The program name (derived from argv[0]). */
char const *g_pszProgName = "";
/** The current verbosity level. */
@@ -601,7 +602,7 @@ static BOOL ResizeDisplayDevice(ULONG Id, DWORD Width, DWORD Height, DWORD BitsP
return TRUE;
}
-static RTEXITCODE handleSetVideoMode(int argc, char *argv[])
+static DECLCALLBACK(RTEXITCODE) handleSetVideoMode(int argc, char *argv[])
{
if (argc != 3 && argc != 4)
{
@@ -765,7 +766,7 @@ static HKEY getVideoKey(bool writable)
return hkeyVideo;
}
-static RTEXITCODE handleGetVideoAcceleration(int argc, char *argv[])
+static DECLCALLBACK(RTEXITCODE) handleGetVideoAcceleration(int argc, char *argv[])
{
ULONG status;
HKEY hkeyVideo = getVideoKey(false);
@@ -786,7 +787,7 @@ static RTEXITCODE handleGetVideoAcceleration(int argc, char *argv[])
return RTEXITCODE_SUCCESS;
}
-static RTEXITCODE handleSetVideoAcceleration(int argc, char *argv[])
+static DECLCALLBACK(RTEXITCODE) handleSetVideoAcceleration(int argc, char *argv[])
{
ULONG status;
HKEY hkeyVideo;
@@ -818,7 +819,7 @@ static RTEXITCODE handleSetVideoAcceleration(int argc, char *argv[])
return RTEXITCODE_SUCCESS;
}
-static RTEXITCODE videoFlagsGet(void)
+static DECLCALLBACK(RTEXITCODE) videoFlagsGet(void)
{
HKEY hkeyVideo = getVideoKey(false);
@@ -839,7 +840,7 @@ static RTEXITCODE videoFlagsGet(void)
return RTEXITCODE_FAILURE;
}
-static RTEXITCODE videoFlagsDelete(void)
+static DECLCALLBACK(RTEXITCODE) videoFlagsDelete(void)
{
HKEY hkeyVideo = getVideoKey(true);
@@ -855,7 +856,7 @@ static RTEXITCODE videoFlagsDelete(void)
return RTEXITCODE_FAILURE;
}
-static RTEXITCODE videoFlagsModify(bool fSet, int argc, char *argv[])
+static DECLCALLBACK(RTEXITCODE) videoFlagsModify(bool fSet, int argc, char *argv[])
{
if (argc != 1)
{
@@ -905,7 +906,7 @@ static RTEXITCODE videoFlagsModify(bool fSet, int argc, char *argv[])
return exitCode;
}
-static RTEXITCODE handleVideoFlags(int argc, char *argv[])
+static DECLCALLBACK(RTEXITCODE) handleVideoFlags(int argc, char *argv[])
{
/* Must have a keyword and optional value (32 bit hex string). */
if (argc != 1 && argc != 2)
@@ -1056,7 +1057,7 @@ void writeCustomModes(HKEY hkeyVideo)
}
-static RTEXITCODE handleListCustomModes(int argc, char *argv[])
+static DECLCALLBACK(RTEXITCODE) handleListCustomModes(int argc, char *argv[])
{
if (argc != 0)
{
@@ -1084,7 +1085,7 @@ static RTEXITCODE handleListCustomModes(int argc, char *argv[])
return RTEXITCODE_SUCCESS;
}
-static RTEXITCODE handleAddCustomMode(int argc, char *argv[])
+static DECLCALLBACK(RTEXITCODE) handleAddCustomMode(int argc, char *argv[])
{
if (argc != 3)
{
@@ -1145,7 +1146,7 @@ static RTEXITCODE handleAddCustomMode(int argc, char *argv[])
return RTEXITCODE_SUCCESS;
}
-static RTEXITCODE handleRemoveCustomMode(int argc, char *argv[])
+static DECLCALLBACK(RTEXITCODE) handleRemoveCustomMode(int argc, char *argv[])
{
if (argc != 3)
{
@@ -1600,7 +1601,7 @@ static RTEXITCODE waitGuestProperty(int argc, char **argv)
* @returns 0 on success, 1 on failure
* @note see the command line API description for parameters
*/
-static RTEXITCODE handleGuestProperty(int argc, char *argv[])
+static DECLCALLBACK(RTEXITCODE) handleGuestProperty(int argc, char *argv[])
{
if (0 == argc)
{
@@ -1696,7 +1697,7 @@ static RTEXITCODE listSharedFolders(int argc, char **argv)
* @note see the command line API description for parameters
* (r=bird: yeah, right. The API description contains nil about params)
*/
-static RTEXITCODE handleSharedFolder(int argc, char *argv[])
+static DECLCALLBACK(RTEXITCODE) handleSharedFolder(int argc, char *argv[])
{
if (0 == argc)
{
@@ -1715,7 +1716,7 @@ static RTEXITCODE handleSharedFolder(int argc, char *argv[])
/**
* @callback_method_impl{FNVBOXCTRLCMDHANDLER, Command: writecoredump}
*/
-static RTEXITCODE handleWriteCoreDump(int argc, char *argv[])
+static DECLCALLBACK(RTEXITCODE) handleWriteCoreDump(int argc, char *argv[])
{
int rc = VbglR3WriteCoreDump();
if (RT_SUCCESS(rc))
@@ -1735,7 +1736,7 @@ static RTEXITCODE handleWriteCoreDump(int argc, char *argv[])
/**
* @callback_method_impl{FNVBOXCTRLCMDHANDLER, Command: help}
*/
-static RTEXITCODE handleDpc(int argc, char *argv[])
+static DECLCALLBACK(RTEXITCODE) handleDpc(int argc, char *argv[])
{
# ifndef VBOX_CONTROL_TEST
int rc;
@@ -1760,7 +1761,7 @@ static RTEXITCODE handleDpc(int argc, char *argv[])
/**
* @callback_method_impl{FNVBOXCTRLCMDHANDLER, Command: writelog}
*/
-static RTEXITCODE handleWriteLog(int argc, char *argv[])
+static DECLCALLBACK(RTEXITCODE) handleWriteLog(int argc, char *argv[])
{
static const RTGETOPTDEF s_aOptions[] =
{
@@ -1823,7 +1824,7 @@ static RTEXITCODE handleWriteLog(int argc, char *argv[])
/**
* @callback_method_impl{FNVBOXCTRLCMDHANDLER, Command: takesnapshot}
*/
-static RTEXITCODE handleTakeSnapshot(int argc, char *argv[])
+static DECLCALLBACK(RTEXITCODE) handleTakeSnapshot(int argc, char *argv[])
{
//VbglR3VmTakeSnapshot(argv[0], argv[1]);
return VBoxControlError("not implemented");
@@ -1832,7 +1833,7 @@ static RTEXITCODE handleTakeSnapshot(int argc, char *argv[])
/**
* @callback_method_impl{FNVBOXCTRLCMDHANDLER, Command: savestate}
*/
-static RTEXITCODE handleSaveState(int argc, char *argv[])
+static DECLCALLBACK(RTEXITCODE) handleSaveState(int argc, char *argv[])
{
//VbglR3VmSaveState();
return VBoxControlError("not implemented");
@@ -1841,7 +1842,7 @@ static RTEXITCODE handleSaveState(int argc, char *argv[])
/**
* @callback_method_impl{FNVBOXCTRLCMDHANDLER, Command: suspend|pause}
*/
-static RTEXITCODE handleSuspend(int argc, char *argv[])
+static DECLCALLBACK(RTEXITCODE) handleSuspend(int argc, char *argv[])
{
//VbglR3VmSuspend();
return VBoxControlError("not implemented");
@@ -1850,7 +1851,7 @@ static RTEXITCODE handleSuspend(int argc, char *argv[])
/**
* @callback_method_impl{FNVBOXCTRLCMDHANDLER, Command: poweroff|powerdown}
*/
-static RTEXITCODE handlePowerOff(int argc, char *argv[])
+static DECLCALLBACK(RTEXITCODE) handlePowerOff(int argc, char *argv[])
{
//VbglR3VmPowerOff();
return VBoxControlError("not implemented");
@@ -1859,7 +1860,7 @@ static RTEXITCODE handlePowerOff(int argc, char *argv[])
/**
* @callback_method_impl{FNVBOXCTRLCMDHANDLER, Command: version}
*/
-static RTEXITCODE handleVersion(int argc, char *argv[])
+static DECLCALLBACK(RTEXITCODE) handleVersion(int argc, char *argv[])
{
if (argc)
return VBoxControlSyntaxError("getversion does not take any arguments");
@@ -1869,7 +1870,7 @@ static RTEXITCODE handleVersion(int argc, char *argv[])
/**
* @callback_method_impl{FNVBOXCTRLCMDHANDLER, Command: help}
*/
-static RTEXITCODE handleHelp(int argc, char *argv[])
+static DECLCALLBACK(RTEXITCODE) handleHelp(int argc, char *argv[])
{
/* ignore arguments for now. */
usage();
diff --git a/src/VBox/Additions/common/VBoxControl/testcase/tstVBoxControl.cpp b/src/VBox/Additions/common/VBoxControl/testcase/tstVBoxControl.cpp
index be6cf66..e3e6136 100644
--- a/src/VBox/Additions/common/VBoxControl/testcase/tstVBoxControl.cpp
+++ b/src/VBox/Additions/common/VBoxControl/testcase/tstVBoxControl.cpp
@@ -17,9 +17,9 @@
-/*******************************************************************************
-* Header Files *
-*******************************************************************************/
+/*********************************************************************************************************************************
+* Header Files *
+*********************************************************************************************************************************/
#include <iprt/cpp/autores.h>
#include <iprt/initterm.h>
#include <iprt/mem.h>
diff --git a/src/VBox/Additions/common/VBoxGuest/VBoxDev-haiku.c b/src/VBox/Additions/common/VBoxGuest/VBoxDev-haiku.c
index 1194da0..87bcbd1 100644
--- a/src/VBox/Additions/common/VBoxGuest/VBoxDev-haiku.c
+++ b/src/VBox/Additions/common/VBoxGuest/VBoxDev-haiku.c
@@ -44,9 +44,10 @@
* OTHER DEALINGS IN THE SOFTWARE.
*/
-/*******************************************************************************
-* Header Files *
-*******************************************************************************/
+
+/*********************************************************************************************************************************
+* Header Files *
+*********************************************************************************************************************************/
#include <sys/param.h>
#include <sys/types.h>
#include <sys/uio.h>
@@ -68,9 +69,10 @@
#define DEVICE_NAME "misc/vboxguest"
#define MODULE_NAME "generic/vboxguest"
-/*******************************************************************************
-* Internal Functions *
-*******************************************************************************/
+
+/*********************************************************************************************************************************
+* Internal Functions *
+*********************************************************************************************************************************/
static status_t VBoxGuestHaikuOpen(const char *name, uint32 flags, void **cookie);
static status_t VBoxGuestHaikuClose(void *cookie);
static status_t VBoxGuestHaikuFree(void *cookie);
diff --git a/src/VBox/Additions/common/VBoxGuest/VBoxGuest-darwin.cpp b/src/VBox/Additions/common/VBoxGuest/VBoxGuest-darwin.cpp
index e473ff0..d93ac16 100644
--- a/src/VBox/Additions/common/VBoxGuest/VBoxGuest-darwin.cpp
+++ b/src/VBox/Additions/common/VBoxGuest/VBoxGuest-darwin.cpp
@@ -15,9 +15,10 @@
* hope that it will be useful, but WITHOUT ANY WARRANTY of any kind.
*/
-/*******************************************************************************
-* Header Files *
-*******************************************************************************/
+
+/*********************************************************************************************************************************
+* Header Files *
+*********************************************************************************************************************************/
#define LOG_GROUP LOG_GROUP_VBGD
/*
* Deal with conflicts first.
@@ -59,9 +60,9 @@
#include "VBoxGuestInternal.h"
-/*******************************************************************************
-* Defined Constants And Macros *
-*******************************************************************************/
+/*********************************************************************************************************************************
+* Defined Constants And Macros *
+*********************************************************************************************************************************/
/** The system device node name. */
#define DEVICE_NAME_SYS "vboxguest"
@@ -85,9 +86,9 @@
#endif
-/*******************************************************************************
-* Internal Functions *
-*******************************************************************************/
+/*********************************************************************************************************************************
+* Internal Functions *
+*********************************************************************************************************************************/
RT_C_DECLS_BEGIN
static kern_return_t VbgdDarwinStart(struct kmod_info *pKModInfo, void *pvData);
static kern_return_t VbgdDarwinStop(struct kmod_info *pKModInfo, void *pvData);
@@ -104,9 +105,9 @@ static IOReturn VbgdDarwinSleepHandler(void *pvTarget, void *pvRefCon, U
RT_C_DECLS_END
-/*******************************************************************************
-* Structures and Typedefs *
-*******************************************************************************/
+/*********************************************************************************************************************************
+* Structures and Typedefs *
+*********************************************************************************************************************************/
/**
* The service class for handling the VMMDev PCI device.
*
@@ -165,9 +166,9 @@ OSDefineMetaClassAndStructors(org_virtualbox_VBoxGuestClient, IOUserClient);
-/*******************************************************************************
-* Global Variables *
-*******************************************************************************/
+/*********************************************************************************************************************************
+* Global Variables *
+*********************************************************************************************************************************/
/**
* Declare the module stuff.
*/
diff --git a/src/VBox/Additions/common/VBoxGuest/VBoxGuest-haiku.c b/src/VBox/Additions/common/VBoxGuest/VBoxGuest-haiku.c
index 1a00949..f7ee2a1 100644
--- a/src/VBox/Additions/common/VBoxGuest/VBoxGuest-haiku.c
+++ b/src/VBox/Additions/common/VBoxGuest/VBoxGuest-haiku.c
@@ -44,9 +44,10 @@
* OTHER DEALINGS IN THE SOFTWARE.
*/
-/*******************************************************************************
-* Header Files *
-*******************************************************************************/
+
+/*********************************************************************************************************************************
+* Header Files *
+*********************************************************************************************************************************/
#define IN_VBOXGUEST
#include <sys/param.h>
#include <sys/types.h>
diff --git a/src/VBox/Additions/common/VBoxGuest/VBoxGuest-linux.c b/src/VBox/Additions/common/VBoxGuest/VBoxGuest-linux.c
index 0383d06..45b0355 100644
--- a/src/VBox/Additions/common/VBoxGuest/VBoxGuest-linux.c
+++ b/src/VBox/Additions/common/VBoxGuest/VBoxGuest-linux.c
@@ -1,4 +1,4 @@
-/* $Rev: 100489 $ */
+/* $Rev: 102121 $ */
/** @file
* VBoxGuest - Linux specifics.
*
@@ -18,9 +18,10 @@
* hope that it will be useful, but WITHOUT ANY WARRANTY of any kind.
*/
-/*******************************************************************************
-* Header Files *
-*******************************************************************************/
+
+/*********************************************************************************************************************************
+* Header Files *
+*********************************************************************************************************************************/
#define LOG_GROUP LOG_GROUP_SUP_DRV
#include "the-linux-kernel.h"
@@ -49,9 +50,9 @@
#include <VBox/log.h>
-/*******************************************************************************
-* Defined Constants And Macros *
-*******************************************************************************/
+/*********************************************************************************************************************************
+* Defined Constants And Macros *
+*********************************************************************************************************************************/
/** The device name. */
#define DEVICE_NAME "vboxguest"
/** The device name for the device node open to everyone.. */
@@ -67,9 +68,9 @@
#endif
-/*******************************************************************************
-* Internal Functions *
-*******************************************************************************/
+/*********************************************************************************************************************************
+* Internal Functions *
+*********************************************************************************************************************************/
static void vboxguestLinuxTermPci(struct pci_dev *pPciDev);
static int vboxguestLinuxModInit(void);
static void vboxguestLinuxModExit(void);
@@ -85,9 +86,9 @@ static unsigned int vboxguestPoll(struct file *pFile, poll_table *pPt);
static ssize_t vboxguestRead(struct file *pFile, char *pbBuf, size_t cbRead, loff_t *poff);
-/*******************************************************************************
-* Global Variables *
-*******************************************************************************/
+/*********************************************************************************************************************************
+* Global Variables *
+*********************************************************************************************************************************/
/**
* Device extention & session data association structure.
*/
diff --git a/src/VBox/Additions/common/VBoxGuest/VBoxGuest-os2.cpp b/src/VBox/Additions/common/VBoxGuest/VBoxGuest-os2.cpp
index 446556b..be22fd3 100644
--- a/src/VBox/Additions/common/VBoxGuest/VBoxGuest-os2.cpp
+++ b/src/VBox/Additions/common/VBoxGuest/VBoxGuest-os2.cpp
@@ -44,9 +44,9 @@
*/
-/*******************************************************************************
-* Header Files *
-*******************************************************************************/
+/*********************************************************************************************************************************
+* Header Files *
+*********************************************************************************************************************************/
#include <os2ddk/bsekee.h>
#include "VBoxGuestInternal.h"
@@ -62,9 +62,9 @@
#include <iprt/param.h>
-/*******************************************************************************
-* Global Variables *
-*******************************************************************************/
+/*********************************************************************************************************************************
+* Global Variables *
+*********************************************************************************************************************************/
/**
* Device extention & session data association structure.
*/
@@ -105,9 +105,9 @@ extern uint16_t g_cchInitTextMax;
RT_C_DECLS_END
-/*******************************************************************************
-* Internal Functions *
-*******************************************************************************/
+/*********************************************************************************************************************************
+* Internal Functions *
+*********************************************************************************************************************************/
static int vboxGuestOS2MapMemory(void);
static VBOXOSTYPE vboxGuestOS2DetectVersion(void);
diff --git a/src/VBox/Additions/common/VBoxGuest/VBoxGuest-solaris.c b/src/VBox/Additions/common/VBoxGuest/VBoxGuest-solaris.c
index c02c965..0db5cf3 100644
--- a/src/VBox/Additions/common/VBoxGuest/VBoxGuest-solaris.c
+++ b/src/VBox/Additions/common/VBoxGuest/VBoxGuest-solaris.c
@@ -25,9 +25,9 @@
*/
-/*******************************************************************************
-* Header Files *
-*******************************************************************************/
+/*********************************************************************************************************************************
+* Header Files *
+*********************************************************************************************************************************/
#include <sys/conf.h>
#include <sys/modctl.h>
#include <sys/mutex.h>
@@ -52,18 +52,18 @@
#include <iprt/asm.h>
-/*******************************************************************************
-* Defined Constants And Macros *
-*******************************************************************************/
+/*********************************************************************************************************************************
+* Defined Constants And Macros *
+*********************************************************************************************************************************/
/** The module name. */
#define DEVICE_NAME "vboxguest"
/** The module description as seen in 'modinfo'. */
#define DEVICE_DESC "VirtualBox GstDrv"
-/*******************************************************************************
-* Internal Functions *
-*******************************************************************************/
+/*********************************************************************************************************************************
+* Internal Functions *
+*********************************************************************************************************************************/
static int VBoxGuestSolarisOpen(dev_t *pDev, int fFlag, int fType, cred_t *pCred);
static int VBoxGuestSolarisClose(dev_t Dev, int fFlag, int fType, cred_t *pCred);
static int VBoxGuestSolarisRead(dev_t Dev, struct uio *pUio, cred_t *pCred);
@@ -81,9 +81,9 @@ static void VBoxGuestSolarisRemoveIRQ(dev_info_t *pDip);
static uint_t VBoxGuestSolarisISR(caddr_t Arg);
-/*******************************************************************************
-* Structures and Typedefs *
-*******************************************************************************/
+/*********************************************************************************************************************************
+* Structures and Typedefs *
+*********************************************************************************************************************************/
/**
* cb_ops: for drivers that support char/block entry points
*/
@@ -158,9 +158,9 @@ typedef struct
} vboxguest_state_t;
-/*******************************************************************************
-* Global Variables *
-*******************************************************************************/
+/*********************************************************************************************************************************
+* Global Variables *
+*********************************************************************************************************************************/
/** Device handle (we support only one instance). */
static dev_info_t *g_pDip = NULL;
/** Opaque pointer to file-descriptor states */
@@ -252,9 +252,11 @@ int _fini(void)
RTLogDestroy(RTLogRelSetDefaultInstance(NULL));
RTLogDestroy(RTLogSetDefaultInstance(NULL));
- mutex_destroy(&g_LdiMtx);
-
- RTR0Term();
+ if (!rc)
+ {
+ mutex_destroy(&g_LdiMtx);
+ RTR0Term();
+ }
return rc;
}
diff --git a/src/VBox/Additions/common/VBoxGuest/VBoxGuest-win-legacy.cpp b/src/VBox/Additions/common/VBoxGuest/VBoxGuest-win-legacy.cpp
index df766a1..bd0ad98 100644
--- a/src/VBox/Additions/common/VBoxGuest/VBoxGuest-win-legacy.cpp
+++ b/src/VBox/Additions/common/VBoxGuest/VBoxGuest-win-legacy.cpp
@@ -15,9 +15,10 @@
* hope that it will be useful, but WITHOUT ANY WARRANTY of any kind.
*/
-/*******************************************************************************
-* Header Files *
-*******************************************************************************/
+
+/*********************************************************************************************************************************
+* Header Files *
+*********************************************************************************************************************************/
#include "VBoxGuest-win.h"
#include "VBoxGuestInternal.h"
#include <VBox/err.h>
@@ -27,17 +28,17 @@
#include <iprt/string.h>
-/*******************************************************************************
-* Defined Constants And Macros *
-*******************************************************************************/
+/*********************************************************************************************************************************
+* Defined Constants And Macros *
+*********************************************************************************************************************************/
#ifndef PCI_MAX_BUSES
# define PCI_MAX_BUSES 256
#endif
-/*******************************************************************************
-* Internal Functions *
-*******************************************************************************/
+/*********************************************************************************************************************************
+* Internal Functions *
+*********************************************************************************************************************************/
RT_C_DECLS_BEGIN
static NTSTATUS vbgdNt4FindPciDevice(PULONG pulBusNumber, PPCI_SLOT_NUMBER pSlotNumber);
RT_C_DECLS_END
diff --git a/src/VBox/Additions/common/VBoxGuest/VBoxGuest-win-pnp.cpp b/src/VBox/Additions/common/VBoxGuest/VBoxGuest-win-pnp.cpp
index 4c3e20e..207b928 100644
--- a/src/VBox/Additions/common/VBoxGuest/VBoxGuest-win-pnp.cpp
+++ b/src/VBox/Additions/common/VBoxGuest/VBoxGuest-win-pnp.cpp
@@ -15,9 +15,10 @@
* hope that it will be useful, but WITHOUT ANY WARRANTY of any kind.
*/
-/*******************************************************************************
-* Header Files *
-*******************************************************************************/
+
+/*********************************************************************************************************************************
+* Header Files *
+*********************************************************************************************************************************/
#include "VBoxGuest-win.h"
#include "VBoxGuestInternal.h"
#include <VBox/err.h>
@@ -26,9 +27,9 @@
#include <VBox/VBoxGuestLib.h>
-/*******************************************************************************
-* Defined Constants And Macros *
-*******************************************************************************/
+/*********************************************************************************************************************************
+* Defined Constants And Macros *
+*********************************************************************************************************************************/
RT_C_DECLS_BEGIN
static NTSTATUS vbgdNtSendIrpSynchronously(PDEVICE_OBJECT pDevObj, PIRP pIrp, BOOLEAN fStrict);
static NTSTATUS vbgdNtPnPIrpComplete(PDEVICE_OBJECT pDevObj, PIRP pIrp, PKEVENT pEvent);
diff --git a/src/VBox/Additions/common/VBoxGuest/VBoxGuest-win.cpp b/src/VBox/Additions/common/VBoxGuest/VBoxGuest-win.cpp
index 48fff37..187e631 100644
--- a/src/VBox/Additions/common/VBoxGuest/VBoxGuest-win.cpp
+++ b/src/VBox/Additions/common/VBoxGuest/VBoxGuest-win.cpp
@@ -15,9 +15,10 @@
* hope that it will be useful, but WITHOUT ANY WARRANTY of any kind.
*/
-/*******************************************************************************
-* Header Files *
-*******************************************************************************/
+
+/*********************************************************************************************************************************
+* Header Files *
+*********************************************************************************************************************************/
#define LOG_GROUP LOG_GROUP_SUP_DRV
#include "VBoxGuest-win.h"
#include "VBoxGuestInternal.h"
@@ -39,9 +40,9 @@
#endif
-/*******************************************************************************
-* Internal Functions *
-*******************************************************************************/
+/*********************************************************************************************************************************
+* Internal Functions *
+*********************************************************************************************************************************/
RT_C_DECLS_BEGIN
static NTSTATUS vbgdNtAddDevice(PDRIVER_OBJECT pDrvObj, PDEVICE_OBJECT pDevObj);
static void vbgdNtUnload(PDRIVER_OBJECT pDrvObj);
@@ -59,9 +60,9 @@ static void vbgdNtDoTests(void);
RT_C_DECLS_END
-/*******************************************************************************
-* Exported Functions *
-*******************************************************************************/
+/*********************************************************************************************************************************
+* Exported Functions *
+*********************************************************************************************************************************/
RT_C_DECLS_BEGIN
ULONG DriverEntry(PDRIVER_OBJECT pDrvObj, PUNICODE_STRING pRegPath);
RT_C_DECLS_END
@@ -78,9 +79,9 @@ RT_C_DECLS_END
#endif
-/*******************************************************************************
-* Global Variables *
-*******************************************************************************/
+/*********************************************************************************************************************************
+* Global Variables *
+*********************************************************************************************************************************/
/** The detected NT (windows) version. */
VBGDNTVER g_enmVbgdNtVer = VBGDNTVER_INVALID;
diff --git a/src/VBox/Additions/common/VBoxGuest/VBoxGuest.cpp b/src/VBox/Additions/common/VBoxGuest/VBoxGuest.cpp
index 630eee4..5e3357d 100644
--- a/src/VBox/Additions/common/VBoxGuest/VBoxGuest.cpp
+++ b/src/VBox/Additions/common/VBoxGuest/VBoxGuest.cpp
@@ -25,9 +25,9 @@
*/
-/*******************************************************************************
-* Header Files *
-*******************************************************************************/
+/*********************************************************************************************************************************
+* Header Files *
+*********************************************************************************************************************************/
#define LOG_GROUP LOG_GROUP_DEFAULT
#include "VBoxGuestInternal.h"
#include <VBox/VMMDev.h> /* for VMMDEV_RAM_SIZE */
@@ -59,15 +59,15 @@
#endif
-/*******************************************************************************
-* Defined Constants And Macros *
-*******************************************************************************/
+/*********************************************************************************************************************************
+* Defined Constants And Macros *
+*********************************************************************************************************************************/
#define VBOXGUEST_ACQUIRE_STYLE_EVENTS (VMMDEV_EVENT_DISPLAY_CHANGE_REQUEST | VMMDEV_EVENT_SEAMLESS_MODE_CHANGE_REQUEST)
-/*******************************************************************************
-* Internal Functions *
-*******************************************************************************/
+/*********************************************************************************************************************************
+* Internal Functions *
+*********************************************************************************************************************************/
#ifdef VBOX_WITH_HGCM
static DECLCALLBACK(int) vbgdHgcmAsyncWaitCallback(VMMDevHGCMRequestHeader *pHdrNonVolatile, void *pvUser, uint32_t u32User);
#endif
@@ -88,9 +88,9 @@ static int vbgdAcquireSessionCapabilities(PVBOXGUESTDEVEXT pDevExt, PVBOXGU
static int vbgdDispatchEventsLocked(PVBOXGUESTDEVEXT pDevExt, uint32_t fEvents);
-/*******************************************************************************
-* Global Variables *
-*******************************************************************************/
+/*********************************************************************************************************************************
+* Global Variables *
+*********************************************************************************************************************************/
static const uint32_t g_cbChangeMemBalloonReq = RT_OFFSETOF(VMMDevChangeMemBalloon, aPhysPage[VMMDEV_MEMORY_BALLOON_CHUNK_PAGES]);
#if defined(RT_OS_DARWIN) || defined(RT_OS_SOLARIS)
diff --git a/src/VBox/Additions/common/VBoxGuest/win/VBoxGuestInst.cpp b/src/VBox/Additions/common/VBoxGuest/win/VBoxGuestInst.cpp
index 97b6b38..240a057 100644
--- a/src/VBox/Additions/common/VBoxGuest/win/VBoxGuestInst.cpp
+++ b/src/VBox/Additions/common/VBoxGuest/win/VBoxGuestInst.cpp
@@ -16,9 +16,9 @@
*/
-/*******************************************************************************
-* Header Files *
-*******************************************************************************/
+/*********************************************************************************************************************************
+* Header Files *
+*********************************************************************************************************************************/
#include <windows.h>
#include <stdio.h>
diff --git a/src/VBox/Additions/common/VBoxGuestLib/HGCMInternal.cpp b/src/VBox/Additions/common/VBoxGuestLib/HGCMInternal.cpp
index 61893ac..799ed84 100644
--- a/src/VBox/Additions/common/VBoxGuestLib/HGCMInternal.cpp
+++ b/src/VBox/Additions/common/VBoxGuestLib/HGCMInternal.cpp
@@ -27,9 +27,10 @@
/* Entire file is ifdef'ed with VBGL_VBOXGUEST */
#ifdef VBGL_VBOXGUEST
-/*******************************************************************************
-* Header Files *
-*******************************************************************************/
+
+/*********************************************************************************************************************************
+* Header Files *
+*********************************************************************************************************************************/
#define LOG_GROUP LOG_GROUP_HGCM
#include "VBGLInternal.h"
@@ -42,9 +43,10 @@
#include <iprt/thread.h>
#include <iprt/time.h>
-/*******************************************************************************
-* Defined Constants And Macros *
-*******************************************************************************/
+
+/*********************************************************************************************************************************
+* Defined Constants And Macros *
+*********************************************************************************************************************************/
/** The max parameter buffer size for a user request. */
#define VBGLR0_MAX_HGCM_USER_PARM (24*_1M)
/** The max parameter buffer size for a kernel request. */
@@ -57,9 +59,9 @@
#endif
-/*******************************************************************************
-* Structures and Typedefs *
-*******************************************************************************/
+/*********************************************************************************************************************************
+* Structures and Typedefs *
+*********************************************************************************************************************************/
/**
* Lock info structure used by VbglR0HGCMInternalCall and its helpers.
*/
diff --git a/src/VBox/Additions/common/VBoxGuestLib/Init.cpp b/src/VBox/Additions/common/VBoxGuestLib/Init.cpp
index ec899da..44b7940 100644
--- a/src/VBox/Additions/common/VBoxGuestLib/Init.cpp
+++ b/src/VBox/Additions/common/VBoxGuestLib/Init.cpp
@@ -24,9 +24,10 @@
* terms and conditions of either the GPL or the CDDL or both.
*/
-/*******************************************************************************
-* Header Files *
-*******************************************************************************/
+
+/*********************************************************************************************************************************
+* Header Files *
+*********************************************************************************************************************************/
#define VBGL_DECL_DATA
#include "VBGLInternal.h"
@@ -34,9 +35,10 @@
#include <iprt/assert.h>
#include <iprt/semaphore.h>
-/*******************************************************************************
-* Global Variables *
-*******************************************************************************/
+
+/*********************************************************************************************************************************
+* Global Variables *
+*********************************************************************************************************************************/
/** The global VBGL instance data. */
VBGLDATA g_vbgldata;
diff --git a/src/VBox/Additions/common/VBoxGuestLib/VBoxGuestR0LibSharedFolders.c b/src/VBox/Additions/common/VBoxGuestLib/VBoxGuestR0LibSharedFolders.c
index aa0883d..0fd1add 100644
--- a/src/VBox/Additions/common/VBoxGuestLib/VBoxGuestR0LibSharedFolders.c
+++ b/src/VBox/Additions/common/VBoxGuestLib/VBoxGuestR0LibSharedFolders.c
@@ -27,9 +27,10 @@
/* Entire file is ifdef'ed with !VBGL_VBOXGUEST */
#ifndef VBGL_VBOXGUEST
-/*******************************************************************************
-* Header Files *
-*******************************************************************************/
+
+/*********************************************************************************************************************************
+* Header Files *
+*********************************************************************************************************************************/
#define LOG_GROUP LOG_GROUP_SHARED_FOLDERS
#ifdef RT_OS_LINUX
# include "VBoxGuestR0LibSharedFolders.h"
@@ -43,9 +44,9 @@
#include <iprt/string.h>
-/*******************************************************************************
-* Defined Constants And Macros *
-*******************************************************************************/
+/*********************************************************************************************************************************
+* Defined Constants And Macros *
+*********************************************************************************************************************************/
#define SHFL_CPARMS_SET_UTF8 0
#define SHFL_CPARMS_SET_SYMLINKS 0
diff --git a/src/VBox/Additions/common/VBoxGuestLib/VBoxGuestR3Lib.cpp b/src/VBox/Additions/common/VBoxGuestLib/VBoxGuestR3Lib.cpp
index a7fd3f0..ff0b1ee 100644
--- a/src/VBox/Additions/common/VBoxGuestLib/VBoxGuestR3Lib.cpp
+++ b/src/VBox/Additions/common/VBoxGuestLib/VBoxGuestR3Lib.cpp
@@ -25,9 +25,9 @@
*/
-/*******************************************************************************
-* Header Files *
-*******************************************************************************/
+/*********************************************************************************************************************************
+* Header Files *
+*********************************************************************************************************************************/
#if defined(RT_OS_WINDOWS)
# include <Windows.h>
@@ -85,9 +85,9 @@ extern "C" int xf86ioctl(int, unsigned long, pointer);
#endif
-/*******************************************************************************
-* Global Variables *
-*******************************************************************************/
+/*********************************************************************************************************************************
+* Global Variables *
+*********************************************************************************************************************************/
/** The VBoxGuest device handle. */
#ifdef VBOX_VBGLR3_XSERVER
static int g_File = -1;
diff --git a/src/VBox/Additions/common/VBoxGuestLib/VBoxGuestR3LibAdditions.cpp b/src/VBox/Additions/common/VBoxGuestLib/VBoxGuestR3LibAdditions.cpp
index 0063620..106df03 100644
--- a/src/VBox/Additions/common/VBoxGuestLib/VBoxGuestR3LibAdditions.cpp
+++ b/src/VBox/Additions/common/VBoxGuestLib/VBoxGuestR3LibAdditions.cpp
@@ -25,9 +25,9 @@
*/
-/*******************************************************************************
-* Header Files *
-*******************************************************************************/
+/*********************************************************************************************************************************
+* Header Files *
+*********************************************************************************************************************************/
#include <iprt/mem.h>
#include <iprt/string.h>
#include <VBox/log.h>
diff --git a/src/VBox/Additions/common/VBoxGuestLib/VBoxGuestR3LibAutoLogon.cpp b/src/VBox/Additions/common/VBoxGuestLib/VBoxGuestR3LibAutoLogon.cpp
index a5aa4fb..50a365f 100644
--- a/src/VBox/Additions/common/VBoxGuestLib/VBoxGuestR3LibAutoLogon.cpp
+++ b/src/VBox/Additions/common/VBoxGuestLib/VBoxGuestR3LibAutoLogon.cpp
@@ -26,9 +26,9 @@
*/
-/*******************************************************************************
-* Header Files *
-*******************************************************************************/
+/*********************************************************************************************************************************
+* Header Files *
+*********************************************************************************************************************************/
#ifdef RT_OS_WINDOWS
# include <Windows.h>
#endif
diff --git a/src/VBox/Additions/common/VBoxGuestLib/VBoxGuestR3LibBalloon.cpp b/src/VBox/Additions/common/VBoxGuestLib/VBoxGuestR3LibBalloon.cpp
index d2f319d..36f4d53 100644
--- a/src/VBox/Additions/common/VBoxGuestLib/VBoxGuestR3LibBalloon.cpp
+++ b/src/VBox/Additions/common/VBoxGuestLib/VBoxGuestR3LibBalloon.cpp
@@ -25,9 +25,9 @@
*/
-/*******************************************************************************
-* Header Files *
-*******************************************************************************/
+/*********************************************************************************************************************************
+* Header Files *
+*********************************************************************************************************************************/
#include "VBGLR3Internal.h"
diff --git a/src/VBox/Additions/common/VBoxGuestLib/VBoxGuestR3LibClipboard.cpp b/src/VBox/Additions/common/VBoxGuestLib/VBoxGuestR3LibClipboard.cpp
index c8ff48c..49ecad6 100644
--- a/src/VBox/Additions/common/VBoxGuestLib/VBoxGuestR3LibClipboard.cpp
+++ b/src/VBox/Additions/common/VBoxGuestLib/VBoxGuestR3LibClipboard.cpp
@@ -25,9 +25,9 @@
*/
-/*******************************************************************************
-* Header Files *
-*******************************************************************************/
+/*********************************************************************************************************************************
+* Header Files *
+*********************************************************************************************************************************/
#include <VBox/HostServices/VBoxClipboardSvc.h>
#include <iprt/assert.h>
#include <iprt/string.h>
diff --git a/src/VBox/Additions/common/VBoxGuestLib/VBoxGuestR3LibCoreDump.cpp b/src/VBox/Additions/common/VBoxGuestLib/VBoxGuestR3LibCoreDump.cpp
index acad143..b38bf97 100644
--- a/src/VBox/Additions/common/VBoxGuestLib/VBoxGuestR3LibCoreDump.cpp
+++ b/src/VBox/Additions/common/VBoxGuestLib/VBoxGuestR3LibCoreDump.cpp
@@ -25,9 +25,9 @@
*/
-/*******************************************************************************
-* Header Files *
-*******************************************************************************/
+/*********************************************************************************************************************************
+* Header Files *
+*********************************************************************************************************************************/
#include "VBGLR3Internal.h"
diff --git a/src/VBox/Additions/common/VBoxGuestLib/VBoxGuestR3LibCpuHotPlug.cpp b/src/VBox/Additions/common/VBoxGuestLib/VBoxGuestR3LibCpuHotPlug.cpp
index 8bc82d4..f0ba32e 100644
--- a/src/VBox/Additions/common/VBoxGuestLib/VBoxGuestR3LibCpuHotPlug.cpp
+++ b/src/VBox/Additions/common/VBoxGuestLib/VBoxGuestR3LibCpuHotPlug.cpp
@@ -25,9 +25,9 @@
*/
-/*******************************************************************************
-* Header Files *
-*******************************************************************************/
+/*********************************************************************************************************************************
+* Header Files *
+*********************************************************************************************************************************/
#include "VBGLR3Internal.h"
diff --git a/src/VBox/Additions/common/VBoxGuestLib/VBoxGuestR3LibCredentials.cpp b/src/VBox/Additions/common/VBoxGuestLib/VBoxGuestR3LibCredentials.cpp
index 6e6f386..b229093 100644
--- a/src/VBox/Additions/common/VBoxGuestLib/VBoxGuestR3LibCredentials.cpp
+++ b/src/VBox/Additions/common/VBoxGuestLib/VBoxGuestR3LibCredentials.cpp
@@ -25,9 +25,9 @@
*/
-/*******************************************************************************
-* Header Files *
-*******************************************************************************/
+/*********************************************************************************************************************************
+* Header Files *
+*********************************************************************************************************************************/
#include <iprt/asm.h>
#include <iprt/mem.h>
#include <iprt/rand.h>
diff --git a/src/VBox/Additions/common/VBoxGuestLib/VBoxGuestR3LibDaemonize.cpp b/src/VBox/Additions/common/VBoxGuestLib/VBoxGuestR3LibDaemonize.cpp
index 3a90243..12ed1d0 100644
--- a/src/VBox/Additions/common/VBoxGuestLib/VBoxGuestR3LibDaemonize.cpp
+++ b/src/VBox/Additions/common/VBoxGuestLib/VBoxGuestR3LibDaemonize.cpp
@@ -25,9 +25,9 @@
*/
-/*******************************************************************************
-* Header Files *
-*******************************************************************************/
+/*********************************************************************************************************************************
+* Header Files *
+*********************************************************************************************************************************/
#if defined(RT_OS_OS2)
# define INCL_BASE
# define INCL_ERRORS
diff --git a/src/VBox/Additions/common/VBoxGuestLib/VBoxGuestR3LibDragAndDrop.cpp b/src/VBox/Additions/common/VBoxGuestLib/VBoxGuestR3LibDragAndDrop.cpp
index b48933f..2dd30f6 100644
--- a/src/VBox/Additions/common/VBoxGuestLib/VBoxGuestR3LibDragAndDrop.cpp
+++ b/src/VBox/Additions/common/VBoxGuestLib/VBoxGuestR3LibDragAndDrop.cpp
@@ -25,9 +25,9 @@
*/
-/*******************************************************************************
-* Header Files *
-*******************************************************************************/
+/*********************************************************************************************************************************
+* Header Files *
+*********************************************************************************************************************************/
#include <iprt/path.h>
#include <iprt/dir.h>
#include <iprt/file.h>
@@ -59,9 +59,10 @@
* better done on the host side)
*/
-/******************************************************************************
- * Private internal functions *
- ******************************************************************************/
+
+/*********************************************************************************************************************************
+* Private internal functions *
+*********************************************************************************************************************************/
static int vbglR3DnDQueryNextHostMessageType(PVBGLR3GUESTDNDCMDCTX pCtx, uint32_t *puMsg, uint32_t *pcParms, bool fWait)
{
@@ -412,7 +413,12 @@ static int vbglR3DnDHGProcessURIMessages(PVBGLR3GUESTDNDCMDCTX pCtx,
char *pszPathAbs = RTPathJoinA(pszDropDir, szPathName);
if (pszPathAbs)
{
- rc = RTDirCreate(pszPathAbs, (fMode & RTFS_UNIX_MASK) | RTFS_UNIX_IRWXU, 0);
+#ifdef RT_OS_WINDOWS
+ uint32_t fCreationMode = (fMode & RTFS_DOS_MASK) | RTFS_DOS_NT_NORMAL;
+#else
+ uint32_t fCreationMode = (fMode & RTFS_UNIX_MASK) | RTFS_UNIX_IRWXU;
+#endif
+ rc = RTDirCreate(pszPathAbs, fCreationMode, 0);
if (RT_SUCCESS(rc))
rc = DnDDirDroppedAddDir(&dirDroppedFiles, pszPathAbs);
@@ -453,7 +459,7 @@ static int vbglR3DnDHGProcessURIMessages(PVBGLR3GUESTDNDCMDCTX pCtx,
if ( RT_SUCCESS(rc)
&& ( uNextMsg == DragAndDropSvc::HOST_DND_HG_SND_FILE_HDR
- /* Protocol v1 always sends the file name, so try opening every time. */
+ /* Protocol v1 always sends the file name, so opening the file every time. */
|| pCtx->uProtocol <= 1)
)
{
@@ -463,7 +469,7 @@ static int vbglR3DnDHGProcessURIMessages(PVBGLR3GUESTDNDCMDCTX pCtx,
LogFlowFunc(("Opening pszPathName=%s, cbPathName=%RU32, fMode=0x%x, cbFileSize=%zu\n",
szPathName, cbPathName, fMode, cbFileSize));
- uint64_t fOpen = RTFILE_O_WRITE | RTFILE_O_DENY_ALL;
+ uint64_t fOpen = RTFILE_O_WRITE | RTFILE_O_DENY_WRITE;
if (pCtx->uProtocol <= 1)
fOpen |= RTFILE_O_OPEN_CREATE | RTFILE_O_APPEND;
else
@@ -473,8 +479,12 @@ static int vbglR3DnDHGProcessURIMessages(PVBGLR3GUESTDNDCMDCTX pCtx,
if (!objFile.IsOpen())
{
RTCString strPathAbs(pszPathAbs);
- rc = objFile.OpenEx(strPathAbs, DnDURIObject::File, DnDURIObject::Target, fOpen,
- (fMode & RTFS_UNIX_MASK) | RTFS_UNIX_IRUSR | RTFS_UNIX_IWUSR);
+#ifdef RT_OS_WINDOWS
+ uint32_t fCreationMode = (fMode & RTFS_DOS_MASK) | RTFS_DOS_NT_NORMAL;
+#else
+ uint32_t fCreationMode = (fMode & RTFS_UNIX_MASK) | RTFS_UNIX_IRUSR | RTFS_UNIX_IWUSR;
+#endif
+ rc = objFile.OpenEx(strPathAbs, DnDURIObject::File, DnDURIObject::Target, fOpen, fCreationMode);
if (RT_SUCCESS(rc))
{
rc = DnDDirDroppedAddFile(&dirDroppedFiles, strPathAbs.c_str());
@@ -898,9 +908,10 @@ static int vbglR3DnDGHProcessDroppedMessage(PVBGLR3GUESTDNDCMDCTX pCtx,
return rc;
}
-/******************************************************************************
- * Public functions *
- ******************************************************************************/
+
+/*********************************************************************************************************************************
+* Public functions *
+*********************************************************************************************************************************/
VBGLR3DECL(int) VbglR3DnDConnect(PVBGLR3GUESTDNDCMDCTX pCtx)
{
@@ -924,11 +935,14 @@ VBGLR3DECL(int) VbglR3DnDConnect(PVBGLR3GUESTDNDCMDCTX pCtx)
if (rc == VERR_HGCM_SERVICE_NOT_FOUND)
rc = VINF_PERMISSION_DENIED;
- /* Set the protocol version to use. */
- pCtx->uProtocol = 2;
+ if (RT_SUCCESS(rc))
+ {
+ /* Set the protocol version to use. */
+ pCtx->uProtocol = 2;
- Assert(Info.u32ClientID);
- pCtx->uClientID = Info.u32ClientID;
+ Assert(Info.u32ClientID);
+ pCtx->uClientID = Info.u32ClientID;
+ }
}
if (RT_SUCCESS(rc))
@@ -938,7 +952,7 @@ VBGLR3DECL(int) VbglR3DnDConnect(PVBGLR3GUESTDNDCMDCTX pCtx)
* Note: This might fail when the Guest Additions run on an older VBox host (< VBox 5.0) which
* does not implement this command.
*/
- DragAndDropSvc::VBOXDNDCONNECTPMSG Msg;
+ DragAndDropSvc::VBOXDNDCONNECTMSG Msg;
RT_ZERO(Msg);
Msg.hdr.result = VERR_WRONG_ORDER;
Msg.hdr.u32ClientID = pCtx->uClientID;
@@ -1139,12 +1153,13 @@ VBGLR3DECL(int) VbglR3DnDHGRequestData(PVBGLR3GUESTDNDCMDCTX pCtx, const char* p
VBGLR3DECL(int) VbglR3DnDHGSetProgress(PVBGLR3GUESTDNDCMDCTX pCtx, uint32_t uStatus, uint8_t uPercent, int rcErr)
{
AssertPtrReturn(pCtx, VERR_INVALID_POINTER);
+ AssertReturn(uStatus > DragAndDropSvc::DND_PROGRESS_UNKNOWN, VERR_INVALID_PARAMETER);
DragAndDropSvc::VBOXDNDHGEVTPROGRESSMSG Msg;
RT_ZERO(Msg);
Msg.hdr.result = VERR_WRONG_ORDER;
Msg.hdr.u32ClientID = pCtx->uClientID;
- Msg.hdr.u32Function = DragAndDropSvc::GUEST_DND_HG_EVT_PROGRESS;
+ Msg.hdr.u32Function = uStatus;
Msg.hdr.cParms = 3;
Msg.uStatus.SetUInt32(uStatus);
diff --git a/src/VBox/Additions/common/VBoxGuestLib/VBoxGuestR3LibEvent.cpp b/src/VBox/Additions/common/VBoxGuestLib/VBoxGuestR3LibEvent.cpp
index fa994f2..3c984b7 100644
--- a/src/VBox/Additions/common/VBoxGuestLib/VBoxGuestR3LibEvent.cpp
+++ b/src/VBox/Additions/common/VBoxGuestLib/VBoxGuestR3LibEvent.cpp
@@ -25,9 +25,9 @@
*/
-/*******************************************************************************
-* Header Files *
-*******************************************************************************/
+/*********************************************************************************************************************************
+* Header Files *
+*********************************************************************************************************************************/
#include <VBox/log.h>
#include "VBGLR3Internal.h"
diff --git a/src/VBox/Additions/common/VBoxGuestLib/VBoxGuestR3LibGR.cpp b/src/VBox/Additions/common/VBoxGuestLib/VBoxGuestR3LibGR.cpp
index 81a0f32..56ad686 100644
--- a/src/VBox/Additions/common/VBoxGuestLib/VBoxGuestR3LibGR.cpp
+++ b/src/VBox/Additions/common/VBoxGuestLib/VBoxGuestR3LibGR.cpp
@@ -25,9 +25,9 @@
*/
-/*******************************************************************************
-* Header Files *
-*******************************************************************************/
+/*********************************************************************************************************************************
+* Header Files *
+*********************************************************************************************************************************/
#include <iprt/mem.h>
#include <iprt/assert.h>
#include <iprt/string.h>
@@ -60,7 +60,7 @@ int vbglR3GRAlloc(VMMDevRequestHeader **ppReq, uint32_t cb, VMMDevRequestType en
}
-VBGLR3DECL(int) vbglR3GRPerform(VMMDevRequestHeader *pReq)
+int vbglR3GRPerform(VMMDevRequestHeader *pReq)
{
return vbglR3DoIOCtl(VBOXGUEST_IOCTL_VMMREQUEST(pReq->size), pReq, pReq->size);
}
diff --git a/src/VBox/Additions/common/VBoxGuestLib/VBoxGuestR3LibGuestCtrl.cpp b/src/VBox/Additions/common/VBoxGuestLib/VBoxGuestR3LibGuestCtrl.cpp
index 41f0a5d..21ca809 100644
--- a/src/VBox/Additions/common/VBoxGuestLib/VBoxGuestR3LibGuestCtrl.cpp
+++ b/src/VBox/Additions/common/VBoxGuestLib/VBoxGuestR3LibGuestCtrl.cpp
@@ -25,9 +25,9 @@
*/
-/*******************************************************************************
-* Header Files *
-*******************************************************************************/
+/*********************************************************************************************************************************
+* Header Files *
+*********************************************************************************************************************************/
#include <iprt/string.h>
#include <iprt/mem.h>
#include <iprt/assert.h>
@@ -39,9 +39,9 @@
#include "VBGLR3Internal.h"
-/*******************************************************************************
-* Structures and Typedefs *
-*******************************************************************************/
+/*********************************************************************************************************************************
+* Structures and Typedefs *
+*********************************************************************************************************************************/
using namespace guestControl;
diff --git a/src/VBox/Additions/common/VBoxGuestLib/VBoxGuestR3LibGuestProp.cpp b/src/VBox/Additions/common/VBoxGuestLib/VBoxGuestR3LibGuestProp.cpp
index 5cf00d6..93e0fcd 100644
--- a/src/VBox/Additions/common/VBoxGuestLib/VBoxGuestR3LibGuestProp.cpp
+++ b/src/VBox/Additions/common/VBoxGuestLib/VBoxGuestR3LibGuestProp.cpp
@@ -28,12 +28,13 @@
# define VBOX_VBGLR3_XSERVER
#endif
-/*******************************************************************************
-* Header Files *
-*******************************************************************************/
+
+/*********************************************************************************************************************************
+* Header Files *
+*********************************************************************************************************************************/
#include <iprt/string.h>
#ifndef VBOX_VBGLR3_XSERVER
-# include <iprt/cpp/mem.h>
+# include <iprt/mem.h>
#endif
#include <iprt/assert.h>
#include <iprt/stdarg.h>
@@ -59,7 +60,7 @@ extern "C" void* xf86memset(const void*,int,xf86size_t);
#ifdef VBOX_VBGLR3_XSERVER
-# undef RTSTrEnd
+# undef RTStrEnd
# define RTStrEnd xf86RTStrEnd
DECLINLINE(char const *) RTStrEnd(char const *pszString, size_t cchMax)
@@ -94,9 +95,10 @@ DECLINLINE(char *) RTStrEnd(char *pszString, size_t cchMax)
#endif /* VBOX_VBGLR3_XSERVER */
-/*******************************************************************************
-* Structures and Typedefs *
-*******************************************************************************/
+
+/*********************************************************************************************************************************
+* Structures and Typedefs *
+*********************************************************************************************************************************/
/**
* Structure containing information needed to enumerate through guest
* properties.
@@ -577,6 +579,7 @@ VBGLR3DECL(int) VbglR3GuestPropEnumRaw(uint32_t u32ClientId,
/**
* Start enumerating guest properties which match a given pattern.
+ *
* This function creates a handle which can be used to continue enumerating.
*
* @returns VBox status code.
@@ -597,18 +600,18 @@ VBGLR3DECL(int) VbglR3GuestPropEnumRaw(uint32_t u32ClientId,
* @param ppHandle where the handle for continued enumeration is stored
* on success. This must be freed with
* VbglR3GuestPropEnumFree when it is no longer needed.
- * @param ppszName Where to store the next property name. This will be
- * set to NULL if there are no more properties to
- * enumerate. This pointer should not be freed. Optional.
- * @param ppszValue Where to store the next property value. This will be
- * set to NULL if there are no more properties to
- * enumerate. This pointer should not be freed. Optional.
- * @param pu64Timestamp Where to store the next property timestamp. This
- * will be set to zero if there are no more properties
- * to enumerate. Optional.
- * @param ppszFlags Where to store the next property flags. This will be
- * set to NULL if there are no more properties to
- * enumerate. This pointer should not be freed. Optional.
+ * @param ppszName Where to store the next property name. This will be
+ * set to NULL if there are no more properties to
+ * enumerate. This pointer should not be freed. Optional.
+ * @param ppszValue Where to store the next property value. This will be
+ * set to NULL if there are no more properties to
+ * enumerate. This pointer should not be freed. Optional.
+ * @param pu64Timestamp Where to store the next property timestamp. This
+ * will be set to zero if there are no more properties
+ * to enumerate. Optional.
+ * @param ppszFlags Where to store the next property flags. This will be
+ * set to NULL if there are no more properties to
+ * enumerate. This pointer should not be freed. Optional.
*
* @remarks While all output parameters are optional, you need at least one to
* figure out when to stop.
@@ -623,68 +626,72 @@ VBGLR3DECL(int) VbglR3GuestPropEnum(uint32_t u32ClientId,
char const **ppszFlags)
{
/* Create the handle. */
- RTCMemAutoPtr<VBGLR3GUESTPROPENUM, VbglR3GuestPropEnumFree> Handle;
- Handle = (PVBGLR3GUESTPROPENUM)RTMemAllocZ(sizeof(VBGLR3GUESTPROPENUM));
- if (!Handle)
+ PVBGLR3GUESTPROPENUM pHandle = (PVBGLR3GUESTPROPENUM)RTMemAllocZ(sizeof(VBGLR3GUESTPROPENUM));
+ if (RT_LIKELY(pHandle))
+ {/* likely */}
+ else
return VERR_NO_MEMORY;
/* Get the length of the pattern string, including the final terminator. */
- size_t cchPatterns = 1;
+ size_t cbPatterns = 1;
for (uint32_t i = 0; i < cPatterns; ++i)
- cchPatterns += strlen(papszPatterns[i]) + 1;
+ cbPatterns += strlen(papszPatterns[i]) + 1;
- /* Pack the pattern array */
- RTCMemAutoPtr<char> Patterns;
- Patterns = (char *)RTMemAlloc(cchPatterns);
+ /* Pack the pattern array. */
+ char *pszzPatterns = (char *)RTMemAlloc(cbPatterns);
size_t off = 0;
for (uint32_t i = 0; i < cPatterns; ++i)
{
size_t cb = strlen(papszPatterns[i]) + 1;
- memcpy(&Patterns[off], papszPatterns[i], cb);
+ memcpy(&pszzPatterns[off], papszPatterns[i], cb);
off += cb;
}
- Patterns[off] = '\0';
-
- /* Randomly chosen initial size for the buffer to hold the enumeration
- * information. */
- uint32_t cchBuf = 4096;
- RTCMemAutoPtr<char> Buf;
+ pszzPatterns[off] = '\0';
/* In reading the guest property data we are racing against the host
* adding more of it, so loop a few times and retry on overflow. */
- int rc = VINF_SUCCESS;
+ uint32_t cbBuf = 4096; /* picked out of thin air */
+ char *pchBuf = NULL;
+ int rc = VINF_SUCCESS;
for (int i = 0; i < 10; ++i)
{
- if (!Buf.realloc(cchBuf))
+ void *pvNew = RTMemRealloc(pchBuf, cbBuf);
+ if (pvNew)
+ pchBuf = (char *)pvNew;
+ else
{
rc = VERR_NO_MEMORY;
break;
}
- rc = VbglR3GuestPropEnumRaw(u32ClientId, Patterns.get(),
- Buf.get(), cchBuf, &cchBuf);
+ rc = VbglR3GuestPropEnumRaw(u32ClientId, pszzPatterns, pchBuf, cbBuf, &cbBuf);
if (rc != VERR_BUFFER_OVERFLOW)
break;
- cchBuf += 4096; /* Just to increase our chances */
+ cbBuf += 4096; /* Just to increase our chances */
}
+ RTMemFree(pszzPatterns);
if (RT_SUCCESS(rc))
{
/*
- * Transfer ownership of the buffer to the handle structure and
- * call VbglR3GuestPropEnumNext to retrieve the first entry.
+ * Complete the handle and call VbglR3GuestPropEnumNext to retrieve the first entry.
*/
- Handle->pchNext = Handle->pchBuf = Buf.release();
- Handle->pchBufEnd = Handle->pchBuf + cchBuf;
+ pHandle->pchNext = pchBuf;
+ pHandle->pchBuf = pchBuf;
+ pHandle->pchBufEnd = pchBuf + cbBuf;
const char *pszNameTmp;
if (!ppszName)
ppszName = &pszNameTmp;
- rc = VbglR3GuestPropEnumNext(Handle.get(), ppszName, ppszValue,
- pu64Timestamp, ppszFlags);
+ rc = VbglR3GuestPropEnumNext(pHandle, ppszName, ppszValue, pu64Timestamp, ppszFlags);
if (RT_SUCCESS(rc))
- *ppHandle = Handle.release();
+ {
+ *ppHandle = pHandle;
+ return rc;
+ }
}
else if (rc == VERR_BUFFER_OVERFLOW)
rc = VERR_TOO_MUCH_DATA;
+ RTMemFree(pchBuf);
+ RTMemFree(pHandle);
return rc;
}
diff --git a/src/VBox/Additions/common/VBoxGuestLib/VBoxGuestR3LibGuestUser.cpp b/src/VBox/Additions/common/VBoxGuestLib/VBoxGuestR3LibGuestUser.cpp
index 95f4d00..3fac75a 100644
--- a/src/VBox/Additions/common/VBoxGuestLib/VBoxGuestR3LibGuestUser.cpp
+++ b/src/VBox/Additions/common/VBoxGuestLib/VBoxGuestR3LibGuestUser.cpp
@@ -26,9 +26,9 @@
*/
-/*******************************************************************************
-* Header Files *
-*******************************************************************************/
+/*********************************************************************************************************************************
+* Header Files *
+*********************************************************************************************************************************/
#include <iprt/assert.h>
#include <VBox/log.h>
#include <iprt/mem.h>
diff --git a/src/VBox/Additions/common/VBoxGuestLib/VBoxGuestR3LibHostVersion.cpp b/src/VBox/Additions/common/VBoxGuestLib/VBoxGuestR3LibHostVersion.cpp
index 57e2dee..f47fe93 100644
--- a/src/VBox/Additions/common/VBoxGuestLib/VBoxGuestR3LibHostVersion.cpp
+++ b/src/VBox/Additions/common/VBoxGuestLib/VBoxGuestR3LibHostVersion.cpp
@@ -25,9 +25,9 @@
*/
-/*******************************************************************************
-* Header Files *
-*******************************************************************************/
+/*********************************************************************************************************************************
+* Header Files *
+*********************************************************************************************************************************/
#include <stdio.h> /* Required for sscanf */
#include <iprt/string.h>
#include <VBox/log.h>
diff --git a/src/VBox/Additions/common/VBoxGuestLib/VBoxGuestR3LibLog.cpp b/src/VBox/Additions/common/VBoxGuestLib/VBoxGuestR3LibLog.cpp
index 01a37ad..0e045f6 100644
--- a/src/VBox/Additions/common/VBoxGuestLib/VBoxGuestR3LibLog.cpp
+++ b/src/VBox/Additions/common/VBoxGuestLib/VBoxGuestR3LibLog.cpp
@@ -25,9 +25,9 @@
*/
-/*******************************************************************************
-* Header Files *
-*******************************************************************************/
+/*********************************************************************************************************************************
+* Header Files *
+*********************************************************************************************************************************/
#include <iprt/mem.h>
#include "VBGLR3Internal.h"
diff --git a/src/VBox/Additions/common/VBoxGuestLib/VBoxGuestR3LibMisc.cpp b/src/VBox/Additions/common/VBoxGuestLib/VBoxGuestR3LibMisc.cpp
index 8b6c35d..0dd7513 100644
--- a/src/VBox/Additions/common/VBoxGuestLib/VBoxGuestR3LibMisc.cpp
+++ b/src/VBox/Additions/common/VBoxGuestLib/VBoxGuestR3LibMisc.cpp
@@ -25,9 +25,9 @@
*/
-/*******************************************************************************
-* Header Files *
-*******************************************************************************/
+/*********************************************************************************************************************************
+* Header Files *
+*********************************************************************************************************************************/
#include <VBox/log.h>
#include "VBGLR3Internal.h"
diff --git a/src/VBox/Additions/common/VBoxGuestLib/VBoxGuestR3LibModule.cpp b/src/VBox/Additions/common/VBoxGuestLib/VBoxGuestR3LibModule.cpp
index 789c697..3e45a89 100644
--- a/src/VBox/Additions/common/VBoxGuestLib/VBoxGuestR3LibModule.cpp
+++ b/src/VBox/Additions/common/VBoxGuestLib/VBoxGuestR3LibModule.cpp
@@ -25,9 +25,9 @@
*/
-/*******************************************************************************
-* Header Files *
-*******************************************************************************/
+/*********************************************************************************************************************************
+* Header Files *
+*********************************************************************************************************************************/
#include "VBGLR3Internal.h"
#include <iprt/mem.h>
#include <iprt/string.h>
diff --git a/src/VBox/Additions/common/VBoxGuestLib/VBoxGuestR3LibMouse.cpp b/src/VBox/Additions/common/VBoxGuestLib/VBoxGuestR3LibMouse.cpp
index 638df50..f1f99fc 100644
--- a/src/VBox/Additions/common/VBoxGuestLib/VBoxGuestR3LibMouse.cpp
+++ b/src/VBox/Additions/common/VBoxGuestLib/VBoxGuestR3LibMouse.cpp
@@ -25,9 +25,9 @@
*/
-/*******************************************************************************
-* Header Files *
-*******************************************************************************/
+/*********************************************************************************************************************************
+* Header Files *
+*********************************************************************************************************************************/
#include "VBGLR3Internal.h"
diff --git a/src/VBox/Additions/common/VBoxGuestLib/VBoxGuestR3LibRuntimeXF86.cpp b/src/VBox/Additions/common/VBoxGuestLib/VBoxGuestR3LibRuntimeXF86.cpp
index b583df1..7279678 100644
--- a/src/VBox/Additions/common/VBoxGuestLib/VBoxGuestR3LibRuntimeXF86.cpp
+++ b/src/VBox/Additions/common/VBoxGuestLib/VBoxGuestR3LibRuntimeXF86.cpp
@@ -27,9 +27,9 @@
*/
-/****************************************************************************
-* Header Files *
-****************************************************************************/
+/*********************************************************************************************************************************
+* Header Files *
+*********************************************************************************************************************************/
#include <iprt/assert.h>
#include <iprt/log.h>
#include <iprt/mem.h>
diff --git a/src/VBox/Additions/common/VBoxGuestLib/VBoxGuestR3LibSeamless.cpp b/src/VBox/Additions/common/VBoxGuestLib/VBoxGuestR3LibSeamless.cpp
index eb3abfa..e46edbf 100644
--- a/src/VBox/Additions/common/VBoxGuestLib/VBoxGuestR3LibSeamless.cpp
+++ b/src/VBox/Additions/common/VBoxGuestLib/VBoxGuestR3LibSeamless.cpp
@@ -25,9 +25,9 @@
*/
-/*******************************************************************************
-* Header Files *
-*******************************************************************************/
+/*********************************************************************************************************************************
+* Header Files *
+*********************************************************************************************************************************/
#include <iprt/assert.h>
#include <iprt/string.h>
diff --git a/src/VBox/Additions/common/VBoxGuestLib/VBoxGuestR3LibSharedFolders.cpp b/src/VBox/Additions/common/VBoxGuestLib/VBoxGuestR3LibSharedFolders.cpp
index 946c32f..b41ee86 100644
--- a/src/VBox/Additions/common/VBoxGuestLib/VBoxGuestR3LibSharedFolders.cpp
+++ b/src/VBox/Additions/common/VBoxGuestLib/VBoxGuestR3LibSharedFolders.cpp
@@ -25,9 +25,9 @@
*/
-/*******************************************************************************
-* Header Files *
-*******************************************************************************/
+/*********************************************************************************************************************************
+* Header Files *
+*********************************************************************************************************************************/
#include <iprt/string.h>
#include <iprt/mem.h>
#include <iprt/assert.h>
diff --git a/src/VBox/Additions/common/VBoxGuestLib/VBoxGuestR3LibStat.cpp b/src/VBox/Additions/common/VBoxGuestLib/VBoxGuestR3LibStat.cpp
index ca708a2..ae5f138 100644
--- a/src/VBox/Additions/common/VBoxGuestLib/VBoxGuestR3LibStat.cpp
+++ b/src/VBox/Additions/common/VBoxGuestLib/VBoxGuestR3LibStat.cpp
@@ -25,9 +25,9 @@
*/
-/*******************************************************************************
-* Header Files *
-*******************************************************************************/
+/*********************************************************************************************************************************
+* Header Files *
+*********************************************************************************************************************************/
#include "VBGLR3Internal.h"
diff --git a/src/VBox/Additions/common/VBoxGuestLib/VBoxGuestR3LibTime.cpp b/src/VBox/Additions/common/VBoxGuestLib/VBoxGuestR3LibTime.cpp
index bef286b..d752f5f 100644
--- a/src/VBox/Additions/common/VBoxGuestLib/VBoxGuestR3LibTime.cpp
+++ b/src/VBox/Additions/common/VBoxGuestLib/VBoxGuestR3LibTime.cpp
@@ -25,9 +25,9 @@
*/
-/*******************************************************************************
-* Header Files *
-*******************************************************************************/
+/*********************************************************************************************************************************
+* Header Files *
+*********************************************************************************************************************************/
#include <iprt/time.h>
#include "VBGLR3Internal.h"
diff --git a/src/VBox/Additions/common/VBoxGuestLib/VBoxGuestR3LibVideo.cpp b/src/VBox/Additions/common/VBoxGuestLib/VBoxGuestR3LibVideo.cpp
index 36e808e..2caaf62 100644
--- a/src/VBox/Additions/common/VBoxGuestLib/VBoxGuestR3LibVideo.cpp
+++ b/src/VBox/Additions/common/VBoxGuestLib/VBoxGuestR3LibVideo.cpp
@@ -25,9 +25,9 @@
*/
-/*******************************************************************************
-* Header Files *
-*******************************************************************************/
+/*********************************************************************************************************************************
+* Header Files *
+*********************************************************************************************************************************/
#include "VBGLR3Internal.h"
#include <VBox/log.h>
diff --git a/src/VBox/Additions/common/VBoxService/VBoxService-win.cpp b/src/VBox/Additions/common/VBoxService/VBoxService-win.cpp
index 00553a3..7fa8654 100644
--- a/src/VBox/Additions/common/VBoxService/VBoxService-win.cpp
+++ b/src/VBox/Additions/common/VBoxService/VBoxService-win.cpp
@@ -16,9 +16,9 @@
*/
-/*******************************************************************************
-* Header Files *
-*******************************************************************************/
+/*********************************************************************************************************************************
+* Header Files *
+*********************************************************************************************************************************/
#include <iprt/assert.h>
#include <iprt/err.h>
#include <iprt/system.h> /* For querying OS version. */
@@ -30,15 +30,15 @@
#include <aclapi.h>
-/*******************************************************************************
-* Internal Functions *
-*******************************************************************************/
+/*********************************************************************************************************************************
+* Internal Functions *
+*********************************************************************************************************************************/
static void WINAPI vboxServiceWinMain(DWORD argc, LPTSTR *argv);
-/*******************************************************************************
-* Global Variables *
-*******************************************************************************/
+/*********************************************************************************************************************************
+* Global Variables *
+*********************************************************************************************************************************/
static DWORD g_dwWinServiceLastStatus = 0;
SERVICE_STATUS_HANDLE g_hWinServiceStatus = NULL;
/** The semaphore for the dummy Windows service. */
diff --git a/src/VBox/Additions/common/VBoxService/VBoxService.cpp b/src/VBox/Additions/common/VBoxService/VBoxService.cpp
index a2b536d..cd410b2 100644
--- a/src/VBox/Additions/common/VBoxService/VBoxService.cpp
+++ b/src/VBox/Additions/common/VBoxService/VBoxService.cpp
@@ -17,9 +17,9 @@
-/*******************************************************************************
-* Header Files *
-*******************************************************************************/
+/*********************************************************************************************************************************
+* Header Files *
+*********************************************************************************************************************************/
/** @todo LOG_GROUP*/
#ifndef _MSC_VER
# include <unistd.h>
@@ -62,9 +62,9 @@
#endif
-/*******************************************************************************
-* Global Variables *
-*******************************************************************************/
+/*********************************************************************************************************************************
+* Global Variables *
+*********************************************************************************************************************************/
/** The program name (derived from argv[0]). */
char *g_pszProgName = (char *)"";
/** The current verbosity level. */
@@ -179,7 +179,7 @@ DECLCALLBACK(void) VBoxServiceDefaultTerm(void)
* @param enmPhase
* @param pfnLog
*/
-static void VBoxServiceLogHeaderFooter(PRTLOGGER pLoggerRelease, RTLOGPHASE enmPhase, PFNRTLOGPHASEMSG pfnLog)
+static DECLCALLBACK(void) VBoxServiceLogHeaderFooter(PRTLOGGER pLoggerRelease, RTLOGPHASE enmPhase, PFNRTLOGPHASEMSG pfnLog)
{
/* Some introductory information. */
static RTTIMESPEC s_TimeSpec;
diff --git a/src/VBox/Additions/common/VBoxService/VBoxServiceAutoMount.cpp b/src/VBox/Additions/common/VBoxService/VBoxServiceAutoMount.cpp
index d9be3e0..82920be 100644
--- a/src/VBox/Additions/common/VBoxService/VBoxServiceAutoMount.cpp
+++ b/src/VBox/Additions/common/VBoxService/VBoxServiceAutoMount.cpp
@@ -16,9 +16,9 @@
*/
-/*******************************************************************************
-* Header Files *
-*******************************************************************************/
+/*********************************************************************************************************************************
+* Header Files *
+*********************************************************************************************************************************/
#include <iprt/assert.h>
#include <iprt/dir.h>
#include <iprt/mem.h>
@@ -60,9 +60,10 @@ RT_C_DECLS_END
#endif
#endif
-/*******************************************************************************
-* Global Variables *
-*******************************************************************************/
+
+/*********************************************************************************************************************************
+* Global Variables *
+*********************************************************************************************************************************/
/** The semaphore we're blocking on. */
static RTSEMEVENTMULTI g_AutoMountEvent = NIL_RTSEMEVENTMULTI;
/** The Shared Folders service client ID. */
diff --git a/src/VBox/Additions/common/VBoxService/VBoxServiceBalloon.cpp b/src/VBox/Additions/common/VBoxService/VBoxServiceBalloon.cpp
index e5d6721..1ed9947 100644
--- a/src/VBox/Additions/common/VBoxService/VBoxServiceBalloon.cpp
+++ b/src/VBox/Additions/common/VBoxService/VBoxServiceBalloon.cpp
@@ -16,9 +16,9 @@
*/
-/*******************************************************************************
-* Header Files *
-*******************************************************************************/
+/*********************************************************************************************************************************
+* Header Files *
+*********************************************************************************************************************************/
#include <iprt/assert.h>
#include <iprt/mem.h>
#include <iprt/stream.h>
@@ -40,9 +40,9 @@
-/*******************************************************************************
-* Global Variables *
-*******************************************************************************/
+/*********************************************************************************************************************************
+* Global Variables *
+*********************************************************************************************************************************/
/** The balloon size. */
static uint32_t g_cMemBalloonChunks = 0;
diff --git a/src/VBox/Additions/common/VBoxService/VBoxServiceClipboard-os2.cpp b/src/VBox/Additions/common/VBoxService/VBoxServiceClipboard-os2.cpp
index 01baa0b..9be9205 100644
--- a/src/VBox/Additions/common/VBoxService/VBoxServiceClipboard-os2.cpp
+++ b/src/VBox/Additions/common/VBoxService/VBoxServiceClipboard-os2.cpp
@@ -16,9 +16,9 @@
*/
-/*******************************************************************************
-* Header Files *
-*******************************************************************************/
+/*********************************************************************************************************************************
+* Header Files *
+*********************************************************************************************************************************/
#define INCL_BASE
#define INCL_PM
#define INCL_ERRORS
@@ -37,9 +37,9 @@
#include "VBoxServiceInternal.h"
-/*******************************************************************************
-* Structures and Typedefs *
-*******************************************************************************/
+/*********************************************************************************************************************************
+* Structures and Typedefs *
+*********************************************************************************************************************************/
/** Header for Odin32 specific clipboard entries.
* (Used to get the correct size of the data.)
*/
@@ -57,9 +57,9 @@ typedef struct _Odin32ClipboardHeader
#define CLIPHEADER_MAGIC "Odin\1\0\1"
-/*******************************************************************************
-* Global Variables *
-*******************************************************************************/
+/*********************************************************************************************************************************
+* Global Variables *
+*********************************************************************************************************************************/
/** The control thread (main) handle.
* Only used to avoid some queue creation trouble. */
diff --git a/src/VBox/Additions/common/VBoxService/VBoxServiceControl.cpp b/src/VBox/Additions/common/VBoxService/VBoxServiceControl.cpp
index d6e6c8f..6f61209 100644
--- a/src/VBox/Additions/common/VBoxService/VBoxServiceControl.cpp
+++ b/src/VBox/Additions/common/VBoxService/VBoxServiceControl.cpp
@@ -16,9 +16,9 @@
*/
-/*******************************************************************************
-* Header Files *
-*******************************************************************************/
+/*********************************************************************************************************************************
+* Header Files *
+*********************************************************************************************************************************/
#include <iprt/asm.h>
#include <iprt/assert.h>
#include <iprt/env.h>
@@ -37,9 +37,10 @@
using namespace guestControl;
-/*******************************************************************************
-* Global Variables *
-*******************************************************************************/
+
+/*********************************************************************************************************************************
+* Global Variables *
+*********************************************************************************************************************************/
/** The control interval (milliseconds). */
static uint32_t g_uControlIntervalMS = 0;
/** The semaphore we're blocking our main control thread on. */
@@ -64,9 +65,10 @@ RTLISTANCHOR g_lstControlSessionThreads;
* are kept in VBOXSERVICECTRLSESSIONTHREAD structures. */
VBOXSERVICECTRLSESSION g_Session;
-/*******************************************************************************
-* Internal Functions *
-*******************************************************************************/
+
+/*********************************************************************************************************************************
+* Internal Functions *
+*********************************************************************************************************************************/
static int gstcntlHandleSessionOpen(PVBGLR3GUESTCTRLCMDCTX pHostCtx);
static int gstcntlHandleSessionClose(PVBGLR3GUESTCTRLCMDCTX pHostCtx);
static void VBoxServiceControlShutdown(void);
diff --git a/src/VBox/Additions/common/VBoxService/VBoxServiceControlProcess.cpp b/src/VBox/Additions/common/VBoxService/VBoxServiceControlProcess.cpp
index f8d90d9..0b4527e 100644
--- a/src/VBox/Additions/common/VBoxService/VBoxServiceControlProcess.cpp
+++ b/src/VBox/Additions/common/VBoxService/VBoxServiceControlProcess.cpp
@@ -16,9 +16,9 @@
*/
-/*******************************************************************************
-* Header Files *
-*******************************************************************************/
+/*********************************************************************************************************************************
+* Header Files *
+*********************************************************************************************************************************/
#include <iprt/asm.h>
#include <iprt/assert.h>
#include <iprt/env.h>
@@ -42,9 +42,10 @@
using namespace guestControl;
-/*******************************************************************************
-* Internal Functions *
-*******************************************************************************/
+
+/*********************************************************************************************************************************
+* Internal Functions *
+*********************************************************************************************************************************/
static int gstcntlProcessAssignPID(PVBOXSERVICECTRLPROCESS pThread, uint32_t uPID);
static int gstcntlProcessLock(PVBOXSERVICECTRLPROCESS pProcess);
static int gstcntlProcessRequest(PVBOXSERVICECTRLPROCESS pProcess, const PVBGLR3GUESTCTRLCMDCTX pHostCtx, PFNRT pfnFunction, unsigned cArgs, ...);
diff --git a/src/VBox/Additions/common/VBoxService/VBoxServiceControlSession.cpp b/src/VBox/Additions/common/VBoxService/VBoxServiceControlSession.cpp
index 5658ea1..6b0ca63 100644
--- a/src/VBox/Additions/common/VBoxService/VBoxServiceControlSession.cpp
+++ b/src/VBox/Additions/common/VBoxService/VBoxServiceControlSession.cpp
@@ -17,9 +17,9 @@
*/
-/*******************************************************************************
-* Header Files *
-*******************************************************************************/
+/*********************************************************************************************************************************
+* Header Files *
+*********************************************************************************************************************************/
#include <iprt/asm.h>
#include <iprt/assert.h>
#include <iprt/dir.h>
@@ -40,18 +40,20 @@
using namespace guestControl;
-/*******************************************************************************
-* Externals *
-*******************************************************************************/
+
+/*********************************************************************************************************************************
+* Externals *
+*********************************************************************************************************************************/
extern RTLISTANCHOR g_lstControlSessionThreads;
extern VBOXSERVICECTRLSESSION g_Session;
extern int VBoxServiceLogCreate(const char *pszLogFile);
extern void VBoxServiceLogDestroy(void);
-/*******************************************************************************
-* Internal Functions *
-*******************************************************************************/
+
+/*********************************************************************************************************************************
+* Internal Functions *
+*********************************************************************************************************************************/
static int gstcntlSessionFileDestroy(PVBOXSERVICECTRLFILE pFile);
static int gstcntlSessionFileAdd(PVBOXSERVICECTRLSESSION pSession, PVBOXSERVICECTRLFILE pFile);
static PVBOXSERVICECTRLFILE gstcntlSessionFileGetLocked(const PVBOXSERVICECTRLSESSION pSession, uint32_t uHandle);
diff --git a/src/VBox/Additions/common/VBoxService/VBoxServiceCpuHotPlug.cpp b/src/VBox/Additions/common/VBoxService/VBoxServiceCpuHotPlug.cpp
index e74908e..1333e6a 100644
--- a/src/VBox/Additions/common/VBoxService/VBoxServiceCpuHotPlug.cpp
+++ b/src/VBox/Additions/common/VBoxService/VBoxServiceCpuHotPlug.cpp
@@ -15,9 +15,10 @@
* hope that it will be useful, but WITHOUT ANY WARRANTY of any kind.
*/
-/*******************************************************************************
-* Header Files *
-*******************************************************************************/
+
+/*********************************************************************************************************************************
+* Header Files *
+*********************************************************************************************************************************/
#include <iprt/assert.h>
#include <iprt/dir.h>
#include <iprt/file.h>
@@ -34,9 +35,9 @@
#endif
-/*******************************************************************************
-* Defined Constants And Macros *
-*******************************************************************************/
+/*********************************************************************************************************************************
+* Defined Constants And Macros *
+*********************************************************************************************************************************/
#ifdef RT_OS_LINUX
/** @name Paths to access the CPU device
* @{
diff --git a/src/VBox/Additions/common/VBoxService/VBoxServicePageSharing.cpp b/src/VBox/Additions/common/VBoxService/VBoxServicePageSharing.cpp
index 3e53395..0130c82 100644
--- a/src/VBox/Additions/common/VBoxService/VBoxServicePageSharing.cpp
+++ b/src/VBox/Additions/common/VBoxService/VBoxServicePageSharing.cpp
@@ -16,9 +16,9 @@
*/
-/*******************************************************************************
-* Header Files *
-*******************************************************************************/
+/*********************************************************************************************************************************
+* Header Files *
+*********************************************************************************************************************************/
#include <iprt/assert.h>
#include <iprt/avl.h>
#include <iprt/asm.h>
@@ -38,9 +38,9 @@
#include "VBoxServiceUtils.h"
-/*******************************************************************************
-* Global Variables *
-*******************************************************************************/
+/*********************************************************************************************************************************
+* Global Variables *
+*********************************************************************************************************************************/
/** The semaphore we're blocking on. */
static RTSEMEVENTMULTI g_PageSharingEvent = NIL_RTSEMEVENTMULTI;
diff --git a/src/VBox/Additions/common/VBoxService/VBoxServicePropCache.cpp b/src/VBox/Additions/common/VBoxService/VBoxServicePropCache.cpp
index 48e6ace..877ed94 100644
--- a/src/VBox/Additions/common/VBoxService/VBoxServicePropCache.cpp
+++ b/src/VBox/Additions/common/VBoxService/VBoxServicePropCache.cpp
@@ -16,9 +16,9 @@
*/
-/*******************************************************************************
-* Header Files *
-*******************************************************************************/
+/*********************************************************************************************************************************
+* Header Files *
+*********************************************************************************************************************************/
#include <iprt/assert.h>
#include <iprt/list.h>
#include <iprt/mem.h>
diff --git a/src/VBox/Additions/common/VBoxService/VBoxServiceStats.cpp b/src/VBox/Additions/common/VBoxService/VBoxServiceStats.cpp
index 7f1e4f6..e48529a 100644
--- a/src/VBox/Additions/common/VBoxService/VBoxServiceStats.cpp
+++ b/src/VBox/Additions/common/VBoxService/VBoxServiceStats.cpp
@@ -15,9 +15,10 @@
* hope that it will be useful, but WITHOUT ANY WARRANTY of any kind.
*/
-/*******************************************************************************
-* Header Files *
-*******************************************************************************/
+
+/*********************************************************************************************************************************
+* Header Files *
+*********************************************************************************************************************************/
#if defined(RT_OS_WINDOWS)
# ifdef TARGET_NT4
# undef _WIN32_WINNT
@@ -55,9 +56,9 @@
#include "VBoxServiceUtils.h"
-/*******************************************************************************
-* Structures and Typedefs *
-*******************************************************************************/
+/*********************************************************************************************************************************
+* Structures and Typedefs *
+*********************************************************************************************************************************/
typedef struct _VBOXSTATSCONTEXT
{
RTMSINTERVAL cMsStatInterval;
@@ -75,9 +76,9 @@ typedef struct _VBOXSTATSCONTEXT
} VBOXSTATSCONTEXT;
-/*******************************************************************************
-* Global Variables *
-*******************************************************************************/
+/*********************************************************************************************************************************
+* Global Variables *
+*********************************************************************************************************************************/
static VBOXSTATSCONTEXT gCtx = {0};
/** The semaphore we're blocking on. */
diff --git a/src/VBox/Additions/common/VBoxService/VBoxServiceTimeSync.cpp b/src/VBox/Additions/common/VBoxService/VBoxServiceTimeSync.cpp
index 27137dd..00cafa1 100644
--- a/src/VBox/Additions/common/VBoxService/VBoxServiceTimeSync.cpp
+++ b/src/VBox/Additions/common/VBoxService/VBoxServiceTimeSync.cpp
@@ -76,9 +76,10 @@
* instead of trying to adjust it (milliseconds).
*/
-/*******************************************************************************
-* Header Files *
-*******************************************************************************/
+
+/*********************************************************************************************************************************
+* Header Files *
+*********************************************************************************************************************************/
#ifdef RT_OS_WINDOWS
# include <Windows.h>
# include <winbase.h> /** @todo r=bird: Why is this here? Windows.h should include winbase.h... */
@@ -99,9 +100,9 @@
#include "VBoxServiceUtils.h"
-/*******************************************************************************
-* Global Variables *
-*******************************************************************************/
+/*********************************************************************************************************************************
+* Global Variables *
+*********************************************************************************************************************************/
/** The timesync interval (milliseconds). */
uint32_t g_TimeSyncInterval = 0;
/**
diff --git a/src/VBox/Additions/common/VBoxService/VBoxServiceToolBox.cpp b/src/VBox/Additions/common/VBoxService/VBoxServiceToolBox.cpp
index 53a74c6..5ecec49 100644
--- a/src/VBox/Additions/common/VBoxService/VBoxServiceToolBox.cpp
+++ b/src/VBox/Additions/common/VBoxService/VBoxServiceToolBox.cpp
@@ -16,9 +16,9 @@
*/
-/*******************************************************************************
-* Header Files *
-*******************************************************************************/
+/*********************************************************************************************************************************
+* Header Files *
+*********************************************************************************************************************************/
#include <stdio.h>
#include <iprt/assert.h>
@@ -44,9 +44,9 @@
#include "VBoxServiceUtils.h"
-/*******************************************************************************
-* Defined Constants And Macros *
-*******************************************************************************/
+/*********************************************************************************************************************************
+* Defined Constants And Macros *
+*********************************************************************************************************************************/
/** Generic option indices for commands. */
enum
@@ -78,9 +78,9 @@ typedef enum VBOXSERVICETOOLBOXOUTPUTFLAG
} VBOXSERVICETOOLBOXOUTPUTFLAG;
-/*******************************************************************************
-* Structures and Typedefs *
-*******************************************************************************/
+/*********************************************************************************************************************************
+* Structures and Typedefs *
+*********************************************************************************************************************************/
/** Pointer to a handler function. */
typedef RTEXITCODE (*PFNHANDLER)(int , char **);
diff --git a/src/VBox/Additions/common/VBoxService/VBoxServiceUtils.cpp b/src/VBox/Additions/common/VBoxService/VBoxServiceUtils.cpp
index e7980da..9d0b3dd 100644
--- a/src/VBox/Additions/common/VBoxService/VBoxServiceUtils.cpp
+++ b/src/VBox/Additions/common/VBoxService/VBoxServiceUtils.cpp
@@ -16,9 +16,9 @@
*/
-/*******************************************************************************
-* Header Files *
-*******************************************************************************/
+/*********************************************************************************************************************************
+* Header Files *
+*********************************************************************************************************************************/
#ifdef RT_OS_WINDOWS
# include <Windows.h>
# include <iprt/param.h>
diff --git a/src/VBox/Additions/common/VBoxService/VBoxServiceVMInfo-win.cpp b/src/VBox/Additions/common/VBoxService/VBoxServiceVMInfo-win.cpp
index eb17f5b..ceeaf24 100644
--- a/src/VBox/Additions/common/VBoxService/VBoxServiceVMInfo-win.cpp
+++ b/src/VBox/Additions/common/VBoxService/VBoxServiceVMInfo-win.cpp
@@ -16,9 +16,9 @@
*/
-/*******************************************************************************
-* Header Files *
-*******************************************************************************/
+/*********************************************************************************************************************************
+* Header Files *
+*********************************************************************************************************************************/
#if defined(_WIN32_WINNT) && _WIN32_WINNT < 0x0502
# undef _WIN32_WINNT
# define _WIN32_WINNT 0x0502 /* CachedRemoteInteractive in recent SDKs. */
@@ -49,9 +49,10 @@ static uint32_t s_uDebugIter = 0;
* See notes in this section why we might want to skip this. */
static bool s_fSkipRDPDetection = false;
-/*******************************************************************************
-* Structures and Typedefs *
-*******************************************************************************/
+
+/*********************************************************************************************************************************
+* Structures and Typedefs *
+*********************************************************************************************************************************/
/** Structure for storing the looked up user information. */
typedef struct VBOXSERVICEVMINFOUSER
{
diff --git a/src/VBox/Additions/common/VBoxService/VBoxServiceVMInfo.cpp b/src/VBox/Additions/common/VBoxService/VBoxServiceVMInfo.cpp
index d29f872..c3e52f6 100644
--- a/src/VBox/Additions/common/VBoxService/VBoxServiceVMInfo.cpp
+++ b/src/VBox/Additions/common/VBoxService/VBoxServiceVMInfo.cpp
@@ -17,9 +17,9 @@
-/*******************************************************************************
-* Header Files *
-*******************************************************************************/
+/*********************************************************************************************************************************
+* Header Files *
+*********************************************************************************************************************************/
#ifdef RT_OS_WINDOWS
# ifdef TARGET_NT4 /* HACK ALERT! PMIB_IPSTATS undefined if 0x0400 with newer SDKs. */
# undef _WIN32_WINNT
@@ -88,9 +88,9 @@ typedef struct VBOXSERVICELACLIENTINFO
} VBOXSERVICELACLIENTINFO, *PVBOXSERVICELACLIENTINFO;
-/*******************************************************************************
-* Global Variables *
-*******************************************************************************/
+/*********************************************************************************************************************************
+* Global Variables *
+*********************************************************************************************************************************/
/** The vminfo interval (milliseconds). */
static uint32_t g_cMsVMInfoInterval = 0;
/** The semaphore we're blocking on. */
@@ -118,9 +118,9 @@ static VBOXSERVICELACLIENTINFO g_LAClientInfo;
uint32_t g_uVMInfoUserIdleThresholdMS = 5 * 1000;
-/*******************************************************************************
-* Defines *
-*******************************************************************************/
+/*********************************************************************************************************************************
+* Defines *
+*********************************************************************************************************************************/
static const char *g_pszLAActiveClient = "/VirtualBox/HostInfo/VRDP/ActiveClient";
#ifdef VBOX_WITH_DBUS
diff --git a/src/VBox/Additions/common/VBoxService/testcase/tstUserInfo.cpp b/src/VBox/Additions/common/VBoxService/testcase/tstUserInfo.cpp
index f7e92f3..6d9c498 100644
--- a/src/VBox/Additions/common/VBoxService/testcase/tstUserInfo.cpp
+++ b/src/VBox/Additions/common/VBoxService/testcase/tstUserInfo.cpp
@@ -16,9 +16,9 @@
*/
-/*******************************************************************************
-* Header Files *
-*******************************************************************************/
+/*********************************************************************************************************************************
+* Header Files *
+*********************************************************************************************************************************/
#ifdef RT_OS_WINDOWS
# include <Windows.h>
# include <Shlobj.h>
diff --git a/src/VBox/Additions/common/crOpenGL/DD_glc.py b/src/VBox/Additions/common/crOpenGL/DD_glc.py
old mode 100755
new mode 100644
diff --git a/src/VBox/Additions/common/crOpenGL/DD_glh.py b/src/VBox/Additions/common/crOpenGL/DD_glh.py
old mode 100755
new mode 100644
diff --git a/src/VBox/Additions/common/crOpenGL/NULLfuncs.py b/src/VBox/Additions/common/crOpenGL/NULLfuncs.py
old mode 100755
new mode 100644
diff --git a/src/VBox/Additions/common/crOpenGL/cr_gl.py b/src/VBox/Additions/common/crOpenGL/cr_gl.py
old mode 100755
new mode 100644
diff --git a/src/VBox/Additions/common/crOpenGL/entrypoints.py b/src/VBox/Additions/common/crOpenGL/entrypoints.py
old mode 100755
new mode 100644
diff --git a/src/VBox/Additions/common/crOpenGL/feedback/feedback.py b/src/VBox/Additions/common/crOpenGL/feedback/feedback.py
old mode 100755
new mode 100644
diff --git a/src/VBox/Additions/common/crOpenGL/feedback/feedback_funcs.py b/src/VBox/Additions/common/crOpenGL/feedback/feedback_funcs.py
old mode 100755
new mode 100644
diff --git a/src/VBox/Additions/common/crOpenGL/feedback/feedback_state.py b/src/VBox/Additions/common/crOpenGL/feedback/feedback_state.py
old mode 100755
new mode 100644
diff --git a/src/VBox/Additions/common/crOpenGL/feedback/feedbackspu_proto.py b/src/VBox/Additions/common/crOpenGL/feedback/feedbackspu_proto.py
old mode 100755
new mode 100644
diff --git a/src/VBox/Additions/common/crOpenGL/getprocaddress.py b/src/VBox/Additions/common/crOpenGL/getprocaddress.py
old mode 100755
new mode 100644
diff --git a/src/VBox/Additions/common/crOpenGL/load.c b/src/VBox/Additions/common/crOpenGL/load.c
index 6c287e1..9db0698 100644
--- a/src/VBox/Additions/common/crOpenGL/load.c
+++ b/src/VBox/Additions/common/crOpenGL/load.c
@@ -499,7 +499,7 @@ static void stubSignalHandler(int signo)
#ifndef RT_OS_WINDOWS
# ifdef CHROMIUM_THREADSAFE
-static DECLCALLBACK(void) stubThreadTlsDtor(void *pvValue)
+static void stubThreadTlsDtor(void *pvValue)
{
ContextInfo *pCtx = (ContextInfo*)pvValue;
VBoxTlsRefRelease(pCtx);
diff --git a/src/VBox/Additions/common/crOpenGL/pack/pack.py b/src/VBox/Additions/common/crOpenGL/pack/pack.py
old mode 100755
new mode 100644
diff --git a/src/VBox/Additions/common/crOpenGL/pack/packspu_beginend.py b/src/VBox/Additions/common/crOpenGL/pack/packspu_beginend.py
old mode 100755
new mode 100644
diff --git a/src/VBox/Additions/common/crOpenGL/pack/packspu_flush.py b/src/VBox/Additions/common/crOpenGL/pack/packspu_flush.py
old mode 100755
new mode 100644
diff --git a/src/VBox/Additions/common/crOpenGL/pack/packspu_proto.py b/src/VBox/Additions/common/crOpenGL/pack/packspu_proto.py
old mode 100755
new mode 100644
diff --git a/src/VBox/Additions/common/crOpenGL/passthrough/passthrough.py b/src/VBox/Additions/common/crOpenGL/passthrough/passthrough.py
old mode 100755
new mode 100644
diff --git a/src/VBox/Additions/common/crOpenGL/tsfuncs.py b/src/VBox/Additions/common/crOpenGL/tsfuncs.py
old mode 100755
new mode 100644
diff --git a/src/VBox/Additions/common/crOpenGL/windows_getprocaddress.py b/src/VBox/Additions/common/crOpenGL/windows_getprocaddress.py
old mode 100755
new mode 100644
diff --git a/src/VBox/Additions/common/pam/pam_vbox.cpp b/src/VBox/Additions/common/pam/pam_vbox.cpp
index 5774ea9..08e5f1c 100644
--- a/src/VBox/Additions/common/pam/pam_vbox.cpp
+++ b/src/VBox/Additions/common/pam/pam_vbox.cpp
@@ -15,9 +15,10 @@
* hope that it will be useful, but WITHOUT ANY WARRANTY of any kind.
*/
-/*******************************************************************************
-* Header Files *
-*******************************************************************************/
+
+/*********************************************************************************************************************************
+* Header Files *
+*********************************************************************************************************************************/
#define PAM_SM_AUTH
#define PAM_SM_ACCOUNT
#define PAM_SM_PASSWORD
diff --git a/src/VBox/Additions/common/testcase/tstPageFusion.cpp b/src/VBox/Additions/common/testcase/tstPageFusion.cpp
index 80965d9..d3e3c59 100644
--- a/src/VBox/Additions/common/testcase/tstPageFusion.cpp
+++ b/src/VBox/Additions/common/testcase/tstPageFusion.cpp
@@ -16,9 +16,9 @@
*/
-/*******************************************************************************
-* Header Files *
-*******************************************************************************/
+/*********************************************************************************************************************************
+* Header Files *
+*********************************************************************************************************************************/
#include <iprt/assert.h>
#include <iprt/asm.h>
#include <iprt/mem.h>
@@ -31,9 +31,9 @@
#include <stdio.h>
-/*******************************************************************************
-* Global Variables *
-*******************************************************************************/
+/*********************************************************************************************************************************
+* Global Variables *
+*********************************************************************************************************************************/
#ifdef RT_OS_WINDOWS
#include <Windows.h>
diff --git a/src/VBox/Additions/darwin/VBoxClient/VBoxClient.cpp b/src/VBox/Additions/darwin/VBoxClient/VBoxClient.cpp
index 9eebc57..d3bcea5 100644
--- a/src/VBox/Additions/darwin/VBoxClient/VBoxClient.cpp
+++ b/src/VBox/Additions/darwin/VBoxClient/VBoxClient.cpp
@@ -16,9 +16,9 @@
*/
-/*******************************************************************************
-* Header Files *
-*******************************************************************************/
+/*********************************************************************************************************************************
+* Header Files *
+*********************************************************************************************************************************/
#include <stdio.h>
#include <signal.h>
#include <unistd.h>
@@ -34,9 +34,10 @@
#include "VBoxClientInternal.h"
-/*******************************************************************************
-* Glogal Variables *
-*******************************************************************************/
+
+/*********************************************************************************************************************************
+* Glogal Variables *
+*********************************************************************************************************************************/
static int g_cVerbosity = 0;
static PRTLOGGER g_pLogger = NULL;
diff --git a/src/VBox/Additions/darwin/VBoxClient/VBoxClientClipboard.cpp b/src/VBox/Additions/darwin/VBoxClient/VBoxClientClipboard.cpp
index 6f37312..4de16f3 100644
--- a/src/VBox/Additions/darwin/VBoxClient/VBoxClientClipboard.cpp
+++ b/src/VBox/Additions/darwin/VBoxClient/VBoxClientClipboard.cpp
@@ -16,9 +16,9 @@
*/
-/*******************************************************************************
-* Header Files *
-*******************************************************************************/
+/*********************************************************************************************************************************
+* Header Files *
+*********************************************************************************************************************************/
#include <Carbon/Carbon.h>
#include <iprt/asm.h>
@@ -31,9 +31,9 @@
#include "VBoxClientInternal.h"
-/*******************************************************************************
-* Global Variables *
-*******************************************************************************/
+/*********************************************************************************************************************************
+* Global Variables *
+*********************************************************************************************************************************/
/** Host clipboard connection client ID */
static uint32_t g_u32ClientId;
@@ -49,16 +49,16 @@ static bool volatile g_fShouldStop;
static RTCRITSECT g_critsect;
-/*******************************************************************************
-* Local Macros *
-*******************************************************************************/
+/*********************************************************************************************************************************
+* Local Macros *
+*********************************************************************************************************************************/
#define VBOXCLIENT_SERVICE_NAME "clipboard"
-/*******************************************************************************
-* Local Function Prototypes *
-*******************************************************************************/
+/*********************************************************************************************************************************
+* Local Function Prototypes *
+*********************************************************************************************************************************/
static int vbclClipboardStop(void);
diff --git a/src/VBox/Additions/darwin/VBoxClient/VBoxClientClipboardGuestToHost.cpp b/src/VBox/Additions/darwin/VBoxClient/VBoxClientClipboardGuestToHost.cpp
index bf110c2..a6e2f95 100644
--- a/src/VBox/Additions/darwin/VBoxClient/VBoxClientClipboardGuestToHost.cpp
+++ b/src/VBox/Additions/darwin/VBoxClient/VBoxClientClipboardGuestToHost.cpp
@@ -16,9 +16,9 @@
*/
-/*******************************************************************************
-* Header Files *
-*******************************************************************************/
+/*********************************************************************************************************************************
+* Header Files *
+*********************************************************************************************************************************/
#include <Carbon/Carbon.h>
#include <signal.h>
#include <stdlib.h>
diff --git a/src/VBox/Additions/darwin/VBoxClient/VBoxClientClipboardHostToGuest.cpp b/src/VBox/Additions/darwin/VBoxClient/VBoxClientClipboardHostToGuest.cpp
index ba1c557..59fad04 100644
--- a/src/VBox/Additions/darwin/VBoxClient/VBoxClientClipboardHostToGuest.cpp
+++ b/src/VBox/Additions/darwin/VBoxClient/VBoxClientClipboardHostToGuest.cpp
@@ -16,9 +16,9 @@
*/
-/*******************************************************************************
-* Header Files *
-*******************************************************************************/
+/*********************************************************************************************************************************
+* Header Files *
+*********************************************************************************************************************************/
#include <Carbon/Carbon.h>
#include <signal.h>
#include <stdlib.h>
diff --git a/src/VBox/Additions/darwin/vboxfs/VBoxVFS.cpp b/src/VBox/Additions/darwin/vboxfs/VBoxVFS.cpp
index 7a4d485..c9bb212 100644
--- a/src/VBox/Additions/darwin/vboxfs/VBoxVFS.cpp
+++ b/src/VBox/Additions/darwin/vboxfs/VBoxVFS.cpp
@@ -45,9 +45,9 @@
#include "vboxvfs.h"
-/*******************************************************************************
-* Structures and Typedefs *
-*******************************************************************************/
+/*********************************************************************************************************************************
+* Structures and Typedefs *
+*********************************************************************************************************************************/
/**
* The service class for dealing with Share Folder filesystem.
@@ -69,9 +69,9 @@ public:
OSDefineMetaClassAndStructors(org_virtualbox_VBoxVFS, IOService);
-/*******************************************************************************
-* Global Variables *
-*******************************************************************************/
+/*********************************************************************************************************************************
+* Global Variables *
+*********************************************************************************************************************************/
/**
* Declare the module stuff.
diff --git a/src/VBox/Additions/haiku/VBoxTray/VBoxGuestApplication.cpp b/src/VBox/Additions/haiku/VBoxTray/VBoxGuestApplication.cpp
index 53d16e3..1df1806 100644
--- a/src/VBox/Additions/haiku/VBoxTray/VBoxGuestApplication.cpp
+++ b/src/VBox/Additions/haiku/VBoxTray/VBoxGuestApplication.cpp
@@ -44,9 +44,10 @@
* OTHER DEALINGS IN THE SOFTWARE.
*/
-/*******************************************************************************
-* Header Files *
-*******************************************************************************/
+
+/*********************************************************************************************************************************
+* Header Files *
+*********************************************************************************************************************************/
#include <iprt/log.h>
#include <errno.h>
diff --git a/src/VBox/Additions/haiku/VBoxTray/VBoxGuestDeskbarView.cpp b/src/VBox/Additions/haiku/VBoxTray/VBoxGuestDeskbarView.cpp
index 4f4ae9e..e0344ad 100644
--- a/src/VBox/Additions/haiku/VBoxTray/VBoxGuestDeskbarView.cpp
+++ b/src/VBox/Additions/haiku/VBoxTray/VBoxGuestDeskbarView.cpp
@@ -43,9 +43,11 @@
* FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR
* OTHER DEALINGS IN THE SOFTWARE.
*/
-/*******************************************************************************
-* Header Files *
-*******************************************************************************/
+
+
+/*********************************************************************************************************************************
+* Header Files *
+*********************************************************************************************************************************/
#include <errno.h>
#include <Alert.h>
#include <Roster.h>
diff --git a/src/VBox/Additions/haiku/VBoxVideo/accelerant/accelerant.cpp b/src/VBox/Additions/haiku/VBoxVideo/accelerant/accelerant.cpp
index 342eb8d..c2a0cdf 100644
--- a/src/VBox/Additions/haiku/VBoxVideo/accelerant/accelerant.cpp
+++ b/src/VBox/Additions/haiku/VBoxVideo/accelerant/accelerant.cpp
@@ -44,18 +44,20 @@
* OTHER DEALINGS IN THE SOFTWARE.
*/
-/*******************************************************************************
-* Header Files *
-*******************************************************************************/
+
+/*********************************************************************************************************************************
+* Header Files *
+*********************************************************************************************************************************/
#include <Accelerant.h>
#include "accelerant.h"
#include <stdio.h>
#include <string.h>
#include <errno.h>
-/*******************************************************************************
-* Global Variables *
-*******************************************************************************/
+
+/*********************************************************************************************************************************
+* Global Variables *
+*********************************************************************************************************************************/
AccelerantInfo gInfo;
static engine_token sEngineToken = { 1, 0 /*B_2D_ACCELERATION*/, NULL };
diff --git a/src/VBox/Additions/haiku/VBoxVideo/driver/driver.cpp b/src/VBox/Additions/haiku/VBoxVideo/driver/driver.cpp
index 1009591..4fb0324 100644
--- a/src/VBox/Additions/haiku/VBoxVideo/driver/driver.cpp
+++ b/src/VBox/Additions/haiku/VBoxVideo/driver/driver.cpp
@@ -44,9 +44,10 @@
* OTHER DEALINGS IN THE SOFTWARE.
*/
-/*******************************************************************************
-* Header Files *
-*******************************************************************************/
+
+/*********************************************************************************************************************************
+* Header Files *
+*********************************************************************************************************************************/
#include <KernelExport.h>
#include <PCI.h>
#include <malloc.h>
@@ -121,9 +122,10 @@ struct DeviceInfo
char name[B_OS_NAME_LENGTH]; /* Name of device */
};
-/*******************************************************************************
-* Internal Functions *
-*******************************************************************************/
+
+/*********************************************************************************************************************************
+* Internal Functions *
+*********************************************************************************************************************************/
status_t device_open(const char *name, uint32 flags, void **cookie);
status_t device_close(void *dev);
status_t device_free(void *dev);
@@ -132,9 +134,10 @@ status_t device_write(void *dev, off_t pos, const void *buf, size_t *len);
status_t device_ioctl(void *dev, uint32 msg, void *buf, size_t len);
static uint32 get_color_space_for_depth(uint32 depth);
-/*******************************************************************************
-* Globals *
-*******************************************************************************/
+
+/*********************************************************************************************************************************
+* Globals *
+*********************************************************************************************************************************/
/* At most one virtual video card ever appears, no reason for this to be an array */
static DeviceInfo gDeviceInfo;
static char *gDeviceNames[2] = { gDeviceInfo.name, NULL };
diff --git a/src/VBox/Additions/linux/installer/vboxadd.sh b/src/VBox/Additions/linux/installer/vboxadd.sh
index cb83479..d2647ad 100755
--- a/src/VBox/Additions/linux/installer/vboxadd.sh
+++ b/src/VBox/Additions/linux/installer/vboxadd.sh
@@ -1,6 +1,6 @@
#! /bin/sh
#
-# Linux Additions kernel module init script ($Revision: 101557 $)
+# Linux Additions kernel module init script ($Revision: 102425 $)
#
#
@@ -400,10 +400,10 @@ setup_modules()
--use-module-symvers /tmp/vboxguest-Module.symvers \
--module-source $MODULE_SRC/vboxvideo \
--no-print-directory install >> $LOG 2>&1; then
- show_error "Look at $LOG to find out what went wrong"
- return 1
+ show_error "Look at $LOG to find out what went wrong. The module is not built but the others are."
+ else
+ succ_msg
fi
- succ_msg
fi
depmod
return 0
diff --git a/src/VBox/Additions/linux/lightdm-greeter/vbox-greeter.cpp b/src/VBox/Additions/linux/lightdm-greeter/vbox-greeter.cpp
index 84a763c..4503d1a 100644
--- a/src/VBox/Additions/linux/lightdm-greeter/vbox-greeter.cpp
+++ b/src/VBox/Additions/linux/lightdm-greeter/vbox-greeter.cpp
@@ -16,9 +16,10 @@
* hope that it will be useful, but WITHOUT ANY WARRANTY of any kind.
*/
-/*******************************************************************************
-* Header Files *
-*******************************************************************************/
+
+/*********************************************************************************************************************************
+* Header Files *
+*********************************************************************************************************************************/
#include <pwd.h>
#include <syslog.h>
#include <stdlib.h>
diff --git a/src/VBox/Additions/solaris/DRM/vboxvideo_drm.c b/src/VBox/Additions/solaris/DRM/vboxvideo_drm.c
index 737e522..0e5e3f3 100644
--- a/src/VBox/Additions/solaris/DRM/vboxvideo_drm.c
+++ b/src/VBox/Additions/solaris/DRM/vboxvideo_drm.c
@@ -25,9 +25,9 @@
*/
-/*******************************************************************************
-* Header Files *
-*******************************************************************************/
+/*********************************************************************************************************************************
+* Header Files *
+*********************************************************************************************************************************/
#undef offsetof /* This gets redefined in drmP.h */
#include "include/drmP.h"
#include "include/drm.h"
@@ -38,9 +38,9 @@
#include <VBox/version.h>
-/*******************************************************************************
-* Defined Constants And Macros *
-*******************************************************************************/
+/*********************************************************************************************************************************
+* Defined Constants And Macros *
+*********************************************************************************************************************************/
#define VBOXSOLQUOTE2(x) #x
#define VBOXSOLQUOTE(x) VBOXSOLQUOTE2(x)
/** The module name. */
@@ -60,9 +60,9 @@
{ 0, 0, 0, NULL }
-/*******************************************************************************
-* Internal Functions *
-*******************************************************************************/
+/*********************************************************************************************************************************
+* Internal Functions *
+*********************************************************************************************************************************/
static int VBoxVideoSolarisAttach(dev_info_t *pDip, ddi_attach_cmd_t enmCmd);
static int VBoxVideoSolarisDetach(dev_info_t *pDip, ddi_detach_cmd_t enmCmd);
static int VBoxVideoSolarisGetInfo(dev_info_t *pDip, ddi_info_cmd_t enmCmd, void *pvArg, void **ppvResult);
@@ -70,9 +70,9 @@ static int VBoxVideoSolarisGetInfo(dev_info_t *pDip, ddi_info_cmd_t enmCmd, void
static void vboxVideoSolarisConfigure(drm_driver_t *pDriver);
-/*******************************************************************************
-* Structures and Typedefs *
-*******************************************************************************/
+/*********************************************************************************************************************************
+* Structures and Typedefs *
+*********************************************************************************************************************************/
extern struct cb_ops drm_cb_ops;
/**
@@ -123,9 +123,9 @@ static drm_pci_id_list_t vboxvideo_pciidlist[] = {
static drm_driver_t g_VBoxVideoSolarisDRMDriver = { 0 };
-/*******************************************************************************
-* Global Variables *
-*******************************************************************************/
+/*********************************************************************************************************************************
+* Global Variables *
+*********************************************************************************************************************************/
/** Device handle (we support only one instance). */
static dev_info_t *g_pDip;
@@ -155,7 +155,8 @@ int _fini(void)
LogFlow((DEVICE_NAME ":_fini flow\n"));
cmn_err(CE_NOTE, DEVICE_NAME ":_fini\n");
int rc = mod_remove(&g_VBoxVideoSolarisModLinkage);
- ddi_soft_state_fini(&g_pVBoxVideoSolarisState);
+ if (!rc)
+ ddi_soft_state_fini(&g_pVBoxVideoSolarisState);
return rc;
}
diff --git a/src/VBox/Additions/solaris/Mouse/testcase/tstVBoxMouse-solaris.c b/src/VBox/Additions/solaris/Mouse/testcase/tstVBoxMouse-solaris.c
index 1f60a8d..d581605 100644
--- a/src/VBox/Additions/solaris/Mouse/testcase/tstVBoxMouse-solaris.c
+++ b/src/VBox/Additions/solaris/Mouse/testcase/tstVBoxMouse-solaris.c
@@ -23,16 +23,18 @@
* terms and conditions of either the GPL or the CDDL or both.
*/
-/******************************************************************************
-* Header Files *
-******************************************************************************/
+
+/*********************************************************************************************************************************
+* Header Files *
+*********************************************************************************************************************************/
#include "solaris.h"
#include <iprt/alloc.h>
-/******************************************************************************
-* Helper functions *
-******************************************************************************/
+
+/*********************************************************************************************************************************
+* Helper functions *
+*********************************************************************************************************************************/
void miocack(queue_t *pWriteQueue, mblk_t *pMBlk, int cbData, int rc)
{
diff --git a/src/VBox/Additions/solaris/Mouse/vboxms.c b/src/VBox/Additions/solaris/Mouse/vboxms.c
index 0768e8b..4dbb0bf 100644
--- a/src/VBox/Additions/solaris/Mouse/vboxms.c
+++ b/src/VBox/Additions/solaris/Mouse/vboxms.c
@@ -26,9 +26,10 @@
#define LOG_GROUP LOG_GROUP_DRV_MOUSE
-/******************************************************************************
-* Header Files *
-******************************************************************************/
+
+/*********************************************************************************************************************************
+* Header Files *
+*********************************************************************************************************************************/
#include <VBox/VBoxGuestLib.h>
#include <VBox/log.h>
@@ -58,9 +59,9 @@
#endif /* TESTCASE */
-/******************************************************************************
-* Defined Constants And Macros *
-******************************************************************************/
+/*********************************************************************************************************************************
+* Defined Constants And Macros *
+*********************************************************************************************************************************/
/** The module name. */
#define DEVICE_NAME "vboxms"
@@ -68,9 +69,9 @@
#define DEVICE_DESC "VBoxMouseIntegr"
-/******************************************************************************
-* Internal functions used in global structures *
-******************************************************************************/
+/*********************************************************************************************************************************
+* Internal functions used in global structures *
+*********************************************************************************************************************************/
static int vbmsSolAttach(dev_info_t *pDip, ddi_attach_cmd_t enmCmd);
static int vbmsSolDetach(dev_info_t *pDip, ddi_detach_cmd_t enmCmd);
@@ -82,9 +83,9 @@ static int vbmsSolClose(queue_t *pReadQueue, int fFlag, cred_t *pCred);
static int vbmsSolWPut(queue_t *pWriteQueue, mblk_t *pMBlk);
-/******************************************************************************
-* Driver global structures *
-******************************************************************************/
+/*********************************************************************************************************************************
+* Driver global structures *
+*********************************************************************************************************************************/
#ifndef TESTCASE /* I see no value in including these in the test. */
@@ -240,17 +241,17 @@ typedef struct
} VBMSSTATE, *PVBMSSTATE;
-/******************************************************************************
-* Global Variables *
-******************************************************************************/
+/*********************************************************************************************************************************
+* Global Variables *
+*********************************************************************************************************************************/
/** Global driver state. Actually this could be allocated dynamically. */
static VBMSSTATE g_OpenNodeState /* = { 0 } */;
-/******************************************************************************
-* Kernel entry points *
-******************************************************************************/
+/*********************************************************************************************************************************
+* Kernel entry points *
+*********************************************************************************************************************************/
/** Driver initialisation. */
int _init(void)
@@ -290,7 +291,8 @@ int _fini(void)
LogRelFlow((DEVICE_NAME ":_fini\n"));
rc = mod_remove(&g_vbmsSolModLinkage);
- mutex_destroy(&g_OpenNodeState.InitMtx);
+ if (!rc)
+ mutex_destroy(&g_OpenNodeState.InitMtx);
return rc;
}
@@ -307,9 +309,9 @@ int _info(struct modinfo *pModInfo)
}
-/******************************************************************************
-* Initialisation entry points *
-******************************************************************************/
+/*********************************************************************************************************************************
+* Initialisation entry points *
+*********************************************************************************************************************************/
/**
* Attach entry point, to attach a device to the system or resume it.
@@ -418,9 +420,9 @@ int vbmsSolGetInfo(dev_info_t *pDip, ddi_info_cmd_t enmCmd, void *pvArg,
}
-/******************************************************************************
-* Main code *
-******************************************************************************/
+/*********************************************************************************************************************************
+* Main code *
+*********************************************************************************************************************************/
static void vbmsSolNotify(void *pvState);
static void vbmsSolVUIDPutAbsEvent(PVBMSSTATE pState, ushort_t cEvent,
diff --git a/src/VBox/Additions/solaris/SharedFolders/vboxfs_mount.c b/src/VBox/Additions/solaris/SharedFolders/vboxfs_mount.c
index 3e5356e..8134547 100644
--- a/src/VBox/Additions/solaris/SharedFolders/vboxfs_mount.c
+++ b/src/VBox/Additions/solaris/SharedFolders/vboxfs_mount.c
@@ -26,9 +26,10 @@
* terms and conditions of either the GPL or the CDDL or both.
*/
-/*******************************************************************************
-* Header Files *
-*******************************************************************************/
+
+/*********************************************************************************************************************************
+* Header Files *
+*********************************************************************************************************************************/
#include <stdio.h>
#include <stdlib.h>
#include <strings.h>
@@ -37,9 +38,10 @@
#include "vboxfs.h"
-/*******************************************************************************
-* Global Variables *
-*******************************************************************************/
+
+/*********************************************************************************************************************************
+* Global Variables *
+*********************************************************************************************************************************/
static char g_achOptBuf[MAX_MNTOPT_STR] = { '\0', };
static const int g_RetErr = 33;
static const int g_RetMagic = 2;
diff --git a/src/VBox/Additions/solaris/Virtio/Virtio-solaris.c b/src/VBox/Additions/solaris/Virtio/Virtio-solaris.c
index 61aaab0..ba9f994 100644
--- a/src/VBox/Additions/solaris/Virtio/Virtio-solaris.c
+++ b/src/VBox/Additions/solaris/Virtio/Virtio-solaris.c
@@ -24,9 +24,10 @@
* terms and conditions of either the GPL or the CDDL or both.
*/
-/*******************************************************************************
-* Header Files *
-*******************************************************************************/
+
+/*********************************************************************************************************************************
+* Header Files *
+*********************************************************************************************************************************/
#include "Virtio-solaris.h"
#include <iprt/assert.h>
diff --git a/src/VBox/Additions/solaris/Virtio/VirtioNet-solaris.c b/src/VBox/Additions/solaris/Virtio/VirtioNet-solaris.c
index af949d4..def6d7d 100644
--- a/src/VBox/Additions/solaris/Virtio/VirtioNet-solaris.c
+++ b/src/VBox/Additions/solaris/Virtio/VirtioNet-solaris.c
@@ -24,9 +24,10 @@
* terms and conditions of either the GPL or the CDDL or both.
*/
-/*******************************************************************************
-* Header Files *
-*******************************************************************************/
+
+/*********************************************************************************************************************************
+* Header Files *
+*********************************************************************************************************************************/
#include "Virtio-solaris.h"
#include "VirtioPci-solaris.h"
@@ -44,9 +45,10 @@
#include <iprt/rand.h>
#include <iprt/string.h>
-/*******************************************************************************
-* Defined Constants And Macros *
-*******************************************************************************/
+
+/*********************************************************************************************************************************
+* Defined Constants And Macros *
+*********************************************************************************************************************************/
#define DEVICE_NAME "virtnet"
/** The module descriptions as seen in 'modinfo'. */
#define DEVICE_DESC_DRV "VirtualBox VirtioNet"
@@ -75,9 +77,9 @@
#define VIRTIO_NET_CTRL_VLAN 0x00080000 /* Control channel VLAN filtering */
-/*******************************************************************************
-* Internal Functions *
-*******************************************************************************/
+/*********************************************************************************************************************************
+* Internal Functions *
+*********************************************************************************************************************************/
static void *VirtioNetDevAlloc(PVIRTIODEVICE pDevice);
static void VirtioNetDevFree(PVIRTIODEVICE pDevice);
static int VirtioNetDevAttach(PVIRTIODEVICE pDevice);
@@ -100,9 +102,9 @@ static int VirtioNetAttachQueues(PVIRTIODEVICE pDevice);
static void VirtioNetDetachQueues(PVIRTIODEVICE pDevice);
-/*******************************************************************************
-* Structures and Typedefs *
-*******************************************************************************/
+/*********************************************************************************************************************************
+* Structures and Typedefs *
+*********************************************************************************************************************************/
/**
* Device operations for Virtio Net.
*/
diff --git a/src/VBox/Additions/solaris/Virtio/VirtioPci-solaris.c b/src/VBox/Additions/solaris/Virtio/VirtioPci-solaris.c
index cf6ba42..6916bf0 100644
--- a/src/VBox/Additions/solaris/Virtio/VirtioPci-solaris.c
+++ b/src/VBox/Additions/solaris/Virtio/VirtioPci-solaris.c
@@ -24,9 +24,10 @@
* terms and conditions of either the GPL or the CDDL or both.
*/
-/*******************************************************************************
-* Header Files *
-*******************************************************************************/
+
+/*********************************************************************************************************************************
+* Header Files *
+*********************************************************************************************************************************/
#include "VirtioPci-solaris.h"
#include <iprt/asm.h>
@@ -38,9 +39,10 @@
#include <sys/pci.h>
#include <sys/param.h>
-/*******************************************************************************
-* Defined Constants And Macros *
-*******************************************************************************/
+
+/*********************************************************************************************************************************
+* Defined Constants And Macros *
+*********************************************************************************************************************************/
/*
* Pci Register offsets.
*/
@@ -118,9 +120,9 @@ static size_t g_cIntrAllocated;
static kmutex_t g_IrqMtx;
-/*******************************************************************************
-* Internal Functions *
-*******************************************************************************/
+/*********************************************************************************************************************************
+* Internal Functions *
+*********************************************************************************************************************************/
static void *VirtioPciAlloc(PVIRTIODEVICE pDevice);
static void VirtioPciFree(PVIRTIODEVICE pDevice);
static int VirtioPciAttach(PVIRTIODEVICE pDevice);
diff --git a/src/VBox/Additions/solaris/Virtio/VirtioRing-solaris.c b/src/VBox/Additions/solaris/Virtio/VirtioRing-solaris.c
index 409ce17..1afbb04 100644
--- a/src/VBox/Additions/solaris/Virtio/VirtioRing-solaris.c
+++ b/src/VBox/Additions/solaris/Virtio/VirtioRing-solaris.c
@@ -24,9 +24,10 @@
* terms and conditions of either the GPL or the CDDL or both.
*/
-/*******************************************************************************
-* Header Files *
-*******************************************************************************/
+
+/*********************************************************************************************************************************
+* Header Files *
+*********************************************************************************************************************************/
#include "Virtio-solaris.h"
#include <iprt/asm.h>
diff --git a/src/VBox/Additions/x11/Installer/98vboxadd-xclient b/src/VBox/Additions/x11/Installer/98vboxadd-xclient
index f0d4236..236a4cc 100755
--- a/src/VBox/Additions/x11/Installer/98vboxadd-xclient
+++ b/src/VBox/Additions/x11/Installer/98vboxadd-xclient
@@ -21,7 +21,7 @@ for i in $HOME/.vboxclient-*.pid; do
test -w $i || rm -f $i
done
-if test -f /proc/modules && ! grep -q vboxguest /proc/modules 2>/dev/null; then
+if ! test -c /dev/vboxguest 2>/dev/null; then
# Do not start if the kernel module is not present.
notify-send "VBoxClient: the VirtualBox kernel service is not running. Exiting."
elif test -z "${SSH_CONNECTION}"; then
diff --git a/src/VBox/Additions/x11/VBoxClient/VBoxClient.h b/src/VBox/Additions/x11/VBoxClient/VBoxClient.h
index 646d698..733ea49 100644
--- a/src/VBox/Additions/x11/VBoxClient/VBoxClient.h
+++ b/src/VBox/Additions/x11/VBoxClient/VBoxClient.h
@@ -50,12 +50,6 @@ struct VBCLSERVICE
int (*init)(struct VBCLSERVICE **ppInterface);
/** Run the service main loop */
int (*run)(struct VBCLSERVICE **ppInterface, bool fDaemonised);
- /** Pause the service loop. This is used to allow the service to disable
- * itself when the X server is switched out. It must be safe to call on a
- * different thread if the VT monitoring thread is used. */
- int (*pause)(struct VBCLSERVICE **ppInterface);
- /** Resume after pausing. The same applies here as for @a pause. */
- int (*resume)(struct VBCLSERVICE **ppInterface);
/** Clean up any global resources before we shut down hard. The last calls
* to @a pause and @a resume are guaranteed to finish before this is called.
*/
@@ -76,10 +70,6 @@ static void VBClServiceDefaultCleanup(struct VBCLSERVICE **ppInterface)
NOREF(ppInterface);
}
-union _XEvent; /* We do not want to pull in the X11 header files here. */
-extern void VBClCheckXOrgVT(union _XEvent *pEvent);
-extern int VBClStartVTMonitor();
-
extern struct VBCLSERVICE **VBClGetClipboardService();
extern struct VBCLSERVICE **VBClGetSeamlessService();
extern struct VBCLSERVICE **VBClGetDisplayService();
diff --git a/src/VBox/Additions/x11/VBoxClient/clipboard.cpp b/src/VBox/Additions/x11/VBoxClient/clipboard.cpp
index 9fe6ce4..0a23d25 100644
--- a/src/VBox/Additions/x11/VBoxClient/clipboard.cpp
+++ b/src/VBox/Additions/x11/VBoxClient/clipboard.cpp
@@ -15,9 +15,10 @@
* hope that it will be useful, but WITHOUT ANY WARRANTY of any kind.
*/
-/****************************************************************************
-* Header Files *
-****************************************************************************/
+
+/*********************************************************************************************************************************
+* Header Files *
+*********************************************************************************************************************************/
#include <iprt/alloc.h>
#include <iprt/asm.h>
#include <iprt/assert.h>
@@ -34,9 +35,10 @@
#include "VBoxClient.h"
-/****************************************************************************
-* Global Variables *
-****************************************************************************/
+
+/*********************************************************************************************************************************
+* Global Variables *
+*********************************************************************************************************************************/
/**
* Global clipboard context information.
@@ -313,8 +315,6 @@ struct VBCLSERVICE vbclClipboardInterface =
getPidFilePath,
VBClServiceDefaultHandler, /* init */
run,
- VBClServiceDefaultHandler, /* pause */
- VBClServiceDefaultHandler, /* resume */
cleanup
};
diff --git a/src/VBox/Additions/x11/VBoxClient/display.cpp b/src/VBox/Additions/x11/VBoxClient/display.cpp
index 41a8670..12007dd 100644
--- a/src/VBox/Additions/x11/VBoxClient/display.cpp
+++ b/src/VBox/Additions/x11/VBoxClient/display.cpp
@@ -25,6 +25,7 @@
#include <X11/Xlib.h>
#include <X11/Xatom.h>
+#include <iprt/asm.h>
#include <iprt/assert.h>
#include <iprt/err.h>
#include <iprt/file.h>
@@ -53,7 +54,7 @@ struct screenInformation
unsigned y;
bool fEnabled;
bool fUpdateSize;
- bool fUpdatePosition;
+ volatile bool fUpdatePosition;
};
/** Display magic number, start of a UUID. */
@@ -83,37 +84,46 @@ struct DISPLAYSTATE
struct screenInformation *paScreenInformation;
};
-/** Tell the VBoxGuest driver we no longer want any events and tell the host
- * we no longer support any capabilities. */
-static int disableEventsAndCaps(bool fDisableEvents)
+/** Thread to monitor and react to X server VT switches and exits. */
+static DECLCALLBACK(int) vboxClientMonitorThread(RTTHREAD self, void *pvUser)
{
- int rc = VbglR3SetGuestCaps(0, VMMDEV_GUEST_SUPPORTS_GRAPHICS);
- if (RT_FAILURE(rc))
- VBClFatalError(("Failed to unset graphics capability, rc=%Rrc.\n", rc));
- rc = VbglR3SetMouseStatus(VMMDEV_MOUSE_GUEST_NEEDS_HOST_CURSOR);
- if (RT_FAILURE(rc))
- VBClFatalError(("Failed to unset mouse status, rc=%Rrc.\n", rc));
- if (fDisableEvents)
- rc = VbglR3CtlFilterMask(0, VMMDEV_EVENT_MOUSE_CAPABILITIES_CHANGED | VMMDEV_EVENT_DISPLAY_CHANGE_REQUEST);
- if (RT_FAILURE(rc))
- VBClFatalError(("Failed to unset filter mask, rc=%Rrc.\n", rc));
- return VINF_SUCCESS;
+ struct DISPLAYSTATE *pState = (struct DISPLAYSTATE *)pvUser;
+ Display *pDisplay;
+ bool fHasVT = true;
+
+ pDisplay = XOpenDisplay(NULL);
+ if (!pDisplay)
+ VBClFatalError(("Failed to open the X11 display\n"));
+ XSelectInput(pDisplay, DefaultRootWindow(pDisplay), PropertyChangeMask);
+ while (true)
+ {
+ XEvent event;
+
+ XNextEvent(pDisplay, &event);
+ /* This property is deleted when the server regains the virtual
+ * terminal. Force the main thread to call xrandr again, as old X
+ * servers could not handle it while switched out. */
+ if (pState->fHaveRandR12)
+ continue;
+ if ( event.type != PropertyNotify
+ || event.xproperty.state != PropertyDelete
+ || event.xproperty.window != DefaultRootWindow(pDisplay)
+ || event.xproperty.atom != XInternAtom(pDisplay, "VBOXVIDEO_NO_VT", False))
+ continue;
+ LogRel(("VBoxClient/Display: entered virtual terminal.\n"));
+ ASMAtomicWriteBool(&pState->paScreenInformation[0].fUpdateSize, true);
+ VbglR3InterruptEventWaits();
+ }
+ return VINF_SUCCESS; /* Should never be reached. */
}
-/** Tell the VBoxGuest driver which events we want and tell the host which
- * capabilities we support. */
-static int enableEventsAndCaps()
+static int startMonitorThread(struct DISPLAYSTATE *pState)
{
- int rc = VbglR3CtlFilterMask( VMMDEV_EVENT_MOUSE_CAPABILITIES_CHANGED
- | VMMDEV_EVENT_DISPLAY_CHANGE_REQUEST, 0);
- if (RT_FAILURE(rc))
- VBClFatalError(("Failed to set filter mask, rc=%Rrc.\n", rc));
- rc = VbglR3SetGuestCaps(VMMDEV_GUEST_SUPPORTS_GRAPHICS, 0);
- if (RT_FAILURE(rc))
- VBClFatalError(("Failed to set graphics capability, rc=%Rrc.\n", rc));
- rc = VbglR3SetMouseStatus(0);
- if (RT_FAILURE(rc))
- VBClFatalError(("Failed to set mouse status, rc=%Rrc.\n", rc));
+ int rc;
+
+ rc = RTThreadCreate(NULL, vboxClientMonitorThread, (void *)pState, 0, RTTHREADTYPE_INFREQUENT_POLLER, 0, "VT_MONITOR");
+ if (rc != VINF_SUCCESS)
+ VBClFatalError(("Failed to start the VT monitor thread, rc=%Rrc\n", rc));
return VINF_SUCCESS;
}
@@ -208,9 +218,12 @@ static void notifyXServerRandR11(struct DISPLAYSTATE *pState)
if ( pState->paScreenInformation[0].fUpdateSize
&& pState->paScreenInformation[0].cx > 0 && pState->paScreenInformation[0].cy > 0)
{
+ int ret;
+
RTStrPrintf(szCommand, sizeof(szCommand), "%s -s %ux%u",
pState->pcszXrandr, pState->paScreenInformation[0].cx, pState->paScreenInformation[0].cy);
- system(szCommand);
+ ret = system(szCommand);
+ LogRel(("VBoxClient/Display: executed \"%s\", returned %d.\n", szCommand, ret));
pState->paScreenInformation[0].fUpdateSize = false;
}
}
@@ -237,6 +250,7 @@ static void runDisplay(struct DISPLAYSTATE *pState)
{
int rc;
unsigned i, cScreensTracked;
+ uint32_t fModeSet = false;
LogRelFlowFunc(("\n"));
rc = VbglR3VideoModeGetHighestSavedScreen(&cScreensTracked);
@@ -261,6 +275,13 @@ static void runDisplay(struct DISPLAYSTATE *pState)
updateScreenInformation(pState, cx, cy, cBPP, i, x, y, fEnabled, true);
}
}
+ /* Semantics: when VBOX_HAS_GRAPHICS is set, the X server driver assumes
+ * that a client capable of forwarding mode hints will be present for the
+ * rest of the X session. If we crash things will not work as they should.
+ * I thought that preferable to implementing complex crash-handling logic.
+ */
+ XChangeProperty(pState->pDisplay, DefaultRootWindow(pState->pDisplay), XInternAtom(pState->pDisplay, "VBOX_HAS_GRAPHICS", 0),
+ XA_INTEGER, 32, PropModeReplace, (unsigned char *)&fModeSet, 1);
while (true)
{
uint32_t fEvents;
@@ -332,7 +353,9 @@ static int init(struct VBCLSERVICE **ppInterface)
rc = initDisplay(pSelf);
if (RT_FAILURE(rc))
return rc;
- rc = enableEventsAndCaps();
+ rc = VbglR3CtlFilterMask(VMMDEV_EVENT_MOUSE_CAPABILITIES_CHANGED | VMMDEV_EVENT_DISPLAY_CHANGE_REQUEST, 0);
+ if (RT_FAILURE(rc))
+ VBClFatalError(("Failed to set filter mask, rc=%Rrc.\n", rc));
if (RT_SUCCESS(rc))
pSelf->mfInit = true;
return rc;
@@ -345,40 +368,17 @@ static int run(struct VBCLSERVICE **ppInterface, bool fDaemonised)
if (!pSelf->mfInit)
return VERR_WRONG_ORDER;
- rc = VBClStartVTMonitor();
+ rc = startMonitorThread(pSelf);
if (RT_FAILURE(rc))
VBClFatalError(("Failed to start the VT monitor thread: %Rrc\n", rc));
runDisplay(pSelf);
return VERR_INTERNAL_ERROR; /* "Should never reach here." */
}
-static int pause(struct VBCLSERVICE **ppInterface)
-{
- struct DISPLAYSTATE *pSelf = getStateFromInterface(ppInterface);
-
- if (!pSelf->mfInit)
- return VERR_WRONG_ORDER;
- return disableEventsAndCaps(false);
-}
-
-static int resume(struct VBCLSERVICE **ppInterface)
-{
- struct DISPLAYSTATE *pSelf = getStateFromInterface(ppInterface);
- int rc;
-
- if (!pSelf->mfInit)
- return VERR_WRONG_ORDER;
- rc = enableEventsAndCaps();
- /* RandR 1.1-based drivers only let us change mode when we are not switched
- * out, so interrupt the wait when we switch in and re-set it. */
- VbglR3InterruptEventWaits();
- return rc;
-}
-
static void cleanup(struct VBCLSERVICE **ppInterface)
{
NOREF(ppInterface);
- disableEventsAndCaps(true);
+ VbglR3CtlFilterMask(0, VMMDEV_EVENT_MOUSE_CAPABILITIES_CHANGED | VMMDEV_EVENT_DISPLAY_CHANGE_REQUEST);
VbglR3Term();
}
@@ -387,8 +387,6 @@ struct VBCLSERVICE vbclDisplayInterface =
getPidFilePath,
init,
run,
- pause,
- resume,
cleanup
};
diff --git a/src/VBox/Additions/x11/VBoxClient/draganddrop.cpp b/src/VBox/Additions/x11/VBoxClient/draganddrop.cpp
index 07d84a3..fd331c3 100644
--- a/src/VBox/Additions/x11/VBoxClient/draganddrop.cpp
+++ b/src/VBox/Additions/x11/VBoxClient/draganddrop.cpp
@@ -598,8 +598,8 @@ public:
private:
int dragAndDropInit(void);
- static int hgcmEventThread(RTTHREAD hThread, void *pvUser);
- static int x11EventThread(RTTHREAD hThread, void *pvUser);
+ static DECLCALLBACK(int) hgcmEventThread(RTTHREAD hThread, void *pvUser);
+ static DECLCALLBACK(int) x11EventThread(RTTHREAD hThread, void *pvUser);
/* Private member vars */
Display *m_pDisplay;
@@ -3169,7 +3169,7 @@ int DragAndDropService::dragAndDropInit(void)
* @param pvUser Pointer to DragAndDropService instance to use.
*/
/* static */
-int DragAndDropService::hgcmEventThread(RTTHREAD hThread, void *pvUser)
+DECLCALLBACK(int) DragAndDropService::hgcmEventThread(RTTHREAD hThread, void *pvUser)
{
AssertPtrReturn(pvUser, VERR_INVALID_PARAMETER);
DragAndDropService *pThis = static_cast<DragAndDropService*>(pvUser);
@@ -3239,7 +3239,7 @@ int DragAndDropService::hgcmEventThread(RTTHREAD hThread, void *pvUser)
* @param pvUser Pointer to DragAndDropService instance to use.
*/
/* static */
-int DragAndDropService::x11EventThread(RTTHREAD hThread, void *pvUser)
+DECLCALLBACK(int) DragAndDropService::x11EventThread(RTTHREAD hThread, void *pvUser)
{
AssertPtrReturn(pvUser, VERR_INVALID_PARAMETER);
DragAndDropService *pThis = static_cast<DragAndDropService*>(pvUser);
@@ -3340,8 +3340,6 @@ struct VBCLSERVICE vbclDragAndDropInterface =
getPidFilePath,
VBClServiceDefaultHandler, /* init */
run,
- VBClServiceDefaultHandler, /* pause */
- VBClServiceDefaultHandler, /* resume */
cleanup
};
diff --git a/src/VBox/Additions/x11/VBoxClient/hostversion.cpp b/src/VBox/Additions/x11/VBoxClient/hostversion.cpp
index 8b25a0a..83211f2 100644
--- a/src/VBox/Additions/x11/VBoxClient/hostversion.cpp
+++ b/src/VBox/Additions/x11/VBoxClient/hostversion.cpp
@@ -207,8 +207,6 @@ struct VBCLSERVICE vbclHostVersionInterface =
getPidFilePath,
VBClServiceDefaultHandler, /* init */
run,
- VBClServiceDefaultHandler, /* pause */
- VBClServiceDefaultHandler, /* resume */
VBClServiceDefaultCleanup
};
diff --git a/src/VBox/Additions/x11/VBoxClient/main.cpp b/src/VBox/Additions/x11/VBoxClient/main.cpp
index 6c424a5..a674dc3 100644
--- a/src/VBox/Additions/x11/VBoxClient/main.cpp
+++ b/src/VBox/Additions/x11/VBoxClient/main.cpp
@@ -114,7 +114,7 @@ static int vboxClientXLibErrorHandler(Display *pDisplay, XErrorEvent *pError)
XGetErrorText(pDisplay, pError->error_code, errorText, sizeof(errorText));
LogRelFlow(("VBoxClient: an X Window protocol error occurred: %s (error code %d). Request code: %d, minor code: %d, serial number: %d\n", errorText, pError->error_code, pError->request_code, pError->minor_code, pError->serial));
- return 0; /* We should never reach this. */
+ return 0;
}
/**
@@ -151,91 +151,6 @@ static void vboxClientSetSignalHandlers(void)
LogRelFlowFunc(("returning\n"));
}
-/** Check whether X.Org has acquired or lost the current virtual terminal and
- * call the service @a pause() or @a resume() call-back if appropriate.
- * The functionality is provided by the vboxvideo driver for pre-1.16 X servers
- * and by 1.16 and later series servers.
- * This can either be called directly from a service's event loop or the service
- * can call VBClStartVTMonitor() to start an event loop in a separate thread.
- * Property notification for the root window should be selected first. Services
- * are not required to check VT changes if they do not need the information.
- * @param pEvent an event received on a display connection which will be
- * checked to see if it is change to the XFree86_has_VT property
- */
-void VBClCheckXOrgVT(union _XEvent *pEvent)
-{
- Atom actualType;
- int actualFormat;
- unsigned long cItems, cbLeft;
- bool fHasVT = false;
- unsigned long *pValue;
- int rc;
- Display *pDisplay = pEvent->xany.display;
- Atom hasVT = XInternAtom(pDisplay, "XFree86_has_VT", False);
-
- if ( pEvent->type != PropertyNotify
- || pEvent->xproperty.window != DefaultRootWindow(pDisplay)
- || pEvent->xproperty.atom != hasVT)
- return;
- XGetWindowProperty(pDisplay, DefaultRootWindow(pDisplay), hasVT, 0, 1,
- False, XA_INTEGER, &actualType, &actualFormat, &cItems,
- &cbLeft, (unsigned char **)&pValue);
- if (cItems && actualFormat == 32)
- {
- fHasVT = *pValue != 0;
- XFree(pValue);
- }
- else
- return;
- if (fHasVT)
- {
- rc = (*g_pService)->resume(g_pService);
- if (RT_FAILURE(rc))
- VBClFatalError(("Error resuming the service: %Rrc\n", rc));
- }
- if (!fHasVT)
- {
- rc = (*g_pService)->pause(g_pService);
- if (RT_FAILURE(rc))
- VBClFatalError(("Error pausing the service: %Rrc\n", rc));
- }
-}
-
-/**
- * Thread which notifies the service when we switch to a different VT or back
- * and cleans up when the X server exits.
- * @note runs until programme exit.
- */
-static int pfnMonitorThread(RTTHREAD self, void *pvUser)
-{
- Display *pDisplay;
- bool fHasVT = true;
-
- pDisplay = XOpenDisplay(NULL);
- if (!pDisplay)
- VBClFatalError(("Failed to open the X11 display\n"));
- XSelectInput(pDisplay, DefaultRootWindow(pDisplay), PropertyChangeMask);
- while (true)
- {
- XEvent event;
-
- XNextEvent(pDisplay, &event);
- VBClCheckXOrgVT(&event);
- }
- return VINF_SUCCESS; /* Should never be reached. */
-}
-
-/**
- * Start a thread which notifies the service when we switch to a different
- * VT or back, and terminates us when the X server exits. This should be called
- * by most services which do not regularly run an X11 event loop.
- */
-int VBClStartVTMonitor()
-{
- return RTThreadCreate(NULL, pfnMonitorThread, NULL, 0,
- RTTHREADTYPE_INFREQUENT_POLLER, 0, "MONITOR");
-}
-
/**
* Print out a usage message and exit with success.
*/
diff --git a/src/VBox/Additions/x11/VBoxClient/seamless-x11.cpp b/src/VBox/Additions/x11/VBoxClient/seamless-x11.cpp
index 067bfa0..5e49b6b 100644
--- a/src/VBox/Additions/x11/VBoxClient/seamless-x11.cpp
+++ b/src/VBox/Additions/x11/VBoxClient/seamless-x11.cpp
@@ -15,9 +15,10 @@
* hope that it will be useful, but WITHOUT ANY WARRANTY of any kind.
*/
-/*****************************************************************************
-* Header files *
-*****************************************************************************/
+
+/*********************************************************************************************************************************
+* Header files *
+*********************************************************************************************************************************/
#include <iprt/err.h>
#include <iprt/assert.h>
@@ -25,6 +26,7 @@
#include <VBox/log.h>
#include "seamless-x11.h"
+#include "VBoxClient.h"
#include <X11/Xatom.h>
#include <X11/Xmu/WinUtil.h>
@@ -87,6 +89,8 @@ int SeamlessX11::init(PFNSENDREGIONUPDATE pHostCallback)
return VERR_ACCESS_DENIED;
}
mHostCallback = pHostCallback;
+ mEnabled = false;
+ unmonitorClientList();
LogRelFlowFunc(("returning %Rrc\n", rc));
return rc;
}
@@ -106,6 +110,8 @@ int SeamlessX11::start(void)
int error, event;
LogRelFlowFunc(("\n"));
+ if (mEnabled)
+ return VINF_SUCCESS;
mSupportsShape = XShapeQueryExtension(mDisplay, &event, &error);
mEnabled = true;
monitorClientList();
@@ -119,6 +125,8 @@ int SeamlessX11::start(void)
void SeamlessX11::stop(void)
{
LogRelFlowFunc(("\n"));
+ if (!mEnabled)
+ return;
mEnabled = false;
unmonitorClientList();
freeWindowTree();
@@ -134,7 +142,7 @@ void SeamlessX11::monitorClientList(void)
void SeamlessX11::unmonitorClientList(void)
{
LogRelFlowFunc(("called\n"));
- XSelectInput(mDisplay, DefaultRootWindow(mDisplay), 0);
+ XSelectInput(mDisplay, DefaultRootWindow(mDisplay), PropertyChangeMask);
}
/**
@@ -269,6 +277,7 @@ DECLCALLBACK(int) VBoxGuestWinFree(VBoxGuestWinInfo *pInfo, void *pvParam)
{
Display *pDisplay = (Display *)pvParam;
+ XShapeSelectInput(pDisplay, pInfo->Core.Key, 0);
delete pInfo;
return VINF_SUCCESS;
}
@@ -297,13 +306,17 @@ void SeamlessX11::nextConfigurationEvent(void)
LogRelFlowFunc(("\n"));
/* Start by sending information about the current window setup to the host. We do this
here because we want to send all such information from a single thread. */
- if (mChanged)
+ if (mChanged && mEnabled)
{
updateRects();
mHostCallback(mpRects, mcRects);
}
mChanged = false;
+ /* We execute this even when seamless is disabled, as it also waits for
+ * enable and disable notification. */
XNextEvent(mDisplay, &event);
+ if (!mEnabled)
+ return;
switch (event.type)
{
case ConfigureNotify:
@@ -345,7 +358,7 @@ void SeamlessX11::nextConfigurationEvent(void)
default:
break;
}
- LogRelFlowFunc(("returning\n"));
+ LogRelFlowFunc(("processed event\n"));
}
/**
@@ -490,17 +503,18 @@ int SeamlessX11::updateRects(void)
bool SeamlessX11::interruptEventWait(void)
{
bool rc = false;
+ Display *pDisplay = XOpenDisplay(NULL);
LogRelFlowFunc(("\n"));
+ if (pDisplay == NULL)
+ VBClFatalError(("Failed to open X11 display.\n"));
/* Message contents set to zero. */
XClientMessageEvent clientMessage = { ClientMessage, 0, 0, 0, 0, 0, 8 };
- if (XSendEvent(mDisplay, DefaultRootWindow(mDisplay), false,
- SubstructureNotifyMask, (XEvent *)&clientMessage))
- {
- XFlush(mDisplay);
+ if (XSendEvent(pDisplay, DefaultRootWindow(mDisplay), false,
+ PropertyChangeMask, (XEvent *)&clientMessage))
rc = true;
- }
+ XCloseDisplay(pDisplay);
LogRelFlowFunc(("returning %RTbool\n", rc));
return rc;
}
diff --git a/src/VBox/Additions/x11/VBoxClient/seamless.cpp b/src/VBox/Additions/x11/VBoxClient/seamless.cpp
index b55a560..399a966 100644
--- a/src/VBox/Additions/x11/VBoxClient/seamless.cpp
+++ b/src/VBox/Additions/x11/VBoxClient/seamless.cpp
@@ -17,9 +17,10 @@
* hope that it will be useful, but WITHOUT ANY WARRANTY of any kind.
*/
-/*****************************************************************************
-* Header files *
-*****************************************************************************/
+
+/*********************************************************************************************************************************
+* Header files *
+*********************************************************************************************************************************/
#include <X11/Xlib.h>
@@ -40,7 +41,7 @@ SeamlessMain::SeamlessMain(void)
mX11MonitorThread = NIL_RTTHREAD;
mX11MonitorThreadStopping = false;
mMode = VMMDev_Seamless_Disabled;
- mfPaused = false;
+ mfPaused = true;
}
SeamlessMain::~SeamlessMain()
@@ -86,9 +87,12 @@ int SeamlessMain::init(void)
rc = VbglR3SeamlessSetCap(true);
if (RT_FAILURE(rc))
break;
+ rc = startX11MonitorThread();
+ if (RT_FAILURE(rc))
+ break;
} while(0);
if (RT_FAILURE(rc))
- LogRel(("VBoxClient (seamless): failed to start. Stage: \"%s\" Error: %Rrc\n",
+ VBClFatalError(("VBoxClient (seamless): failed to start. Stage: \"%s\" Error: %Rrc\n",
pcszStage, rc));
return rc;
}
@@ -169,12 +173,11 @@ int SeamlessMain::nextStateChangeEvent(void)
}
if (RT_SUCCESS(rc) || rc == VERR_TRY_AGAIN)
{
- if (mMode == VMMDev_Seamless_Visible_Region && !mfPaused)
- /* This does it's own logging on failure. */
- rc = startX11MonitorThread();
+ if (mMode == VMMDev_Seamless_Visible_Region)
+ mfPaused = false;
else
- /* This does it's own logging on failure. */
- rc = stopX11MonitorThread();
+ mfPaused = true;
+ mX11Monitor.interruptEventWait();
}
else
{
@@ -184,11 +187,6 @@ int SeamlessMain::nextStateChangeEvent(void)
return rc;
}
-int SeamlessMain::cancelEvent(void)
-{
- return VbglR3InterruptEventWaits();
-}
-
/**
* The actual X11 window configuration change monitor thread function.
*/
@@ -198,12 +196,18 @@ int SeamlessMain::x11MonitorThread(RTTHREAD self, void *pvUser)
int rc = VINF_SUCCESS;
LogRelFlowFunc(("\n"));
- rc = pHost->mX11Monitor.start();
- if (RT_SUCCESS(rc))
+ while (!pHost->mX11MonitorThreadStopping)
{
- while (!pHost->mX11MonitorThreadStopping)
- pHost->mX11Monitor.nextConfigurationEvent();
- pHost->mX11Monitor.stop();
+ if (!pHost->mfPaused)
+ {
+ rc = pHost->mX11Monitor.start();
+ if (RT_FAILURE(rc))
+ VBClFatalError(("Failed to change the X11 seamless service state, mfPaused=%RTbool, rc=%Rrc\n",
+ pHost->mfPaused, rc));
+ }
+ pHost->mX11Monitor.nextConfigurationEvent();
+ if (pHost->mfPaused || pHost->mX11MonitorThreadStopping)
+ pHost->mX11Monitor.stop();
}
LogRelFlowFunc(("returning %Rrc\n", rc));
return rc;
@@ -247,54 +251,6 @@ int SeamlessMain::stopX11MonitorThread(void)
return rc;
}
-/** Pause the service loop. */
-int SeamlessMain::pause()
-{
- int rc;
- const char *pcszStage;
-
- LogRelFlowFunc(("\n"));
- mfPaused = true;
- do {
- pcszStage = "Reporting end of support for seamless capability";
- rc = VbglR3SeamlessSetCap(false);
- if (RT_FAILURE(rc))
- break;
- pcszStage = "Interrupting the event loop";
- rc = cancelEvent();
- if (RT_FAILURE(rc))
- break;
- } while (0);
- if (RT_FAILURE(rc))
- LogRelFunc(("Failure. Stage: \"%s\" Error: %Rrc (VBoxClient)\n",
- pcszStage, rc));
- return rc;
-}
-
-/** Resume after pausing. */
-int SeamlessMain::resume()
-{
- int rc;
- const char *pcszStage;
-
- LogRelFlowFunc(("\n"));
- mfPaused = false;
- do {
- pcszStage = "Reporting support for seamless capability";
- rc = VbglR3SeamlessSetCap(true);
- if (RT_FAILURE(rc))
- break;
- pcszStage = "Interrupting the event loop";
- rc = cancelEvent();
- if (RT_FAILURE(rc))
- break;
- } while (0);
- if (RT_FAILURE(rc))
- LogRelFunc(("Failure. Stage: \"%s\" Error: %Rrc (VBoxClient)\n",
- pcszStage, rc));
- return rc;
-}
-
/** @todo Expand this? */
int SeamlessMain::selfTest()
{
@@ -381,29 +337,12 @@ static int run(struct VBCLSERVICE **ppInterface, bool fDaemonised)
if (!pSelf->mIsInitialised)
return VERR_INTERNAL_ERROR;
- rc = VBClStartVTMonitor();
- if (RT_FAILURE(rc))
- VBClFatalError(("Failed to start the VT monitor thread: %Rrc\n", rc));
/* This only exits on error. */
rc = pSelf->mSeamless.run();
pSelf->mIsInitialised = false;
return rc;
}
-static int pause(struct VBCLSERVICE **ppInterface)
-{
- struct SEAMLESSSERVICE *pSelf = getClassFromInterface(ppInterface);
-
- return pSelf->mSeamless.pause();
-}
-
-static int resume(struct VBCLSERVICE **ppInterface)
-{
- struct SEAMLESSSERVICE *pSelf = getClassFromInterface(ppInterface);
-
- return pSelf->mSeamless.resume();
-}
-
static void cleanup(struct VBCLSERVICE **ppInterface)
{
NOREF(ppInterface);
@@ -416,8 +355,6 @@ struct VBCLSERVICE vbclSeamlessInterface =
getPidFilePath,
init,
run,
- pause,
- resume,
cleanup
};
diff --git a/src/VBox/Additions/x11/VBoxClient/seamless.h b/src/VBox/Additions/x11/VBoxClient/seamless.h
index fe4e6b1..20dc096 100644
--- a/src/VBox/Additions/x11/VBoxClient/seamless.h
+++ b/src/VBox/Additions/x11/VBoxClient/seamless.h
@@ -58,12 +58,6 @@ private:
*/
int nextStateChangeEvent(void);
- /**
- * Interrupt an event wait and cause the current or next
- * @a nextStateChangeEvent call to return immediately.
- */
- int cancelEvent(void);
-
/** Thread function to monitor X11 window configuration changes. */
static DECLCALLBACK(int) x11MonitorThread(RTTHREAD self, void *pvUser);
diff --git a/src/VBox/Additions/x11/VBoxClient/testcase/tstSeamlessX11-auto.cpp b/src/VBox/Additions/x11/VBoxClient/testcase/tstSeamlessX11-auto.cpp
index e53f8b3..f06bfcf 100644
--- a/src/VBox/Additions/x11/VBoxClient/testcase/tstSeamlessX11-auto.cpp
+++ b/src/VBox/Additions/x11/VBoxClient/testcase/tstSeamlessX11-auto.cpp
@@ -45,6 +45,12 @@ int XFree(void *data)
#define TEST_DISPLAY ((Display *)0xffff)
#define TEST_ROOT ((Window)1)
+extern void vbclFatalError(char *psz)
+{
+ RTPrintf("Fatal error: %s\n", psz);
+ exit(1);
+}
+
extern "C" Display *XOpenDisplay(const char *display_name);
Display *XOpenDisplay(const char *display_name)
{
diff --git a/src/VBox/Additions/x11/undefined_xfree86 b/src/VBox/Additions/x11/undefined_xfree86
index 18c4378..e80b681 100644
--- a/src/VBox/Additions/x11/undefined_xfree86
+++ b/src/VBox/Additions/x11/undefined_xfree86
@@ -82,6 +82,7 @@ DeclareExtensionSecurity
defaultColorVisualClass
defaultDPMSEnabled
DeleteCallback
+DeleteProperty
DeliverEvents
deltaSaveUndersViewable
DestroyFontRec
diff --git a/src/VBox/Additions/x11/vboxmouse/vboxmouse.c b/src/VBox/Additions/x11/vboxmouse/vboxmouse.c
index 242234c..251d717 100644
--- a/src/VBox/Additions/x11/vboxmouse/vboxmouse.c
+++ b/src/VBox/Additions/x11/vboxmouse/vboxmouse.c
@@ -185,8 +185,12 @@ VBoxProc(DeviceIntPtr device, int what)
if (device->public.on)
break;
/* Tell the host that we want absolute co-ordinates */
- rc = VbglR3SetMouseStatus( VMMDEV_MOUSE_GUEST_CAN_ABSOLUTE
- | VMMDEV_MOUSE_NEW_PROTOCOL);
+ rc = VbglR3GetMouseStatus(&fFeatures, NULL, NULL);
+ fFeatures &= VMMDEV_MOUSE_GUEST_NEEDS_HOST_CURSOR;
+ if (RT_SUCCESS(rc))
+ rc = VbglR3SetMouseStatus( fFeatures
+ | VMMDEV_MOUSE_GUEST_CAN_ABSOLUTE
+ | VMMDEV_MOUSE_NEW_PROTOCOL);
if (!RT_SUCCESS(rc)) {
xf86Msg(X_ERROR, "%s: Failed to switch guest mouse into absolute mode\n",
pInfo->name);
@@ -200,6 +204,7 @@ VBoxProc(DeviceIntPtr device, int what)
case DEVICE_OFF:
xf86Msg(X_INFO, "%s: Off.\n", pInfo->name);
rc = VbglR3GetMouseStatus(&fFeatures, NULL, NULL);
+ fFeatures &= VMMDEV_MOUSE_GUEST_NEEDS_HOST_CURSOR;
if (RT_SUCCESS(rc))
rc = VbglR3SetMouseStatus( fFeatures
& ~VMMDEV_MOUSE_GUEST_CAN_ABSOLUTE
diff --git a/src/VBox/Additions/x11/vboxvideo/vboxvideo.c b/src/VBox/Additions/x11/vboxvideo/vboxvideo.c
index ff0a5d0..0d5bc42 100644
--- a/src/VBox/Additions/x11/vboxvideo/vboxvideo.c
+++ b/src/VBox/Additions/x11/vboxvideo/vboxvideo.c
@@ -56,6 +56,7 @@
#include "vboxvideo.h"
#include <VBox/VBoxGuest.h>
+#include <VBox/VBoxGuestLib.h>
#include <VBox/Hardware/VBoxVideoVBE.h>
#include "version-generated.h"
#include "product-generated.h"
@@ -99,12 +100,6 @@
# include <string.h>
#endif
-/* This was accepted upstream in X.Org Server 1.16 which bumped the video
- * driver ABI to 17. */
-#if GET_ABI_MAJOR(ABI_VIDEODRV_VERSION) < 17
-# define SET_HAVE_VT_PROPERTY
-#endif
-
/* Mandatory functions */
static const OptionInfoRec * VBOXAvailableOptions(int chipid, int busid);
@@ -299,11 +294,19 @@ static Bool adjustScreenPixmap(ScrnInfoPtr pScrn, int width, int height)
}
/** Set a video mode to the hardware, RandR 1.1 version. Since we no longer do
- * virtual frame buffers, adjust the screen pixmap dimensions to match. */
-static void setModeRandR11(ScrnInfoPtr pScrn, DisplayModePtr pMode, bool fScreenInitTime, bool fEnterVTTime)
+ * virtual frame buffers, adjust the screen pixmap dimensions to match. The
+ * "override" parameters are for when we received a mode hint while switched to
+ * a virtual terminal. In this case VBoxClient will have told us about the
+ * mode, but not yet been able to do a mode switch using RandR. We solve this
+ * by setting the requested mode to the host but keeping the virtual frame-
+ * buffer matching what the X server expects. */
+static void setModeRandR11(ScrnInfoPtr pScrn, DisplayModePtr pMode, bool fScreenInitTime, bool fEnterVTTime,
+ int cXOverRide, int cYOverRide)
{
VBOXPtr pVBox = VBOXGetRec(pScrn);
struct vbvxFrameBuffer frameBuffer = { 0, 0, pMode->HDisplay, pMode->VDisplay, pScrn->bitsPerPixel};
+ int cXPhysical = cXOverRide > 0 ? min(cXOverRide, pMode->HDisplay) : pMode->HDisplay;
+ int cYPhysical = cYOverRide > 0 ? min(cYOverRide, pMode->VDisplay) : pMode->VDisplay;
pVBox->pScreens[0].aScreenLocation.cx = pMode->HDisplay;
pVBox->pScreens[0].aScreenLocation.cy = pMode->VDisplay;
@@ -329,7 +332,7 @@ static void setModeRandR11(ScrnInfoPtr pScrn, DisplayModePtr pMode, bool fScreen
pScrn->vtSema = TRUE;
}
if (pMode->HDisplay != 0 && pMode->VDisplay != 0 && pScrn->vtSema)
- vbvxSetMode(pScrn, 0, pMode->HDisplay, pMode->VDisplay, 0, 0, true, true, &frameBuffer);
+ vbvxSetMode(pScrn, 0, cXPhysical, cYPhysical, 0, 0, true, true, &frameBuffer);
pScrn->currentMode = pMode;
}
@@ -995,51 +998,31 @@ vboxLoadPalette(ScrnInfoPtr pScrn, int numColors, int *indices,
(void)pVisual;
}
-#define HAS_VT_ATOM_NAME "XFree86_has_VT"
-#define VBOXVIDEO_DRIVER_ATOM_NAME "VBOXVIDEO_DRIVER_IN_USE"
-/* The memory storing the initial value of the XFree86_has_VT root window
- * property. This has to remain available until server start-up, so we just
- * use a global. */
-static CARD32 InitialPropertyValue = 1;
-
-/** Initialise a flag property on the root window to say whether the server VT
- * is currently the active one as some clients need to know this. */
-static void initialiseProperties(ScrnInfoPtr pScrn)
+/** Set the graphics and guest cursor support capabilities to the host if
+ * the user-space helper is running. */
+static void updateGraphicsCapability(ScrnInfoPtr pScrn, Bool hasVT)
{
- Atom atom = -1;
- CARD32 *PropertyValue = &InitialPropertyValue;
-#ifdef SET_HAVE_VT_PROPERTY
- atom = MakeAtom(HAS_VT_ATOM_NAME, sizeof(HAS_VT_ATOM_NAME) - 1, TRUE);
- if (xf86RegisterRootWindowProperty(pScrn->scrnIndex, atom, XA_INTEGER,
- 32, 1, PropertyValue) != Success)
- FatalError("vboxvideo: failed to register VT property\n");
-#endif /* SET_HAVE_VT_PROPERTY */
- atom = MakeAtom(VBOXVIDEO_DRIVER_ATOM_NAME,
- sizeof(VBOXVIDEO_DRIVER_ATOM_NAME) - 1, TRUE);
- if (xf86RegisterRootWindowProperty(pScrn->scrnIndex, atom, XA_INTEGER,
- 32, 1, PropertyValue) != Success)
- FatalError("vboxvideo: failed to register driver in use property\n");
-}
+ VBOXPtr pVBox = VBOXGetRec(pScrn);
+ size_t cData;
+ int32_t *paData;
+ int rc;
-#ifdef SET_HAVE_VT_PROPERTY
-/** Update a flag property on the root window to say whether the server VT
- * is currently the active one as some clients need to know this. */
-static void updateHasVTProperty(ScrnInfoPtr pScrn, Bool hasVT)
-{
- Atom property_name;
- int32_t value = hasVT ? 1 : 0;
- int i;
-
- property_name = MakeAtom(HAS_VT_ATOM_NAME, sizeof(HAS_VT_ATOM_NAME) - 1,
- FALSE);
- if (property_name == BAD_RESOURCE)
- FatalError("Failed to retrieve \"HAS_VT\" atom\n");
- if (ROOT_WINDOW(pScrn) == NULL)
+ if (pVBox->fHaveHGSMIModeHints)
+ return;
+ rc = vbvxGetIntegerPropery(pScrn, "VBOX_HAS_GRAPHICS", &cData, &paData);
+ if (rc != VINF_SUCCESS || cData != 1)
return;
- ChangeWindowProperty(ROOT_WINDOW(pScrn), property_name, XA_INTEGER, 32,
- PropModeReplace, 1, &value, TRUE);
+ if (RT_BOOL(*paData) != hasVT)
+ {
+ uint32_t fFeatures;
+ VbglR3SetGuestCaps(hasVT ? VMMDEV_GUEST_SUPPORTS_GRAPHICS : 0, hasVT ? 0 : VMMDEV_GUEST_SUPPORTS_GRAPHICS);
+ rc = VbglR3GetMouseStatus(&fFeatures, NULL, NULL);
+ fFeatures &= VMMDEV_MOUSE_GUEST_CAN_ABSOLUTE | VMMDEV_MOUSE_NEW_PROTOCOL;
+ if (RT_SUCCESS(rc))
+ VbglR3SetMouseStatus(hasVT ? fFeatures : fFeatures | VMMDEV_MOUSE_GUEST_NEEDS_HOST_CURSOR);
+ }
+ *paData = hasVT;
}
-#endif /* SET_HAVE_VT_PROPERTY */
#ifdef VBOXVIDEO_13
@@ -1168,7 +1151,7 @@ static void setSizesAndCursorIntegration(ScrnInfoPtr pScrn, bool fScreenInitTime
* that the X server goes to sleep (to catch the property change request).
* Although this is far more often than necessary it should not have real-life
* performance consequences and allows us to simplify the code quite a bit. */
-static void updateSizeHintsBlockHandler(pointer pData, OSTimePtr pTimeout, pointer pReadmask)
+static void vboxBlockHandler(pointer pData, OSTimePtr pTimeout, pointer pReadmask)
{
ScrnInfoPtr pScrn = (ScrnInfoPtr)pData;
VBOXPtr pVBox = VBOXGetRec(pScrn);
@@ -1176,9 +1159,12 @@ static void updateSizeHintsBlockHandler(pointer pData, OSTimePtr pTimeout, point
(void)pTimeout;
(void)pReadmask;
- if (!pScrn->vtSema)
- return;
- vbvxReadSizesAndCursorIntegrationFromHGSMI(pScrn, &fNeedUpdate);
+ updateGraphicsCapability(pScrn, pScrn->vtSema);
+ if (pScrn->vtSema)
+ vbvxReadSizesAndCursorIntegrationFromHGSMI(pScrn, &fNeedUpdate);
+ /* This has to be done even when we are switched out so that VBoxClient can
+ * set a mode using RandR without having to know the virtual terminal state.
+ */
if (ROOT_WINDOW(pScrn) != NULL)
vbvxReadSizesAndCursorIntegrationFromProperties(pScrn, &fNeedUpdate);
if (fNeedUpdate)
@@ -1207,6 +1193,8 @@ static Bool VBOXScreenInit(ScreenPtr pScreen, int argc, char **argv)
TRACE_ENTRY();
+ /* Initialise our guest library if possible: ignore failure. */
+ VbglR3Init();
if (!VBOXMapVidMem(pScrn))
return (FALSE);
@@ -1339,11 +1327,11 @@ static Bool VBOXScreenInit(ScreenPtr pScreen, int argc, char **argv)
setSizesAndCursorIntegration(pScrn, true);
#else
/* set first video mode */
- setModeRandR11(pScrn, pScrn->currentMode, true, false);
+ setModeRandR11(pScrn, pScrn->currentMode, true, false, 0, 0);
#endif
/* Register block and wake-up handlers for getting new screen size hints. */
- RegisterBlockAndWakeupHandlers(updateSizeHintsBlockHandler, (WakeupHandlerProcPtr)NoopDDA, (pointer)pScrn);
+ RegisterBlockAndWakeupHandlers(vboxBlockHandler, (WakeupHandlerProcPtr)NoopDDA, (pointer)pScrn);
/* software cursor */
miDCInitialize(pScreen, xf86GetPointerScreenFuncs());
@@ -1384,16 +1372,24 @@ static Bool VBOXScreenInit(ScreenPtr pScreen, int argc, char **argv)
pVBox->useDRI = VBOXDRIFinishScreenInit(pScreen);
#endif
- initialiseProperties(pScrn);
-
return (TRUE);
}
+#define NO_VT_ATOM_NAME "VBOXVIDEO_NO_VT"
+
static Bool VBOXEnterVT(ScrnInfoPtr pScrn)
{
VBOXPtr pVBox = VBOXGetRec(pScrn);
+#ifndef VBOXVIDEO_13
+ /* If we got a mode request while we were switched out, temporarily override
+ * the physical mode set to the device while keeping things consistent from
+ * the server's point of view. */
+ int cXOverRide = RT_CLAMP(pVBox->pScreens[0].aPreferredSize.cx, VBOX_VIDEO_MIN_SIZE, VBOX_VIDEO_MAX_VIRTUAL);
+ int cYOverRide = RT_CLAMP(pVBox->pScreens[0].aPreferredSize.cy, VBOX_VIDEO_MIN_SIZE, VBOX_VIDEO_MAX_VIRTUAL);
+#endif
TRACE_ENTRY();
+ updateGraphicsCapability(pScrn, TRUE);
#ifdef VBOX_DRI_OLD
if (pVBox->useDRI)
DRIUnlock(xf86ScrnToScreen(pScrn));
@@ -1409,13 +1405,10 @@ static Bool VBOXEnterVT(ScrnInfoPtr pScrn)
/* Re-set video mode */
#ifdef VBOXVIDEO_13
vbvxReadSizesAndCursorIntegrationFromHGSMI(pScrn, NULL);
- vbvxReadSizesAndCursorIntegrationFromProperties(pScrn, NULL);
setSizesAndCursorIntegration(pScrn, false);
#else
- setModeRandR11(pScrn, pScrn->currentMode, false, true);
-#endif
-#ifdef SET_HAVE_VT_PROPERTY
- updateHasVTProperty(pScrn, TRUE);
+ setModeRandR11(pScrn, pScrn->currentMode, false, true, cXOverRide, cYOverRide);
+ DeleteProperty(ROOT_WINDOW(pScrn), MakeAtom(NO_VT_ATOM_NAME, sizeof(NO_VT_ATOM_NAME) - 1, TRUE));
#endif
return TRUE;
}
@@ -1425,12 +1418,18 @@ static void VBOXLeaveVT(ScrnInfoPtr pScrn)
VBOXPtr pVBox = VBOXGetRec(pScrn);
#ifdef VBOXVIDEO_13
unsigned i;
+#else
+ int32_t propertyValue = 0;
#endif
TRACE_ENTRY();
+ updateGraphicsCapability(pScrn, FALSE);
#ifdef VBOXVIDEO_13
for (i = 0; i < pVBox->cScreens; ++i)
vbox_crtc_dpms(pVBox->pScreens[i].paCrtcs, DPMSModeOff);
+#else
+ ChangeWindowProperty(ROOT_WINDOW(pScrn), MakeAtom(NO_VT_ATOM_NAME, sizeof(NO_VT_ATOM_NAME) - 1, FALSE), XA_INTEGER, 32,
+ PropModeReplace, 1, &propertyValue, TRUE);
#endif
vboxDisableVbva(pScrn);
vbvxClearVRAM(pScrn, ((size_t)pScrn->virtualX) * pScrn->virtualY * (pScrn->bitsPerPixel / 8), 0);
@@ -1442,9 +1441,6 @@ static void VBOXLeaveVT(ScrnInfoPtr pScrn)
drmDropMaster(pVBox->drmFD);
#endif
VBOXRestoreMode(pScrn);
-#ifdef SET_HAVE_VT_PROPERTY
- updateHasVTProperty(pScrn, FALSE);
-#endif
TRACE_EXIT();
}
@@ -1455,6 +1451,8 @@ static Bool VBOXCloseScreen(ScreenPtr pScreen)
#if defined(VBOX_DRI) && !defined(VBOX_DRI_OLD) /* DRI2 */
BOOL fRestore = TRUE;
#endif
+ BOOL ret;
+
if (pScrn->vtSema)
{
#ifdef VBOXVIDEO_13
@@ -1493,10 +1491,12 @@ static Bool VBOXCloseScreen(ScreenPtr pScreen)
vbvxCleanUpLinuxACPI(pScreen);
#endif
#ifndef XF86_SCRN_INTERFACE
- return pScreen->CloseScreen(pScreen->myNum, pScreen);
+ ret = pScreen->CloseScreen(pScreen->myNum, pScreen);
#else
- return pScreen->CloseScreen(pScreen);
+ ret = pScreen->CloseScreen(pScreen);
#endif
+ VbglR3Term();
+ return ret;
}
static Bool VBOXSwitchMode(ScrnInfoPtr pScrn, DisplayModePtr pMode)
@@ -1507,7 +1507,7 @@ static Bool VBOXSwitchMode(ScrnInfoPtr pScrn, DisplayModePtr pMode)
#ifdef VBOXVIDEO_13
rc = xf86SetSingleMode(pScrn, pMode, RR_Rotate_0);
#else
- setModeRandR11(pScrn, pMode, false, false);
+ setModeRandR11(pScrn, pMode, false, false, 0, 0);
#endif
TRACE_LOG("returning %s\n", rc ? "TRUE" : "FALSE");
return rc;
diff --git a/src/VBox/Additions/x11/vboxvideo/vbva.c b/src/VBox/Additions/x11/vboxvideo/vbva.c
index f3a1360..fcd3fbb 100644
--- a/src/VBox/Additions/x11/vboxvideo/vbva.c
+++ b/src/VBox/Additions/x11/vboxvideo/vbva.c
@@ -129,8 +129,7 @@ void vbvxSetUpHGSMIHeapInGuest(VBOXPtr pVBox, uint32_t cbVRAM)
}
/** Callback to fill in the view structures */
-static int
-vboxFillViewInfo(void *pvVBox, struct VBVAINFOVIEW *pViews, uint32_t cViews)
+static DECLCALLBACK(int) vboxFillViewInfo(void *pvVBox, struct VBVAINFOVIEW *pViews, uint32_t cViews)
{
VBOXPtr pVBox = (VBOXPtr)pvVBox;
unsigned i;
diff --git a/src/VBox/Debugger/DBGCBuiltInSymbols.cpp b/src/VBox/Debugger/DBGCBuiltInSymbols.cpp
index d40ab94..607f110 100644
--- a/src/VBox/Debugger/DBGCBuiltInSymbols.cpp
+++ b/src/VBox/Debugger/DBGCBuiltInSymbols.cpp
@@ -15,9 +15,10 @@
* hope that it will be useful, but WITHOUT ANY WARRANTY of any kind.
*/
-/*******************************************************************************
-* Header Files *
-*******************************************************************************/
+
+/*********************************************************************************************************************************
+* Header Files *
+*********************************************************************************************************************************/
#define LOG_GROUP LOG_GROUP_DBGC
#include "DBGCInternal.h"
diff --git a/src/VBox/Debugger/DBGCCmdHlp.cpp b/src/VBox/Debugger/DBGCCmdHlp.cpp
index eb0e8f6..5400d33 100644
--- a/src/VBox/Debugger/DBGCCmdHlp.cpp
+++ b/src/VBox/Debugger/DBGCCmdHlp.cpp
@@ -15,9 +15,10 @@
* hope that it will be useful, but WITHOUT ANY WARRANTY of any kind.
*/
-/*******************************************************************************
-* Header Files *
-*******************************************************************************/
+
+/*********************************************************************************************************************************
+* Header Files *
+*********************************************************************************************************************************/
#define LOG_GROUP LOG_GROUP_DBGC
#include <VBox/dbg.h>
#include <VBox/vmm/dbgf.h>
diff --git a/src/VBox/Debugger/DBGCCmdWorkers.cpp b/src/VBox/Debugger/DBGCCmdWorkers.cpp
index c9f7a8c..05da6c1 100644
--- a/src/VBox/Debugger/DBGCCmdWorkers.cpp
+++ b/src/VBox/Debugger/DBGCCmdWorkers.cpp
@@ -15,9 +15,10 @@
* hope that it will be useful, but WITHOUT ANY WARRANTY of any kind.
*/
-/*******************************************************************************
-* Header Files *
-*******************************************************************************/
+
+/*********************************************************************************************************************************
+* Header Files *
+*********************************************************************************************************************************/
#define LOG_GROUP LOG_GROUP_DBGC
#include <VBox/dbg.h>
#include <VBox/vmm/dbgf.h>
diff --git a/src/VBox/Debugger/DBGCCommands.cpp b/src/VBox/Debugger/DBGCCommands.cpp
index 02f0b5b..911ee1f 100644
--- a/src/VBox/Debugger/DBGCCommands.cpp
+++ b/src/VBox/Debugger/DBGCCommands.cpp
@@ -15,9 +15,10 @@
* hope that it will be useful, but WITHOUT ANY WARRANTY of any kind.
*/
-/*******************************************************************************
-* Header Files *
-*******************************************************************************/
+
+/*********************************************************************************************************************************
+* Header Files *
+*********************************************************************************************************************************/
#define LOG_GROUP LOG_GROUP_DBGC
#include <VBox/dbg.h>
#include <VBox/vmm/dbgf.h>
@@ -44,9 +45,9 @@
#include "DBGCInternal.h"
-/*******************************************************************************
-* Internal Functions *
-*******************************************************************************/
+/*********************************************************************************************************************************
+* Internal Functions *
+*********************************************************************************************************************************/
static FNDBGCCMD dbgcCmdHelp;
static FNDBGCCMD dbgcCmdQuit;
static FNDBGCCMD dbgcCmdStop;
@@ -75,9 +76,9 @@ static FNDBGCCMD dbgcCmdRunScript;
static FNDBGCCMD dbgcCmdWriteCore;
-/*******************************************************************************
-* Global Variables *
-*******************************************************************************/
+/*********************************************************************************************************************************
+* Global Variables *
+*********************************************************************************************************************************/
/** One argument of any kind. */
static const DBGCVARDESC g_aArgAny[] =
{
diff --git a/src/VBox/Debugger/DBGCEmulateCodeView.cpp b/src/VBox/Debugger/DBGCEmulateCodeView.cpp
index 7cdabe2..d99badd 100644
--- a/src/VBox/Debugger/DBGCEmulateCodeView.cpp
+++ b/src/VBox/Debugger/DBGCEmulateCodeView.cpp
@@ -15,9 +15,10 @@
* hope that it will be useful, but WITHOUT ANY WARRANTY of any kind.
*/
-/*******************************************************************************
-* Header Files *
-*******************************************************************************/
+
+/*********************************************************************************************************************************
+* Header Files *
+*********************************************************************************************************************************/
#define LOG_GROUP LOG_GROUP_DBGC
#include <VBox/dbg.h>
#include <VBox/vmm/dbgf.h>
@@ -40,9 +41,9 @@
#include "DBGCInternal.h"
-/*******************************************************************************
-* Internal Functions *
-*******************************************************************************/
+/*********************************************************************************************************************************
+* Internal Functions *
+*********************************************************************************************************************************/
static FNDBGCCMD dbgcCmdBrkAccess;
static FNDBGCCMD dbgcCmdBrkClear;
static FNDBGCCMD dbgcCmdBrkDisable;
@@ -76,9 +77,9 @@ static FNDBGCCMD dbgcCmdTrace;
static FNDBGCCMD dbgcCmdUnassemble;
-/*******************************************************************************
-* Global Variables *
-*******************************************************************************/
+/*********************************************************************************************************************************
+* Global Variables *
+*********************************************************************************************************************************/
/** 'ba' arguments. */
static const DBGCVARDESC g_aArgBrkAcc[] =
{
diff --git a/src/VBox/Debugger/DBGCEval.cpp b/src/VBox/Debugger/DBGCEval.cpp
index b4c12f3..0034d6a 100644
--- a/src/VBox/Debugger/DBGCEval.cpp
+++ b/src/VBox/Debugger/DBGCEval.cpp
@@ -15,9 +15,10 @@
* hope that it will be useful, but WITHOUT ANY WARRANTY of any kind.
*/
-/*******************************************************************************
-* Header Files *
-*******************************************************************************/
+
+/*********************************************************************************************************************************
+* Header Files *
+*********************************************************************************************************************************/
#define LOG_GROUP LOG_GROUP_DBGC
#include <VBox/dbg.h>
#include <VBox/err.h>
@@ -35,16 +36,16 @@
#define BETTER_ARGUMENT_MATCHING
-/*******************************************************************************
-* Global Variables *
-*******************************************************************************/
+/*********************************************************************************************************************************
+* Global Variables *
+*********************************************************************************************************************************/
/** Bitmap where set bits indicates the characters the may start an operator name. */
static uint32_t g_bmOperatorChars[256 / (4*8)];
-/*******************************************************************************
-* Internal Functions *
-*******************************************************************************/
+/*********************************************************************************************************************************
+* Internal Functions *
+*********************************************************************************************************************************/
static int dbgcCheckAndTypePromoteArgument(PDBGC pDbgc, DBGCVARCAT enmCategory, PDBGCVAR pArg);
static int dbgcProcessArguments(PDBGC pDbgc, const char *pszCmdOrFunc,
uint32_t const cArgsMin, uint32_t const cArgsMax,
diff --git a/src/VBox/Debugger/DBGCFunctions.cpp b/src/VBox/Debugger/DBGCFunctions.cpp
index ef500cf..a0f8a98 100644
--- a/src/VBox/Debugger/DBGCFunctions.cpp
+++ b/src/VBox/Debugger/DBGCFunctions.cpp
@@ -15,9 +15,10 @@
* hope that it will be useful, but WITHOUT ANY WARRANTY of any kind.
*/
-/*******************************************************************************
-* Header Files *
-*******************************************************************************/
+
+/*********************************************************************************************************************************
+* Header Files *
+*********************************************************************************************************************************/
#define LOG_GROUP LOG_GROUP_DBGC
#include <VBox/dbg.h>
#include <VBox/vmm/dbgf.h>
@@ -32,9 +33,9 @@
-/*******************************************************************************
-* Global Variables *
-*******************************************************************************/
+/*********************************************************************************************************************************
+* Global Variables *
+*********************************************************************************************************************************/
/** Pointer to head of the list of exteranl functions. */
static PDBGCEXTFUNCS g_pExtFuncsHead;
diff --git a/src/VBox/Debugger/DBGCGdbRemoteStub.cpp b/src/VBox/Debugger/DBGCGdbRemoteStub.cpp
index 17f02fa..0708147 100644
--- a/src/VBox/Debugger/DBGCGdbRemoteStub.cpp
+++ b/src/VBox/Debugger/DBGCGdbRemoteStub.cpp
@@ -16,9 +16,9 @@
*/
-/*******************************************************************************
-* Header Files *
-*******************************************************************************/
+/*********************************************************************************************************************************
+* Header Files *
+*********************************************************************************************************************************/
#include <VBox/dbg.h>
#include <VBox/vmm/dbgf.h>
#include <VBox/err.h>
diff --git a/src/VBox/Debugger/DBGCOps.cpp b/src/VBox/Debugger/DBGCOps.cpp
index a1578b7..39cb501 100644
--- a/src/VBox/Debugger/DBGCOps.cpp
+++ b/src/VBox/Debugger/DBGCOps.cpp
@@ -16,9 +16,9 @@
*/
-/*******************************************************************************
-* Header Files *
-*******************************************************************************/
+/*********************************************************************************************************************************
+* Header Files *
+*********************************************************************************************************************************/
#define LOG_GROUP LOG_GROUP_DBGC
#include <VBox/dbg.h>
#include <VBox/vmm/dbgf.h>
@@ -33,9 +33,9 @@
#include "DBGCInternal.h"
-/*******************************************************************************
-* Internal Functions *
-*******************************************************************************/
+/*********************************************************************************************************************************
+* Internal Functions *
+*********************************************************************************************************************************/
static DECLCALLBACK(int) dbgcOpMinus(PDBGC pDbgc, PCDBGCVAR pArg, DBGCVARCAT enmCat, PDBGCVAR pResult);
static DECLCALLBACK(int) dbgcOpPluss(PDBGC pDbgc, PCDBGCVAR pArg, DBGCVARCAT enmCat, PDBGCVAR pResult);
static DECLCALLBACK(int) dbgcOpBooleanNot(PDBGC pDbgc, PCDBGCVAR pArg, DBGCVARCAT enmCat, PDBGCVAR pResult);
@@ -60,9 +60,9 @@ static DECLCALLBACK(int) dbgcOpRangeLengthBytes(PDBGC pDbgc, PCDBGCVAR pArg1, PC
static DECLCALLBACK(int) dbgcOpRangeTo(PDBGC pDbgc, PCDBGCVAR pArg1, PCDBGCVAR pArg2, PDBGCVAR pResult);
-/*******************************************************************************
-* Defined Constants And Macros *
-*******************************************************************************/
+/*********************************************************************************************************************************
+* Defined Constants And Macros *
+*********************************************************************************************************************************/
/**
* Generic implementation of a binary operator.
*
@@ -149,9 +149,9 @@ static DECLCALLBACK(int) dbgcOpRangeTo(PDBGC pDbgc, PCDBGCVAR pArg1, PCDBGCVAR p
} while (0)
-/*******************************************************************************
-* Global Variables *
-*******************************************************************************/
+/*********************************************************************************************************************************
+* Global Variables *
+*********************************************************************************************************************************/
/** Operators. */
const DBGCOP g_aDbgcOps[] =
{
diff --git a/src/VBox/Debugger/DBGCTcp.cpp b/src/VBox/Debugger/DBGCTcp.cpp
index 6b96289..3231f2d 100644
--- a/src/VBox/Debugger/DBGCTcp.cpp
+++ b/src/VBox/Debugger/DBGCTcp.cpp
@@ -16,9 +16,9 @@
*/
-/*******************************************************************************
-* Header Files *
-*******************************************************************************/
+/*********************************************************************************************************************************
+* Header Files *
+*********************************************************************************************************************************/
#include <VBox/dbg.h>
#include <VBox/vmm/cfgm.h>
#include <VBox/err.h>
@@ -31,9 +31,9 @@
#include <iprt/string.h>
-/*******************************************************************************
-* Structures and Typedefs *
-*******************************************************************************/
+/*********************************************************************************************************************************
+* Structures and Typedefs *
+*********************************************************************************************************************************/
/**
* Debug console TCP backend instance data.
*/
@@ -53,10 +53,10 @@ typedef DBGCTCP *PDBGCTCP;
#define DBGCTCP_BACK2DBGCTCP(pBack) ( (PDBGCTCP)((char *)pBack - RT_OFFSETOF(DBGCTCP, Back)) )
-/*******************************************************************************
-* Internal Functions *
-*******************************************************************************/
-static int dbgcTcpConnection(RTSOCKET Sock, void *pvUser);
+/*********************************************************************************************************************************
+* Internal Functions *
+*********************************************************************************************************************************/
+static DECLCALLBACK(int) dbgcTcpConnection(RTSOCKET Sock, void *pvUser);
diff --git a/src/VBox/Debugger/DBGConsole.cpp b/src/VBox/Debugger/DBGConsole.cpp
index 812ba35..48ec175 100644
--- a/src/VBox/Debugger/DBGConsole.cpp
+++ b/src/VBox/Debugger/DBGConsole.cpp
@@ -155,9 +155,9 @@
*/
-/*******************************************************************************
-* Header Files *
-*******************************************************************************/
+/*********************************************************************************************************************************
+* Header Files *
+*********************************************************************************************************************************/
#define LOG_GROUP LOG_GROUP_DBGC
#include <VBox/dbg.h>
#include <VBox/vmm/dbgf.h>
@@ -175,9 +175,9 @@
#include "DBGPlugIns.h"
-/*******************************************************************************
-* Internal Functions *
-*******************************************************************************/
+/*********************************************************************************************************************************
+* Internal Functions *
+*********************************************************************************************************************************/
static int dbgcProcessLog(PDBGC pDbgc);
diff --git a/src/VBox/Debugger/DBGPlugInCommonELF.cpp b/src/VBox/Debugger/DBGPlugInCommonELF.cpp
index 2c0bc64..5658990 100644
--- a/src/VBox/Debugger/DBGPlugInCommonELF.cpp
+++ b/src/VBox/Debugger/DBGPlugInCommonELF.cpp
@@ -16,9 +16,9 @@
*/
-/*******************************************************************************
-* Header Files *
-*******************************************************************************/
+/*********************************************************************************************************************************
+* Header Files *
+*********************************************************************************************************************************/
#define LOG_GROUP LOG_GROUP_DBGF ///@todo add new log group.
#include "DBGPlugInCommonELF.h"
@@ -31,9 +31,9 @@
#include <iprt/string.h>
-/*******************************************************************************
-* Structures and Typedefs *
-*******************************************************************************/
+/*********************************************************************************************************************************
+* Structures and Typedefs *
+*********************************************************************************************************************************/
typedef struct DBGDIGGERELFSEG
{
/** The segment load address. */
diff --git a/src/VBox/Debugger/DBGPlugInDarwin.cpp b/src/VBox/Debugger/DBGPlugInDarwin.cpp
index 125b8c3..f23de69 100644
--- a/src/VBox/Debugger/DBGPlugInDarwin.cpp
+++ b/src/VBox/Debugger/DBGPlugInDarwin.cpp
@@ -16,9 +16,9 @@
*/
-/*******************************************************************************
-* Header Files *
-*******************************************************************************/
+/*********************************************************************************************************************************
+* Header Files *
+*********************************************************************************************************************************/
#define LOG_GROUP LOG_GROUP_DBGF ///@todo add new log group.
#include "DBGPlugIns.h"
#include <VBox/vmm/dbgf.h>
@@ -30,9 +30,9 @@
#include <iprt/formats/mach-o.h>
-/*******************************************************************************
-* Structures and Typedefs *
-*******************************************************************************/
+/*********************************************************************************************************************************
+* Structures and Typedefs *
+*********************************************************************************************************************************/
/** @name Internal Darwin structures
* @{ */
@@ -109,9 +109,9 @@ typedef struct DBGDIGGERDARWIN
typedef DBGDIGGERDARWIN *PDBGDIGGERDARWIN;
-/*******************************************************************************
-* Defined Constants And Macros *
-*******************************************************************************/
+/*********************************************************************************************************************************
+* Defined Constants And Macros *
+*********************************************************************************************************************************/
/** Validates a 32-bit darwin kernel address */
#define OSX32_VALID_ADDRESS(Addr) ((Addr) > UINT32_C(0x00001000) && (Addr) < UINT32_C(0xfffff000))
/** Validates a 64-bit darwin kernel address */
@@ -124,9 +124,9 @@ typedef DBGDIGGERDARWIN *PDBGDIGGERDARWIN;
#define DIG_DARWIN_MOD_TAG UINT64_C(0x58734f656c707041)
-/*******************************************************************************
-* Internal Functions *
-*******************************************************************************/
+/*********************************************************************************************************************************
+* Internal Functions *
+*********************************************************************************************************************************/
static DECLCALLBACK(int) dbgDiggerDarwinInit(PUVM pUVM, void *pvData);
diff --git a/src/VBox/Debugger/DBGPlugInDiggers.cpp b/src/VBox/Debugger/DBGPlugInDiggers.cpp
index 7b2e4ee..aba25b2 100644
--- a/src/VBox/Debugger/DBGPlugInDiggers.cpp
+++ b/src/VBox/Debugger/DBGPlugInDiggers.cpp
@@ -16,9 +16,9 @@
*/
-/*******************************************************************************
-* Header Files *
-*******************************************************************************/
+/*********************************************************************************************************************************
+* Header Files *
+*********************************************************************************************************************************/
#define LOG_GROUP LOG_GROUP_DBGC
#include <VBox/dbg.h>
#include <VBox/vmm/dbgf.h>
diff --git a/src/VBox/Debugger/DBGPlugInLinux.cpp b/src/VBox/Debugger/DBGPlugInLinux.cpp
index 299c44b..a8f268c 100644
--- a/src/VBox/Debugger/DBGPlugInLinux.cpp
+++ b/src/VBox/Debugger/DBGPlugInLinux.cpp
@@ -16,9 +16,9 @@
*/
-/*******************************************************************************
-* Header Files *
-*******************************************************************************/
+/*********************************************************************************************************************************
+* Header Files *
+*********************************************************************************************************************************/
#define LOG_GROUP LOG_GROUP_DBGF ///@todo add new log group.
#include "DBGPlugIns.h"
#include "DBGPlugInCommonELF.h"
@@ -29,9 +29,9 @@
#include <iprt/ctype.h>
-/*******************************************************************************
-* Structures and Typedefs *
-*******************************************************************************/
+/*********************************************************************************************************************************
+* Structures and Typedefs *
+*********************************************************************************************************************************/
/** @name InternalLinux structures
* @{ */
@@ -112,9 +112,9 @@ typedef LNXPRINTKHDR *PLNXPRINTKHDR;
typedef LNXPRINTKHDR const *PCLNXPRINTKHDR;
-/*******************************************************************************
-* Defined Constants And Macros *
-*******************************************************************************/
+/*********************************************************************************************************************************
+* Defined Constants And Macros *
+*********************************************************************************************************************************/
/** Validates a 32-bit linux kernel address */
#define LNX32_VALID_ADDRESS(Addr) ((Addr) > UINT32_C(0x80000000) && (Addr) < UINT32_C(0xfffff000))
/** Validates a 64-bit linux kernel address */
@@ -143,15 +143,15 @@ typedef LNXPRINTKHDR const *PCLNXPRINTKHDR;
#define DIG_LNX_MOD_TAG UINT64_C(0x545f5d78758e898c)
-/*******************************************************************************
-* Internal Functions *
-*******************************************************************************/
+/*********************************************************************************************************************************
+* Internal Functions *
+*********************************************************************************************************************************/
static DECLCALLBACK(int) dbgDiggerLinuxInit(PUVM pUVM, void *pvData);
-/*******************************************************************************
-* Global Variables *
-*******************************************************************************/
+/*********************************************************************************************************************************
+* Global Variables *
+*********************************************************************************************************************************/
/** Table of common linux kernel addresses. */
static uint64_t g_au64LnxKernelAddresses[] =
{
diff --git a/src/VBox/Debugger/DBGPlugInOS2.cpp b/src/VBox/Debugger/DBGPlugInOS2.cpp
index dd1bc70..dd1bd5c 100644
--- a/src/VBox/Debugger/DBGPlugInOS2.cpp
+++ b/src/VBox/Debugger/DBGPlugInOS2.cpp
@@ -16,9 +16,9 @@
*/
-/*******************************************************************************
-* Header Files *
-*******************************************************************************/
+/*********************************************************************************************************************************
+* Header Files *
+*********************************************************************************************************************************/
#define LOG_GROUP LOG_GROUP_DBGF ///@todo add new log group.
#include "DBGPlugIns.h"
#include <VBox/vmm/dbgf.h>
@@ -29,9 +29,9 @@
#include <iprt/stream.h>
-/*******************************************************************************
-* Structures and Typedefs *
-*******************************************************************************/
+/*********************************************************************************************************************************
+* Structures and Typedefs *
+*********************************************************************************************************************************/
/** @name Internal OS/2 structures */
@@ -72,24 +72,25 @@ typedef struct DBGDIGGEROS2
typedef DBGDIGGEROS2 *PDBGDIGGEROS2;
-/*******************************************************************************
-* Defined Constants And Macros *
-*******************************************************************************/
+/*********************************************************************************************************************************
+* Defined Constants And Macros *
+*********************************************************************************************************************************/
/** The 'SAS ' signature. */
#define DIG_OS2_SAS_SIG RT_MAKE_U32_FROM_U8('S','A','S',' ')
/** OS/2Warp on little endian ASCII systems. */
#define DIG_OS2_MOD_TAG UINT64_C(0x43532f3257617270)
-/*******************************************************************************
-* Internal Functions *
-*******************************************************************************/
+
+/*********************************************************************************************************************************
+* Internal Functions *
+*********************************************************************************************************************************/
static DECLCALLBACK(int) dbgDiggerOS2Init(PUVM pUVM, void *pvData);
-/*******************************************************************************
-* Global Variables *
-*******************************************************************************/
+/*********************************************************************************************************************************
+* Global Variables *
+*********************************************************************************************************************************/
/**
diff --git a/src/VBox/Debugger/DBGPlugInSolaris.cpp b/src/VBox/Debugger/DBGPlugInSolaris.cpp
index 89f97f9..adece11 100644
--- a/src/VBox/Debugger/DBGPlugInSolaris.cpp
+++ b/src/VBox/Debugger/DBGPlugInSolaris.cpp
@@ -16,9 +16,9 @@
*/
-/*******************************************************************************
-* Header Files *
-*******************************************************************************/
+/*********************************************************************************************************************************
+* Header Files *
+*********************************************************************************************************************************/
#define LOG_GROUP LOG_GROUP_DBGF ///@todo add new log group.
#include "DBGPlugIns.h"
#include "DBGPlugInCommonELF.h"
@@ -29,16 +29,16 @@
#include <iprt/string.h>
-/*******************************************************************************
-* Defined Constants And Macros *
-*******************************************************************************/
+/*********************************************************************************************************************************
+* Defined Constants And Macros *
+*********************************************************************************************************************************/
/** Solaris on little endian ASCII systems. */
#define DIG_SOL_MOD_TAG UINT64_C(0x00736972616c6f53)
-/*******************************************************************************
-* Structures and Typedefs *
-*******************************************************************************/
+/*********************************************************************************************************************************
+* Structures and Typedefs *
+*********************************************************************************************************************************/
/** @name InternalSolaris structures
* @{ */
@@ -312,9 +312,9 @@ typedef struct DBGDIGGERSOLARIS
typedef DBGDIGGERSOLARIS *PDBGDIGGERSOLARIS;
-/*******************************************************************************
-* Defined Constants And Macros *
-*******************************************************************************/
+/*********************************************************************************************************************************
+* Defined Constants And Macros *
+*********************************************************************************************************************************/
/** Min kernel address. */
#define SOL32_MIN_KRNL_ADDR UINT32_C(0x80000000)
/** Max kernel address. */
@@ -346,9 +346,9 @@ typedef DBGDIGGERSOLARIS *PDBGDIGGERSOLARIS;
#define SOL_UNIX_MAX_CODE_SEG_SIZE 0x00400000
-/*******************************************************************************
-* Internal Functions *
-*******************************************************************************/
+/*********************************************************************************************************************************
+* Internal Functions *
+*********************************************************************************************************************************/
static DECLCALLBACK(int) dbgDiggerSolarisInit(PUVM pUVM, void *pvData);
diff --git a/src/VBox/Debugger/DBGPlugInWinNt.cpp b/src/VBox/Debugger/DBGPlugInWinNt.cpp
index a5be497..6657652 100644
--- a/src/VBox/Debugger/DBGPlugInWinNt.cpp
+++ b/src/VBox/Debugger/DBGPlugInWinNt.cpp
@@ -16,9 +16,9 @@
*/
-/*******************************************************************************
-* Header Files *
-*******************************************************************************/
+/*********************************************************************************************************************************
+* Header Files *
+*********************************************************************************************************************************/
#define LOG_GROUP LOG_GROUP_DBGF ///@todo add new log group.
#include "DBGPlugIns.h"
#include <VBox/vmm/dbgf.h>
@@ -33,9 +33,9 @@
#include "../Runtime/include/internal/ldrPE.h" /* ugly */
-/*******************************************************************************
-* Structures and Typedefs *
-*******************************************************************************/
+/*********************************************************************************************************************************
+* Structures and Typedefs *
+*********************************************************************************************************************************/
/** @name Internal WinNT structures
* @{ */
@@ -251,9 +251,9 @@ typedef struct DBGDIGGERWINNTRDR
typedef DBGDIGGERWINNTRDR *PDBGDIGGERWINNTRDR;
-/*******************************************************************************
-* Defined Constants And Macros *
-*******************************************************************************/
+/*********************************************************************************************************************************
+* Defined Constants And Macros *
+*********************************************************************************************************************************/
/** Validates a 32-bit Windows NT kernel address */
#define WINNT32_VALID_ADDRESS(Addr) ((Addr) > UINT32_C(0x80000000) && (Addr) < UINT32_C(0xfffff000))
/** Validates a 64-bit Windows NT kernel address */
@@ -270,15 +270,15 @@ typedef DBGDIGGERWINNTRDR *PDBGDIGGERWINNTRDR;
#define DIG_WINNT_MOD_TAG UINT64_C(0x54696e646f774e54)
-/*******************************************************************************
-* Internal Functions *
-*******************************************************************************/
+/*********************************************************************************************************************************
+* Internal Functions *
+*********************************************************************************************************************************/
static DECLCALLBACK(int) dbgDiggerWinNtInit(PUVM pUVM, void *pvData);
-/*******************************************************************************
-* Global Variables *
-*******************************************************************************/
+/*********************************************************************************************************************************
+* Global Variables *
+*********************************************************************************************************************************/
/** Kernel names. */
static const RTUTF16 g_wszKernelNames[][WINNT_KERNEL_BASE_NAME_LEN + 1] =
{
diff --git a/src/VBox/Debugger/VBoxDbg.cpp b/src/VBox/Debugger/VBoxDbg.cpp
index 3600884..9448e61 100644
--- a/src/VBox/Debugger/VBoxDbg.cpp
+++ b/src/VBox/Debugger/VBoxDbg.cpp
@@ -15,9 +15,10 @@
* hope that it will be useful, but WITHOUT ANY WARRANTY of any kind.
*/
-/*******************************************************************************
-* Header Files *
-*******************************************************************************/
+
+/*********************************************************************************************************************************
+* Header Files *
+*********************************************************************************************************************************/
#define LOG_GROUP LOG_GROUP_DBGG
#define VBOX_COM_NO_ATL
#ifdef RT_OS_WINDOWS
@@ -34,9 +35,9 @@
#include "VBoxDbgGui.h"
-/*******************************************************************************
-* Structures and Typedefs *
-*******************************************************************************/
+/*********************************************************************************************************************************
+* Structures and Typedefs *
+*********************************************************************************************************************************/
/**
* Debugger GUI instance data.
*/
@@ -54,9 +55,9 @@ typedef struct DBGGUI
#define DBGGUI_MAGIC_DEAD 0x19760201
-/*******************************************************************************
-* Global Variables *
-*******************************************************************************/
+/*********************************************************************************************************************************
+* Global Variables *
+*********************************************************************************************************************************/
/** Virtual method table for simplifying dynamic linking. */
static const DBGGUIVT g_dbgGuiVT =
{
diff --git a/src/VBox/Debugger/VBoxDbgBase.cpp b/src/VBox/Debugger/VBoxDbgBase.cpp
index 2538abc..ca5e502 100644
--- a/src/VBox/Debugger/VBoxDbgBase.cpp
+++ b/src/VBox/Debugger/VBoxDbgBase.cpp
@@ -15,9 +15,10 @@
* hope that it will be useful, but WITHOUT ANY WARRANTY of any kind.
*/
-/*******************************************************************************
-* Header Files *
-*******************************************************************************/
+
+/*********************************************************************************************************************************
+* Header Files *
+*********************************************************************************************************************************/
#define LOG_GROUP LOG_GROUP_DBGG
#include <VBox/err.h>
#include <iprt/asm.h>
diff --git a/src/VBox/Debugger/VBoxDbgConsole.cpp b/src/VBox/Debugger/VBoxDbgConsole.cpp
index 0dfcd0f..ac60cd9 100644
--- a/src/VBox/Debugger/VBoxDbgConsole.cpp
+++ b/src/VBox/Debugger/VBoxDbgConsole.cpp
@@ -16,9 +16,9 @@
*/
-/*******************************************************************************
-* Header Files *
-*******************************************************************************/
+/*********************************************************************************************************************************
+* Header Files *
+*********************************************************************************************************************************/
#define LOG_GROUP LOG_GROUP_DBGG
#include "VBoxDbgConsole.h"
diff --git a/src/VBox/Debugger/VBoxDbgGui.cpp b/src/VBox/Debugger/VBoxDbgGui.cpp
index c0db886..5ddaff5 100644
--- a/src/VBox/Debugger/VBoxDbgGui.cpp
+++ b/src/VBox/Debugger/VBoxDbgGui.cpp
@@ -15,9 +15,10 @@
* hope that it will be useful, but WITHOUT ANY WARRANTY of any kind.
*/
-/*******************************************************************************
-* Header Files *
-*******************************************************************************/
+
+/*********************************************************************************************************************************
+* Header Files *
+*********************************************************************************************************************************/
#define LOG_GROUP LOG_GROUP_DBGG
#define VBOX_COM_NO_ATL
#include <VBox/com/defs.h>
diff --git a/src/VBox/Debugger/VBoxDbgStatsQt4.cpp b/src/VBox/Debugger/VBoxDbgStatsQt4.cpp
index d0f7793..4b25ed5 100644
--- a/src/VBox/Debugger/VBoxDbgStatsQt4.cpp
+++ b/src/VBox/Debugger/VBoxDbgStatsQt4.cpp
@@ -16,9 +16,9 @@
*/
-/*******************************************************************************
-* Header Files *
-*******************************************************************************/
+/*********************************************************************************************************************************
+* Header Files *
+*********************************************************************************************************************************/
#define LOG_GROUP LOG_GROUP_DBGG
#include "VBoxDbgStatsQt4.h"
@@ -42,16 +42,16 @@
#include <iprt/assert.h>
-/*******************************************************************************
-* Defined Constants And Macros *
-*******************************************************************************/
+/*********************************************************************************************************************************
+* Defined Constants And Macros *
+*********************************************************************************************************************************/
/** The number of column. */
#define DBGGUI_STATS_COLUMNS 9
-/*******************************************************************************
-* Structures and Typedefs *
-*******************************************************************************/
+/*********************************************************************************************************************************
+* Structures and Typedefs *
+*********************************************************************************************************************************/
/**
* The state of a statistics sample node.
*
@@ -586,9 +586,9 @@ protected:
};
-/*******************************************************************************
-* Internal Functions *
-*******************************************************************************/
+/*********************************************************************************************************************************
+* Internal Functions *
+*********************************************************************************************************************************/
/**
diff --git a/src/VBox/Debugger/testcase/tstDBGCParser.cpp b/src/VBox/Debugger/testcase/tstDBGCParser.cpp
index 664935d..745ab66 100644
--- a/src/VBox/Debugger/testcase/tstDBGCParser.cpp
+++ b/src/VBox/Debugger/testcase/tstDBGCParser.cpp
@@ -15,9 +15,10 @@
* hope that it will be useful, but WITHOUT ANY WARRANTY of any kind.
*/
-/*******************************************************************************
-* Header Files *
-*******************************************************************************/
+
+/*********************************************************************************************************************************
+* Header Files *
+*********************************************************************************************************************************/
#include <VBox/dbg.h>
#include "../DBGCInternal.h"
@@ -26,18 +27,18 @@
#include <VBox/err.h>
-/*******************************************************************************
-* Internal Functions *
-*******************************************************************************/
+/*********************************************************************************************************************************
+* Internal Functions *
+*********************************************************************************************************************************/
static DECLCALLBACK(bool) tstDBGCBackInput(PDBGCBACK pBack, uint32_t cMillies);
static DECLCALLBACK(int) tstDBGCBackRead(PDBGCBACK pBack, void *pvBuf, size_t cbBuf, size_t *pcbRead);
static DECLCALLBACK(int) tstDBGCBackWrite(PDBGCBACK pBack, const void *pvBuf, size_t cbBuf, size_t *pcbWritten);
static DECLCALLBACK(void) tstDBGCBackSetReady(PDBGCBACK pBack, bool fReady);
-/*******************************************************************************
-* Global Variables *
-*******************************************************************************/
+/*********************************************************************************************************************************
+* Global Variables *
+*********************************************************************************************************************************/
/** The test handle. */
static RTTEST g_hTest = NIL_RTTEST;
diff --git a/src/VBox/Debugger/testcase/tstVBoxDbg.cpp b/src/VBox/Debugger/testcase/tstVBoxDbg.cpp
index 4c7843e..21cd4b2 100644
--- a/src/VBox/Debugger/testcase/tstVBoxDbg.cpp
+++ b/src/VBox/Debugger/testcase/tstVBoxDbg.cpp
@@ -16,9 +16,9 @@
*/
-/*******************************************************************************
-* Header Files *
-*******************************************************************************/
+/*********************************************************************************************************************************
+* Header Files *
+*********************************************************************************************************************************/
#include <qapplication.h>
#include <VBox/dbggui.h>
#include <VBox/vmm/vm.h>
diff --git a/src/VBox/Devices/Audio/AudioMixBuffer.cpp b/src/VBox/Devices/Audio/AudioMixBuffer.cpp
index fb141da..80db4e7 100644
--- a/src/VBox/Devices/Audio/AudioMixBuffer.cpp
+++ b/src/VBox/Devices/Audio/AudioMixBuffer.cpp
@@ -20,11 +20,12 @@
/*
* DEBUG_DUMP_PCM_DATA enables dumping the raw PCM data
- * to a file on the host. Be sure to adjust the dumping path
+ * to a file on the host. Be sure to adjust DEBUG_DUMP_PCM_DATA_PATH
* to your needs before using this!
*/
#ifdef DEBUG
//# define DEBUG_DUMP_PCM_DATA
+# define DEBUG_DUMP_PCM_DATA_PATH "c:\\temp\\"
#endif
#include <iprt/asm-math.h>
@@ -215,6 +216,40 @@ int AudioMixBufAcquire(PPDMAUDIOMIXBUF pMixBuf, uint32_t cSamplesToRead,
}
/**
+ * Returns available number of samples for reading.
+ *
+ * @return uint32_t Number of samples available for reading.
+ * @param pMixBuf Mixing buffer to return value for.
+ */
+uint32_t AudioMixBufAvail(PPDMAUDIOMIXBUF pMixBuf)
+{
+ AssertPtrReturn(pMixBuf, true);
+
+ uint32_t cAvail;
+ if (pMixBuf->pParent) /* Child */
+ cAvail = pMixBuf->cMixed;
+ else
+ cAvail = pMixBuf->cProcessed;
+
+ Assert(cAvail <= pMixBuf->cSamples);
+ return cAvail;
+}
+
+/**
+ * Clears the entire sample buffer.
+ *
+ * @param pMixBuf Mixing buffer to clear.
+ *
+ */
+void AudioMixBufClear(PPDMAUDIOMIXBUF pMixBuf)
+{
+ AssertPtrReturnVoid(pMixBuf);
+
+ if (pMixBuf->cSamples)
+ RT_BZERO(pMixBuf->pSamples, pMixBuf->cSamples * sizeof(PDMAUDIOSAMPLE));
+}
+
+/**
* Clears (zeroes) the buffer by a certain amount of (processed) samples and
* keeps track to eventually assigned children buffers.
*
@@ -916,7 +951,7 @@ int AudioMixBufLinkTo(PPDMAUDIOMIXBUF pMixBuf, PPDMAUDIOMIXBUF pParent)
}
/**
- * Returns the number of audio samples mixed (processed) from
+ * Returns the number of audio samples mixed (processed) by
* the parent mixing buffer.
*
* @return uint32_t Number of audio samples mixed (processed).
@@ -947,6 +982,7 @@ static int audioMixBufMixTo(PPDMAUDIOMIXBUF pDst, PPDMAUDIOMIXBUF pSrc, uint32_t
{
AssertPtrReturn(pDst, VERR_INVALID_POINTER);
AssertPtrReturn(pSrc, VERR_INVALID_POINTER);
+ AssertReturn(cSamples, VERR_INVALID_PARAMETER);
/* pcProcessed is optional. */
/* Live samples indicate how many samples there are in the source buffer
@@ -1248,7 +1284,6 @@ int AudioMixBufReadCircEx(PPDMAUDIOMIXBUF pMixBuf, PDMAUDIOMIXBUFFMT enmFmt,
{
AssertPtrReturn(pMixBuf, VERR_INVALID_POINTER);
AssertPtrReturn(pvBuf, VERR_INVALID_POINTER);
- AssertReturn(cbBuf, VERR_INVALID_PARAMETER);
/* pcbRead is optional. */
if (!cbBuf)
@@ -1329,7 +1364,7 @@ int AudioMixBufReadCircEx(PPDMAUDIOMIXBUF pMixBuf, PDMAUDIOMIXBUFFMT enmFmt,
{
#ifdef DEBUG_DUMP_PCM_DATA
RTFILE fh;
- rc = RTFileOpen(&fh, "c:\\temp\\mixbuf_readcirc.pcm",
+ rc = RTFileOpen(&fh, DEBUG_DUMP_PCM_DATA_PATH "mixbuf_readcirc.pcm",
RTFILE_O_OPEN_CREATE | RTFILE_O_APPEND | RTFILE_O_WRITE | RTFILE_O_DENY_NONE);
if (RT_SUCCESS(rc))
{
@@ -1369,8 +1404,7 @@ void AudioMixBufReset(PPDMAUDIOMIXBUF pMixBuf)
pMixBuf->cMixed = 0;
pMixBuf->cProcessed = 0;
- if (pMixBuf->cSamples)
- RT_BZERO(pMixBuf->pSamples, pMixBuf->cSamples * sizeof(PDMAUDIOSAMPLE));
+ AudioMixBufClear(pMixBuf);
}
/**
@@ -1532,7 +1566,7 @@ int AudioMixBufWriteAtEx(PPDMAUDIOMIXBUF pMixBuf, PDMAUDIOMIXBUFFMT enmFmt,
#ifdef DEBUG_DUMP_PCM_DATA
RTFILE fh;
- rc = RTFileOpen(&fh, "c:\\temp\\mixbuf_writeat.pcm",
+ rc = RTFileOpen(&fh, DEBUG_DUMP_PCM_DATA_PATH "mixbuf_writeat.pcm",
RTFILE_O_OPEN_CREATE | RTFILE_O_APPEND | RTFILE_O_WRITE | RTFILE_O_DENY_NONE);
if (RT_SUCCESS(rc))
{
@@ -1685,7 +1719,7 @@ int AudioMixBufWriteCircEx(PPDMAUDIOMIXBUF pMixBuf, PDMAUDIOMIXBUFFMT enmFmt,
#ifdef DEBUG_DUMP_PCM_DATA
RTFILE fh;
- RTFileOpen(&fh, "c:\\temp\\mixbuf_writeex.pcm",
+ RTFileOpen(&fh, DEBUG_DUMP_PCM_DATA_PATH "mixbuf_writeex.pcm",
RTFILE_O_OPEN_CREATE | RTFILE_O_APPEND | RTFILE_O_WRITE | RTFILE_O_DENY_NONE);
RTFileWrite(fh, pSamplesDst1, AUDIOMIXBUF_S2B(pMixBuf, cLenDst1), NULL);
RTFileClose(fh);
diff --git a/src/VBox/Devices/Audio/AudioMixBuffer.h b/src/VBox/Devices/Audio/AudioMixBuffer.h
index 119836a..c4caa7c 100644
--- a/src/VBox/Devices/Audio/AudioMixBuffer.h
+++ b/src/VBox/Devices/Audio/AudioMixBuffer.h
@@ -50,7 +50,9 @@
int AudioMixBufAcquire(PPDMAUDIOMIXBUF pMixBuf, uint32_t cSamplesToRead, PPDMAUDIOSAMPLE *ppvSamples, uint32_t *pcSamplesRead);
+uint32_t AudioMixBufAvail(PPDMAUDIOMIXBUF pMixBuf);
inline uint32_t AudioMixBufBytesToSamples(PPDMAUDIOMIXBUF pMixBuf);
+void AudioMixBufClear(PPDMAUDIOMIXBUF pMixBuf);
void AudioMixBufDestroy(PPDMAUDIOMIXBUF pMixBuf);
void AudioMixBufFinish(PPDMAUDIOMIXBUF pMixBuf, uint32_t cSamplesToClear);
uint32_t AudioMixBufFree(PPDMAUDIOMIXBUF pMixBuf);
diff --git a/src/VBox/Devices/Audio/DevIchAc97.cpp b/src/VBox/Devices/Audio/DevIchAc97.cpp
index e2864af..f6e5cce 100644
--- a/src/VBox/Devices/Audio/DevIchAc97.cpp
+++ b/src/VBox/Devices/Audio/DevIchAc97.cpp
@@ -15,9 +15,10 @@
* hope that it will be useful, but WITHOUT ANY WARRANTY of any kind.
*/
-/*******************************************************************************
-* Header Files *
-*******************************************************************************/
+
+/*********************************************************************************************************************************
+* Header Files *
+*********************************************************************************************************************************/
#define LOG_GROUP LOG_GROUP_DEV_AC97
#include <VBox/log.h>
#include <VBox/vmm/pdmdev.h>
@@ -33,9 +34,10 @@
#include "VBoxDD.h"
#include "AudioMixer.h"
-/*******************************************************************************
-* Defined Constants And Macros *
-*******************************************************************************/
+
+/*********************************************************************************************************************************
+* Defined Constants And Macros *
+*********************************************************************************************************************************/
#undef LOG_VOICES
#ifdef DEBUG
@@ -168,9 +170,9 @@ enum
};
-/*******************************************************************************
-* Structures and Typedefs *
-*******************************************************************************/
+/*********************************************************************************************************************************
+* Structures and Typedefs *
+*********************************************************************************************************************************/
/**
* Buffer descriptor.
*/
diff --git a/src/VBox/Devices/Audio/DevIchHda.cpp b/src/VBox/Devices/Audio/DevIchHda.cpp
index 3a1ae3c..0922707 100644
--- a/src/VBox/Devices/Audio/DevIchHda.cpp
+++ b/src/VBox/Devices/Audio/DevIchHda.cpp
@@ -19,9 +19,10 @@
* hope that it will be useful, but WITHOUT ANY WARRANTY of any kind.
*/
-/*******************************************************************************
-* Header Files *
-*******************************************************************************/
+
+/*********************************************************************************************************************************
+* Header Files *
+*********************************************************************************************************************************/
#define LOG_GROUP LOG_GROUP_DEV_HDA
#include <VBox/log.h>
#include <VBox/vmm/pdmdev.h>
@@ -43,9 +44,10 @@
#include "AudioMixer.h"
#include "DevIchHdaCodec.h"
-/*******************************************************************************
-* Defined Constants And Macros *
-*******************************************************************************/
+
+/*********************************************************************************************************************************
+* Defined Constants And Macros *
+*********************************************************************************************************************************/
//#define HDA_AS_PCI_EXPRESS
#define VBOX_WITH_INTEL_HDA
@@ -514,9 +516,9 @@
-/*******************************************************************************
-* Structures and Typedefs *
-*******************************************************************************/
+/*********************************************************************************************************************************
+* Structures and Typedefs *
+*********************************************************************************************************************************/
typedef struct HDABDLEDESC
{
uint64_t u64BdleCviAddr;
@@ -686,9 +688,9 @@ typedef HDASTATE *PHDASTATE;
( AUDIO_FORMAT_SELECTOR((pThis)->pCodec, Out, SDFMT_BASE_RATE(pThis, 4), SDFMT_MULT(pThis, 4), SDFMT_DIV(pThis, 4)) )
-/*******************************************************************************
-* Internal Functions *
-*******************************************************************************/
+/*********************************************************************************************************************************
+* Internal Functions *
+*********************************************************************************************************************************/
#ifndef VBOX_DEVICE_STRUCT_TESTCASE
static FNPDMDEVRESET hdaReset;
@@ -740,9 +742,9 @@ static void dump_bd(PHDASTATE pThis, PHDABDLEDESC pBdle, uint64_t u64BaseDMA);
#endif
-/*******************************************************************************
-* Global Variables *
-*******************************************************************************/
+/*********************************************************************************************************************************
+* Global Variables *
+*********************************************************************************************************************************/
/* see 302349 p 6.2*/
static const struct HDAREGDESC
@@ -2266,7 +2268,7 @@ static int hdaWriteAudio(PHDASTATE pThis, PHDASTREAMTRANSFERDESC pStreamDesc, ui
/**
* @interface_method_impl{HDACODEC,pfnReset}
*/
-DECLCALLBACK(int) hdaCodecReset(PHDACODEC pCodec)
+static DECLCALLBACK(int) hdaCodecReset(PHDACODEC pCodec)
{
PHDASTATE pThis = pCodec->pHDAState;
NOREF(pThis);
@@ -2496,8 +2498,8 @@ static DECLCALLBACK(void) hdaTimer(PPDMDEVINS pDevIns, PTMTIMER pTimer, void *pv
STAM_PROFILE_STOP(&pThis->StatTimer, a);
}
-static DECLCALLBACK(int) hdaTransfer(PHDASTATE pThis,
- ENMSOUNDSOURCE enmSrc, uint32_t cbAvail)
+static int hdaTransfer(PHDASTATE pThis,
+ ENMSOUNDSOURCE enmSrc, uint32_t cbAvail)
{
AssertPtrReturn(pThis, VERR_INVALID_POINTER);
diff --git a/src/VBox/Devices/Audio/DevIchHdaCodec.cpp b/src/VBox/Devices/Audio/DevIchHdaCodec.cpp
index 53657b6..44da663 100644
--- a/src/VBox/Devices/Audio/DevIchHdaCodec.cpp
+++ b/src/VBox/Devices/Audio/DevIchHdaCodec.cpp
@@ -20,9 +20,9 @@
*/
-/*******************************************************************************
-* Header Files *
-*******************************************************************************/
+/*********************************************************************************************************************************
+* Header Files *
+*********************************************************************************************************************************/
#define LOG_GROUP LOG_GROUP_DEV_HDA_CODEC
#include <VBox/vmm/pdmdev.h>
#include <VBox/vmm/pdmaudioifs.h>
@@ -37,9 +37,9 @@
#include "DevIchHdaCodec.h"
-/*******************************************************************************
-* Defined Constants And Macros *
-*******************************************************************************/
+/*********************************************************************************************************************************
+* Defined Constants And Macros *
+*********************************************************************************************************************************/
/* PRM 5.3.1 */
/** Codec address mask. */
#define CODEC_CAD_MASK 0xF0000000
@@ -520,9 +520,9 @@
| ((sequence)))
-/*******************************************************************************
-* Structures and Typedefs *
-*******************************************************************************/
+/*********************************************************************************************************************************
+* Structures and Typedefs *
+*********************************************************************************************************************************/
/** The F00 parameter length (in dwords). */
#define CODECNODE_F00_PARAM_LENGTH 20
/** The F02 parameter length (in dwords). */
@@ -756,9 +756,11 @@ typedef union CODECNODE
CODECSAVEDSTATENODE SavedState;
} CODECNODE, *PCODECNODE;
AssertNodeSize(CODECNODE, 60 + 6);
-/*******************************************************************************
-* Global Variables *
-*******************************************************************************/
+
+
+/*********************************************************************************************************************************
+* Global Variables *
+*********************************************************************************************************************************/
/* STAC9220 - Nodes IDs / names. */
#define STAC9220_NID_ROOT 0x0 /* Root node */
#define STAC9220_NID_AFG 0x1 /* Audio Configuration Group */
@@ -864,7 +866,7 @@ static DECLCALLBACK(void) stac9220DbgNodes(PHDACODEC pThis, PCDBGFINFOHLP pHlp,
}
-static int stac9220ResetNode(PHDACODEC pThis, uint8_t nodenum, PCODECNODE pNode)
+static DECLCALLBACK(int) stac9220ResetNode(PHDACODEC pThis, uint8_t nodenum, PCODECNODE pNode)
{
pNode->node.id = nodenum;
pNode->node.au32F00_param[0xF] = 0; /* Power statest Supported: are the same as AFG reports */
@@ -2558,7 +2560,7 @@ static DECLCALLBACK(void) codecDbgSelector(PHDACODEC pThis, PCDBGFINFOHLP pHlp,
}
#endif
-static int codecLookup(PHDACODEC pThis, uint32_t cmd, PPFNHDACODECVERBPROCESSOR pfn)
+static DECLCALLBACK(int) codecLookup(PHDACODEC pThis, uint32_t cmd, PPFNHDACODECVERBPROCESSOR pfn)
{
Assert(CODEC_CAD(cmd) == pThis->id);
if (hdaCodecIsReservedNode(pThis, CODEC_NID(cmd)))
diff --git a/src/VBox/Devices/Audio/DrvAudio.cpp b/src/VBox/Devices/Audio/DrvAudio.cpp
index 4be7b44..e7fe66a 100644
--- a/src/VBox/Devices/Audio/DrvAudio.cpp
+++ b/src/VBox/Devices/Audio/DrvAudio.cpp
@@ -309,14 +309,20 @@ static bool drvAudioStreamCfgIsValid(PPDMAUDIOSTREAMCFG pCfg)
return fValid;
}
-void audio_pcm_info_clear_buf(PPDMPCMPROPS pPCMInfo, void *pvBuf, int len)
+void drvAudioClearBuf(PPDMPCMPROPS pPCMInfo, void *pvBuf, size_t cbBuf)
{
- if (!len)
+ AssertPtrReturnVoid(pPCMInfo);
+ AssertPtrReturnVoid(pvBuf);
+
+ if (!cbBuf)
return;
+ Log2Func(("pPCMInfo=%p, pvBuf=%p, cbBuf=%zu, fSigned=%RTbool, cBits=%RU8, cShift=%RU8\n",
+ pPCMInfo, pvBuf, cbBuf, pPCMInfo->fSigned, pPCMInfo->cBits, pPCMInfo->cShift));
+
if (pPCMInfo->fSigned)
{
- memset (pvBuf, 0, len << pPCMInfo->cShift);
+ memset(pvBuf, 0, cbBuf << pPCMInfo->cShift);
}
else
{
@@ -324,44 +330,162 @@ void audio_pcm_info_clear_buf(PPDMPCMPROPS pPCMInfo, void *pvBuf, int len)
{
case 8:
- memset (pvBuf, 0x80, len << pPCMInfo->cShift);
+ memset(pvBuf, 0x80, cbBuf << pPCMInfo->cShift);
break;
case 16:
- {
- int i;
- uint16_t *p = (uint16_t *)pvBuf;
- int shift = pPCMInfo->cChannels - 1;
- short s = INT16_MAX;
+ {
+ uint16_t *p = (uint16_t *)pvBuf;
+ int shift = pPCMInfo->cChannels - 1;
+ short s = INT16_MAX;
- if (pPCMInfo->fSwapEndian)
- s = RT_BSWAP_U16(s);
+ if (pPCMInfo->fSwapEndian)
+ s = RT_BSWAP_U16(s);
+
+ for (unsigned i = 0; i < cbBuf << shift; i++)
+ p[i] = s;
- for (i = 0; i < len << shift; i++)
- p[i] = s;
- }
break;
+ }
case 32:
+ {
+ uint32_t *p = (uint32_t *)pvBuf;
+ int shift = pPCMInfo->cChannels - 1;
+ int32_t s = INT32_MAX;
+
+ if (pPCMInfo->fSwapEndian)
+ s = RT_BSWAP_U32(s);
+
+ for (unsigned i = 0; i < cbBuf << shift; i++)
+ p[i] = s;
+
+ break;
+ }
+
+ default:
+ AssertMsgFailed(("Invalid bits: %RU8\n", pPCMInfo->cBits));
+ break;
+ }
+ }
+}
+
+static int drvAudioControlHstIn(PDRVAUDIO pThis, PPDMAUDIOHSTSTRMIN pHstStrmIn, PDMAUDIOSTREAMCMD enmStreamCmd,
+ uint32_t uFlags)
+{
+ AssertPtrReturn(pThis, VERR_INVALID_POINTER);
+ AssertPtrReturn(pHstStrmIn, VERR_INVALID_POINTER);
+
+ int rc;
+
+ switch (enmStreamCmd)
+ {
+ case PDMAUDIOSTREAMCMD_ENABLE:
+ {
+ if (!pHstStrmIn->fEnabled)
{
- int i;
- uint32_t *p = (uint32_t *)pvBuf;
- int shift = pPCMInfo->cChannels - 1;
- int32_t s = INT32_MAX;
+ rc = pThis->pHostDrvAudio->pfnControlIn(pThis->pHostDrvAudio, pHstStrmIn, PDMAUDIOSTREAMCMD_ENABLE);
+ if (RT_SUCCESS(rc))
+ {
+ pHstStrmIn->fEnabled = true;
+ }
+ else
+ LogFlowFunc(("Backend reported an error when opening input stream, rc=%Rrc\n", rc));
+ }
+ else
+ rc = VINF_SUCCESS;
- if (pPCMInfo->fSwapEndian)
- s = RT_BSWAP_U32(s);
+ break;
+ }
- for (i = 0; i < len << shift; i++)
- p[i] = s;
+ case PDMAUDIOSTREAMCMD_DISABLE:
+ {
+ if (pHstStrmIn->fEnabled)
+ {
+ rc = pThis->pHostDrvAudio->pfnControlIn(pThis->pHostDrvAudio, pHstStrmIn, PDMAUDIOSTREAMCMD_DISABLE);
+ if (RT_SUCCESS(rc))
+ {
+ pHstStrmIn->fEnabled = false;
+ AudioMixBufClear(&pHstStrmIn->MixBuf);
+ }
+ else
+ LogFlowFunc(("Backend vetoed closing output stream, rc=%Rrc\n", rc));
}
+ else
+ rc = VINF_SUCCESS;
+
break;
+ }
default:
- LogFlowFunc(("audio_pcm_info_clear_buf: invalid bits %d\n", pPCMInfo->cBits));
+ AssertMsgFailed(("Command %ld not implemented\n", enmStreamCmd));
+ rc = VERR_NOT_IMPLEMENTED;
+ break;
+ }
+
+ return rc;
+}
+
+static int drvAudioControlHstOut(PDRVAUDIO pThis, PPDMAUDIOHSTSTRMOUT pHstStrmOut, PDMAUDIOSTREAMCMD enmStreamCmd,
+ uint32_t uFlags)
+{
+ AssertPtrReturn(pThis, VERR_INVALID_POINTER);
+ AssertPtrReturn(pHstStrmOut, VERR_INVALID_POINTER);
+
+ int rc;
+
+ switch (enmStreamCmd)
+ {
+ case PDMAUDIOSTREAMCMD_ENABLE:
+ {
+ if (!pHstStrmOut->fEnabled)
+ {
+ rc = pThis->pHostDrvAudio->pfnControlOut(pThis->pHostDrvAudio, pHstStrmOut, PDMAUDIOSTREAMCMD_ENABLE);
+ if (RT_SUCCESS(rc))
+ {
+ Assert(!pHstStrmOut->fPendingDisable);
+ pHstStrmOut->fEnabled = true;
+ LogFunc(("[%s] Enabled stream\n", pHstStrmOut->MixBuf.pszName));
+ }
+ else
+ LogFlowFunc(("[%s] Backend reported an error when opening output stream, rc=%Rrc\n",
+ pHstStrmOut->MixBuf.pszName, rc));
+ }
+ else
+ rc = VINF_SUCCESS;
+
+ break;
+ }
+
+ case PDMAUDIOSTREAMCMD_DISABLE:
+ {
+ if (pHstStrmOut->fEnabled)
+ {
+ rc = pThis->pHostDrvAudio->pfnControlOut(pThis->pHostDrvAudio, pHstStrmOut, PDMAUDIOSTREAMCMD_DISABLE);
+ if (RT_SUCCESS(rc))
+ {
+ pHstStrmOut->fEnabled = false;
+ pHstStrmOut->fPendingDisable = false;
+ AudioMixBufClear(&pHstStrmOut->MixBuf);
+
+ LogFunc(("[%s] Disabled stream\n", pHstStrmOut->MixBuf.pszName));
+ }
+ else
+ LogFlowFunc(("[%s] Backend vetoed closing output stream, rc=%Rrc\n", pHstStrmOut->MixBuf.pszName, rc));
+ }
+ else
+ rc = VINF_SUCCESS;
+
break;
}
+
+ default:
+ AssertMsgFailed(("Command %ld not implemented\n", enmStreamCmd));
+ rc = VERR_NOT_IMPLEMENTED;
+ break;
}
+
+ return rc;
}
int drvAudioDestroyHstOut(PDRVAUDIO pThis, PPDMAUDIOHSTSTRMOUT pHstStrmOut)
@@ -853,8 +977,8 @@ static int drvAudioAllocHstIn(PDRVAUDIO pThis, const char *pszName, PPDMAUDIOSTR
* @param cbBuf
* @param pcbWritten
*/
-int drvAudioWrite(PPDMIAUDIOCONNECTOR pInterface, PPDMAUDIOGSTSTRMOUT pGstStrmOut,
- const void *pvBuf, uint32_t cbBuf, uint32_t *pcbWritten)
+static DECLCALLBACK(int) drvAudioWrite(PPDMIAUDIOCONNECTOR pInterface, PPDMAUDIOGSTSTRMOUT pGstStrmOut,
+ const void *pvBuf, uint32_t cbBuf, uint32_t *pcbWritten)
{
PDRVAUDIO pThis = PDMIAUDIOCONNECTOR_2_DRVAUDIO(pInterface);
AssertPtrReturn(pThis, VERR_INVALID_POINTER);
@@ -896,14 +1020,16 @@ int drvAudioWrite(PPDMIAUDIOCONNECTOR pInterface, PPDMAUDIOGSTSTRMOUT pGstStrmOu
if (RT_SUCCESS(rc))
{
- /* Return the number of samples which actually have been mixed
+ /*
+ * Return the number of samples which actually have been mixed
* down to the parent, regardless how much samples were written
- * into the children buffer. */
+ * into the children buffer.
+ */
if (pcbWritten)
*pcbWritten = AUDIOMIXBUF_S2B(&pGstStrmOut->MixBuf, cMixed);
}
- LogFlowFunc(("%s -> %s: Written pvBuf=%p, cbBuf=%zu, cWritten=%RU32 (%RU32 bytes), cMixed=%RU32, rc=%Rrc\n",
+ LogFlowFunc(("%s -> %s: Written pvBuf=%p, cbBuf=%RU32, cWritten=%RU32 (%RU32 bytes), cMixed=%RU32, rc=%Rrc\n",
pGstStrmOut->MixBuf.pszName, pHstStrmOut->MixBuf.pszName, pvBuf, cbBuf, cWritten,
AUDIOMIXBUF_S2B(&pGstStrmOut->MixBuf, cWritten), cMixed, rc));
return rc;
@@ -1028,22 +1154,17 @@ static DECLCALLBACK(int) drvAudioQueryStatus(PPDMIAUDIOCONNECTOR pInterface,
PPDMAUDIOHSTSTRMOUT pHstStrmOut = NULL;
while ((pHstStrmOut = drvAudioHstFindAnyEnabledOut(pThis, pHstStrmOut)))
{
- uint32_t cStreamsLive;
- cSamplesLive = drvAudioHstOutSamplesLive(pHstStrmOut, &cStreamsLive);
- if (!cStreamsLive)
- cSamplesLive = 0;
+ cSamplesLive = drvAudioHstOutSamplesLive(pHstStrmOut);
/* Has this stream marked as disabled but there still were guest streams relying
* on it? Check if this stream now can be closed and do so, if possible. */
if ( pHstStrmOut->fPendingDisable
- && !cStreamsLive)
+ && !cSamplesLive)
{
/* Stop playing the current (pending) stream. */
- int rc2 = pThis->pHostDrvAudio->pfnControlOut(pThis->pHostDrvAudio, pHstStrmOut,
- PDMAUDIOSTREAMCMD_DISABLE);
+ int rc2 = drvAudioControlHstOut(pThis, pHstStrmOut, PDMAUDIOSTREAMCMD_DISABLE, 0 /* Flags */);
if (RT_SUCCESS(rc2))
{
- pHstStrmOut->fEnabled = false;
pHstStrmOut->fPendingDisable = false;
LogFunc(("[%s] Disabling stream\n", pHstStrmOut->MixBuf.pszName));
@@ -1074,7 +1195,7 @@ static DECLCALLBACK(int) drvAudioQueryStatus(PPDMIAUDIOCONNECTOR pInterface,
cbFree2 = RT_MIN(cbFree2, AUDIOMIXBUF_S2B_RATIO(&pGstStrmOut->MixBuf,
AudioMixBufFree(&pGstStrmOut->MixBuf)));
- LogFlowFunc(("\t[%s] cbFree=%RU32\n", pGstStrmOut->MixBuf.pszName, cbFree2));
+ //LogFlowFunc(("\t[%s] cbFree=%RU32\n", pGstStrmOut->MixBuf.pszName, cbFree2));
}
}
@@ -1177,7 +1298,8 @@ static DECLCALLBACK(int) drvAudioPlayOut(PPDMIAUDIOCONNECTOR pInterface, uint32_
if (RT_SUCCESS(rc2))
cSamplesPlayedMax = RT_MAX(cSamplesPlayed, cSamplesPlayedMax);
- LogFlowFunc(("\t[%s] cSamplesPlayed=%RU32, rc=%Rrc\n", pHstStrmOut->MixBuf.pszName, cSamplesPlayed, rc2));
+ LogFlowFunc(("\t[%s] cSamplesPlayed=%RU32, cSamplesPlayedMax=%RU32, rc=%Rrc\n",
+ pHstStrmOut->MixBuf.pszName, cSamplesPlayed, cSamplesPlayedMax, rc2));
bool fNeedsCleanup = false;
@@ -1288,11 +1410,11 @@ static void drvAudioStateHandler(PPDMDRVINS pDrvIns, PDMAUDIOSTREAMCMD enmCmd)
PPDMAUDIOHSTSTRMOUT pHstStrmOut = NULL;
while ((pHstStrmOut = drvAudioHstFindAnyEnabledOut(pThis, pHstStrmOut)))
- pThis->pHostDrvAudio->pfnControlOut(pThis->pHostDrvAudio, pHstStrmOut, enmCmd);
+ drvAudioControlHstOut(pThis, pHstStrmOut, enmCmd, 0 /* Flags */);
PPDMAUDIOHSTSTRMIN pHstStrmIn = NULL;
while ((pHstStrmIn = drvAudioFindNextEnabledHstIn(pThis, pHstStrmIn)))
- pThis->pHostDrvAudio->pfnControlIn(pThis->pHostDrvAudio, pHstStrmIn, enmCmd);
+ drvAudioControlHstIn(pThis, pHstStrmIn, enmCmd, 0 /* Flags */);
}
static struct audio_option audio_options[] =
@@ -1445,48 +1567,62 @@ static DECLCALLBACK(int) drvAudioEnableOut(PPDMIAUDIOCONNECTOR pInterface,
PDRVAUDIO pThis = PDMIAUDIOCONNECTOR_2_DRVAUDIO(pInterface);
+ int rc = VINF_SUCCESS;
+
if (pGstStrmOut)
{
PPDMAUDIOHSTSTRMOUT pHstStrmOut = pGstStrmOut->pHstStrmOut;
AssertPtr(pHstStrmOut);
- LogFlowFunc(("%s: fEnable=%RTbool\n", pGstStrmOut->MixBuf.pszName, fEnable));
-
- if (pGstStrmOut->State.fActive != fEnable)
+ if (pGstStrmOut->State.fActive != fEnable) /* Only process real state changes. */
{
if (fEnable)
{
pHstStrmOut->fPendingDisable = false;
if (!pHstStrmOut->fEnabled)
- {
- pHstStrmOut->fEnabled = true;
- pThis->pHostDrvAudio->pfnControlOut(pThis->pHostDrvAudio, pHstStrmOut,
- PDMAUDIOSTREAMCMD_ENABLE);
- /** @todo Check rc. */
- }
+ rc = drvAudioControlHstOut(pThis, pHstStrmOut, PDMAUDIOSTREAMCMD_ENABLE, 0 /* Flags */);
}
- else
+ else /* Disable */
{
if (pHstStrmOut->fEnabled)
{
uint32_t cGstStrmsActive = 0;
+ /*
+ * Check if there are any active guest streams assigned
+ * to this host stream which still are being marked as active.
+ *
+ * In that case we have to defer closing the host stream and
+ * wait until all guest streams have been finished.
+ */
PPDMAUDIOGSTSTRMOUT pIter;
RTListForEach(&pHstStrmOut->lstGstStrmOut, pIter, PDMAUDIOGSTSTRMOUT, Node)
{
if (pIter->State.fActive)
+ {
cGstStrmsActive++;
+ break; /* At least one assigned & active guest stream is enough. */
+ }
}
- pHstStrmOut->fPendingDisable = cGstStrmsActive == 1;
+ /* Do we need to defer closing the host stream? */
+ pHstStrmOut->fPendingDisable = cGstStrmsActive >= 1;
+
+ /* Can we close the host stream now instead of deferring it? */
+ if (!pHstStrmOut->fPendingDisable)
+ rc = drvAudioControlHstOut(pThis, pHstStrmOut, PDMAUDIOSTREAMCMD_DISABLE, 0 /* Flags */);
}
}
- pGstStrmOut->State.fActive = fEnable;
+ if (RT_SUCCESS(rc))
+ pGstStrmOut->State.fActive = fEnable;
+
+ LogFlowFunc(("%s: fEnable=%RTbool, fPendingDisable=%RTbool, rc=%Rrc\n",
+ pGstStrmOut->MixBuf.pszName, fEnable, pHstStrmOut->fPendingDisable, rc));
}
}
- return VINF_SUCCESS;
+ return rc;
}
static DECLCALLBACK(int) drvAudioEnableIn(PPDMIAUDIOCONNECTOR pInterface,
@@ -1497,6 +1633,8 @@ static DECLCALLBACK(int) drvAudioEnableIn(PPDMIAUDIOCONNECTOR pInterface,
PDRVAUDIO pThis = PDMIAUDIOCONNECTOR_2_DRVAUDIO(pInterface);
+ int rc = VINF_SUCCESS;
+
if (pGstStrmIn)
{
PPDMAUDIOHSTSTRMIN pHstStrmIn = pGstStrmIn->pHstStrmIn;
@@ -1504,38 +1642,18 @@ static DECLCALLBACK(int) drvAudioEnableIn(PPDMIAUDIOCONNECTOR pInterface,
LogFlowFunc(("%s: fEnable=%RTbool\n", pGstStrmIn->MixBuf.pszName, fEnable));
- if (pGstStrmIn->State.fActive != fEnable)
+ if (pGstStrmIn->State.fActive != fEnable) /* Only process real state changes. */
{
- if (fEnable)
- {
- if (!pHstStrmIn->fEnabled)
- {
- int rc2 = pThis->pHostDrvAudio->pfnControlIn(pThis->pHostDrvAudio, pHstStrmIn,
- PDMAUDIOSTREAMCMD_ENABLE);
- if (RT_LIKELY(RT_SUCCESS(rc2)))
- pHstStrmIn->fEnabled = true;
- else
- LogFlowFunc(("Error opening host input stream in backend, rc=%Rrc\n", rc2));
- }
- }
- else
- {
- if (pHstStrmIn->fEnabled)
- {
- int rc2 = pThis->pHostDrvAudio->pfnControlIn(pThis->pHostDrvAudio, pHstStrmIn,
- PDMAUDIOSTREAMCMD_DISABLE);
- if (RT_LIKELY(RT_SUCCESS(rc2))) /* Did the backend veto? */
- pHstStrmIn->fEnabled = false;
- else
- LogFlowFunc(("Backend vetoed closing input stream, rc=%Rrc\n", rc2));
- }
- }
+ rc = drvAudioControlHstIn(pThis, pHstStrmIn,
+ fEnable ? PDMAUDIOSTREAMCMD_ENABLE : PDMAUDIOSTREAMCMD_DISABLE, 0 /* Flags */);
+ if (RT_SUCCESS(rc))
+ pGstStrmIn->State.fActive = fEnable;
- pGstStrmIn->State.fActive = fEnable;
+ LogFlowFunc(("%s: fEnable=%RTbool, rc=%Rrc\n", pGstStrmIn->MixBuf.pszName, fEnable, rc));
}
}
- return VINF_SUCCESS;
+ return rc;
}
static DECLCALLBACK(bool) drvAudioIsInputOK(PPDMIAUDIOCONNECTOR pInterface,
@@ -1616,8 +1734,8 @@ static DECLCALLBACK(int) drvAudioOpenIn(PPDMIAUDIOCONNECTOR pInterface, const ch
return rc;
}
-DECLCALLBACK(int) drvAudioOpenOut(PPDMIAUDIOCONNECTOR pInterface, const char *pszName,
- PPDMAUDIOSTREAMCFG pCfg, PPDMAUDIOGSTSTRMOUT *ppGstStrmOut)
+static DECLCALLBACK(int) drvAudioOpenOut(PPDMIAUDIOCONNECTOR pInterface, const char *pszName,
+ PPDMAUDIOSTREAMCFG pCfg, PPDMAUDIOGSTSTRMOUT *ppGstStrmOut)
{
AssertPtrReturn(pInterface, VERR_INVALID_POINTER);
AssertPtrReturn(pszName, VERR_INVALID_POINTER);
@@ -1728,7 +1846,7 @@ static DECLCALLBACK(void) drvAudioCloseIn(PPDMIAUDIOCONNECTOR pInterface, PPDMAU
drvAudioDestroyGstIn(pThis, pGstStrmIn);
}
-DECLCALLBACK(void) drvAudioCloseOut(PPDMIAUDIOCONNECTOR pInterface, PPDMAUDIOGSTSTRMOUT pGstStrmOut)
+static DECLCALLBACK(void) drvAudioCloseOut(PPDMIAUDIOCONNECTOR pInterface, PPDMAUDIOGSTSTRMOUT pGstStrmOut)
{
PDRVAUDIO pThis = PDMIAUDIOCONNECTOR_2_DRVAUDIO(pInterface);
if (pGstStrmOut)
@@ -1772,7 +1890,7 @@ static DECLCALLBACK(void) drvAudioPowerOff(PPDMDRVINS pDrvIns)
PPDMAUDIOHSTSTRMOUT pHstStrmOut = NULL;
while ((pHstStrmOut = drvAudioFindAnyHstOut(pThis, pHstStrmOut)))
{
- pThis->pHostDrvAudio->pfnControlOut(pThis->pHostDrvAudio, pHstStrmOut, PDMAUDIOSTREAMCMD_DISABLE);
+ drvAudioControlHstOut(pThis, pHstStrmOut, PDMAUDIOSTREAMCMD_DISABLE, 0 /* Flags */);
pThis->pHostDrvAudio->pfnFiniOut(pThis->pHostDrvAudio, pHstStrmOut);
}
@@ -1780,7 +1898,7 @@ static DECLCALLBACK(void) drvAudioPowerOff(PPDMDRVINS pDrvIns)
PPDMAUDIOHSTSTRMIN pHstStrmIn = NULL;
while ((pHstStrmIn = drvAudioFindNextHstIn(pThis, pHstStrmIn)))
{
- pThis->pHostDrvAudio->pfnControlIn(pThis->pHostDrvAudio, pHstStrmIn, PDMAUDIOSTREAMCMD_DISABLE);
+ drvAudioControlHstIn(pThis, pHstStrmIn, PDMAUDIOSTREAMCMD_DISABLE, 0 /* Flags */);
pThis->pHostDrvAudio->pfnFiniIn(pThis->pHostDrvAudio, pHstStrmIn);
}
diff --git a/src/VBox/Devices/Audio/DrvAudio.h b/src/VBox/Devices/Audio/DrvAudio.h
index 0be9ed1..ba9755a 100644
--- a/src/VBox/Devices/Audio/DrvAudio.h
+++ b/src/VBox/Devices/Audio/DrvAudio.h
@@ -144,10 +144,10 @@ int drvAudioHlpPcmCreateVoicePairOut(PDRVAUDIO pDrvAudio, const char *pszName, P
/* Common functions between DrvAudio and backends (host audio drivers). */
int drvAudioAttachCapture(PDRVAUDIO pDrvAudio, PPDMAUDIOHSTSTRMOUT pHstStrmOut);
+void drvAudioClearBuf(PPDMPCMPROPS pPCMInfo, void *pvBuf, size_t cbBuf);
void drvAudioDetachCapture(PPDMAUDIOHSTSTRMOUT pHstStrmOut);
-uint32_t drvAudioHstOutSamplesLive(PPDMAUDIOHSTSTRMOUT pHstStrmOut, uint32_t *pcStreamsLive);
+uint32_t drvAudioHstOutSamplesLive(PPDMAUDIOHSTSTRMOUT pHstStrmOut);
-void audio_pcm_info_clear_buf(PPDMPCMPROPS pPCMInfo, void *pvBuf, int len);
typedef struct fixed_settings
{
diff --git a/src/VBox/Devices/Audio/DrvAudioCommon.cpp b/src/VBox/Devices/Audio/DrvAudioCommon.cpp
index 9121979..7dc8b2d 100644
--- a/src/VBox/Devices/Audio/DrvAudioCommon.cpp
+++ b/src/VBox/Devices/Audio/DrvAudioCommon.cpp
@@ -408,74 +408,19 @@ void drvAudioStreamCfgPrint(PPDMAUDIOSTREAMCFG pCfg)
}
/**
- * Returns the minimum number of live samples already written to all associated
- * guest output streams of a specific host output stream.
- *
- * @return uint32_t Minimum number of total live samples already written to all
- * associated guest output streams, UINT32_MAX if none found.
- * @param pHstStrmOut Host output stream to search in.
- * @param pcStreamsLive Returns the number of live guest streams associated to
- * this host output stream. Optional.
- */
-static uint32_t drvAudioHstOutMinSamplesMixed(PPDMAUDIOHSTSTRMOUT pHstStrmOut, uint32_t *pcStreamsLive)
-{
- AssertPtrReturn(pHstStrmOut, 0);
- /* pcStreamsLive is optional. */
-
- uint32_t cStreamsLive = 0;
- uint32_t cMinSamplesMixed = UINT32_MAX;
- uint32_t cSamples;
-
- PPDMAUDIOGSTSTRMOUT pGstStrmOut;
- RTListForEach(&pHstStrmOut->lstGstStrmOut, pGstStrmOut, PDMAUDIOGSTSTRMOUT, Node)
- {
- if ( pGstStrmOut->State.fActive
- || !pGstStrmOut->State.fEmpty)
- {
- cSamples = AudioMixBufMixed(&pGstStrmOut->MixBuf);
- cMinSamplesMixed = RT_MIN(cMinSamplesMixed, cSamples);
-
- cStreamsLive++;
- }
- }
-
- if (pcStreamsLive)
- *pcStreamsLive = cStreamsLive;
-
- return cMinSamplesMixed;
-}
-
-/**
- * Finds the number of live (guest) samples of a specific host output stream.
+ * Finds the number of live samples for a specific output stream.
*
* @return uint32_t Minimum number of live host output samples processed
* by all connected guest output streams.
* @param pHstStrmOut Host output stream to search in.
- * @param pcStreamsLive Number of associated guest live streams. Optional.
*/
-uint32_t drvAudioHstOutSamplesLive(PPDMAUDIOHSTSTRMOUT pHstStrmOut, uint32_t *pcStreamsLive)
+uint32_t drvAudioHstOutSamplesLive(PPDMAUDIOHSTSTRMOUT pHstStrmOut)
{
AssertPtrReturn(pHstStrmOut, 0);
- /* pcStreamsLive is optional. */
-
- uint32_t cStreamsLive;
- uint32_t cSamplesMin = drvAudioHstOutMinSamplesMixed(pHstStrmOut, &cStreamsLive);
- if (pcStreamsLive)
- *pcStreamsLive = cStreamsLive;
+ uint32_t cSamplesLive = AudioMixBufAvail(&pHstStrmOut->MixBuf);
- if (cStreamsLive) /* Any live streams at all? */
- {
- if ( cSamplesMin == UINT32_MAX
- || cSamplesMin > AudioMixBufSize(&pHstStrmOut->MixBuf))
- {
- LogFlowFunc(("Error: cSamplesMin=%RU32\n", cSamplesMin));
- return 0;
- }
-
- return cSamplesMin;
- }
-
- return 0;
+ LogFlowFunc(("%s: cStreamsLive=%RU32, cSamplesLive=%RU32\n", pHstStrmOut->MixBuf.pszName, cSamplesLive));
+ return cSamplesLive;
}
diff --git a/src/VBox/Devices/Audio/DrvHostALSAAudio.cpp b/src/VBox/Devices/Audio/DrvHostALSAAudio.cpp
index 74f6d6c..d15f023 100644
--- a/src/VBox/Devices/Audio/DrvHostALSAAudio.cpp
+++ b/src/VBox/Devices/Audio/DrvHostALSAAudio.cpp
@@ -40,9 +40,10 @@
* THE SOFTWARE.
*/
-/*******************************************************************************
-* Header Files *
-*******************************************************************************/
+
+/*********************************************************************************************************************************
+* Header Files *
+*********************************************************************************************************************************/
#define LOG_GROUP LOG_GROUP_DRV_HOST_AUDIO
#include <VBox/log.h>
#include <iprt/alloc.h>
@@ -147,6 +148,9 @@ typedef struct DRVHOSTALSAAUDIO
uint32_t cLogErrors;
} DRVHOSTALSAAUDIO, *PDRVHOSTALSAAUDIO;
+/** Maximum number of tries to recover a broken pipe. */
+#define ALSA_RECOVERY_TRIES_MAX 5
+
typedef struct ALSAAUDIOSTREAMCFG
{
unsigned int freq;
@@ -939,9 +943,9 @@ static DECLCALLBACK(int) drvHostALSAAudioPlayOut(PPDMIHOSTAUDIO pInterface, PPDM
}
size_t cbToRead = RT_MIN(AUDIOMIXBUF_S2B(&pHstStrmOut->MixBuf,
- cAvail),
+ (uint32_t)cAvail), /* cAvail is always >= 0 */
AUDIOMIXBUF_S2B(&pHstStrmOut->MixBuf,
- drvAudioHstOutSamplesLive(pHstStrmOut, NULL /* pcStreamsLive */)));
+ drvAudioHstOutSamplesLive(pHstStrmOut)));
LogFlowFunc(("cbToRead=%zu, cbAvail=%zu\n",
cbToRead, AUDIOMIXBUF_S2B(&pHstStrmOut->MixBuf, cAvail)));
@@ -956,49 +960,60 @@ static DECLCALLBACK(int) drvHostALSAAudioPlayOut(PPDMIHOSTAUDIO pInterface, PPDM
cbRead = AUDIOMIXBUF_S2B(&pHstStrmOut->MixBuf, cRead);
AssertBreak(cbRead);
- cWritten = snd_pcm_writei(pThisStrmOut->phPCM, pThisStrmOut->pvBuf, cRead);
- if (cWritten <= 0)
+ /* Don't try infinitely on recoverable errors. */
+ unsigned iTry;
+ for (iTry = 0; iTry < ALSA_RECOVERY_TRIES_MAX; iTry++)
{
- switch (cWritten)
+ cWritten = snd_pcm_writei(pThisStrmOut->phPCM, pThisStrmOut->pvBuf, cRead);
+ if (cWritten <= 0)
{
- case 0:
- {
- LogFunc(("Failed to write %RI32 frames\n", cRead));
- rc = VERR_ACCESS_DENIED;
- break;
- }
-
- case -EPIPE:
+ switch (cWritten)
{
- rc = drvHostALSAAudioRecover(pThisStrmOut->phPCM);
- if (RT_FAILURE(rc))
+ case 0:
+ {
+ LogFunc(("Failed to write %RI32 frames\n", cRead));
+ rc = VERR_ACCESS_DENIED;
break;
+ }
- LogFlowFunc(("Recovered from playback\n"));
- continue;
- }
+ case -EPIPE:
+ {
+ rc = drvHostALSAAudioRecover(pThisStrmOut->phPCM);
+ if (RT_FAILURE(rc))
+ break;
- case -ESTRPIPE:
- {
- /* Stream was suspended and waiting for a recovery. */
- rc = drvHostALSAAudioResume(pThisStrmOut->phPCM);
- if (RT_FAILURE(rc))
+ LogFlowFunc(("Recovered from playback\n"));
+ continue;
+ }
+
+ case -ESTRPIPE:
{
- LogRel(("ALSA: Failed to resume output stream\n"));
- break;
+ /* Stream was suspended and waiting for a recovery. */
+ rc = drvHostALSAAudioResume(pThisStrmOut->phPCM);
+ if (RT_FAILURE(rc))
+ {
+ LogRel(("ALSA: Failed to resume output stream\n"));
+ break;
+ }
+
+ LogFlowFunc(("Resumed suspended output stream\n"));
+ continue;
}
- LogFlowFunc(("Resumed suspended output stream\n"));
- continue;
+ default:
+ LogFlowFunc(("Failed to write %RI32 output frames, rc=%Rrc\n",
+ cRead, rc));
+ rc = VERR_GENERAL_FAILURE; /** @todo */
+ break;
}
-
- default:
- LogFlowFunc(("Failed to write %RI32 output frames, rc=%Rrc\n",
- cRead, rc));
- rc = VERR_GENERAL_FAILURE; /** @todo */
- break;
}
- }
+ else
+ break;
+ } /* For number of tries. */
+
+ if ( iTry == ALSA_RECOVERY_TRIES_MAX
+ && cWritten <= 0)
+ rc = VERR_BROKEN_PIPE;
if (RT_FAILURE(rc))
break;
diff --git a/src/VBox/Devices/Audio/DrvHostCoreAudio.cpp b/src/VBox/Devices/Audio/DrvHostCoreAudio.cpp
index a98d1aa..b76272b 100644
--- a/src/VBox/Devices/Audio/DrvHostCoreAudio.cpp
+++ b/src/VBox/Devices/Audio/DrvHostCoreAudio.cpp
@@ -276,10 +276,6 @@ typedef struct COREAUDIOSTREAMOUT
AudioUnit audioUnit;
/* A ring buffer for transferring data to the playback thread. */
PRTCIRCBUF pBuf;
- /* Temporary buffer for copying over audio data into Core Audio. */
- void *pvPCMBuf;
- /** Size of the temporary buffer. */
- size_t cbPCMBuf;
/* Initialization status tracker. Used when some of the device parameters
* or the device itself is changed during the runtime. */
volatile uint32_t status;
@@ -1260,15 +1256,6 @@ static int drvHostCoreAudioInitOutput(PPDMAUDIOHSTSTRMOUT pHstStrmOut, uint32_t
rc = RTCircBufCreate(&pStreamOut->pBuf, cSamples << pHstStrmOut->Props.cShift);
if (RT_SUCCESS(rc))
{
- /* Allocate temporary buffer. */
- pStreamOut->cbPCMBuf = _4K; /** @todo Make this configurable. */
- pStreamOut->pvPCMBuf = RTMemAlloc(pStreamOut->cbPCMBuf);
- if (!pStreamOut->pvPCMBuf)
- rc = VERR_NO_MEMORY;
- }
-
- if (RT_SUCCESS(rc))
- {
/*
* Register callbacks.
*/
@@ -1493,7 +1480,7 @@ static DECLCALLBACK(int) drvHostCoreAudioPlayOut(PPDMIHOSTAUDIO pInterface, PPDM
/* Not much else to do here. */
- uint32_t cLive = drvAudioHstOutSamplesLive(pHstStrmOut, NULL /* pcStreamsLive */);
+ uint32_t cLive = drvAudioHstOutSamplesLive(pHstStrmOut);
if (!cLive) /* Not samples to play? Bail out. */
{
if (pcSamplesPlayed)
@@ -1503,50 +1490,46 @@ static DECLCALLBACK(int) drvHostCoreAudioPlayOut(PPDMIHOSTAUDIO pInterface, PPDM
int rc = VINF_SUCCESS;
uint32_t cbReadTotal = 0;
+ uint32_t cAvail = AudioMixBufAvail(&pHstStrmOut->MixBuf);
+ size_t cbAvail = AUDIOMIXBUF_S2B(&pHstStrmOut->MixBuf, cAvail);
+ size_t cbToRead = RT_MIN(cbAvail, RTCircBufFree(pStreamOut->pBuf));
+ LogFlowFunc(("cbToRead=%zu\n", cbToRead));
- do
+ while (cbToRead)
{
- size_t cbMixBuf = AudioMixBufSizeBytes(&pHstStrmOut->MixBuf);
- size_t cbBuf = RT_MIN(cbMixBuf, pStreamOut->cbPCMBuf);
- size_t cbToRead = RT_MIN(cbBuf, RTCircBufFree(pStreamOut->pBuf));
- LogFlowFunc(("cbToRead=%zu\n", cbToRead));
-
uint32_t cRead, cbRead;
uint8_t *puBuf;
- size_t cbToWrite;
+ size_t cbCopy;
- while (cbToRead)
+ /* Try to acquire the necessary space from the ring buffer. */
+ RTCircBufAcquireWriteBlock(pStreamOut->pBuf, cbToRead, (void **)&puBuf, &cbCopy);
+ if (!cbCopy)
{
- rc = AudioMixBufReadCirc(&pHstStrmOut->MixBuf,
- pStreamOut->pvPCMBuf, cbToRead, &cRead);
- if ( RT_FAILURE(rc)
- || !cRead)
- break;
+ RTCircBufReleaseWriteBlock(pStreamOut->pBuf, cbCopy);
+ break;
+ }
- cbRead = AUDIOMIXBUF_S2B(&pHstStrmOut->MixBuf, cRead);
+ Assert(cbCopy <= cbToRead);
- /* Try to acquire the necessary space from the ring buffer. */
- RTCircBufAcquireWriteBlock(pStreamOut->pBuf, cbRead, (void **)&puBuf, &cbToWrite);
- if (!cbToWrite)
- {
- RTCircBufReleaseWriteBlock(pStreamOut->pBuf, cbToWrite);
- break;
- }
+ rc = AudioMixBufReadCirc(&pHstStrmOut->MixBuf,
+ puBuf, cbCopy, &cRead);
- /* Transfer data into stream's own ring buffer. The playback will operate on this
- * own ring buffer separately. */
- Assert(cbToWrite <= cbRead);
- memcpy(puBuf, pStreamOut->pvPCMBuf, cbToWrite);
+ if ( RT_FAILURE(rc)
+ || !cRead)
+ {
+ RTCircBufReleaseWriteBlock(pStreamOut->pBuf, 0);
+ break;
+ }
- /* Release the ring buffer, so the read thread could start reading this data. */
- RTCircBufReleaseWriteBlock(pStreamOut->pBuf, cbToWrite);
+ cbRead = AUDIOMIXBUF_S2B(&pHstStrmOut->MixBuf, cRead);
- Assert(cbToRead >= cbRead);
- cbToRead -= cbRead;
- cbReadTotal += cbRead;
- }
+ /* Release the ring buffer, so the read thread could start reading this data. */
+ RTCircBufReleaseWriteBlock(pStreamOut->pBuf, cbRead);
+
+ Assert(cbToRead >= cbRead);
+ cbToRead -= cbRead;
+ cbReadTotal += cbRead;
}
- while (0);
if (RT_SUCCESS(rc))
{
@@ -1860,13 +1843,6 @@ static DECLCALLBACK(int) drvHostCoreAudioFiniOut(PPDMIHOSTAUDIO pInterface, PPDM
pStreamOut->audioUnit = NULL;
pStreamOut->deviceID = kAudioDeviceUnknown;
- if (pStreamOut->pvPCMBuf)
- {
- RTMemFree(pStreamOut->pvPCMBuf);
- pStreamOut->pvPCMBuf = NULL;
- pStreamOut->cbPCMBuf = 0;
- }
-
ASMAtomicXchgU32(&pStreamOut->status, CA_STATUS_UNINIT);
}
else
diff --git a/src/VBox/Devices/Audio/DrvHostDSound.cpp b/src/VBox/Devices/Audio/DrvHostDSound.cpp
index dd5aaf1..28286b7 100644
--- a/src/VBox/Devices/Audio/DrvHostDSound.cpp
+++ b/src/VBox/Devices/Audio/DrvHostDSound.cpp
@@ -27,20 +27,6 @@
#include "DrvAudio.h"
#include "VBoxDD.h"
-#define DSLOG(a) do { LogRel2(a); } while(0)
-#define DSLOGF(a) do { LogRel3(a); } while(0)
-#define DSLOGREL(a) \
- do { \
- static int8_t scLogged = 0; \
- if (scLogged < 8) { \
- ++scLogged; \
- LogRel(a); \
- } \
- else { \
- DSLOG(a); \
- } \
- } while (0)
-
typedef struct DSOUNDHOSTCFG
{
DWORD cbBufferIn;
@@ -61,13 +47,13 @@ typedef struct DRVHOSTDSOUND
RTLISTANCHOR lstDevInput;
/** List of found host output devices. */
RTLISTANCHOR lstDevOutput;
- /** Configuration options. */
+ /** DirectSound configuration options. */
DSOUNDHOSTCFG cfg;
} DRVHOSTDSOUND, *PDRVHOSTDSOUND;
typedef struct DSOUNDSTREAMOUT
{
- PDMAUDIOHSTSTRMOUT hw; /* Always must come first! */
+ PDMAUDIOHSTSTRMOUT strmOut; /* Always must come first! */
LPDIRECTSOUND8 pDS;
LPDIRECTSOUNDBUFFER8 pDSB;
DWORD cbPlayWritePos;
@@ -78,7 +64,7 @@ typedef struct DSOUNDSTREAMOUT
typedef struct DSOUNDSTREAMIN
{
- PDMAUDIOHSTSTRMIN hw; /* Always must come first! */
+ PDMAUDIOHSTSTRMIN strmIn; /* Always must come first! */
LPDIRECTSOUNDCAPTURE8 pDSC;
LPDIRECTSOUNDCAPTUREBUFFER8 pDSCB;
DWORD csCaptureReadPos;
@@ -104,6 +90,9 @@ typedef struct DSOUNDDEV
GUID Guid;
} DSOUNDDEV, *PDSOUNDDEV;
+/** Maximum number of release logging entries. */
+static uint32_t s_cMaxRelLogEntries = 32;
+
/** Makes DRVHOSTDSOUND out of PDMIHOSTAUDIO. */
#define PDMIHOSTAUDIO_2_DRVHOSTDSOUND(pInterface) \
( (PDRVHOSTDSOUND)((uintptr_t)pInterface - RT_OFFSETOF(DRVHOSTDSOUND, IHostAudio)) )
@@ -156,18 +145,21 @@ static int dsoundWaveFmtFromCfg(PPDMAUDIOSTREAMCFG pCfg, PWAVEFORMATEX pFmt)
static char *dsoundGUIDToUtf8StrA(LPCGUID lpGUID)
{
- LPOLESTR lpOLEStr;
- HRESULT hr = StringFromCLSID(*lpGUID, &lpOLEStr);
- if (SUCCEEDED(hr))
+ if (lpGUID)
{
- char *pszGUID;
- int rc = RTUtf16ToUtf8(lpOLEStr, &pszGUID);
- CoTaskMemFree(lpOLEStr);
+ LPOLESTR lpOLEStr;
+ HRESULT hr = StringFromCLSID(*lpGUID, &lpOLEStr);
+ if (SUCCEEDED(hr))
+ {
+ char *pszGUID;
+ int rc = RTUtf16ToUtf8(lpOLEStr, &pszGUID);
+ CoTaskMemFree(lpOLEStr);
- return RT_SUCCESS(rc) ? pszGUID : NULL;
+ return RT_SUCCESS(rc) ? pszGUID : NULL;
+ }
}
- return NULL;
+ return RTStrDup("<GUID not found>");
}
static void dsoundFreeDeviceLists(PDRVHOSTDSOUND pThis)
@@ -192,7 +184,7 @@ static int dsoundPlayRestore(LPDIRECTSOUNDBUFFER8 pDSB)
if (SUCCEEDED(hr))
return VINF_SUCCESS;
- DSLOGREL(("DSound: Restore playback buffer %Rhrc\n", hr));
+ LogRelMax(s_cMaxRelLogEntries, ("DSound: Error restoring playback buffer: %Rhrc\n", hr));
return VERR_INVALID_STATE;
}
@@ -204,7 +196,7 @@ static int dsoundUnlockOutput(LPDIRECTSOUNDBUFFER8 pDSB,
if (SUCCEEDED(hr))
return VINF_SUCCESS;
- DSLOG(("DSound: Unable to unlock output buffer, hr=%Rhrc\n", hr));
+ LogRelMax(s_cMaxRelLogEntries, ("DSound: Error unlocking output buffer: %Rhrc\n", hr));
return VERR_ACCESS_DENIED;
}
@@ -216,7 +208,7 @@ static int dsoundUnlockInput(LPDIRECTSOUNDCAPTUREBUFFER8 pDSCB,
if (SUCCEEDED(hr))
return VINF_SUCCESS;
- DSLOG(("DSound: Unable to unlock input buffer, hr=%Rhrc\n", hr));
+ LogRelMax(s_cMaxRelLogEntries, ("DSound: Error unlocking input buffer: %Rhrc\n", hr));
return VERR_ACCESS_DENIED;
}
@@ -240,19 +232,22 @@ static int dsoundLockOutput(LPDIRECTSOUNDBUFFER8 pDSB, PDMPCMPROPS *pProps,
if (RT_SUCCESS(rc))
{
hr = IDirectSoundBuffer8_Lock(pDSB, dwOffset, dwBytes, &pv1, &cb1, &pv2, &cb2, dwFlags);
+ if (FAILED(hr))
+ rc = VERR_ACCESS_DENIED;
}
}
- if (FAILED(hr) || RT_FAILURE(rc))
+ if (RT_FAILURE(rc))
{
- DSLOG(("DSound: Unable to lock output buffer, hr=%Rhrc\n", hr));
- return RT_SUCCESS(rc) ? VERR_ACCESS_DENIED: rc;
+ LogRelMax(s_cMaxRelLogEntries, ("DSound: Error locking output buffer: %Rhrc\n", hr));
+ return rc;
}
if ( (pv1 && (cb1 & pProps->uAlign))
|| (pv2 && (cb2 & pProps->uAlign)))
{
- DSLOG(("DSound: lock output returned misaligned buffer: cb1=%d, cb2=%d\n", cb1, cb2));
+ LogRelMax(s_cMaxRelLogEntries, ("DSound: Locking playback buffer returned misaligned buffer: cb1=%RI32, cb2=%RI32 (alignment: %RU32)\n",
+ cb1, cb2, pProps->uAlign));
dsoundUnlockOutput(pDSB, pv1, pv2, cb1, cb2);
return VERR_INVALID_STATE;
}
@@ -280,14 +275,15 @@ static int dsoundLockInput(LPDIRECTSOUNDCAPTUREBUFFER8 pDSCB, PPDMPCMPROPS pProp
&pv1, &cb1, &pv2, &cb2, dwFlags);
if (FAILED(hr))
{
- DSLOG(("DSound: Unable to lock capturing buffer, hr=%Rhrc\n", hr));
+ LogRelMax(s_cMaxRelLogEntries, ("DSound: Error locking capturing buffer: %Rhrc\n", hr));
return VERR_ACCESS_DENIED;
}
if ( (pv1 && (cb1 & pProps->uAlign))
|| (pv2 && (cb2 & pProps->uAlign)))
{
- DSLOG(("DSound: lock input returned misaligned buffer: cb1=%d, cb2=%d\n", cb1, cb2));
+ LogRelMax(s_cMaxRelLogEntries, ("DSound: Locking capture buffer returned misaligned buffer: cb1=%RI32, cb2=%RI32 (alignment: %RU32)\n",
+ cb1, cb2, pProps->uAlign));
dsoundUnlockInput(pDSCB, pv1, pv2, cb1, cb2);
return VERR_INVALID_PARAMETER;
}
@@ -318,7 +314,7 @@ static int dsoundPlayInterfaceCreate(PDRVHOSTDSOUND pThis, PDSOUNDSTREAMOUT pDSo
{
if (pDSoundStrmOut->pDS != NULL)
{
- DSLOG(("DSound: DirectSound instance already exists\n"));
+ LogFlowFunc(("DirectSound instance already exists\n"));
return VINF_SUCCESS;
}
@@ -326,30 +322,25 @@ static int dsoundPlayInterfaceCreate(PDRVHOSTDSOUND pThis, PDSOUNDSTREAMOUT pDSo
IID_IDirectSound8, (void **)&pDSoundStrmOut->pDS);
if (FAILED(hr))
{
- DSLOGREL(("DSound: DirectSound create instance %Rhrc\n", hr));
+ LogRel(("DSound: Error creating DirectSound instance: %Rhrc\n", hr));
}
else
{
hr = IDirectSound8_Initialize(pDSoundStrmOut->pDS, pThis->cfg.pGuidPlay);
if (SUCCEEDED(hr))
{
- HWND hwnd = GetDesktopWindow();
- hr = IDirectSound8_SetCooperativeLevel(pDSoundStrmOut->pDS, hwnd, DSSCL_PRIORITY);
- if (FAILED (hr))
- {
- DSLOGREL(("DSound: Set cooperative level for window %p %Rhrc\n", hwnd, hr));
- }
+ HWND hWnd = GetDesktopWindow();
+ hr = IDirectSound8_SetCooperativeLevel(pDSoundStrmOut->pDS, hWnd, DSSCL_PRIORITY);
+ if (FAILED(hr))
+ LogRel(("DSound: Error setting cooperative level for window %p: %Rhrc\n", hWnd, hr));
}
if (FAILED(hr))
{
if (hr == DSERR_NODRIVER)
- {
- DSLOGREL(("DSound: DirectSound playback is currently unavailable\n"));
- }
+ LogRel(("DSound: DirectSound playback is currently unavailable\n"));
else
- {
- DSLOGREL(("DSound: DirectSound initialize %Rhrc\n", hr));
- }
+ LogRel(("DSound: Error initializing DirectSound: %Rhrc\n", hr));
+
dsoundPlayInterfaceRelease(pDSoundStrmOut);
}
}
@@ -359,15 +350,13 @@ static int dsoundPlayInterfaceCreate(PDRVHOSTDSOUND pThis, PDSOUNDSTREAMOUT pDSo
static void dsoundPlayClose(PDSOUNDSTREAMOUT pDSoundStrmOut)
{
- DSLOG(("DSound: playback close %p buffer %p\n", pDSoundStrmOut, pDSoundStrmOut->pDSB));
+ LogFlowFunc(("Closing playback stream %p (buffer %p)\n", pDSoundStrmOut, pDSoundStrmOut->pDSB));
if (pDSoundStrmOut->pDSB)
{
HRESULT hr = IDirectSoundBuffer8_Stop(pDSoundStrmOut->pDSB);
if (FAILED(hr))
- {
- DSLOGREL(("DSound: Playback close Stop %Rhrc\n", hr));
- }
+ LogRelMax(s_cMaxRelLogEntries, ("DSound: Error closing playback stream %p: %Rhrc\n", pDSoundStrmOut, hr));
IDirectSoundBuffer8_Release(pDSoundStrmOut->pDSB);
pDSoundStrmOut->pDSB = NULL;
@@ -378,18 +367,21 @@ static void dsoundPlayClose(PDSOUNDSTREAMOUT pDSoundStrmOut)
static int dsoundPlayOpen(PDRVHOSTDSOUND pThis, PDSOUNDSTREAMOUT pDSoundStrmOut)
{
- DSLOG(("DSound: playback open %p size %u bytes, freq %u, chan %u, bits %u, sign %d\n",
- pDSoundStrmOut,
- pThis->cfg.cbBufferOut,
- pDSoundStrmOut->hw.Props.uHz,
- pDSoundStrmOut->hw.Props.cChannels,
- pDSoundStrmOut->hw.Props.cBits,
- pDSoundStrmOut->hw.Props.fSigned));
+ AssertPtrReturn(pThis, VERR_INVALID_POINTER);
+ AssertPtrReturn(pDSoundStrmOut, VERR_INVALID_POINTER);
+
+ LogFlowFunc(("pDSoundStrmOut=%p, cbBufferOut=%ld, uHz=%RU32, cChannels=%RU8, cBits=%RU8, fSigned=%RTbool\n",
+ pDSoundStrmOut,
+ pThis->cfg.cbBufferOut,
+ pDSoundStrmOut->strmOut.Props.uHz,
+ pDSoundStrmOut->strmOut.Props.cChannels,
+ pDSoundStrmOut->strmOut.Props.cBits,
+ pDSoundStrmOut->strmOut.Props.fSigned));
if (pDSoundStrmOut->pDSB != NULL)
{
/* Should not happen but be forgiving. */
- DSLOGREL(("DSound: DirectSoundBuffer already exists\n"));
+ LogFlowFunc(("DirectSoundBuffer already exists\n"));
dsoundPlayClose(pDSoundStrmOut);
}
@@ -417,7 +409,7 @@ static int dsoundPlayOpen(PDRVHOSTDSOUND pThis, PDSOUNDSTREAMOUT pDSoundStrmOut)
&bd, &pDSB, NULL);
if (FAILED(hr))
{
- DSLOGREL(("DSound: Playback CreateSoundBuffer %Rhrc\n", hr));
+ LogRelMax(s_cMaxRelLogEntries, ("DSound: Error creating playback stream: %Rhrc\n", hr));
break;
}
@@ -425,16 +417,15 @@ static int dsoundPlayOpen(PDRVHOSTDSOUND pThis, PDSOUNDSTREAMOUT pDSoundStrmOut)
pDSB->Release();
if (FAILED(hr))
{
- DSLOGREL(("DSound: Playback QueryInterface %Rhrc\n", hr));
+ LogRelMax(s_cMaxRelLogEntries, ("DSound: Error querying interface for playback stream: %Rhrc\n", hr));
break;
}
/* Query the actual parameters. */
-
hr = IDirectSoundBuffer8_GetFormat(pDSoundStrmOut->pDSB, &wfx, sizeof(wfx), NULL);
if (FAILED(hr))
{
- DSLOGREL(("DSound: Playback GetFormat %Rhrc\n", hr));
+ LogRelMax(s_cMaxRelLogEntries, ("DSound: Error querying format for playback stream: %Rhrc\n", hr));
break;
}
@@ -444,18 +435,19 @@ static int dsoundPlayOpen(PDRVHOSTDSOUND pThis, PDSOUNDSTREAMOUT pDSoundStrmOut)
hr = IDirectSoundBuffer8_GetCaps(pDSoundStrmOut->pDSB, &bc);
if (FAILED(hr))
{
- DSLOGREL(("DSound: Playback GetCaps %Rhrc\n", hr));
+ LogRelMax(s_cMaxRelLogEntries, ("DSound: Error querying capabilities for playback stream: %Rhrc\n", hr));
break;
}
- DSLOG(("DSound: playback format: size %d bytes\n"
- " tag = %d\n"
- " nChannels = %d\n"
- " nSamplesPerSec = %d\n"
- " nAvgBytesPerSec = %d\n"
- " nBlockAlign = %d\n"
- " wBitsPerSample = %d\n"
- " cbSize = %d\n",
+ LogFunc(("Playback format:\n"
+ "\tdwBufferBytes = %RI32\n"
+ "\twFormatTag = %RI16\n"
+ "\tnChannels = %RI16\n"
+ "\tnSamplesPerSec = %RU32\n"
+ "\tnAvgBytesPerSec = %RU32\n"
+ "\tnBlockAlign = %RI16\n"
+ "\twBitsPerSample = %RI16\n"
+ "\tcbSize = %RI16\n",
bc.dwBufferBytes,
wfx.wFormatTag,
wfx.nChannels,
@@ -465,24 +457,22 @@ static int dsoundPlayOpen(PDRVHOSTDSOUND pThis, PDSOUNDSTREAMOUT pDSoundStrmOut)
wfx.wBitsPerSample,
wfx.cbSize));
- if (bc.dwBufferBytes & pDSoundStrmOut->hw.Props.uAlign)
- {
- DSLOGREL(("DSound: Playback GetCaps returned misaligned buffer size %ld, alignment %d\n",
- bc.dwBufferBytes, pDSoundStrmOut->hw.Props.uAlign + 1));
- }
+ if (bc.dwBufferBytes & pDSoundStrmOut->strmOut.Props.uAlign)
+ LogRelMax(s_cMaxRelLogEntries, ("DSound: Playback capabilities returned misaligned buffer (size %ld, alignment %RU32)\n",
+ bc.dwBufferBytes, pDSoundStrmOut->strmOut.Props.uAlign + 1));
if (bc.dwBufferBytes != pThis->cfg.cbBufferOut)
- {
- DSLOGREL(("DSound: Playback buffer size mismatch dsound %d, requested %d bytes\n",
- bc.dwBufferBytes, pThis->cfg.cbBufferOut));
- }
+ LogRelMax(s_cMaxRelLogEntries, ("DSound: Playback buffer size mismatched (DirectSound %ld, requested %ld bytes)\n",
+ bc.dwBufferBytes, pThis->cfg.cbBufferOut));
- /* Initial state.
+ /*
+ * Initial state.
* dsoundPlayStart initializes part of it to make sure that Stop/Start continues with a correct
* playback buffer position.
*/
- pDSoundStrmOut->csPlaybackBufferSize = bc.dwBufferBytes >> pDSoundStrmOut->hw.Props.cShift;
- DSLOG(("DSound: playback open csPlaybackBufferSize %d samples\n", pDSoundStrmOut->csPlaybackBufferSize));
+ pDSoundStrmOut->csPlaybackBufferSize = bc.dwBufferBytes >> pDSoundStrmOut->strmOut.Props.cShift;
+ LogFlowFunc(("csPlaybackBufferSize=%ld\n", pDSoundStrmOut->csPlaybackBufferSize));
+
} while (0);
if (SUCCEEDED(hr))
@@ -494,21 +484,23 @@ static int dsoundPlayOpen(PDRVHOSTDSOUND pThis, PDSOUNDSTREAMOUT pDSoundStrmOut)
static void dsoundPlayClearSamples(PDSOUNDSTREAMOUT pDSoundStrmOut)
{
+ AssertPtrReturnVoid(pDSoundStrmOut);
+
LPVOID pv1, pv2;
DWORD cb1, cb2;
- int rc = dsoundLockOutput(pDSoundStrmOut->pDSB, &pDSoundStrmOut->hw.Props,
- 0, pDSoundStrmOut->csPlaybackBufferSize << pDSoundStrmOut->hw.Props.cShift,
+ int rc = dsoundLockOutput(pDSoundStrmOut->pDSB, &pDSoundStrmOut->strmOut.Props,
+ 0, pDSoundStrmOut->csPlaybackBufferSize << pDSoundStrmOut->strmOut.Props.cShift,
&pv1, &pv2, &cb1, &cb2, DSBLOCK_ENTIREBUFFER);
if (RT_SUCCESS(rc))
{
- int len1 = cb1 >> pDSoundStrmOut->hw.Props.cShift;
- int len2 = cb2 >> pDSoundStrmOut->hw.Props.cShift;
+ int len1 = cb1 >> pDSoundStrmOut->strmOut.Props.cShift;
+ int len2 = cb2 >> pDSoundStrmOut->strmOut.Props.cShift;
if (pv1 && len1)
- audio_pcm_info_clear_buf(&pDSoundStrmOut->hw.Props, pv1, len1);
+ drvAudioClearBuf(&pDSoundStrmOut->strmOut.Props, pv1, len1);
if (pv2 && len2)
- audio_pcm_info_clear_buf(&pDSoundStrmOut->hw.Props, pv2, len2);
+ drvAudioClearBuf(&pDSoundStrmOut->strmOut.Props, pv2, len2);
dsoundUnlockOutput(pDSoundStrmOut->pDSB, pv1, pv2, cb1, cb2);
}
@@ -516,6 +508,9 @@ static void dsoundPlayClearSamples(PDSOUNDSTREAMOUT pDSoundStrmOut)
static int dsoundPlayGetStatus(LPDIRECTSOUNDBUFFER8 pDSB, DWORD *pStatus)
{
+ AssertPtrReturn(pDSB, VERR_INVALID_POINTER);
+ /* pStatus is optional. */
+
int rc = VINF_SUCCESS;
DWORD dwStatus = 0;
@@ -526,24 +521,21 @@ static int dsoundPlayGetStatus(LPDIRECTSOUNDBUFFER8 pDSB, DWORD *pStatus)
{
rc = dsoundPlayRestore(pDSB);
if (RT_SUCCESS(rc))
- {
hr = IDirectSoundBuffer8_GetStatus(pDSB, &dwStatus);
- }
}
}
if (FAILED(hr))
{
- DSLOG(("DSound: playback GetStatus %Rhrc\n", hr));
+ LogRelMax(s_cMaxRelLogEntries, ("DSound: Error getting playback status: %Rhrc\n", hr));
if (RT_SUCCESS(rc))
- {
rc = VERR_NOT_SUPPORTED;
- }
}
if (RT_SUCCESS(rc))
{
- *pStatus = dwStatus;
+ if (pStatus)
+ *pStatus = dwStatus;
}
return rc;
@@ -551,40 +543,41 @@ static int dsoundPlayGetStatus(LPDIRECTSOUNDBUFFER8 pDSB, DWORD *pStatus)
static void dsoundPlayStop(PDRVHOSTDSOUND pThis, PDSOUNDSTREAMOUT pDSoundStrmOut)
{
+ AssertPtrReturnVoid(pThis);
+ AssertPtrReturnVoid(pDSoundStrmOut);
+
if (pDSoundStrmOut->pDSB != NULL)
{
- DWORD dwStatus;
/* This performs some restore, so call it anyway and ignore result. */
- dsoundPlayGetStatus(pDSoundStrmOut->pDSB, &dwStatus);
+ dsoundPlayGetStatus(pDSoundStrmOut->pDSB, NULL /* Status */);
- DSLOG(("DSound: playback stop\n"));
+ LogFlowFunc(("Playback stopped\n"));
HRESULT hr = IDirectSoundBuffer8_Stop(pDSoundStrmOut->pDSB);
- if (FAILED(hr))
+ if (SUCCEEDED(hr))
{
- DSLOG(("DSound: stop playback buffer %Rhrc\n", hr));
+ dsoundPlayClearSamples(pDSoundStrmOut);
}
+ else
+ LogRelMax(s_cMaxRelLogEntries, ("DSound: Errpor stopping playback buffer: %Rhrc\n", hr));
}
}
static int dsoundPlayStart(PDSOUNDSTREAMOUT pDSoundStrmOut)
{
- int rc = VINF_SUCCESS;
+ AssertPtrReturn(pDSoundStrmOut, VERR_INVALID_POINTER);
+
+ int rc;
if (pDSoundStrmOut->pDSB != NULL)
{
DWORD dwStatus;
- int rc2 = dsoundPlayGetStatus(pDSoundStrmOut->pDSB, &dwStatus);
- if (RT_FAILURE(rc2))
- {
- DSLOG(("DSound: playback start GetStatus %Rrc\n", rc2));
- rc = rc2; /* Propagate error. */
- }
- else
+ rc = dsoundPlayGetStatus(pDSoundStrmOut->pDSB, &dwStatus);
+ if (RT_SUCCESS(rc))
{
if (dwStatus & DSBSTATUS_PLAYING)
{
- DSLOG(("DSound: already playing\n"));
+ LogFlowFunc(("Already playing\n"));
}
else
{
@@ -592,21 +585,19 @@ static int dsoundPlayStart(PDSOUNDSTREAMOUT pDSoundStrmOut)
pDSoundStrmOut->fReinitPlayPos = true;
- DSLOG(("DSound: playback start\n"));
+ LogFlowFunc(("Playback started\n"));
HRESULT hr = IDirectSoundBuffer8_Play(pDSoundStrmOut->pDSB, 0, 0, DSBPLAY_LOOPING);
if (FAILED(hr))
{
- DSLOGREL(("DSound: Playback start %Rhrc\n", hr));
+ LogRelMax(s_cMaxRelLogEntries, ("DSound: Error starting playback: %Rhrc\n", hr));
rc = VERR_NOT_SUPPORTED;
}
}
}
}
else
- {
rc = VERR_INVALID_STATE;
- }
return rc;
}
@@ -617,6 +608,9 @@ static int dsoundPlayStart(PDSOUNDSTREAMOUT pDSoundStrmOut)
static LPCGUID dsoundCaptureSelectDevice(PDRVHOSTDSOUND pThis, PDSOUNDSTREAMIN pDSoundStrmIn)
{
+ AssertPtrReturn(pThis, NULL);
+ AssertPtrReturn(pDSoundStrmIn, NULL);
+
LPCGUID pGUID = pThis->cfg.pGuidCapture;
if (!pGUID)
@@ -629,12 +623,14 @@ static LPCGUID dsoundCaptureSelectDevice(PDRVHOSTDSOUND pThis, PDSOUNDSTREAMIN p
{
RTListForEach(&pThis->lstDevInput, pDev, DSOUNDDEV, Node)
{
- if (RTStrIStr(pDev->pszName, "Mic")) /** @todo what is with non en_us windows versions? */
+ if (RTStrIStr(pDev->pszName, "Mic")) /** @todo what is with non en_us windows versions? */
break;
}
if (RTListNodeIsDummy(&pThis->lstDevInput, pDev, DSOUNDDEV, Node))
pDev = NULL; /* Found nothing. */
- } break;
+
+ break;
+ }
case PDMAUDIORECSOURCE_LINE_IN:
default:
@@ -644,17 +640,20 @@ static LPCGUID dsoundCaptureSelectDevice(PDRVHOSTDSOUND pThis, PDSOUNDSTREAMIN p
if (pDev)
{
- DSLOG(("DSound: Guest \"%s\" is using host \"%s\"\n",
- drvAudioRecSourceToString(pDSoundStrmIn->enmRecSource), pDev->pszName));
+ LogRel2(("DSound: Guest \"%s\" is using host \"%s\"\n",
+ drvAudioRecSourceToString(pDSoundStrmIn->enmRecSource), pDev->pszName));
pGUID = &pDev->Guid;
}
}
char *pszGUID = dsoundGUIDToUtf8StrA(pGUID);
- LogRel(("DSound: Guest \"%s\" is using host device with GUID: %s\n",
- drvAudioRecSourceToString(pDSoundStrmIn->enmRecSource), pszGUID ? pszGUID : "NULL"));
- RTStrFree(pszGUID);
+ if (pszGUID)
+ {
+ LogRel(("DSound: Guest \"%s\" is using host device with GUID: %s\n",
+ drvAudioRecSourceToString(pDSoundStrmIn->enmRecSource), pszGUID));
+ RTStrFree(pszGUID);
+ }
return pGUID;
}
@@ -672,7 +671,7 @@ static int dsoundCaptureInterfaceCreate(PDRVHOSTDSOUND pThis, PDSOUNDSTREAMIN pD
{
if (pDSoundStrmIn->pDSC != NULL)
{
- DSLOG(("DSound: DirectSoundCapture instance already exists\n"));
+ LogFunc(("DSound: DirectSoundCapture instance already exists\n"));
return VINF_SUCCESS;
}
@@ -680,7 +679,7 @@ static int dsoundCaptureInterfaceCreate(PDRVHOSTDSOUND pThis, PDSOUNDSTREAMIN pD
IID_IDirectSoundCapture8, (void **)&pDSoundStrmIn->pDSC);
if (FAILED(hr))
{
- DSLOGREL(("DSound: DirectSoundCapture create instance %Rhrc\n", hr));
+ LogRel(("DSound: Error creating capture instance: %Rhrc\n", hr));
}
else
{
@@ -689,13 +688,9 @@ static int dsoundCaptureInterfaceCreate(PDRVHOSTDSOUND pThis, PDSOUNDSTREAMIN pD
if (FAILED(hr))
{
if (hr == DSERR_NODRIVER)
- {
- DSLOGREL(("DSound: DirectSound capture is currently unavailable\n"));
- }
+ LogRel(("DSound: DirectSound capture is currently unavailable\n"));
else
- {
- DSLOGREL(("DSound: DirectSoundCapture initialize %Rhrc\n", hr));
- }
+ LogRel(("DSound: Error initializing capture: %Rhrc\n", hr));
dsoundCaptureInterfaceRelease(pDSoundStrmIn);
}
}
@@ -705,15 +700,15 @@ static int dsoundCaptureInterfaceCreate(PDRVHOSTDSOUND pThis, PDSOUNDSTREAMIN pD
static void dsoundCaptureClose(PDSOUNDSTREAMIN pDSoundStrmIn)
{
- DSLOG(("DSound: capture close %p buffer %p\n", pDSoundStrmIn, pDSoundStrmIn->pDSCB));
+ AssertPtrReturnVoid(pDSoundStrmIn);
+
+ LogFlowFunc(("pDSoundStrmIn=%p, pDSCB=%p\n", pDSoundStrmIn, pDSoundStrmIn->pDSCB));
if (pDSoundStrmIn->pDSCB)
{
HRESULT hr = IDirectSoundCaptureBuffer_Stop(pDSoundStrmIn->pDSCB);
if (FAILED (hr))
- {
- DSLOG(("DSound: close capture buffer stop %Rhrc\n", hr));
- }
+ LogRelMax(s_cMaxRelLogEntries, ("DSound: Error stopping capture buffer: %Rhrc\n", hr));
IDirectSoundCaptureBuffer8_Release(pDSoundStrmIn->pDSCB);
pDSoundStrmIn->pDSCB = NULL;
@@ -724,18 +719,21 @@ static void dsoundCaptureClose(PDSOUNDSTREAMIN pDSoundStrmIn)
static int dsoundCaptureOpen(PDRVHOSTDSOUND pThis, PDSOUNDSTREAMIN pDSoundStrmIn)
{
- DSLOG(("DSound: capture open %p size %u bytes freq %u, chan %u, bits %u, sign %d\n",
- pDSoundStrmIn,
- pThis->cfg.cbBufferIn,
- pDSoundStrmIn->hw.Props.uHz,
- pDSoundStrmIn->hw.Props.cChannels,
- pDSoundStrmIn->hw.Props.cBits,
- pDSoundStrmIn->hw.Props.fSigned));
+ AssertPtrReturn(pThis, VERR_INVALID_POINTER);
+ AssertPtrReturn(pDSoundStrmIn, VERR_INVALID_POINTER);
+
+ LogFlowFunc(("pDSoundStrmIn=%p, cbBufferIn=%ld, uHz=%RU32, cChannels=%RU8, cBits=%RU8, fSigned=%RTbool\n",
+ pDSoundStrmIn,
+ pThis->cfg.cbBufferIn,
+ pDSoundStrmIn->strmIn.Props.uHz,
+ pDSoundStrmIn->strmIn.Props.cChannels,
+ pDSoundStrmIn->strmIn.Props.cBits,
+ pDSoundStrmIn->strmIn.Props.fSigned));
if (pDSoundStrmIn->pDSCB != NULL)
{
/* Should not happen but be forgiving. */
- DSLOGREL(("DSound: DirectSoundCaptureBuffer already exists\n"));
+ LogFlowFunc(("Capture buffer already exists\n"));
dsoundCaptureClose(pDSoundStrmIn);
}
@@ -760,10 +758,9 @@ static int dsoundCaptureOpen(PDRVHOSTDSOUND pThis, PDSOUNDSTREAMIN pDSoundStrmIn
bd.dwBufferBytes = pThis->cfg.cbBufferIn;
hr = IDirectSoundCapture_CreateCaptureBuffer(pDSoundStrmIn->pDSC,
&bd, &pDSCB, NULL);
-
if (FAILED(hr))
{
- DSLOGREL(("DSound: Create capture buffer %Rhrc\n", hr));
+ LogRelMax(s_cMaxRelLogEntries, ("DSound: Error creating capture buffer: %Rhrc\n", hr));
pDSoundStrmIn->pDSCB = NULL;
break;
}
@@ -772,25 +769,24 @@ static int dsoundCaptureOpen(PDRVHOSTDSOUND pThis, PDSOUNDSTREAMIN pDSoundStrmIn
IDirectSoundCaptureBuffer_Release(pDSCB);
if (FAILED(hr))
{
- DSLOGREL(("DSound: Querying capture buffer %Rhrc\n", hr));
+ LogRelMax(s_cMaxRelLogEntries, ("DSound: Error querying for capture buffer interface: %Rhrc\n", hr));
break;
}
/* Query the actual parameters. */
-
DWORD cbReadPos = 0;
hr = IDirectSoundCaptureBuffer8_GetCurrentPosition(pDSoundStrmIn->pDSCB, NULL, &cbReadPos);
if (FAILED(hr))
{
cbReadPos = 0;
- DSLOG(("DSound: open GetCurrentPosition %Rhrc\n", hr));
+ LogRelMax(s_cMaxRelLogEntries, ("DSound: Error retrieving current position for capture stream: %Rhrc\n", hr));
}
RT_ZERO(wfx);
hr = IDirectSoundCaptureBuffer8_GetFormat(pDSoundStrmIn->pDSCB, &wfx, sizeof(wfx), NULL);
if (FAILED(hr))
{
- DSLOGREL(("DSound: Capture buffer GetFormat %Rhrc\n", hr));
+ LogRelMax(s_cMaxRelLogEntries, ("DSound: Error querying format for capture stream: %Rhrc\n", hr));
break;
}
@@ -800,18 +796,19 @@ static int dsoundCaptureOpen(PDRVHOSTDSOUND pThis, PDSOUNDSTREAMIN pDSoundStrmIn
hr = IDirectSoundCaptureBuffer8_GetCaps(pDSoundStrmIn->pDSCB, &bc);
if (FAILED (hr))
{
- DSLOGREL(("DSound: Capture buffer GetCaps %Rhrc\n", hr));
+ LogRelMax(s_cMaxRelLogEntries, ("DSound: Error querying capabilities for capture stream: %Rhrc\n", hr));
break;
}
- DSLOG(("DSound: capture buffer format: size %d bytes\n"
- " tag = %d\n"
- " nChannels = %d\n"
- " nSamplesPerSec = %d\n"
- " nAvgBytesPerSec = %d\n"
- " nBlockAlign = %d\n"
- " wBitsPerSample = %d\n"
- " cbSize = %d\n",
+ LogFunc(("Capture format:\n"
+ "\tdwBufferBytes = %RI32\n"
+ "\twFormatTag = %RI16\n"
+ "\tnChannels = %RI16\n"
+ "\tnSamplesPerSec = %RU32\n"
+ "\tnAvgBytesPerSec = %RU32\n"
+ "\tnBlockAlign = %RI16\n"
+ "\twBitsPerSample = %RI16\n"
+ "\tcbSize = %RI16\n",
bc.dwBufferBytes,
wfx.wFormatTag,
wfx.nChannels,
@@ -821,25 +818,24 @@ static int dsoundCaptureOpen(PDRVHOSTDSOUND pThis, PDSOUNDSTREAMIN pDSoundStrmIn
wfx.wBitsPerSample,
wfx.cbSize));
- if (bc.dwBufferBytes & pDSoundStrmIn->hw.Props.uAlign)
- {
- DSLOGREL(("DSound: GetCaps returned misaligned buffer size %ld, alignment %d\n",
- bc.dwBufferBytes, pDSoundStrmIn->hw.Props.uAlign + 1));
- }
+ if (bc.dwBufferBytes & pDSoundStrmIn->strmIn.Props.uAlign)
+ LogRelMax(s_cMaxRelLogEntries, ("DSound: Capture capabilities returned misaligned buffer (size %ld, alignment %RU32)\n",
+ bc.dwBufferBytes, pDSoundStrmIn->strmIn.Props.uAlign + 1));
if (bc.dwBufferBytes != pThis->cfg.cbBufferIn)
- {
- DSLOGREL(("DSound: Buffer size mismatch dsound %u, requested %u bytes\n",
+ LogRelMax(s_cMaxRelLogEntries, ("DSound: Capture buffer size mismatched (DirectSound %ld, requested %ld bytes)\n",
bc.dwBufferBytes, pThis->cfg.cbBufferIn));
- }
/* Initial state: reading at the initial capture position. */
- pDSoundStrmIn->csCaptureReadPos = cbReadPos >> pDSoundStrmIn->hw.Props.cShift;
- pDSoundStrmIn->csCaptureBufferSize = bc.dwBufferBytes >> pDSoundStrmIn->hw.Props.cShift;
- DSLOG(("DSound: capture open csCaptureReadPos %d, csCaptureBufferSize %d samples\n",
- pDSoundStrmIn->csCaptureReadPos, pDSoundStrmIn->csCaptureBufferSize));
+ pDSoundStrmIn->csCaptureReadPos = cbReadPos >> pDSoundStrmIn->strmIn.Props.cShift;
+ pDSoundStrmIn->csCaptureBufferSize = bc.dwBufferBytes >> pDSoundStrmIn->strmIn.Props.cShift;
+
+ LogFlowFunc(("csCaptureReadPos=%ld, csCaptureBufferSize=%ld\n",
+ pDSoundStrmIn->csCaptureReadPos, pDSoundStrmIn->csCaptureBufferSize));
+ /* Update status. */
pDSoundStrmIn->hrLastCaptureIn = S_OK;
+
} while (0);
if (SUCCEEDED(hr))
@@ -851,20 +847,23 @@ static int dsoundCaptureOpen(PDRVHOSTDSOUND pThis, PDSOUNDSTREAMIN pDSoundStrmIn
static void dsoundCaptureStop(PDSOUNDSTREAMIN pDSoundStrmIn)
{
+ AssertPtrReturnVoid(pDSoundStrmIn);
+
if (pDSoundStrmIn->pDSCB)
{
- DSLOG(("DSound: capture stop\n"));
+ LogFlowFunc(("Capturing stopped\n"));
HRESULT hr = IDirectSoundCaptureBuffer_Stop(pDSoundStrmIn->pDSCB);
if (FAILED(hr))
- {
- DSLOG(("DSound: stop capture buffer %Rhrc\n", hr));
- }
+ LogRelMax(s_cMaxRelLogEntries, ("DSound: Error stopping capture buffer: %Rhrc\n", hr));
}
}
static int dsoundCaptureStart(PDRVHOSTDSOUND pThis, PDSOUNDSTREAMIN pDSoundStrmIn)
{
+ AssertPtrReturn(pThis, VERR_INVALID_POINTER);
+ AssertPtrReturn(pDSoundStrmIn, VERR_INVALID_POINTER);
+
HRESULT hr;
if (pDSoundStrmIn->pDSCB != NULL)
@@ -873,28 +872,26 @@ static int dsoundCaptureStart(PDRVHOSTDSOUND pThis, PDSOUNDSTREAMIN pDSoundStrmI
hr = IDirectSoundCaptureBuffer8_GetStatus(pDSoundStrmIn->pDSCB, &dwStatus);
if (FAILED(hr))
{
- DSLOG(("DSound: start GetStatus %Rhrc\n", hr));
+ LogRelMax(s_cMaxRelLogEntries, ("DSound: Error getting capture buffer status: %Rhrc\n", hr));
}
else
{
if (dwStatus & DSCBSTATUS_CAPTURING)
{
- DSLOG(("DSound: already capturing\n"));
+ LogFlowFunc(("Already capturing\n"));
}
else
{
- DSLOG(("DSound: capture start\n"));
-
+ LogFlowFunc(("Capturig started\n"));
hr = IDirectSoundCaptureBuffer8_Start(pDSoundStrmIn->pDSCB, DSCBSTART_LOOPING);
if (FAILED (hr))
- {
- DSLOGREL(("DSound: Start %Rhrc\n", hr));
- }
+ LogRelMax(s_cMaxRelLogEntries, ("DSound: Error starting capture: %Rhrc\n", hr));
}
}
}
else
{
+ AssertMsgFailed(("No/invalid capture buffer\n"));
hr = E_FAIL;
}
@@ -940,17 +937,26 @@ static void dsoundDevRemove(PDSOUNDDEV pDev)
static void dsoundLogDevice(const char *pszType, LPGUID lpGUID, LPCWSTR lpwstrDescription, LPCWSTR lpwstrModule)
{
- char *pszGUID = dsoundGUIDToUtf8StrA(lpGUID);
+ AssertPtrReturnVoid(pszType);
+ AssertPtrReturnVoid(lpGUID);
+ AssertPtrReturnVoid(lpwstrDescription);
+ AssertPtrReturnVoid(lpwstrModule);
- LogRel(("DSound: %s: GUID: %s [%ls] (Module: %ls)\n",
- pszType, pszGUID? pszGUID: "no GUID", lpwstrDescription, lpwstrModule));
+ char *pszGUID = dsoundGUIDToUtf8StrA(lpGUID);
+ if (pszGUID)
+ {
+ LogRel(("DSound: %s: GUID: %s [%ls] (Module: %ls)\n",
+ pszType, pszGUID, lpwstrDescription, lpwstrModule));
- RTStrFree(pszGUID);
+ RTStrFree(pszGUID);
+ }
}
static BOOL CALLBACK dsoundEnumCallback(LPGUID lpGUID, LPCWSTR lpwstrDescription,
LPCWSTR lpwstrModule, LPVOID lpContext)
{
+ AssertPtrReturn(lpContext, FALSE);
+
PDSOUNDENUMCBCTX pCtx = (PDSOUNDENUMCBCTX)lpContext;
AssertPtrReturn(pCtx, FALSE);
AssertPtrReturn(pCtx->pDrv, FALSE);
@@ -959,6 +965,9 @@ static BOOL CALLBACK dsoundEnumCallback(LPGUID lpGUID, LPCWSTR lpwstrDescription
if (!lpGUID)
return TRUE;
+ AssertPtrReturn(lpwstrDescription, FALSE);
+ AssertPtrReturn(lpwstrModule, FALSE);
+
dsoundLogDevice("Output", lpGUID, lpwstrDescription, lpwstrModule);
int rc = dsoundDevAdd(&pCtx->pDrv->lstDevOutput,
@@ -985,7 +994,7 @@ static BOOL CALLBACK dsoundCaptureEnumCallback(LPGUID lpGUID, LPCWSTR lpwstrDesc
dsoundLogDevice("Input", lpGUID, lpwstrDescription, lpwstrModule);
int rc = dsoundDevAdd(&pCtx->pDrv->lstDevInput,
- lpGUID, lpwstrDescription, NULL /* ppDev */);
+ lpGUID, lpwstrDescription, NULL /* ppDev */);
if (RT_FAILURE(rc))
return FALSE; /* Abort enumeration. */
@@ -1003,6 +1012,11 @@ static DECLCALLBACK(int) drvHostDSoundInitOut(PPDMIHOSTAUDIO pInterface,
PPDMAUDIOHSTSTRMOUT pHstStrmOut, PPDMAUDIOSTREAMCFG pCfg,
uint32_t *pcSamples)
{
+ AssertPtrReturn(pInterface, VERR_INVALID_POINTER);
+ AssertPtrReturn(pHstStrmOut, VERR_INVALID_POINTER);
+ AssertPtrReturn(pCfg, VERR_INVALID_POINTER);
+ /* pcSamples is optional. */
+
LogFlowFunc(("pHstStrmOut=%p, pCfg=%p\n", pHstStrmOut, pCfg));
PDRVHOSTDSOUND pThis = PDMIHOSTAUDIO_2_DRVHOSTDSOUND(pInterface);
@@ -1011,7 +1025,7 @@ static DECLCALLBACK(int) drvHostDSoundInitOut(PPDMIHOSTAUDIO pInterface,
pDSoundStrmOut->streamCfg = *pCfg;
pDSoundStrmOut->streamCfg.enmEndianness = PDMAUDIOHOSTENDIANNESS;
- int rc = drvAudioStreamCfgToProps(&pDSoundStrmOut->streamCfg, &pDSoundStrmOut->hw.Props);
+ int rc = drvAudioStreamCfgToProps(&pDSoundStrmOut->streamCfg, &pDSoundStrmOut->strmOut.Props);
if (RT_SUCCESS(rc))
{
pDSoundStrmOut->pDS = NULL;
@@ -1060,18 +1074,22 @@ static DECLCALLBACK(int) drvHostDSoundControlOut(PPDMIHOSTAUDIO pInterface,
rc = dsoundPlayStart(pDSoundStrmOut);
}
- } break;
+
+ break;
+ }
case PDMAUDIOSTREAMCMD_DISABLE:
{
dsoundPlayStop(pThis, pDSoundStrmOut);
- } break;
+ break;
+ }
default:
{
- AssertMsgFailed(("Invalid command %ld\n", enmStreamCmd));
+ AssertMsgFailed(("Invalid command: %ld\n", enmStreamCmd));
rc = VERR_INVALID_PARAMETER;
- } break;
+ break;
+ }
}
LogFlowFuncLeaveRC(rc);
@@ -1082,139 +1100,123 @@ static DECLCALLBACK(int) drvHostDSoundControlOut(PPDMIHOSTAUDIO pInterface,
static DECLCALLBACK(int) drvHostDSoundPlayOut(PPDMIHOSTAUDIO pInterface, PPDMAUDIOHSTSTRMOUT pHstStrmOut,
uint32_t *pcSamplesPlayed)
{
+ AssertPtrReturn(pInterface, VERR_INVALID_POINTER);
+ AssertPtrReturn(pHstStrmOut, VERR_INVALID_POINTER);
+ /* pcSamplesPlayed is optional. */
+
PDRVHOSTDSOUND pThis = PDMIHOSTAUDIO_2_DRVHOSTDSOUND(pInterface);
PDSOUNDSTREAMOUT pDSoundStrmOut = (PDSOUNDSTREAMOUT)pHstStrmOut;
- LPDIRECTSOUNDBUFFER8 pDSB = pDSoundStrmOut->pDSB;
int rc = VINF_SUCCESS;
+ uint32_t cReadTotal = 0;
- if (!pDSB)
+ do
{
- if (pcSamplesPlayed) /** @todo single point of return */
- *pcSamplesPlayed = 0;
- return VINF_SUCCESS;
- }
+ LPDIRECTSOUNDBUFFER8 pDSB = pDSoundStrmOut->pDSB;
+ if (!pDSB)
+ break;
- int cShift = pHstStrmOut->Props.cShift;
- DWORD cbBuffer = pDSoundStrmOut->csPlaybackBufferSize << cShift;
+ int cShift = pHstStrmOut->Props.cShift;
+ DWORD cbBuffer = pDSoundStrmOut->csPlaybackBufferSize << cShift;
- DWORD cbPlayPos, cbWritePos;
- HRESULT hr = IDirectSoundBuffer8_GetCurrentPosition(pDSB, &cbPlayPos, &cbWritePos);
- if (hr == DSERR_BUFFERLOST)
- {
- rc = dsoundPlayRestore(pDSB);
- if (RT_FAILURE(rc))
+ DWORD cbPlayPos, cbWritePos;
+ HRESULT hr = IDirectSoundBuffer8_GetCurrentPosition(pDSB, &cbPlayPos, &cbWritePos);
+ if (hr == DSERR_BUFFERLOST)
{
- if (pcSamplesPlayed)
- *pcSamplesPlayed = 0;
- return VINF_SUCCESS;
+ rc = dsoundPlayRestore(pDSB);
+ if (RT_FAILURE(rc))
+ break;
+
+ hr = IDirectSoundBuffer8_GetCurrentPosition(pDSB, &cbPlayPos, &cbWritePos);
+ if (hr == DSERR_BUFFERLOST) /* Avoid log flooding if the error is still there. */
+ break;
}
- hr = IDirectSoundBuffer8_GetCurrentPosition(pDSB, &cbPlayPos, &cbWritePos);
- if (hr == DSERR_BUFFERLOST)
+ if (FAILED(hr))
{
- /* Avoid log flooding if the error is still there. */
- if (pcSamplesPlayed)
- *pcSamplesPlayed = 0;
- return VINF_SUCCESS;
+ LogRelMax(s_cMaxRelLogEntries, ("Error retrieving current playback position: %Rhrc\n", hr));
+ break;
}
- }
- if (FAILED (hr))
- {
- DSLOG(("DSound: get playback buffer position %Rhrc\n", hr));
- if (pcSamplesPlayed)
- *pcSamplesPlayed = 0;
- return VINF_SUCCESS;
- }
- DWORD cbFree;
- DWORD cbPlayWritePos;
- if (pDSoundStrmOut->fReinitPlayPos)
- {
- pDSoundStrmOut->fReinitPlayPos = false;
+ DWORD cbFree;
+ DWORD cbPlayWritePos;
+ if (pDSoundStrmOut->fReinitPlayPos)
+ {
+ pDSoundStrmOut->fReinitPlayPos = false;
- pDSoundStrmOut->cbPlayWritePos = cbWritePos;
+ pDSoundStrmOut->cbPlayWritePos = cbWritePos;
- cbPlayWritePos = pDSoundStrmOut->cbPlayWritePos;
- cbFree = cbBuffer - dsoundRingDistance(cbWritePos, cbPlayPos, cbBuffer);
- }
- else
- {
- if (pDSoundStrmOut->cbPlayWritePos == cbPlayPos)
+ cbPlayWritePos = pDSoundStrmOut->cbPlayWritePos;
+ cbFree = cbBuffer - dsoundRingDistance(cbWritePos, cbPlayPos, cbBuffer);
+ }
+ else
{
- /* Full buffer. */
- if (pcSamplesPlayed)
- *pcSamplesPlayed = 0;
- return VINF_SUCCESS;
+ /* Full buffer? */
+ if (pDSoundStrmOut->cbPlayWritePos == cbPlayPos)
+ break;
+
+ cbPlayWritePos = pDSoundStrmOut->cbPlayWritePos;
+ cbFree = dsoundRingDistance(cbPlayPos, cbPlayWritePos, cbBuffer);
}
- cbPlayWritePos = pDSoundStrmOut->cbPlayWritePos;
- cbFree = dsoundRingDistance(cbPlayPos, cbPlayWritePos, cbBuffer);
- }
+ uint32_t csLive = drvAudioHstOutSamplesLive(pHstStrmOut);
+ uint32_t cbLive = csLive << cShift;
- uint32_t csLive = drvAudioHstOutSamplesLive(pHstStrmOut, NULL /* pcStreamsLive */);
- uint32_t cbLive = csLive << cShift;
+ /* Do not write more than available space in the DirectSound playback buffer. */
+ cbLive = RT_MIN(cbFree, cbLive);
- /* Do not write more than available space in the DirectSound playback buffer. */
- cbLive = RT_MIN(cbFree, cbLive);
+ cbLive &= ~pHstStrmOut->Props.uAlign;
+ if (cbLive == 0 || cbLive > cbBuffer)
+ {
+ LogFlowFunc(("cbLive=%RU32, cbBuffer=%ld, cbPlayWritePos=%ld, cbPlayPos=%ld\n",
+ cbLive, cbBuffer, cbPlayWritePos, cbPlayPos));
+ break;
+ }
- cbLive &= ~pHstStrmOut->Props.uAlign;
- if (cbLive == 0 || cbLive > cbBuffer)
- {
- DSLOG(("DSound: cbLive=%d cbBuffer=%d cbPlayWritePos=%d cbPlayPos=%d\n",
- cbLive, cbBuffer, cbPlayWritePos, cbPlayPos));
- if (pcSamplesPlayed)
- *pcSamplesPlayed = 0;
- return VINF_SUCCESS;
- }
+ LPVOID pv1, pv2;
+ DWORD cb1, cb2;
+ rc = dsoundLockOutput(pDSB, &pHstStrmOut->Props, cbPlayWritePos, cbLive,
+ &pv1, &pv2, &cb1, &cb2, 0 /* dwFlags */);
+ if (RT_FAILURE(rc))
+ break;
- LPVOID pv1, pv2;
- DWORD cb1, cb2;
- rc = dsoundLockOutput(pDSB, &pHstStrmOut->Props, cbPlayWritePos, cbLive,
- &pv1, &pv2, &cb1, &cb2, 0 /* dwFlags */);
- if (RT_FAILURE(rc))
- {
- if (pcSamplesPlayed)
- *pcSamplesPlayed = 0;
- return VINF_SUCCESS;
- }
+ DWORD len1 = cb1 >> cShift;
+ DWORD len2 = cb2 >> cShift;
- DWORD len1 = cb1 >> cShift;
- DWORD len2 = cb2 >> cShift;
+ uint32_t cRead = 0;
- uint32_t cReadTotal = 0;
- uint32_t cRead = 0;
+ if (pv1 && cb1)
+ {
+ rc = AudioMixBufReadCirc(&pHstStrmOut->MixBuf, pv1, cb1, &cRead);
+ if (RT_SUCCESS(rc))
+ cReadTotal += cRead;
+ }
- if (pv1 && cb1)
- {
- rc = AudioMixBufReadCirc(&pHstStrmOut->MixBuf, pv1, cb1, &cRead);
- if (RT_SUCCESS(rc))
- cReadTotal += cRead;
- }
+ if ( RT_SUCCESS(rc)
+ && cReadTotal == len1
+ && pv2 && cb2)
+ {
+ rc = AudioMixBufReadCirc(&pHstStrmOut->MixBuf, pv2, cb2, &cRead);
+ if (RT_SUCCESS(rc))
+ cReadTotal += cRead;
+ }
- if ( RT_SUCCESS(rc)
- && cReadTotal == len1
- && pv2 && cb2)
- {
- rc = AudioMixBufReadCirc(&pHstStrmOut->MixBuf, pv2, cb2, &cRead);
- if (RT_SUCCESS(rc))
- cReadTotal += cRead;
- }
+ dsoundUnlockOutput(pDSB, pv1, pv2, cb1, cb2);
- dsoundUnlockOutput(pDSB, pv1, pv2, cb1, cb2);
+ pDSoundStrmOut->cbPlayWritePos = (cbPlayWritePos + (cReadTotal << cShift)) % cbBuffer;
- pDSoundStrmOut->cbPlayWritePos = (cbPlayWritePos + (cReadTotal << cShift)) % cbBuffer;
+ LogFlowFunc(("%RU32 (%RU32 samples) out of %RU32%s, buffer write pos %ld -> %ld, rc=%Rrc\n",
+ AUDIOMIXBUF_S2B(&pHstStrmOut->MixBuf, cReadTotal), cReadTotal, cbLive,
+ cbLive != AUDIOMIXBUF_S2B(&pHstStrmOut->MixBuf, cReadTotal) ? " !!!": "",
+ cbPlayWritePos, pDSoundStrmOut->cbPlayWritePos, rc));
- DSLOGF(("DSound: PlayOut %RU32 (%RU32 samples) out of %d%s, ds write pos %d -> %d, rc=%Rrc\n",
- AUDIOMIXBUF_S2B(&pHstStrmOut->MixBuf, cReadTotal), cReadTotal, cbLive,
- cbLive != AUDIOMIXBUF_S2B(&pHstStrmOut->MixBuf, cReadTotal) ? " !!!": "",
- cbPlayWritePos, pDSoundStrmOut->cbPlayWritePos, rc));
+ if (cReadTotal)
+ {
+ AudioMixBufFinish(&pHstStrmOut->MixBuf, cReadTotal);
+ rc = VINF_SUCCESS; /* Played something. */
+ }
- if (cReadTotal)
- {
- AudioMixBufFinish(&pHstStrmOut->MixBuf, cReadTotal);
- rc = VINF_SUCCESS; /* Played something. */
- }
+ } while (0);
if (pcSamplesPlayed)
*pcSamplesPlayed = cReadTotal;
@@ -1344,7 +1346,7 @@ static DECLCALLBACK(int) drvHostDSoundCaptureIn(PPDMIHOSTAUDIO pInterface, PPDMA
{
if (hr != pDSoundStrmIn->hrLastCaptureIn)
{
- DSLOGREL(("DSound: CaptureIn GetCurrentPosition %Rhrc\n", hr));
+ LogRelMax(s_cMaxRelLogEntries, ("DSound: Error retrieving current capture position: %Rhrc\n", hr));
pDSoundStrmIn->hrLastCaptureIn = hr;
}
@@ -1355,12 +1357,10 @@ static DECLCALLBACK(int) drvHostDSoundCaptureIn(PPDMIHOSTAUDIO pInterface, PPDMA
pDSoundStrmIn->hrLastCaptureIn = hr;
if (cbReadPos & pHstStrmIn->Props.uAlign)
- {
- DSLOG(("DSound: CaptureIn misaligned read position %d(%d)\n", cbReadPos, pHstStrmIn->Props.uAlign));
- }
+ LogFunc(("Misaligned read position %ld (alignment: %RU32)\n", cbReadPos, pHstStrmIn->Props.uAlign));
/* Capture position in samples. */
- int csReadPos = cbReadPos >> pHstStrmIn->Props.cShift;
+ DWORD csReadPos = cbReadPos >> pHstStrmIn->Props.cShift;
/* Number of samples available in the DirectSound capture buffer. */
DWORD csCaptured = dsoundRingDistance(csReadPos, pDSoundStrmIn->csCaptureReadPos, pDSoundStrmIn->csCaptureBufferSize);
@@ -1378,14 +1378,14 @@ static DECLCALLBACK(int) drvHostDSoundCaptureIn(PPDMIHOSTAUDIO pInterface, PPDMA
uint32_t csMixFree = AudioMixBufFree(&pHstStrmIn->MixBuf);
if (csMixFree == 0)
{
- DSLOG(("DSound: capture mix buffer full\n"));
+ LogRelMax(s_cMaxRelLogEntries, ("DSound: Capture buffer full\n"));
if (pcSamplesCaptured)
*pcSamplesCaptured = 0;
return VINF_SUCCESS;
}
- DSLOGF(("DSound: CaptureIn csMixFree = %u, csReadPos = %d, csCaptureReadPos = %d, csCaptured = %u\n",
- csMixFree, csReadPos, pDSoundStrmIn->csCaptureReadPos, csCaptured));
+ LogFlowFunc(("csMixFree=%RU32, csReadPos=%ld, csCaptureReadPos=%ld, csCaptured=%ld\n",
+ csMixFree, csReadPos, pDSoundStrmIn->csCaptureReadPos, csCaptured));
/* No need to fetch more samples than mix buffer can receive. */
csCaptured = RT_MIN(csCaptured, csMixFree);
@@ -1441,8 +1441,8 @@ static DECLCALLBACK(int) drvHostDSoundCaptureIn(PPDMIHOSTAUDIO pInterface, PPDMA
if (RT_SUCCESS(rc))
{
pDSoundStrmIn->csCaptureReadPos = (pDSoundStrmIn->csCaptureReadPos + csProcessed) % pDSoundStrmIn->csCaptureBufferSize;
- DSLOGF(("DSound: CaptureIn %d (%d+%d), processed %d/%d\n",
- csCaptured, len1, len2, csProcessed, csWrittenTotal));
+ LogFlowFunc(("%ld (%ld+%ld), processed %RU32/%RU32\n",
+ csCaptured, len1, len2, csProcessed, csWrittenTotal));
}
if (pcSamplesCaptured)
@@ -1458,7 +1458,7 @@ static DECLCALLBACK(int) drvHostDSoundFiniIn(PPDMIHOSTAUDIO pInterface, PPDMAUDI
dsoundCaptureClose(pDSoundStrmIn);
- pDSoundStrmIn->csCaptureReadPos = 0;
+ pDSoundStrmIn->csCaptureReadPos = 0;
pDSoundStrmIn->csCaptureBufferSize = 0;
RT_ZERO(pDSoundStrmIn->streamCfg);
@@ -1490,20 +1490,20 @@ static DECLCALLBACK(int) drvHostDSoundGetConf(PPDMIHOSTAUDIO pInterface, PPDMAUD
HRESULT hr = DirectSoundEnumerateW(&dsoundEnumCallback, &ctx);
if (FAILED(hr))
- DSLOG(("DSound: Enumerating host playback devices failed %Rhrc\n", hr));
+ LogRel(("DSound: Error enumerating host playback devices: %Rhrc\n", hr));
- DSLOGREL(("DSound: Found %RU32 host playback devices\n", pCfg->cMaxHstStrmsOut));
+ LogRel(("DSound: Found %RU32 host playback devices\n", pCfg->cMaxHstStrmsOut));
if (pCfg->cMaxHstStrmsOut == 0)
pCfg->cMaxHstStrmsOut = 1; /* Support at least one stream. */
hr = DirectSoundCaptureEnumerateW(&dsoundCaptureEnumCallback, &ctx);
if (FAILED(hr))
- DSLOG(("DSound: Enumerating host capturing devices failed %Rhrc\n", hr));
+ LogRel(("DSound: Error enumerating host capturing devices: %Rhrc\n", hr));
- DSLOGREL(("DSound: Found %RU32 host capturing devices\n", pCfg->cMaxHstStrmsIn));
+ LogRel(("DSound: Found %RU32 host capturing devices\n", pCfg->cMaxHstStrmsIn));
if (pCfg->cMaxHstStrmsIn < 2)
{
- DSLOGREL(("DSound: Adjusting the number of host capturing devices from %RU32 to 2\n", pCfg->cMaxHstStrmsIn));
+ LogRel(("DSound: Adjusting the number of host capturing devices from %RU32 to 2\n", pCfg->cMaxHstStrmsIn));
pCfg->cMaxHstStrmsIn = 2; /* Support at least two streams (line in + mic). */
}
@@ -1528,7 +1528,7 @@ static DECLCALLBACK(int) drvHostDSoundInit(PPDMIHOSTAUDIO pInterface)
if (SUCCEEDED(hr))
IDirectSound_Release(pDirectSound);
else
- DSLOGREL(("DSound: Not available %Rhrc\n", hr));
+ LogRel(("DSound: DirectSound not available: %Rhrc\n", hr));
int rc = SUCCEEDED(hr) ? VINF_SUCCESS: VERR_NOT_SUPPORTED;
@@ -1580,7 +1580,7 @@ static LPCGUID dsoundConfigQueryGUID(PCFGMNODE pCfg, const char *pszName, RTUUID
if (RT_SUCCESS(rc))
pGuid = (LPCGUID)&pUuid;
else
- DSLOGREL(("DSound: Parse DirectSound %s %Rrc\n", pszName, rc));
+ LogRel(("DSound: Error parsing device GUID for device '%s': %Rrc\n", pszName, rc));
RTStrFree(pszGuid);
}
@@ -1600,11 +1600,11 @@ static void dSoundConfigInit(PDRVHOSTDSOUND pThis, PCFGMNODE pCfg)
pThis->cfg.pGuidPlay = dsoundConfigQueryGUID(pCfg, "DeviceGuidOut", &pThis->cfg.uuidPlay);
pThis->cfg.pGuidCapture = dsoundConfigQueryGUID(pCfg, "DeviceGuidIn", &pThis->cfg.uuidCapture);
- DSLOG(("DSound: BufsizeOut %u, BufsizeIn %u, DeviceGuidOut {%RTuuid}, DeviceGuidIn {%RTuuid}\n",
- pThis->cfg.cbBufferOut,
- pThis->cfg.cbBufferIn,
- &pThis->cfg.uuidPlay,
- &pThis->cfg.uuidCapture));
+ LogFlowFunc(("BufsizeOut %u, BufsizeIn %u, DeviceGuidOut {%RTuuid}, DeviceGuidIn {%RTuuid}\n",
+ pThis->cfg.cbBufferOut,
+ pThis->cfg.cbBufferIn,
+ &pThis->cfg.uuidPlay,
+ &pThis->cfg.uuidCapture));
}
static DECLCALLBACK(void) drvHostDSoundDestruct(PPDMDRVINS pDrvIns)
@@ -1633,7 +1633,7 @@ static DECLCALLBACK(int) drvHostDSoundConstruct(PPDMDRVINS pDrvIns, PCFGMNODE pC
HRESULT hr = CoInitializeEx(NULL, COINIT_MULTITHREADED);
if (FAILED(hr))
{
- LogRel(("DSound: COM initialize %Rhrc\n", hr));
+ LogRel(("DSound: Error initializing COM: %Rhrc\n", hr));
return VERR_NOT_SUPPORTED;
}
diff --git a/src/VBox/Devices/Audio/DrvHostNullAudio.cpp b/src/VBox/Devices/Audio/DrvHostNullAudio.cpp
index 1f50bbb..9564b49 100644
--- a/src/VBox/Devices/Audio/DrvHostNullAudio.cpp
+++ b/src/VBox/Devices/Audio/DrvHostNullAudio.cpp
@@ -152,7 +152,7 @@ static DECLCALLBACK(int) drvHostNullAudioPlayOut(PPDMIHOSTAUDIO pInterface, PPDM
NULLAUDIOSTREAMOUT *pNullStrmOut = (NULLAUDIOSTREAMOUT *)pHstStrmOut;
/* Consume as many samples as would be played at the current frequency since last call. */
- uint32_t csLive = drvAudioHstOutSamplesLive(pHstStrmOut, NULL /* pcStreamsLive */);
+ uint32_t csLive = drvAudioHstOutSamplesLive(pHstStrmOut);
uint64_t u64TicksNow = PDMDrvHlpTMGetVirtualTime(pDrv->pDrvIns);
uint64_t u64TicksElapsed = u64TicksNow - pNullStrmOut->u64TicksLast;
uint64_t u64TicksFreq = PDMDrvHlpTMGetVirtualFreq(pDrv->pDrvIns);
diff --git a/src/VBox/Devices/Audio/DrvHostOSSAudio.cpp b/src/VBox/Devices/Audio/DrvHostOSSAudio.cpp
index 2a47529..21c2369 100644
--- a/src/VBox/Devices/Audio/DrvHostOSSAudio.cpp
+++ b/src/VBox/Devices/Audio/DrvHostOSSAudio.cpp
@@ -352,8 +352,8 @@ static DECLCALLBACK(int) drvHostOSSAudioControlOut(PPDMIHOSTAUDIO pInterface, PP
{
case PDMAUDIOSTREAMCMD_ENABLE:
{
- audio_pcm_info_clear_buf(&pHstStrmOut->Props,
- pThisStrmOut->pvPCMBuf, AudioMixBufSize(&pHstStrmOut->MixBuf));
+ drvAudioClearBuf(&pHstStrmOut->Props,
+ pThisStrmOut->pvPCMBuf, AudioMixBufSize(&pHstStrmOut->MixBuf));
mask = PCM_ENABLE_OUTPUT;
if (ioctl(pThisStrmOut->hFile, SNDCTL_DSP_SETTRIGGER, &mask) < 0)
@@ -775,8 +775,7 @@ static DECLCALLBACK(int) drvHostOSSAudioPlayOut(PPDMIHOSTAUDIO pInterface, PPDMA
{
size_t cbBuf = AudioMixBufSizeBytes(&pHstStrmOut->MixBuf);
- uint32_t cLive = drvAudioHstOutSamplesLive(pHstStrmOut,
- NULL /* pcStreamsLive */);
+ uint32_t cLive = drvAudioHstOutSamplesLive(pHstStrmOut);
uint32_t cToRead;
#ifndef RT_OS_L4
diff --git a/src/VBox/Devices/Audio/DrvHostPulseAudio.cpp b/src/VBox/Devices/Audio/DrvHostPulseAudio.cpp
index ed7de9e..62cdf29 100644
--- a/src/VBox/Devices/Audio/DrvHostPulseAudio.cpp
+++ b/src/VBox/Devices/Audio/DrvHostPulseAudio.cpp
@@ -16,9 +16,9 @@
*/
-/*******************************************************************************
-* Header Files *
-*******************************************************************************/
+/*********************************************************************************************************************************
+* Header Files *
+*********************************************************************************************************************************/
#define LOG_GROUP LOG_GROUP_DRV_HOST_AUDIO
#include <VBox/log.h>
@@ -832,7 +832,7 @@ static DECLCALLBACK(int) drvHostPulseAudioPlayOut(PPDMIHOSTAUDIO pInterface, PPD
int rc = VINF_SUCCESS;
uint32_t cbReadTotal = 0;
- uint32_t cLive = drvAudioHstOutSamplesLive(pHstStrmOut, NULL /* pcStreamsLive */);
+ uint32_t cLive = drvAudioHstOutSamplesLive(pHstStrmOut);
if (!cLive)
{
LogFlowFunc(("%p: No live samples, skipping\n", pHstStrmOut));
diff --git a/src/VBox/Devices/Audio/testcase/tstAudioMixBuffer.cpp b/src/VBox/Devices/Audio/testcase/tstAudioMixBuffer.cpp
index e72f4da..5b6741b 100644
--- a/src/VBox/Devices/Audio/testcase/tstAudioMixBuffer.cpp
+++ b/src/VBox/Devices/Audio/testcase/tstAudioMixBuffer.cpp
@@ -16,9 +16,9 @@
*/
-/*******************************************************************************
-* Header Files *
-*******************************************************************************/
+/*********************************************************************************************************************************
+* Header Files *
+*********************************************************************************************************************************/
#include <iprt/err.h>
#include <iprt/initterm.h>
#include <iprt/mem.h>
@@ -32,9 +32,9 @@
#include "../DrvAudio.h"
-/*******************************************************************************
-* Structures and Typedefs *
-*******************************************************************************/
+/*********************************************************************************************************************************
+* Structures and Typedefs *
+*********************************************************************************************************************************/
static int tstSingle(RTTEST hTest)
{
diff --git a/src/VBox/Devices/BiosCommonCode/MakeAlternativeSource.cpp b/src/VBox/Devices/BiosCommonCode/MakeAlternativeSource.cpp
index c0b04eb..7f7c226 100644
--- a/src/VBox/Devices/BiosCommonCode/MakeAlternativeSource.cpp
+++ b/src/VBox/Devices/BiosCommonCode/MakeAlternativeSource.cpp
@@ -16,9 +16,9 @@
*/
-/*******************************************************************************
-* Header Files *
-*******************************************************************************/
+/*********************************************************************************************************************************
+* Header Files *
+*********************************************************************************************************************************/
#include <iprt/asm.h>
#include <iprt/buildconfig.h>
#include <iprt/ctype.h>
@@ -36,9 +36,9 @@
#include <VBox/dis.h>
-/*******************************************************************************
-* Structures and Typedefs *
-*******************************************************************************/
+/*********************************************************************************************************************************
+* Structures and Typedefs *
+*********************************************************************************************************************************/
/**
* A BIOS segment.
*/
@@ -92,9 +92,9 @@ typedef struct BIOSMAP
typedef BIOSMAP *PBIOSMAP;
-/*******************************************************************************
-* Global Variables *
-*******************************************************************************/
+/*********************************************************************************************************************************
+* Global Variables *
+*********************************************************************************************************************************/
/** The verbosity level.*/
static unsigned g_cVerbose = 1 /*0*/;
/** Pointer to the BIOS image. */
diff --git a/src/VBox/Devices/Bus/DevPCI.cpp b/src/VBox/Devices/Bus/DevPCI.cpp
index dd2861a..bd1c1ab 100644
--- a/src/VBox/Devices/Bus/DevPCI.cpp
+++ b/src/VBox/Devices/Bus/DevPCI.cpp
@@ -40,9 +40,10 @@
* THE SOFTWARE.
*/
-/*******************************************************************************
-* Header Files *
-*******************************************************************************/
+
+/*********************************************************************************************************************************
+* Header Files *
+*********************************************************************************************************************************/
#define LOG_GROUP LOG_GROUP_DEV_PCI
/* Hack to get PCIDEVICEINT declared at the right point - include "PCIInternal.h". */
#define PCI_INCLUDE_PRIVATE
@@ -55,9 +56,9 @@
#include "VBoxDD.h"
-/*******************************************************************************
-* Structures and Typedefs *
-*******************************************************************************/
+/*********************************************************************************************************************************
+* Structures and Typedefs *
+*********************************************************************************************************************************/
/**
* PIIX3 ISA Bridge state.
*/
@@ -172,9 +173,9 @@ typedef struct PCIGLOBALS
typedef PCIGLOBALS *PPCIGLOBALS;
-/*******************************************************************************
-* Defined Constants And Macros *
-*******************************************************************************/
+/*********************************************************************************************************************************
+* Defined Constants And Macros *
+*********************************************************************************************************************************/
/** Converts a bus instance pointer to a device instance pointer. */
#define PCIBUS_2_DEVINS(pPciBus) ((pPciBus)->CTX_SUFF(pDevIns))
@@ -208,9 +209,11 @@ typedef PCIGLOBALS *PPCIGLOBALS;
#ifndef VBOX_DEVICE_STRUCT_TESTCASE
-/*******************************************************************************
-* Internal Functions *
-*******************************************************************************/
+
+
+/*********************************************************************************************************************************
+* Internal Functions *
+*********************************************************************************************************************************/
RT_C_DECLS_BEGIN
PDMBOTHCBDECL(void) pciSetIrq(PPDMDEVINS pDevIns, PPCIDEVICE pPciDev, int iIrq, int iLevel, uint32_t uTag);
@@ -2341,7 +2344,7 @@ PDMBOTHCBDECL(void) pcibridgeSetIrq(PPDMDEVINS pDevIns, PPCIDEVICE pPciDev, int
/**
* @callback_method_impl{FNPCIBRIDGECONFIGWRITE}
*/
-static void pcibridgeR3ConfigWrite(PPDMDEVINSR3 pDevIns, uint8_t iBus, uint8_t iDevice, uint32_t u32Address, uint32_t u32Value, unsigned cb)
+static DECLCALLBACK(void) pcibridgeR3ConfigWrite(PPDMDEVINSR3 pDevIns, uint8_t iBus, uint8_t iDevice, uint32_t u32Address, uint32_t u32Value, unsigned cb)
{
PPCIBUS pBus = PDMINS_2_DATA(pDevIns, PPCIBUS);
@@ -2373,7 +2376,7 @@ static void pcibridgeR3ConfigWrite(PPDMDEVINSR3 pDevIns, uint8_t iBus, uint8_t i
/**
* @callback_method_impl{FNPCIBRIDGECONFIGREAD}
*/
-static uint32_t pcibridgeR3ConfigRead(PPDMDEVINSR3 pDevIns, uint8_t iBus, uint8_t iDevice, uint32_t u32Address, unsigned cb)
+static DECLCALLBACK(uint32_t) pcibridgeR3ConfigRead(PPDMDEVINSR3 pDevIns, uint8_t iBus, uint8_t iDevice, uint32_t u32Address, unsigned cb)
{
PPCIBUS pBus = PDMINS_2_DATA(pDevIns, PPCIBUS);
uint32_t u32Value = 0xffffffff; /* Return value in case there is no device. */
diff --git a/src/VBox/Devices/Bus/DevPciIch9.cpp b/src/VBox/Devices/Bus/DevPciIch9.cpp
index e390375..0d260b4 100644
--- a/src/VBox/Devices/Bus/DevPciIch9.cpp
+++ b/src/VBox/Devices/Bus/DevPciIch9.cpp
@@ -18,9 +18,10 @@
* hope that it will be useful, but WITHOUT ANY WARRANTY of any kind.
*/
-/*******************************************************************************
-* Header Files *
-*******************************************************************************/
+
+/*********************************************************************************************************************************
+* Header Files *
+*********************************************************************************************************************************/
#define LOG_GROUP LOG_GROUP_DEV_PCI
/* Hack to get PCIDEVICEINT declared at the right point - include "PCIInternal.h". */
#define PCI_INCLUDE_PRIVATE
@@ -39,9 +40,9 @@
#include "MsiCommon.h"
-/*******************************************************************************
-* Structures and Typedefs *
-*******************************************************************************/
+/*********************************************************************************************************************************
+* Structures and Typedefs *
+*********************************************************************************************************************************/
/**
* PCI Bus instance.
*/
@@ -135,9 +136,10 @@ typedef struct
#ifndef VBOX_DEVICE_STRUCT_TESTCASE
-/*******************************************************************************
-* Defined Constants And Macros *
-*******************************************************************************/
+
+/*********************************************************************************************************************************
+* Defined Constants And Macros *
+*********************************************************************************************************************************/
/** @def VBOX_ICH9PCI_SAVED_STATE_VERSION
* Saved state version of the ICH9 PCI bus device.
@@ -1148,7 +1150,7 @@ static DECLCALLBACK(int) ich9pcibridgeR3SaveExec(PPDMDEVINS pDevIns, PSSMHANDLE
}
-static void ich9pcibridgeConfigWrite(PPDMDEVINSR3 pDevIns, uint8_t iBus, uint8_t iDevice, uint32_t u32Address, uint32_t u32Value, unsigned cb)
+static DECLCALLBACK(void) ich9pcibridgeConfigWrite(PPDMDEVINSR3 pDevIns, uint8_t iBus, uint8_t iDevice, uint32_t u32Address, uint32_t u32Value, unsigned cb)
{
PICH9PCIBUS pBus = PDMINS_2_DATA(pDevIns, PICH9PCIBUS);
@@ -1176,7 +1178,7 @@ static void ich9pcibridgeConfigWrite(PPDMDEVINSR3 pDevIns, uint8_t iBus, uint8_t
}
}
-static uint32_t ich9pcibridgeConfigRead(PPDMDEVINSR3 pDevIns, uint8_t iBus, uint8_t iDevice, uint32_t u32Address, unsigned cb)
+static DECLCALLBACK(uint32_t) ich9pcibridgeConfigRead(PPDMDEVINSR3 pDevIns, uint8_t iBus, uint8_t iDevice, uint32_t u32Address, unsigned cb)
{
PICH9PCIBUS pBus = PDMINS_2_DATA(pDevIns, PICH9PCIBUS);
uint32_t u32Value;
diff --git a/src/VBox/Devices/Bus/SrvPciRawR0.cpp b/src/VBox/Devices/Bus/SrvPciRawR0.cpp
index e1baf01..bc1577a 100644
--- a/src/VBox/Devices/Bus/SrvPciRawR0.cpp
+++ b/src/VBox/Devices/Bus/SrvPciRawR0.cpp
@@ -16,9 +16,9 @@
*/
-/*******************************************************************************
-* Header Files *
-*******************************************************************************/
+/*********************************************************************************************************************************
+* Header Files *
+*********************************************************************************************************************************/
#define LOG_GROUP LOG_GROUP_DEV_PCI_RAW
#include <VBox/log.h>
#include <VBox/sup.h>
@@ -42,9 +42,9 @@
#include <iprt/asm-amd64-x86.h>
-/*******************************************************************************
-* Structures and Typedefs *
-*******************************************************************************/
+/*********************************************************************************************************************************
+* Structures and Typedefs *
+*********************************************************************************************************************************/
typedef struct PCIRAWSRVSTATE
{
/** Structure lock. */
diff --git a/src/VBox/Devices/EFI/DevEFI.cpp b/src/VBox/Devices/EFI/DevEFI.cpp
index 8e168c6..3c0a1e5 100644
--- a/src/VBox/Devices/EFI/DevEFI.cpp
+++ b/src/VBox/Devices/EFI/DevEFI.cpp
@@ -15,9 +15,10 @@
* hope that it will be useful, but WITHOUT ANY WARRANTY of any kind.
*/
-/*******************************************************************************
-* Header Files *
-*******************************************************************************/
+
+/*********************************************************************************************************************************
+* Header Files *
+*********************************************************************************************************************************/
#define LOG_GROUP LOG_GROUP_DEV_EFI
#include <VBox/vmm/pdmdev.h>
@@ -58,9 +59,9 @@
#include <Common/PiFirmwareFile.h>
-/*******************************************************************************
-* Structures and Typedefs *
-*******************************************************************************/
+/*********************************************************************************************************************************
+* Structures and Typedefs *
+*********************************************************************************************************************************/
/**
* EFI NVRAM variable.
*/
@@ -245,9 +246,9 @@ typedef struct DEVEFI
typedef DEVEFI *PDEVEFI;
-/*******************************************************************************
-* Defined Constants And Macros *
-*******************************************************************************/
+/*********************************************************************************************************************************
+* Defined Constants And Macros *
+*********************************************************************************************************************************/
/** The saved state version. */
#define EFI_SSM_VERSION 2
/** The saved state version from VBox 4.2. */
@@ -259,9 +260,9 @@ typedef DEVEFI *PDEVEFI;
#define VBOX_EFI_VARIABLE_READ_ONLY UINT32_C(0x00000008)
-/*******************************************************************************
-* Global Variables *
-*******************************************************************************/
+/*********************************************************************************************************************************
+* Global Variables *
+*********************************************************************************************************************************/
/** Saved state NVRAMDESC field descriptors. */
static SSMFIELD const g_aEfiNvramDescField[] =
{
diff --git a/src/VBox/Devices/EFI/DevSmc.cpp b/src/VBox/Devices/EFI/DevSmc.cpp
index 74b2eaa..0783d41 100644
--- a/src/VBox/Devices/EFI/DevSmc.cpp
+++ b/src/VBox/Devices/EFI/DevSmc.cpp
@@ -22,9 +22,9 @@
*/
-/*******************************************************************************
-* Header Files *
-*******************************************************************************/
+/*********************************************************************************************************************************
+* Header Files *
+*********************************************************************************************************************************/
#define LOG_GROUP LOG_GROUP_DEV_SMC
#include <VBox/vmm/pdmdev.h>
#include <VBox/log.h>
@@ -42,9 +42,9 @@
#include "VBoxDD.h"
-/*******************************************************************************
-* Defined Constants And Macros *
-*******************************************************************************/
+/*********************************************************************************************************************************
+* Defined Constants And Macros *
+*********************************************************************************************************************************/
/** The current version of the saved state. */
#define SMC_SAVED_STATE_VERSION 1 /** @todo later 2 */
/** Empty saved state version. */
@@ -136,9 +136,9 @@
#define VBOX_WITH_SMC_2_x
-/*******************************************************************************
-* Structures and Typedefs *
-*******************************************************************************/
+/*********************************************************************************************************************************
+* Structures and Typedefs *
+*********************************************************************************************************************************/
/**
* 4 char identifier
@@ -298,9 +298,9 @@ typedef struct DEVSMCKEYDESC
typedef DEVSMCKEYDESC const *PCDEVSMCKEYDESC;
-/*******************************************************************************
-* Internal Functions *
-*******************************************************************************/
+/*********************************************************************************************************************************
+* Internal Functions *
+*********************************************************************************************************************************/
#ifdef IN_RING3
static DEVSMCKEYGETTER scmKeyGetOSKs;
static DEVSMCKEYGETTER scmKeyGetKeyCount;
@@ -319,9 +319,9 @@ static DEVSMCKEYGETTER scmKeyGetZero;
#endif
-/*******************************************************************************
-* Global Variables *
-*******************************************************************************/
+/*********************************************************************************************************************************
+* Global Variables *
+*********************************************************************************************************************************/
#ifdef IN_RING3
/**
* Apple SMC key descriptor table.
diff --git a/src/VBox/Devices/EFI/Firmware/BaseTools/Source/Python/BPDG/StringTable.py b/src/VBox/Devices/EFI/Firmware/BaseTools/Source/Python/BPDG/StringTable.py
old mode 100755
new mode 100644
diff --git a/src/VBox/Devices/EFI/Firmware/BaseTools/Source/Python/Common/FdfParserLite.py b/src/VBox/Devices/EFI/Firmware/BaseTools/Source/Python/Common/FdfParserLite.py
old mode 100644
new mode 100755
diff --git a/src/VBox/Devices/EFI/Firmware/BaseTools/Source/Python/Common/Identification.py b/src/VBox/Devices/EFI/Firmware/BaseTools/Source/Python/Common/Identification.py
old mode 100644
new mode 100755
diff --git a/src/VBox/Devices/EFI/Firmware/BaseTools/Source/Python/Common/VpdInfoFile.py b/src/VBox/Devices/EFI/Firmware/BaseTools/Source/Python/Common/VpdInfoFile.py
old mode 100644
new mode 100755
diff --git a/src/VBox/Devices/EFI/Firmware/BaseTools/Source/Python/CommonDataClass/CommonClass.py b/src/VBox/Devices/EFI/Firmware/BaseTools/Source/Python/CommonDataClass/CommonClass.py
old mode 100644
new mode 100755
diff --git a/src/VBox/Devices/EFI/Firmware/BaseTools/Source/Python/CommonDataClass/FdfClass.py b/src/VBox/Devices/EFI/Firmware/BaseTools/Source/Python/CommonDataClass/FdfClass.py
old mode 100644
new mode 100755
diff --git a/src/VBox/Devices/EFI/Firmware/BaseTools/Source/Python/Ecc/CodeFragment.py b/src/VBox/Devices/EFI/Firmware/BaseTools/Source/Python/Ecc/CodeFragment.py
old mode 100644
new mode 100755
diff --git a/src/VBox/Devices/EFI/Firmware/BaseTools/Source/Python/Ecc/ParserWarning.py b/src/VBox/Devices/EFI/Firmware/BaseTools/Source/Python/Ecc/ParserWarning.py
old mode 100644
new mode 100755
diff --git a/src/VBox/Devices/EFI/Firmware/BaseTools/Source/Python/Ecc/Xml/XmlRoutines.py b/src/VBox/Devices/EFI/Firmware/BaseTools/Source/Python/Ecc/Xml/XmlRoutines.py
old mode 100644
new mode 100755
diff --git a/src/VBox/Devices/EFI/Firmware/BaseTools/Source/Python/Ecc/Xml/__init__.py b/src/VBox/Devices/EFI/Firmware/BaseTools/Source/Python/Ecc/Xml/__init__.py
old mode 100755
new mode 100644
diff --git a/src/VBox/Devices/EFI/Firmware/BaseTools/Source/Python/Eot/CodeFragment.py b/src/VBox/Devices/EFI/Firmware/BaseTools/Source/Python/Eot/CodeFragment.py
old mode 100644
new mode 100755
diff --git a/src/VBox/Devices/EFI/Firmware/BaseTools/Source/Python/Eot/ParserWarning.py b/src/VBox/Devices/EFI/Firmware/BaseTools/Source/Python/Eot/ParserWarning.py
old mode 100644
new mode 100755
diff --git a/src/VBox/Devices/EFI/Firmware/BaseTools/Source/Python/Eot/Report.py b/src/VBox/Devices/EFI/Firmware/BaseTools/Source/Python/Eot/Report.py
old mode 100644
new mode 100755
diff --git a/src/VBox/Devices/EFI/Firmware/BaseTools/Source/Python/GenFds/Attribute.py b/src/VBox/Devices/EFI/Firmware/BaseTools/Source/Python/GenFds/Attribute.py
old mode 100644
new mode 100755
diff --git a/src/VBox/Devices/EFI/Firmware/BaseTools/Source/Python/Table/Table.py b/src/VBox/Devices/EFI/Firmware/BaseTools/Source/Python/Table/Table.py
old mode 100644
new mode 100755
diff --git a/src/VBox/Devices/EFI/Firmware/BaseTools/Source/Python/UPT/BuildVersion.py b/src/VBox/Devices/EFI/Firmware/BaseTools/Source/Python/UPT/BuildVersion.py
old mode 100755
new mode 100644
diff --git a/src/VBox/Devices/EFI/Firmware/BaseTools/Source/Python/UPT/Core/__init__.py b/src/VBox/Devices/EFI/Firmware/BaseTools/Source/Python/UPT/Core/__init__.py
old mode 100755
new mode 100644
diff --git a/src/VBox/Devices/EFI/Firmware/BaseTools/Source/Python/UPT/GenMetaFile/GenXmlFile.py b/src/VBox/Devices/EFI/Firmware/BaseTools/Source/Python/UPT/GenMetaFile/GenXmlFile.py
old mode 100755
new mode 100644
diff --git a/src/VBox/Devices/EFI/Firmware/BaseTools/Source/Python/UPT/GenMetaFile/__init__.py b/src/VBox/Devices/EFI/Firmware/BaseTools/Source/Python/UPT/GenMetaFile/__init__.py
old mode 100755
new mode 100644
diff --git a/src/VBox/Devices/EFI/Firmware/BaseTools/Source/Python/UPT/Library/DataType.py b/src/VBox/Devices/EFI/Firmware/BaseTools/Source/Python/UPT/Library/DataType.py
old mode 100755
new mode 100644
diff --git a/src/VBox/Devices/EFI/Firmware/BaseTools/Source/Python/UPT/Library/GlobalData.py b/src/VBox/Devices/EFI/Firmware/BaseTools/Source/Python/UPT/Library/GlobalData.py
old mode 100755
new mode 100644
diff --git a/src/VBox/Devices/EFI/Firmware/BaseTools/Source/Python/UPT/Library/Xml/__init__.py b/src/VBox/Devices/EFI/Firmware/BaseTools/Source/Python/UPT/Library/Xml/__init__.py
old mode 100755
new mode 100644
diff --git a/src/VBox/Devices/EFI/Firmware/BaseTools/Source/Python/UPT/Library/__init__.py b/src/VBox/Devices/EFI/Firmware/BaseTools/Source/Python/UPT/Library/__init__.py
old mode 100755
new mode 100644
diff --git a/src/VBox/Devices/EFI/Firmware/BaseTools/Source/Python/UPT/Logger/StringTable.py b/src/VBox/Devices/EFI/Firmware/BaseTools/Source/Python/UPT/Logger/StringTable.py
old mode 100755
new mode 100644
diff --git a/src/VBox/Devices/EFI/Firmware/BaseTools/Source/Python/UPT/Logger/__init__.py b/src/VBox/Devices/EFI/Firmware/BaseTools/Source/Python/UPT/Logger/__init__.py
old mode 100755
new mode 100644
diff --git a/src/VBox/Devices/EFI/Firmware/BaseTools/Source/Python/UPT/Object/POM/__init__.py b/src/VBox/Devices/EFI/Firmware/BaseTools/Source/Python/UPT/Object/POM/__init__.py
old mode 100755
new mode 100644
diff --git a/src/VBox/Devices/EFI/Firmware/BaseTools/Source/Python/UPT/Object/Parser/InfCommonObject.py b/src/VBox/Devices/EFI/Firmware/BaseTools/Source/Python/UPT/Object/Parser/InfCommonObject.py
old mode 100644
new mode 100755
diff --git a/src/VBox/Devices/EFI/Firmware/BaseTools/Source/Python/UPT/Object/Parser/InfHeaderObject.py b/src/VBox/Devices/EFI/Firmware/BaseTools/Source/Python/UPT/Object/Parser/InfHeaderObject.py
old mode 100644
new mode 100755
diff --git a/src/VBox/Devices/EFI/Firmware/BaseTools/Source/Python/UPT/Object/Parser/__init__.py b/src/VBox/Devices/EFI/Firmware/BaseTools/Source/Python/UPT/Object/Parser/__init__.py
old mode 100755
new mode 100644
diff --git a/src/VBox/Devices/EFI/Firmware/BaseTools/Source/Python/UPT/Object/__init__.py b/src/VBox/Devices/EFI/Firmware/BaseTools/Source/Python/UPT/Object/__init__.py
old mode 100755
new mode 100644
diff --git a/src/VBox/Devices/EFI/Firmware/BaseTools/Source/Python/UPT/Parser/__init__.py b/src/VBox/Devices/EFI/Firmware/BaseTools/Source/Python/UPT/Parser/__init__.py
old mode 100755
new mode 100644
diff --git a/src/VBox/Devices/EFI/Firmware/BaseTools/Source/Python/UPT/PomAdapter/__init__.py b/src/VBox/Devices/EFI/Firmware/BaseTools/Source/Python/UPT/PomAdapter/__init__.py
old mode 100755
new mode 100644
diff --git a/src/VBox/Devices/EFI/Firmware/BaseTools/Source/Python/UPT/Xml/__init__.py b/src/VBox/Devices/EFI/Firmware/BaseTools/Source/Python/UPT/Xml/__init__.py
old mode 100755
new mode 100644
diff --git a/src/VBox/Devices/EFI/Firmware/UefiCpuPkg/ResetVector/Vtf0/Build.py b/src/VBox/Devices/EFI/Firmware/UefiCpuPkg/ResetVector/Vtf0/Build.py
old mode 100644
new mode 100755
diff --git a/src/VBox/Devices/EFI/Firmware/UefiCpuPkg/ResetVector/Vtf0/Tools/FixupForRawSection.py b/src/VBox/Devices/EFI/Firmware/UefiCpuPkg/ResetVector/Vtf0/Tools/FixupForRawSection.py
old mode 100644
new mode 100755
diff --git a/src/VBox/Devices/EFI/FirmwareBin/VBoxEFI32.fd b/src/VBox/Devices/EFI/FirmwareBin/VBoxEFI32.fd
index b962910..6ec17f2 100644
Binary files a/src/VBox/Devices/EFI/FirmwareBin/VBoxEFI32.fd and b/src/VBox/Devices/EFI/FirmwareBin/VBoxEFI32.fd differ
diff --git a/src/VBox/Devices/EFI/FirmwareBin/VBoxEFI64.fd b/src/VBox/Devices/EFI/FirmwareBin/VBoxEFI64.fd
index 987a305..c935953 100644
Binary files a/src/VBox/Devices/EFI/FirmwareBin/VBoxEFI64.fd and b/src/VBox/Devices/EFI/FirmwareBin/VBoxEFI64.fd differ
diff --git a/src/VBox/Devices/EFI/VBoxSmcUtil-darwin.cpp b/src/VBox/Devices/EFI/VBoxSmcUtil-darwin.cpp
index e27a243..64d3f03 100644
--- a/src/VBox/Devices/EFI/VBoxSmcUtil-darwin.cpp
+++ b/src/VBox/Devices/EFI/VBoxSmcUtil-darwin.cpp
@@ -16,9 +16,9 @@
*/
-/*******************************************************************************
-* Header Files *
-*******************************************************************************/
+/*********************************************************************************************************************************
+* Header Files *
+*********************************************************************************************************************************/
#include <iprt/asm.h>
#include <iprt/err.h>
#include <iprt/ctype.h>
@@ -34,9 +34,9 @@
#include <unistd.h>
-/*******************************************************************************
-* Structures and Typedefs *
-*******************************************************************************/
+/*********************************************************************************************************************************
+* Structures and Typedefs *
+*********************************************************************************************************************************/
enum
{
kSMCSuccess = 0,
@@ -104,9 +104,9 @@ typedef struct
} SMCPARAM;
-/*******************************************************************************
-* Global Variables *
-*******************************************************************************/
+/*********************************************************************************************************************************
+* Global Variables *
+*********************************************************************************************************************************/
io_service_t g_hSmcService = IO_OBJECT_NULL;
io_connect_t g_hSmcConnect = IO_OBJECT_NULL;
diff --git a/src/VBox/Devices/GIMDev/GIMDev.cpp b/src/VBox/Devices/GIMDev/GIMDev.cpp
index 9fa612a..a6be4fb 100644
--- a/src/VBox/Devices/GIMDev/GIMDev.cpp
+++ b/src/VBox/Devices/GIMDev/GIMDev.cpp
@@ -16,9 +16,9 @@
*/
-/*******************************************************************************
-* Header Files *
-*******************************************************************************/
+/*********************************************************************************************************************************
+* Header Files *
+*********************************************************************************************************************************/
#define LOG_GROUP LOG_GROUP_DEV_GIM
#include <VBox/vmm/pdmdev.h>
#include <VBox/vmm/gim.h>
diff --git a/src/VBox/Devices/Graphics/BIOS/VBoxVgaBiosAlternative.asm b/src/VBox/Devices/Graphics/BIOS/VBoxVgaBiosAlternative.asm
index d46db2d..e0c22c1 100644
--- a/src/VBox/Devices/Graphics/BIOS/VBoxVgaBiosAlternative.asm
+++ b/src/VBox/Devices/Graphics/BIOS/VBoxVgaBiosAlternative.asm
@@ -6769,7 +6769,7 @@ vesa_pm_end: ; 0xc4514 LB 0x1
section _DATA progbits vstart=0x4600 align=1 ; size=0x371e class=DATA group=DGROUP
_msg_vga_init: ; 0xc4600 LB 0x2e
- db 'Oracle VM VirtualBox Version 5.0.2 VGA BIOS', 00dh, 00ah, 000h
+ db 'Oracle VM VirtualBox Version 5.0.4 VGA BIOS', 00dh, 00ah, 000h
_vga_modes: ; 0xc462e LB 0x80
db 000h, 000h, 000h, 004h, 000h, 0b8h, 0ffh, 002h, 001h, 000h, 000h, 004h, 000h, 0b8h, 0ffh, 002h
db 002h, 000h, 000h, 004h, 000h, 0b8h, 0ffh, 002h, 003h, 000h, 000h, 004h, 000h, 0b8h, 0ffh, 002h
@@ -7664,7 +7664,7 @@ _vbebios_vendor_name: ; 0xc7c73 LB 0x13
_vbebios_product_name: ; 0xc7c86 LB 0x21
db 'Oracle VM VirtualBox VBE Adapter', 000h
_vbebios_product_revision: ; 0xc7ca7 LB 0x23
- db 'Oracle VM VirtualBox Version 5.0.2', 000h
+ db 'Oracle VM VirtualBox Version 5.0.4', 000h
_vbebios_info_string: ; 0xc7cca LB 0x2b
db 'VirtualBox VBE Display Adapter enabled', 00dh, 00ah, 00dh, 00ah, 000h
_no_vbebios_info_string: ; 0xc7cf5 LB 0x29
@@ -7676,11 +7676,11 @@ section CONST2 progbits vstart=0x7d1e align=1 ; size=0x0 class=DATA group=DGROUP
; Padding 0x2e2 bytes at 0xc7d1e
db 001h, 000h, 000h, 000h, 000h, 001h, 000h, 000h, 000h, 000h, 000h, 000h, 02fh, 068h, 06fh, 06dh
- db 065h, 02fh, 066h, 06dh, 033h, 02fh, 073h, 072h, 063h, 02fh, 076h, 062h, 06fh, 078h, 02fh, 06fh
- db 075h, 074h, 02fh, 06ch, 069h, 06eh, 075h, 078h, 02eh, 061h, 06dh, 064h, 036h, 034h, 02fh, 072h
- db 065h, 06ch, 065h, 061h, 073h, 065h, 02fh, 06fh, 062h, 06ah, 02fh, 056h, 042h, 06fh, 078h, 056h
- db 067h, 061h, 042h, 069h, 06fh, 073h, 02fh, 056h, 042h, 06fh, 078h, 056h, 067h, 061h, 042h, 069h
- db 06fh, 073h, 02eh, 073h, 079h, 06dh, 000h, 000h, 000h, 000h, 000h, 000h, 000h, 000h, 000h, 000h
+ db 065h, 02fh, 066h, 06dh, 033h, 02fh, 073h, 072h, 063h, 02fh, 076h, 062h, 06fh, 078h, 02dh, 035h
+ db 02eh, 030h, 02fh, 06fh, 075h, 074h, 02fh, 06ch, 069h, 06eh, 075h, 078h, 02eh, 061h, 06dh, 064h
+ db 036h, 034h, 02fh, 072h, 065h, 06ch, 065h, 061h, 073h, 065h, 02fh, 06fh, 062h, 06ah, 02fh, 056h
+ db 042h, 06fh, 078h, 056h, 067h, 061h, 042h, 069h, 06fh, 073h, 02fh, 056h, 042h, 06fh, 078h, 056h
+ db 067h, 061h, 042h, 069h, 06fh, 073h, 02eh, 073h, 079h, 06dh, 000h, 000h, 000h, 000h, 000h, 000h
db 000h, 000h, 000h, 000h, 000h, 000h, 000h, 000h, 000h, 000h, 000h, 000h, 000h, 000h, 000h, 000h
db 000h, 000h, 000h, 000h, 000h, 000h, 000h, 000h, 000h, 000h, 000h, 000h, 000h, 000h, 000h, 000h
db 000h, 000h, 000h, 000h, 000h, 000h, 000h, 000h, 000h, 000h, 000h, 000h, 000h, 000h, 000h, 000h
@@ -7721,4 +7721,4 @@ section CONST2 progbits vstart=0x7d1e align=1 ; size=0x0 class=DATA group=DGROUP
db 000h, 000h, 000h, 000h, 000h, 000h, 000h, 000h, 000h, 000h, 000h, 000h, 000h, 000h, 000h, 000h
db 000h, 000h, 000h, 000h, 000h, 000h, 000h, 000h, 000h, 000h, 000h, 000h, 000h, 000h, 000h, 000h
db 000h, 000h, 000h, 000h, 000h, 000h, 000h, 000h, 000h, 000h, 000h, 000h, 000h, 000h, 000h, 000h
- db 000h, 07eh
+ db 000h, 0bah
diff --git a/src/VBox/Devices/Graphics/BIOS/VBoxVgaBiosAlternative.md5sum b/src/VBox/Devices/Graphics/BIOS/VBoxVgaBiosAlternative.md5sum
index 409ced6..b4d1ee8 100644
--- a/src/VBox/Devices/Graphics/BIOS/VBoxVgaBiosAlternative.md5sum
+++ b/src/VBox/Devices/Graphics/BIOS/VBoxVgaBiosAlternative.md5sum
@@ -1 +1 @@
-ffe36013d7712bc04f0b05c928dd0d04 *VBoxVgaBios.rom
+76735991ac7e8ee1bddcc93f264fc028 *VBoxVgaBios.rom
diff --git a/src/VBox/Devices/Graphics/DevVGA-SVGA.cpp b/src/VBox/Devices/Graphics/DevVGA-SVGA.cpp
index ce4ca83..d666808 100644
--- a/src/VBox/Devices/Graphics/DevVGA-SVGA.cpp
+++ b/src/VBox/Devices/Graphics/DevVGA-SVGA.cpp
@@ -23,9 +23,9 @@
*/
-/*******************************************************************************
-* Header Files *
-*******************************************************************************/
+/*********************************************************************************************************************************
+* Header Files *
+*********************************************************************************************************************************/
#define LOG_GROUP LOG_GROUP_DEV_VMSVGA
#define VMSVGA_USE_EMT_HALT_CODE
#include <VBox/vmm/pdmdev.h>
@@ -75,9 +75,9 @@
#endif
-/*******************************************************************************
-* Defined Constants And Macros *
-*******************************************************************************/
+/*********************************************************************************************************************************
+* Defined Constants And Macros *
+*********************************************************************************************************************************/
/**
* Macro for checking if a fixed FIFO register is valid according to the
* current FIFO configuration.
@@ -89,9 +89,9 @@
#define VMSVGA_IS_VALID_FIFO_REG(a_iIndex, a_offFifoMin) ( ((a_iIndex) + 1) * sizeof(uint32_t) <= (a_offFifoMin) )
-/*******************************************************************************
-* Structures and Typedefs *
-*******************************************************************************/
+/*********************************************************************************************************************************
+* Structures and Typedefs *
+*********************************************************************************************************************************/
/**
* 64-bit GMR descriptor.
*/
@@ -167,9 +167,9 @@ typedef struct VMSVGAR3STATE
#endif /* IN_RING3 */
-/*******************************************************************************
-* Internal Functions *
-*******************************************************************************/
+/*********************************************************************************************************************************
+* Internal Functions *
+*********************************************************************************************************************************/
#ifdef IN_RING3
# ifdef DEBUG_FIFO_ACCESS
static FNPGMPHYSHANDLER vmsvgaR3FIFOAccessHandler;
@@ -180,9 +180,9 @@ static FNPGMPHYSHANDLER vmsvgaR3GMRAccessHandler;
#endif
-/*******************************************************************************
-* Global Variables *
-*******************************************************************************/
+/*********************************************************************************************************************************
+* Global Variables *
+*********************************************************************************************************************************/
#ifdef IN_RING3
/**
@@ -543,11 +543,32 @@ DECLCALLBACK(void) vmsvgaPortSetViewport(PPDMIDISPLAYPORT pInterface, uint32_t u
Log(("vmsvgaPortSetViewPort: screen %d (%d,%d)(%d,%d)\n", uScreenId, x, y, cx, cy));
- pThis->svga.viewport.x = x;
- pThis->svga.viewport.y = y;
- pThis->svga.viewport.cx = RT_MIN(cx, (uint32_t)pThis->svga.uWidth);
- pThis->svga.viewport.cy = RT_MIN(cy, (uint32_t)pThis->svga.uHeight);
- return;
+ if (x < pThis->svga.uWidth)
+ {
+ pThis->svga.viewport.x = x;
+ pThis->svga.viewport.cx = RT_MIN(cx, pThis->svga.uWidth - x);
+ pThis->svga.viewport.xRight = x + pThis->svga.viewport.cx;
+ }
+ else
+ {
+ pThis->svga.viewport.x = pThis->svga.uWidth;
+ pThis->svga.viewport.cx = 0;
+ pThis->svga.viewport.xRight = pThis->svga.uWidth;
+ }
+ if (y < pThis->svga.uHeight)
+ {
+ pThis->svga.viewport.y = y;
+ pThis->svga.viewport.cy = RT_MIN(cy, pThis->svga.uHeight - y);
+ pThis->svga.viewport.yLowWC = pThis->svga.uHeight - y - pThis->svga.viewport.cy;
+ pThis->svga.viewport.yHighWC = pThis->svga.uHeight - y;
+ }
+ else
+ {
+ pThis->svga.viewport.y = pThis->svga.uHeight;
+ pThis->svga.viewport.cy = 0;
+ pThis->svga.viewport.yLowWC = 0;
+ pThis->svga.viewport.yHighWC = 0;
+ }
}
/**
@@ -1027,8 +1048,11 @@ int vmsvgaChangeMode(PVGASTATE pThis)
if ( pThis->svga.viewport.cx == 0
&& pThis->svga.viewport.cy == 0)
{
- pThis->svga.viewport.cx = pThis->svga.uWidth;
- pThis->svga.viewport.cy = pThis->svga.uHeight;
+ pThis->svga.viewport.cx = pThis->svga.uWidth;
+ pThis->svga.viewport.xRight = pThis->svga.uWidth;
+ pThis->svga.viewport.cy = pThis->svga.uHeight;
+ pThis->svga.viewport.yHighWC = pThis->svga.uHeight;
+ pThis->svga.viewport.yLowWC = 0;
}
return VINF_SUCCESS;
}
diff --git a/src/VBox/Devices/Graphics/DevVGA-SVGA.h b/src/VBox/Devices/Graphics/DevVGA-SVGA.h
index bde41a2..6b85b96 100644
--- a/src/VBox/Devices/Graphics/DevVGA-SVGA.h
+++ b/src/VBox/Devices/Graphics/DevVGA-SVGA.h
@@ -29,6 +29,13 @@
#define VMSVGA_VAL_UNINITIALIZED (unsigned)-1
+/** For validating X and width values.
+ * The code assumes it's at least an order of magnitude less than UINT32_MAX. */
+#define VMSVGA_MAX_X _1M
+/** For validating Y and height values.
+ * The code assumes it's at least an order of magnitude less than UINT32_MAX. */
+#define VMSVGA_MAX_Y _1M
+
/* u32ActionFlags */
#define VMSVGA_ACTION_CHANGEMODE_BIT 0
#define VMSVGA_ACTION_CHANGEMODE RT_BIT(VMSVGA_ACTION_CHANGEMODE_BIT)
diff --git a/src/VBox/Devices/Graphics/DevVGA-SVGA3d-cocoa.m b/src/VBox/Devices/Graphics/DevVGA-SVGA3d-cocoa.m
index 9b68a35..627fe57 100644
--- a/src/VBox/Devices/Graphics/DevVGA-SVGA3d-cocoa.m
+++ b/src/VBox/Devices/Graphics/DevVGA-SVGA3d-cocoa.m
@@ -17,9 +17,10 @@
* hope that it will be useful, but WITHOUT ANY WARRANTY of any kind.
*/
-/*******************************************************************************
-* Header Files *
-*******************************************************************************/
+
+/*********************************************************************************************************************************
+* Header Files *
+*********************************************************************************************************************************/
#define LOG_GROUP LOG_GROUP_DEV_VMSVGA
#include "DevVGA-SVGA3d-cocoa.h"
#import <Cocoa/Cocoa.h>
@@ -33,9 +34,9 @@
#include <VBox/vmm/dbgf.h>
-/*******************************************************************************
-* Defined Constants And Macros *
-*******************************************************************************/
+/*********************************************************************************************************************************
+* Defined Constants And Macros *
+*********************************************************************************************************************************/
/** @def USE_NSOPENGLVIEW
* Define this to experiment with using NSOpenGLView instead
* of NSView. There are transparency issues with the former,
@@ -54,9 +55,9 @@
-/*******************************************************************************
-* Structures and Typedefs *
-*******************************************************************************/
+/*********************************************************************************************************************************
+* Structures and Typedefs *
+*********************************************************************************************************************************/
/**
* Argument package for doing this on the main thread.
*/
@@ -89,13 +90,13 @@
{
@private
/** This points to the parent view, if there is one. If there isn't a parent
- * the view will be hidden and never used for displaying stuff. We only have
- * one visible context per guest screen that is visible to the user and
- * subject to buffer swapping. */
+ * the view will be hidden and never used for displaying stuff. We only have
+ * one visible context per guest screen that is visible to the user and
+ * subject to buffer swapping. */
NSView *m_pParentView;
/** Indicates that buffers (back+front) needs clearing before use because
- * the view changed size. There are two buffers, so this is set to two
- * each time when the view area increases. */
+ * the view changed size. There are two buffers, so this is set to two
+ * each time when the view area increases. */
uint32_t m_cClears;
/** Set if the OpenGL context needs updating after a resize. */
bool m_fUpdateCtx;
@@ -255,8 +256,8 @@
*/
if (pParams->pParentView)
{
- [[NSNotificationCenter defaultCenter] addObserver:self
- selector:@selector(vboxFrameDidChange)
+ [[NSNotificationCenter defaultCenter] addObserver:self
+ selector:@selector(vboxFrameDidChange)
name:NSViewFrameDidChangeNotification
object:self];
}
@@ -406,20 +407,20 @@
if ( m_Pos.x != CurFrameRect.origin.x
|| m_Pos.y != CurFrameRect.origin.y)
{
- LogFlow(("OvlView(%p) vboxReshapePerform: moving (%d,%d) -> (%d,%d)\n",
+ LogFlow(("OvlView(%p) vboxReshapePerform: moving (%d,%d) -> (%d,%d)\n",
(void *)self, CurFrameRect.origin.x, CurFrameRect.origin.y, m_Pos.x, m_Pos.y));
[self setFrameOrigin:m_Pos];
}
if ( CurFrameRect.size.width != m_Size.width
|| CurFrameRect.size.height != m_Size.height)
- {
- LogFlow(("OvlView(%p) vboxReshapePerform: resizing (%d,%d) -> (%d,%d)\n",
+ {
+ LogFlow(("OvlView(%p) vboxReshapePerform: resizing (%d,%d) -> (%d,%d)\n",
(void *)self, CurFrameRect.size.width, CurFrameRect.size.height, m_Size.width, m_Size.height));
[self setFrameSize:m_Size];
- /*
- * Schedule two clears and a context update for now.
+ /*
+ * Schedule two clears and a context update for now.
* Really though, we should just clear any new surface area.
*/
m_cClears = 2;
@@ -466,9 +467,9 @@
#endif
/**
- * Removes the view from the parent, if it has one, and makes sure it's hidden.
- *
- * This is callbed before destroying it.
+ * Removes the view from the parent, if it has one, and makes sure it's hidden.
+ *
+ * This is callbed before destroying it.
*/
- (void)vboxRemoveFromSuperviewAndHide
{
@@ -476,7 +477,7 @@
if (m_pParentView)
{
/*
- * The removeFromSuperview has been frequently seen to deadlock thing like this:
+ * The removeFromSuperview has been frequently seen to deadlock thing like this:
* #0 0x00007fff8db440fa in __psynch_cvwait ()
* #1 0x00007fff8d0acfb9 in _pthread_cond_wait ()
* #2 0x00007fff8a1bc8f0 in -[NSViewHierarchyLock _lockForWriting:handler:] ()
@@ -577,8 +578,8 @@
if (m_pCtx && [m_pCtx view] != self)
{
m_cSetViewAttempts++;
- if ( m_pParentView
- || m_cSetViewAttempts < 64
+ if ( m_pParentView
+ || m_cSetViewAttempts < 64
|| (m_cSetViewAttempts & (m_cSetViewAttempts < _64K ? 0xfff : 0x7fff)) == 0 )
[m_pCtx setView:self];
}
@@ -649,8 +650,8 @@ VMSVGA3DCOCOA_DECL(void) vmsvga3dCocoaServiceRunLoop(void)
/**
* Document me later.
- *
- * @param pParentView The parent view if this is a context we'll be
+ *
+ * @param pParentView The parent view if this is a context we'll be
* presenting to.
*/
VMSVGA3DCOCOA_DECL(bool) vmsvga3dCocoaCreateViewAndContext(NativeNSViewRef *ppView, NativeNSOpenGLContextRef *ppCtx,
@@ -717,27 +718,27 @@ VMSVGA3DCOCOA_DECL(void) vmsvga3dCocoaViewInfo(PCDBGFINFOHLP pHlp, NativeNSViewR
if (pView != nil)
{
VMSVGA3DOverlayView *pOvlView = (VMSVGA3DOverlayView *)pView;
-
+
NSRect FrameRect = [pOvlView frame];
- pHlp->pfnPrintf(pHlp, " Frame rect: x=" FLOAT_FMT_STR ", y=" FLOAT_FMT_STR " cx=" FLOAT_FMT_STR ", cy=" FLOAT_FMT_STR "\n",
+ pHlp->pfnPrintf(pHlp, " Frame rect: x=" FLOAT_FMT_STR ", y=" FLOAT_FMT_STR " cx=" FLOAT_FMT_STR ", cy=" FLOAT_FMT_STR "\n",
FLOAT_FMT_ARGS(FrameRect.origin.x), FLOAT_FMT_ARGS(FrameRect.origin.y),
FLOAT_FMT_ARGS(FrameRect.size.width), FLOAT_FMT_ARGS(FrameRect.size.height));
NSRect BoundsRect = [pOvlView bounds];
- pHlp->pfnPrintf(pHlp, " Bounds rect: x=" FLOAT_FMT_STR ", y=" FLOAT_FMT_STR " cx=" FLOAT_FMT_STR ", cy=" FLOAT_FMT_STR "\n",
- FLOAT_FMT_ARGS(BoundsRect.origin.x), FLOAT_FMT_ARGS(BoundsRect.origin.y),
+ pHlp->pfnPrintf(pHlp, " Bounds rect: x=" FLOAT_FMT_STR ", y=" FLOAT_FMT_STR " cx=" FLOAT_FMT_STR ", cy=" FLOAT_FMT_STR "\n",
+ FLOAT_FMT_ARGS(BoundsRect.origin.x), FLOAT_FMT_ARGS(BoundsRect.origin.y),
FLOAT_FMT_ARGS(BoundsRect.size.width), FLOAT_FMT_ARGS(BoundsRect.size.height));
NSRect VisibleRect = [pOvlView visibleRect];
- pHlp->pfnPrintf(pHlp, " Visible rect: x=" FLOAT_FMT_STR ", y=" FLOAT_FMT_STR " cx=" FLOAT_FMT_STR ", cy=" FLOAT_FMT_STR "\n",
- FLOAT_FMT_ARGS(VisibleRect.origin.x), FLOAT_FMT_ARGS(VisibleRect.origin.y),
+ pHlp->pfnPrintf(pHlp, " Visible rect: x=" FLOAT_FMT_STR ", y=" FLOAT_FMT_STR " cx=" FLOAT_FMT_STR ", cy=" FLOAT_FMT_STR "\n",
+ FLOAT_FMT_ARGS(VisibleRect.origin.x), FLOAT_FMT_ARGS(VisibleRect.origin.y),
FLOAT_FMT_ARGS(VisibleRect.size.width), FLOAT_FMT_ARGS(VisibleRect.size.height));
pHlp->pfnPrintf(pHlp, " isHidden: %RTbool\n", [pOvlView isHidden] != NO);
pHlp->pfnPrintf(pHlp, " canDraw: %RTbool\n", [pOvlView canDraw] != NO);
pHlp->pfnPrintf(pHlp, " wantsDefaultClipping: %RTbool\n", [pOvlView wantsDefaultClipping] != NO);
- pHlp->pfnPrintf(pHlp, " wantsLayer: %RTbool\n", [pOvlView wantsLayer] != NO);
+ pHlp->pfnPrintf(pHlp, " wantsLayer: %RTbool\n", [pOvlView wantsLayer] != NO);
if ([pOvlView layer] != nil)
pHlp->pfnPrintf(pHlp, " Layer: %p\n", [pOvlView layer] != nil);
pHlp->pfnPrintf(pHlp, " isOpaque: %RTbool\n", [pOvlView isOpaque] != NO);
- pHlp->pfnPrintf(pHlp, " autoresizingMask: %#x\n", [pOvlView autoresizingMask]);
+ pHlp->pfnPrintf(pHlp, " autoresizingMask: %#x\n", [pOvlView autoresizingMask]);
pHlp->pfnPrintf(pHlp, " isRotatedOrScaledFromBase: %RTbool\n", [pOvlView isRotatedOrScaledFromBase] != NO);
NSView *pEnclosingScrollView = [pOvlView enclosingScrollView];
@@ -748,14 +749,14 @@ VMSVGA3DCOCOA_DECL(void) vmsvga3dCocoaViewInfo(PCDBGFINFOHLP pHlp, NativeNSViewR
NSView *pNextView = [pCurView superview];
pHlp->pfnPrintf(pHlp, " Superview#%u: %p, super=%p\n", iLevel, pCurView, pNextView);
FrameRect = [pCurView frame];
- pHlp->pfnPrintf(pHlp, " Superview#%u frame: x=" FLOAT_FMT_STR ", y=" FLOAT_FMT_STR " cx=" FLOAT_FMT_STR ", cy=" FLOAT_FMT_STR "\n",
+ pHlp->pfnPrintf(pHlp, " Superview#%u frame: x=" FLOAT_FMT_STR ", y=" FLOAT_FMT_STR " cx=" FLOAT_FMT_STR ", cy=" FLOAT_FMT_STR "\n",
iLevel,
- FLOAT_FMT_ARGS(FrameRect.origin.x), FLOAT_FMT_ARGS(FrameRect.origin.y),
+ FLOAT_FMT_ARGS(FrameRect.origin.x), FLOAT_FMT_ARGS(FrameRect.origin.y),
FLOAT_FMT_ARGS(FrameRect.size.width), FLOAT_FMT_ARGS(FrameRect.size.height));
BoundsRect = [pCurView bounds];
- pHlp->pfnPrintf(pHlp, " Superview#%u bounds: x=" FLOAT_FMT_STR ", y=" FLOAT_FMT_STR " cx=" FLOAT_FMT_STR ", cy=" FLOAT_FMT_STR "\n",
+ pHlp->pfnPrintf(pHlp, " Superview#%u bounds: x=" FLOAT_FMT_STR ", y=" FLOAT_FMT_STR " cx=" FLOAT_FMT_STR ", cy=" FLOAT_FMT_STR "\n",
iLevel,
- FLOAT_FMT_ARGS(BoundsRect.origin.x), FLOAT_FMT_ARGS(BoundsRect.origin.y),
+ FLOAT_FMT_ARGS(BoundsRect.origin.x), FLOAT_FMT_ARGS(BoundsRect.origin.y),
FLOAT_FMT_ARGS(BoundsRect.size.width), FLOAT_FMT_ARGS(BoundsRect.size.height));
if (pEnclosingScrollView == pCurView)
pHlp->pfnPrintf(pHlp, " Superview#%u is enclosing scroll view\n", iLevel);
@@ -771,8 +772,8 @@ VMSVGA3DCOCOA_DECL(void) vmsvga3dCocoaViewInfo(PCDBGFINFOHLP pHlp, NativeNSViewR
{
pHlp->pfnPrintf(pHlp, " Window: %p\n", pWindow);
FrameRect = [pWindow frame];
- pHlp->pfnPrintf(pHlp, " Window frame: x=" FLOAT_FMT_STR ", y=" FLOAT_FMT_STR " cx=" FLOAT_FMT_STR ", cy=" FLOAT_FMT_STR "\n",
- FLOAT_FMT_ARGS(FrameRect.origin.x), FLOAT_FMT_ARGS(FrameRect.origin.y),
+ pHlp->pfnPrintf(pHlp, " Window frame: x=" FLOAT_FMT_STR ", y=" FLOAT_FMT_STR " cx=" FLOAT_FMT_STR ", cy=" FLOAT_FMT_STR "\n",
+ FLOAT_FMT_ARGS(FrameRect.origin.x), FLOAT_FMT_ARGS(FrameRect.origin.y),
FLOAT_FMT_ARGS(FrameRect.size.width), FLOAT_FMT_ARGS(FrameRect.size.height));
CGFloat rFactor = [pWindow backingScaleFactor];
pHlp->pfnPrintf(pHlp, " W.backingScaleFactor: " FLOAT_FMT_STR "\n", FLOAT_FMT_ARGS(rFactor));
diff --git a/src/VBox/Devices/Graphics/DevVGA-SVGA3d-info.cpp b/src/VBox/Devices/Graphics/DevVGA-SVGA3d-info.cpp
index 63331ea..c414584 100644
--- a/src/VBox/Devices/Graphics/DevVGA-SVGA3d-info.cpp
+++ b/src/VBox/Devices/Graphics/DevVGA-SVGA3d-info.cpp
@@ -16,9 +16,9 @@
*/
-/*******************************************************************************
-* Header Files *
-*******************************************************************************/
+/*********************************************************************************************************************************
+* Header Files *
+*********************************************************************************************************************************/
#define LOG_GROUP LOG_GROUP_DEV_VMSVGA
#include <VBox/vmm/pdmdev.h>
#include <VBox/err.h>
diff --git a/src/VBox/Devices/Graphics/DevVGA-SVGA3d-ogl.cpp b/src/VBox/Devices/Graphics/DevVGA-SVGA3d-ogl.cpp
index f2d6343..a0e51d3 100644
--- a/src/VBox/Devices/Graphics/DevVGA-SVGA3d-ogl.cpp
+++ b/src/VBox/Devices/Graphics/DevVGA-SVGA3d-ogl.cpp
@@ -16,9 +16,9 @@
*/
-/*******************************************************************************
-* Header Files *
-*******************************************************************************/
+/*********************************************************************************************************************************
+* Header Files *
+*********************************************************************************************************************************/
/* Enable to disassemble defined shaders. (Windows host only) */
#if defined(RT_OS_WINDOWS) && defined(DEBUG) && 0 /* Disabled as we don't have the DirectX SDK avaible atm. */
# define DUMP_SHADER_DISASSEMBLY
@@ -56,9 +56,9 @@
#include <float.h> /* FLT_MIN */
-/*******************************************************************************
-* Defined Constants And Macros *
-*******************************************************************************/
+/*********************************************************************************************************************************
+* Defined Constants And Macros *
+*********************************************************************************************************************************/
#ifndef VBOX_VMSVGA3D_DEFAULT_OGL_PROFILE
# define VBOX_VMSVGA3D_DEFAULT_OGL_PROFILE 1.0
#endif
@@ -135,11 +135,11 @@ static void *MyNSGLGetProcAddress(const char *pszSymbol)
#endif
-/*******************************************************************************
-* Global Variables *
-*******************************************************************************/
+/*********************************************************************************************************************************
+* Global Variables *
+*********************************************************************************************************************************/
/* Define the default light parameters as specified by MSDN. */
-/* @todo move out; fetched from Wine */
+/** @todo move out; fetched from Wine */
const SVGA3dLightData vmsvga3d_default_light =
{
SVGA3D_LIGHTTYPE_DIRECTIONAL, /* type */
@@ -157,9 +157,9 @@ const SVGA3dLightData vmsvga3d_default_light =
};
-/*******************************************************************************
-* Internal Functions *
-*******************************************************************************/
+/*********************************************************************************************************************************
+* Internal Functions *
+*********************************************************************************************************************************/
static int vmsvga3dContextDestroyOgl(PVGASTATE pThis, PVMSVGA3DCONTEXT pContext, uint32_t cid);
static void vmsvgaColor2GLFloatArray(uint32_t color, GLfloat *pRed, GLfloat *pGreen, GLfloat *pBlue, GLfloat *pAlpha);
@@ -844,7 +844,7 @@ int vmsvga3dPowerOn(PVGASTATE pThis)
* ATI does not support higher than SM 2.0 functionality in assembly shaders.
*
*/
- /** @todo: distinguish between vertex and pixel shaders??? */
+ /** @todo distinguish between vertex and pixel shaders??? */
if ( vmsvga3dCheckGLExtension(pState, 0.0f, " GL_NV_gpu_program4 ")
|| strstr(pState->pszOtherExtensions, " GL_NV_gpu_program4 "))
{
@@ -1096,7 +1096,7 @@ static uint32_t vmsvga3dGetSurfaceFormatSupport(PVMSVGA3DSTATE pState3D, uint32_
{
uint32_t result = 0;
- /* @todo missing:
+ /** @todo missing:
*
* SVGA3DFORMAT_OP_PIXELSIZE
*/
@@ -1122,7 +1122,7 @@ static uint32_t vmsvga3dGetSurfaceFormatSupport(PVMSVGA3DSTATE pState3D, uint32_
break;
}
- /* @todo check hardware caps! */
+ /** @todo check hardware caps! */
switch (idx3dCaps)
{
case SVGA3D_DEVCAP_SURFACEFMT_X8R8G8B8:
@@ -1200,7 +1200,7 @@ static uint32_t vmsvga3dGetDepthFormatSupport(PVMSVGA3DSTATE pState3D, uint32_t
{
uint32_t result = 0;
- /* @todo test this somehow */
+ /** @todo test this somehow */
result = SVGA3DFORMAT_OP_ZSTENCIL | SVGA3DFORMAT_OP_ZSTENCIL_WITH_ARBITRARY_COLOR_DEPTH;
Log(("CAPS: %s =\n%s\n", vmsvga3dGetCapString(idx3dCaps), vmsvga3dGet3dFormatString(result)));
@@ -1295,7 +1295,7 @@ int vmsvga3dQueryCaps(PVGASTATE pThis, uint32_t idx3dCaps, uint32_t *pu32Val)
break;
case SVGA3D_DEVCAP_MAX_SHADER_TEXTURES:
- /* @todo ?? */
+ /** @todo ?? */
rc = VERR_INVALID_PARAMETER;
break;
@@ -1369,7 +1369,7 @@ int vmsvga3dQueryCaps(PVGASTATE pThis, uint32_t idx3dCaps, uint32_t *pu32Val)
case SVGA3D_DEVCAP_MAX_VERTEX_SHADER_TEXTURES:
break;
- case SVGA3D_DEVCAP_MAX_RENDER_TARGETS: /* @todo same thing? */
+ case SVGA3D_DEVCAP_MAX_RENDER_TARGETS: /** @todo same thing? */
case SVGA3D_DEVCAP_MAX_SIMULTANEOUS_RENDER_TARGETS:
*pu32Val = pState->caps.maxColorAttachments;
break;
@@ -1801,7 +1801,7 @@ D3DMULTISAMPLE_TYPE vmsvga3dMultipeSampleCount2D3D(uint32_t multisampleCount)
if (multisampleCount > 16)
return D3DMULTISAMPLE_NONE;
- /* @todo exact same mapping as d3d? */
+ /** @todo exact same mapping as d3d? */
return (D3DMULTISAMPLE_TYPE)multisampleCount;
}
#endif
@@ -1820,7 +1820,7 @@ void vmsvga3dBackSurfaceDestroy(PVMSVGA3DSTATE pState, PVMSVGA3DSURFACE pSurface
switch (pSurface->flags & VMSVGA3D_SURFACE_HINT_SWITCH_MASK)
{
case SVGA3D_SURFACE_CUBEMAP:
- AssertFailed(); /** @todo */
+ AssertFailed(); /** @todo destroy SVGA3D_SURFACE_CUBEMAP */
break;
case SVGA3D_SURFACE_HINT_INDEXBUFFER:
@@ -2025,7 +2025,7 @@ int vmsvga3dBackCreateTexture(PVMSVGA3DSTATE pState, PVMSVGA3DCONTEXT pContext,
glGenTextures(1, &pSurface->oglId.texture);
VMSVGA3D_CHECK_LAST_ERROR(pState, pContext);
- /* @todo Set the mip map generation filter settings. */
+ /** @todo Set the mip map generation filter settings. */
glGetIntegerv(GL_TEXTURE_BINDING_2D, &activeTexture);
VMSVGA3D_CHECK_LAST_ERROR(pState, pContext);
@@ -2420,7 +2420,7 @@ int vmsvga3dBackSurfaceDMACopyBox(PVGASTATE pThis, PVMSVGA3DSTATE pState, PVMSVG
}
case SVGA3D_SURFACE_HINT_DEPTHSTENCIL:
- AssertFailed(); /* @todo */
+ AssertFailed(); /** @todo DMA SVGA3D_SURFACE_HINT_DEPTHSTENCIL */
break;
case SVGA3D_SURFACE_HINT_VERTEXBUFFER:
@@ -2501,10 +2501,10 @@ int vmsvga3dSurfaceBlitToScreen(PVGASTATE pThis, uint32_t dest, SVGASignedRect d
Log(("vmsvga3dSurfaceBlitToScreen: clipping rect %d (%d,%d)(%d,%d)\n", i, pRect[i].left, pRect[i].top, pRect[i].right, pRect[i].bottom));
}
- /* @todo Only screen 0 for now. */
+ /** @todo Only screen 0 for now. */
AssertReturn(dest == 0, VERR_INTERNAL_ERROR);
AssertReturn(src.mipmap == 0 && src.face == 0, VERR_INVALID_PARAMETER);
- /* @todo scaling */
+ /** @todo scaling */
AssertReturn(destRect.right - destRect.left == srcRect.right - srcRect.left && destRect.bottom - destRect.top == srcRect.bottom - srcRect.top, VERR_INVALID_PARAMETER);
if (cRects == 0)
@@ -2546,7 +2546,7 @@ int vmsvga3dSurfaceBlitToScreen(PVGASTATE pThis, uint32_t dest, SVGASignedRect d
dst.ptr.offset = 0;
dst.pitch = pThis->svga.cbScanline;
- /* @todo merge into one SurfaceDMA call */
+ /** @todo merge into one SurfaceDMA call */
for (uint32_t i = 0; i < cRects; i++)
{
/* The clipping rectangle is relative to the top-left corner of srcRect & destRect. Adjust here. */
@@ -2603,7 +2603,7 @@ int vmsvga3dGenerateMipmaps(PVGASTATE pThis, uint32_t sid, SVGA3dTextureFilter f
}
else
{
- /* @todo new filter */
+ /** @todo new filter */
AssertFailed();
}
@@ -2639,7 +2639,6 @@ int vmsvga3dCommandPresent(PVGASTATE pThis, uint32_t sid, uint32_t cRects, SVGA3
pSurface = pState->papSurfaces[sid];
- /* @todo stricter checks for associated context */
Log(("vmsvga3dCommandPresent: sid=%x cRects=%d\n", sid, cRects));
for (uint32_t i=0; i < cRects; i++)
Log(("vmsvga3dCommandPresent: rectangle %d src=(%d,%d) (%d,%d)(%d,%d)\n", i, pRect[i].srcx, pRect[i].srcy, pRect[i].x, pRect[i].y, pRect[i].x + pRect[i].w, pRect[i].y + pRect[i].h));
@@ -2649,6 +2648,7 @@ int vmsvga3dCommandPresent(PVGASTATE pThis, uint32_t sid, uint32_t cRects, SVGA3
cid = pContext->id;
VMSVGA3D_CLEAR_GL_ERRORS();
+#if 0 /* Can't make sense of this. SVGA3dCopyRect doesn't allow scaling. non-blit-cube path change to not use it. */
/*
* Source surface different size?
*/
@@ -2656,11 +2656,13 @@ int vmsvga3dCommandPresent(PVGASTATE pThis, uint32_t sid, uint32_t cRects, SVGA3
if ( pSurface->pMipmapLevels[0].size.width != pThis->svga.uWidth
|| pSurface->pMipmapLevels[0].size.height != pThis->svga.uHeight)
{
- float xMultiplier = (float)pSurface->pMipmapLevels[0].size.width / (float)pThis->svga.uWidth;
+ float xMultiplier = (float)pSurface->pMipmapLevels[0].size.width / (float)pThis->svga.uWidth;
float yMultiplier = (float)pSurface->pMipmapLevels[0].size.height / (float)pThis->svga.uHeight;
- LogFlow(("size (%d vs %d) (%d vs %d) multiplier (%d,%d)/100\n", pSurface->pMipmapLevels[0].size.width, pThis->svga.uWidth,
- pSurface->pMipmapLevels[0].size.height, pThis->svga.uHeight, (int)(xMultiplier * 100.0), (int)(yMultiplier * 100.0)));
+ LogFlow(("size (%d vs %d, %d vs %d) multiplier (" FLOAT_FMT_STR ", " FLOAT_FMT_STR ")\n",
+ pSurface->pMipmapLevels[0].size.width, pThis->svga.uWidth,
+ pSurface->pMipmapLevels[0].size.height, pThis->svga.uHeight,
+ FLOAT_FMT_ARGS(xMultiplier), FLOAT_FMT_ARGS(yMultiplier) ));
srcViewPort.x = (uint32_t)((float)pThis->svga.viewport.x * xMultiplier);
srcViewPort.y = (uint32_t)((float)pThis->svga.viewport.y * yMultiplier);
@@ -2679,9 +2681,10 @@ int vmsvga3dCommandPresent(PVGASTATE pThis, uint32_t sid, uint32_t cRects, SVGA3
SrcViewPortRect.xRight = srcViewPort.x + srcViewPort.cx;
SrcViewPortRect.yBottom = srcViewPort.y;
SrcViewPortRect.yTop = srcViewPort.y + srcViewPort.cy;
+#endif
-#ifndef RT_OS_DARWIN /* blit-cube fails in this path... */
+#if 0//ndef RT_OS_DARWIN /* blit-cube fails in this path... */
/*
* Note! this path is slightly faster than the glBlitFrameBuffer path below.
*/
@@ -2837,113 +2840,256 @@ int vmsvga3dCommandPresent(PVGASTATE pThis, uint32_t sid, uint32_t cRects, SVGA3
pState->ext.glFramebufferTexture2D(GL_READ_FRAMEBUFFER, GL_COLOR_ATTACHMENT0, GL_TEXTURE_2D, pSurface->oglId.texture, 0 /* level 0 */);
VMSVGA3D_CHECK_LAST_ERROR_WARN(pState, pContext);
- /* Blit the surface rectangle(s) to the back buffer. */
- if (cRects == 0)
+ /* Read the destination viewport specs in one go to try avoid some unnecessary update races. */
+ VMSVGAVIEWPORT const DstViewport = pThis->svga.viewport;
+ ASMCompilerBarrier(); /* paranoia */
+ Assert(DstViewport.yHighWC >= DstViewport.yLowWC);
+
+ /* If there are no recangles specified, just grab a screenful. */
+ SVGA3dCopyRect DummyRect;
+ if (cRects != 0)
+ { /* likely */ }
+ else
{
- Log(("view port (%d,%d)(%d,%d)\n", srcViewPort.x, srcViewPort.y, srcViewPort.cx, srcViewPort.cy));
- pState->ext.glBlitFramebuffer(srcViewPort.x,
- srcViewPort.y,
- srcViewPort.x + srcViewPort.cx, /* exclusive. */
- srcViewPort.y + srcViewPort.cy, /* exclusive. (reverse to flip the image) */
- 0,
- pThis->svga.viewport.cy, /* exclusive. */
- pThis->svga.viewport.cx, /* exclusive. */
- 0,
- GL_COLOR_BUFFER_BIT,
- GL_LINEAR);
- VMSVGA3D_CHECK_LAST_ERROR_WARN(pState, pContext);
+ /** @todo Find the usecase for this or check what the original device does.
+ * The original code was doing some scaling based on the surface
+ * size... */
+# ifdef DEBUG_bird
+ AssertMsgFailed(("No rects to present. Who is doing that and what do they actually expect?\n"));
+# endif
+ DummyRect.x = DummyRect.srcx = 0;
+ DummyRect.y = DummyRect.srcy = 0;
+ DummyRect.w = pThis->svga.uWidth;
+ DummyRect.h = pThis->svga.uHeight;
+ cRects = 1;
+ pRect = &DummyRect;
}
- else
+
+ /*
+ * Blit the surface rectangle(s) to the back buffer.
+ */
+ uint32_t const cxSurface = pSurface->pMipmapLevels[0].size.width;
+ uint32_t const cySurface = pSurface->pMipmapLevels[0].size.height;
+ for (uint32_t i = 0; i < cRects; i++)
{
- for (uint32_t i = 0; i < cRects; i++)
+ SVGA3dCopyRect ClippedRect = pRect[i];
+
+ /*
+ * Do some sanity checking and limit width and height, all so we
+ * don't need to think about wrap-arounds below.
+ */
+ if (RT_LIKELY( ClippedRect.w
+ && ClippedRect.x < VMSVGA_MAX_X
+ && ClippedRect.srcx < VMSVGA_MAX_X
+ && ClippedRect.h
+ && ClippedRect.y < VMSVGA_MAX_Y
+ && ClippedRect.srcy < VMSVGA_MAX_Y
+ ))
+ { /* likely */ }
+ else
+ continue;
+
+ if (RT_LIKELY(ClippedRect.w < VMSVGA_MAX_Y))
+ { /* likely */ }
+ else
+ ClippedRect.w = VMSVGA_MAX_Y;
+ if (RT_LIKELY(ClippedRect.w < VMSVGA_MAX_Y))
+ { /* likely */ }
+ else
+ ClippedRect.w = VMSVGA_MAX_Y;
+
+
+ /*
+ * Source surface clipping (paranoia). Straight forward.
+ */
+ if (RT_LIKELY(ClippedRect.srcx < cxSurface))
+ { /* likely */ }
+ else
+ continue;
+ if (RT_LIKELY(ClippedRect.srcx + ClippedRect.w <= cxSurface))
+ { /* likely */ }
+ else
{
-# ifdef RT_OS_DARWIN
- /* This works better... */
- RTRECT SrcRect;
- SrcRect.xLeft = pRect[i].srcx;
- SrcRect.xRight = pRect[i].srcx + pRect[i].w;
- SrcRect.yBottom = pRect[i].srcy;
- SrcRect.yTop = pRect[i].srcy + pRect[i].h;
- RTRECT DstRect; /* y flipped wrt source */
- DstRect.xLeft = pRect[i].x;
- DstRect.xRight = pRect[i].x + pRect[i].w;
- DstRect.yBottom = pRect[i].y + pRect[i].h;
- DstRect.yTop = pRect[i].y;
-
- if (SrcRect.xLeft < SrcViewPortRect.xLeft)
- {
- DstRect.xLeft += SrcViewPortRect.xLeft - SrcRect.xLeft;
- SrcRect.xLeft = SrcViewPortRect.xLeft;
- }
- else if (SrcRect.xLeft >= SrcViewPortRect.xRight)
- continue;
+ AssertFailed(); /* remove if annoying. */
+ ClippedRect.w = cxSurface - ClippedRect.srcx;
+ }
+
+ if (RT_LIKELY(ClippedRect.srcy < cySurface))
+ { /* likely */ }
+ else
+ continue;
+ if (RT_LIKELY(ClippedRect.srcy + ClippedRect.h <= cySurface))
+ { /* likely */ }
+ else
+ {
+ AssertFailed(); /* remove if annoying. */
+ ClippedRect.h = cySurface - ClippedRect.srcy;
+ }
- if (SrcRect.xRight > SrcViewPortRect.xRight)
+ /*
+ * Destination viewport clipping - real PITA.
+ *
+ * We have to take the following into account here:
+ * - The source image is Y inverted.
+ * - The destination framebuffer is in world and not window coordinates,
+ * just like the source surface. This means working in the first quadrant.
+ * - The viewport is in window coordinate, that is fourth quadrant and
+ * negated Y values.
+ * - The destination framebuffer is not scrolled, so we have to blit
+ * what's visible into the top of the framebuffer.
+ *
+ *
+ * To illustrate:
+ *
+ * source destination 0123456789
+ * 8 ^---------- 8 ^---------- 0 ----------->
+ * 7 | | 7 | | 1 | |
+ * 6 | | 6 | ******* | 2 | ******* |
+ * 5 | *** | 5 | * | 3 | * |
+ * 4 | * | => 4 | * | => 4 | * |
+ * 3 | * | 3 | *** | 5 | *** |
+ * 2 | ******* | 2 | | 6 | |
+ * 1 | | 1 | | 7 | |
+ * 0 -----------> 0 -----------> 8 v----------
+ * 0123456789 0123456789 Destination window
+ *
+ * From the above, it follows that a destination viewport given in
+ * window coordinates matches the source exactly when srcy = srcx = 0.
+ *
+ * Example (Y only):
+ * ySrc = 0
+ * yDst = 0
+ * cyCopy = 9
+ * cyScreen = cyCopy
+ * cySurface >= cyCopy
+ * yViewport = 5
+ * cyViewport = 2 (i.e. '| *** |'
+ * '| |' )
+ * yWCViewportHi = cxScreen - yViewport = 9 - 5 = 4
+ * yWCViewportLow = cxScreen - yViewport - cyViewport = 4 - 2 = 2
+ *
+ * We can see from the illustration that the final result should be:
+ * SrcRect = (0,7) (11, 5) (cy=2 from y=5)
+ * DstRect = (0,2) (11, 4)
+ *
+ * Let's postpone the switching of SrcRect.yBottom/yTop to make it
+ * easier to follow:
+ * SrcRect = (0,5) (11, 7)
+ *
+ * From the top, Y values only:
+ * 0. Copy = { .yDst = 0, .ySrc = 0, .cy = 9 }
+ *
+ * 1. CopyRect.yDst (=0) is lower than yWCViewportLow:
+ * cyAdjust = yWCViewportLow - CopyRect.yDst = 2;
+ * Copy.yDst += cyAdjust = 2;
+ * Copy.ySrc = unchanged;
+ * Copy.cx -= cyAdjust = 7;
+ * => Copy = { .yDst = 2, .ySrc = 0, .cy = 7 }
+ *
+ * 2. CopyRect.yDst + CopyRect.cx (=9) is higher than yWCViewportHi:
+ * cyAdjust = CopyRect.yDst + CopyRect.cx - yWCViewportHi = 9 - 4 = 5
+ * Copy.yDst = unchanged;
+ * Copy.ySrc += cyAdjust = 5;
+ * Copy.cx -= cyAdjust = 2;
+ * => Copy = { .yDst = 2, .ySrc = 5, .cy = 2 }
+ *
+ */
+ /* X - no inversion, so kind of simple. */
+ if (ClippedRect.x >= DstViewport.x)
+ {
+ if (ClippedRect.x + ClippedRect.w <= DstViewport.xRight)
+ { /* typical */ }
+ else if (ClippedRect.x < DstViewport.xRight)
+ ClippedRect.w = DstViewport.xRight - ClippedRect.x;
+ else
+ continue;
+ }
+ else
+ {
+ uint32_t cxAdjust = DstViewport.x - ClippedRect.x;
+ if (cxAdjust < ClippedRect.w)
{
- DstRect.xRight -= SrcViewPortRect.xRight - SrcRect.xRight;
- SrcRect.xRight = SrcViewPortRect.xRight;
+ ClippedRect.w -= cxAdjust;
+ ClippedRect.x += cxAdjust;
+ ClippedRect.srcx += cxAdjust;
}
- else if (SrcRect.xRight <= SrcViewPortRect.xLeft)
+ else
continue;
- if (SrcRect.xRight <= SrcRect.xLeft)
- continue;
+ if (ClippedRect.x + ClippedRect.w <= DstViewport.xRight)
+ { /* typical */ }
+ else
+ ClippedRect.w = DstViewport.xRight - ClippedRect.x;
+ }
- if (SrcRect.yBottom < SrcViewPortRect.yBottom)
+ /* Y - complicated, see above. */
+ if (ClippedRect.y >= DstViewport.yLowWC)
+ {
+ if (ClippedRect.y + ClippedRect.h <= DstViewport.yHighWC)
+ { /* typical */ }
+ else if (ClippedRect.y < DstViewport.yHighWC)
{
- DstRect.yTop += SrcViewPortRect.yBottom - SrcRect.yBottom;
- SrcRect.yBottom = SrcViewPortRect.yBottom;
+ /* adjustment #2 */
+ uint32_t cyAdjust = ClippedRect.y + ClippedRect.h - DstViewport.yHighWC;
+ ClippedRect.srcy += cyAdjust;
+ ClippedRect.h -= cyAdjust;
}
- else if (SrcRect.yBottom >= SrcViewPortRect.yTop)
+ else
continue;
-
- if (SrcRect.yTop > SrcViewPortRect.yTop)
+ }
+ else
+ {
+ /* adjustment #1 */
+ uint32_t cyAdjust = DstViewport.yLowWC - ClippedRect.y;
+ if (cyAdjust < ClippedRect.h)
{
- DstRect.yBottom -= SrcViewPortRect.yTop - SrcRect.yTop;
- SrcRect.yTop = SrcViewPortRect.yTop;
+ ClippedRect.y += cyAdjust;
+ ClippedRect.h -= cyAdjust;
}
- else if (SrcRect.yTop <= SrcViewPortRect.yBottom)
- continue;
-
- if (SrcRect.yTop <= SrcRect.yBottom)
+ else
continue;
- Log(("SrcRect: (%d,%d)(%d,%d) DstRect: (%d,%d)(%d,%d)\n",
- SrcRect.xLeft, SrcRect.yBottom, SrcRect.xRight, SrcRect.yTop,
- DstRect.xLeft, DstRect.yBottom, DstRect.xRight, DstRect.yTop));
- pState->ext.glBlitFramebuffer(SrcRect.xLeft, SrcRect.yBottom, SrcRect.xRight, SrcRect.yTop,
- DstRect.xLeft, DstRect.yBottom, DstRect.xRight, DstRect.yTop,
- GL_COLOR_BUFFER_BIT, GL_LINEAR);
-
-# else
- if ( pRect[i].x + pRect[i].w <= pThis->svga.viewport.x
- || pThis->svga.viewport.x + pThis->svga.viewport.cx <= pRect[i].x
- || pRect[i].y + pRect[i].h <= pThis->svga.viewport.y
- || pThis->svga.viewport.y + pThis->svga.viewport.cy <= pRect[i].y)
+ if (ClippedRect.y + ClippedRect.h <= DstViewport.yHighWC)
+ { /* typical */ }
+ else
{
- /* Intersection is empty; skip */
- continue;
+ /* adjustment #2 */
+ uint32_t cyAdjust = ClippedRect.y + ClippedRect.h - DstViewport.yHighWC;
+ ClippedRect.srcy += cyAdjust;
+ ClippedRect.h -= cyAdjust;
}
- pState->ext.glBlitFramebuffer(RT_MAX(pRect[i].srcx, srcViewPort.x),
- pSurface->pMipmapLevels[0].size.width - RT_MAX(pRect[i].srcy, srcViewPort.y), /* exclusive. (reverse to flip the image) */
- RT_MIN(pRect[i].srcx + pRect[i].w, srcViewPort.x + srcViewPort.cx), /* exclusive. */
- pSurface->pMipmapLevels[0].size.width - RT_MIN(pRect[i].srcy + pRect[i].h, srcViewPort.y + srcViewPort.cy),
- RT_MAX(pRect[i].x, pThis->svga.viewport.x) - pThis->svga.viewport.x,
- pThis->svga.uHeight - (RT_MIN(pRect[i].y + pRect[i].h, pThis->svga.viewport.y + pThis->svga.viewport.cy) - pThis->svga.viewport.y), /* exclusive. */
- RT_MIN(pRect[i].x + pRect[i].w, pThis->svga.viewport.x + pThis->svga.viewport.cx) - pThis->svga.viewport.x, /* exclusive. */
- pThis->svga.uHeight - (RT_MAX(pRect[i].y, pThis->svga.viewport.y) - pThis->svga.viewport.y),
- GL_COLOR_BUFFER_BIT,
- GL_LINEAR);
-# endif
}
+
+ /* Calc source rectangle with y flipping wrt destination. */
+ RTRECT SrcRect;
+ SrcRect.xLeft = ClippedRect.srcx;
+ SrcRect.xRight = ClippedRect.srcx + ClippedRect.w;
+ SrcRect.yBottom = ClippedRect.srcy + ClippedRect.h;
+ SrcRect.yTop = ClippedRect.srcy;
+
+ /* Calc destination rectangle. */
+ RTRECT DstRect;
+ DstRect.xLeft = ClippedRect.x;
+ DstRect.xRight = ClippedRect.x + ClippedRect.w;
+ DstRect.yBottom = ClippedRect.y;
+ DstRect.yTop = ClippedRect.y + ClippedRect.h;
+
+ /* Adjust for viewport. */
+ DstRect.xLeft -= DstViewport.x;
+ DstRect.xRight -= DstViewport.x;
+ DstRect.yBottom += DstViewport.y;
+ DstRect.yTop += DstViewport.y;
+
+ Log(("SrcRect: (%d,%d)(%d,%d) DstRect: (%d,%d)(%d,%d)\n",
+ SrcRect.xLeft, SrcRect.yBottom, SrcRect.xRight, SrcRect.yTop,
+ DstRect.xLeft, DstRect.yBottom, DstRect.xRight, DstRect.yTop));
+ pState->ext.glBlitFramebuffer(SrcRect.xLeft, SrcRect.yBottom, SrcRect.xRight, SrcRect.yTop,
+ DstRect.xLeft, DstRect.yBottom, DstRect.xRight, DstRect.yTop,
+ GL_COLOR_BUFFER_BIT, GL_LINEAR);
}
#endif
-#ifndef RT_OS_DARWIN /* darwin: later */
- /* Reset the frame buffer association - see below. */
- VMSVGA3D_ASSERT_GL_CALL(pState->ext.glBindFramebuffer(GL_FRAMEBUFFER, pContext->idFramebuffer), pState, pContext);
-#endif
/*
* Flip the front and back buffers.
@@ -2964,13 +3110,11 @@ int vmsvga3dCommandPresent(PVGASTATE pThis, uint32_t sid, uint32_t cRects, SVGA3
glXSwapBuffers(pState->display, pContext->window);
#endif
-#if defined(RT_OS_DARWIN)
/*
* Now we can reset the frame buffer association. Doing it earlier means no
* output on darwin.
*/
VMSVGA3D_ASSERT_GL_CALL(pState->ext.glBindFramebuffer(GL_FRAMEBUFFER, pContext->idFramebuffer), pState, pContext);
-#endif
return VINF_SUCCESS;
}
@@ -3154,7 +3298,7 @@ int vmsvga3dContextDefineOgl(PVGASTATE pThis, uint32_t cid, uint32_t fFlags)
BOOL ret;
pixelFormat = ChoosePixelFormat(pContext->hdc, &pfd);
- /* @todo is this really necessary?? */
+ /** @todo is this really necessary?? */
pixelFormat = ChoosePixelFormat(pContext->hdc, &pfd);
AssertMsgReturn(pixelFormat != 0, ("ChoosePixelFormat failed with %d\n", GetLastError()), VERR_INTERNAL_ERROR);
@@ -3252,7 +3396,7 @@ int vmsvga3dContextDefineOgl(PVGASTATE pThis, uint32_t cid, uint32_t fFlags)
}
#if 0
- /* @todo move to shader lib!!! */
+ /** @todo move to shader lib!!! */
/* Clear the screen */
VMSVGA3D_SET_CURRENT_CONTEXT(pState, pContext);
@@ -3265,7 +3409,7 @@ int vmsvga3dContextDefineOgl(PVGASTATE pThis, uint32_t cid, uint32_t fFlags)
glLightModeli(GL_LIGHT_MODEL_COLOR_CONTROL, GL_SEPARATE_SPECULAR_COLOR);
if (pState->ext.glProvokingVertex)
pState->ext.glProvokingVertex(GL_FIRST_VERTEX_CONVENTION);
- /* @todo move to shader lib!!! */
+ /** @todo move to shader lib!!! */
#endif
return VINF_SUCCESS;
}
@@ -3614,9 +3758,9 @@ static GLenum vmsvga3dBlendOp2GL(uint32_t blendOp)
case SVGA3D_BLENDOP_SRCALPHASAT:
return GL_SRC_ALPHA_SATURATE;
case SVGA3D_BLENDOP_BLENDFACTOR:
- return GL_CONSTANT_ALPHA; /* @todo correct?? */
+ return GL_CONSTANT_ALPHA; /** @todo correct?? */
case SVGA3D_BLENDOP_INVBLENDFACTOR:
- return GL_ONE_MINUS_CONSTANT_ALPHA; /* @todo correct?? */
+ return GL_ONE_MINUS_CONSTANT_ALPHA; /** @todo correct?? */
default:
AssertFailed();
return GL_ONE;
@@ -3768,7 +3912,7 @@ int vmsvga3dSetRenderState(PVGASTATE pThis, uint32_t cid, uint32_t cRenderStates
break;
case SVGA3D_RS_POINTSIZE: /* float */
- /* @todo we need to apply scaling for point sizes below the min or above the max; see Wine) */
+ /** @todo we need to apply scaling for point sizes below the min or above the max; see Wine) */
if (pRenderState[i].floatValue < pState->caps.flPointSize[0])
pRenderState[i].floatValue = pState->caps.flPointSize[0];
if (pRenderState[i].floatValue > pState->caps.flPointSize[1])
@@ -3876,7 +4020,7 @@ int vmsvga3dSetRenderState(PVGASTATE pThis, uint32_t cid, uint32_t cRenderStates
break;
}
- /* @todo how to switch between vertex and pixel fog modes??? */
+ /** @todo how to switch between vertex and pixel fog modes??? */
Assert(mode.s.type == SVGA3D_FOGTYPE_PIXEL);
#if 0
/* The fog type determines the render state. */
@@ -3963,7 +4107,7 @@ int vmsvga3dSetRenderState(PVGASTATE pThis, uint32_t cid, uint32_t cRenderStates
case SVGA3D_RS_LINEPATTERN: /* SVGA3dLinePattern */
/* No longer supported by d3d; mesagl comments suggest not all backends support it */
- /* @todo */
+ /** @todo */
Log(("WARNING: SVGA3D_RS_LINEPATTERN %x not supported!!\n", pRenderState[i].uintValue));
/*
renderState = D3DRS_LINEPATTERN;
@@ -4237,8 +4381,8 @@ int vmsvga3dSetRenderState(PVGASTATE pThis, uint32_t cid, uint32_t cRenderStates
case SVGA3D_RS_CCWSTENCILFUNC: /* SVGA3dCmpFunc */
{
- /* @todo SVGA3D_RS_STENCILFAIL/ZFAIL/PASS for front & back faces
- * SVGA3D_RS_CCWSTENCILFAIL/ZFAIL/PASS for back faces ??
+ /** @todo SVGA3D_RS_STENCILFAIL/ZFAIL/PASS for front & back faces
+ * SVGA3D_RS_CCWSTENCILFAIL/ZFAIL/PASS for back faces ??
*/
GLint ref;
GLuint mask;
@@ -4257,8 +4401,8 @@ int vmsvga3dSetRenderState(PVGASTATE pThis, uint32_t cid, uint32_t cRenderStates
case SVGA3D_RS_CCWSTENCILZFAIL: /* SVGA3dStencilOp */
case SVGA3D_RS_CCWSTENCILPASS: /* SVGA3dStencilOp */
{
- /* @todo SVGA3D_RS_STENCILFAIL/ZFAIL/PASS for front & back faces
- * SVGA3D_RS_CCWSTENCILFAIL/ZFAIL/PASS for back faces ??
+ /** @todo SVGA3D_RS_STENCILFAIL/ZFAIL/PASS for front & back faces
+ * SVGA3D_RS_CCWSTENCILFAIL/ZFAIL/PASS for back faces ??
*/
GLint sfail, dpfail, dppass;
GLenum stencilop = vmsvgaStencipOp2GL(pRenderState[i].uintValue);
@@ -4292,7 +4436,7 @@ int vmsvga3dSetRenderState(PVGASTATE pThis, uint32_t cid, uint32_t cRenderStates
}
case SVGA3D_RS_ZBIAS: /* float */
- /* @todo unknown meaning; depth bias is not identical
+ /** @todo unknown meaning; depth bias is not identical
renderState = D3DRS_DEPTHBIAS;
val = pRenderState[i].uintValue;
*/
@@ -4303,7 +4447,7 @@ int vmsvga3dSetRenderState(PVGASTATE pThis, uint32_t cid, uint32_t cRenderStates
{
GLfloat factor;
- /* @todo not sure if the d3d & ogl definitions are identical. */
+ /** @todo not sure if the d3d & ogl definitions are identical. */
/* Do not change the factor part. */
glGetFloatv(GL_POLYGON_OFFSET_FACTOR, &factor);
@@ -4318,7 +4462,7 @@ int vmsvga3dSetRenderState(PVGASTATE pThis, uint32_t cid, uint32_t cRenderStates
{
GLfloat units;
- /* @todo not sure if the d3d & ogl definitions are identical. */
+ /** @todo not sure if the d3d & ogl definitions are identical. */
/* Do not change the factor part. */
glGetFloatv(GL_POLYGON_OFFSET_UNITS, &units);
@@ -4415,7 +4559,7 @@ int vmsvga3dSetRenderState(PVGASTATE pThis, uint32_t cid, uint32_t cRenderStates
case SVGA3D_RS_COORDINATETYPE: /* SVGA3dCoordinateType */
Assert(pRenderState[i].uintValue == SVGA3D_COORDINATE_LEFTHANDED);
- /* @todo setup a view matrix to scale the world space by -1 in the z-direction for right handed coordinates. */
+ /** @todo setup a view matrix to scale the world space by -1 in the z-direction for right handed coordinates. */
/*
renderState = D3DRS_COORDINATETYPE;
val = pRenderState[i].uintValue;
@@ -4660,7 +4804,7 @@ int vmsvga3dSetRenderTarget(PVGASTATE pThis, uint32_t cid, SVGA3dRenderTargetTyp
if (status != GL_FRAMEBUFFER_COMPLETE)
Log(("vmsvga3dSetRenderTarget: WARNING: glCheckFramebufferStatus returned %x\n", status));
#endif
- /* @todo use glDrawBuffers too? */
+ /** @todo use glDrawBuffers too? */
break;
}
@@ -4706,7 +4850,7 @@ static DWORD vmsvga3dTextureCombiner2D3D(uint32_t value)
case SVGA3D_TC_MODULATE4X:
return D3DTOP_MODULATE4X;
case SVGA3D_TC_DSDT:
- AssertFailed(); /* @todo ??? */
+ AssertFailed(); /** @todo ??? */
return D3DTOP_DISABLE;
case SVGA3D_TC_DOTPRODUCT3:
return D3DTOP_DOTPRODUCT3;
@@ -4771,13 +4915,13 @@ static DWORD vmsvga3dTextTransformFlags2D3D(uint32_t value)
case SVGA3D_TEX_TRANSFORM_OFF:
return D3DTTFF_DISABLE;
case SVGA3D_TEX_TRANSFORM_S:
- return D3DTTFF_COUNT1; /* @todo correct? */
+ return D3DTTFF_COUNT1; /** @todo correct? */
case SVGA3D_TEX_TRANSFORM_T:
- return D3DTTFF_COUNT2; /* @todo correct? */
+ return D3DTTFF_COUNT2; /** @todo correct? */
case SVGA3D_TEX_TRANSFORM_R:
- return D3DTTFF_COUNT3; /* @todo correct? */
+ return D3DTTFF_COUNT3; /** @todo correct? */
case SVGA3D_TEX_TRANSFORM_Q:
- return D3DTTFF_COUNT4; /* @todo correct? */
+ return D3DTTFF_COUNT4; /** @todo correct? */
case SVGA3D_TEX_PROJECTED:
return D3DTTFF_PROJECTED;
default:
@@ -4801,7 +4945,7 @@ static GLenum vmsvga3dTextureAddress2OGL(SVGA3dTextureAddress value)
return GL_CLAMP_TO_BORDER;
case SVGA3D_TEX_ADDRESS_MIRRORONCE:
AssertFailed();
- return GL_CLAMP_TO_EDGE_SGIS; /* @todo correct? */
+ return GL_CLAMP_TO_EDGE_SGIS; /** @todo correct? */
case SVGA3D_TEX_ADDRESS_EDGE:
case SVGA3D_TEX_ADDRESS_INVALID:
@@ -4821,7 +4965,7 @@ static GLenum vmsvga3dTextureFilter2OGL(SVGA3dTextureFilter value)
case SVGA3D_TEX_FILTER_NEAREST:
return GL_NEAREST;
case SVGA3D_TEX_FILTER_ANISOTROPIC:
- /* @todo */
+ /** @todo */
case SVGA3D_TEX_FILTER_FLATCUBIC: // Deprecated, not implemented
case SVGA3D_TEX_FILTER_GAUSSIANCUBIC: // Deprecated, not implemented
case SVGA3D_TEX_FILTER_PYRAMIDALQUAD: // Not currently implemented
@@ -4909,7 +5053,7 @@ int vmsvga3dSetTextureState(PVGASTATE pThis, uint32_t cid, uint32_t cTextureStat
case SVGA3D_TS_ALPHAARG0: /* SVGA3dTextureArgData */
case SVGA3D_TS_ALPHAARG1: /* SVGA3dTextureArgData */
case SVGA3D_TS_ALPHAARG2: /* SVGA3dTextureArgData */
- /* @todo; not used by MesaGL */
+ /** @todo not used by MesaGL */
Log(("vmsvga3dSetTextureState: colorop/alphaop not yet supported!!\n"));
break;
#if 0
@@ -5043,13 +5187,13 @@ int vmsvga3dSetTextureState(PVGASTATE pThis, uint32_t cid, uint32_t cTextureStat
vmsvgaColor2GLFloatArray(pTextureState[i].value, &color[0], &color[1], &color[2], &color[3]);
- glTexParameterfv(GL_TEXTURE_2D /* @todo flexible type */, GL_TEXTURE_BORDER_COLOR, color); /* Identical; default 0.0 identical too */
+ glTexParameterfv(GL_TEXTURE_2D /** @todo flexible type */, GL_TEXTURE_BORDER_COLOR, color); /* Identical; default 0.0 identical too */
VMSVGA3D_CHECK_LAST_ERROR(pState, pContext);
break;
}
case SVGA3D_TS_TEXTURE_LOD_BIAS: /* float */
- glTexParameterf(GL_TEXTURE_2D /* @todo flexible type */, GL_TEXTURE_LOD_BIAS, pTextureState[i].value); /* Identical; default 0.0 identical too */
+ glTexParameterf(GL_TEXTURE_2D /** @todo flexible type */, GL_TEXTURE_LOD_BIAS, pTextureState[i].value); /* Identical; default 0.0 identical too */
VMSVGA3D_CHECK_LAST_ERROR(pState, pContext);
break;
@@ -5085,7 +5229,7 @@ int vmsvga3dSetTextureState(PVGASTATE pThis, uint32_t cid, uint32_t cTextureStat
if (textureType != ~0U)
{
- glTexParameteri(GL_TEXTURE_2D /* @todo flexible type */, textureType, val);
+ glTexParameteri(GL_TEXTURE_2D /** @todo flexible type */, textureType, val);
VMSVGA3D_CHECK_LAST_ERROR(pState, pContext);
}
}
@@ -5145,7 +5289,7 @@ int vmsvga3dSetMaterial(PVGASTATE pThis, uint32_t cid, SVGA3dFace face, SVGA3dMa
return VINF_SUCCESS;
}
-/* @todo Move into separate library as we are using logic from Wine here. */
+/** @todo Move into separate library as we are using logic from Wine here. */
int vmsvga3dSetLightData(PVGASTATE pThis, uint32_t cid, uint32_t index, SVGA3dLightData *pData)
{
PVMSVGA3DCONTEXT pContext;
@@ -5222,7 +5366,7 @@ int vmsvga3dSetLightData(PVGASTATE pThis, uint32_t cid, uint32_t index, SVGA3dLi
glLightf(GL_LIGHT0 + index, GL_QUADRATIC_ATTENUATION, (QuadAttenuation < pData->attenuation2) ? pData->attenuation2 : QuadAttenuation);
VMSVGA3D_CHECK_LAST_ERROR_WARN(pState, pContext);
- /* @todo range */
+ /** @todo range */
break;
}
@@ -5290,7 +5434,7 @@ int vmsvga3dSetLightData(PVGASTATE pThis, uint32_t cid, uint32_t index, SVGA3dLi
glLightf(GL_LIGHT0 + index, GL_QUADRATIC_ATTENUATION, (QuadAttenuation < pData->attenuation2) ? pData->attenuation2 : QuadAttenuation);
VMSVGA3D_CHECK_LAST_ERROR_WARN(pState, pContext);
- /* @todo range */
+ /** @todo range */
break;
}
@@ -5384,7 +5528,7 @@ int vmsvga3dSetViewPort(PVGASTATE pThis, uint32_t cid, SVGA3dRect *pRect)
pContext->state.RectViewPort = *pRect;
pContext->state.u32UpdateFlags |= VMSVGA3D_UPDATE_VIEWPORT;
- /* @todo y-inversion for partial viewport coordinates? */
+ /** @todo y-inversion for partial viewport coordinates? */
glViewport(pRect->x, pRect->y, pRect->w, pRect->h);
VMSVGA3D_CHECK_LAST_ERROR(pState, pContext);
@@ -5513,7 +5657,7 @@ int vmsvga3dCommandClear(PVGASTATE pThis, uint32_t cid, SVGA3dClearFlag clearFla
}
if (clearFlag & SVGA3D_CLEAR_STENCIL)
{
- /* @todo possibly the same problem as with glDepthMask */
+ /** @todo possibly the same problem as with glDepthMask */
glClearStencil(stencil);
mask |= GL_STENCIL_BUFFER_BIT;
}
@@ -5625,13 +5769,13 @@ int vmsvga3dVertexDecl2OGL(SVGA3dVertexArrayIdentity &identity, GLint &size, GLe
case SVGA3D_DECLTYPE_UDEC3:
size = 3;
- type = GL_UNSIGNED_INT_2_10_10_10_REV; /* @todo correct? */
+ type = GL_UNSIGNED_INT_2_10_10_10_REV; /** @todo correct? */
break;
case SVGA3D_DECLTYPE_DEC3N:
normalized = true;
size = 3;
- type = GL_INT_2_10_10_10_REV; /* @todo correct? */
+ type = GL_INT_2_10_10_10_REV; /** @todo correct? */
break;
case SVGA3D_DECLTYPE_FLOAT16_2:
@@ -5714,7 +5858,7 @@ int vmsvga3dDrawPrimitivesProcessVertexDecls(PVMSVGA3DSTATE pState, PVMSVGA3DCON
VMSVGA3D_CHECK_LAST_ERROR(pState, pContext);
Assert(pVertexSurface->fDirty);
- /* @todo rethink usage dynamic/static */
+ /** @todo rethink usage dynamic/static */
pState->ext.glBufferData(GL_ARRAY_BUFFER, pVertexSurface->pMipmapLevels[0].cbSurface, pVertexSurface->pMipmapLevels[0].pSurfaceData, GL_DYNAMIC_DRAW);
VMSVGA3D_CHECK_LAST_ERROR(pState, pContext);
@@ -5755,7 +5899,7 @@ int vmsvga3dDrawPrimitivesProcessVertexDecls(PVMSVGA3DSTATE pState, PVMSVGA3DCON
pState->ext.glVertexAttribPointer(index, size, type, normalized, pVertexDecl[iVertex].array.stride,
(const GLvoid *)(uintptr_t)pVertexDecl[iVertex].array.offset);
VMSVGA3D_CHECK_LAST_ERROR(pState, pContext);
- /* case SVGA3D_DECLUSAGE_COLOR: @todo color component order not identical!! test GL_BGRA!! */
+ /** @todo case SVGA3D_DECLUSAGE_COLOR: color component order not identical!! test GL_BGRA!! */
}
else
{
@@ -5891,7 +6035,7 @@ int vmsvga3dDrawPrimitivesCleanupVertexDecls(PVMSVGA3DSTATE pState, PVMSVGA3DCON
break;
case SVGA3D_DECLUSAGE_POSITIONT:
break;
- case SVGA3D_DECLUSAGE_COLOR: /* @todo color component order not identical!! */
+ case SVGA3D_DECLUSAGE_COLOR: /** @todo color component order not identical!! */
glDisableClientState(GL_COLOR_ARRAY);
VMSVGA3D_CHECK_LAST_ERROR(pState, pContext);
break;
@@ -5926,7 +6070,7 @@ int vmsvga3dDrawPrimitives(PVGASTATE pThis, uint32_t cid, uint32_t numVertexDecl
AssertReturn(numVertexDecls && numVertexDecls <= SVGA3D_MAX_VERTEX_ARRAYS, VERR_INVALID_PARAMETER);
AssertReturn(numRanges && numRanges <= SVGA3D_MAX_DRAW_PRIMITIVE_RANGES, VERR_INVALID_PARAMETER);
AssertReturn(!cVertexDivisor || cVertexDivisor == numVertexDecls, VERR_INVALID_PARAMETER);
- /* @todo */
+ /** @todo Non-zero cVertexDivisor */
Assert(!cVertexDivisor);
if ( cid >= pState->cContexts
@@ -6020,7 +6164,7 @@ int vmsvga3dDrawPrimitives(PVGASTATE pThis, uint32_t cid, uint32_t numVertexDecl
Assert(pIndexSurface->fDirty);
- /* @todo rethink usage dynamic/static */
+ /** @todo rethink usage dynamic/static */
pState->ext.glBufferData(GL_ELEMENT_ARRAY_BUFFER, pIndexSurface->pMipmapLevels[0].cbSurface, pIndexSurface->pMipmapLevels[0].pSurfaceData, GL_DYNAMIC_DRAW);
VMSVGA3D_CHECK_LAST_ERROR(pState, pContext);
@@ -6049,7 +6193,7 @@ int vmsvga3dDrawPrimitives(PVGASTATE pThis, uint32_t cid, uint32_t numVertexDecl
}
else
{
- Assert(pRange[iPrimitive].indexBias >= 0); /* @todo */
+ Assert(pRange[iPrimitive].indexBias >= 0); /** @todo indexBias */
Assert(pRange[iPrimitive].indexWidth == pRange[iPrimitive].indexArray.stride);
/* Render with an index buffer */
diff --git a/src/VBox/Devices/Graphics/DevVGA-SVGA3d-savedstate.cpp b/src/VBox/Devices/Graphics/DevVGA-SVGA3d-savedstate.cpp
index 86b35dc..b5d976e 100644
--- a/src/VBox/Devices/Graphics/DevVGA-SVGA3d-savedstate.cpp
+++ b/src/VBox/Devices/Graphics/DevVGA-SVGA3d-savedstate.cpp
@@ -16,9 +16,9 @@
*/
-/*******************************************************************************
-* Header Files *
-*******************************************************************************/
+/*********************************************************************************************************************************
+* Header Files *
+*********************************************************************************************************************************/
#define LOG_GROUP LOG_GROUP_DEV_VMSVGA
#include <VBox/vmm/pdmdev.h>
#include <VBox/err.h>
diff --git a/src/VBox/Devices/Graphics/DevVGA-SVGA3d-shared.cpp b/src/VBox/Devices/Graphics/DevVGA-SVGA3d-shared.cpp
index 18bc36a..3e1eeef 100644
--- a/src/VBox/Devices/Graphics/DevVGA-SVGA3d-shared.cpp
+++ b/src/VBox/Devices/Graphics/DevVGA-SVGA3d-shared.cpp
@@ -16,9 +16,9 @@
*/
-/*******************************************************************************
-* Header Files *
-*******************************************************************************/
+/*********************************************************************************************************************************
+* Header Files *
+*********************************************************************************************************************************/
#define LOG_GROUP LOG_GROUP_DEV_VMSVGA
#include <VBox/vmm/pdmdev.h>
#include <VBox/version.h>
@@ -167,7 +167,6 @@ DECLCALLBACK(int) vmsvga3dWindowThread(RTTHREAD ThreadSelf, void *pvUser)
RTSemEventSignal(WndRequestSem);
continue;
}
- else
if (msg.message == WM_VMSVGA3D_DESTROYWINDOW)
{
BOOL ret = DestroyWindow((HWND)msg.wParam);
@@ -176,7 +175,6 @@ DECLCALLBACK(int) vmsvga3dWindowThread(RTTHREAD ThreadSelf, void *pvUser)
RTSemEventSignal(WndRequestSem);
continue;
}
- else
if (msg.message == WM_VMSVGA3D_RESIZEWINDOW)
{
HWND hwnd = (HWND)msg.wParam;
@@ -221,13 +219,52 @@ static LONG WINAPI vmsvga3dWndProc(HWND hwnd, UINT uMsg, WPARAM wParam, LPARAM l
switch (uMsg)
{
case WM_CLOSE:
+ Log7(("vmsvga3dWndProc(%p): WM_CLOSE\n", hwnd));
break;
case WM_DESTROY:
+ Log7(("vmsvga3dWndProc(%p): WM_DESTROY\n", hwnd));
break;
case WM_NCHITTEST:
+ Log7(("vmsvga3dWndProc(%p): WM_NCHITTEST\n", hwnd));
return HTNOWHERE;
+
+# if 0 /* flicker experiment, no help here. */
+ case WM_PAINT:
+ Log7(("vmsvga3dWndProc(%p): WM_PAINT %p %p\n", hwnd, wParam, lParam));
+ ValidateRect(hwnd, NULL);
+ return 0;
+ case WM_ERASEBKGND:
+ Log7(("vmsvga3dWndProc(%p): WM_ERASEBKGND %p %p\n", hwnd, wParam, lParam));
+ return TRUE;
+ case WM_NCPAINT:
+ Log7(("vmsvga3dWndProc(%p): WM_NCPAINT %p %p\n", hwnd, wParam, lParam));
+ break;
+ case WM_WINDOWPOSCHANGING:
+ {
+ PWINDOWPOS pPos = (PWINDOWPOS)lParam;
+ Log7(("vmsvga3dWndProc(%p): WM_WINDOWPOSCHANGING %p %p pos=(%d,%d) size=(%d,%d) flags=%#x\n",
+ hwnd, wParam, lParam, pPos->x, pPos->y, pPos->cx, pPos->cy, pPos->flags));
+ break;
+ }
+ case WM_WINDOWPOSCHANGED:
+ {
+ PWINDOWPOS pPos = (PWINDOWPOS)lParam;
+ Log7(("vmsvga3dWndProc(%p): WM_WINDOWPOSCHANGED %p %p pos=(%d,%d) size=(%d,%d) flags=%#x\n",
+ hwnd, wParam, lParam, pPos->x, pPos->y, pPos->cx, pPos->cy, pPos->flags));
+ break;
+ }
+ case WM_MOVE:
+ Log7(("vmsvga3dWndProc(%p): WM_MOVE %p %p\n", hwnd, wParam, lParam));
+ break;
+ case WM_SIZE:
+ Log7(("vmsvga3dWndProc(%p): WM_SIZE %p %p\n", hwnd, wParam, lParam));
+ break;
+
+ default:
+ Log7(("vmsvga3dWndProc(%p): %#x %p %p\n", hwnd, uMsg, wParam, lParam));
+# endif
}
return DefWindowProc(hwnd, uMsg, wParam, lParam);
}
diff --git a/src/VBox/Devices/Graphics/DevVGA-SVGA3d-win.cpp b/src/VBox/Devices/Graphics/DevVGA-SVGA3d-win.cpp
index 1192bce..aeb48d8 100644
--- a/src/VBox/Devices/Graphics/DevVGA-SVGA3d-win.cpp
+++ b/src/VBox/Devices/Graphics/DevVGA-SVGA3d-win.cpp
@@ -16,9 +16,9 @@
*/
-/*******************************************************************************
-* Header Files *
-*******************************************************************************/
+/*********************************************************************************************************************************
+* Header Files *
+*********************************************************************************************************************************/
#define LOG_GROUP LOG_GROUP_DEV_VMSVGA
#include <VBox/vmm/pdmdev.h>
#include <VBox/version.h>
@@ -51,9 +51,9 @@
#endif
-/*******************************************************************************
-* Defined Constants And Macros *
-*******************************************************************************/
+/*********************************************************************************************************************************
+* Defined Constants And Macros *
+*********************************************************************************************************************************/
/* Enable to render the result of DrawPrimitive in a seperate window. */
//#define DEBUG_GFX_WINDOW
@@ -61,9 +61,9 @@
#define FOURCC_NULL (D3DFORMAT)MAKEFOURCC('N', 'U', 'L', 'L')
-/*******************************************************************************
-* Structures and Typedefs *
-*******************************************************************************/
+/*********************************************************************************************************************************
+* Structures and Typedefs *
+*********************************************************************************************************************************/
typedef struct
{
@@ -73,9 +73,9 @@ typedef struct
} VMSVGA3DFORMATSUPPORT;
-/*******************************************************************************
-* Global Variables *
-*******************************************************************************/
+/*********************************************************************************************************************************
+* Global Variables *
+*********************************************************************************************************************************/
static VMSVGA3DFORMATSUPPORT const g_aFormatSupport[] =
{
{
@@ -155,9 +155,9 @@ static VMSVGA3DFORMATSUPPORT const g_aFeatureReject[] =
};
-/*******************************************************************************
-* Internal Functions *
-*******************************************************************************/
+/*********************************************************************************************************************************
+* Internal Functions *
+*********************************************************************************************************************************/
static void vmsvgaDumpD3DCaps(D3DCAPS9 *pCaps);
@@ -1275,7 +1275,7 @@ int vmsvga3dSurfaceFlush(PVGASTATE pThis, PVMSVGA3DSURFACE pSurface)
return VINF_SUCCESS;
}
-int vmsvga3dSurfaceCopy(PVGASTATE pThis, SVGA3dSurfaceImageId dest, SVGA3dSurfaceImageId src,
+int vmsvga3dSurfaceCopy(PVGASTATE pThis, SVGA3dSurfaceImageId dest, SVGA3dSurfaceImageId src,
uint32_t cCopyBoxes, SVGA3dCopyBox *pBox)
{
PVMSVGA3DSTATE pState = pThis->svga.p3dState;
@@ -2185,69 +2185,178 @@ int vmsvga3dCommandPresent(PVGASTATE pThis, uint32_t sid, uint32_t cRects, SVGA3
else
pSurfaceD3D = pSurface->u.pSurface;
- /* Source surface different size? */
- if (pSurface->pMipmapLevels[0].size.width != pThis->svga.uWidth ||
- pSurface->pMipmapLevels[0].size.height != pThis->svga.uHeight)
- {
- float xMultiplier = (float)pSurface->pMipmapLevels[0].size.width / (float)pThis->svga.uWidth;
- float yMultiplier = (float)pSurface->pMipmapLevels[0].size.height / (float)pThis->svga.uHeight;
+ /* Read the destination viewport specs in one go to try avoid some unnecessary update races. */
+ VMSVGAVIEWPORT const DstViewport = pThis->svga.viewport;
+ ASMCompilerBarrier(); /* paranoia */
+ Assert(DstViewport.yHighWC >= DstViewport.yLowWC);
- srcViewPort.x = (uint32_t)((float)pThis->svga.viewport.x * xMultiplier);
- srcViewPort.y = (uint32_t)((float)pThis->svga.viewport.y * yMultiplier);
- srcViewPort.cx = (uint32_t)((float)pThis->svga.viewport.cx * xMultiplier);
- srcViewPort.cy = (uint32_t)((float)pThis->svga.viewport.cy * yMultiplier);
- }
+ /* If there are no recangles specified, just grab a screenful. */
+ SVGA3dCopyRect DummyRect;
+ if (cRects != 0)
+ { /* likely */ }
else
{
- srcViewPort.x = pThis->svga.viewport.x;
- srcViewPort.y = pThis->svga.viewport.y;
- srcViewPort.cx = pThis->svga.viewport.cx;
- srcViewPort.cy = pThis->svga.viewport.cy;
+ /** @todo Find the usecase for this or check what the original device does.
+ * The original code was doing some scaling based on the surface
+ * size... */
+# ifdef DEBUG_bird
+ AssertMsgFailed(("No rects to present. Who is doing that and what do they actually expect?\n"));
+# endif
+ DummyRect.x = DummyRect.srcx = 0;
+ DummyRect.y = DummyRect.srcy = 0;
+ DummyRect.w = pThis->svga.uWidth;
+ DummyRect.h = pThis->svga.uHeight;
+ cRects = 1;
+ pRect = &DummyRect;
}
- /* @note the viewport doesn't affect blitting. */
- if (cRects == 0)
- {
- RECT rectDest, rectSrc;
-
- rectSrc.left = srcViewPort.x;
- rectSrc.top = srcViewPort.y;
- rectSrc.right = rectSrc.left + srcViewPort.cx;
- rectSrc.bottom = rectSrc.top + srcViewPort.cy;
- rectDest.left = 0;
- rectDest.top = 0;
- rectDest.right = pThis->svga.viewport.cx;
- rectDest.bottom = pThis->svga.viewport.cy;
- hr = pContext->pDevice->StretchRect(pSurfaceD3D, &rectSrc, pBackBuffer, &rectDest, D3DTEXF_NONE);
- }
- else
+ /*
+ * Blit the surface rectangle(s) to the back buffer.
+ */
+ uint32_t const cxSurface = pSurface->pMipmapLevels[0].size.width;
+ uint32_t const cySurface = pSurface->pMipmapLevels[0].size.height;
+ for (uint32_t i = 0; i < cRects; i++)
{
- for (uint32_t i = 0; i < cRects; i++)
+ SVGA3dCopyRect ClippedRect = pRect[i];
+
+ /*
+ * Do some sanity checking and limit width and height, all so we
+ * don't need to think about wrap-arounds below.
+ */
+ if (RT_LIKELY( ClippedRect.w
+ && ClippedRect.x < VMSVGA_MAX_X
+ && ClippedRect.srcx < VMSVGA_MAX_X
+ && ClippedRect.h
+ && ClippedRect.y < VMSVGA_MAX_Y
+ && ClippedRect.srcy < VMSVGA_MAX_Y
+ ))
+ { /* likely */ }
+ else
+ continue;
+
+ if (RT_LIKELY(ClippedRect.w < VMSVGA_MAX_Y))
+ { /* likely */ }
+ else
+ ClippedRect.w = VMSVGA_MAX_Y;
+ if (RT_LIKELY(ClippedRect.w < VMSVGA_MAX_Y))
+ { /* likely */ }
+ else
+ ClippedRect.w = VMSVGA_MAX_Y;
+
+ /*
+ * Source surface clipping (paranoia). Straight forward.
+ */
+ if (RT_LIKELY(ClippedRect.srcx < cxSurface))
+ { /* likely */ }
+ else
+ continue;
+ if (RT_LIKELY(ClippedRect.srcx + ClippedRect.w <= cxSurface))
+ { /* likely */ }
+ else
{
- RECT rectSrc;
- RECT rectDest;
+ AssertFailed(); /* remove if annoying. */
+ ClippedRect.w = cxSurface - ClippedRect.srcx;
+ }
- if ( pRect[i].x + pRect[i].w <= pThis->svga.viewport.x
- || pThis->svga.viewport.x + pThis->svga.viewport.cx <= pRect[i].x
- || pRect[i].y + pRect[i].h <= pThis->svga.viewport.y
- || pThis->svga.viewport.y + pThis->svga.viewport.cy <= pRect[i].y)
+ if (RT_LIKELY(ClippedRect.srcy < cySurface))
+ { /* likely */ }
+ else
+ continue;
+ if (RT_LIKELY(ClippedRect.srcy + ClippedRect.h <= cySurface))
+ { /* likely */ }
+ else
+ {
+ AssertFailed(); /* remove if annoying. */
+ ClippedRect.h = cySurface - ClippedRect.srcy;
+ }
+
+ /*
+ * Destination viewport clipping.
+ *
+ * This is very straight forward compared to OpenGL. There is no Y
+ * inversion anywhere and all the coordinate systems are the same.
+ */
+ /* X */
+ if (ClippedRect.x >= DstViewport.x)
+ {
+ if (ClippedRect.x + ClippedRect.w <= DstViewport.xRight)
+ { /* typical */ }
+ else if (ClippedRect.x < DstViewport.xRight)
+ ClippedRect.w = DstViewport.xRight - ClippedRect.x;
+ else
+ continue;
+ }
+ else
+ {
+ uint32_t cxAdjust = DstViewport.x - ClippedRect.x;
+ if (cxAdjust < ClippedRect.w)
{
- /* Intersection is empty; skip */
+ ClippedRect.w -= cxAdjust;
+ ClippedRect.x += cxAdjust;
+ ClippedRect.srcx += cxAdjust;
+ }
+ else
+ continue;
+
+ if (ClippedRect.x + ClippedRect.w <= DstViewport.xRight)
+ { /* typical */ }
+ else
+ ClippedRect.w = DstViewport.xRight - ClippedRect.x;
+ }
+
+ /* Y */
+ if (ClippedRect.y >= DstViewport.y)
+ {
+ if (ClippedRect.y + ClippedRect.h <= DstViewport.y + DstViewport.cy)
+ { /* typical */ }
+ else if (ClippedRect.x < DstViewport.y + DstViewport.cy)
+ ClippedRect.h = DstViewport.y + DstViewport.cy - ClippedRect.y;
+ else
continue;
+ }
+ else
+ {
+ uint32_t cyAdjust = DstViewport.y - ClippedRect.y;
+ if (cyAdjust < ClippedRect.h)
+ {
+ ClippedRect.h -= cyAdjust;
+ ClippedRect.y += cyAdjust;
+ ClippedRect.srcy += cyAdjust;
}
+ else
+ continue;
- rectSrc.left = RT_MAX(pRect[i].srcx, srcViewPort.x);
- rectSrc.top = RT_MAX(pRect[i].srcy, srcViewPort.y);
- rectSrc.right = RT_MIN(pRect[i].srcx + pRect[i].w, srcViewPort.x + srcViewPort.cx);
- rectSrc.bottom = RT_MIN(pRect[i].srcy + pRect[i].h, srcViewPort.y + srcViewPort.cy);
- rectDest.left = RT_MAX(pRect[i].x, pThis->svga.viewport.x) - pThis->svga.viewport.x;
- rectDest.top = RT_MAX(pRect[i].y, pThis->svga.viewport.y) - pThis->svga.viewport.y;
- rectDest.right = RT_MIN(pRect[i].x + pRect[i].w, pThis->svga.viewport.x + pThis->svga.viewport.cx) - pThis->svga.viewport.x;
- rectDest.bottom = RT_MIN(pRect[i].y + pRect[i].h, pThis->svga.viewport.y + pThis->svga.viewport.cy) - pThis->svga.viewport.y;
-
- hr = pContext->pDevice->StretchRect(pSurfaceD3D, &rectSrc, pBackBuffer, &rectDest, D3DTEXF_NONE);
- AssertBreak(hr == D3D_OK);
+ if (ClippedRect.y + ClippedRect.h <= DstViewport.y + DstViewport.cy)
+ { /* typical */ }
+ else
+ ClippedRect.h = DstViewport.y + DstViewport.cy - ClippedRect.y;
}
+
+ /* Calc source rectangle. */
+ RECT SrcRect;
+ SrcRect.left = ClippedRect.srcx;
+ SrcRect.right = ClippedRect.srcx + ClippedRect.w;
+ SrcRect.top = ClippedRect.srcy;
+ SrcRect.bottom = ClippedRect.srcy + ClippedRect.h;
+
+ /* Calc destination rectangle. */
+ RECT DstRect;
+ DstRect.left = ClippedRect.x;
+ DstRect.right = ClippedRect.x + ClippedRect.w;
+ DstRect.top = ClippedRect.y;
+ DstRect.bottom = ClippedRect.y + ClippedRect.h;
+
+ /* Adjust for viewport. */
+ DstRect.left -= DstViewport.x;
+ DstRect.right -= DstViewport.x;
+ DstRect.bottom -= DstViewport.y;
+ DstRect.top -= DstViewport.y;
+
+ Log(("SrcRect: (%d,%d)(%d,%d) DstRect: (%d,%d)(%d,%d)\n",
+ SrcRect.left, SrcRect.bottom, SrcRect.right, SrcRect.top,
+ DstRect.left, DstRect.bottom, DstRect.right, DstRect.top));
+ hr = pContext->pDevice->StretchRect(pSurfaceD3D, &SrcRect, pBackBuffer, &DstRect, D3DTEXF_NONE);
+ AssertBreak(hr == D3D_OK);
}
if (pSurface->flags & SVGA3D_SURFACE_HINT_TEXTURE)
diff --git a/src/VBox/Devices/Graphics/DevVGA-SVGA3d.cpp b/src/VBox/Devices/Graphics/DevVGA-SVGA3d.cpp
index ce477fa..b53119c 100644
--- a/src/VBox/Devices/Graphics/DevVGA-SVGA3d.cpp
+++ b/src/VBox/Devices/Graphics/DevVGA-SVGA3d.cpp
@@ -16,9 +16,9 @@
*/
-/*******************************************************************************
-* Header Files *
-*******************************************************************************/
+/*********************************************************************************************************************************
+* Header Files *
+*********************************************************************************************************************************/
#define LOG_GROUP LOG_GROUP_DEV_VMSVGA
#include <VBox/vmm/pdmdev.h>
#include <VBox/err.h>
diff --git a/src/VBox/Devices/Graphics/DevVGA.cpp b/src/VBox/Devices/Graphics/DevVGA.cpp
index 7030337..b829cd1 100644
--- a/src/VBox/Devices/Graphics/DevVGA.cpp
+++ b/src/VBox/Devices/Graphics/DevVGA.cpp
@@ -40,9 +40,10 @@
* THE SOFTWARE.
*/
-/*******************************************************************************
-* Defined Constants And Macros *
-*******************************************************************************/
+
+/*********************************************************************************************************************************
+* Defined Constants And Macros *
+*********************************************************************************************************************************/
/* WARNING!!! All defines that affect VGAState should be placed to DevVGA.h !!!
* NEVER place them here as this would lead to VGASTATE inconsistency
@@ -110,9 +111,9 @@
#define VBOX_WITH_VMSVGA_BACKUP_VGA_FB 1
-/*******************************************************************************
-* Header Files *
-*******************************************************************************/
+/*********************************************************************************************************************************
+* Header Files *
+*********************************************************************************************************************************/
#define LOG_GROUP LOG_GROUP_DEV_VGA
#include <VBox/vmm/pdmdev.h>
#include <VBox/vmm/pgm.h>
@@ -148,9 +149,10 @@
#include "vmsvga/svga_reg.h"
#endif
-/*******************************************************************************
-* Structures and Typedefs *
-*******************************************************************************/
+
+/*********************************************************************************************************************************
+* Structures and Typedefs *
+*********************************************************************************************************************************/
#pragma pack(1)
/** BMP File Format Bitmap Header. */
@@ -262,9 +264,10 @@ typedef WINHDR *PWINHDR;
#define LOGO_MAX_HEIGHT 480
#define LOGO_MAX_SIZE LOGO_MAX_WIDTH * LOGO_MAX_HEIGHT * 4
-/*******************************************************************************
-* Internal Functions *
-*******************************************************************************/
+
+/*********************************************************************************************************************************
+* Internal Functions *
+*********************************************************************************************************************************/
#ifndef IN_RING3
RT_C_DECLS_BEGIN
DECLEXPORT(FNPGMRZPHYSPFHANDLER) vgaLbfAccessPfHandler;
@@ -273,9 +276,9 @@ RT_C_DECLS_END
PGM_ALL_CB_DECL(FNPGMPHYSHANDLER) vgaLFBAccessHandler;
-/*******************************************************************************
-* Global Variables *
-*******************************************************************************/
+/*********************************************************************************************************************************
+* Global Variables *
+*********************************************************************************************************************************/
/* "Press F12 to select boot device." bitmap. */
static const uint8_t g_abLogoF12BootText[] =
{
@@ -2425,12 +2428,13 @@ static int vga_draw_graphic(PVGASTATE pThis, bool full_update, bool fFailOnResiz
{
/* Do not update the destination buffer if it is not big enough.
* Can happen if the resize request was ignored by the driver.
+ * Compare with 'disp_width', because it is what the framebuffer has been resized to.
*/
- if ( pDrv->cx != (uint32_t)width
+ if ( pDrv->cx != (uint32_t)disp_width
|| pDrv->cy != (uint32_t)height)
{
LogRel(("Framebuffer mismatch: vga %dx%d, drv %dx%d!!!\n",
- width, height,
+ disp_width, height,
pDrv->cx, pDrv->cy));
return VINF_SUCCESS;
}
diff --git a/src/VBox/Devices/Graphics/DevVGA.h b/src/VBox/Devices/Graphics/DevVGA.h
index a636ee4..e3b12e1 100644
--- a/src/VBox/Devices/Graphics/DevVGA.h
+++ b/src/VBox/Devices/Graphics/DevVGA.h
@@ -230,6 +230,26 @@ typedef struct
uint32_t uPass;
} VMSVGA_STATE_LOAD, *PVMSVGA_STATE_LOAD;
+/** Host screen viewport.
+ * (4th quadrant with negated Y values - usual Windows and X11 world view.) */
+typedef struct VMSVGAVIEWPORT
+{
+ uint32_t x; /**< x coordinate (left). */
+ uint32_t y; /**< y coordinate (top). */
+ uint32_t cx; /**< width. */
+ uint32_t cy; /**< height. */
+ /** Right side coordinate (exclusive). Same as x + cx. */
+ uint32_t xRight;
+ /** First quadrant low y coordinate.
+ * Same as y + cy - 1 in window coordinates. */
+ uint32_t yLowWC;
+ /** First quadrant high y coordinate (exclusive) - yLowWC + cy.
+ * Same as y - 1 in window coordinates. */
+ uint32_t yHighWC;
+ /** Alignment padding. */
+ uint32_t uAlignment;
+} VMSVGAVIEWPORT;
+
/** Pointer to the private VMSVGA ring-3 state structure.
* @todo Still not entirely satisfired with the type name, but better than
* the previous lower/upper case only distinction. */
@@ -308,14 +328,10 @@ typedef struct VMSVGAState
uint32_t u32MaxWidth;
/** Maximum height supported. */
uint32_t u32MaxHeight;
- /** Viewport rectangle */
- struct
- {
- uint32_t x;
- uint32_t y;
- uint32_t cx;
- uint32_t cy;
- } viewport;
+ /** Viewport rectangle, i.e. what's currently visible of the target host
+ * window. This is usually (0,0)(uWidth,uHeight), but if the window is
+ * shrunk and scrolling applied, both the origin and size may differ. */
+ VMSVGAVIEWPORT viewport;
/** Action flags */
uint32_t u32ActionFlags;
/** SVGA 3d extensions enabled or not. */
@@ -401,7 +417,7 @@ typedef struct VGAState {
PPDMDEVINSRC pDevInsRC;
/** Pointer to the GC vram mapping. */
RCPTRTYPE(uint8_t *) vram_ptrRC;
- uint32_t PaddingMinus1;
+ uint32_t Padding1;
/** Pointer to the device instance - R3 Ptr. */
PPDMDEVINSR3 pDevInsR3;
@@ -442,12 +458,13 @@ typedef struct VGAState {
/** The R0 vram pointer... */
R0PTRTYPE(uint8_t *) vram_ptrR0;
-#ifdef VBOX_WITH_VMSVGA
# if HC_ARCH_BITS == 32
uint32_t Padding3;
# endif
+
+# ifdef VBOX_WITH_VMSVGA
VMSVGAState svga;
-#endif
+# endif
/** The number of monitors. */
uint32_t cMonitors;
@@ -468,13 +485,13 @@ typedef struct VGAState {
bool fRemappedVGA;
/** Whether to render the guest VRAM to the framebuffer memory. False only for some LFB modes. */
bool fRenderVRAM;
-#ifdef VBOX_WITH_VMSVGA
+# ifdef VBOX_WITH_VMSVGA
/* Whether the SVGA emulation is enabled or not. */
bool fVMSVGAEnabled;
- bool Padding1[1+4];
-#else
- bool Padding1[2+4];
-#endif
+ bool Padding4[1+4];
+# else
+ bool Padding4[2+4];
+# endif
/** Physical access type for the linear frame buffer dirty page tracking. */
PGMPHYSHANDLERTYPE hLfbAccessHandlerType;
@@ -680,7 +697,7 @@ int VBVAGetInfoViewAndScreen(PVGASTATE pVGAState, uint32_t u32ViewIndex, VBVAINF
uint32_t HGSMIReset (PHGSMIINSTANCE pIns);
# ifdef VBOX_WITH_VIDEOHWACCEL
-int vbvaVHWACommandCompleteAsync(PPDMIDISPLAYVBVACALLBACKS pInterface, PVBOXVHWACMD pCmd);
+DECLCALLBACK(int) vbvaVHWACommandCompleteAsync(PPDMIDISPLAYVBVACALLBACKS pInterface, PVBOXVHWACMD pCmd);
int vbvaVHWAConstruct (PVGASTATE pVGAState);
int vbvaVHWAReset (PVGASTATE pVGAState);
@@ -695,14 +712,16 @@ int vboxVBVASaveStateDone (PPDMDEVINS pDevIns, PSSMHANDLE pSSM);
#endif
# ifdef VBOX_WITH_CRHGSMI
-int vboxVDMACrHgsmiCommandCompleteAsync(PPDMIDISPLAYVBVACALLBACKS pInterface, PVBOXVDMACMD_CHROMIUM_CMD pCmd, int rc);
-int vboxVDMACrHgsmiControlCompleteAsync(PPDMIDISPLAYVBVACALLBACKS pInterface, PVBOXVDMACMD_CHROMIUM_CTL pCmd, int rc);
-int vboxCmdVBVACmdHostCtl(PPDMIDISPLAYVBVACALLBACKS pInterface,
- struct VBOXCRCMDCTL* pCmd, uint32_t cbCmd,
- PFNCRCTLCOMPLETION pfnCompletion,
- void *pvCompletion);
-int vboxCmdVBVACmdHostCtlSync(PPDMIDISPLAYVBVACALLBACKS pInterface,
- struct VBOXCRCMDCTL* pCmd, uint32_t cbCmd);
+DECLCALLBACK(int) vboxVDMACrHgsmiCommandCompleteAsync(PPDMIDISPLAYVBVACALLBACKS pInterface,
+ PVBOXVDMACMD_CHROMIUM_CMD pCmd, int rc);
+DECLCALLBACK(int) vboxVDMACrHgsmiControlCompleteAsync(PPDMIDISPLAYVBVACALLBACKS pInterface,
+ PVBOXVDMACMD_CHROMIUM_CTL pCmd, int rc);
+DECLCALLBACK(int) vboxCmdVBVACmdHostCtl(PPDMIDISPLAYVBVACALLBACKS pInterface,
+ struct VBOXCRCMDCTL* pCmd, uint32_t cbCmd,
+ PFNCRCTLCOMPLETION pfnCompletion,
+ void *pvCompletion);
+DECLCALLBACK(int) vboxCmdVBVACmdHostCtlSync(PPDMIDISPLAYVBVACALLBACKS pInterface,
+ struct VBOXCRCMDCTL* pCmd, uint32_t cbCmd);
# endif
int vboxVBVASaveStateExec (PPDMDEVINS pDevIns, PSSMHANDLE pSSM);
diff --git a/src/VBox/Devices/Graphics/DevVGA_VBVA.cpp b/src/VBox/Devices/Graphics/DevVGA_VBVA.cpp
index f46d8b3..228d9df 100644
--- a/src/VBox/Devices/Graphics/DevVGA_VBVA.cpp
+++ b/src/VBox/Devices/Graphics/DevVGA_VBVA.cpp
@@ -15,9 +15,10 @@
* hope that it will be useful, but WITHOUT ANY WARRANTY of any kind.
*/
-/*******************************************************************************
-* Header Files *
-*******************************************************************************/
+
+/*********************************************************************************************************************************
+* Header Files *
+*********************************************************************************************************************************/
#define LOG_GROUP LOG_GROUP_DEV_VGA
#include <VBox/vmm/pdmifs.h>
#include <VBox/vmm/pdmdev.h>
@@ -43,9 +44,10 @@
#define LOGVBVABUFFER(a) do {} while (0)
#endif
-/*******************************************************************************
-* Structures and Typedefs *
-*******************************************************************************/
+
+/*********************************************************************************************************************************
+* Structures and Typedefs *
+*********************************************************************************************************************************/
typedef struct VBVAPARTIALRECORD
{
uint8_t *pu8;
@@ -1347,7 +1349,7 @@ int vboxVBVASaveStateDone (PPDMDEVINS pDevIns, PSSMHANDLE pSSM)
return vbvaVHWAEnable(PDMINS_2_DATA(pDevIns, PVGASTATE), true);
}
-int vbvaVHWACommandCompleteAsync(PPDMIDISPLAYVBVACALLBACKS pInterface, PVBOXVHWACMD pCmd)
+DECLCALLBACK(int) vbvaVHWACommandCompleteAsync(PPDMIDISPLAYVBVACALLBACKS pInterface, PVBOXVHWACMD pCmd)
{
int rc;
Log(("VGA Command <<< Async rc %d %#p, %d\n", pCmd->rc, pCmd, pCmd->enmCmd));
diff --git a/src/VBox/Devices/Graphics/DevVGA_VDMA.cpp b/src/VBox/Devices/Graphics/DevVGA_VDMA.cpp
index f95c70c..0cbfcf4 100644
--- a/src/VBox/Devices/Graphics/DevVGA_VDMA.cpp
+++ b/src/VBox/Devices/Graphics/DevVGA_VDMA.cpp
@@ -3276,8 +3276,8 @@ static int vboxCmdVBVACmdCalloutProcess(struct VBOXVDMAHOST *pVdma, struct VBOXC
return rc;
}
-int vboxCmdVBVACmdHostCtlSync(PPDMIDISPLAYVBVACALLBACKS pInterface,
- struct VBOXCRCMDCTL* pCmd, uint32_t cbCmd)
+DECLCALLBACK(int) vboxCmdVBVACmdHostCtlSync(PPDMIDISPLAYVBVACALLBACKS pInterface,
+ struct VBOXCRCMDCTL* pCmd, uint32_t cbCmd)
{
PVGASTATE pVGAState = PPDMIDISPLAYVBVACALLBACKS_2_PVGASTATE(pInterface);
struct VBOXVDMAHOST *pVdma = pVGAState->pVdma;
diff --git a/src/VBox/Devices/Graphics/testcase/dump-vmwgfx.c b/src/VBox/Devices/Graphics/testcase/dump-vmwgfx.c
index e432f3f..0d144af 100644
--- a/src/VBox/Devices/Graphics/testcase/dump-vmwgfx.c
+++ b/src/VBox/Devices/Graphics/testcase/dump-vmwgfx.c
@@ -16,9 +16,9 @@
*/
-/*******************************************************************************
-* Header Files *
-*******************************************************************************/
+/*********************************************************************************************************************************
+* Header Files *
+*********************************************************************************************************************************/
#include <assert.h>
#include <dirent.h>
#include <errno.h>
@@ -33,9 +33,9 @@
#include <unistd.h>
-/*******************************************************************************
-* Defined Constants And Macros *
-*******************************************************************************/
+/*********************************************************************************************************************************
+* Defined Constants And Macros *
+*********************************************************************************************************************************/
#define DRM_IOCTL_BASE 'd'
#define DRM_COMMAND_BASE 0x40
#define DRM_VMW_GET_PARAM 0
@@ -58,9 +58,9 @@
#define DRM_VMW_PARAM_MAX_MOB_SIZE 10
-/*******************************************************************************
-* Structures and Typedefs *
-*******************************************************************************/
+/*********************************************************************************************************************************
+* Structures and Typedefs *
+*********************************************************************************************************************************/
struct drm_vmw_get_3d_cap_arg
{
uint64_t buffer;
@@ -98,9 +98,9 @@ typedef struct FLAGDESC
typedef FLAGDESC const *PCFLAGDESC;
-/*******************************************************************************
-* Global Variables *
-*******************************************************************************/
+/*********************************************************************************************************************************
+* Global Variables *
+*********************************************************************************************************************************/
/** The size of the 3D capabilities. */
static uint32_t g_cb3dCaps;
/** Set if the driver will return the new 3D capability format. */
diff --git a/src/VBox/Devices/Input/DevPS2.cpp b/src/VBox/Devices/Input/DevPS2.cpp
index b135a17..783759f 100644
--- a/src/VBox/Devices/Input/DevPS2.cpp
+++ b/src/VBox/Devices/Input/DevPS2.cpp
@@ -41,9 +41,10 @@
*
*/
-/*******************************************************************************
-* Header Files *
-*******************************************************************************/
+
+/*********************************************************************************************************************************
+* Header Files *
+*********************************************************************************************************************************/
#define LOG_GROUP LOG_GROUP_DEV_KBD
#include <VBox/vmm/pdmdev.h>
#include <iprt/assert.h>
@@ -63,9 +64,11 @@
#endif
#ifndef VBOX_DEVICE_STRUCT_TESTCASE
-/*******************************************************************************
-* Internal Functions *
-*******************************************************************************/
+
+
+/*********************************************************************************************************************************
+* Internal Functions *
+*********************************************************************************************************************************/
RT_C_DECLS_BEGIN
PDMBOTHCBDECL(int) kbdIOPortDataRead(PPDMDEVINS pDevIns, void *pvUser, RTIOPORT Port, uint32_t *pu32, unsigned cb);
PDMBOTHCBDECL(int) kbdIOPortDataWrite(PPDMDEVINS pDevIns, void *pvUser, RTIOPORT Port, uint32_t u32, unsigned cb);
diff --git a/src/VBox/Devices/Input/DrvKeyboardQueue.cpp b/src/VBox/Devices/Input/DrvKeyboardQueue.cpp
index 09a415d..a7d0fd0 100644
--- a/src/VBox/Devices/Input/DrvKeyboardQueue.cpp
+++ b/src/VBox/Devices/Input/DrvKeyboardQueue.cpp
@@ -16,9 +16,9 @@
*/
-/*******************************************************************************
-* Header Files *
-*******************************************************************************/
+/*********************************************************************************************************************************
+* Header Files *
+*********************************************************************************************************************************/
#define LOG_GROUP LOG_GROUP_DRV_KBD_QUEUE
#include <VBox/vmm/pdmdrv.h>
#include <iprt/assert.h>
@@ -28,9 +28,9 @@
-/*******************************************************************************
-* Structures and Typedefs *
-*******************************************************************************/
+/*********************************************************************************************************************************
+* Structures and Typedefs *
+*********************************************************************************************************************************/
/** Scancode translator state. */
typedef enum {
@@ -80,9 +80,9 @@ typedef struct DRVKBDQUEUEITEM
} DRVKBDQUEUEITEM, *PDRVKBDQUEUEITEM;
-/*******************************************************************************
-* Global Variables *
-*******************************************************************************/
+/*********************************************************************************************************************************
+* Global Variables *
+*********************************************************************************************************************************/
/** Lookup table for converting PC/XT scan codes to USB HID usage codes. */
static const uint8_t aScancode2Hid[] =
diff --git a/src/VBox/Devices/Input/DrvMouseQueue.cpp b/src/VBox/Devices/Input/DrvMouseQueue.cpp
index d091b2e..f8e9c66 100644
--- a/src/VBox/Devices/Input/DrvMouseQueue.cpp
+++ b/src/VBox/Devices/Input/DrvMouseQueue.cpp
@@ -16,9 +16,9 @@
*/
-/*******************************************************************************
-* Header Files *
-*******************************************************************************/
+/*********************************************************************************************************************************
+* Header Files *
+*********************************************************************************************************************************/
#define LOG_GROUP LOG_GROUP_DRV_MOUSE_QUEUE
#include <VBox/vmm/pdmdrv.h>
#include <iprt/assert.h>
@@ -28,9 +28,9 @@
-/*******************************************************************************
-* Structures and Typedefs *
-*******************************************************************************/
+/*********************************************************************************************************************************
+* Structures and Typedefs *
+*********************************************************************************************************************************/
/**
* Mouse queue driver instance data.
*
diff --git a/src/VBox/Devices/Input/PS2K.cpp b/src/VBox/Devices/Input/PS2K.cpp
index aef3716..88f0cda 100644
--- a/src/VBox/Devices/Input/PS2K.cpp
+++ b/src/VBox/Devices/Input/PS2K.cpp
@@ -32,9 +32,9 @@
*/
-/*******************************************************************************
-* Header Files *
-*******************************************************************************/
+/*********************************************************************************************************************************
+* Header Files *
+*********************************************************************************************************************************/
#define LOG_GROUP LOG_GROUP_DEV_KBD
#include <VBox/vmm/pdmdev.h>
#include <VBox/err.h>
@@ -44,9 +44,10 @@
#define IN_PS2K
#include "PS2Dev.h"
-/*******************************************************************************
-* Defined Constants And Macros *
-*******************************************************************************/
+
+/*********************************************************************************************************************************
+* Defined Constants And Macros *
+*********************************************************************************************************************************/
/** @name Keyboard commands sent by the system.
* @{ */
#define KCMD_LEDS 0xED
@@ -126,9 +127,10 @@
#define KBD_KEY_QUEUE_SIZE 64
#define KBD_CMD_QUEUE_SIZE 4
-/*******************************************************************************
-* Structures and Typedefs *
-*******************************************************************************/
+
+/*********************************************************************************************************************************
+* Structures and Typedefs *
+*********************************************************************************************************************************/
/** Scancode translator state. */
typedef enum {
@@ -458,13 +460,15 @@ static const key_def aPS2ModKeys[] = {
/* E7 */ {0x5C, 0x27, UNKN, KF_E0, T_U }, /* Key 128: Right GUI */
};
-/*******************************************************************************
-* Global Variables *
-*******************************************************************************/
-/*******************************************************************************
-* Internal Functions *
-*******************************************************************************/
+/*********************************************************************************************************************************
+* Global Variables *
+*********************************************************************************************************************************/
+
+
+/*********************************************************************************************************************************
+* Internal Functions *
+*********************************************************************************************************************************/
/**
diff --git a/src/VBox/Devices/Input/PS2M.cpp b/src/VBox/Devices/Input/PS2M.cpp
index 4451cdf..2a06ffd 100644
--- a/src/VBox/Devices/Input/PS2M.cpp
+++ b/src/VBox/Devices/Input/PS2M.cpp
@@ -93,9 +93,9 @@
*/
-/*******************************************************************************
-* Header Files *
-*******************************************************************************/
+/*********************************************************************************************************************************
+* Header Files *
+*********************************************************************************************************************************/
#define LOG_GROUP LOG_GROUP_DEV_KBD
#include <VBox/vmm/pdmdev.h>
#include <VBox/err.h>
@@ -105,9 +105,10 @@
#define IN_PS2M
#include "PS2Dev.h"
-/*******************************************************************************
-* Defined Constants And Macros *
-*******************************************************************************/
+
+/*********************************************************************************************************************************
+* Defined Constants And Macros *
+*********************************************************************************************************************************/
/** @name Auxiliary device commands sent by the system.
* @{ */
#define ACMD_SET_SCALE_11 0xE6 /* Set 1:1 scaling. */
@@ -163,9 +164,10 @@
#define AUX_EVT_QUEUE_SIZE 256
#define AUX_CMD_QUEUE_SIZE 8
-/*******************************************************************************
-* Structures and Typedefs *
-*******************************************************************************/
+
+/*********************************************************************************************************************************
+* Structures and Typedefs *
+*********************************************************************************************************************************/
DEF_PS2Q_TYPE(AuxEvtQ, AUX_EVT_QUEUE_SIZE);
DEF_PS2Q_TYPE(AuxCmdQ, AUX_CMD_QUEUE_SIZE);
@@ -293,14 +295,15 @@ AssertCompile(PS2M_STRUCT_FILLER >= sizeof(PS2M));
#ifndef VBOX_DEVICE_STRUCT_TESTCASE
-/*******************************************************************************
-* Global Variables *
-*******************************************************************************/
+
+/*********************************************************************************************************************************
+* Global Variables *
+*********************************************************************************************************************************/
-/*******************************************************************************
-* Internal Functions *
-*******************************************************************************/
+/*********************************************************************************************************************************
+* Internal Functions *
+*********************************************************************************************************************************/
/**
diff --git a/src/VBox/Devices/Input/UsbKbd.cpp b/src/VBox/Devices/Input/UsbKbd.cpp
index fbbafd9..be10fc9 100644
--- a/src/VBox/Devices/Input/UsbKbd.cpp
+++ b/src/VBox/Devices/Input/UsbKbd.cpp
@@ -45,9 +45,10 @@
*
*/
-/*******************************************************************************
-* Header Files *
-*******************************************************************************/
+
+/*********************************************************************************************************************************
+* Header Files *
+*********************************************************************************************************************************/
#define LOG_GROUP LOG_GROUP_USB_KBD
#include <VBox/vmm/pdmusb.h>
#include <VBox/log.h>
@@ -61,9 +62,9 @@
#include "VBoxDD.h"
-/*******************************************************************************
-* Defined Constants And Macros *
-*******************************************************************************/
+/*********************************************************************************************************************************
+* Defined Constants And Macros *
+*********************************************************************************************************************************/
/** @name USB HID string IDs
* @{ */
#define USBHID_STR_ID_MANUFACTURER 1
@@ -103,9 +104,10 @@
#define USBHID_MODIFIER_LAST 0xE7
/** @} */
-/*******************************************************************************
-* Structures and Typedefs *
-*******************************************************************************/
+
+/*********************************************************************************************************************************
+* Structures and Typedefs *
+*********************************************************************************************************************************/
/**
* The USB HID request state.
@@ -223,9 +225,10 @@ typedef struct USBHID
/** Pointer to the USB HID instance data. */
typedef USBHID *PUSBHID;
-/*******************************************************************************
-* Global Variables *
-*******************************************************************************/
+
+/*********************************************************************************************************************************
+* Global Variables *
+*********************************************************************************************************************************/
static const PDMUSBDESCCACHESTRING g_aUsbHidStrings_en_US[] =
{
{ USBHID_STR_ID_MANUFACTURER, "VirtualBox" },
@@ -375,9 +378,9 @@ static const PDMUSBDESCCACHE g_UsbHidDescCache =
};
-/*******************************************************************************
-* Internal Functions *
-*******************************************************************************/
+/*********************************************************************************************************************************
+* Internal Functions *
+*********************************************************************************************************************************/
/**
@@ -1212,7 +1215,7 @@ static DECLCALLBACK(int) usbHidUsbReset(PPDMUSBINS pUsbIns, bool fResetOnLinux)
/**
* @copydoc PDMUSBREG::pfnDestruct
*/
-static void usbHidDestruct(PPDMUSBINS pUsbIns)
+static DECLCALLBACK(void) usbHidDestruct(PPDMUSBINS pUsbIns)
{
PUSBHID pThis = PDMINS_2_DATA(pUsbIns, PUSBHID);
LogFlow(("usbHidDestruct/#%u:\n", pUsbIns->iInstance));
diff --git a/src/VBox/Devices/Input/UsbMouse.cpp b/src/VBox/Devices/Input/UsbMouse.cpp
index 30d1854..5287bbb 100644
--- a/src/VBox/Devices/Input/UsbMouse.cpp
+++ b/src/VBox/Devices/Input/UsbMouse.cpp
@@ -15,9 +15,10 @@
* hope that it will be useful, but WITHOUT ANY WARRANTY of any kind.
*/
-/*******************************************************************************
-* Header Files *
-*******************************************************************************/
+
+/*********************************************************************************************************************************
+* Header Files *
+*********************************************************************************************************************************/
#define LOG_GROUP LOG_GROUP_USB_MOUSE
#include <VBox/vmm/pdmusb.h>
#include <VBox/log.h>
@@ -31,9 +32,9 @@
#include "VBoxDD.h"
-/*******************************************************************************
-* Defined Constants And Macros *
-*******************************************************************************/
+/*********************************************************************************************************************************
+* Defined Constants And Macros *
+*********************************************************************************************************************************/
/** @name USB HID string IDs
* @{ */
#define USBHID_STR_ID_MANUFACTURER 1
@@ -56,9 +57,10 @@
#define USBHID_PID_MULTI_TOUCH 0x0022
/** @} */
-/*******************************************************************************
-* Structures and Typedefs *
-*******************************************************************************/
+
+/*********************************************************************************************************************************
+* Structures and Typedefs *
+*********************************************************************************************************************************/
/**
* The USB HID request state.
@@ -299,9 +301,10 @@ typedef struct USBHIDMT_REPORT_POINTER
} USBHIDMT_REPORT_POINTER;
#pragma pack()
-/*******************************************************************************
-* Global Variables *
-*******************************************************************************/
+
+/*********************************************************************************************************************************
+* Global Variables *
+*********************************************************************************************************************************/
static const PDMUSBDESCCACHESTRING g_aUsbHidStrings_en_US[] =
{
{ USBHID_STR_ID_MANUFACTURER, "VirtualBox" },
@@ -977,9 +980,9 @@ static const PDMUSBDESCCACHE g_UsbHidMTDescCache =
};
-/*******************************************************************************
-* Internal Functions *
-*******************************************************************************/
+/*********************************************************************************************************************************
+* Internal Functions *
+*********************************************************************************************************************************/
/**
* Initializes an URB queue.
@@ -2284,7 +2287,7 @@ static DECLCALLBACK(int) usbHidUsbReset(PPDMUSBINS pUsbIns, bool fResetOnLinux)
/**
* @copydoc PDMUSBREG::pfnDestruct
*/
-static void usbHidDestruct(PPDMUSBINS pUsbIns)
+static DECLCALLBACK(void) usbHidDestruct(PPDMUSBINS pUsbIns)
{
PUSBHID pThis = PDMINS_2_DATA(pUsbIns, PUSBHID);
LogRelFlow(("usbHidDestruct/#%u:\n", pUsbIns->iInstance));
diff --git a/src/VBox/Devices/Input/testcase/tstUsbMouse.cpp b/src/VBox/Devices/Input/testcase/tstUsbMouse.cpp
index 543dcee..c8081bc 100644
--- a/src/VBox/Devices/Input/testcase/tstUsbMouse.cpp
+++ b/src/VBox/Devices/Input/testcase/tstUsbMouse.cpp
@@ -15,9 +15,10 @@
* hope that it will be useful, but WITHOUT ANY WARRANTY of any kind.
*/
-/*******************************************************************************
-* Header Files *
-*******************************************************************************/
+
+/*********************************************************************************************************************************
+* Header Files *
+*********************************************************************************************************************************/
#include "VBoxDD.h"
#include <VBox/vmm/pdmdrv.h>
#include <iprt/alloc.h>
diff --git a/src/VBox/Devices/Makefile.kmk b/src/VBox/Devices/Makefile.kmk
index a1507a5..98aff80 100644
--- a/src/VBox/Devices/Makefile.kmk
+++ b/src/VBox/Devices/Makefile.kmk
@@ -1017,7 +1017,6 @@ if !defined(VBOX_ONLY_EXTPACKS) # Goes on almost to the end of the file.
# VBoxDDR0 (sysmod)
#
VBoxDDR0_TEMPLATE = VBoxR0
- VBoxDDR0_DEFS.darwin.x86= VBOX_WITH_2X_4GB_ADDR_SPACE_IN_R0 VBOX_WITH_2X_4GB_ADDR_SPACE
VBoxDDR0_DEFS = IN_RT_R0 $(if $(VBOX_WITH_HGCM),VBOX_WITH_HGCM,) # - WTF is IN_RT_R0 doing here?
VBoxDDR0_DEFS.win += VBOX_WITH_WIN_PARPORT_SUP
VBoxDDR0_INCS = build
diff --git a/src/VBox/Devices/Misc/VirtualKD.cpp b/src/VBox/Devices/Misc/VirtualKD.cpp
index 3b05e24..2bcd728 100644
--- a/src/VBox/Devices/Misc/VirtualKD.cpp
+++ b/src/VBox/Devices/Misc/VirtualKD.cpp
@@ -18,9 +18,10 @@
* hope that it will be useful, but WITHOUT ANY WARRANTY of any kind.
*/
-/*******************************************************************************
-* Header Files *
-*******************************************************************************/
+
+/*********************************************************************************************************************************
+* Header Files *
+*********************************************************************************************************************************/
#define LOG_GROUP LOG_GROUP_DEV_VIRTUALKD
#include <VBox/vmm/pdmdev.h>
#include <iprt/assert.h>
@@ -29,16 +30,16 @@
#include "VBoxDD.h"
-/*******************************************************************************
-* Defined Constants And Macros *
-*******************************************************************************/
+/*********************************************************************************************************************************
+* Defined Constants And Macros *
+*********************************************************************************************************************************/
#define IKDClient_InterfaceVersion 3
-/*******************************************************************************
-* Structures and Typedefs *
-*******************************************************************************/
+/*********************************************************************************************************************************
+* Structures and Typedefs *
+*********************************************************************************************************************************/
typedef struct VKDREQUESTHDR
{
@@ -75,9 +76,9 @@ typedef struct VIRTUALKD
} VIRTUALKD;
-/*******************************************************************************
-* Internal Functions *
-*******************************************************************************/
+/*********************************************************************************************************************************
+* Internal Functions *
+*********************************************************************************************************************************/
static DECLCALLBACK(int) vkdPortRead(PPDMDEVINS pDevIns, void *pvUser, RTIOPORT Port, uint32_t *pu32, unsigned cb)
{
diff --git a/src/VBox/Devices/Network/DevE1000.cpp b/src/VBox/Devices/Network/DevE1000.cpp
index a89cc5d..9388c4f 100644
--- a/src/VBox/Devices/Network/DevE1000.cpp
+++ b/src/VBox/Devices/Network/DevE1000.cpp
@@ -25,9 +25,10 @@
* hope that it will be useful, but WITHOUT ANY WARRANTY of any kind.
*/
-/*******************************************************************************
-* Header Files *
-*******************************************************************************/
+
+/*********************************************************************************************************************************
+* Header Files *
+*********************************************************************************************************************************/
#define LOG_GROUP LOG_GROUP_DEV_E1000
#include <iprt/crc.h>
#include <iprt/ctype.h>
diff --git a/src/VBox/Devices/Network/DevINIP.cpp b/src/VBox/Devices/Network/DevINIP.cpp
index 9792ddc..26e05d9 100644
--- a/src/VBox/Devices/Network/DevINIP.cpp
+++ b/src/VBox/Devices/Network/DevINIP.cpp
@@ -16,9 +16,9 @@
*/
-/*******************************************************************************
-* Header Files *
-*******************************************************************************/
+/*********************************************************************************************************************************
+* Header Files *
+*********************************************************************************************************************************/
#define LOG_GROUP LOG_GROUP_DEV_INIP
#include <iprt/cdefs.h> /* include early to allow RT_C_DECLS_BEGIN hack */
#include <iprt/mem.h> /* include anything of ours that the lwip headers use. */
@@ -54,17 +54,18 @@ RT_C_DECLS_END
#include "VBoxDD.h"
#include "VBoxLwipCore.h"
-/*******************************************************************************
-* Macros and Defines *
-*******************************************************************************/
+
+/*********************************************************************************************************************************
+* Macros and Defines *
+*********************************************************************************************************************************/
/** Maximum frame size this device can handle. */
#define DEVINIP_MAX_FRAME 1514
-/*******************************************************************************
-* Structures and Typedefs *
-*******************************************************************************/
+/*********************************************************************************************************************************
+* Structures and Typedefs *
+*********************************************************************************************************************************/
/**
* Internal Network IP stack device instance data.
@@ -117,9 +118,9 @@ typedef struct DEVINTNETIP
} DEVINTNETIP, *PDEVINTNETIP;
-/*******************************************************************************
-* Global Variables *
-*******************************************************************************/
+/*********************************************************************************************************************************
+* Global Variables *
+*********************************************************************************************************************************/
/**
* Pointer to the (only) instance data in this device.
@@ -141,12 +142,12 @@ static const PFNRT g_pDevINILinkHack[] =
};
-/*******************************************************************************
-* Internal Functions *
-*******************************************************************************/
-static DECLCALLBACK(err_t) devINIPOutput(struct netif *netif, struct pbuf *p, struct ip_addr *ipaddr);
-static DECLCALLBACK(err_t) devINIPOutputRaw(struct netif *netif, struct pbuf *p);
-static DECLCALLBACK(err_t) devINIPInterface(struct netif *netif);
+/*********************************************************************************************************************************
+* Internal Functions *
+*********************************************************************************************************************************/
+static err_t devINIPOutput(struct netif *netif, struct pbuf *p, struct ip_addr *ipaddr);
+static err_t devINIPOutputRaw(struct netif *netif, struct pbuf *p);
+static err_t devINIPInterface(struct netif *netif);
/**
@@ -158,7 +159,7 @@ static DECLCALLBACK(err_t) devINIPInterface(struct netif *netif);
* @param p Packet data.
* @param ipaddr Destination IP address.
*/
-static DECLCALLBACK(err_t) devINIPOutput(struct netif *netif, struct pbuf *p, struct ip_addr *ipaddr)
+static err_t devINIPOutput(struct netif *netif, struct pbuf *p, struct ip_addr *ipaddr)
{
err_t lrc;
LogFlow(("%s: netif=%p p=%p ipaddr=%#04x\n", __FUNCTION__, netif, p,
@@ -177,7 +178,7 @@ static DECLCALLBACK(err_t) devINIPOutput(struct netif *netif, struct pbuf *p, st
* @param netif Interface on which to send frame.
* @param p Frame data.
*/
-static DECLCALLBACK(err_t) devINIPOutputRaw(struct netif *netif, struct pbuf *p)
+static err_t devINIPOutputRaw(struct netif *netif, struct pbuf *p)
{
int rc = VINF_SUCCESS;
@@ -249,7 +250,7 @@ static DECLCALLBACK(err_t) devINIPOutputRaw(struct netif *netif, struct pbuf *p)
* @returns lwIP error code
* @param netif Interface to configure.
*/
-static DECLCALLBACK(err_t) devINIPInterface(struct netif *netif)
+static err_t devINIPInterface(struct netif *netif)
{
LogFlow(("%s: netif=%p\n", __FUNCTION__, netif));
Assert(g_pDevINIPData != NULL);
diff --git a/src/VBox/Devices/Network/DevPCNet.cpp b/src/VBox/Devices/Network/DevPCNet.cpp
index 6e35c2b..3d740ac 100644
--- a/src/VBox/Devices/Network/DevPCNet.cpp
+++ b/src/VBox/Devices/Network/DevPCNet.cpp
@@ -47,9 +47,9 @@
*/
-/*******************************************************************************
-* Header Files *
-*******************************************************************************/
+/*********************************************************************************************************************************
+* Header Files *
+*********************************************************************************************************************************/
#define LOG_GROUP LOG_GROUP_DEV_PCNET
#include <VBox/vmm/pdmdev.h>
#include <VBox/vmm/pdmnetifs.h>
@@ -70,9 +70,9 @@
#include "VBoxDD.h"
-/*******************************************************************************
-* Defined Constants And Macros *
-*******************************************************************************/
+/*********************************************************************************************************************************
+* Defined Constants And Macros *
+*********************************************************************************************************************************/
/* Enable this to catch writes to the ring descriptors instead of using excessive polling */
/* #define PCNET_NO_POLLING */
@@ -240,9 +240,9 @@
#define PHYSADDR(S,A) ((A) | (S)->GCUpperPhys)
-/*******************************************************************************
-* Structures and Typedefs *
-*******************************************************************************/
+/*********************************************************************************************************************************
+* Structures and Typedefs *
+*********************************************************************************************************************************/
/**
* PCNET state.
*
@@ -596,9 +596,11 @@ AssertCompileSize(RMD, 16);
#ifndef VBOX_DEVICE_STRUCT_TESTCASE
-/*******************************************************************************
-* Internal Functions *
-*******************************************************************************/
+
+
+/*********************************************************************************************************************************
+* Internal Functions *
+*********************************************************************************************************************************/
#define PRINT_TMD(T) Log2(( \
"TMD0 : TBADR=%#010x\n" \
"TMD1 : OWN=%d, ERR=%d, FCS=%d, LTI=%d, " \
diff --git a/src/VBox/Devices/Network/DevVirtioNet.cpp b/src/VBox/Devices/Network/DevVirtioNet.cpp
index 7b116a5..98a9ec0 100644
--- a/src/VBox/Devices/Network/DevVirtioNet.cpp
+++ b/src/VBox/Devices/Network/DevVirtioNet.cpp
@@ -16,9 +16,9 @@
*/
-/*******************************************************************************
-* Header Files *
-*******************************************************************************/
+/*********************************************************************************************************************************
+* Header Files *
+*********************************************************************************************************************************/
#define LOG_GROUP LOG_GROUP_DEV_VIRTIO_NET
#define VNET_GC_SUPPORT
#define VNET_WITH_GSO
@@ -37,9 +37,9 @@
#include "../VirtIO/Virtio.h"
-/*******************************************************************************
-* Defined Constants And Macros *
-*******************************************************************************/
+/*********************************************************************************************************************************
+* Defined Constants And Macros *
+*********************************************************************************************************************************/
#ifndef VBOX_DEVICE_STRUCT_TESTCASE
#define INSTANCE(pThis) pThis->VPCI.szInstance
@@ -94,9 +94,9 @@
#define VNET_S_LINK_UP 1
-/*******************************************************************************
-* Structures and Typedefs *
-*******************************************************************************/
+/*********************************************************************************************************************************
+* Structures and Typedefs *
+*********************************************************************************************************************************/
#ifdef _MSC_VER
struct VNetPCIConfig
#else /* !_MSC_VER */
diff --git a/src/VBox/Devices/Network/DrvDedicatedNic.cpp b/src/VBox/Devices/Network/DrvDedicatedNic.cpp
index 7f5064e..128fcda 100644
--- a/src/VBox/Devices/Network/DrvDedicatedNic.cpp
+++ b/src/VBox/Devices/Network/DrvDedicatedNic.cpp
@@ -15,9 +15,10 @@
* hope that it will be useful, but WITHOUT ANY WARRANTY of any kind.
*/
-/*******************************************************************************
-* Header Files *
-*******************************************************************************/
+
+/*********************************************************************************************************************************
+* Header Files *
+*********************************************************************************************************************************/
#define LOG_GROUP LOG_GROUP_DEFAULT
#include <VBox/log.h>
#include <VBox/vmm/pdmcritsect.h>
@@ -38,9 +39,9 @@
#include "VBoxDD.h"
-/*******************************************************************************
-* Structures and Typedefs *
-*******************************************************************************/
+/*********************************************************************************************************************************
+* Structures and Typedefs *
+*********************************************************************************************************************************/
/**
* Instance data for the dedicated (V)NIC driver.
*
diff --git a/src/VBox/Devices/Network/DrvIntNet.cpp b/src/VBox/Devices/Network/DrvIntNet.cpp
index 448d6d2..4ade805 100644
--- a/src/VBox/Devices/Network/DrvIntNet.cpp
+++ b/src/VBox/Devices/Network/DrvIntNet.cpp
@@ -15,9 +15,10 @@
* hope that it will be useful, but WITHOUT ANY WARRANTY of any kind.
*/
-/*******************************************************************************
-* Header Files *
-*******************************************************************************/
+
+/*********************************************************************************************************************************
+* Header Files *
+*********************************************************************************************************************************/
#define LOG_GROUP LOG_GROUP_DRV_INTNET
#include <VBox/vmm/pdmdrv.h>
#include <VBox/vmm/pdmnetinline.h>
@@ -48,16 +49,16 @@
#include "VBoxDD.h"
-/*******************************************************************************
-* Defined Constants And Macros *
-*******************************************************************************/
+/*********************************************************************************************************************************
+* Defined Constants And Macros *
+*********************************************************************************************************************************/
/** Enables the ring-0 part. */
#define VBOX_WITH_DRVINTNET_IN_R0
-/*******************************************************************************
-* Structures and Typedefs *
-*******************************************************************************/
+/*********************************************************************************************************************************
+* Structures and Typedefs *
+*********************************************************************************************************************************/
/**
* The state of the asynchronous thread.
*/
diff --git a/src/VBox/Devices/Network/DrvNAT.cpp b/src/VBox/Devices/Network/DrvNAT.cpp
index ff5c8a6..29b2d2d 100644
--- a/src/VBox/Devices/Network/DrvNAT.cpp
+++ b/src/VBox/Devices/Network/DrvNAT.cpp
@@ -16,9 +16,9 @@
*/
-/*******************************************************************************
-* Header Files *
-*******************************************************************************/
+/*********************************************************************************************************************************
+* Header Files *
+*********************************************************************************************************************************/
#define LOG_GROUP LOG_GROUP_DRV_NAT
#define __STDC_LIMIT_MACROS
#define __STDC_CONSTANT_MACROS
@@ -65,9 +65,9 @@ extern "C" {
#include "counters.h"
-/*******************************************************************************
-* Defined Constants And Macros *
-*******************************************************************************/
+/*********************************************************************************************************************************
+* Defined Constants And Macros *
+*********************************************************************************************************************************/
#define DRVNAT_MAXFRAMESIZE (16 * 1024)
@@ -131,9 +131,10 @@ do \
x.s_addr = def; \
} while (0)
-/*******************************************************************************
-* Structures and Typedefs *
-*******************************************************************************/
+
+/*********************************************************************************************************************************
+* Structures and Typedefs *
+*********************************************************************************************************************************/
/**
* NAT network transport driver instance data.
*
@@ -219,9 +220,9 @@ AssertCompileMemberAlignment(DRVNAT, StatNATRecvWakeups, 8);
typedef DRVNAT *PDRVNAT;
-/*******************************************************************************
-* Internal Functions *
-*******************************************************************************/
+/*********************************************************************************************************************************
+* Internal Functions *
+*********************************************************************************************************************************/
static void drvNATNotifyNATThread(PDRVNAT pThis, const char *pszWho);
DECLINLINE(void) drvNATUpdateDNS(PDRVNAT pThis, bool fFlapLink);
static DECLCALLBACK(int) drvNATReinitializeHostNameResolving(PDRVNAT pThis);
@@ -573,10 +574,8 @@ static DECLCALLBACK(int) drvNATNetworkUp_SendBuf(PPDMINETWORKUP pInterface, PPDM
/* Set an FTM checkpoint as this operation changes the state permanently. */
PDMDrvHlpFTSetCheckpoint(pThis->pDrvIns, FTMCHECKPOINTTYPE_NETWORK);
-
- RTREQQUEUE hQueue = pThis->hSlirpReqQueue;
-
- rc = RTReqQueueCallEx(hQueue, NULL /*ppReq*/, 0 /*cMillies*/, RTREQFLAGS_VOID | RTREQFLAGS_NO_WAIT,
+ rc = RTReqQueueCallEx(pThis->hSlirpReqQueue, NULL /*ppReq*/, 0 /*cMillies*/,
+ RTREQFLAGS_VOID | RTREQFLAGS_NO_WAIT,
(PFNRT)drvNATSendWorker, 2, pThis, pSgBuf);
if (RT_SUCCESS(rc))
{
@@ -665,8 +664,8 @@ static DECLCALLBACK(void) drvNATNetworkUp_NotifyLinkChanged(PPDMINETWORKUP pInte
LogFlow(("drvNATNetworkUp_NotifyLinkChanged: enmLinkState=%d\n", enmLinkState));
- /* Don't queue new requests when the NAT thread is about to stop.
- * But the VM could also be paused. So memorize the desired state. */
+ /* Don't queue new requests if the NAT thread is not running (e.g. paused,
+ * stopping), otherwise we would deadlock. Memorize the change. */
if (pThis->pSlirpThread->enmState != PDMTHREADSTATE_RUNNING)
{
pThis->enmLinkStateWant = enmLinkState;
@@ -676,7 +675,7 @@ static DECLCALLBACK(void) drvNATNetworkUp_NotifyLinkChanged(PPDMINETWORKUP pInte
PRTREQ pReq;
int rc = RTReqQueueCallEx(pThis->hSlirpReqQueue, &pReq, 0 /*cMillies*/, RTREQFLAGS_VOID,
(PFNRT)drvNATNotifyLinkChangedWorker, 2, pThis, enmLinkState);
- if (RT_LIKELY(rc == VERR_TIMEOUT))
+ if (rc == VERR_TIMEOUT)
{
drvNATNotifyNATThread(pThis, "drvNATNetworkUp_NotifyLinkChanged");
rc = RTReqWait(pReq, RT_INDEFINITE_WAIT);
@@ -712,29 +711,38 @@ static void drvNATNotifyApplyPortForwardCommand(PDRVNAT pThis, bool fRemove,
slirp_add_redirect(pThis->pNATState, fUdp, hostIp, u16HostPort, guestIp, u16GuestPort, Mac.au8);
}
-DECLCALLBACK(int) drvNATNetworkNatConfig_RedirectRuleCommand(PPDMINETWORKNATCONFIG pInterface, bool fRemove,
- bool fUdp, const char *pHostIp,
- uint16_t u16HostPort, const char *pGuestIp, uint16_t u16GuestPort)
+static DECLCALLBACK(int) drvNATNetworkNatConfigRedirect(PPDMINETWORKNATCONFIG pInterface, bool fRemove,
+ bool fUdp, const char *pHostIp, uint16_t u16HostPort,
+ const char *pGuestIp, uint16_t u16GuestPort)
{
LogFlowFunc(("fRemove=%d, fUdp=%d, pHostIp=%s, u16HostPort=%u, pGuestIp=%s, u16GuestPort=%u\n",
- RT_BOOL(fRemove), RT_BOOL(fUdp), pHostIp, u16HostPort, pGuestIp,
- u16GuestPort));
+ RT_BOOL(fRemove), RT_BOOL(fUdp), pHostIp, u16HostPort, pGuestIp, u16GuestPort));
PDRVNAT pThis = RT_FROM_MEMBER(pInterface, DRVNAT, INetworkNATCfg);
- PRTREQ pReq;
- int rc = RTReqQueueCallEx(pThis->hSlirpReqQueue, &pReq, 0 /*cMillies*/, RTREQFLAGS_VOID,
- (PFNRT)drvNATNotifyApplyPortForwardCommand, 7, pThis, fRemove,
- fUdp, pHostIp, u16HostPort, pGuestIp, u16GuestPort);
- if (RT_LIKELY(rc == VERR_TIMEOUT))
+ /* Execute the command directly if the VM is not running. */
+ int rc;
+ if (pThis->pSlirpThread->enmState != PDMTHREADSTATE_RUNNING)
{
- drvNATNotifyNATThread(pThis, "drvNATNetworkNatConfig_RedirectRuleCommand");
- rc = RTReqWait(pReq, RT_INDEFINITE_WAIT);
- AssertRC(rc);
+ drvNATNotifyApplyPortForwardCommand(pThis, fRemove, fUdp, pHostIp,
+ u16HostPort, pGuestIp,u16GuestPort);
+ rc = VINF_SUCCESS;
}
else
- AssertRC(rc);
+ {
+ PRTREQ pReq;
+ rc = RTReqQueueCallEx(pThis->hSlirpReqQueue, &pReq, 0 /*cMillies*/, RTREQFLAGS_VOID,
+ (PFNRT)drvNATNotifyApplyPortForwardCommand, 7, pThis, fRemove,
+ fUdp, pHostIp, u16HostPort, pGuestIp, u16GuestPort);
+ if (rc == VERR_TIMEOUT)
+ {
+ drvNATNotifyNATThread(pThis, "drvNATNetworkNatConfigRedirect");
+ rc = RTReqWait(pReq, RT_INDEFINITE_WAIT);
+ AssertRC(rc);
+ }
+ else
+ AssertRC(rc);
- RTReqRelease(pReq);
- port_forwarding_done:
+ RTReqRelease(pReq);
+ }
return rc;
}
@@ -1141,36 +1149,32 @@ DECLINLINE(void) drvNATUpdateDNS(PDRVNAT pThis, bool fFlapLink)
int strategy = slirp_host_network_configuration_change_strategy_selector(pThis->pNATState);
switch (strategy)
{
-
case VBOX_NAT_DNS_DNSPROXY:
- {
- /**
- * XXX: Here or in _strategy_selector we should deal with network change
- * in "network change" scenario domain name change we have to update guest lease
- * forcibly.
- * Note at that built-in dhcp also updates DNS information on NAT thread.
- */
- /**
- * It's unsafe to to do it directly on non-NAT thread
- * so we schedule the worker and kick the NAT thread.
- */
- RTREQQUEUE hQueue = pThis->hSlirpReqQueue;
-
- int rc = RTReqQueueCallEx(hQueue, NULL /*ppReq*/, 0 /*cMillies*/,
- RTREQFLAGS_VOID | RTREQFLAGS_NO_WAIT,
- (PFNRT)drvNATReinitializeHostNameResolving, 1, pThis);
- if (RT_SUCCESS(rc))
- drvNATNotifyNATThread(pThis, "drvNATUpdateDNS");
+ {
+ /**
+ * XXX: Here or in _strategy_selector we should deal with network change
+ * in "network change" scenario domain name change we have to update guest lease
+ * forcibly.
+ * Note at that built-in dhcp also updates DNS information on NAT thread.
+ */
+ /**
+ * It's unsafe to to do it directly on non-NAT thread
+ * so we schedule the worker and kick the NAT thread.
+ */
+ int rc = RTReqQueueCallEx(pThis->hSlirpReqQueue, NULL /*ppReq*/, 0 /*cMillies*/,
+ RTREQFLAGS_VOID | RTREQFLAGS_NO_WAIT,
+ (PFNRT)drvNATReinitializeHostNameResolving, 1, pThis);
+ if (RT_SUCCESS(rc))
+ drvNATNotifyNATThread(pThis, "drvNATUpdateDNS");
- return;
- }
+ return;
+ }
case VBOX_NAT_DNS_EXTERNAL:
/*
* Host resumed from a suspend and the network might have changed.
* Disconnect the guest from the network temporarily to let it pick up the changes.
*/
-
if (fFlapLink)
pThis->pIAboveConfig->pfnSetLinkState(pThis->pIAboveConfig,
PDMNETWORKLINKSTATE_DOWN_RESUME);
@@ -1419,7 +1423,7 @@ static DECLCALLBACK(int) drvNATConstruct(PPDMDRVINS pDrvIns, PCFGMNODE pCfg, uin
pThis->INetworkUp.pfnNotifyLinkChanged = drvNATNetworkUp_NotifyLinkChanged;
/* NAT engine configuration */
- pThis->INetworkNATCfg.pfnRedirectRuleCommand = drvNATNetworkNatConfig_RedirectRuleCommand;
+ pThis->INetworkNATCfg.pfnRedirectRuleCommand = drvNATNetworkNatConfigRedirect;
#if HAVE_NOTIFICATION_FOR_DNS_UPDATE && !defined(RT_OS_DARWIN)
/*
* On OS X we stick to the old OS X specific notifications for
diff --git a/src/VBox/Devices/Network/DrvNetShaper.cpp b/src/VBox/Devices/Network/DrvNetShaper.cpp
index 1db0881..adf99fa 100644
--- a/src/VBox/Devices/Network/DrvNetShaper.cpp
+++ b/src/VBox/Devices/Network/DrvNetShaper.cpp
@@ -16,9 +16,9 @@
*/
-/*******************************************************************************
-* Header Files *
-*******************************************************************************/
+/*********************************************************************************************************************************
+* Header Files *
+*********************************************************************************************************************************/
#define LOG_GROUP LOG_GROUP_NET_SHAPER
#include <VBox/vmm/pdmdrv.h>
@@ -33,9 +33,10 @@
#include "VBoxDD.h"
-/*******************************************************************************
-* Structures and Typedefs *
-*******************************************************************************/
+
+/*********************************************************************************************************************************
+* Structures and Typedefs *
+*********************************************************************************************************************************/
/**
* Block driver instance data.
*
diff --git a/src/VBox/Devices/Network/DrvNetSniffer.cpp b/src/VBox/Devices/Network/DrvNetSniffer.cpp
index ed32c44..1752eca 100644
--- a/src/VBox/Devices/Network/DrvNetSniffer.cpp
+++ b/src/VBox/Devices/Network/DrvNetSniffer.cpp
@@ -16,9 +16,9 @@
*/
-/*******************************************************************************
-* Header Files *
-*******************************************************************************/
+/*********************************************************************************************************************************
+* Header Files *
+*********************************************************************************************************************************/
#define LOG_GROUP LOG_GROUP_DRV_NAT
#include <VBox/vmm/pdmdrv.h>
#include <VBox/vmm/pdmnetifs.h>
@@ -38,9 +38,9 @@
#include "VBoxDD.h"
-/*******************************************************************************
-* Structures and Typedefs *
-*******************************************************************************/
+/*********************************************************************************************************************************
+* Structures and Typedefs *
+*********************************************************************************************************************************/
/**
* Block driver instance data.
*
diff --git a/src/VBox/Devices/Network/DrvTAP.cpp b/src/VBox/Devices/Network/DrvTAP.cpp
index ff753c0..bc0f98a 100644
--- a/src/VBox/Devices/Network/DrvTAP.cpp
+++ b/src/VBox/Devices/Network/DrvTAP.cpp
@@ -15,9 +15,10 @@
* hope that it will be useful, but WITHOUT ANY WARRANTY of any kind.
*/
-/*******************************************************************************
-* Header Files *
-*******************************************************************************/
+
+/*********************************************************************************************************************************
+* Header Files *
+*********************************************************************************************************************************/
#define LOG_GROUP LOG_GROUP_DRV_TUN
#include <VBox/log.h>
#include <VBox/vmm/pdmdrv.h>
@@ -66,9 +67,9 @@
#include "VBoxDD.h"
-/*******************************************************************************
-* Structures and Typedefs *
-*******************************************************************************/
+/*********************************************************************************************************************************
+* Structures and Typedefs *
+*********************************************************************************************************************************/
/**
* TAP driver instance data.
*
@@ -135,9 +136,9 @@ typedef struct DRVTAP
#define PDMINETWORKUP_2_DRVTAP(pInterface) ( (PDRVTAP)((uintptr_t)pInterface - RT_OFFSETOF(DRVTAP, INetworkUp)) )
-/*******************************************************************************
-* Internal Functions *
-*******************************************************************************/
+/*********************************************************************************************************************************
+* Internal Functions *
+*********************************************************************************************************************************/
#ifdef RT_OS_SOLARIS
static int SolarisTAPAttach(PDRVTAP pThis);
#endif
diff --git a/src/VBox/Devices/Network/DrvUDPTunnel.cpp b/src/VBox/Devices/Network/DrvUDPTunnel.cpp
index 896387f..80cb96b 100644
--- a/src/VBox/Devices/Network/DrvUDPTunnel.cpp
+++ b/src/VBox/Devices/Network/DrvUDPTunnel.cpp
@@ -17,9 +17,10 @@
* hope that it will be useful, but WITHOUT ANY WARRANTY of any kind.
*/
-/*******************************************************************************
-* Header Files *
-*******************************************************************************/
+
+/*********************************************************************************************************************************
+* Header Files *
+*********************************************************************************************************************************/
#define LOG_GROUP LOG_GROUP_DRV_UDPTUNNEL
#include <VBox/log.h>
#include <VBox/vmm/pdmdrv.h>
@@ -39,9 +40,9 @@
#include "VBoxDD.h"
-/*******************************************************************************
-* Structures and Typedefs *
-*******************************************************************************/
+/*********************************************************************************************************************************
+* Structures and Typedefs *
+*********************************************************************************************************************************/
/**
* UDP tunnel driver instance data.
*
@@ -101,9 +102,10 @@ typedef struct DRVUDPTUNNEL
/** Converts a pointer to UDPTUNNEL::INetworkUp to a PRDVUDPTUNNEL. */
#define PDMINETWORKUP_2_DRVUDPTUNNEL(pInterface) ( (PDRVUDPTUNNEL)((uintptr_t)pInterface - RT_OFFSETOF(DRVUDPTUNNEL, INetworkUp)) )
-/*******************************************************************************
-* Internal Functions *
-*******************************************************************************/
+
+/*********************************************************************************************************************************
+* Internal Functions *
+*********************************************************************************************************************************/
/**
* @interface_method_impl{PDMINETWORKUP,pfnBeginXmit}
diff --git a/src/VBox/Devices/Network/DrvVDE.cpp b/src/VBox/Devices/Network/DrvVDE.cpp
index a3d3f9b..652cec7 100644
--- a/src/VBox/Devices/Network/DrvVDE.cpp
+++ b/src/VBox/Devices/Network/DrvVDE.cpp
@@ -16,9 +16,10 @@
* hope that it will be useful, but WITHOUT ANY WARRANTY of any kind.
*/
-/*******************************************************************************
-* Header Files *
-*******************************************************************************/
+
+/*********************************************************************************************************************************
+* Header Files *
+*********************************************************************************************************************************/
#define LOG_GROUP LOG_GROUP_DRV_TUN
#include <VBox/log.h>
#include <VBox/vmm/pdmdrv.h>
@@ -48,9 +49,9 @@
#include "VBoxDD.h"
-/*******************************************************************************
-* Structures and Typedefs *
-*******************************************************************************/
+/*********************************************************************************************************************************
+* Structures and Typedefs *
+*********************************************************************************************************************************/
/**
* VDE driver instance data.
*
@@ -107,9 +108,9 @@ typedef struct DRVVDE
#define PDMINETWORKUP_2_DRVVDE(pInterface) ( (PDRVVDE)((uintptr_t)pInterface - RT_OFFSETOF(DRVVDE, INetworkUp)) )
-/*******************************************************************************
-* Internal Functions *
-*******************************************************************************/
+/*********************************************************************************************************************************
+* Internal Functions *
+*********************************************************************************************************************************/
diff --git a/src/VBox/Devices/Network/Pcap.cpp b/src/VBox/Devices/Network/Pcap.cpp
index e283939..00eb03c 100644
--- a/src/VBox/Devices/Network/Pcap.cpp
+++ b/src/VBox/Devices/Network/Pcap.cpp
@@ -15,9 +15,10 @@
* hope that it will be useful, but WITHOUT ANY WARRANTY of any kind.
*/
-/*******************************************************************************
-* Header Files *
-*******************************************************************************/
+
+/*********************************************************************************************************************************
+* Header Files *
+*********************************************************************************************************************************/
#include "Pcap.h"
#include <iprt/file.h>
@@ -27,9 +28,9 @@
#include <VBox/vmm/pdmnetinline.h>
-/*******************************************************************************
-* Structures and Typedefs *
-*******************************************************************************/
+/*********************************************************************************************************************************
+* Structures and Typedefs *
+*********************************************************************************************************************************/
/* "libpcap" magic */
#define PCAP_MAGIC 0xa1b2c3d4
@@ -61,9 +62,9 @@ struct pcaprec_hdr_init
};
-/*******************************************************************************
-* Global Variables *
-*******************************************************************************/
+/*********************************************************************************************************************************
+* Global Variables *
+*********************************************************************************************************************************/
static pcaprec_hdr_init const s_Hdr =
{
PCAP_MAGIC,
diff --git a/src/VBox/Devices/Network/SrvIntNetR0.cpp b/src/VBox/Devices/Network/SrvIntNetR0.cpp
index 4f02381..d6fa0df 100644
--- a/src/VBox/Devices/Network/SrvIntNetR0.cpp
+++ b/src/VBox/Devices/Network/SrvIntNetR0.cpp
@@ -21,9 +21,9 @@
*/
-/*******************************************************************************
-* Header Files *
-*******************************************************************************/
+/*********************************************************************************************************************************
+* Header Files *
+*********************************************************************************************************************************/
#define LOG_GROUP LOG_GROUP_SRV_INTNET
#include <VBox/intnet.h>
#include <VBox/intnetinline.h>
@@ -45,9 +45,9 @@
#include <iprt/time.h>
-/*******************************************************************************
-* Defined Constants And Macros *
-*******************************************************************************/
+/*********************************************************************************************************************************
+* Defined Constants And Macros *
+*********************************************************************************************************************************/
/** @def INTNET_WITH_DHCP_SNOOPING
* Enabled DHCP snooping when in shared-mac-on-the-wire mode. */
#define INTNET_WITH_DHCP_SNOOPING
@@ -66,9 +66,9 @@
#define INTNET_BUSY_WAKEUP_MASK RT_BIT_32(30)
-/*******************************************************************************
-* Structures and Typedefs *
-*******************************************************************************/
+/*********************************************************************************************************************************
+* Structures and Typedefs *
+*********************************************************************************************************************************/
/**
* MAC address lookup table entry.
*/
@@ -404,9 +404,9 @@ typedef struct INTNET *PINTNET;
#define INTNET_MAGIC UINT32_C(0x19410105)
-/*******************************************************************************
-* Global Variables *
-*******************************************************************************/
+/*********************************************************************************************************************************
+* Global Variables *
+*********************************************************************************************************************************/
/** Pointer to the internal network instance data. */
static PINTNET volatile g_pIntNet = NULL;
@@ -437,9 +437,9 @@ g_afIntNetOpenNetworkIfFlags[] =
};
-/*******************************************************************************
-* Forward Declarations *
-*******************************************************************************/
+/*********************************************************************************************************************************
+* Forward Declarations *
+*********************************************************************************************************************************/
static void intnetR0TrunkIfDestroy(PINTNETTRUNKIF pThis, PINTNETNETWORK pNetwork);
diff --git a/src/VBox/Devices/Network/lwip-new/vbox/VBoxLwipCore.cpp b/src/VBox/Devices/Network/lwip-new/vbox/VBoxLwipCore.cpp
index b8c3225..ad8cd98 100644
--- a/src/VBox/Devices/Network/lwip-new/vbox/VBoxLwipCore.cpp
+++ b/src/VBox/Devices/Network/lwip-new/vbox/VBoxLwipCore.cpp
@@ -65,7 +65,7 @@ static LWIPCORE g_LwipCore;
/**
* @note: this function executes on TCPIP thread.
*/
-static DECLCALLBACK(void) lwipCoreUserCallback(void *pvArg)
+static void lwipCoreUserCallback(void *pvArg)
{
LogFlowFunc(("ENTER: pvArg:%p\n", pvArg));
@@ -82,7 +82,7 @@ static DECLCALLBACK(void) lwipCoreUserCallback(void *pvArg)
/**
* @note: this function executes on TCPIP thread.
*/
-static DECLCALLBACK(void) lwipCoreInitDone(void *pvArg)
+static void lwipCoreInitDone(void *pvArg)
{
LogFlowFunc(("ENTER: pvArg:%p\n", pvArg));
@@ -96,7 +96,7 @@ static DECLCALLBACK(void) lwipCoreInitDone(void *pvArg)
/**
* @note: this function executes on TCPIP thread.
*/
-static DECLCALLBACK(void) lwipCoreFiniDone(void *pvArg)
+static void lwipCoreFiniDone(void *pvArg)
{
LogFlowFunc(("ENTER: pvArg:%p\n", pvArg));
diff --git a/src/VBox/Devices/Network/lwip-new/vbox/sys_arch.c b/src/VBox/Devices/Network/lwip-new/vbox/sys_arch.c
index fbf48f6..77a6aae 100644
--- a/src/VBox/Devices/Network/lwip-new/vbox/sys_arch.c
+++ b/src/VBox/Devices/Network/lwip-new/vbox/sys_arch.c
@@ -493,7 +493,7 @@ struct sys_timeouts *sys_arch_timeouts(void)
* Internal: thread main function adapter, dropping the first parameter. Needed
* to make lwip thread main function compatible with IPRT thread main function.
*/
-static int sys_thread_adapter(RTTHREAD ThreadSelf, void *pvUser)
+static DECLCALLBACK(int) sys_thread_adapter(RTTHREAD ThreadSelf, void *pvUser)
{
THREADLOCALSTORAGE *tls = (THREADLOCALSTORAGE *)pvUser;
tls->thread(tls->arg);
diff --git a/src/VBox/Devices/Network/slirp/ip_icmp.c b/src/VBox/Devices/Network/slirp/ip_icmp.c
index 0669ee7..5384a82 100644
--- a/src/VBox/Devices/Network/slirp/ip_icmp.c
+++ b/src/VBox/Devices/Network/slirp/ip_icmp.c
@@ -350,8 +350,9 @@ icmp_find_original_mbuf(PNATState pData, struct ip *ip)
}
for (so = head_socket->so_prev; so != head_socket; so = so->so_prev)
{
- /* Should be reaplaced by hash here */
- Log(("trying:%R[natsock] against %RTnaipv4:%d lport=%d hlport=%d\n", so, &faddr, fport, lport, so->so_hlport));
+ /* Should be replaced by hash here */
+ Log(("trying:%R[natsock] against %RTnaipv4:%d lport=%d hlport=%d\n",
+ so, faddr.s_addr, ntohs(fport), ntohs(lport), ntohs(so->so_hlport)));
if ( so->so_faddr.s_addr == faddr.s_addr
&& so->so_fport == fport
&& so->so_hlport == lport)
diff --git a/src/VBox/Devices/Network/slirp/slirp.c b/src/VBox/Devices/Network/slirp/slirp.c
index 81541e6..0356fde 100644
--- a/src/VBox/Devices/Network/slirp/slirp.c
+++ b/src/VBox/Devices/Network/slirp/slirp.c
@@ -304,8 +304,11 @@ int slirp_init(PNATState *ppData, uint32_t u32NetAddr, uint32_t u32Netmask,
int rc;
PNATState pData;
if (u32Netmask & 0x1f)
+ {
/* CTL is x.x.x.15, bootp passes up to 16 IPs (15..31) */
+ LogRel(("The last 5 bits of the netmask (%RTnaipv4) need to be unset\n", RT_BE2H_U32(u32Netmask)));
return VERR_INVALID_PARAMETER;
+ }
pData = RTMemAllocZ(RT_ALIGN_Z(sizeof(NATState), sizeof(uint64_t)));
*ppData = pData;
if (!pData)
diff --git a/src/VBox/Devices/Network/slirp/udp.c b/src/VBox/Devices/Network/slirp/udp.c
index aedc925..15df749 100644
--- a/src/VBox/Devices/Network/slirp/udp.c
+++ b/src/VBox/Devices/Network/slirp/udp.c
@@ -650,6 +650,10 @@ udp_listen(PNATState pData, u_int32_t bind_addr, u_int port, u_int32_t laddr, u_
/* setsockopt(so->s, SOL_SOCKET, SO_OOBINLINE,(char *)&opt, sizeof(int)); */
getsockname(so->s,(struct sockaddr *)&addr,&addrlen);
+ so->so_hladdr = addr.sin_addr;
+ so->so_hlport = addr.sin_port;
+
+ /* XXX: wtf are we setting so_faddr/so_fport here? */
so->so_fport = addr.sin_port;
/* The original check was completely broken, as the commented out
* if statement was always true (INADDR_ANY=0). */
diff --git a/src/VBox/Devices/Network/testcase/tstIntNet-1.cpp b/src/VBox/Devices/Network/testcase/tstIntNet-1.cpp
index 4e80bb2..1962d9c 100644
--- a/src/VBox/Devices/Network/testcase/tstIntNet-1.cpp
+++ b/src/VBox/Devices/Network/testcase/tstIntNet-1.cpp
@@ -15,9 +15,10 @@
* hope that it will be useful, but WITHOUT ANY WARRANTY of any kind.
*/
-/*******************************************************************************
-* Header Files *
-*******************************************************************************/
+
+/*********************************************************************************************************************************
+* Header Files *
+*********************************************************************************************************************************/
#include <VBox/intnet.h>
#include <VBox/intnetinline.h>
#include <VBox/vmm/pdmnetinline.h>
@@ -40,9 +41,9 @@
#include "../Pcap.h"
-/*******************************************************************************
-* Global Variables *
-*******************************************************************************/
+/*********************************************************************************************************************************
+* Global Variables *
+*********************************************************************************************************************************/
static int g_cErrors = 0;
static uint64_t g_StartTS = 0;
static uint32_t g_DhcpXID = 0;
@@ -806,7 +807,7 @@ extern "C" DECLEXPORT(int) TrustedMain(int argc, char **argv, char **envp)
return 1;
case 'V':
- RTPrintf("$Revision: 101707 $\n");
+ RTPrintf("$Revision: 102121 $\n");
return 0;
default:
diff --git a/src/VBox/Devices/Network/testcase/tstIntNetR0.cpp b/src/VBox/Devices/Network/testcase/tstIntNetR0.cpp
index 9424647..bf5a323 100644
--- a/src/VBox/Devices/Network/testcase/tstIntNetR0.cpp
+++ b/src/VBox/Devices/Network/testcase/tstIntNetR0.cpp
@@ -19,9 +19,9 @@
*/
-/*******************************************************************************
-* Header Files *
-*******************************************************************************/
+/*********************************************************************************************************************************
+* Header Files *
+*********************************************************************************************************************************/
#define IN_INTNET_TESTCASE
#define IN_INTNET_R3
#include <VBox/cdefs.h>
@@ -47,9 +47,9 @@ typedef void *MYPSUPDRVSESSION;
#include <iprt/test.h>
-/*******************************************************************************
-* Structures and Typedefs *
-*******************************************************************************/
+/*********************************************************************************************************************************
+* Structures and Typedefs *
+*********************************************************************************************************************************/
/**
* Security objectype.
*/
@@ -92,9 +92,9 @@ typedef struct OBJREF
} OBJREF, *POBJREF;
-/*******************************************************************************
-* Global Variables *
-*******************************************************************************/
+/*********************************************************************************************************************************
+* Global Variables *
+*********************************************************************************************************************************/
/** The test handle.*/
static RTTEST g_hTest = NIL_RTTEST;
/** The size (in bytes) of the large transfer tests. */
@@ -230,7 +230,7 @@ typedef struct MYFRAMEHDR
* Send thread.
* This is constantly sending frames to the other interface.
*/
-DECLCALLBACK(int) SendThread(RTTHREAD hThreadSelf, void *pvArg)
+static DECLCALLBACK(int) SendThread(RTTHREAD hThreadSelf, void *pvArg)
{
PMYARGS pArgs = (PMYARGS)pvArg;
int rc;
@@ -293,7 +293,7 @@ DECLCALLBACK(int) SendThread(RTTHREAD hThreadSelf, void *pvArg)
* Receive thread.
* This is reading stuff from the network.
*/
-DECLCALLBACK(int) ReceiveThread(RTTHREAD hThreadSelf, void *pvArg)
+static DECLCALLBACK(int) ReceiveThread(RTTHREAD hThreadSelf, void *pvArg)
{
uint32_t cbReceived = 0;
uint32_t cLostFrames = 0;
diff --git a/src/VBox/Devices/PC/ACPI/VBoxAcpi.cpp b/src/VBox/Devices/PC/ACPI/VBoxAcpi.cpp
index 1565847..e897204 100644
--- a/src/VBox/Devices/PC/ACPI/VBoxAcpi.cpp
+++ b/src/VBox/Devices/PC/ACPI/VBoxAcpi.cpp
@@ -16,9 +16,9 @@
*/
-/*******************************************************************************
-* Header Files *
-*******************************************************************************/
+/*********************************************************************************************************************************
+* Header Files *
+*********************************************************************************************************************************/
#include <iprt/cdefs.h>
#if !defined(IN_RING3)
# error Pure R3 code
diff --git a/src/VBox/Devices/PC/BIOS/VBoxBiosAlternative.asm b/src/VBox/Devices/PC/BIOS/VBoxBiosAlternative.asm
index 137dee7..e38a008 100644
--- a/src/VBox/Devices/PC/BIOS/VBoxBiosAlternative.asm
+++ b/src/VBox/Devices/PC/BIOS/VBoxBiosAlternative.asm
@@ -983,7 +983,7 @@ section CONST progbits vstart=0xb0 align=1 ; size=0xce0 class=DATA group=DGROUP
section CONST2 progbits vstart=0xd90 align=1 ; size=0x3fa class=DATA group=DGROUP
_bios_cvs_version_string: ; 0xf0d90 LB 0x12
- db 'VirtualBox 5.0.2', 000h, 000h
+ db 'VirtualBox 5.0.4', 000h, 000h
_bios_prefix_string: ; 0xf0da2 LB 0x8
db 'BIOS: ', 000h, 000h
_isotag: ; 0xf0daa LB 0x6
@@ -16348,4 +16348,4 @@ dummy_iret: ; 0xfff53 LB 0x9d
db 'XM'
cpu_reset: ; 0xffff0 LB 0x10
jmp far 0f000h:0e05bh ; ea 5b e0 00 f0
- db 030h, 036h, 02fh, 032h, 033h, 02fh, 039h, 039h, 000h, 0fch, 087h
+ db 030h, 036h, 02fh, 032h, 033h, 02fh, 039h, 039h, 000h, 0fch, 085h
diff --git a/src/VBox/Devices/PC/BIOS/VBoxBiosAlternative.md5sum b/src/VBox/Devices/PC/BIOS/VBoxBiosAlternative.md5sum
index 4d6d5e7..c752487 100644
--- a/src/VBox/Devices/PC/BIOS/VBoxBiosAlternative.md5sum
+++ b/src/VBox/Devices/PC/BIOS/VBoxBiosAlternative.md5sum
@@ -1 +1 @@
-6d3230e23c6948548bc0468e6f090fbd *VBoxPcBios.rom
+f1f88e6a631fdb80686051c812f21d6e *VBoxPcBios.rom
diff --git a/src/VBox/Devices/PC/DevACPI.cpp b/src/VBox/Devices/PC/DevACPI.cpp
index fbc56ee..0d8e5e0 100644
--- a/src/VBox/Devices/PC/DevACPI.cpp
+++ b/src/VBox/Devices/PC/DevACPI.cpp
@@ -15,9 +15,10 @@
* hope that it will be useful, but WITHOUT ANY WARRANTY of any kind.
*/
-/*******************************************************************************
-* Header Files *
-*******************************************************************************/
+
+/*********************************************************************************************************************************
+* Header Files *
+*********************************************************************************************************************************/
#define LOG_GROUP LOG_GROUP_DEV_ACPI
#include <VBox/vmm/pdmdev.h>
#include <VBox/vmm/pgm.h>
@@ -43,9 +44,9 @@
-/*******************************************************************************
-* Defined Constants And Macros *
-*******************************************************************************/
+/*********************************************************************************************************************************
+* Defined Constants And Macros *
+*********************************************************************************************************************************/
#ifdef IN_RING3
/** Locks the device state, ring-3 only. */
# define DEVACPI_LOCK_R3(a_pThis) \
@@ -199,9 +200,9 @@ enum
#define STA_BATTERY_PRESENT_MASK RT_BIT(4) /**< the battery is present */
-/*******************************************************************************
-* Structures and Typedefs *
-*******************************************************************************/
+/*********************************************************************************************************************************
+* Structures and Typedefs *
+*********************************************************************************************************************************/
/**
* The ACPI device state.
*/
@@ -631,9 +632,11 @@ AssertCompileSize(ACPITBLCUST, 512);
#ifndef VBOX_DEVICE_STRUCT_TESTCASE /* exclude the rest of the file */
-/*******************************************************************************
-* Internal Functions *
-*******************************************************************************/
+
+
+/*********************************************************************************************************************************
+* Internal Functions *
+*********************************************************************************************************************************/
RT_C_DECLS_BEGIN
PDMBOTHCBDECL(int) acpiPMTmrRead(PPDMDEVINS pDevIns, void *pvUser, RTIOPORT Port, uint32_t *pu32, unsigned cb);
RT_C_DECLS_END
diff --git a/src/VBox/Devices/PC/DevAPIC.cpp b/src/VBox/Devices/PC/DevAPIC.cpp
index a5b31d4..8af7351 100644
--- a/src/VBox/Devices/PC/DevAPIC.cpp
+++ b/src/VBox/Devices/PC/DevAPIC.cpp
@@ -41,9 +41,10 @@
* Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
*/
-/*******************************************************************************
-* Header Files *
-*******************************************************************************/
+
+/*********************************************************************************************************************************
+* Header Files *
+*********************************************************************************************************************************/
#define LOG_GROUP LOG_GROUP_DEV_APIC
#include <VBox/vmm/pdmdev.h>
@@ -59,9 +60,9 @@
#include "DevApic.h"
-/*******************************************************************************
-* Defined Constants And Macros *
-*******************************************************************************/
+/*********************************************************************************************************************************
+* Defined Constants And Macros *
+*********************************************************************************************************************************/
#define MSR_IA32_APICBASE_ENABLE (1<<11)
#define MSR_IA32_APICBASE_X2ENABLE (1<<10)
#define MSR_IA32_APICBASE_BASE (0xfffff<<12) /** @todo r=bird: This is not correct according to current specs! */
@@ -172,9 +173,9 @@
#define APIC_MAX_PATCH_ATTEMPTS 100
-/*******************************************************************************
-* Structures and Typedefs *
-*******************************************************************************/
+/*********************************************************************************************************************************
+* Structures and Typedefs *
+*********************************************************************************************************************************/
typedef uint32_t PhysApicId;
typedef uint32_t LogApicId;
@@ -403,9 +404,10 @@ AssertCompileMemberAlignment(APICDeviceInfo, StatMMIOReadGC, 8);
#ifndef VBOX_DEVICE_STRUCT_TESTCASE
-/*******************************************************************************
-* Internal Functions *
-*******************************************************************************/
+
+/*********************************************************************************************************************************
+* Internal Functions *
+*********************************************************************************************************************************/
static void apic_update_tpr(APICDeviceInfo *pDev, APICState *pApic, uint32_t val);
static void apic_eoi(APICDeviceInfo *pDev, APICState *pApic); /* */
diff --git a/src/VBox/Devices/PC/DevDMA.cpp b/src/VBox/Devices/PC/DevDMA.cpp
index b6a2c2b..6f74e18 100644
--- a/src/VBox/Devices/PC/DevDMA.cpp
+++ b/src/VBox/Devices/PC/DevDMA.cpp
@@ -40,9 +40,10 @@
* THE SOFTWARE.
*/
-/*******************************************************************************
-* Header Files *
-*******************************************************************************/
+
+/*********************************************************************************************************************************
+* Header Files *
+*********************************************************************************************************************************/
#define LOG_GROUP LOG_GROUP_DEV_DMA
#include <VBox/vmm/pdmdev.h>
#include <VBox/err.h>
@@ -782,7 +783,7 @@ static DECLCALLBACK(uint8_t) dmaGetChannelMode(PPDMDEVINS pDevIns, unsigned uCha
/**
* @interface_method_impl{PDMDEVREG,pfnReset}
*/
-static void dmaReset(PPDMDEVINS pDevIns)
+static DECLCALLBACK(void) dmaReset(PPDMDEVINS pDevIns)
{
DMAState *pThis = PDMINS_2_DATA(pDevIns, DMAState *);
diff --git a/src/VBox/Devices/PC/DevFwCommon.cpp b/src/VBox/Devices/PC/DevFwCommon.cpp
index d7ff9f8..bc12a25 100644
--- a/src/VBox/Devices/PC/DevFwCommon.cpp
+++ b/src/VBox/Devices/PC/DevFwCommon.cpp
@@ -15,9 +15,10 @@
* hope that it will be useful, but WITHOUT ANY WARRANTY of any kind.
*/
-/*******************************************************************************
-* Header Files *
-*******************************************************************************/
+
+/*********************************************************************************************************************************
+* Header Files *
+*********************************************************************************************************************************/
#define LOG_GROUP LOG_GROUP_DEV
#include <VBox/vmm/pdmdev.h>
@@ -40,9 +41,9 @@
#include "DevFwCommon.h"
-/*******************************************************************************
-* Defined Constants And Macros *
-*******************************************************************************/
+/*********************************************************************************************************************************
+* Defined Constants And Macros *
+*********************************************************************************************************************************/
/*
* Default DMI data (legacy).
@@ -88,9 +89,9 @@ static char g_szHostDmiSystemProduct[64];
static char g_szHostDmiSystemVersion[64];
-/*******************************************************************************
-* Structures and Typedefs *
-*******************************************************************************/
+/*********************************************************************************************************************************
+* Structures and Typedefs *
+*********************************************************************************************************************************/
#pragma pack(1)
typedef struct SMBIOSHDR
diff --git a/src/VBox/Devices/PC/DevHPET.cpp b/src/VBox/Devices/PC/DevHPET.cpp
index 370198e..c6a8464 100644
--- a/src/VBox/Devices/PC/DevHPET.cpp
+++ b/src/VBox/Devices/PC/DevHPET.cpp
@@ -19,9 +19,10 @@
* and the Intel ICH9 datasheet.
*/
-/*******************************************************************************
-* Header Files *
-*******************************************************************************/
+
+/*********************************************************************************************************************************
+* Header Files *
+*********************************************************************************************************************************/
#define LOG_GROUP LOG_GROUP_DEV_HPET
#include <VBox/vmm/pdmdev.h>
#include <VBox/vmm/stam.h>
@@ -33,9 +34,9 @@
#include "VBoxDD.h"
-/*******************************************************************************
-* Defined Constants And Macros *
-*******************************************************************************/
+/*********************************************************************************************************************************
+* Defined Constants And Macros *
+*********************************************************************************************************************************/
/*
* Current limitations:
* - not entirely correct time of interrupt, i.e. never
@@ -177,9 +178,9 @@
} while (0)
-/*******************************************************************************
-* Structures and Typedefs *
-*******************************************************************************/
+/*********************************************************************************************************************************
+* Structures and Typedefs *
+*********************************************************************************************************************************/
/**
* A HPET timer.
*/
diff --git a/src/VBox/Devices/PC/DevIoApic.cpp b/src/VBox/Devices/PC/DevIoApic.cpp
index 555d968..2c15e27 100644
--- a/src/VBox/Devices/PC/DevIoApic.cpp
+++ b/src/VBox/Devices/PC/DevIoApic.cpp
@@ -38,9 +38,10 @@
* Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
*/
-/*******************************************************************************
-* Header Files *
-*******************************************************************************/
+
+/*********************************************************************************************************************************
+* Header Files *
+*********************************************************************************************************************************/
#define LOG_GROUP LOG_GROUP_DEV_APIC
#include <VBox/vmm/pdmdev.h>
@@ -55,9 +56,9 @@
#include "DevApic.h"
-/*******************************************************************************
-* Defined Constants And Macros *
-*******************************************************************************/
+/*********************************************************************************************************************************
+* Defined Constants And Macros *
+*********************************************************************************************************************************/
/** @def IOAPIC_LOCK
* Acquires the PDM lock. */
#define IOAPIC_LOCK(pThis, rc) \
@@ -75,9 +76,9 @@
#define IOAPIC_NUM_PINS 0x18
-/*******************************************************************************
-* Structures and Typedefs *
-*******************************************************************************/
+/*********************************************************************************************************************************
+* Structures and Typedefs *
+*********************************************************************************************************************************/
typedef struct IOAPIC
{
uint8_t id;
@@ -117,9 +118,10 @@ typedef IOAPIC *PIOAPIC;
#ifndef VBOX_DEVICE_STRUCT_TESTCASE
-/*******************************************************************************
-* Internal Functions *
-*******************************************************************************/
+
+/*********************************************************************************************************************************
+* Internal Functions *
+*********************************************************************************************************************************/
static void ioapic_service(PIOAPIC pThis)
diff --git a/src/VBox/Devices/PC/DevLPC.cpp b/src/VBox/Devices/PC/DevLPC.cpp
index d75ef7f..9d512c5 100644
--- a/src/VBox/Devices/PC/DevLPC.cpp
+++ b/src/VBox/Devices/PC/DevLPC.cpp
@@ -46,9 +46,10 @@
*
*/
-/*******************************************************************************
-* Header Files *
-*******************************************************************************/
+
+/*********************************************************************************************************************************
+* Header Files *
+*********************************************************************************************************************************/
#define LOG_GROUP LOG_GROUP_DEV_LPC
#include <VBox/vmm/pdmdev.h>
#include <VBox/log.h>
diff --git a/src/VBox/Devices/PC/DevPIC.cpp b/src/VBox/Devices/PC/DevPIC.cpp
index ce10401..13d6755 100644
--- a/src/VBox/Devices/PC/DevPIC.cpp
+++ b/src/VBox/Devices/PC/DevPIC.cpp
@@ -42,9 +42,9 @@
*/
-/*******************************************************************************
-* Header Files *
-*******************************************************************************/
+/*********************************************************************************************************************************
+* Header Files *
+*********************************************************************************************************************************/
#define LOG_GROUP LOG_GROUP_DEV_PIC
#include <VBox/vmm/pdmdev.h>
#include <VBox/log.h>
@@ -54,9 +54,9 @@
#include "VBoxDD.h"
-/*******************************************************************************
-* Defined Constants And Macros *
-*******************************************************************************/
+/*********************************************************************************************************************************
+* Defined Constants And Macros *
+*********************************************************************************************************************************/
/** @def PIC_LOCK
* Acquires the PDM lock. This is a NOP if locking is disabled. */
/** @def PIC_UNLOCK
diff --git a/src/VBox/Devices/PC/DevPcArch.cpp b/src/VBox/Devices/PC/DevPcArch.cpp
index ad8747a..04f58e5 100644
--- a/src/VBox/Devices/PC/DevPcArch.cpp
+++ b/src/VBox/Devices/PC/DevPcArch.cpp
@@ -15,9 +15,10 @@
* hope that it will be useful, but WITHOUT ANY WARRANTY of any kind.
*/
-/*******************************************************************************
-* Header Files *
-*******************************************************************************/
+
+/*********************************************************************************************************************************
+* Header Files *
+*********************************************************************************************************************************/
#define LOG_GROUP LOG_GROUP_DEV_PC_ARCH
#include <VBox/vmm/pdmdev.h>
#include <VBox/vmm/mm.h>
@@ -29,9 +30,9 @@
#include "VBoxDD.h"
-/*******************************************************************************
-* Structures and Typedefs *
-*******************************************************************************/
+/*********************************************************************************************************************************
+* Structures and Typedefs *
+*********************************************************************************************************************************/
/**
* PC Bios instance data structure.
diff --git a/src/VBox/Devices/PC/DevPcBios.cpp b/src/VBox/Devices/PC/DevPcBios.cpp
index 29b4c4c..ea95260 100644
--- a/src/VBox/Devices/PC/DevPcBios.cpp
+++ b/src/VBox/Devices/PC/DevPcBios.cpp
@@ -15,9 +15,10 @@
* hope that it will be useful, but WITHOUT ANY WARRANTY of any kind.
*/
-/*******************************************************************************
-* Header Files *
-*******************************************************************************/
+
+/*********************************************************************************************************************************
+* Header Files *
+*********************************************************************************************************************************/
#define LOG_GROUP LOG_GROUP_DEV_PC_BIOS
#include <VBox/vmm/pdmdev.h>
#include <VBox/vmm/mm.h>
@@ -122,9 +123,9 @@
*/
-/*******************************************************************************
-* Structures and Typedefs *
-*******************************************************************************/
+/*********************************************************************************************************************************
+* Structures and Typedefs *
+*********************************************************************************************************************************/
/**
* The boot device.
diff --git a/src/VBox/Devices/PC/DevPit-i8254.cpp b/src/VBox/Devices/PC/DevPit-i8254.cpp
index ea9c0a5..56a50c3 100644
--- a/src/VBox/Devices/PC/DevPit-i8254.cpp
+++ b/src/VBox/Devices/PC/DevPit-i8254.cpp
@@ -40,9 +40,10 @@
* THE SOFTWARE.
*/
-/*******************************************************************************
-* Header Files *
-*******************************************************************************/
+
+/*********************************************************************************************************************************
+* Header Files *
+*********************************************************************************************************************************/
#define LOG_GROUP LOG_GROUP_DEV_PIT
#include <VBox/vmm/pdmdev.h>
#include <VBox/log.h>
@@ -59,9 +60,9 @@
#include "VBoxDD.h"
-/*******************************************************************************
-* Defined Constants And Macros *
-*******************************************************************************/
+/*********************************************************************************************************************************
+* Defined Constants And Macros *
+*********************************************************************************************************************************/
/** The PIT frequency. */
#define PIT_FREQ 1193182
@@ -146,9 +147,9 @@
-/*******************************************************************************
-* Structures and Typedefs *
-*******************************************************************************/
+/*********************************************************************************************************************************
+* Structures and Typedefs *
+*********************************************************************************************************************************/
/**
* The state of one PIT channel.
*/
@@ -239,9 +240,11 @@ typedef PITSTATE *PPITSTATE;
#ifndef VBOX_DEVICE_STRUCT_TESTCASE
-/*******************************************************************************
-* Internal Functions *
-*******************************************************************************/
+
+
+/*********************************************************************************************************************************
+* Internal Functions *
+*********************************************************************************************************************************/
#ifdef IN_RING3
static void pit_irq_timer_update(PPITCHANNEL pChan, uint64_t current_time, uint64_t now, bool in_timer);
#endif
diff --git a/src/VBox/Devices/PC/DevRTC.cpp b/src/VBox/Devices/PC/DevRTC.cpp
index 6e798fc..971adb7 100644
--- a/src/VBox/Devices/PC/DevRTC.cpp
+++ b/src/VBox/Devices/PC/DevRTC.cpp
@@ -40,9 +40,10 @@
* THE SOFTWARE.
*/
-/*******************************************************************************
-* Header Files *
-*******************************************************************************/
+
+/*********************************************************************************************************************************
+* Header Files *
+*********************************************************************************************************************************/
#define LOG_GROUP LOG_GROUP_DEV_RTC
#include <VBox/vmm/pdmdev.h>
#include <VBox/log.h>
@@ -58,9 +59,9 @@
#include "VBoxDD.h"
-/*******************************************************************************
-* Defined Constants And Macros *
-*******************************************************************************/
+/*********************************************************************************************************************************
+* Defined Constants And Macros *
+*********************************************************************************************************************************/
/*#define DEBUG_CMOS*/
#define RTC_CRC_START 0x10
#define RTC_CRC_LAST 0x2d
@@ -111,9 +112,9 @@
#define RTC_SAVED_STATE_VERSION_VBOX_30 1
-/*******************************************************************************
-* Structures and Typedefs *
-*******************************************************************************/
+/*********************************************************************************************************************************
+* Structures and Typedefs *
+*********************************************************************************************************************************/
/** @todo Replace struct my_tm with RTTIME. */
struct my_tm
{
diff --git a/src/VBox/Devices/PC/DrvACPI.cpp b/src/VBox/Devices/PC/DrvACPI.cpp
index d08e29d..cce83fb 100644
--- a/src/VBox/Devices/PC/DrvACPI.cpp
+++ b/src/VBox/Devices/PC/DrvACPI.cpp
@@ -15,9 +15,10 @@
* hope that it will be useful, but WITHOUT ANY WARRANTY of any kind.
*/
-/*******************************************************************************
-* Header Files *
-*******************************************************************************/
+
+/*********************************************************************************************************************************
+* Header Files *
+*********************************************************************************************************************************/
#define LOG_GROUP LOG_GROUP_DRV_ACPI
#ifdef RT_OS_WINDOWS
@@ -58,9 +59,9 @@
#include "VBoxDD.h"
-/*******************************************************************************
-* Structures and Typedefs *
-*******************************************************************************/
+/*********************************************************************************************************************************
+* Structures and Typedefs *
+*********************************************************************************************************************************/
/**
* ACPI driver instance data.
*
diff --git a/src/VBox/Devices/PC/DrvAcpiCpu.cpp b/src/VBox/Devices/PC/DrvAcpiCpu.cpp
index ccf6e79..f7dac0b 100644
--- a/src/VBox/Devices/PC/DrvAcpiCpu.cpp
+++ b/src/VBox/Devices/PC/DrvAcpiCpu.cpp
@@ -15,9 +15,10 @@
* hope that it will be useful, but WITHOUT ANY WARRANTY of any kind.
*/
-/*******************************************************************************
-* Header Files *
-*******************************************************************************/
+
+/*********************************************************************************************************************************
+* Header Files *
+*********************************************************************************************************************************/
#define LOG_GROUP LOG_GROUP_DRV_ACPI
#include <VBox/vmm/pdmdrv.h>
diff --git a/src/VBox/Devices/Parallel/DevParallel.cpp b/src/VBox/Devices/Parallel/DevParallel.cpp
index c315caf..8cf0e2f 100644
--- a/src/VBox/Devices/Parallel/DevParallel.cpp
+++ b/src/VBox/Devices/Parallel/DevParallel.cpp
@@ -18,9 +18,10 @@
* hope that it will be useful, but WITHOUT ANY WARRANTY of any kind.
*/
-/*******************************************************************************
-* Header Files *
-*******************************************************************************/
+
+/*********************************************************************************************************************************
+* Header Files *
+*********************************************************************************************************************************/
#define LOG_GROUP LOG_GROUP_DEV_PARALLEL
#include <VBox/vmm/pdmdev.h>
#include <iprt/assert.h>
@@ -31,9 +32,9 @@
#include "VBoxDD.h"
-/*******************************************************************************
-* Defined Constants And Macros *
-*******************************************************************************/
+/*********************************************************************************************************************************
+* Defined Constants And Macros *
+*********************************************************************************************************************************/
#define PARALLEL_SAVED_STATE_VERSION 1
/* defines for accessing the register bits */
@@ -84,9 +85,9 @@
#define LPT_ECP_FIFO_DEPTH 2
-/*******************************************************************************
-* Structures and Typedefs *
-*******************************************************************************/
+/*********************************************************************************************************************************
+* Structures and Typedefs *
+*********************************************************************************************************************************/
/**
* Parallel device state.
*
@@ -154,9 +155,9 @@ typedef struct PARALLELPORT
#define PDMIBASE_2_PARALLELPORT(pInstance) ( (PARALLELPORT *)((uintptr_t)(pInterface) - RT_OFFSETOF(PARALLELPORT, IBase)) )
-/*******************************************************************************
-* Internal Functions *
-*******************************************************************************/
+/*********************************************************************************************************************************
+* Internal Functions *
+*********************************************************************************************************************************/
RT_C_DECLS_BEGIN
PDMBOTHCBDECL(int) parallelIOPortRead(PPDMDEVINS pDevIns, void *pvUser, RTIOPORT Port, uint32_t *pu32, unsigned cb);
PDMBOTHCBDECL(int) parallelIOPortWrite(PPDMDEVINS pDevIns, void *pvUser, RTIOPORT Port, uint32_t u32, unsigned cb);
diff --git a/src/VBox/Devices/Parallel/DrvHostParallel.cpp b/src/VBox/Devices/Parallel/DrvHostParallel.cpp
index 1859cd0..f11d1f5 100644
--- a/src/VBox/Devices/Parallel/DrvHostParallel.cpp
+++ b/src/VBox/Devices/Parallel/DrvHostParallel.cpp
@@ -17,9 +17,10 @@
* hope that it will be useful, but WITHOUT ANY WARRANTY of any kind.
*/
-/*******************************************************************************
-* Header Files *
-*******************************************************************************/
+
+/*********************************************************************************************************************************
+* Header Files *
+*********************************************************************************************************************************/
#define LOG_GROUP LOG_GROUP_DRV_HOST_PARALLEL
#include <VBox/vmm/pdmdrv.h>
#include <VBox/vmm/pdmthread.h>
@@ -71,9 +72,9 @@
#include "VBoxDD.h"
-/*******************************************************************************
-* Structures and Typedefs *
-*******************************************************************************/
+/*********************************************************************************************************************************
+* Structures and Typedefs *
+*********************************************************************************************************************************/
/**
* Host parallel port driver instance data.
* @implements PDMIHOSTPARALLELCONNECTOR
@@ -156,9 +157,9 @@ typedef enum DRVHOSTPARALLELR0OP
#define PDMIHOSTPARALLELCONNECTOR_2_DRVHOSTPARALLEL(pInterface) ( (PDRVHOSTPARALLEL)((uintptr_t)pInterface - RT_OFFSETOF(DRVHOSTPARALLEL, CTX_SUFF(IHostParallelConnector))) )
-/*******************************************************************************
-* Defined Constants And Macros *
-*******************************************************************************/
+/*********************************************************************************************************************************
+* Defined Constants And Macros *
+*********************************************************************************************************************************/
#define CTRL_REG_OFFSET 2
#define STATUS_REG_OFFSET 1
#define LPT_CONTROL_ENABLE_BIDIRECT 0x20
diff --git a/src/VBox/Devices/Samples/DrvStorageFilter.cpp b/src/VBox/Devices/Samples/DrvStorageFilter.cpp
index 6c4d49b..2fb4272 100644
--- a/src/VBox/Devices/Samples/DrvStorageFilter.cpp
+++ b/src/VBox/Devices/Samples/DrvStorageFilter.cpp
@@ -16,9 +16,9 @@
*/
-/*******************************************************************************
-* Header Files *
-*******************************************************************************/
+/*********************************************************************************************************************************
+* Header Files *
+*********************************************************************************************************************************/
#define LOG_GROUP LOG_GROUP_MISC
#include <VBox/vmm/pdmifs.h>
#include <VBox/vmm/pdmdrv.h>
@@ -27,9 +27,9 @@
#include <iprt/uuid.h>
-/*******************************************************************************
-* Structures and Typedefs *
-*******************************************************************************/
+/*********************************************************************************************************************************
+* Structures and Typedefs *
+*********************************************************************************************************************************/
/**
* Storage Filter Driver Instance Data.
*/
diff --git a/src/VBox/Devices/Samples/VBoxSampleDevice.cpp b/src/VBox/Devices/Samples/VBoxSampleDevice.cpp
index 8bc5bcf..a4b31ae 100644
--- a/src/VBox/Devices/Samples/VBoxSampleDevice.cpp
+++ b/src/VBox/Devices/Samples/VBoxSampleDevice.cpp
@@ -16,9 +16,9 @@
*/
-/*******************************************************************************
-* Header Files *
-*******************************************************************************/
+/*********************************************************************************************************************************
+* Header Files *
+*********************************************************************************************************************************/
#define LOG_GROUP LOG_GROUP_MISC
#include <VBox/vmm/pdmdev.h>
#include <VBox/version.h>
@@ -28,9 +28,9 @@
#include <iprt/assert.h>
-/*******************************************************************************
-* Structures and Typedefs *
-*******************************************************************************/
+/*********************************************************************************************************************************
+* Structures and Typedefs *
+*********************************************************************************************************************************/
/**
* Device Instance Data.
*/
diff --git a/src/VBox/Devices/Serial/DevSerial.cpp b/src/VBox/Devices/Serial/DevSerial.cpp
index 689b328..493011f 100644
--- a/src/VBox/Devices/Serial/DevSerial.cpp
+++ b/src/VBox/Devices/Serial/DevSerial.cpp
@@ -43,9 +43,10 @@
* THE SOFTWARE.
*/
-/*******************************************************************************
-* Header Files *
-*******************************************************************************/
+
+/*********************************************************************************************************************************
+* Header Files *
+*********************************************************************************************************************************/
#define LOG_GROUP LOG_GROUP_DEV_SERIAL
#include <VBox/vmm/pdmdev.h>
#include <iprt/assert.h>
@@ -63,9 +64,9 @@
#endif /* VBOX_SERIAL_PCI */
-/*******************************************************************************
-* Defined Constants And Macros *
-*******************************************************************************/
+/*********************************************************************************************************************************
+* Defined Constants And Macros *
+*********************************************************************************************************************************/
#define SERIAL_SAVED_STATE_VERSION_16450 3
#define SERIAL_SAVED_STATE_VERSION_MISSING_BITS 4
#define SERIAL_SAVED_STATE_VERSION 5
@@ -141,9 +142,10 @@
#define MIN_XMIT_RETRY 16
#define MAX_XMIT_RETRY_TIME 1 /* max time (in seconds) for retrying the character xmit before dropping it */
-/*******************************************************************************
-* Structures and Typedefs *
-*******************************************************************************/
+
+/*********************************************************************************************************************************
+* Structures and Typedefs *
+*********************************************************************************************************************************/
struct SerialFifo
{
diff --git a/src/VBox/Devices/Serial/DrvChar.cpp b/src/VBox/Devices/Serial/DrvChar.cpp
index 8186a01..83fca95 100644
--- a/src/VBox/Devices/Serial/DrvChar.cpp
+++ b/src/VBox/Devices/Serial/DrvChar.cpp
@@ -22,9 +22,9 @@
*/
-/*******************************************************************************
-* Header Files *
-*******************************************************************************/
+/*********************************************************************************************************************************
+* Header Files *
+*********************************************************************************************************************************/
#define LOG_GROUP LOG_GROUP_DRV_CHAR
#include <VBox/vmm/pdmdrv.h>
#include <iprt/asm.h>
@@ -36,16 +36,16 @@
#include "VBoxDD.h"
-/*******************************************************************************
-* Defined Constants And Macros *
-*******************************************************************************/
+/*********************************************************************************************************************************
+* Defined Constants And Macros *
+*********************************************************************************************************************************/
/** Converts a pointer to DRVCHAR::ICharConnector to a PDRVCHAR. */
#define PDMICHAR_2_DRVCHAR(pInterface) RT_FROM_MEMBER(pInterface, DRVCHAR, ICharConnector)
-/*******************************************************************************
-* Structures and Typedefs *
-*******************************************************************************/
+/*********************************************************************************************************************************
+* Structures and Typedefs *
+*********************************************************************************************************************************/
/**
* Char driver instance data.
*
diff --git a/src/VBox/Devices/Serial/DrvHostSerial.cpp b/src/VBox/Devices/Serial/DrvHostSerial.cpp
index 2e2d5ca..52d3bad 100644
--- a/src/VBox/Devices/Serial/DrvHostSerial.cpp
+++ b/src/VBox/Devices/Serial/DrvHostSerial.cpp
@@ -17,9 +17,9 @@
-/*******************************************************************************
-* Header Files *
-*******************************************************************************/
+/*********************************************************************************************************************************
+* Header Files *
+*********************************************************************************************************************************/
#define LOG_GROUP LOG_GROUP_DRV_HOST_SERIAL
#include <VBox/vmm/pdm.h>
#include <VBox/err.h>
@@ -72,9 +72,9 @@
#include "VBoxDD.h"
-/*******************************************************************************
-* Structures and Typedefs *
-*******************************************************************************/
+/*********************************************************************************************************************************
+* Structures and Typedefs *
+*********************************************************************************************************************************/
/**
* Char driver instance data.
diff --git a/src/VBox/Devices/Serial/DrvNamedPipe.cpp b/src/VBox/Devices/Serial/DrvNamedPipe.cpp
index 5b09f75..5230830 100644
--- a/src/VBox/Devices/Serial/DrvNamedPipe.cpp
+++ b/src/VBox/Devices/Serial/DrvNamedPipe.cpp
@@ -16,9 +16,9 @@
*/
-/*******************************************************************************
-* Header Files *
-*******************************************************************************/
+/*********************************************************************************************************************************
+* Header Files *
+*********************************************************************************************************************************/
#define LOG_GROUP LOG_GROUP_DRV_NAMEDPIPE
#include <VBox/vmm/pdmdrv.h>
#include <iprt/assert.h>
@@ -45,16 +45,16 @@
#endif /* !RT_OS_WINDOWS */
-/*******************************************************************************
-* Defined Constants And Macros *
-*******************************************************************************/
+/*********************************************************************************************************************************
+* Defined Constants And Macros *
+*********************************************************************************************************************************/
/** Converts a pointer to DRVNAMEDPIPE::IMedia to a PDRVNAMEDPIPE. */
#define PDMISTREAM_2_DRVNAMEDPIPE(pInterface) ( (PDRVNAMEDPIPE)((uintptr_t)pInterface - RT_OFFSETOF(DRVNAMEDPIPE, IStream)) )
-/*******************************************************************************
-* Structures and Typedefs *
-*******************************************************************************/
+/*********************************************************************************************************************************
+* Structures and Typedefs *
+*********************************************************************************************************************************/
/**
* Named pipe driver instance data.
*
@@ -92,9 +92,9 @@ typedef struct DRVNAMEDPIPE
} DRVNAMEDPIPE, *PDRVNAMEDPIPE;
-/*******************************************************************************
-* Internal Functions *
-*******************************************************************************/
+/*********************************************************************************************************************************
+* Internal Functions *
+*********************************************************************************************************************************/
/** @copydoc PDMISTREAM::pfnRead */
diff --git a/src/VBox/Devices/Serial/DrvRawFile.cpp b/src/VBox/Devices/Serial/DrvRawFile.cpp
index db302e1..bb21c13 100644
--- a/src/VBox/Devices/Serial/DrvRawFile.cpp
+++ b/src/VBox/Devices/Serial/DrvRawFile.cpp
@@ -16,9 +16,9 @@
*/
-/*******************************************************************************
-* Header Files *
-*******************************************************************************/
+/*********************************************************************************************************************************
+* Header Files *
+*********************************************************************************************************************************/
#define LOG_GROUP LOG_GROUP_DEFAULT
#include <VBox/vmm/pdmdrv.h>
#include <iprt/assert.h>
@@ -32,16 +32,16 @@
#include "VBoxDD.h"
-/*******************************************************************************
-* Defined Constants And Macros *
-*******************************************************************************/
+/*********************************************************************************************************************************
+* Defined Constants And Macros *
+*********************************************************************************************************************************/
/** Converts a pointer to DRVRAWFILE::IMedia to a PDRVRAWFILE. */
#define PDMISTREAM_2_DRVRAWFILE(pInterface) ( (PDRVRAWFILE)((uintptr_t)pInterface - RT_OFFSETOF(DRVRAWFILE, IStream)) )
-/*******************************************************************************
-* Structures and Typedefs *
-*******************************************************************************/
+/*********************************************************************************************************************************
+* Structures and Typedefs *
+*********************************************************************************************************************************/
/**
* Raw file output driver instance data.
*
diff --git a/src/VBox/Devices/Serial/DrvTCP.cpp b/src/VBox/Devices/Serial/DrvTCP.cpp
index ac7a254..d573a16 100644
--- a/src/VBox/Devices/Serial/DrvTCP.cpp
+++ b/src/VBox/Devices/Serial/DrvTCP.cpp
@@ -18,9 +18,9 @@
*/
-/*******************************************************************************
-* Header Files *
-*******************************************************************************/
+/*********************************************************************************************************************************
+* Header Files *
+*********************************************************************************************************************************/
#define LOG_GROUP LOG_GROUP_DRV_TCP
#include <VBox/vmm/pdmdrv.h>
#include <iprt/assert.h>
@@ -56,15 +56,17 @@
# endif
#endif
-/*******************************************************************************
-* Defined Constants And Macros *
-*******************************************************************************/
+
+/*********************************************************************************************************************************
+* Defined Constants And Macros *
+*********************************************************************************************************************************/
/** Converts a pointer to DRVTCP::IMedia to a PDRVTCP. */
#define PDMISTREAM_2_DRVTCP(pInterface) ( (PDRVTCP)((uintptr_t)pInterface - RT_OFFSETOF(DRVTCP, IStream)) )
-/*******************************************************************************
-* Structures and Typedefs *
-*******************************************************************************/
+
+/*********************************************************************************************************************************
+* Structures and Typedefs *
+*********************************************************************************************************************************/
/**
* TCP driver instance data.
*
@@ -93,9 +95,9 @@ typedef struct DRVTCP
} DRVTCP, *PDRVTCP;
-/*******************************************************************************
-* Internal Functions *
-*******************************************************************************/
+/*********************************************************************************************************************************
+* Internal Functions *
+*********************************************************************************************************************************/
/** @copydoc PDMISTREAM::pfnRead */
diff --git a/src/VBox/Devices/Storage/DevAHCI.cpp b/src/VBox/Devices/Storage/DevAHCI.cpp
index aa2beff..fa0c458 100644
--- a/src/VBox/Devices/Storage/DevAHCI.cpp
+++ b/src/VBox/Devices/Storage/DevAHCI.cpp
@@ -33,9 +33,10 @@
* development. [not quite up to date]
*/
-/*******************************************************************************
-* Header Files *
-*******************************************************************************/
+
+/*********************************************************************************************************************************
+* Header Files *
+*********************************************************************************************************************************/
#define LOG_GROUP LOG_GROUP_DEV_AHCI
#include <VBox/vmm/pdmdev.h>
#include <VBox/vmm/pdmqueue.h>
@@ -1070,7 +1071,7 @@ static int ahciHbaSetInterrupt(PAHCI pAhci, uint8_t iPort, int rcBusy)
/*
* Assert irq when an CCC timeout occurs
*/
-DECLCALLBACK(void) ahciCccTimer(PPDMDEVINS pDevIns, PTMTIMER pTimer, void *pvUser)
+static DECLCALLBACK(void) ahciCccTimer(PPDMDEVINS pDevIns, PTMTIMER pTimer, void *pvUser)
{
PAHCI pAhci = (PAHCI)pvUser;
@@ -4361,7 +4362,7 @@ static int atapiDoTransfer(PAHCIPort pAhciPort, PAHCIREQ pAhciReq, size_t cbMax,
return rcSourceSink;
}
-static int atapiReadSectors2352PostProcess(PAHCIREQ pAhciReq, void **ppvProc, size_t *pcbProc)
+static DECLCALLBACK(int) atapiReadSectors2352PostProcess(PAHCIREQ pAhciReq, void **ppvProc, size_t *pcbProc)
{
uint8_t *pbBuf = NULL;
uint32_t cSectors = pAhciReq->cbTransfer / 2048;
diff --git a/src/VBox/Devices/Storage/DevATA.cpp b/src/VBox/Devices/Storage/DevATA.cpp
index 28191dd..4469284 100644
--- a/src/VBox/Devices/Storage/DevATA.cpp
+++ b/src/VBox/Devices/Storage/DevATA.cpp
@@ -16,9 +16,9 @@
*/
-/*******************************************************************************
-* Defined Constants And Macros *
-*******************************************************************************/
+/*********************************************************************************************************************************
+* Defined Constants And Macros *
+*********************************************************************************************************************************/
/** Temporary instrumentation for tracking down potential virtual disk
* write performance issues. */
#undef VBOX_INSTRUMENT_DMA_WRITES
@@ -37,9 +37,9 @@
/** @} */
-/*******************************************************************************
-* Header Files *
-*******************************************************************************/
+/*********************************************************************************************************************************
+* Header Files *
+*********************************************************************************************************************************/
#define LOG_GROUP LOG_GROUP_DEV_IDE
#include <VBox/vmm/pdmdev.h>
#include <iprt/assert.h>
@@ -66,9 +66,9 @@
#include "VBoxDD.h"
-/*******************************************************************************
-* Defined Constants And Macros *
-*******************************************************************************/
+/*********************************************************************************************************************************
+* Defined Constants And Macros *
+*********************************************************************************************************************************/
/**
* Maximum number of sectors to transfer in a READ/WRITE MULTIPLE request.
* Set to 1 to disable multi-sector read support. According to the ATA
@@ -107,9 +107,10 @@
#define ATA_MEDIA_TYPE_UNKNOWN 0 /**< unknown CD type */
#define ATA_MEDIA_NO_DISC 0x70 /**< Door closed, no medium */
-/*******************************************************************************
-* Structures and Typedefs *
-*******************************************************************************/
+
+/*********************************************************************************************************************************
+* Structures and Typedefs *
+*********************************************************************************************************************************/
/**
* The state of an ATA device.
*
@@ -522,9 +523,11 @@ typedef struct PCIATAState
#define PDMIBLOCKPORT_2_ATASTATE(pInterface) ( (ATADevState *)((uintptr_t)(pInterface) - RT_OFFSETOF(ATADevState, IPort)) )
#ifndef VBOX_DEVICE_STRUCT_TESTCASE
-/*******************************************************************************
- * Internal Functions *
- ******************************************************************************/
+
+
+/*********************************************************************************************************************************
+* Internal Functions *
+*********************************************************************************************************************************/
RT_C_DECLS_BEGIN
PDMBOTHCBDECL(int) ataIOPortWrite1Data(PPDMDEVINS pDevIns, void *pvUser, RTIOPORT Port, uint32_t u32, unsigned cb);
diff --git a/src/VBox/Devices/Storage/DevBusLogic.cpp b/src/VBox/Devices/Storage/DevBusLogic.cpp
index 713d1c9..d919c78 100644
--- a/src/VBox/Devices/Storage/DevBusLogic.cpp
+++ b/src/VBox/Devices/Storage/DevBusLogic.cpp
@@ -18,9 +18,9 @@
*/
-/*******************************************************************************
-* Header Files *
-*******************************************************************************/
+/*********************************************************************************************************************************
+* Header Files *
+*********************************************************************************************************************************/
#define LOG_GROUP LOG_GROUP_DEV_BUSLOGIC
#include <VBox/vmm/pdmdev.h>
#include <VBox/vmm/pdmifs.h>
@@ -41,9 +41,9 @@
#include "VBoxDD.h"
-/*******************************************************************************
-* Defined Constants And Macros *
-*******************************************************************************/
+/*********************************************************************************************************************************
+* Defined Constants And Macros *
+*********************************************************************************************************************************/
/** Maximum number of attached devices the adapter can handle. */
#define BUSLOGIC_MAX_DEVICES 16
@@ -81,9 +81,9 @@
#define BUSLOGIC_RESET_DURATION_NS UINT64_C(50000000)
-/*******************************************************************************
-* Structures and Typedefs *
-*******************************************************************************/
+/*********************************************************************************************************************************
+* Structures and Typedefs *
+*********************************************************************************************************************************/
/**
* State of a device attached to the buslogic host adapter.
*
@@ -973,9 +973,10 @@ typedef struct BUSLOGICTASKSTATE
#define PDMIBASE_2_PBUSLOGIC(pInterface) ( (PBUSLOGIC)((uintptr_t)(pInterface) - RT_OFFSETOF(BUSLOGIC, IBase)) )
#define PDMILEDPORTS_2_PBUSLOGIC(pInterface) ( (PBUSLOGIC)((uintptr_t)(pInterface) - RT_OFFSETOF(BUSLOGIC, ILeds)) )
-/*******************************************************************************
-* Internal Functions *
-*******************************************************************************/
+
+/*********************************************************************************************************************************
+* Internal Functions *
+*********************************************************************************************************************************/
static int buslogicR3RegisterISARange(PBUSLOGIC pBusLogic, uint8_t uBaseCode);
diff --git a/src/VBox/Devices/Storage/DevFdc.cpp b/src/VBox/Devices/Storage/DevFdc.cpp
index 2715d1b..a38ca14 100644
--- a/src/VBox/Devices/Storage/DevFdc.cpp
+++ b/src/VBox/Devices/Storage/DevFdc.cpp
@@ -42,9 +42,9 @@
*/
-/*******************************************************************************
-* Header Files *
-*******************************************************************************/
+/*********************************************************************************************************************************
+* Header Files *
+*********************************************************************************************************************************/
#define LOG_GROUP LOG_GROUP_DEV_FDC
#include <VBox/vmm/pdmdev.h>
#include <iprt/assert.h>
diff --git a/src/VBox/Devices/Storage/DevLsiLogicSCSI.cpp b/src/VBox/Devices/Storage/DevLsiLogicSCSI.cpp
index 80e9453..3beba9a 100644
--- a/src/VBox/Devices/Storage/DevLsiLogicSCSI.cpp
+++ b/src/VBox/Devices/Storage/DevLsiLogicSCSI.cpp
@@ -15,9 +15,10 @@
* hope that it will be useful, but WITHOUT ANY WARRANTY of any kind.
*/
-/*******************************************************************************
-* Header Files *
-*******************************************************************************/
+
+/*********************************************************************************************************************************
+* Header Files *
+*********************************************************************************************************************************/
#define LOG_GROUP LOG_GROUP_DEV_LSILOGICSCSI
#include <VBox/vmm/pdmdev.h>
#include <VBox/vmm/pdmqueue.h>
@@ -43,9 +44,9 @@
#include "VBoxDD.h"
-/*******************************************************************************
-* Defined Constants And Macros *
-*******************************************************************************/
+/*********************************************************************************************************************************
+* Defined Constants And Macros *
+*********************************************************************************************************************************/
/** The current saved state version. */
#define LSILOGIC_SAVED_STATE_VERSION 5
/** The saved state version used by VirtualBox before the diagnostic
@@ -72,9 +73,10 @@
* allocating loadds of memory). */
#define LSILOGIC_MEMORY_REGIONS_MAX (_1M)
-/*******************************************************************************
-* Structures and Typedefs *
-*******************************************************************************/
+
+/*********************************************************************************************************************************
+* Structures and Typedefs *
+*********************************************************************************************************************************/
/**
* I/O buffer copy worker.
@@ -409,9 +411,10 @@ typedef struct LSILOGICREQ
#ifndef VBOX_DEVICE_STRUCT_TESTCASE
-/*******************************************************************************
-* Internal Functions *
-*******************************************************************************/
+
+/*********************************************************************************************************************************
+* Internal Functions *
+*********************************************************************************************************************************/
RT_C_DECLS_BEGIN
#ifdef IN_RING3
static void lsilogicR3InitializeConfigurationPages(PLSILOGICSCSI pThis);
@@ -422,9 +425,9 @@ static int lsilogicR3ProcessConfigurationRequest(PLSILOGICSCSI pThis, PMptConfi
RT_C_DECLS_END
-/*******************************************************************************
-* Global Variables *
-*******************************************************************************/
+/*********************************************************************************************************************************
+* Global Variables *
+*********************************************************************************************************************************/
/** Key sequence the guest has to write to enable access
* to diagnostic memory. */
static const uint8_t g_lsilogicDiagnosticAccess[] = {0x04, 0x0b, 0x02, 0x07, 0x0d};
diff --git a/src/VBox/Devices/Storage/DrvBlock.cpp b/src/VBox/Devices/Storage/DrvBlock.cpp
index aa1c23c..9f0af1e 100644
--- a/src/VBox/Devices/Storage/DrvBlock.cpp
+++ b/src/VBox/Devices/Storage/DrvBlock.cpp
@@ -16,9 +16,9 @@
*/
-/*******************************************************************************
-* Header Files *
-*******************************************************************************/
+/*********************************************************************************************************************************
+* Header Files *
+*********************************************************************************************************************************/
#define LOG_GROUP LOG_GROUP_DRV_BLOCK
#include <VBox/vmm/pdmdrv.h>
#include <iprt/assert.h>
@@ -51,9 +51,9 @@
#define VBOX_IGNORE_FLUSH
-/*******************************************************************************
-* Structures and Typedefs *
-*******************************************************************************/
+/*********************************************************************************************************************************
+* Structures and Typedefs *
+*********************************************************************************************************************************/
/**
* Block driver instance data.
*
diff --git a/src/VBox/Devices/Storage/DrvDiskIntegrity.cpp b/src/VBox/Devices/Storage/DrvDiskIntegrity.cpp
index 7cd2440..4d3402b 100644
--- a/src/VBox/Devices/Storage/DrvDiskIntegrity.cpp
+++ b/src/VBox/Devices/Storage/DrvDiskIntegrity.cpp
@@ -16,9 +16,9 @@
*/
-/*******************************************************************************
-* Header Files *
-*******************************************************************************/
+/*********************************************************************************************************************************
+* Header Files *
+*********************************************************************************************************************************/
#define LOG_GROUP LOG_GROUP_DRV_DISK_INTEGRITY
#include <VBox/vmm/pdmdrv.h>
#include <VBox/vddbg.h>
@@ -36,9 +36,9 @@
#include "VBoxDD.h"
-/*******************************************************************************
-* Structures and Typedefs *
-*******************************************************************************/
+/*********************************************************************************************************************************
+* Structures and Typedefs *
+*********************************************************************************************************************************/
/**
* Transfer direction.
@@ -749,9 +749,10 @@ static int drvdiskintReadAfterWriteVerify(PDRVDISKINTEGRITY pThis, PDRVDISKAIORE
/** Makes a PDRVDISKINTEGRITY out of a PPDMIMEDIAASYNC. */
#define PDMIMEDIAASYNC_2_DRVDISKINTEGRITY(pInterface) ( (PDRVDISKINTEGRITY)((uintptr_t)pInterface - RT_OFFSETOF(DRVDISKINTEGRITY, IMediaAsync)) )
-/*******************************************************************************
-* Media interface methods *
-*******************************************************************************/
+
+/*********************************************************************************************************************************
+* Media interface methods *
+*********************************************************************************************************************************/
/** @copydoc PDMIMEDIA::pfnRead */
static DECLCALLBACK(int) drvdiskintRead(PPDMIMEDIA pInterface,
diff --git a/src/VBox/Devices/Storage/DrvHostBase.cpp b/src/VBox/Devices/Storage/DrvHostBase.cpp
index 5e2778a..5592613 100644
--- a/src/VBox/Devices/Storage/DrvHostBase.cpp
+++ b/src/VBox/Devices/Storage/DrvHostBase.cpp
@@ -16,9 +16,9 @@
*/
-/*******************************************************************************
-* Header Files *
-*******************************************************************************/
+/*********************************************************************************************************************************
+* Header Files *
+*********************************************************************************************************************************/
#define LOG_GROUP LOG_GROUP_DRV_HOST_BASE
#ifdef RT_OS_DARWIN
# include <mach/mach.h>
@@ -1174,7 +1174,7 @@ static int drvHostBaseReopen(PDRVHOSTBASE pThis)
* @param pThis Pointer to the instance data.
* @param pcb Where to store the media size in bytes.
*/
-static int drvHostBaseGetMediaSize(PDRVHOSTBASE pThis, uint64_t *pcb)
+static DECLCALLBACK(int) drvHostBaseGetMediaSize(PDRVHOSTBASE pThis, uint64_t *pcb)
{
#if defined(RT_OS_DARWIN) || defined(RT_OS_FREEBSD)
/*
diff --git a/src/VBox/Devices/Storage/DrvHostDVD.cpp b/src/VBox/Devices/Storage/DrvHostDVD.cpp
index 58fb917..63cc4cc 100644
--- a/src/VBox/Devices/Storage/DrvHostDVD.cpp
+++ b/src/VBox/Devices/Storage/DrvHostDVD.cpp
@@ -16,9 +16,9 @@
*/
-/*******************************************************************************
-* Header Files *
-*******************************************************************************/
+/*********************************************************************************************************************************
+* Header Files *
+*********************************************************************************************************************************/
#define LOG_GROUP LOG_GROUP_DRV_HOST_DVD
#define __STDC_LIMIT_MACROS
#define __STDC_CONSTANT_MACROS
@@ -112,9 +112,9 @@
#include "DrvHostBase.h"
-/*******************************************************************************
-* Internal Functions *
-*******************************************************************************/
+/*********************************************************************************************************************************
+* Internal Functions *
+*********************************************************************************************************************************/
static DECLCALLBACK(int) drvHostDvdDoLock(PDRVHOSTBASE pThis, bool fLock);
#ifdef VBOX_WITH_SUID_WRAPPER
static int solarisCheckUserAuth();
@@ -300,7 +300,7 @@ static DECLCALLBACK(int) drvHostDvdDoLock(PDRVHOSTBASE pThis, bool fLock)
* @param pThis The instance data.
* @param pcb Where to store the size.
*/
-static int drvHostDvdGetMediaSize(PDRVHOSTBASE pThis, uint64_t *pcb)
+static DECLCALLBACK(int) drvHostDvdGetMediaSize(PDRVHOSTBASE pThis, uint64_t *pcb)
{
/*
* Query the media size.
@@ -317,7 +317,7 @@ static int drvHostDvdGetMediaSize(PDRVHOSTBASE pThis, uint64_t *pcb)
/**
* Do media change polling.
*/
-DECLCALLBACK(int) drvHostDvdPoll(PDRVHOSTBASE pThis)
+static DECLCALLBACK(int) drvHostDvdPoll(PDRVHOSTBASE pThis)
{
/*
* Poll for media change.
@@ -414,9 +414,9 @@ DECLCALLBACK(int) drvHostDvdPoll(PDRVHOSTBASE pThis)
/** @copydoc PDMIBLOCK::pfnSendCmd */
-static int drvHostDvdSendCmd(PPDMIBLOCK pInterface, const uint8_t *pbCmd,
- PDMBLOCKTXDIR enmTxDir, void *pvBuf, uint32_t *pcbBuf,
- uint8_t *pabSense, size_t cbSense, uint32_t cTimeoutMillies)
+static DECLCALLBACK(int) drvHostDvdSendCmd(PPDMIBLOCK pInterface, const uint8_t *pbCmd,
+ PDMBLOCKTXDIR enmTxDir, void *pvBuf, uint32_t *pcbBuf,
+ uint8_t *pabSense, size_t cbSense, uint32_t cTimeoutMillies)
{
PDRVHOSTBASE pThis = PDMIBLOCK_2_DRVHOSTBASE(pInterface);
int rc;
@@ -725,7 +725,7 @@ static int solarisExitRootMode(uid_t *pEffUserID)
/** @copydoc FNPDMDRVDESTRUCT */
-DECLCALLBACK(void) drvHostDvdDestruct(PPDMDRVINS pDrvIns)
+static DECLCALLBACK(void) drvHostDvdDestruct(PPDMDRVINS pDrvIns)
{
#ifdef RT_OS_LINUX
PDRVHOSTBASE pThis = PDMINS_2_DATA(pDrvIns, PDRVHOSTBASE);
diff --git a/src/VBox/Devices/Storage/DrvHostFloppy.cpp b/src/VBox/Devices/Storage/DrvHostFloppy.cpp
index f387233..b05b494 100644
--- a/src/VBox/Devices/Storage/DrvHostFloppy.cpp
+++ b/src/VBox/Devices/Storage/DrvHostFloppy.cpp
@@ -18,9 +18,9 @@
*/
-/*******************************************************************************
-* Header Files *
-*******************************************************************************/
+/*********************************************************************************************************************************
+* Header Files *
+*********************************************************************************************************************************/
#define LOG_GROUP LOG_GROUP_DRV_HOST_FLOPPY
#ifdef RT_OS_LINUX
# include <sys/ioctl.h>
diff --git a/src/VBox/Devices/Storage/DrvMediaISO.cpp b/src/VBox/Devices/Storage/DrvMediaISO.cpp
index 93ab030..60348a5 100644
--- a/src/VBox/Devices/Storage/DrvMediaISO.cpp
+++ b/src/VBox/Devices/Storage/DrvMediaISO.cpp
@@ -15,9 +15,10 @@
* hope that it will be useful, but WITHOUT ANY WARRANTY of any kind.
*/
-/*******************************************************************************
-* Header Files *
-*******************************************************************************/
+
+/*********************************************************************************************************************************
+* Header Files *
+*********************************************************************************************************************************/
#define LOG_GROUP LOG_GROUP_DRV_ISO
#include <VBox/vmm/pdmdrv.h>
#include <iprt/assert.h>
@@ -28,16 +29,16 @@
#include "VBoxDD.h"
-/*******************************************************************************
-* Defined Constants And Macros *
-*******************************************************************************/
+/*********************************************************************************************************************************
+* Defined Constants And Macros *
+*********************************************************************************************************************************/
/** Converts a pointer to MEDIAISO::IMedia to a PRDVMEDIAISO. */
#define PDMIMEDIA_2_DRVMEDIAISO(pInterface) ( (PDRVMEDIAISO)((uintptr_t)pInterface - RT_OFFSETOF(DRVMEDIAISO, IMedia)) )
-/*******************************************************************************
-* Structures and Typedefs *
-*******************************************************************************/
+/*********************************************************************************************************************************
+* Structures and Typedefs *
+*********************************************************************************************************************************/
/**
* Block driver instance data.
*
diff --git a/src/VBox/Devices/Storage/DrvRawImage.cpp b/src/VBox/Devices/Storage/DrvRawImage.cpp
index 5ce0bae..7253530 100644
--- a/src/VBox/Devices/Storage/DrvRawImage.cpp
+++ b/src/VBox/Devices/Storage/DrvRawImage.cpp
@@ -16,9 +16,9 @@
*/
-/*******************************************************************************
-* Header Files *
-*******************************************************************************/
+/*********************************************************************************************************************************
+* Header Files *
+*********************************************************************************************************************************/
#define LOG_GROUP LOG_GROUP_DRV_RAW_IMAGE
#include <VBox/vmm/pdmdrv.h>
#include <iprt/assert.h>
@@ -29,9 +29,9 @@
#include "VBoxDD.h"
-/*******************************************************************************
-* Structures and Typedefs *
-*******************************************************************************/
+/*********************************************************************************************************************************
+* Structures and Typedefs *
+*********************************************************************************************************************************/
/**
* Block driver instance data.
*
diff --git a/src/VBox/Devices/Storage/DrvSCSI.cpp b/src/VBox/Devices/Storage/DrvSCSI.cpp
index 09c3391..690fc65 100644
--- a/src/VBox/Devices/Storage/DrvSCSI.cpp
+++ b/src/VBox/Devices/Storage/DrvSCSI.cpp
@@ -15,9 +15,10 @@
* hope that it will be useful, but WITHOUT ANY WARRANTY of any kind.
*/
-/*******************************************************************************
-* Header Files *
-*******************************************************************************/
+
+/*********************************************************************************************************************************
+* Header Files *
+*********************************************************************************************************************************/
//#define DEBUG
#define LOG_GROUP LOG_GROUP_DRV_SCSI
#include <VBox/vmm/pdmdrv.h>
@@ -267,7 +268,7 @@ static DECLCALLBACK(int) drvscsiSetLock(VSCSILUN hVScsiLun, void *pvScsiLunUser,
return VINF_SUCCESS;
}
-static int drvscsiTransferCompleteNotify(PPDMIBLOCKASYNCPORT pInterface, void *pvUser, int rc)
+static DECLCALLBACK(int) drvscsiTransferCompleteNotify(PPDMIBLOCKASYNCPORT pInterface, void *pvUser, int rc)
{
PDRVSCSI pThis = PDMIBLOCKASYNCPORT_2_DRVSCSI(pInterface);
VSCSIIOREQ hVScsiIoReq = (VSCSIIOREQ)pvUser;
@@ -476,9 +477,9 @@ static DECLCALLBACK(int) drvscsiGetFeatureFlags(VSCSILUN hVScsiLun,
return VINF_SUCCESS;
}
-static void drvscsiVScsiReqCompleted(VSCSIDEVICE hVScsiDevice, void *pVScsiDeviceUser,
- void *pVScsiReqUser, int rcScsiCode, bool fRedoPossible,
- int rcReq)
+static DECLCALLBACK(void) drvscsiVScsiReqCompleted(VSCSIDEVICE hVScsiDevice, void *pVScsiDeviceUser,
+ void *pVScsiReqUser, int rcScsiCode, bool fRedoPossible,
+ int rcReq)
{
PDRVSCSI pThis = (PDRVSCSI)pVScsiDeviceUser;
@@ -525,7 +526,7 @@ static int drvscsiAsyncIOLoopWakeupFunc(PDRVSCSI pThis)
* @param pDrvIns Pointer to the driver instance data.
* @param pThread Pointer to the thread instance data.
*/
-static int drvscsiAsyncIOLoop(PPDMDRVINS pDrvIns, PPDMTHREAD pThread)
+static DECLCALLBACK(int) drvscsiAsyncIOLoop(PPDMDRVINS pDrvIns, PPDMTHREAD pThread)
{
int rc = VINF_SUCCESS;
PDRVSCSI pThis = PDMINS_2_DATA(pDrvIns, PDRVSCSI);
@@ -564,7 +565,7 @@ static bool drvscsiAsyncIOLoopNoPendingDummy(PDRVSCSI pThis, uint32_t cMillies)
return true;
}
-static int drvscsiAsyncIOLoopWakeup(PPDMDRVINS pDrvIns, PPDMTHREAD pThread)
+static DECLCALLBACK(int) drvscsiAsyncIOLoopWakeup(PPDMDRVINS pDrvIns, PPDMTHREAD pThread)
{
PDRVSCSI pThis = PDMINS_2_DATA(pDrvIns, PDRVSCSI);
PRTREQ pReq;
diff --git a/src/VBox/Devices/Storage/DrvSCSIHost.cpp b/src/VBox/Devices/Storage/DrvSCSIHost.cpp
index 573f1ca..feaa365 100644
--- a/src/VBox/Devices/Storage/DrvSCSIHost.cpp
+++ b/src/VBox/Devices/Storage/DrvSCSIHost.cpp
@@ -15,9 +15,10 @@
* hope that it will be useful, but WITHOUT ANY WARRANTY of any kind.
*/
-/*******************************************************************************
-* Header Files *
-*******************************************************************************/
+
+/*********************************************************************************************************************************
+* Header Files *
+*********************************************************************************************************************************/
//#define DEBUG
#define LOG_GROUP LOG_GROUP_DRV_SCSIHOST
#include <VBox/vmm/pdmdrv.h>
@@ -339,7 +340,7 @@ static int drvscsihostAsyncIOLoopWakeupFunc(void)
* @param pDrvIns Pointer to the device instance data.
* @param pThread Pointer to the thread instance data.
*/
-static int drvscsihostAsyncIOLoop(PPDMDRVINS pDrvIns, PPDMTHREAD pThread)
+static DECLCALLBACK(int) drvscsihostAsyncIOLoop(PPDMDRVINS pDrvIns, PPDMTHREAD pThread)
{
int rc = VINF_SUCCESS;
PDRVSCSIHOST pThis = PDMINS_2_DATA(pDrvIns, PDRVSCSIHOST);
@@ -358,7 +359,7 @@ static int drvscsihostAsyncIOLoop(PPDMDRVINS pDrvIns, PPDMTHREAD pThread)
return VINF_SUCCESS;
}
-static int drvscsihostAsyncIOLoopWakeup(PPDMDRVINS pDrvIns, PPDMTHREAD pThread)
+static DECLCALLBACK(int) drvscsihostAsyncIOLoopWakeup(PPDMDRVINS pDrvIns, PPDMTHREAD pThread)
{
int rc;
PDRVSCSIHOST pThis = PDMINS_2_DATA(pDrvIns, PDRVSCSIHOST);
diff --git a/src/VBox/Devices/Storage/DrvVD.cpp b/src/VBox/Devices/Storage/DrvVD.cpp
index 6391fbe..98e4e61 100644
--- a/src/VBox/Devices/Storage/DrvVD.cpp
+++ b/src/VBox/Devices/Storage/DrvVD.cpp
@@ -16,9 +16,9 @@
*/
-/*******************************************************************************
-* Header files *
-*******************************************************************************/
+/*********************************************************************************************************************************
+* Header files *
+*********************************************************************************************************************************/
#define LOG_GROUP LOG_GROUP_DRV_VD
#include <VBox/vd.h>
#include <VBox/vmm/pdmdrv.h>
@@ -61,9 +61,9 @@ extern bool DevINIPConfigured(void);
#endif /* VBOX_WITH_INIP */
-/*******************************************************************************
-* Defined types, constants and macros *
-*******************************************************************************/
+/*********************************************************************************************************************************
+* Defined types, constants and macros *
+*********************************************************************************************************************************/
/** Converts a pointer to VBOXDISK::IMedia to a PVBOXDISK. */
#define PDMIMEDIA_2_VBOXDISK(pInterface) \
@@ -208,9 +208,9 @@ typedef struct VBOXDISK
} VBOXDISK, *PVBOXDISK;
-/*******************************************************************************
-* Internal Functions *
-*******************************************************************************/
+/*********************************************************************************************************************************
+* Internal Functions *
+*********************************************************************************************************************************/
/**
* Internal: allocate new image descriptor and put it in the list
@@ -294,11 +294,11 @@ static int drvvdSetWritable(PVBOXDISK pThis)
}
-/*******************************************************************************
-* Error reporting callback *
-*******************************************************************************/
+/*********************************************************************************************************************************
+* Error reporting callback *
+*********************************************************************************************************************************/
-static void drvvdErrorCallback(void *pvUser, int rc, RT_SRC_POS_DECL,
+static DECLCALLBACK(void) drvvdErrorCallback(void *pvUser, int rc, RT_SRC_POS_DECL,
const char *pszFormat, va_list va)
{
PPDMDRVINS pDrvIns = (PPDMDRVINS)pvUser;
@@ -314,9 +314,10 @@ static void drvvdErrorCallback(void *pvUser, int rc, RT_SRC_POS_DECL,
PDMDrvHlpVMSetErrorV(pDrvIns, rc, RT_SRC_POS_ARGS, pszFormat, va);
}
-/*******************************************************************************
-* VD Async I/O interface implementation *
-*******************************************************************************/
+
+/*********************************************************************************************************************************
+* VD Async I/O interface implementation *
+*********************************************************************************************************************************/
#ifdef VBOX_WITH_PDM_ASYNC_COMPLETION
@@ -609,9 +610,9 @@ static DECLCALLBACK(int) drvvdAsyncIOSetSize(void *pvUser, void *pStorage, uint6
#endif /* VBOX_WITH_PDM_ASYNC_COMPLETION */
-/*******************************************************************************
-* VD Thread Synchronization interface implementation *
-*******************************************************************************/
+/*********************************************************************************************************************************
+* VD Thread Synchronization interface implementation *
+*********************************************************************************************************************************/
static DECLCALLBACK(int) drvvdThreadStartRead(void *pvUser)
{
@@ -642,26 +643,26 @@ static DECLCALLBACK(int) drvvdThreadFinishWrite(void *pvUser)
}
-/*******************************************************************************
-* VD Configuration interface implementation *
-*******************************************************************************/
+/*********************************************************************************************************************************
+* VD Configuration interface implementation *
+*********************************************************************************************************************************/
-static bool drvvdCfgAreKeysValid(void *pvUser, const char *pszzValid)
+static DECLCALLBACK(bool) drvvdCfgAreKeysValid(void *pvUser, const char *pszzValid)
{
return CFGMR3AreValuesValid((PCFGMNODE)pvUser, pszzValid);
}
-static int drvvdCfgQuerySize(void *pvUser, const char *pszName, size_t *pcb)
+static DECLCALLBACK(int) drvvdCfgQuerySize(void *pvUser, const char *pszName, size_t *pcb)
{
return CFGMR3QuerySize((PCFGMNODE)pvUser, pszName, pcb);
}
-static int drvvdCfgQuery(void *pvUser, const char *pszName, char *pszString, size_t cchString)
+static DECLCALLBACK(int) drvvdCfgQuery(void *pvUser, const char *pszName, char *pszString, size_t cchString)
{
return CFGMR3QueryString((PCFGMNODE)pvUser, pszName, pszString, cchString);
}
-static int drvvdCfgQueryBytes(void *pvUser, const char *pszName, void *ppvData, size_t cbData)
+static DECLCALLBACK(int) drvvdCfgQueryBytes(void *pvUser, const char *pszName, void *ppvData, size_t cbData)
{
return CFGMR3QueryBytes((PCFGMNODE)pvUser, pszName, ppvData, cbData);
}
@@ -728,9 +729,11 @@ static DECLCALLBACK(int) drvvdCryptoKeyStorePasswordRelease(void *pvUser, const
}
#ifdef VBOX_WITH_INIP
-/*******************************************************************************
-* VD TCP network stack interface implementation - INIP case *
-*******************************************************************************/
+
+
+/*********************************************************************************************************************************
+* VD TCP network stack interface implementation - INIP case *
+*********************************************************************************************************************************/
/**
* vvl: this structure duplicate meaning of sockaddr,
@@ -1109,9 +1112,9 @@ static DECLCALLBACK(int) drvvdINIPPoke(VDSOCKET Sock)
#endif /* VBOX_WITH_INIP */
-/*******************************************************************************
-* VD TCP network stack interface implementation - Host TCP case *
-*******************************************************************************/
+/*********************************************************************************************************************************
+* VD TCP network stack interface implementation - Host TCP case *
+*********************************************************************************************************************************/
/**
* Socket data.
@@ -1370,8 +1373,8 @@ static DECLCALLBACK(int) drvvdTcpGetPeerAddress(VDSOCKET Sock, PRTNETADDR pAddr)
return RTTcpGetPeerAddress(pSockInt->hSocket, pAddr);
}
-static int drvvdTcpSelectOneExPoll(VDSOCKET Sock, uint32_t fEvents,
- uint32_t *pfEvents, RTMSINTERVAL cMillies)
+static DECLCALLBACK(int) drvvdTcpSelectOneExPoll(VDSOCKET Sock, uint32_t fEvents,
+ uint32_t *pfEvents, RTMSINTERVAL cMillies)
{
int rc = VINF_SUCCESS;
uint32_t id = 0;
@@ -1625,9 +1628,10 @@ static int drvvdKeyCheckPrereqs(PVBOXDISK pThis)
return VINF_SUCCESS;
}
-/*******************************************************************************
-* Media interface methods *
-*******************************************************************************/
+
+/*********************************************************************************************************************************
+* Media interface methods *
+*********************************************************************************************************************************/
/** @copydoc PDMIMEDIA::pfnRead */
static DECLCALLBACK(int) drvvdRead(PPDMIMEDIA pInterface,
@@ -2039,9 +2043,9 @@ static DECLCALLBACK(int) drvvdIoBufFree(PPDMIMEDIA pInterface, void *pv, size_t
}
-/*******************************************************************************
-* Async Media interface methods *
-*******************************************************************************/
+/*********************************************************************************************************************************
+* Async Media interface methods *
+*********************************************************************************************************************************/
static void drvvdAsyncReqComplete(void *pvUser1, void *pvUser2, int rcReq)
{
@@ -2169,7 +2173,7 @@ static DECLCALLBACK(int) drvvdStartDiscard(PPDMIMEDIAASYNC pInterface, PCRTRANGE
}
/** @copydoc FNPDMBLKCACHEXFERCOMPLETEDRV */
-static void drvvdBlkCacheXferComplete(PPDMDRVINS pDrvIns, void *pvUser, int rcReq)
+static DECLCALLBACK(void) drvvdBlkCacheXferComplete(PPDMDRVINS pDrvIns, void *pvUser, int rcReq)
{
PVBOXDISK pThis = PDMINS_2_DATA(pDrvIns, PVBOXDISK);
@@ -2179,10 +2183,10 @@ static void drvvdBlkCacheXferComplete(PPDMDRVINS pDrvIns, void *pvUser, int rcRe
}
/** @copydoc FNPDMBLKCACHEXFERENQUEUEDRV */
-static int drvvdBlkCacheXferEnqueue(PPDMDRVINS pDrvIns,
- PDMBLKCACHEXFERDIR enmXferDir,
- uint64_t off, size_t cbXfer,
- PCRTSGBUF pcSgBuf, PPDMBLKCACHEIOXFER hIoXfer)
+static DECLCALLBACK(int) drvvdBlkCacheXferEnqueue(PPDMDRVINS pDrvIns,
+ PDMBLKCACHEXFERDIR enmXferDir,
+ uint64_t off, size_t cbXfer,
+ PCRTSGBUF pcSgBuf, PPDMBLKCACHEIOXFER hIoXfer)
{
int rc = VINF_SUCCESS;
PVBOXDISK pThis = PDMINS_2_DATA(pDrvIns, PVBOXDISK);
@@ -2216,8 +2220,8 @@ static int drvvdBlkCacheXferEnqueue(PPDMDRVINS pDrvIns,
}
/** @copydoc FNPDMBLKCACHEXFERENQUEUEDISCARDDRV */
-static int drvvdBlkCacheXferEnqueueDiscard(PPDMDRVINS pDrvIns, PCRTRANGE paRanges,
- unsigned cRanges, PPDMBLKCACHEIOXFER hIoXfer)
+static DECLCALLBACK(int) drvvdBlkCacheXferEnqueueDiscard(PPDMDRVINS pDrvIns, PCRTRANGE paRanges,
+ unsigned cRanges, PPDMBLKCACHEIOXFER hIoXfer)
{
int rc = VINF_SUCCESS;
PVBOXDISK pThis = PDMINS_2_DATA(pDrvIns, PVBOXDISK);
@@ -2303,9 +2307,10 @@ static int drvvdSetupFilters(PVBOXDISK pThis, PCFGMNODE pCfg)
return rc;
}
-/*******************************************************************************
-* Base interface methods *
-*******************************************************************************/
+
+/*********************************************************************************************************************************
+* Base interface methods *
+*********************************************************************************************************************************/
/**
* @interface_method_impl{PDMIBASE,pfnQueryInterface}
@@ -2322,9 +2327,9 @@ static DECLCALLBACK(void *) drvvdQueryInterface(PPDMIBASE pInterface, const char
}
-/*******************************************************************************
-* Saved state notification methods *
-*******************************************************************************/
+/*********************************************************************************************************************************
+* Saved state notification methods *
+*********************************************************************************************************************************/
/**
* Load done callback for re-opening the image writable during teleportation.
@@ -2354,9 +2359,9 @@ static DECLCALLBACK(int) drvvdLoadDone(PPDMDRVINS pDrvIns, PSSMHANDLE pSSM)
}
-/*******************************************************************************
-* Driver methods *
-*******************************************************************************/
+/*********************************************************************************************************************************
+* Driver methods *
+*********************************************************************************************************************************/
/**
* Worker for the power off or destruct callback.
diff --git a/src/VBox/Devices/Storage/HBDMgmt-darwin.cpp b/src/VBox/Devices/Storage/HBDMgmt-darwin.cpp
index 201c23d..0766fcf 100644
--- a/src/VBox/Devices/Storage/HBDMgmt-darwin.cpp
+++ b/src/VBox/Devices/Storage/HBDMgmt-darwin.cpp
@@ -16,9 +16,9 @@
*/
-/*******************************************************************************
-* Header Files *
-*******************************************************************************/
+/*********************************************************************************************************************************
+* Header Files *
+*********************************************************************************************************************************/
#define LOG_GROUP LOG_GROUP_DRV_VD
#include <VBox/cdefs.h>
#include <VBox/err.h>
@@ -36,13 +36,14 @@
#include "HBDMgmt.h"
-/*******************************************************************************
-* Defined Constants And Macros *
-*******************************************************************************/
+/*********************************************************************************************************************************
+* Defined Constants And Macros *
+*********************************************************************************************************************************/
-/*******************************************************************************
-* Structures and Typedefs *
-*******************************************************************************/
+
+/*********************************************************************************************************************************
+* Structures and Typedefs *
+*********************************************************************************************************************************/
/**
* Claimed block device state.
@@ -95,14 +96,15 @@ typedef struct HBDMGRDACLBKARGS
} HBDMGRDACLBKARGS;
typedef HBDMGRDACLBKARGS *PHBDMGRDACLBKARGS;
-/*******************************************************************************
-* Global Variables *
-*******************************************************************************/
+
+/*********************************************************************************************************************************
+* Global Variables *
+*********************************************************************************************************************************/
-/*******************************************************************************
-* Internal Functions *
-*******************************************************************************/
+/*********************************************************************************************************************************
+* Internal Functions *
+*********************************************************************************************************************************/
/**
* Unclaims the given block device and frees its state removing it from the list.
@@ -123,7 +125,7 @@ static void hbdMgrDevUnclaim(PHBDMGRDEV pDev)
*
* @returns Pointer to the claimed block device or NULL if not claimed.
* @param pThis The block device manager.
- * @param pszFilename The name to look for.
+ * @param pszFilename The name to look for.
*/
static PHBDMGRDEV hbdMgrDevFindByName(PHBDMGRINT pThis, const char *pszFilename)
{
@@ -346,10 +348,10 @@ DECLHIDDEN(int) HBDMgrCreate(PHBDMGR phHbdMgr)
CFRelease(pThis->hRunLoopSrcWakeRef);
}
}
-
+
RTSemFastMutexDestroy(pThis->hMtxList);
}
-
+
CFRelease(pThis->hSessionRef);
}
else
diff --git a/src/VBox/Devices/Storage/HBDMgmt-win.cpp b/src/VBox/Devices/Storage/HBDMgmt-win.cpp
index 13b0d9f..4d32757 100644
--- a/src/VBox/Devices/Storage/HBDMgmt-win.cpp
+++ b/src/VBox/Devices/Storage/HBDMgmt-win.cpp
@@ -29,13 +29,15 @@
#include "HBDMgmt.h"
-/*******************************************************************************
-* Defined Constants And Macros *
-*******************************************************************************/
-/*******************************************************************************
-* Structures and Typedefs *
-*******************************************************************************/
+/*********************************************************************************************************************************
+* Defined Constants And Macros *
+*********************************************************************************************************************************/
+
+
+/*********************************************************************************************************************************
+* Structures and Typedefs *
+*********************************************************************************************************************************/
/**
* Claimed block device state.
@@ -69,14 +71,15 @@ typedef HBDMGRINT *PHBDMGRINT;
#define HBDMGR_NT_HARDDISK_START "\\Device\\Harddisk"
-/*******************************************************************************
-* Global Variables *
-*******************************************************************************/
+
+/*********************************************************************************************************************************
+* Global Variables *
+*********************************************************************************************************************************/
-/*******************************************************************************
-* Internal Functions *
-*******************************************************************************/
+/*********************************************************************************************************************************
+* Internal Functions *
+*********************************************************************************************************************************/
/**
* Unclaims the given block device and frees its state removing it from the list.
@@ -111,7 +114,7 @@ static void hbdMgrDevUnclaim(PHBDMGRDEV pDev)
*
* @returns Pointer to the claimed block device or NULL if not claimed.
* @param pThis The block device manager.
- * @param pszFilename The name to look for.
+ * @param pszFilename The name to look for.
*/
static PHBDMGRDEV hbdMgrDevFindByName(PHBDMGRINT pThis, const char *pszFilename)
{
diff --git a/src/VBox/Devices/Storage/HBDMgmt.h b/src/VBox/Devices/Storage/HBDMgmt.h
index 109a03b..c774c91 100644
--- a/src/VBox/Devices/Storage/HBDMgmt.h
+++ b/src/VBox/Devices/Storage/HBDMgmt.h
@@ -52,8 +52,8 @@ DECLHIDDEN(void) HBDMgrDestroy(HBDMGR hHbdMgr);
* be managed by this API.
*
* @returns true if the given filename point to a block device manageable
- * by the given manager
- * false otherwise.
+ * by the given manager
+ * false otherwise.
* @param pszFilename The block device to check.
*/
DECLHIDDEN(bool) HBDMgrIsBlockDevice(const char *pszFilename);
diff --git a/src/VBox/Devices/Storage/UsbMsd.cpp b/src/VBox/Devices/Storage/UsbMsd.cpp
index 857e8e4..6753614 100644
--- a/src/VBox/Devices/Storage/UsbMsd.cpp
+++ b/src/VBox/Devices/Storage/UsbMsd.cpp
@@ -15,9 +15,10 @@
* hope that it will be useful, but WITHOUT ANY WARRANTY of any kind.
*/
-/*******************************************************************************
-* Header Files *
-*******************************************************************************/
+
+/*********************************************************************************************************************************
+* Header Files *
+*********************************************************************************************************************************/
#define LOG_GROUP LOG_GROUP_USB_MSD
#include <VBox/vmm/pdmusb.h>
#include <VBox/log.h>
@@ -32,9 +33,9 @@
#include "VBoxDD.h"
-/*******************************************************************************
-* Defined Constants And Macros *
-*******************************************************************************/
+/*********************************************************************************************************************************
+* Defined Constants And Macros *
+*********************************************************************************************************************************/
/** @name USB MSD string IDs
* @{ */
#define USBMSD_STR_ID_MANUFACTURER 1
@@ -52,9 +53,10 @@
/** Saved state version. */
#define USB_MSD_SAVED_STATE_VERSION 1
-/*******************************************************************************
-* Structures and Typedefs *
-*******************************************************************************/
+
+/*********************************************************************************************************************************
+* Structures and Typedefs *
+*********************************************************************************************************************************/
/**
* USB MSD Command Block Wrapper or CBW. The command block
@@ -265,9 +267,9 @@ typedef struct USBMSD
typedef USBMSD *PUSBMSD;
-/*******************************************************************************
-* Global Variables *
-*******************************************************************************/
+/*********************************************************************************************************************************
+* Global Variables *
+*********************************************************************************************************************************/
static const PDMUSBDESCCACHESTRING g_aUsbMsdStrings_en_US[] =
{
{ USBMSD_STR_ID_MANUFACTURER, "VirtualBox" },
@@ -688,9 +690,10 @@ static const PDMUSBDESCCACHE g_UsbCdDescCacheSS =
/* .fUseCachedStringsDescriptors = */ true
};
-/*******************************************************************************
-* Internal Functions *
-*******************************************************************************/
+
+/*********************************************************************************************************************************
+* Internal Functions *
+*********************************************************************************************************************************/
static int usbMsdHandleBulkDevToHost(PUSBMSD pThis, PUSBMSDEP pEp, PVUSBURB pUrb);
@@ -2248,7 +2251,7 @@ static DECLCALLBACK(void) usbMsdVMReset(PPDMUSBINS pUsbIns)
/**
* @copydoc PDMUSBREG::pfnDestruct
*/
-static void usbMsdDestruct(PPDMUSBINS pUsbIns)
+static DECLCALLBACK(void) usbMsdDestruct(PPDMUSBINS pUsbIns)
{
PUSBMSD pThis = PDMINS_2_DATA(pUsbIns, PUSBMSD);
LogFlow(("usbMsdDestruct/#%u:\n", pUsbIns->iInstance));
diff --git a/src/VBox/Devices/Storage/VBoxSCSI.cpp b/src/VBox/Devices/Storage/VBoxSCSI.cpp
index 04fefa5..12761ff 100644
--- a/src/VBox/Devices/Storage/VBoxSCSI.cpp
+++ b/src/VBox/Devices/Storage/VBoxSCSI.cpp
@@ -15,9 +15,10 @@
* hope that it will be useful, but WITHOUT ANY WARRANTY of any kind.
*/
-/*******************************************************************************
-* Header Files *
-*******************************************************************************/
+
+/*********************************************************************************************************************************
+* Header Files *
+*********************************************************************************************************************************/
//#define DEBUG
#define LOG_GROUP LOG_GROUP_DEV_BUSLOGIC /** @todo Create extra group. */
diff --git a/src/VBox/Devices/Storage/VSCSI/VSCSIDevice.cpp b/src/VBox/Devices/Storage/VSCSI/VSCSIDevice.cpp
index f68e6f1..0ab3498 100644
--- a/src/VBox/Devices/Storage/VSCSI/VSCSIDevice.cpp
+++ b/src/VBox/Devices/Storage/VSCSI/VSCSIDevice.cpp
@@ -14,9 +14,11 @@
* VirtualBox OSE distribution. VirtualBox OSE is distributed in the
* hope that it will be useful, but WITHOUT ANY WARRANTY of any kind.
*/
-/*******************************************************************************
-* Header Files *
-*******************************************************************************/
+
+
+/*********************************************************************************************************************************
+* Header Files *
+*********************************************************************************************************************************/
#define LOG_GROUP LOG_GROUP_VSCSI
#include <VBox/log.h>
#include <VBox/err.h>
diff --git a/src/VBox/Devices/Storage/VSCSI/VSCSILunMmc.cpp b/src/VBox/Devices/Storage/VSCSI/VSCSILunMmc.cpp
index 9e353f0..613d100 100644
--- a/src/VBox/Devices/Storage/VSCSI/VSCSILunMmc.cpp
+++ b/src/VBox/Devices/Storage/VSCSI/VSCSILunMmc.cpp
@@ -15,9 +15,10 @@
* hope that it will be useful, but WITHOUT ANY WARRANTY of any kind.
*/
-/*******************************************************************************
-* Header Files *
-*******************************************************************************/
+
+/*********************************************************************************************************************************
+* Header Files *
+*********************************************************************************************************************************/
#define LOG_GROUP LOG_GROUP_VSCSI
#include <VBox/log.h>
#include <VBox/err.h>
@@ -154,7 +155,7 @@ static int mmcReadTOCMulti(PVSCSILUNINT pVScsiLun, PVSCSIREQINT pVScsiReq, uint1
return vscsiLunReqSenseOkSet(pVScsiLun, pVScsiReq);
}
-static int vscsiLunMmcInit(PVSCSILUNINT pVScsiLun)
+static DECLCALLBACK(int) vscsiLunMmcInit(PVSCSILUNINT pVScsiLun)
{
PVSCSILUNMMC pVScsiLunMmc = (PVSCSILUNMMC)pVScsiLun;
uint64_t cbDisk = 0;
@@ -168,14 +169,14 @@ static int vscsiLunMmcInit(PVSCSILUNINT pVScsiLun)
return rc;
}
-static int vscsiLunMmcDestroy(PVSCSILUNINT pVScsiLun)
+static DECLCALLBACK(int) vscsiLunMmcDestroy(PVSCSILUNINT pVScsiLun)
{
PVSCSILUNMMC pVScsiLunMmc = (PVSCSILUNMMC)pVScsiLun;
return VINF_SUCCESS;
}
-static int vscsiLunMmcReqProcess(PVSCSILUNINT pVScsiLun, PVSCSIREQINT pVScsiReq)
+static DECLCALLBACK(int) vscsiLunMmcReqProcess(PVSCSILUNINT pVScsiLun, PVSCSIREQINT pVScsiReq)
{
PVSCSILUNMMC pVScsiLunMmc = (PVSCSILUNMMC)pVScsiLun;
VSCSIIOREQTXDIR enmTxDir = VSCSIIOREQTXDIR_INVALID;
diff --git a/src/VBox/Devices/Storage/VSCSI/VSCSILunSbc.cpp b/src/VBox/Devices/Storage/VSCSI/VSCSILunSbc.cpp
index fac259b..47311d8 100644
--- a/src/VBox/Devices/Storage/VSCSI/VSCSILunSbc.cpp
+++ b/src/VBox/Devices/Storage/VSCSI/VSCSILunSbc.cpp
@@ -15,9 +15,10 @@
* hope that it will be useful, but WITHOUT ANY WARRANTY of any kind.
*/
-/*******************************************************************************
-* Header Files *
-*******************************************************************************/
+
+/*********************************************************************************************************************************
+* Header Files *
+*********************************************************************************************************************************/
#define LOG_GROUP LOG_GROUP_VSCSI
#include <VBox/log.h>
#include <VBox/err.h>
@@ -51,7 +52,7 @@ typedef struct VSCSILUNSBC
/** Pointer to a SBC LUN instance */
typedef VSCSILUNSBC *PVSCSILUNSBC;
-static int vscsiLunSbcInit(PVSCSILUNINT pVScsiLun)
+static DECLCALLBACK(int) vscsiLunSbcInit(PVSCSILUNINT pVScsiLun)
{
PVSCSILUNSBC pVScsiLunSbc = (PVSCSILUNSBC)pVScsiLun;
uint64_t cbDisk = 0;
@@ -179,7 +180,7 @@ static int vscsiLunSbcInit(PVSCSILUNINT pVScsiLun)
return rc;
}
-static int vscsiLunSbcDestroy(PVSCSILUNINT pVScsiLun)
+static DECLCALLBACK(int) vscsiLunSbcDestroy(PVSCSILUNINT pVScsiLun)
{
PVSCSILUNSBC pVScsiLunSbc = (PVSCSILUNSBC)pVScsiLun;
@@ -188,7 +189,7 @@ static int vscsiLunSbcDestroy(PVSCSILUNINT pVScsiLun)
return VINF_SUCCESS;
}
-static int vscsiLunSbcReqProcess(PVSCSILUNINT pVScsiLun, PVSCSIREQINT pVScsiReq)
+static DECLCALLBACK(int) vscsiLunSbcReqProcess(PVSCSILUNINT pVScsiLun, PVSCSIREQINT pVScsiReq)
{
PVSCSILUNSBC pVScsiLunSbc = (PVSCSILUNSBC)pVScsiLun;
int rc = VINF_SUCCESS;
diff --git a/src/VBox/Devices/Storage/VSCSI/VSCSIVpdPagePool.cpp b/src/VBox/Devices/Storage/VSCSI/VSCSIVpdPagePool.cpp
index 28e590e..a8ed5ea 100644
--- a/src/VBox/Devices/Storage/VSCSI/VSCSIVpdPagePool.cpp
+++ b/src/VBox/Devices/Storage/VSCSI/VSCSIVpdPagePool.cpp
@@ -14,9 +14,11 @@
* VirtualBox OSE distribution. VirtualBox OSE is distributed in the
* hope that it will be useful, but WITHOUT ANY WARRANTY of any kind.
*/
-/*******************************************************************************
-* Header Files *
-*******************************************************************************/
+
+
+/*********************************************************************************************************************************
+* Header Files *
+*********************************************************************************************************************************/
#define LOG_GROUP LOG_GROUP_VSCSI
#include <VBox/log.h>
#include <VBox/err.h>
@@ -25,9 +27,10 @@
#include "VSCSIInternal.h"
-/*******************************************************************************
-* Structures and Typedefs *
-*******************************************************************************/
+
+/*********************************************************************************************************************************
+* Structures and Typedefs *
+*********************************************************************************************************************************/
/**
* A VSCSI VPD page.
@@ -45,9 +48,9 @@ typedef struct VSCSIVPDPAGE
typedef VSCSIVPDPAGE *PVSCSIVPDPAGE;
-/*******************************************************************************
-* Internal Functions *
-*******************************************************************************/
+/*********************************************************************************************************************************
+* Internal Functions *
+*********************************************************************************************************************************/
int vscsiVpdPagePoolInit(PVSCSIVPDPOOL pVScsiVpdPool)
{
diff --git a/src/VBox/Devices/USB/DevOHCI.cpp b/src/VBox/Devices/USB/DevOHCI.cpp
index 0873cda..36d7569 100644
--- a/src/VBox/Devices/USB/DevOHCI.cpp
+++ b/src/VBox/Devices/USB/DevOHCI.cpp
@@ -77,9 +77,9 @@
*/
-/*******************************************************************************
-* Header Files *
-*******************************************************************************/
+/*********************************************************************************************************************************
+* Header Files *
+*********************************************************************************************************************************/
#define LOG_GROUP LOG_GROUP_DEV_OHCI
#include <VBox/pci.h>
#include <VBox/vmm/pdm.h>
@@ -102,9 +102,9 @@
#include "VBoxDD.h"
-/*******************************************************************************
-* Structures and Typedefs *
-*******************************************************************************/
+/*********************************************************************************************************************************
+* Structures and Typedefs *
+*********************************************************************************************************************************/
/** The saved state version. */
#define OHCI_SAVED_STATE_VERSION 5
// The saved state with support of 8 ports
@@ -740,9 +740,11 @@ typedef struct ohci_opreg
#ifndef VBOX_DEVICE_STRUCT_TESTCASE
-/*******************************************************************************
-* Global Variables *
-*******************************************************************************/
+
+
+/*********************************************************************************************************************************
+* Global Variables *
+*********************************************************************************************************************************/
#if defined(LOG_ENABLED) && defined(IN_RING3)
static bool g_fLogBulkEPs = false;
static bool g_fLogControlEPs = false;
@@ -793,9 +795,9 @@ static SSMFIELD const g_aOhciFields[] =
#endif
-/*******************************************************************************
-* Internal Functions *
-*******************************************************************************/
+/*********************************************************************************************************************************
+* Internal Functions *
+*********************************************************************************************************************************/
RT_C_DECLS_BEGIN
#ifdef IN_RING3
/* Update host controller state to reflect a device attach */
diff --git a/src/VBox/Devices/USB/DrvVUSBRootHub.cpp b/src/VBox/Devices/USB/DrvVUSBRootHub.cpp
index 98ada56..9b8eb38 100644
--- a/src/VBox/Devices/USB/DrvVUSBRootHub.cpp
+++ b/src/VBox/Devices/USB/DrvVUSBRootHub.cpp
@@ -198,9 +198,10 @@
*
*/
-/*******************************************************************************
-* Header Files *
-*******************************************************************************/
+
+/*********************************************************************************************************************************
+* Header Files *
+*********************************************************************************************************************************/
#define LOG_GROUP LOG_GROUP_DRV_VUSB
#include <VBox/vmm/pdm.h>
#include <VBox/vmm/vmapi.h>
@@ -783,7 +784,7 @@ static DECLCALLBACK(int) vusbRhDevPowerOff(PVUSBIDEVICE pInterface)
/**
* @copydoc VUSBIDEVICE::pfnGetState
*/
-DECLCALLBACK(VUSBDEVICESTATE) vusbRhDevGetState(PVUSBIDEVICE pInterface)
+static DECLCALLBACK(VUSBDEVICESTATE) vusbRhDevGetState(PVUSBIDEVICE pInterface)
{
PVUSBROOTHUB pRh = RT_FROM_MEMBER(pInterface, VUSBROOTHUB, Hub.Dev.IDevice);
return pRh->Hub.Dev.enmState;
diff --git a/src/VBox/Devices/USB/USBProxyDevice-stub.cpp b/src/VBox/Devices/USB/USBProxyDevice-stub.cpp
index cbe1d06..efe770c 100644
--- a/src/VBox/Devices/USB/USBProxyDevice-stub.cpp
+++ b/src/VBox/Devices/USB/USBProxyDevice-stub.cpp
@@ -16,16 +16,17 @@
*/
-/*******************************************************************************
-* Header Files *
-*******************************************************************************/
+/*********************************************************************************************************************************
+* Header Files *
+*********************************************************************************************************************************/
#include <VBox/vmm/pdm.h>
#include "USBProxyDevice.h"
-/*******************************************************************************
-* Global Variables *
-*******************************************************************************/
+
+/*********************************************************************************************************************************
+* Global Variables *
+*********************************************************************************************************************************/
/**
* Stub USB Proxy Backend.
*/
diff --git a/src/VBox/Devices/USB/USBProxyDevice.cpp b/src/VBox/Devices/USB/USBProxyDevice.cpp
index 735142c..378966e 100644
--- a/src/VBox/Devices/USB/USBProxyDevice.cpp
+++ b/src/VBox/Devices/USB/USBProxyDevice.cpp
@@ -16,9 +16,9 @@
*/
-/*******************************************************************************
-* Header Files *
-*******************************************************************************/
+/*********************************************************************************************************************************
+* Header Files *
+*********************************************************************************************************************************/
#define LOG_GROUP LOG_GROUP_DRV_USBPROXY
#include <VBox/usb.h>
#include <VBox/usbfilter.h>
@@ -33,9 +33,9 @@
#include "VBoxDD.h"
-/*******************************************************************************
-* Global Variables *
-*******************************************************************************/
+/*********************************************************************************************************************************
+* Global Variables *
+*********************************************************************************************************************************/
/** A dummy name used early during the construction phase to avoid log crashes. */
static char g_szDummyName[] = "proxy xxxx:yyyy";
diff --git a/src/VBox/Devices/USB/VUSBDevice.cpp b/src/VBox/Devices/USB/VUSBDevice.cpp
index 9688b34..3320387 100644
--- a/src/VBox/Devices/USB/VUSBDevice.cpp
+++ b/src/VBox/Devices/USB/VUSBDevice.cpp
@@ -16,9 +16,9 @@
*/
-/*******************************************************************************
-* Header Files *
-*******************************************************************************/
+/*********************************************************************************************************************************
+* Header Files *
+*********************************************************************************************************************************/
#define LOG_GROUP LOG_GROUP_DRV_VUSB
#include <VBox/vmm/pdm.h>
#include <VBox/vmm/vmapi.h>
@@ -35,9 +35,10 @@
#include "VUSBSniffer.h"
-/*******************************************************************************
-* Structures and Typedefs *
-*******************************************************************************/
+
+/*********************************************************************************************************************************
+* Structures and Typedefs *
+*********************************************************************************************************************************/
/**
* Argument package of vusbDevResetThread().
*/
@@ -54,9 +55,9 @@ typedef struct vusb_reset_args
} VUSBRESETARGS, *PVUSBRESETARGS;
-/*******************************************************************************
-* Global Variables *
-*******************************************************************************/
+/*********************************************************************************************************************************
+* Global Variables *
+*********************************************************************************************************************************/
/** Default message pipe. */
const VUSBDESCENDPOINTEX g_Endpoint0 =
{
@@ -1423,7 +1424,7 @@ static int vusbDevResetWorker(PVUSBDEV pDev, bool fResetOnLinux, bool fUseTimer,
* on the EMT thread.
* @thread EMT
*/
-DECLCALLBACK(int) vusbIDeviceReset(PVUSBIDEVICE pDevice, bool fResetOnLinux, PFNVUSBRESETDONE pfnDone, void *pvUser, PVM pVM)
+static DECLCALLBACK(int) vusbIDeviceReset(PVUSBIDEVICE pDevice, bool fResetOnLinux, PFNVUSBRESETDONE pfnDone, void *pvUser, PVM pVM)
{
PVUSBDEV pDev = (PVUSBDEV)pDevice;
Assert(!pfnDone || pVM);
@@ -1482,7 +1483,7 @@ DECLCALLBACK(int) vusbIDeviceReset(PVUSBIDEVICE pDevice, bool fResetOnLinux, PFN
* @returns VBox status code.
* @param pInterface Pointer to the device interface structure.
*/
-DECLCALLBACK(int) vusbIDevicePowerOn(PVUSBIDEVICE pInterface)
+static DECLCALLBACK(int) vusbIDevicePowerOn(PVUSBIDEVICE pInterface)
{
PVUSBDEV pDev = (PVUSBDEV)pInterface;
LogFlow(("vusbDevPowerOn: pDev=%p[%s]\n", pDev, pDev->pUsbIns->pszName));
@@ -1518,7 +1519,7 @@ DECLCALLBACK(int) vusbIDevicePowerOn(PVUSBIDEVICE pInterface)
* @returns VBox status code.
* @param pInterface Pointer to the device interface structure.
*/
-DECLCALLBACK(int) vusbIDevicePowerOff(PVUSBIDEVICE pInterface)
+static DECLCALLBACK(int) vusbIDevicePowerOff(PVUSBIDEVICE pInterface)
{
PVUSBDEV pDev = (PVUSBDEV)pInterface;
LogFlow(("vusbDevPowerOff: pDev=%p[%s]\n", pDev, pDev->pUsbIns->pszName));
@@ -1559,7 +1560,7 @@ DECLCALLBACK(int) vusbIDevicePowerOff(PVUSBIDEVICE pInterface)
* @returns Device state.
* @param pInterface Pointer to the device interface structure.
*/
-DECLCALLBACK(VUSBDEVICESTATE) vusbIDeviceGetState(PVUSBIDEVICE pInterface)
+static DECLCALLBACK(VUSBDEVICESTATE) vusbIDeviceGetState(PVUSBIDEVICE pInterface)
{
return vusbDevGetState((PVUSBDEV)pInterface);
}
@@ -1568,7 +1569,7 @@ DECLCALLBACK(VUSBDEVICESTATE) vusbIDeviceGetState(PVUSBIDEVICE pInterface)
/**
* @interface_method_impl{VUSBIDEVICE,pfnIsSavedStateSupported}
*/
-DECLCALLBACK(bool) vusbIDeviceIsSavedStateSupported(PVUSBIDEVICE pInterface)
+static DECLCALLBACK(bool) vusbIDeviceIsSavedStateSupported(PVUSBIDEVICE pInterface)
{
PVUSBDEV pDev = (PVUSBDEV)pInterface;
bool fSavedStateSupported = RT_BOOL(pDev->pUsbIns->pReg->fFlags & PDM_USBREG_SAVED_STATE_SUPPORTED);
@@ -1583,7 +1584,7 @@ DECLCALLBACK(bool) vusbIDeviceIsSavedStateSupported(PVUSBIDEVICE pInterface)
/**
* @interface_method_impl{VUSBIDEVICE,pfnGetState}
*/
-DECLCALLBACK(VUSBSPEED) vusbIDeviceGetSpeed(PVUSBIDEVICE pInterface)
+static DECLCALLBACK(VUSBSPEED) vusbIDeviceGetSpeed(PVUSBIDEVICE pInterface)
{
PVUSBDEV pDev = (PVUSBDEV)pInterface;
VUSBSPEED enmSpeed = pDev->pUsbIns->enmSpeed;
diff --git a/src/VBox/Devices/USB/VUSBReadAhead.cpp b/src/VBox/Devices/USB/VUSBReadAhead.cpp
index 1db5646..30644ba 100644
--- a/src/VBox/Devices/USB/VUSBReadAhead.cpp
+++ b/src/VBox/Devices/USB/VUSBReadAhead.cpp
@@ -16,9 +16,9 @@
*/
-/*******************************************************************************
-* Header Files *
-*******************************************************************************/
+/*********************************************************************************************************************************
+* Header Files *
+*********************************************************************************************************************************/
#define LOG_GROUP LOG_GROUP_DRV_VUSB
#include <VBox/vmm/pdm.h>
#include <VBox/vmm/vmapi.h>
@@ -35,9 +35,9 @@
#include "VUSBInternal.h"
-/*******************************************************************************
-* Structures and Typedefs *
-*******************************************************************************/
+/*********************************************************************************************************************************
+* Structures and Typedefs *
+*********************************************************************************************************************************/
/**
* VUSB Readahead instance data.
@@ -69,9 +69,9 @@ typedef struct VUSBREADAHEADINT
} VUSBREADAHEADINT, *PVUSBREADAHEADINT;
-/*******************************************************************************
-* Implementation *
-*******************************************************************************/
+/*********************************************************************************************************************************
+* Implementation *
+*********************************************************************************************************************************/
static PVUSBURB vusbDevNewIsocUrb(PVUSBDEV pDev, unsigned uEndPt, unsigned uInterval, unsigned uPktSize)
{
diff --git a/src/VBox/Devices/USB/VUSBSniffer.cpp b/src/VBox/Devices/USB/VUSBSniffer.cpp
index 4ea5766..c3800f0 100644
--- a/src/VBox/Devices/USB/VUSBSniffer.cpp
+++ b/src/VBox/Devices/USB/VUSBSniffer.cpp
@@ -15,9 +15,10 @@
* hope that it will be useful, but WITHOUT ANY WARRANTY of any kind.
*/
-/*******************************************************************************
-* Header Files *
-*******************************************************************************/
+
+/*********************************************************************************************************************************
+* Header Files *
+*********************************************************************************************************************************/
#define LOG_GROUP LOG_GROUP_DRV_VUSB
#include <VBox/log.h>
#include <iprt/file.h>
@@ -30,9 +31,10 @@
#include "VUSBSniffer.h"
-/*******************************************************************************
-* Defined Constants And Macros *
-*******************************************************************************/
+
+/*********************************************************************************************************************************
+* Defined Constants And Macros *
+*********************************************************************************************************************************/
/** DumpFile Section Header Block type. */
#define DUMPFILE_SHB_BLOCK_TYPE UINT32_C(0x0a0d0d0a)
@@ -66,9 +68,10 @@
#define DUMPFILE_IDB_OPTION_TS_RESOLUTION UINT16_C(9)
-/*******************************************************************************
-* DumpFile format structures *
-*******************************************************************************/
+
+/*********************************************************************************************************************************
+* DumpFile format structures *
+*********************************************************************************************************************************/
/**
* DumpFile Block header.
@@ -237,9 +240,10 @@ typedef struct DumpFileUsbIsoDesc
} DumpFileUsbIsoDesc;
typedef DumpFileUsbIsoDesc *PDumpFileUsbIsoDesc;
-/*******************************************************************************
-* Structures and Typedefs *
-*******************************************************************************/
+
+/*********************************************************************************************************************************
+* Structures and Typedefs *
+*********************************************************************************************************************************/
/**
* The internal VUSB sniffer state.
@@ -546,6 +550,8 @@ DECLHIDDEN(int) VUSBSnifferCreate(PVUSBSNIFFER phSniffer, uint32_t fFlags,
RTSemFastMutexDestroy(pThis->hMtx);
pThis->hMtx = NIL_RTSEMFASTMUTEX;
}
+ if (pThis->pbBlockData)
+ RTMemFree(pThis->pbBlockData);
RTMemFree(pThis);
}
else
diff --git a/src/VBox/Devices/USB/VUSBUrb.cpp b/src/VBox/Devices/USB/VUSBUrb.cpp
index 4213123..7ae2445 100644
--- a/src/VBox/Devices/USB/VUSBUrb.cpp
+++ b/src/VBox/Devices/USB/VUSBUrb.cpp
@@ -15,9 +15,10 @@
* hope that it will be useful, but WITHOUT ANY WARRANTY of any kind.
*/
-/*******************************************************************************
-* Header Files *
-*******************************************************************************/
+
+/*********************************************************************************************************************************
+* Header Files *
+*********************************************************************************************************************************/
#define LOG_GROUP LOG_GROUP_DRV_VUSB
#include <VBox/vmm/pdm.h>
#include <VBox/vmm/vmapi.h>
@@ -35,9 +36,9 @@
-/*******************************************************************************
-* Global Variables *
-*******************************************************************************/
+/*********************************************************************************************************************************
+* Global Variables *
+*********************************************************************************************************************************/
/** Strings for the CTLSTAGE enum values. */
const char * const g_apszCtlStates[4] =
{
@@ -48,9 +49,9 @@ const char * const g_apszCtlStates[4] =
};
-/*******************************************************************************
-* Internal Functions *
-*******************************************************************************/
+/*********************************************************************************************************************************
+* Internal Functions *
+*********************************************************************************************************************************/
static PVUSBCTRLEXTRA vusbMsgAllocExtraData(PVUSBURB pUrb);
diff --git a/src/VBox/Devices/USB/darwin/USBProxyDevice-darwin.cpp b/src/VBox/Devices/USB/darwin/USBProxyDevice-darwin.cpp
index 8239de7..fd448aa 100644
--- a/src/VBox/Devices/USB/darwin/USBProxyDevice-darwin.cpp
+++ b/src/VBox/Devices/USB/darwin/USBProxyDevice-darwin.cpp
@@ -16,9 +16,9 @@
*/
-/*******************************************************************************
-* Header Files *
-*******************************************************************************/
+/*********************************************************************************************************************************
+* Header Files *
+*********************************************************************************************************************************/
#define LOG_GROUP LOG_GROUP_DRV_USBPROXY
#define __STDC_LIMIT_MACROS
#define __STDC_CONSTANT_MACROS
@@ -46,15 +46,16 @@
#include <VBox/usblib.h>
-/*******************************************************************************
-* Defined Constants And Macros *
-*******************************************************************************/
+/*********************************************************************************************************************************
+* Defined Constants And Macros *
+*********************************************************************************************************************************/
/** An experiment... */
//#define USE_LOW_LATENCY_API 1
-/*******************************************************************************
-* Structures and Typedefs *
-*******************************************************************************/
+
+/*********************************************************************************************************************************
+* Structures and Typedefs *
+*********************************************************************************************************************************/
/** Forward declaration of the Darwin interface structure. */
typedef struct USBPROXYIFOSX *PUSBPROXYIFOSX;
@@ -250,9 +251,9 @@ typedef struct USBPROXYDEVOSX
} USBPROXYDEVOSX, *PUSBPROXYDEVOSX;
-/*******************************************************************************
-* Global Variables *
-*******************************************************************************/
+/*********************************************************************************************************************************
+* Global Variables *
+*********************************************************************************************************************************/
static RTONCE g_usbProxyDarwinOnce = RTONCE_INITIALIZER;
/** The runloop mode we use.
* Since it's difficult to remove this, we leak it to prevent crashes.
diff --git a/src/VBox/Devices/USB/freebsd/USBProxyDevice-freebsd.cpp b/src/VBox/Devices/USB/freebsd/USBProxyDevice-freebsd.cpp
index 5d37f88..e639d34 100644
--- a/src/VBox/Devices/USB/freebsd/USBProxyDevice-freebsd.cpp
+++ b/src/VBox/Devices/USB/freebsd/USBProxyDevice-freebsd.cpp
@@ -17,9 +17,10 @@
* hope that it will be useful, but WITHOUT ANY WARRANTY of any kind.
*/
-/*******************************************************************************
-* Header Files *
-*******************************************************************************/
+
+/*********************************************************************************************************************************
+* Header Files *
+*********************************************************************************************************************************/
#define LOG_GROUP LOG_GROUP_DRV_USBPROXY
#ifdef VBOX
# include <iprt/stdint.h>
@@ -64,9 +65,10 @@
# define VUSB_DIR_TO_DEV 0x00
#endif
-/*******************************************************************************
-* Structures and Typedefs *
-*******************************************************************************/
+
+/*********************************************************************************************************************************
+* Structures and Typedefs *
+*********************************************************************************************************************************/
typedef struct USBENDPOINTFBSD
{
/** Flag whether it is opened. */
@@ -110,9 +112,10 @@ typedef struct USBPROXYDEVFBSD
struct usb_fs_endpoint aHwEndpoint[USBFBSD_MAXENDPOINTS];
} USBPROXYDEVFBSD, *PUSBPROXYDEVFBSD;
-/*******************************************************************************
-* Internal Functions *
-*******************************************************************************/
+
+/*********************************************************************************************************************************
+* Internal Functions *
+*********************************************************************************************************************************/
static int usbProxyFreeBSDEndpointClose(PUSBPROXYDEV pProxyDev, int Endpoint);
/**
diff --git a/src/VBox/Devices/USB/linux/USBProxyDevice-linux.cpp b/src/VBox/Devices/USB/linux/USBProxyDevice-linux.cpp
index 31ff950..904b393 100644
--- a/src/VBox/Devices/USB/linux/USBProxyDevice-linux.cpp
+++ b/src/VBox/Devices/USB/linux/USBProxyDevice-linux.cpp
@@ -15,9 +15,10 @@
* hope that it will be useful, but WITHOUT ANY WARRANTY of any kind.
*/
-/*******************************************************************************
-* Defined Constants And Macros *
-*******************************************************************************/
+
+/*********************************************************************************************************************************
+* Defined Constants And Macros *
+*********************************************************************************************************************************/
/** Define NO_PORT_RESET to skip the slow and broken linux port reset.
* Resetting will break PalmOne. */
#define NO_PORT_RESET
@@ -25,9 +26,9 @@
#define NO_LOGICAL_RECONNECT
-/*******************************************************************************
-* Header Files *
-*******************************************************************************/
+/*********************************************************************************************************************************
+* Header Files *
+*********************************************************************************************************************************/
#define LOG_GROUP LOG_GROUP_DRV_USBPROXY
#include <iprt/stdint.h>
@@ -99,9 +100,10 @@ static inline bool rtcsTrue() { return true; }
#include <iprt/time.h>
#include "../USBProxyDevice.h"
-/*******************************************************************************
-* Structures and Typedefs *
-*******************************************************************************/
+
+/*********************************************************************************************************************************
+* Structures and Typedefs *
+*********************************************************************************************************************************/
/**
* Wrapper around the linux urb request structure.
* This is required to track in-flight and landed URBs.
@@ -156,9 +158,9 @@ typedef struct USBPROXYDEVLNX
} USBPROXYDEVLNX, *PUSBPROXYDEVLNX;
-/*******************************************************************************
-* Internal Functions *
-*******************************************************************************/
+/*********************************************************************************************************************************
+* Internal Functions *
+*********************************************************************************************************************************/
static int usbProxyLinuxDoIoCtl(PUSBPROXYDEV pProxyDev, unsigned long iCmd, void *pvArg, bool fHandleNoDev, uint32_t cTries);
static void usbProxLinuxUrbUnplugged(PUSBPROXYDEV pProxyDev);
static void usbProxyLinuxSetConnected(PUSBPROXYDEV pProyxDev, int iIf, bool fConnect, bool fQuiet);
@@ -1144,7 +1146,7 @@ static DECLCALLBACK(int) usbProxyLinuxClaimInterface(PUSBPROXYDEV pProxyDev, int
* Releases an interface.
* @returns success indicator.
*/
-static int usbProxyLinuxReleaseInterface(PUSBPROXYDEV pProxyDev, int iIf)
+static DECLCALLBACK(int) usbProxyLinuxReleaseInterface(PUSBPROXYDEV pProxyDev, int iIf)
{
LogFlow(("usbProxyLinuxReleaseInterface: pProxyDev=%s ifnum=%#x\n", usbProxyGetName(pProxyDev), iIf));
@@ -1162,7 +1164,7 @@ static int usbProxyLinuxReleaseInterface(PUSBPROXYDEV pProxyDev, int iIf)
*
* @returns success indicator.
*/
-static int usbProxyLinuxSetInterface(PUSBPROXYDEV pProxyDev, int iIf, int iAlt)
+static DECLCALLBACK(int) usbProxyLinuxSetInterface(PUSBPROXYDEV pProxyDev, int iIf, int iAlt)
{
struct usbdevfs_setinterface SetIf;
LogFlow(("usbProxyLinuxSetInterface: pProxyDev=%p iIf=%#x iAlt=%#x\n", pProxyDev, iIf, iAlt));
@@ -1181,7 +1183,7 @@ static int usbProxyLinuxSetInterface(PUSBPROXYDEV pProxyDev, int iIf, int iAlt)
/**
* Clears the halted endpoint 'EndPt'.
*/
-static int usbProxyLinuxClearHaltedEp(PUSBPROXYDEV pProxyDev, unsigned int EndPt)
+static DECLCALLBACK(int) usbProxyLinuxClearHaltedEp(PUSBPROXYDEV pProxyDev, unsigned int EndPt)
{
LogFlow(("usbProxyLinuxClearHaltedEp: pProxyDev=%s EndPt=%u\n", usbProxyGetName(pProxyDev), EndPt));
diff --git a/src/VBox/Devices/USB/os2/USBProxyDevice-os2.cpp b/src/VBox/Devices/USB/os2/USBProxyDevice-os2.cpp
index 0a7ac27..898a9a5 100644
--- a/src/VBox/Devices/USB/os2/USBProxyDevice-os2.cpp
+++ b/src/VBox/Devices/USB/os2/USBProxyDevice-os2.cpp
@@ -16,14 +16,14 @@
*/
-/*******************************************************************************
-* Defined Constants And Macros *
-*******************************************************************************/
+/*********************************************************************************************************************************
+* Defined Constants And Macros *
+*********************************************************************************************************************************/
-/*******************************************************************************
-* Header Files *
-*******************************************************************************/
+/*********************************************************************************************************************************
+* Header Files *
+*********************************************************************************************************************************/
#define LOG_GROUP LOG_GROUP_DRV_USBPROXY
#include <VBox/vmm/pdm.h>
#include <VBox/err.h>
@@ -45,9 +45,9 @@
#include <usbcalls.h>
-/*******************************************************************************
-* Structures and Typedefs *
-*******************************************************************************/
+/*********************************************************************************************************************************
+* Structures and Typedefs *
+*********************************************************************************************************************************/
/**
* Structure for keeping track of the URBs for a device.
*/
@@ -95,9 +95,9 @@ typedef struct USBPROXYDEVOS2
} USBPROXYDEVOS2, *PUSBPROXYDEVOS2;
-/*******************************************************************************
-* Internal Functions *
-*******************************************************************************/
+/*********************************************************************************************************************************
+* Internal Functions *
+*********************************************************************************************************************************/
#ifdef DYNAMIC_USBCALLS
static int usbProxyOs2GlobalInit(void);
#endif
@@ -106,9 +106,9 @@ static void usbProxyOs2UrbFree(PUSBPROXYDEV pProxyDev, PUSBPROXYURBOS2 pUrbOs2);
static DECLCALLBACK(int) usbProxyOs2AsyncThread(RTTHREAD Thread, void *pvProxyDev);
-/*******************************************************************************
-* Global Variables *
-*******************************************************************************/
+/*********************************************************************************************************************************
+* Global Variables *
+*********************************************************************************************************************************/
#ifdef DYNAMIC_USBCALLS
static HMODULE g_hmod;
static APIRET (APIENTRY *g_pfnUsbOpen)(PUSBHANDLE, USHORT, USHORT, USHORT, USHORT);
diff --git a/src/VBox/Devices/USB/solaris/USBProxyDevice-solaris.cpp b/src/VBox/Devices/USB/solaris/USBProxyDevice-solaris.cpp
index 5f3f156..67bcd79 100644
--- a/src/VBox/Devices/USB/solaris/USBProxyDevice-solaris.cpp
+++ b/src/VBox/Devices/USB/solaris/USBProxyDevice-solaris.cpp
@@ -16,9 +16,9 @@
*/
-/*******************************************************************************
-* Header Files *
-*******************************************************************************/
+/*********************************************************************************************************************************
+* Header Files *
+*********************************************************************************************************************************/
#define LOG_GROUP LOG_GROUP_DRV_USBPROXY
#include <sys/poll.h>
#include <errno.h>
@@ -38,16 +38,17 @@
#include "../USBProxyDevice.h"
#include <VBox/usblib.h>
-/*******************************************************************************
-* Defined Constants And Macros *
-*******************************************************************************/
+
+/*********************************************************************************************************************************
+* Defined Constants And Macros *
+*********************************************************************************************************************************/
/** Log Prefix. */
#define USBPROXY "USBProxy"
-/*******************************************************************************
-* Structures and Typedefs *
-*******************************************************************************/
+/*********************************************************************************************************************************
+* Structures and Typedefs *
+*********************************************************************************************************************************/
/**
* Wrapper around the solaris urb request structure.
* This is required to track in-flight and landed URBs.
diff --git a/src/VBox/Devices/USB/testcase/tstOhciRegisterAccess.cpp b/src/VBox/Devices/USB/testcase/tstOhciRegisterAccess.cpp
index 735b181..f345d1e 100644
--- a/src/VBox/Devices/USB/testcase/tstOhciRegisterAccess.cpp
+++ b/src/VBox/Devices/USB/testcase/tstOhciRegisterAccess.cpp
@@ -16,9 +16,9 @@
*/
-/*******************************************************************************
-* Header Files *
-*******************************************************************************/
+/*********************************************************************************************************************************
+* Header Files *
+*********************************************************************************************************************************/
#include <VBox/log.h>
#include <iprt/mem.h>
#include <iprt/memobj.h>
@@ -31,9 +31,9 @@
#define LogRel(a) SUPR0Printf a
-/*******************************************************************************
-* Global Variables *
-*******************************************************************************/
+/*********************************************************************************************************************************
+* Global Variables *
+*********************************************************************************************************************************/
/** Register names. */
static const char * const g_apszRegNms[] =
{
diff --git a/src/VBox/Devices/USB/usbip/USBProxyDevice-usbip.cpp b/src/VBox/Devices/USB/usbip/USBProxyDevice-usbip.cpp
index 4bcdbd0..01e08a6 100644
--- a/src/VBox/Devices/USB/usbip/USBProxyDevice-usbip.cpp
+++ b/src/VBox/Devices/USB/usbip/USBProxyDevice-usbip.cpp
@@ -16,9 +16,9 @@
*/
-/*******************************************************************************
-* Header Files *
-*******************************************************************************/
+/*********************************************************************************************************************************
+* Header Files *
+*********************************************************************************************************************************/
#define LOG_GROUP LOG_GROUP_DRV_USBPROXY
#include <VBox/log.h>
@@ -39,9 +39,9 @@
#include "../USBProxyDevice.h"
-/*******************************************************************************
-* Constants And Macros, Structures and Typedefs *
-*******************************************************************************/
+/*********************************************************************************************************************************
+* Constants And Macros, Structures and Typedefs *
+*********************************************************************************************************************************/
/** The USB version number used for the protocol. */
#define USBIP_VERSION UINT16_C(0x0111)
@@ -304,6 +304,25 @@ typedef UsbIpRet *PUsbIpRet;
#pragma pack()
/**
+ * Isochronous packet descriptor.
+*/
+#pragma pack(1)
+typedef struct UsbIpIsocPktDesc
+{
+ /** Offset */
+ uint32_t u32Offset;
+ /** Length of the packet including padding. */
+ uint32_t u32Length;
+ /** Size of the transmitted data. */
+ uint32_t u32ActualLength;
+ /** Completion status for this packet. */
+ int32_t i32Status;
+} UsbIpIsocPktDesc;
+/** Pointer to a isochronous packet descriptor. */
+typedef UsbIpIsocPktDesc *PUsbIpIsocPktDesc;
+#pragma pack()
+
+/**
* USB/IP backend specific data for one URB.
* Required for tracking in flight and landed URBs.
*/
@@ -320,46 +339,71 @@ typedef struct USBPROXYURBUSBIP
typedef USBPROXYURBUSBIP *PUSBPROXYURBUSBIP;
/**
+ * USB/IP data receive states.
+ */
+typedef enum USBPROXYUSBIPRECVSTATE
+{
+ /** Invalid receive state. */
+ USBPROXYUSBIPRECVSTATE_INVALID = 0,
+ /** Currently receiving the common header structure. */
+ USBPROXYUSBIPRECVSTATE_HDR_COMMON,
+ /** Currently receieving the rest of the header structure. */
+ USBPROXYUSBIPRECVSTATE_HDR_RESIDUAL,
+ /** Currently receiving data into the URB buffer. */
+ USBPROXYUSBIPRECVSTATE_URB_BUFFER,
+ /** Currently receiving the isochronous packet descriptors. */
+ USBPROXYUSBIPRECVSTATE_ISOC_PKT_DESCS,
+ /** Usual 32bit hack. */
+ USBPROXYUSBIPRECVSTATE_32BIT_HACK = 0x7fffffff
+} USBPROXYUSBIPRECVSTATE;
+/** Pointer to an receive state. */
+typedef USBPROXYUSBIPRECVSTATE *PUSBPROXYUSBIPRECVSTATE;
+
+/**
* Backend data for the USB/IP USB Proxy device backend.
*/
typedef struct USBPROXYDEVUSBIP
{
/** IPRT socket handle. */
- RTSOCKET hSocket;
+ RTSOCKET hSocket;
/** Pollset with the wakeup pipe and socket. */
- RTPOLLSET hPollSet;
+ RTPOLLSET hPollSet;
/** Pipe endpoint - read (in the pollset). */
- RTPIPE hPipeR;
+ RTPIPE hPipeR;
/** Pipe endpoint - write. */
- RTPIPE hPipeW;
+ RTPIPE hPipeW;
/** Next sequence number to use for identifying submitted URBs. */
- volatile uint32_t u32SeqNumNext;
+ volatile uint32_t u32SeqNumNext;
/** Fast mutex protecting the lists below against concurrent access. */
- RTSEMFASTMUTEX hMtxLists;
+ RTSEMFASTMUTEX hMtxLists;
/** List of in flight URBs. */
- RTLISTANCHOR ListUrbsInFlight;
+ RTLISTANCHOR ListUrbsInFlight;
/** List of landed URBs. */
- RTLISTANCHOR ListUrbsLanded;
+ RTLISTANCHOR ListUrbsLanded;
/** List of URBs to submit. */
- RTLISTANCHOR ListUrbsToQueue;
+ RTLISTANCHOR ListUrbsToQueue;
/** Port of the USB/IP host to connect to. */
- uint32_t uPort;
+ uint32_t uPort;
/** USB/IP host address. */
- char *pszHost;
+ char *pszHost;
/** USB Bus ID of the device to capture. */
- char *pszBusId;
+ char *pszBusId;
/** The device ID to use to identify the device. */
- uint32_t u32DevId;
+ uint32_t u32DevId;
/** Temporary buffer for the next reply header */
- UsbIpRet BufRet;
+ UsbIpRet BufRet;
+ /** Temporary buffer to hold all isochronous packet descriptors. */
+ UsbIpIsocPktDesc aIsocPktDesc[8];
+ /** Pointer to the current buffer to write received data to. */
+ uint8_t *pbRecv;
/** Number of bytes received so far. */
- size_t cbRecv;
- /** Number of bytes left to receive. */
- size_t cbLeft;
- /** Flag whether we are currently receiving data for an URB. */
- bool fRecvData;
+ size_t cbRecv;
+ /** Number of bytes left to receive. until we advance the state machine and process the data */
+ size_t cbLeft;
+ /** The current receiving state. */
+ USBPROXYUSBIPRECVSTATE enmRecvState;
/** The URB we currently receive a response for. */
- PUSBPROXYURBUSBIP pUrbUsbIp;
+ PUSBPROXYURBUSBIP pUrbUsbIp;
} USBPROXYDEVUSBIP, *PUSBPROXYDEVUSBIP;
/** Pollset id of the socket. */
@@ -440,6 +484,34 @@ DECLINLINE(void) usbProxyUsbIpRetSubmitN2H(PUsbIpRetSubmit pRetSubmit)
}
/**
+ * Converts a isochronous packet descriptor from host to network endianness.
+ *
+ * @returns nothing.
+ * @param pIsocPktDesc The packet descriptor to convert.
+ */
+DECLINLINE(void) usbProxyUsbIpIsocPktDescH2N(PUsbIpIsocPktDesc pIsocPktDesc)
+{
+ pIsocPktDesc->u32Offset = RT_H2N_U32(pIsocPktDesc->u32Offset);
+ pIsocPktDesc->u32Length = RT_H2N_U32(pIsocPktDesc->u32Length);
+ pIsocPktDesc->u32ActualLength = RT_H2N_U32(pIsocPktDesc->u32ActualLength);
+ pIsocPktDesc->i32Status = RT_H2N_U32(pIsocPktDesc->i32Status);
+}
+
+/**
+ * Converts a isochronous packet descriptor from network to host endianness.
+ *
+ * @returns nothing.
+ * @param pIsocPktDesc The packet descriptor to convert.
+ */
+DECLINLINE(void) usbProxyUsbIpIsocPktDescN2H(PUsbIpIsocPktDesc pIsocPktDesc)
+{
+ pIsocPktDesc->u32Offset = RT_N2H_U32(pIsocPktDesc->u32Offset);
+ pIsocPktDesc->u32Length = RT_N2H_U32(pIsocPktDesc->u32Length);
+ pIsocPktDesc->u32ActualLength = RT_N2H_U32(pIsocPktDesc->u32ActualLength);
+ pIsocPktDesc->i32Status = RT_N2H_U32(pIsocPktDesc->i32Status);
+}
+
+/**
* Converts a unlink request from host to network endianness.
*
* @returns nothing.
@@ -480,6 +552,28 @@ DECLINLINE(void) usbProxyUsbIpExportedDeviceN2H(PUsbIpExportedDevice pDevice)
}
/**
+ * Converts a USB/IP status code to a VBox status code.
+ *
+ * @returns VUSB status code.
+ * @param i32Status The USB/IP status code from the reply.
+ */
+DECLINLINE(int) usbProxyUsbIpStatusConvertFromStatus(int32_t i32Status)
+{
+ if (RT_LIKELY(i32Status == USBIP_STATUS_SUCCESS))
+ return VINF_SUCCESS;
+
+ switch (i32Status)
+ {
+ case USBIP_STATUS_PIPE_STALLED:
+ return VINF_SUCCESS;
+ default:
+ return VERR_INVALID_STATE;
+ }
+
+ return VERR_INVALID_STATE;
+}
+
+/**
* Converts a USB/IP status code to a VUSB status code.
*
* @returns VUSB status code.
@@ -771,7 +865,7 @@ static int usbProxyUsbIpCtrlUrbExchangeSync(PUSBPROXYDEVUSBIP pProxyDevUsbIp, PV
if (RT_SUCCESS(rc))
{
usbProxyUsbIpRetSubmitN2H(&RetSubmit);
- rc = usbProxyUsbIpVUsbStatusConvertFromStatus(RetSubmit.u32Status);
+ rc = usbProxyUsbIpStatusConvertFromStatus(RetSubmit.u32Status);
}
}
return rc;
@@ -809,9 +903,19 @@ static PUSBPROXYURBUSBIP usbProxyUsbIpGetUrbFromSeqNum(PUSBPROXYDEVUSBIP pProxyD
*/
static void usbProxyUsbIpResetRecvState(PUSBPROXYDEVUSBIP pProxyDevUsbIp)
{
- pProxyDevUsbIp->fRecvData = false;
- pProxyDevUsbIp->cbRecv = 0;
- pProxyDevUsbIp->cbLeft = sizeof(UsbIpReqRetHdr);
+ pProxyDevUsbIp->enmRecvState = USBPROXYUSBIPRECVSTATE_HDR_COMMON;
+ pProxyDevUsbIp->pbRecv = (uint8_t *)&pProxyDevUsbIp->BufRet;
+ pProxyDevUsbIp->cbRecv = 0;
+ pProxyDevUsbIp->cbLeft = sizeof(UsbIpReqRetHdr);
+}
+
+static void usbProxyUsbIpRecvStateAdvance(PUSBPROXYDEVUSBIP pProxyDevUsbIp, USBPROXYUSBIPRECVSTATE enmState,
+ uint8_t *pbData, size_t cbData)
+{
+ pProxyDevUsbIp->enmRecvState = enmState;
+ pProxyDevUsbIp->cbRecv = 0;
+ pProxyDevUsbIp->cbLeft = cbData;
+ pProxyDevUsbIp->pbRecv = pbData;
}
/**
@@ -829,117 +933,144 @@ static int usbProxyUsbIpRecvPdu(PUSBPROXYDEVUSBIP pProxyDevUsbIp, PUSBPROXYURBUS
size_t cbRead = 0;
PUSBPROXYURBUSBIP pUrbUsbIp = NULL;
- if (pProxyDevUsbIp->fRecvData)
- {
- /* Read data into the URB. */
- rc = RTTcpReadNB(pProxyDevUsbIp->hSocket, &pProxyDevUsbIp->pUrbUsbIp->pVUsbUrb->abData[pProxyDevUsbIp->cbRecv], pProxyDevUsbIp->cbLeft, &cbRead);
- if (RT_SUCCESS(rc))
- {
- pProxyDevUsbIp->cbRecv += cbRead;
- pProxyDevUsbIp->cbLeft -= cbRead;
+ Assert(pProxyDevUsbIp->cbLeft);
- if (!pProxyDevUsbIp->cbLeft)
- {
- pUrbUsbIp = pProxyDevUsbIp->pUrbUsbIp;
- usbProxyUsbIpResetRecvState(pProxyDevUsbIp);
- }
- }
- else
- {
- pUrbUsbIp = pProxyDevUsbIp->pUrbUsbIp;
- pUrbUsbIp->pVUsbUrb->enmStatus = VUSBSTATUS_DNR;
- usbProxyUsbIpResetRecvState(pProxyDevUsbIp);
- }
- }
- else
+ /* Read any available data first. */
+ rc = RTTcpReadNB(pProxyDevUsbIp->hSocket, pProxyDevUsbIp->pbRecv, pProxyDevUsbIp->cbLeft, &cbRead);
+ if (RT_SUCCESS(rc))
{
- rc = RTTcpReadNB(pProxyDevUsbIp->hSocket, &pProxyDevUsbIp->BufRet.abReply[pProxyDevUsbIp->cbRecv], pProxyDevUsbIp->cbLeft, &cbRead);
- if (RT_SUCCESS(rc))
- {
- pProxyDevUsbIp->cbRecv += cbRead;
- pProxyDevUsbIp->cbLeft -= cbRead;
- }
+ pProxyDevUsbIp->cbRecv += cbRead;
+ pProxyDevUsbIp->cbLeft -= cbRead;
+ pProxyDevUsbIp->pbRecv += cbRead;
- /* Check whether we received a complete header. */
+ /* Process the received data if there is nothing to receive left for the current state. */
if (!pProxyDevUsbIp->cbLeft)
{
- if (pProxyDevUsbIp->cbRecv == sizeof(UsbIpReqRetHdr))
+ switch (pProxyDevUsbIp->enmRecvState)
{
- /*
- * Determine the residual amount of data to receive until
- * the complete reply header was received.
- */
- switch (RT_N2H_U32(pProxyDevUsbIp->BufRet.Hdr.u32ReqRet))
+ case USBPROXYUSBIPRECVSTATE_HDR_COMMON:
{
- case USBIP_RET_SUBMIT:
- pProxyDevUsbIp->cbLeft = sizeof(UsbIpRetSubmit) - sizeof(UsbIpReqRetHdr);
- break;
- case USBIP_RET_UNLINK:
- pProxyDevUsbIp->cbLeft = sizeof(UsbIpRetUnlink) - sizeof(UsbIpReqRetHdr);
- break;
- default:
- AssertLogRelMsgFailed(("Invalid reply header received: %d\n",
- pProxyDevUsbIp->BufRet.Hdr.u32ReqRet));
- usbProxyUsbIpResetRecvState(pProxyDevUsbIp);
- }
- }
- else
- {
- AssertMsg(pProxyDevUsbIp->cbRecv > sizeof(UsbIpReqRetHdr), ("Invalid state\n"));
-
- /* Get the URB from the in flight list. */
- pProxyDevUsbIp->pUrbUsbIp = usbProxyUsbIpGetUrbFromSeqNum(pProxyDevUsbIp, RT_N2H_U32(pProxyDevUsbIp->BufRet.Hdr.u32SeqNum));
- if (pProxyDevUsbIp->pUrbUsbIp)
- {
- /** @todo: Verify that the directions match, verify that the length doesn't exceed the buffer. */
+ Assert(pProxyDevUsbIp->cbRecv == sizeof(UsbIpReqRetHdr));
+ /*
+ * Determine the residual amount of data to receive until
+ * the complete reply header was received.
+ */
switch (RT_N2H_U32(pProxyDevUsbIp->BufRet.Hdr.u32ReqRet))
{
case USBIP_RET_SUBMIT:
- usbProxyUsbIpRetSubmitN2H(&pProxyDevUsbIp->BufRet.RetSubmit);
- pProxyDevUsbIp->pUrbUsbIp->pVUsbUrb->enmStatus = usbProxyUsbIpVUsbStatusConvertFromStatus(pProxyDevUsbIp->BufRet.RetSubmit.u32Status);
- if ( pProxyDevUsbIp->pUrbUsbIp->pVUsbUrb->enmDir == VUSBDIRECTION_IN
- && pProxyDevUsbIp->pUrbUsbIp->pVUsbUrb->enmStatus == VUSBSTATUS_OK)
- {
- pProxyDevUsbIp->fRecvData = true;
- if (pProxyDevUsbIp->pUrbUsbIp->pVUsbUrb->enmType == VUSBXFERTYPE_MSG)
+ pProxyDevUsbIp->cbLeft = sizeof(UsbIpRetSubmit) - sizeof(UsbIpReqRetHdr);
+ pProxyDevUsbIp->enmRecvState = USBPROXYUSBIPRECVSTATE_HDR_RESIDUAL;
+ break;
+ case USBIP_RET_UNLINK:
+ pProxyDevUsbIp->cbLeft = sizeof(UsbIpRetUnlink) - sizeof(UsbIpReqRetHdr);
+ pProxyDevUsbIp->enmRecvState = USBPROXYUSBIPRECVSTATE_HDR_RESIDUAL;
+ break;
+ default:
+ AssertLogRelMsgFailed(("Invalid reply header received: %d\n",
+ pProxyDevUsbIp->BufRet.Hdr.u32ReqRet));
+ usbProxyUsbIpResetRecvState(pProxyDevUsbIp);
+ }
+
+ break;
+ }
+ case USBPROXYUSBIPRECVSTATE_HDR_RESIDUAL:
+ {
+ /* Get the URB from the in flight list. */
+ pProxyDevUsbIp->pUrbUsbIp = usbProxyUsbIpGetUrbFromSeqNum(pProxyDevUsbIp, RT_N2H_U32(pProxyDevUsbIp->BufRet.Hdr.u32SeqNum));
+ if (pProxyDevUsbIp->pUrbUsbIp)
+ {
+ /** @todo: Verify that the directions match, verify that the length doesn't exceed the buffer. */
+
+ switch (RT_N2H_U32(pProxyDevUsbIp->BufRet.Hdr.u32ReqRet))
+ {
+ case USBIP_RET_SUBMIT:
+ usbProxyUsbIpRetSubmitN2H(&pProxyDevUsbIp->BufRet.RetSubmit);
+
+ pProxyDevUsbIp->pUrbUsbIp->pVUsbUrb->enmStatus = usbProxyUsbIpVUsbStatusConvertFromStatus(pProxyDevUsbIp->BufRet.RetSubmit.u32Status);
+ if ( pProxyDevUsbIp->pUrbUsbIp->pVUsbUrb->enmDir == VUSBDIRECTION_IN
+ && pProxyDevUsbIp->pUrbUsbIp->pVUsbUrb->enmStatus == VUSBSTATUS_OK)
{
- /* Preserve the setup request. */
- pProxyDevUsbIp->cbRecv = sizeof(VUSBSETUP);
- pProxyDevUsbIp->cbLeft = pProxyDevUsbIp->BufRet.RetSubmit.u32ActualLength;
- pProxyDevUsbIp->pUrbUsbIp->pVUsbUrb->cbData = pProxyDevUsbIp->BufRet.RetSubmit.u32ActualLength + sizeof(VUSBSETUP);
+ uint8_t *pbData = NULL;
+
+ if (pProxyDevUsbIp->pUrbUsbIp->pVUsbUrb->enmType == VUSBXFERTYPE_MSG)
+ {
+ /* Preserve the setup request. */
+ pbData = &pProxyDevUsbIp->pUrbUsbIp->pVUsbUrb->abData[sizeof(VUSBSETUP)];
+ pProxyDevUsbIp->pUrbUsbIp->pVUsbUrb->cbData = pProxyDevUsbIp->BufRet.RetSubmit.u32ActualLength + sizeof(VUSBSETUP);
+ }
+ else
+ {
+ pbData = &pProxyDevUsbIp->pUrbUsbIp->pVUsbUrb->abData[0];
+ pProxyDevUsbIp->pUrbUsbIp->pVUsbUrb->cbData = pProxyDevUsbIp->BufRet.RetSubmit.u32ActualLength;
+ }
+
+ usbProxyUsbIpRecvStateAdvance(pProxyDevUsbIp, USBPROXYUSBIPRECVSTATE_URB_BUFFER,
+ pbData, pProxyDevUsbIp->BufRet.RetSubmit.u32ActualLength);
}
else
{
- pProxyDevUsbIp->cbRecv = 0;
- pProxyDevUsbIp->cbLeft = pProxyDevUsbIp->BufRet.RetSubmit.u32ActualLength;
- pProxyDevUsbIp->pUrbUsbIp->pVUsbUrb->cbData = pProxyDevUsbIp->BufRet.RetSubmit.u32ActualLength;
+ Assert( pProxyDevUsbIp->pUrbUsbIp->pVUsbUrb->enmDir == VUSBDIRECTION_OUT
+ || pProxyDevUsbIp->pUrbUsbIp->pVUsbUrb->enmStatus != VUSBSTATUS_OK);
+ pUrbUsbIp = pProxyDevUsbIp->pUrbUsbIp;
+ usbProxyUsbIpResetRecvState(pProxyDevUsbIp);
}
- }
- else
- {
- Assert( pProxyDevUsbIp->pUrbUsbIp->pVUsbUrb->enmDir == VUSBDIRECTION_OUT
- || pProxyDevUsbIp->pUrbUsbIp->pVUsbUrb->enmStatus != VUSBSTATUS_OK);
+ break;
+ case USBIP_RET_UNLINK:
+ usbProxyUsbIpRetUnlinkN2H(&pProxyDevUsbIp->BufRet.RetUnlink);
pUrbUsbIp = pProxyDevUsbIp->pUrbUsbIp;
+ pUrbUsbIp->pVUsbUrb->enmStatus = usbProxyUsbIpVUsbStatusConvertFromStatus(pProxyDevUsbIp->BufRet.RetUnlink.u32Status);
usbProxyUsbIpResetRecvState(pProxyDevUsbIp);
- }
- break;
- case USBIP_RET_UNLINK:
- usbProxyUsbIpRetUnlinkN2H(&pProxyDevUsbIp->BufRet.RetUnlink);
- pUrbUsbIp = pProxyDevUsbIp->pUrbUsbIp;
- pUrbUsbIp->pVUsbUrb->enmStatus = usbProxyUsbIpVUsbStatusConvertFromStatus(pProxyDevUsbIp->BufRet.RetUnlink.u32Status);
- usbProxyUsbIpResetRecvState(pProxyDevUsbIp);
- break;
+ break;
+ }
+ }
+ else
+ {
+ LogRel(("USB/IP: Received reply with sequence number doesn't match any local URB\n", pProxyDevUsbIp->BufRet.Hdr.u32SeqNum));
+ usbProxyUsbIpResetRecvState(pProxyDevUsbIp);
}
+
+ break;
}
- else
- {
- LogRel(("USB/IP: Received reply with sequence number doesn't match any local URB\n", pProxyDevUsbIp->BufRet.Hdr.u32SeqNum));
+ case USBPROXYUSBIPRECVSTATE_URB_BUFFER:
+ if (pProxyDevUsbIp->pUrbUsbIp->pVUsbUrb->enmType == VUSBXFERTYPE_ISOC)
+ usbProxyUsbIpRecvStateAdvance(pProxyDevUsbIp, USBPROXYUSBIPRECVSTATE_ISOC_PKT_DESCS,
+ (uint8_t *)&pProxyDevUsbIp->aIsocPktDesc[0],
+ pProxyDevUsbIp->pUrbUsbIp->pVUsbUrb->cIsocPkts * sizeof(UsbIpIsocPktDesc));
+ else
+ {
+ pUrbUsbIp = pProxyDevUsbIp->pUrbUsbIp;
+ usbProxyUsbIpResetRecvState(pProxyDevUsbIp);
+ }
+ break;
+ case USBPROXYUSBIPRECVSTATE_ISOC_PKT_DESCS:
+ /* Process all received isochronous packet descriptors. */
+ for (unsigned i = 0; i < pProxyDevUsbIp->pUrbUsbIp->pVUsbUrb->cIsocPkts; i++)
+ {
+ PVUSBURBISOCPTK pIsocPkt = &pProxyDevUsbIp->pUrbUsbIp->pVUsbUrb->aIsocPkts[i];
+ usbProxyUsbIpIsocPktDescN2H(&pProxyDevUsbIp->aIsocPktDesc[i]);
+ pIsocPkt->enmStatus = usbProxyUsbIpVUsbStatusConvertFromStatus(pProxyDevUsbIp->aIsocPktDesc[i].i32Status);
+ pIsocPkt->off = pProxyDevUsbIp->aIsocPktDesc[i].u32Offset;
+ pIsocPkt->cb = pProxyDevUsbIp->aIsocPktDesc[i].u32ActualLength;
+ }
+
+ pUrbUsbIp = pProxyDevUsbIp->pUrbUsbIp;
usbProxyUsbIpResetRecvState(pProxyDevUsbIp);
- }
+ break;
+ default:
+ AssertLogRelMsgFailed(("USB/IP: Invalid receive state %d\n", pProxyDevUsbIp->enmRecvState));
}
}
}
+ else
+ {
+ /** @todo: Complete all URBs with DNR error and mark device as unplugged. */
+#if 0
+ pUrbUsbIp = pProxyDevUsbIp->pUrbUsbIp;
+ pUrbUsbIp->pVUsbUrb->enmStatus = VUSBSTATUS_DNR;
+ usbProxyUsbIpResetRecvState(pProxyDevUsbIp);
+#endif
+ }
if (RT_SUCCESS(rc))
*ppUrbUsbIp = pUrbUsbIp;
@@ -956,8 +1087,6 @@ static int usbProxyUsbIpRecvPdu(PUSBPROXYDEVUSBIP pProxyDevUsbIp, PUSBPROXYURBUS
*/
static int usbProxyUsbIpUrbQueueWorker(PUSBPROXYDEVUSBIP pProxyDevUsbIp, PUSBPROXYURBUSBIP pUrbUsbIp)
{
- size_t cbData = 0;
- void *pvData = NULL;
PVUSBURB pUrb = pUrbUsbIp->pVUsbUrb;
pUrbUsbIp->u32SeqNumUrb = usbProxyUsbIpSeqNumGet(pProxyDevUsbIp);
@@ -977,46 +1106,61 @@ static int usbProxyUsbIpUrbQueueWorker(PUSBPROXYDEVUSBIP pProxyDevUsbIp, PUSBPRO
ReqSubmit.u32NumIsocPkts = 0;
ReqSubmit.u32Interval = 0;
+ RTSGSEG aSegReq[3]; /* Maximum number of segments used for a Isochronous transfer. */
+ UsbIpIsocPktDesc aIsocPktsDesc[8];
+ unsigned cSegsUsed = 1;
+ aSegReq[0].pvSeg = &ReqSubmit;
+ aSegReq[0].cbSeg = sizeof(ReqSubmit);
+
+
switch (pUrb->enmType)
{
case VUSBXFERTYPE_MSG:
memcpy(&ReqSubmit.Setup, &pUrb->abData, sizeof(ReqSubmit.Setup));
if (pUrb->enmDir == VUSBDIRECTION_OUT)
{
- cbData = pUrb->cbData - sizeof(VUSBSETUP);
- pvData = pUrb->abData + sizeof(VUSBSETUP);
+ ReqSubmit.u32TransferBufferLength -= sizeof(VUSBSETUP);
+ aSegReq[cSegsUsed].cbSeg = pUrb->cbData - sizeof(VUSBSETUP);
+ aSegReq[cSegsUsed].pvSeg = pUrb->abData + sizeof(VUSBSETUP);
+ cSegsUsed++;
}
- else
- cbData = 0;
LogFlowFunc(("Message (Control) URB\n"));
break;
case VUSBXFERTYPE_ISOC:
- cbData = pUrb->cbData;
- pvData = pUrb->abData;
-
ReqSubmit.u32XferFlags |= USBIP_XFER_FLAGS_ISO_ASAP;
ReqSubmit.u32NumIsocPkts = pUrb->cIsocPkts;
-#if 0
+ if (pUrb->enmDir == VUSBDIRECTION_OUT)
+ {
+ aSegReq[cSegsUsed].cbSeg = pUrb->cbData;
+ aSegReq[cSegsUsed].pvSeg = pUrb->abData;
+ cSegsUsed++;
+ }
+
for (unsigned i = 0; i < pUrb->cIsocPkts; i++)
{
- pUrbLnx->KUrb.iso_frame_desc[i].length = pUrb->aIsocPkts[i].cb;
- pUrbLnx->KUrb.iso_frame_desc[i].actual_length = 0;
- pUrbLnx->KUrb.iso_frame_desc[i].status = 0x7fff;
+ aIsocPktsDesc[i].u32Offset = pUrb->aIsocPkts[i].off;
+ aIsocPktsDesc[i].u32Length = pUrb->aIsocPkts[i].cb;
+ aIsocPktsDesc[i].u32ActualLength = 0; /** @todo */
+ aIsocPktsDesc[i].i32Status = pUrb->aIsocPkts[i].enmStatus;
+ usbProxyUsbIpIsocPktDescH2N(&aIsocPktsDesc[i]);
}
-#else /** @todo: Implement isochronous support */
- usbProxyUsbIpUrbFree(pProxyDevUsbIp, pUrbUsbIp);
- return VERR_NOT_SUPPORTED;
-#endif
+
+ if (pUrb->cIsocPkts)
+ {
+ aSegReq[cSegsUsed].cbSeg = pUrb->cIsocPkts * sizeof(UsbIpIsocPktDesc);
+ aSegReq[cSegsUsed].pvSeg = &aIsocPktsDesc[0];
+ cSegsUsed++;
+ }
+
break;
case VUSBXFERTYPE_BULK:
case VUSBXFERTYPE_INTR:
if (pUrb->enmDir == VUSBDIRECTION_OUT)
{
- cbData = pUrb->cbData;
- pvData = pUrb->abData;
+ aSegReq[cSegsUsed].cbSeg = pUrb->cbData;
+ aSegReq[cSegsUsed].pvSeg = pUrb->abData;
+ cSegsUsed++;
}
- else
- cbData = 0;
break;
default:
usbProxyUsbIpUrbFree(pProxyDevUsbIp, pUrbUsbIp);
@@ -1025,14 +1169,11 @@ static int usbProxyUsbIpUrbQueueWorker(PUSBPROXYDEVUSBIP pProxyDevUsbIp, PUSBPRO
usbProxyUsbIpReqSubmitH2N(&ReqSubmit);
+ Assert(cSegsUsed <= RT_ELEMENTS(aSegReq));
+
/* Send the command. */
RTSGBUF SgBufReq;
- RTSGSEG aSegReq[2];
- aSegReq[0].pvSeg = &ReqSubmit;
- aSegReq[0].cbSeg = sizeof(ReqSubmit);
- aSegReq[1].pvSeg = pvData;
- aSegReq[1].cbSeg = cbData;
- RTSgBufInit(&SgBufReq, &aSegReq[0], RT_ELEMENTS(aSegReq));
+ RTSgBufInit(&SgBufReq, &aSegReq[0], cSegsUsed);
int rc = RTTcpSgWrite(pProxyDevUsbIp->hSocket, &SgBufReq);
if (RT_SUCCESS(rc))
@@ -1134,6 +1275,9 @@ static DECLCALLBACK(int) usbProxyUsbIpOpen(PUSBPROXYDEV pProxyDev, const char *p
pDevUsbIp->pszBusId = NULL;
usbProxyUsbIpResetRecvState(pDevUsbIp);
+ pProxyDev->iActiveCfg = 1; /** @todo that may not be always true. */
+ pProxyDev->cIgnoreSetConfigs = 1;
+
rc = RTSemFastMutexCreate(&pDevUsbIp->hMtxLists);
if (RT_SUCCESS(rc))
{
@@ -1230,8 +1374,26 @@ static DECLCALLBACK(int) usbProxyUsbIpReset(PUSBPROXYDEV pProxyDev, bool fResetO
{
LogFlowFunc(("pProxyDev = %p\n", pProxyDev));
+ int rc = VINF_SUCCESS;
PUSBPROXYDEVUSBIP pProxyDevUsbIp = USBPROXYDEV_2_DATA(pProxyDev, PUSBPROXYDEVUSBIP);
- return VINF_SUCCESS; /* No way to reset the device with the current protocol. */
+ VUSBSETUP Setup;
+
+ if (fResetOnLinux)
+ {
+ Setup.bmRequestType = RT_BIT(5) | 0x03; /* Port request. */
+ Setup.bRequest = 0x03; /* SET_FEATURE */
+ Setup.wValue = 4; /* Port feature: Reset */
+ Setup.wIndex = 0; /* Port number, irrelevant */
+ Setup.wLength = 0;
+ rc = usbProxyUsbIpCtrlUrbExchangeSync(pProxyDevUsbIp, &Setup);
+ if (RT_SUCCESS(rc))
+ {
+ pProxyDev->iActiveCfg = -1;
+ pProxyDev->cIgnoreSetConfigs = 2;
+ }
+ }
+
+ return rc;
}
static DECLCALLBACK(int) usbProxyUsbIpSetConfig(PUSBPROXYDEV pProxyDev, int iCfg)
@@ -1269,7 +1431,7 @@ static DECLCALLBACK(int) usbProxyUsbIpSetInterface(PUSBPROXYDEV pProxyDev, int i
VUSBSETUP Setup;
Setup.bmRequestType = 0x1;
- Setup.bRequest = 0x11; /* SET_INTERFACE */
+ Setup.bRequest = 0x0b; /* SET_INTERFACE */
Setup.wValue = setting;
Setup.wIndex = ifnum;
Setup.wLength = 0;
diff --git a/src/VBox/Devices/USB/win/USBProxyDevice-win.cpp b/src/VBox/Devices/USB/win/USBProxyDevice-win.cpp
index fb4e5dd..f5efbd7 100644
--- a/src/VBox/Devices/USB/win/USBProxyDevice-win.cpp
+++ b/src/VBox/Devices/USB/win/USBProxyDevice-win.cpp
@@ -16,9 +16,9 @@
*/
-/*******************************************************************************
-* Header Files *
-*******************************************************************************/
+/*********************************************************************************************************************************
+* Header Files *
+*********************************************************************************************************************************/
#define LOG_GROUP LOG_GROUP_DRV_USBPROXY
#include <windows.h>
@@ -36,9 +36,9 @@
#include <VBox/usblib.h>
-/*******************************************************************************
-* Structures and Typedefs *
-*******************************************************************************/
+/*********************************************************************************************************************************
+* Structures and Typedefs *
+*********************************************************************************************************************************/
typedef struct _QUEUED_URB
{
PVUSBURB urb;
@@ -74,9 +74,10 @@ typedef struct
/* All functions are returning 1 on success, 0 on error */
-/*******************************************************************************
-* Internal Functions *
-*******************************************************************************/
+
+/*********************************************************************************************************************************
+* Internal Functions *
+*********************************************************************************************************************************/
static int usbProxyWinSetInterface(PUSBPROXYDEV p, int ifnum, int setting);
/**
diff --git a/src/VBox/Devices/VMMDev/VMMDev.cpp b/src/VBox/Devices/VMMDev/VMMDev.cpp
index 94e5042..72f76cc 100644
--- a/src/VBox/Devices/VMMDev/VMMDev.cpp
+++ b/src/VBox/Devices/VMMDev/VMMDev.cpp
@@ -16,9 +16,9 @@
*/
-/*******************************************************************************
-* Header Files *
-*******************************************************************************/
+/*********************************************************************************************************************************
+* Header Files *
+*********************************************************************************************************************************/
/* Enable dev_vmm Log3 statements to get IRQ-related logging. */
#define LOG_GROUP LOG_GROUP_DEV_VMM
#include <VBox/VMMDev.h>
@@ -56,9 +56,9 @@
#endif
-/*******************************************************************************
-* Defined Constants And Macros *
-*******************************************************************************/
+/*********************************************************************************************************************************
+* Defined Constants And Macros *
+*********************************************************************************************************************************/
#define VBOX_GUEST_INTERFACE_VERSION_1_03(s) \
( RT_HIWORD((s)->guestInfo.interfaceVersion) == 1 \
&& RT_LOWORD((s)->guestInfo.interfaceVersion) == 3 )
@@ -135,6 +135,76 @@
/* -=-=-=-=- Misc Helpers -=-=-=-=- */
+/**
+ * Log information about the Guest Additions.
+ *
+ * @param pGuestInfo The information we've got from the Guest Additions driver.
+ */
+static void vmmdevLogGuestOsInfo(VBoxGuestInfo *pGuestInfo)
+{
+ const char *pcszOs;
+ switch (pGuestInfo->osType & ~VBOXOSTYPE_x64)
+ {
+ case VBOXOSTYPE_DOS: pcszOs = "DOS"; break;
+ case VBOXOSTYPE_Win31: pcszOs = "Windows 3.1"; break;
+ case VBOXOSTYPE_Win9x: pcszOs = "Windows 9x"; break;
+ case VBOXOSTYPE_Win95: pcszOs = "Windows 95"; break;
+ case VBOXOSTYPE_Win98: pcszOs = "Windows 98"; break;
+ case VBOXOSTYPE_WinMe: pcszOs = "Windows Me"; break;
+ case VBOXOSTYPE_WinNT: pcszOs = "Windows NT"; break;
+ case VBOXOSTYPE_WinNT4: pcszOs = "Windows NT4"; break;
+ case VBOXOSTYPE_Win2k: pcszOs = "Windows 2k"; break;
+ case VBOXOSTYPE_WinXP: pcszOs = "Windows XP"; break;
+ case VBOXOSTYPE_Win2k3: pcszOs = "Windows 2k3"; break;
+ case VBOXOSTYPE_WinVista: pcszOs = "Windows Vista"; break;
+ case VBOXOSTYPE_Win2k8: pcszOs = "Windows 2k8"; break;
+ case VBOXOSTYPE_Win7: pcszOs = "Windows 7"; break;
+ case VBOXOSTYPE_Win8: pcszOs = "Windows 8"; break;
+ case VBOXOSTYPE_Win2k12_x64 & ~VBOXOSTYPE_x64: pcszOs = "Windows 2k12"; break;
+ case VBOXOSTYPE_Win81: pcszOs = "Windows 8.1"; break;
+ case VBOXOSTYPE_Win10: pcszOs = "Windows 10"; break;
+ case VBOXOSTYPE_OS2: pcszOs = "OS/2"; break;
+ case VBOXOSTYPE_OS2Warp3: pcszOs = "OS/2 Warp 3"; break;
+ case VBOXOSTYPE_OS2Warp4: pcszOs = "OS/2 Warp 4"; break;
+ case VBOXOSTYPE_OS2Warp45: pcszOs = "OS/2 Warp 4.5"; break;
+ case VBOXOSTYPE_ECS: pcszOs = "OS/2 ECS"; break;
+ case VBOXOSTYPE_OS21x: pcszOs = "OS/2 2.1x"; break;
+ case VBOXOSTYPE_Linux: pcszOs = "Linux"; break;
+ case VBOXOSTYPE_Linux22: pcszOs = "Linux 2.2"; break;
+ case VBOXOSTYPE_Linux24: pcszOs = "Linux 2.4"; break;
+ case VBOXOSTYPE_Linux26: pcszOs = "Linux >= 2.6"; break;
+ case VBOXOSTYPE_ArchLinux: pcszOs = "ArchLinux"; break;
+ case VBOXOSTYPE_Debian: pcszOs = "Debian"; break;
+ case VBOXOSTYPE_OpenSUSE: pcszOs = "openSUSE"; break;
+ case VBOXOSTYPE_FedoraCore: pcszOs = "Fedora"; break;
+ case VBOXOSTYPE_Gentoo: pcszOs = "Gentoo"; break;
+ case VBOXOSTYPE_Mandriva: pcszOs = "Mandriva"; break;
+ case VBOXOSTYPE_RedHat: pcszOs = "RedHat"; break;
+ case VBOXOSTYPE_Turbolinux: pcszOs = "TurboLinux"; break;
+ case VBOXOSTYPE_Ubuntu: pcszOs = "Ubuntu"; break;
+ case VBOXOSTYPE_Xandros: pcszOs = "Xandros"; break;
+ case VBOXOSTYPE_Oracle: pcszOs = "Oracle Linux"; break;
+ case VBOXOSTYPE_FreeBSD: pcszOs = "FreeBSD"; break;
+ case VBOXOSTYPE_OpenBSD: pcszOs = "OpenBSD"; break;
+ case VBOXOSTYPE_NetBSD: pcszOs = "NetBSD"; break;
+ case VBOXOSTYPE_Netware: pcszOs = "Netware"; break;
+ case VBOXOSTYPE_Solaris: pcszOs = "Solaris"; break;
+ case VBOXOSTYPE_OpenSolaris: pcszOs = "OpenSolaris"; break;
+ case VBOXOSTYPE_Solaris11_x64 & ~VBOXOSTYPE_x64: pcszOs = "Solaris 11"; break;
+ case VBOXOSTYPE_MacOS: pcszOs = "Mac OS X"; break;
+ case VBOXOSTYPE_MacOS106: pcszOs = "Mac OS X 10.6"; break;
+ case VBOXOSTYPE_MacOS107_x64 & ~VBOXOSTYPE_x64: pcszOs = "Mac OS X 10.7"; break;
+ case VBOXOSTYPE_MacOS108_x64 & ~VBOXOSTYPE_x64: pcszOs = "Mac OS X 10.8"; break;
+ case VBOXOSTYPE_MacOS109_x64 & ~VBOXOSTYPE_x64: pcszOs = "Mac OS X 10.9"; break;
+ case VBOXOSTYPE_MacOS1010_x64 & ~VBOXOSTYPE_x64: pcszOs = "Mac OS X 10.10"; break;
+ case VBOXOSTYPE_MacOS1011_x64 & ~VBOXOSTYPE_x64: pcszOs = "Mac OS X 10.11"; break;
+ case VBOXOSTYPE_Haiku: pcszOs = "Haiku"; break;
+ default: pcszOs = "unknown"; break;
+ }
+ LogRel(("VMMDev: Guest Additions information report: Interface = 0x%08X osType = 0x%08X (%s, %u-bit)\n",
+ pGuestInfo->interfaceVersion, pGuestInfo->osType, pcszOs,
+ pGuestInfo->osType & VBOXOSTYPE_x64 ? 64 : 32));
+}
/**
* Sets the IRQ (raise it or lower it) for 1.03 additions.
@@ -339,9 +409,7 @@ static int vmmdevReqHandler_ReportGuestInfo(PVMMDEV pThis, VMMDevRequestHeader *
/* Check additions interface version. */
pThis->fu32AdditionsOk = VBOX_GUEST_INTERFACE_VERSION_OK(pThis->guestInfo.interfaceVersion);
- LogRel(("VMMDev: Guest Additions information report: Interface = 0x%08X osType = 0x%08X (%u-bit)\n",
- pThis->guestInfo.interfaceVersion, pThis->guestInfo.osType,
- (pThis->guestInfo.osType & VBOXOSTYPE_x64) ? 64 : 32));
+ vmmdevLogGuestOsInfo(&pThis->guestInfo);
if (pThis->pDrv && pThis->pDrv->pfnUpdateGuestInfo)
pThis->pDrv->pfnUpdateGuestInfo(pThis->pDrv, &pThis->guestInfo);
@@ -3552,9 +3620,7 @@ static DECLCALLBACK(int) vmmdevLoadExec(PPDMDEVINS pDevIns, PSSMHANDLE pSSM, uin
if (pThis->fu32AdditionsOk)
{
- LogRel(("VMMDev: Guest Additions information report: additionsVersion = 0x%08X, osType = 0x%08X (%u-bit)\n",
- pThis->guestInfo.interfaceVersion, pThis->guestInfo.osType,
- (pThis->guestInfo.osType & VBOXOSTYPE_x64) ? 64 : 32));
+ vmmdevLogGuestOsInfo(&pThis->guestInfo);
if (pThis->pDrv)
{
if (pThis->guestInfo2.uFullVersion && pThis->pDrv->pfnUpdateGuestInfo2)
diff --git a/src/VBox/Devices/VMMDev/VMMDevHGCM.cpp b/src/VBox/Devices/VMMDev/VMMDevHGCM.cpp
index 8d617dc..7a1c4ec 100644
--- a/src/VBox/Devices/VMMDev/VMMDevHGCM.cpp
+++ b/src/VBox/Devices/VMMDev/VMMDevHGCM.cpp
@@ -16,9 +16,9 @@
*/
-/*******************************************************************************
-* Header Files *
-*******************************************************************************/
+/*********************************************************************************************************************************
+* Header Files *
+*********************************************************************************************************************************/
#define LOG_GROUP LOG_GROUP_DEV_VMM
#include <iprt/alloc.h>
#include <iprt/asm.h>
@@ -43,9 +43,9 @@
#endif
-/*******************************************************************************
-* Structures and Typedefs *
-*******************************************************************************/
+/*********************************************************************************************************************************
+* Structures and Typedefs *
+*********************************************************************************************************************************/
typedef enum VBOXHGCMCMDTYPE
{
VBOXHGCMCMDTYPE_LOADSTATE = 0,
diff --git a/src/VBox/Devices/VMMDev/VMMDevHGCM.h b/src/VBox/Devices/VMMDev/VMMDevHGCM.h
index 30fcb50..1d6bea1 100644
--- a/src/VBox/Devices/VMMDev/VMMDevHGCM.h
+++ b/src/VBox/Devices/VMMDev/VMMDevHGCM.h
@@ -21,13 +21,13 @@
#include "VMMDevState.h"
RT_C_DECLS_BEGIN
-DECLCALLBACK(int) vmmdevHGCMConnect (VMMDevState *pVMMDevState, VMMDevHGCMConnect *pHGCMConnect, RTGCPHYS GCPtr);
-DECLCALLBACK(int) vmmdevHGCMDisconnect (VMMDevState *pVMMDevState, VMMDevHGCMDisconnect *pHGCMDisconnect, RTGCPHYS GCPtr);
-DECLCALLBACK(int) vmmdevHGCMCall (VMMDevState *pVMMDevState, VMMDevHGCMCall *pHGCMCall, uint32_t cbHGCMCall, RTGCPHYS GCPtr, bool f64Bits);
-DECLCALLBACK(int) vmmdevHGCMCancel (VMMDevState *pVMMDevState, VMMDevHGCMCancel *pHGCMCancel, RTGCPHYS GCPtr);
-DECLCALLBACK(int) vmmdevHGCMCancel2 (VMMDevState *pVMMDevState, RTGCPHYS GCPtr);
+int vmmdevHGCMConnect(VMMDevState *pVMMDevState, VMMDevHGCMConnect *pHGCMConnect, RTGCPHYS GCPtr);
+int vmmdevHGCMDisconnect(VMMDevState *pVMMDevState, VMMDevHGCMDisconnect *pHGCMDisconnect, RTGCPHYS GCPtr);
+int vmmdevHGCMCall(VMMDevState *pVMMDevState, VMMDevHGCMCall *pHGCMCall, uint32_t cbHGCMCall, RTGCPHYS GCPtr, bool f64Bits);
+int vmmdevHGCMCancel(VMMDevState *pVMMDevState, VMMDevHGCMCancel *pHGCMCancel, RTGCPHYS GCPtr);
+int vmmdevHGCMCancel2(VMMDevState *pVMMDevState, RTGCPHYS GCPtr);
-DECLCALLBACK(void) hgcmCompleted (PPDMIHGCMPORT pInterface, int32_t result, PVBOXHGCMCMD pCmdPtr);
+DECLCALLBACK(void) hgcmCompleted(PPDMIHGCMPORT pInterface, int32_t result, PVBOXHGCMCMD pCmdPtr);
int vmmdevHGCMSaveState(VMMDevState *pVMMDevState, PSSMHANDLE pSSM);
int vmmdevHGCMLoadState(VMMDevState *pVMMDevState, PSSMHANDLE pSSM, uint32_t u32Version);
diff --git a/src/VBox/Devices/VMMDev/VMMDevTesting.cpp b/src/VBox/Devices/VMMDev/VMMDevTesting.cpp
index ac2c82c..419100e 100644
--- a/src/VBox/Devices/VMMDev/VMMDevTesting.cpp
+++ b/src/VBox/Devices/VMMDev/VMMDevTesting.cpp
@@ -18,9 +18,9 @@
*/
-/*******************************************************************************
-* Header Files *
-*******************************************************************************/
+/*********************************************************************************************************************************
+* Header Files *
+*********************************************************************************************************************************/
#define LOG_GROUP LOG_GROUP_DEV_VMM
#include <VBox/VMMDev.h>
#include <VBox/vmm/vmapi.h>
diff --git a/src/VBox/Devices/VirtIO/Virtio.cpp b/src/VBox/Devices/VirtIO/Virtio.cpp
index cd55e99..873c539 100644
--- a/src/VBox/Devices/VirtIO/Virtio.cpp
+++ b/src/VBox/Devices/VirtIO/Virtio.cpp
@@ -16,9 +16,9 @@
*/
-/*******************************************************************************
-* Header Files *
-*******************************************************************************/
+/*********************************************************************************************************************************
+* Header Files *
+*********************************************************************************************************************************/
#define LOG_GROUP LOG_GROUP_DEV_VIRTIO
#include <iprt/param.h>
@@ -809,10 +809,10 @@ static const char *vpciCounter(const char *pszDevFmt,
}
// TODO: header
-DECLCALLBACK(int) vpciConstruct(PPDMDEVINS pDevIns, VPCISTATE *pState,
- int iInstance, const char *pcszNameFmt,
- uint16_t uSubsystemId, uint16_t uClass,
- uint32_t nQueues)
+int vpciConstruct(PPDMDEVINS pDevIns, VPCISTATE *pState,
+ int iInstance, const char *pcszNameFmt,
+ uint16_t uSubsystemId, uint16_t uClass,
+ uint32_t nQueues)
{
/* Init handles and log related stuff. */
RTStrPrintf(pState->szInstance, sizeof(pState->szInstance),
diff --git a/src/VBox/Devices/build/VBoxDD.cpp b/src/VBox/Devices/build/VBoxDD.cpp
index 7402624..92aa661 100644
--- a/src/VBox/Devices/build/VBoxDD.cpp
+++ b/src/VBox/Devices/build/VBoxDD.cpp
@@ -16,9 +16,9 @@
*/
-/*******************************************************************************
-* Header Files *
-*******************************************************************************/
+/*********************************************************************************************************************************
+* Header Files *
+*********************************************************************************************************************************/
#define LOG_GROUP LOG_GROUP_DEV
#include <VBox/vmm/pdm.h>
#include <VBox/version.h>
@@ -31,9 +31,9 @@
#include "VBoxDD.h"
-/*******************************************************************************
-* Global Variables *
-*******************************************************************************/
+/*********************************************************************************************************************************
+* Global Variables *
+*********************************************************************************************************************************/
const void *g_apvVBoxDDDependencies[] =
{
NULL,
diff --git a/src/VBox/Devices/build/VBoxDD2.cpp b/src/VBox/Devices/build/VBoxDD2.cpp
index 385b451..6165fad 100644
--- a/src/VBox/Devices/build/VBoxDD2.cpp
+++ b/src/VBox/Devices/build/VBoxDD2.cpp
@@ -18,9 +18,9 @@
*/
-/*******************************************************************************
-* Header Files *
-*******************************************************************************/
+/*********************************************************************************************************************************
+* Header Files *
+*********************************************************************************************************************************/
#define LOG_GROUP LOG_GROUP_DEV
#include <VBox/vmm/pdm.h>
#include <VBox/version.h>
@@ -32,9 +32,9 @@
#include "VBoxDD2.h"
-/*******************************************************************************
-* Global Variables *
-*******************************************************************************/
+/*********************************************************************************************************************************
+* Global Variables *
+*********************************************************************************************************************************/
const void *g_apvVBoxDDDependencies2[] =
{
(void *)&g_abPcBiosBinary,
diff --git a/src/VBox/Devices/build/VBoxDD2R0.cpp b/src/VBox/Devices/build/VBoxDD2R0.cpp
index 32bc15c..4b47fbb 100644
--- a/src/VBox/Devices/build/VBoxDD2R0.cpp
+++ b/src/VBox/Devices/build/VBoxDD2R0.cpp
@@ -15,15 +15,16 @@
* hope that it will be useful, but WITHOUT ANY WARRANTY of any kind.
*/
-/*******************************************************************************
-* Header Files *
-*******************************************************************************/
+
+/*********************************************************************************************************************************
+* Header Files *
+*********************************************************************************************************************************/
#include <iprt/types.h>
-/*******************************************************************************
-* Global Variables *
-*******************************************************************************/
+/*********************************************************************************************************************************
+* Global Variables *
+*********************************************************************************************************************************/
#if defined(RT_OS_SOLARIS) && defined(IN_RING0)
/* Dependency information for the native solaris loader. */
extern "C" { char _depends_on[] = "vboxdrv VMMR0.r0"; }
diff --git a/src/VBox/Devices/build/VBoxDDR0.cpp b/src/VBox/Devices/build/VBoxDDR0.cpp
index 4cc2b42..e175a2f 100644
--- a/src/VBox/Devices/build/VBoxDDR0.cpp
+++ b/src/VBox/Devices/build/VBoxDDR0.cpp
@@ -15,15 +15,16 @@
* hope that it will be useful, but WITHOUT ANY WARRANTY of any kind.
*/
-/*******************************************************************************
-* Header Files *
-*******************************************************************************/
+
+/*********************************************************************************************************************************
+* Header Files *
+*********************************************************************************************************************************/
#include <iprt/types.h>
-/*******************************************************************************
-* Global Variables *
-*******************************************************************************/
+/*********************************************************************************************************************************
+* Global Variables *
+*********************************************************************************************************************************/
#if defined(RT_OS_SOLARIS) && defined(IN_RING0)
/* Dependency information for the native solaris loader. */
extern "C" { char _depends_on[] = "vboxdrv VMMR0.r0"; }
diff --git a/src/VBox/Devices/build/VBoxDDUDeps.cpp b/src/VBox/Devices/build/VBoxDDUDeps.cpp
index 0ee5032..f053e08 100644
--- a/src/VBox/Devices/build/VBoxDDUDeps.cpp
+++ b/src/VBox/Devices/build/VBoxDDUDeps.cpp
@@ -15,9 +15,10 @@
* hope that it will be useful, but WITHOUT ANY WARRANTY of any kind.
*/
-/*******************************************************************************
-* Header Files *
-*******************************************************************************/
+
+/*********************************************************************************************************************************
+* Header Files *
+*********************************************************************************************************************************/
#include <VBox/types.h>
#include <VBox/vd.h>
#ifdef VBOX_WITH_USB
diff --git a/src/VBox/Devices/testcase/tstDeviceStructSize.cpp b/src/VBox/Devices/testcase/tstDeviceStructSize.cpp
index 2099495..60fd1a0 100644
--- a/src/VBox/Devices/testcase/tstDeviceStructSize.cpp
+++ b/src/VBox/Devices/testcase/tstDeviceStructSize.cpp
@@ -17,9 +17,10 @@
* hope that it will be useful, but WITHOUT ANY WARRANTY of any kind.
*/
-/*******************************************************************************
-* Header Files *
-*******************************************************************************/
+
+/*********************************************************************************************************************************
+* Header Files *
+*********************************************************************************************************************************/
#include <VBox/types.h>
#include <iprt/x86.h>
@@ -114,9 +115,9 @@
#include <stdio.h>
-/*******************************************************************************
-* Defined Constants And Macros *
-*******************************************************************************/
+/*********************************************************************************************************************************
+* Defined Constants And Macros *
+*********************************************************************************************************************************/
/**
* Checks the offset of a data member.
* @param type Type.
@@ -342,8 +343,11 @@ int main()
CHECK_MEMBER_ALIGNMENT(PITSTATE, StatPITIrq, 8);
CHECK_MEMBER_ALIGNMENT(SerialState, CritSect, 8);
#ifdef VBOX_WITH_VMSVGA
+ CHECK_SIZE(VMSVGAState, RT_ALIGN_Z(sizeof(VMSVGAState), 8));
+ CHECK_MEMBER_ALIGNMENT(VGASTATE, svga, 8);
CHECK_MEMBER_ALIGNMENT(VGASTATE, svga.u64HostWindowId, 8);
#endif
+ CHECK_MEMBER_ALIGNMENT(VGASTATE, cMonitors, 8);
CHECK_MEMBER_ALIGNMENT(VGASTATE, GCPhysVRAM, 8);
CHECK_MEMBER_ALIGNMENT(VGASTATE, Dev, 8);
CHECK_MEMBER_ALIGNMENT(VGASTATE, CritSect, 8);
diff --git a/src/VBox/Devices/testcase/tstDeviceStructSizeRC.cpp b/src/VBox/Devices/testcase/tstDeviceStructSizeRC.cpp
index fba259e..bd022f1 100644
--- a/src/VBox/Devices/testcase/tstDeviceStructSizeRC.cpp
+++ b/src/VBox/Devices/testcase/tstDeviceStructSizeRC.cpp
@@ -30,9 +30,9 @@
#endif
-/*******************************************************************************
-* Header Files *
-*******************************************************************************/
+/*********************************************************************************************************************************
+* Header Files *
+*********************************************************************************************************************************/
#define VBOX_DEVICE_STRUCT_TESTCASE
#define VBOX_WITH_HGCM /* grumble */
#undef LOG_GROUP
diff --git a/src/VBox/Disassembler/Disasm.cpp b/src/VBox/Disassembler/Disasm.cpp
index a443bb9..7556541 100644
--- a/src/VBox/Disassembler/Disasm.cpp
+++ b/src/VBox/Disassembler/Disasm.cpp
@@ -16,9 +16,9 @@
*/
-/*******************************************************************************
-* Header Files *
-*******************************************************************************/
+/*********************************************************************************************************************************
+* Header Files *
+*********************************************************************************************************************************/
#define LOG_GROUP LOG_GROUP_DIS
#include <VBox/dis.h>
#include <VBox/disopcode.h>
diff --git a/src/VBox/Disassembler/DisasmCore.cpp b/src/VBox/Disassembler/DisasmCore.cpp
index 1a8b893..82d7d7e 100644
--- a/src/VBox/Disassembler/DisasmCore.cpp
+++ b/src/VBox/Disassembler/DisasmCore.cpp
@@ -16,9 +16,9 @@
*/
-/*******************************************************************************
-* Header Files *
-*******************************************************************************/
+/*********************************************************************************************************************************
+* Header Files *
+*********************************************************************************************************************************/
#define LOG_GROUP LOG_GROUP_DIS
#include <VBox/dis.h>
#include <VBox/disopcode.h>
@@ -31,9 +31,9 @@
#include "DisasmInternal.h"
-/*******************************************************************************
-* Defined Constants And Macros *
-*******************************************************************************/
+/*********************************************************************************************************************************
+* Defined Constants And Macros *
+*********************************************************************************************************************************/
/** This must be less or equal to DISSTATE::abInstr.
* See Vol3A/Table 6-2 and Vol3B/Section22.25 for instance. */
#define DIS_MAX_INSTR_LENGTH 15
@@ -44,9 +44,9 @@
#endif
-/*******************************************************************************
-* Internal Functions *
-*******************************************************************************/
+/*********************************************************************************************************************************
+* Internal Functions *
+*********************************************************************************************************************************/
/** @name Parsers
* @{ */
static FNDISPARSE ParseIllegal;
@@ -114,9 +114,9 @@ static FNDISPARSE ParseEscFP;
/** @} */
-/*******************************************************************************
-* Global Variables *
-*******************************************************************************/
+/*********************************************************************************************************************************
+* Global Variables *
+*********************************************************************************************************************************/
/** Parser opcode table for full disassembly. */
static PFNDISPARSE const g_apfnFullDisasm[IDX_ParseMax] =
{
diff --git a/src/VBox/Disassembler/DisasmFormatBytes.cpp b/src/VBox/Disassembler/DisasmFormatBytes.cpp
index b0671fa..5febdb3 100644
--- a/src/VBox/Disassembler/DisasmFormatBytes.cpp
+++ b/src/VBox/Disassembler/DisasmFormatBytes.cpp
@@ -16,9 +16,9 @@
*/
-/*******************************************************************************
-* Header Files *
-*******************************************************************************/
+/*********************************************************************************************************************************
+* Header Files *
+*********************************************************************************************************************************/
#include "DisasmInternal.h"
#include <iprt/string.h>
#include <iprt/assert.h>
diff --git a/src/VBox/Disassembler/DisasmFormatYasm.cpp b/src/VBox/Disassembler/DisasmFormatYasm.cpp
index a47977e..7ca926b 100644
--- a/src/VBox/Disassembler/DisasmFormatYasm.cpp
+++ b/src/VBox/Disassembler/DisasmFormatYasm.cpp
@@ -16,9 +16,9 @@
*/
-/*******************************************************************************
-* Header Files *
-*******************************************************************************/
+/*********************************************************************************************************************************
+* Header Files *
+*********************************************************************************************************************************/
#include <VBox/dis.h>
#include "DisasmInternal.h"
#include <iprt/string.h>
@@ -26,9 +26,9 @@
#include <iprt/ctype.h>
-/*******************************************************************************
-* Global Variables *
-*******************************************************************************/
+/*********************************************************************************************************************************
+* Global Variables *
+*********************************************************************************************************************************/
static const char g_szSpaces[] =
" ";
static const char g_aszYasmRegGen8[20][5] =
diff --git a/src/VBox/Disassembler/DisasmReg.cpp b/src/VBox/Disassembler/DisasmReg.cpp
index c6341a4..66032df 100644
--- a/src/VBox/Disassembler/DisasmReg.cpp
+++ b/src/VBox/Disassembler/DisasmReg.cpp
@@ -16,9 +16,9 @@
*/
-/*******************************************************************************
-* Header Files *
-*******************************************************************************/
+/*********************************************************************************************************************************
+* Header Files *
+*********************************************************************************************************************************/
#define LOG_GROUP LOG_GROUP_DIS
#include <VBox/dis.h>
#include <VBox/disopcode.h>
@@ -31,9 +31,9 @@
#include "DisasmInternal.h"
-/*******************************************************************************
-* Global Variables *
-*******************************************************************************/
+/*********************************************************************************************************************************
+* Global Variables *
+*********************************************************************************************************************************/
/**
* Array for accessing 64-bit general registers in VMMREGFRAME structure
diff --git a/src/VBox/Disassembler/DisasmTables.cpp b/src/VBox/Disassembler/DisasmTables.cpp
index 1485307..c6e47c8 100644
--- a/src/VBox/Disassembler/DisasmTables.cpp
+++ b/src/VBox/Disassembler/DisasmTables.cpp
@@ -16,9 +16,9 @@
*/
-/*******************************************************************************
-* Header Files *
-*******************************************************************************/
+/*********************************************************************************************************************************
+* Header Files *
+*********************************************************************************************************************************/
#include <VBox/dis.h>
#include <VBox/disopcode.h>
#include "DisasmTables.h"
diff --git a/src/VBox/Disassembler/DisasmTablesX64.cpp b/src/VBox/Disassembler/DisasmTablesX64.cpp
index a4bbf68..66cb244 100644
--- a/src/VBox/Disassembler/DisasmTablesX64.cpp
+++ b/src/VBox/Disassembler/DisasmTablesX64.cpp
@@ -16,9 +16,9 @@
*/
-/*******************************************************************************
-* Header Files *
-*******************************************************************************/
+/*********************************************************************************************************************************
+* Header Files *
+*********************************************************************************************************************************/
#include <VBox/dis.h>
#include <VBox/disopcode.h>
#include "DisasmInternal.h"
diff --git a/src/VBox/Disassembler/testcase/tstDisasm-1.cpp b/src/VBox/Disassembler/testcase/tstDisasm-1.cpp
index 9ad0f38..d314e2b 100644
--- a/src/VBox/Disassembler/testcase/tstDisasm-1.cpp
+++ b/src/VBox/Disassembler/testcase/tstDisasm-1.cpp
@@ -15,9 +15,10 @@
* hope that it will be useful, but WITHOUT ANY WARRANTY of any kind.
*/
-/*******************************************************************************
-* Header Files *
-*******************************************************************************/
+
+/*********************************************************************************************************************************
+* Header Files *
+*********************************************************************************************************************************/
#include <VBox/dis.h>
#include <iprt/test.h>
#include <iprt/ctype.h>
diff --git a/src/VBox/Disassembler/testcase/tstDisasm-2.cpp b/src/VBox/Disassembler/testcase/tstDisasm-2.cpp
index 48044ce..e480e66 100644
--- a/src/VBox/Disassembler/testcase/tstDisasm-2.cpp
+++ b/src/VBox/Disassembler/testcase/tstDisasm-2.cpp
@@ -15,9 +15,10 @@
* hope that it will be useful, but WITHOUT ANY WARRANTY of any kind.
*/
-/*******************************************************************************
-* Header Files *
-*******************************************************************************/
+
+/*********************************************************************************************************************************
+* Header Files *
+*********************************************************************************************************************************/
#include <VBox/dis.h>
#include <VBox/err.h>
#include <iprt/alloc.h>
@@ -31,9 +32,9 @@
#include <iprt/ctype.h>
-/*******************************************************************************
-* Structures and Typedefs *
-*******************************************************************************/
+/*********************************************************************************************************************************
+* Structures and Typedefs *
+*********************************************************************************************************************************/
typedef enum { kAsmStyle_Default, kAsmStyle_yasm, kAsmStyle_masm, kAsmStyle_gas, kAsmStyle_invalid } ASMSTYLE;
typedef enum { kUndefOp_Fail, kUndefOp_All, kUndefOp_DefineByte, kUndefOp_End } UNDEFOPHANDLING;
@@ -570,7 +571,7 @@ int main(int argc, char **argv)
break;
case 'V':
- RTPrintf("$Revision: 101699 $\n");
+ RTPrintf("$Revision: 102121 $\n");
return 0;
default:
diff --git a/src/VBox/ExtPacks/BusMouseSample/BusMouse.cpp b/src/VBox/ExtPacks/BusMouseSample/BusMouse.cpp
index b6e5884..55536b3 100644
--- a/src/VBox/ExtPacks/BusMouseSample/BusMouse.cpp
+++ b/src/VBox/ExtPacks/BusMouseSample/BusMouse.cpp
@@ -28,9 +28,10 @@
* OTHER DEALINGS IN THE SOFTWARE.
*/
-/*******************************************************************************
-* Header Files *
-*******************************************************************************/
+
+/*********************************************************************************************************************************
+* Header Files *
+*********************************************************************************************************************************/
#define LOG_GROUP LOG_GROUP_DEV_KBD
#include <VBox/vmm/pdmdev.h>
#include <VBox/version.h>
@@ -71,9 +72,9 @@
*/
-/*******************************************************************************
-* Defined Constants And Macros *
-*******************************************************************************/
+/*********************************************************************************************************************************
+* Defined Constants And Macros *
+*********************************************************************************************************************************/
/** The original bus mouse controller is fixed at I/O port 0x23C. */
#define BMS_IO_BASE 0x23C
#define BMS_IO_SIZE 4
@@ -115,9 +116,9 @@
#define BMS_SAVED_STATE_VERSION 1
-/*******************************************************************************
-* Structures and Typedefs *
-*******************************************************************************/
+/*********************************************************************************************************************************
+* Structures and Typedefs *
+*********************************************************************************************************************************/
/**
* The device state.
*/
diff --git a/src/VBox/ExtPacks/BusMouseSample/VBoxBusMouseMain.cpp b/src/VBox/ExtPacks/BusMouseSample/VBoxBusMouseMain.cpp
index 7ad44e8..d2065cd 100644
--- a/src/VBox/ExtPacks/BusMouseSample/VBoxBusMouseMain.cpp
+++ b/src/VBox/ExtPacks/BusMouseSample/VBoxBusMouseMain.cpp
@@ -29,9 +29,9 @@
*/
-/*******************************************************************************
-* Header Files *
-*******************************************************************************/
+/*********************************************************************************************************************************
+* Header Files *
+*********************************************************************************************************************************/
#include <VBox/ExtPack/ExtPack.h>
#include <VBox/err.h>
@@ -42,9 +42,9 @@
#include <iprt/path.h>
-/*******************************************************************************
-* Global Variables *
-*******************************************************************************/
+/*********************************************************************************************************************************
+* Global Variables *
+*********************************************************************************************************************************/
/** Pointer to the extension pack helpers. */
static PCVBOXEXTPACKHLP g_pHlp;
diff --git a/src/VBox/ExtPacks/Skeleton/VBoxSkeletonMain.cpp b/src/VBox/ExtPacks/Skeleton/VBoxSkeletonMain.cpp
index 96513a5..a35aa8d 100644
--- a/src/VBox/ExtPacks/Skeleton/VBoxSkeletonMain.cpp
+++ b/src/VBox/ExtPacks/Skeleton/VBoxSkeletonMain.cpp
@@ -29,9 +29,9 @@
*/
-/*******************************************************************************
-* Header Files *
-*******************************************************************************/
+/*********************************************************************************************************************************
+* Header Files *
+*********************************************************************************************************************************/
#include <VBox/ExtPack/ExtPack.h>
#include <VBox/err.h>
@@ -42,9 +42,9 @@
#include <iprt/path.h>
-/*******************************************************************************
-* Global Variables *
-*******************************************************************************/
+/*********************************************************************************************************************************
+* Global Variables *
+*********************************************************************************************************************************/
/** Pointer to the extension pack helpers. */
static PCVBOXEXTPACKHLP g_pHlp;
diff --git a/src/VBox/ExtPacks/VBoxDTrace/VBoxDTraceMain.cpp b/src/VBox/ExtPacks/VBoxDTrace/VBoxDTraceMain.cpp
index ebf370b..ebfa65e 100644
--- a/src/VBox/ExtPacks/VBoxDTrace/VBoxDTraceMain.cpp
+++ b/src/VBox/ExtPacks/VBoxDTrace/VBoxDTraceMain.cpp
@@ -29,9 +29,9 @@
*/
-/*******************************************************************************
-* Header Files *
-*******************************************************************************/
+/*********************************************************************************************************************************
+* Header Files *
+*********************************************************************************************************************************/
#include <VBox/ExtPack/ExtPack.h>
#include <VBox/err.h>
@@ -42,9 +42,9 @@
#include <iprt/path.h>
-/*******************************************************************************
-* Global Variables *
-*******************************************************************************/
+/*********************************************************************************************************************************
+* Global Variables *
+*********************************************************************************************************************************/
/** Pointer to the extension pack helpers. */
static PCVBOXEXTPACKHLP g_pHlp;
diff --git a/src/VBox/ExtPacks/VBoxDTrace/VBoxDTraceR0.cpp b/src/VBox/ExtPacks/VBoxDTrace/VBoxDTraceR0.cpp
index 8dd0655..a34d6c6 100644
--- a/src/VBox/ExtPacks/VBoxDTrace/VBoxDTraceR0.cpp
+++ b/src/VBox/ExtPacks/VBoxDTrace/VBoxDTraceR0.cpp
@@ -19,9 +19,9 @@
*/
-/*******************************************************************************
-* Header Files *
-*******************************************************************************/
+/*********************************************************************************************************************************
+* Header Files *
+*********************************************************************************************************************************/
#include <VBox/sup.h>
#include <VBox/log.h>
@@ -43,17 +43,17 @@
#include <VBox/VBoxTpG.h>
-/*******************************************************************************
-* Defined Constants And Macros *
-*******************************************************************************/
+/*********************************************************************************************************************************
+* Defined Constants And Macros *
+*********************************************************************************************************************************/
//#if !defined(RT_OS_WINDOWS) && !defined(RT_OS_OS2)
//# define HAVE_RTMEMALLOCEX_FEATURES
//#endif
-/*******************************************************************************
-* Structures and Typedefs *
-*******************************************************************************/
+/*********************************************************************************************************************************
+* Structures and Typedefs *
+*********************************************************************************************************************************/
/** Caller indicator. */
typedef enum VBOXDTCALLER
@@ -155,9 +155,9 @@ typedef VBDTSTACKDATA *PVBDTSTACKDATA;
#endif
-/*******************************************************************************
-* Global Variables *
-*******************************************************************************/
+/*********************************************************************************************************************************
+* Global Variables *
+*********************************************************************************************************************************/
/** Per CPU information */
cpucore_t g_aVBoxDtCpuCores[RTCPUSET_MAX_CPUS];
/** Dummy mutex. */
diff --git a/src/VBox/ExtPacks/VBoxDTrace/VBoxDTraceWrapper.cpp b/src/VBox/ExtPacks/VBoxDTrace/VBoxDTraceWrapper.cpp
index 04d7e7c..7f1a1bc 100644
--- a/src/VBox/ExtPacks/VBoxDTrace/VBoxDTraceWrapper.cpp
+++ b/src/VBox/ExtPacks/VBoxDTrace/VBoxDTraceWrapper.cpp
@@ -18,9 +18,9 @@
*/
-/*******************************************************************************
-* Header Files *
-*******************************************************************************/
+/*********************************************************************************************************************************
+* Header Files *
+*********************************************************************************************************************************/
#include <iprt/buildconfig.h>
#include <iprt/env.h>
#include <iprt/file.h>
@@ -36,18 +36,18 @@
#include "../../Main/include/ExtPackUtil.h"
-/*******************************************************************************
-* Defined Constants And Macros *
-*******************************************************************************/
+/*********************************************************************************************************************************
+* Defined Constants And Macros *
+*********************************************************************************************************************************/
/** The VBoxDTrace extension pack name. */
#define VBOX_EXTPACK_VBOXDTRACE_NAME "Oracle VBoxDTrace Extension Pack"
/** The mangled version of VBOX_EXTPACK_VBOXDTRACE_NAME (also in Config.kmk). */
#define VBOX_EXTPACK_VBOXDTRACE_MANGLED_NAME "Oracle_VBoxDTrace_Extension_Pack"
-/*******************************************************************************
-* Structures and Typedefs *
-*******************************************************************************/
+/*********************************************************************************************************************************
+* Structures and Typedefs *
+*********************************************************************************************************************************/
/** The main function of VBoxDTrace.so/dylib/dll. */
typedef int (RTCALL *PFNVBOXDTRACEMAIN)(int argc, char **argv);
diff --git a/src/VBox/ExtPacks/VBoxDTrace/onnv/cmd/dtrace/test/tst/common/funcs/tst.index.d.out b/src/VBox/ExtPacks/VBoxDTrace/onnv/cmd/dtrace/test/tst/common/funcs/tst.index.d.out
old mode 100644
new mode 100755
diff --git a/src/VBox/ExtPacks/VBoxDTrace/onnv/cmd/dtrace/test/tst/common/funcs/tst.substr.d.out b/src/VBox/ExtPacks/VBoxDTrace/onnv/cmd/dtrace/test/tst/common/funcs/tst.substr.d.out
old mode 100644
new mode 100755
diff --git a/src/VBox/ExtPacks/VNC/VBoxVNC.cpp b/src/VBox/ExtPacks/VNC/VBoxVNC.cpp
index a2d1c43..b46a1a1 100644
--- a/src/VBox/ExtPacks/VNC/VBoxVNC.cpp
+++ b/src/VBox/ExtPacks/VNC/VBoxVNC.cpp
@@ -18,9 +18,10 @@
* hope that it will be useful, but WITHOUT ANY WARRANTY of any kind.
*/
-/*******************************************************************************
-* Header Files *
-*******************************************************************************/
+
+/*********************************************************************************************************************************
+* Header Files *
+*********************************************************************************************************************************/
#define LOG_GROUP LOG_GROUP_VRDE
#include <VBox/log.h>
@@ -48,9 +49,9 @@
#endif
-/*******************************************************************************
-* Defined Constants And Macros *
-*******************************************************************************/
+/*********************************************************************************************************************************
+* Defined Constants And Macros *
+*********************************************************************************************************************************/
#define VNC_SIZEOFRGBA 4
#define VNC_PASSWORDSIZE 20
#define VNC_ADDRESSSIZE 60
@@ -58,9 +59,9 @@
#define VNC_ADDRESS_OPTION_MAX 500
-/*******************************************************************************
-* Structures and Typedefs *
-*******************************************************************************/
+/*********************************************************************************************************************************
+* Structures and Typedefs *
+*********************************************************************************************************************************/
class VNCServerImpl
{
public:
diff --git a/src/VBox/ExtPacks/VNC/VBoxVNCMain.cpp b/src/VBox/ExtPacks/VNC/VBoxVNCMain.cpp
index 625893e..715fc57 100644
--- a/src/VBox/ExtPacks/VNC/VBoxVNCMain.cpp
+++ b/src/VBox/ExtPacks/VNC/VBoxVNCMain.cpp
@@ -16,9 +16,9 @@
*/
-/*******************************************************************************
-* Header Files *
-*******************************************************************************/
+/*********************************************************************************************************************************
+* Header Files *
+*********************************************************************************************************************************/
#include <VBox/ExtPack/ExtPack.h>
#include <VBox/err.h>
@@ -29,9 +29,9 @@
#include <iprt/path.h>
-/*******************************************************************************
-* Global Variables *
-*******************************************************************************/
+/*********************************************************************************************************************************
+* Global Variables *
+*********************************************************************************************************************************/
/** Pointer to the extension pack helpers. */
static PCVBOXEXTPACKHLP g_pHlp;
diff --git a/src/VBox/Frontends/VBoxAutostart/VBoxAutostart-posix.cpp b/src/VBox/Frontends/VBoxAutostart/VBoxAutostart-posix.cpp
index 75cfaba..1f8c380 100644
--- a/src/VBox/Frontends/VBoxAutostart/VBoxAutostart-posix.cpp
+++ b/src/VBox/Frontends/VBoxAutostart/VBoxAutostart-posix.cpp
@@ -16,9 +16,9 @@
*/
-/*******************************************************************************
-* Header Files *
-*******************************************************************************/
+/*********************************************************************************************************************************
+* Header Files *
+*********************************************************************************************************************************/
#include <VBox/com/com.h>
#include <VBox/com/string.h>
#include <VBox/com/Guid.h>
diff --git a/src/VBox/Frontends/VBoxAutostart/VBoxAutostart-win.cpp b/src/VBox/Frontends/VBoxAutostart/VBoxAutostart-win.cpp
index cc3f237..9928ec1 100644
--- a/src/VBox/Frontends/VBoxAutostart/VBoxAutostart-win.cpp
+++ b/src/VBox/Frontends/VBoxAutostart/VBoxAutostart-win.cpp
@@ -15,9 +15,10 @@
* hope that it will be useful, but WITHOUT ANY WARRANTY of any kind.
*/
-/*******************************************************************************
-* Header Files *
-*******************************************************************************/
+
+/*********************************************************************************************************************************
+* Header Files *
+*********************************************************************************************************************************/
#include <Windows.h>
#include <VBox/com/com.h>
@@ -43,9 +44,10 @@
#include "VBoxAutostart.h"
-/*******************************************************************************
-* Defined Constants And Macros *
-*******************************************************************************/
+
+/*********************************************************************************************************************************
+* Defined Constants And Macros *
+*********************************************************************************************************************************/
/** The service name. */
#define AUTOSTART_SERVICE_NAME "VBoxAutostartSvc"
/** The service display name. */
@@ -56,9 +58,10 @@ bool g_fVerbose = false;
ComPtr<IVirtualBox> g_pVirtualBox = NULL;
ComPtr<ISession> g_pSession = NULL;
-/*******************************************************************************
-* Global Variables *
-*******************************************************************************/
+
+/*********************************************************************************************************************************
+* Global Variables *
+*********************************************************************************************************************************/
/** The service control handler handle. */
static SERVICE_STATUS_HANDLE g_hSupSvcWinCtrlHandler = NULL;
/** The service status. */
@@ -67,9 +70,9 @@ static uint32_t volatile g_u32SupSvcWinStatus = SERVICE_STOPPED;
static RTSEMEVENTMULTI g_hSupSvcWinEvent = NIL_RTSEMEVENTMULTI;
-/*******************************************************************************
-* Internal Functions *
-*******************************************************************************/
+/*********************************************************************************************************************************
+* Internal Functions *
+*********************************************************************************************************************************/
static SC_HANDLE autostartSvcWinOpenSCManager(const char *pszAction, DWORD dwAccess);
/**
diff --git a/src/VBox/Frontends/VBoxAutostart/VBoxAutostartCfg.cpp b/src/VBox/Frontends/VBoxAutostart/VBoxAutostartCfg.cpp
index c483966..00bcb00 100644
--- a/src/VBox/Frontends/VBoxAutostart/VBoxAutostartCfg.cpp
+++ b/src/VBox/Frontends/VBoxAutostart/VBoxAutostartCfg.cpp
@@ -15,9 +15,10 @@
* hope that it will be useful, but WITHOUT ANY WARRANTY of any kind.
*/
-/*******************************************************************************
-* Header Files *
-*******************************************************************************/
+
+/*********************************************************************************************************************************
+* Header Files *
+*********************************************************************************************************************************/
#include <iprt/stream.h>
#include <iprt/process.h>
@@ -28,9 +29,10 @@
#include "VBoxAutostart.h"
-/*******************************************************************************
-* Constants And Macros, Structures and Typedefs *
-*******************************************************************************/
+
+/*********************************************************************************************************************************
+* Constants And Macros, Structures and Typedefs *
+*********************************************************************************************************************************/
/**
* Token type.
@@ -111,9 +113,10 @@ typedef struct CFGTOKENIZER
PCFGTOKEN pTokenNext;
} CFGTOKENIZER, *PCFGTOKENIZER;
-/*******************************************************************************
-* Internal Functions *
-*******************************************************************************/
+
+/*********************************************************************************************************************************
+* Internal Functions *
+*********************************************************************************************************************************/
/**
* Free a config token.
diff --git a/src/VBox/Frontends/VBoxBalloonCtrl/VBoxModAPIMonitor.cpp b/src/VBox/Frontends/VBoxBalloonCtrl/VBoxModAPIMonitor.cpp
index 31a1d32..f140cce 100644
--- a/src/VBox/Frontends/VBoxBalloonCtrl/VBoxModAPIMonitor.cpp
+++ b/src/VBox/Frontends/VBoxBalloonCtrl/VBoxModAPIMonitor.cpp
@@ -16,9 +16,9 @@
*/
-/*******************************************************************************
-* Header Files *
-*******************************************************************************/
+/*********************************************************************************************************************************
+* Header Files *
+*********************************************************************************************************************************/
#ifndef VBOX_ONLY_DOCS
# include <iprt/message.h>
# include <VBox/com/errorprint.h>
diff --git a/src/VBox/Frontends/VBoxBalloonCtrl/VBoxModBallooning.cpp b/src/VBox/Frontends/VBoxBalloonCtrl/VBoxModBallooning.cpp
index a00395f..417cfa2 100644
--- a/src/VBox/Frontends/VBoxBalloonCtrl/VBoxModBallooning.cpp
+++ b/src/VBox/Frontends/VBoxBalloonCtrl/VBoxModBallooning.cpp
@@ -16,9 +16,9 @@
*/
-/*******************************************************************************
-* Header Files *
-*******************************************************************************/
+/*********************************************************************************************************************************
+* Header Files *
+*********************************************************************************************************************************/
#ifndef VBOX_ONLY_DOCS
# include <VBox/com/errorprint.h>
#endif /* !VBOX_ONLY_DOCS */
diff --git a/src/VBox/Frontends/VBoxBalloonCtrl/VBoxWatchdog.cpp b/src/VBox/Frontends/VBoxBalloonCtrl/VBoxWatchdog.cpp
index caa9703..cc7d381 100644
--- a/src/VBox/Frontends/VBoxBalloonCtrl/VBoxWatchdog.cpp
+++ b/src/VBox/Frontends/VBoxBalloonCtrl/VBoxWatchdog.cpp
@@ -16,9 +16,9 @@
*/
-/*******************************************************************************
-* Header Files *
-*******************************************************************************/
+/*********************************************************************************************************************************
+* Header Files *
+*********************************************************************************************************************************/
#ifndef VBOX_ONLY_DOCS
# include <VBox/com/com.h>
# include <VBox/com/string.h>
diff --git a/src/VBox/Frontends/VBoxBalloonCtrl/VBoxWatchdogUtils.cpp b/src/VBox/Frontends/VBoxBalloonCtrl/VBoxWatchdogUtils.cpp
index 353c46e..88c2aff 100644
--- a/src/VBox/Frontends/VBoxBalloonCtrl/VBoxWatchdogUtils.cpp
+++ b/src/VBox/Frontends/VBoxBalloonCtrl/VBoxWatchdogUtils.cpp
@@ -16,9 +16,9 @@
*/
-/*******************************************************************************
-* Header Files *
-*******************************************************************************/
+/*********************************************************************************************************************************
+* Header Files *
+*********************************************************************************************************************************/
#include <VBox/com/array.h>
#include "VBoxWatchdogInternal.h"
diff --git a/src/VBox/Frontends/VBoxManage/VBoxInternalManage.cpp b/src/VBox/Frontends/VBoxManage/VBoxInternalManage.cpp
index 9014365..a04dea6 100644
--- a/src/VBox/Frontends/VBoxManage/VBoxInternalManage.cpp
+++ b/src/VBox/Frontends/VBoxManage/VBoxInternalManage.cpp
@@ -21,9 +21,9 @@
-/*******************************************************************************
-* Header Files *
-*******************************************************************************/
+/*********************************************************************************************************************************
+* Header Files *
+*********************************************************************************************************************************/
#include <VBox/com/com.h>
#include <VBox/com/string.h>
#include <VBox/com/Guid.h>
@@ -603,7 +603,7 @@ static DECLCALLBACK(void) handleVDError(void *pvUser, int rc, RT_SRC_POS_DECL, c
RTMsgError("Error code %Rrc at %s(%u) in function %s", rc, RT_SRC_POS_ARGS);
}
-static int handleVDMessage(void *pvUser, const char *pszFormat, va_list va)
+static DECLCALLBACK(int) handleVDMessage(void *pvUser, const char *pszFormat, va_list va)
{
NOREF(pvUser);
return RTPrintfV(pszFormat, va);
diff --git a/src/VBox/Frontends/VBoxManage/VBoxManage.cpp b/src/VBox/Frontends/VBoxManage/VBoxManage.cpp
index d208919..cb7f6d9 100644
--- a/src/VBox/Frontends/VBoxManage/VBoxManage.cpp
+++ b/src/VBox/Frontends/VBoxManage/VBoxManage.cpp
@@ -16,9 +16,9 @@
*/
-/*******************************************************************************
-* Header Files *
-*******************************************************************************/
+/*********************************************************************************************************************************
+* Header Files *
+*********************************************************************************************************************************/
#ifndef VBOX_ONLY_DOCS
# include <VBox/com/com.h>
# include <VBox/com/string.h>
@@ -47,18 +47,18 @@
#include "VBoxManage.h"
-/*******************************************************************************
-* Defined Constants And Macros *
-*******************************************************************************/
+/*********************************************************************************************************************************
+* Defined Constants And Macros *
+*********************************************************************************************************************************/
/** The command doesn't need the COM stuff. */
#define VBMG_CMD_F_NO_COM RT_BIT_32(0)
#define VBMG_CMD_TODO HELP_CMD_VBOXMANAGE_INVALID
-/*******************************************************************************
-* Structures and Typedefs *
-*******************************************************************************/
+/*********************************************************************************************************************************
+* Structures and Typedefs *
+*********************************************************************************************************************************/
#ifndef VBOX_ONLY_DOCS
/**
* VBoxManage command descriptor.
@@ -81,9 +81,9 @@ typedef VBMGCMD const *PCVBMGCMD;
#endif
-/*******************************************************************************
-* Global Variables *
-*******************************************************************************/
+/*********************************************************************************************************************************
+* Global Variables *
+*********************************************************************************************************************************/
/*extern*/ bool g_fDetailedProgress = false;
#ifndef VBOX_ONLY_DOCS
diff --git a/src/VBox/Frontends/VBoxManage/VBoxManageAppliance.cpp b/src/VBox/Frontends/VBoxManage/VBoxManageAppliance.cpp
index 4575007..7bc77bf 100644
--- a/src/VBox/Frontends/VBoxManage/VBoxManageAppliance.cpp
+++ b/src/VBox/Frontends/VBoxManage/VBoxManageAppliance.cpp
@@ -17,9 +17,10 @@
#ifndef VBOX_ONLY_DOCS
-/*******************************************************************************
-* Header Files *
-*******************************************************************************/
+
+/*********************************************************************************************************************************
+* Header Files *
+*********************************************************************************************************************************/
#ifndef VBOX_ONLY_DOCS
#include <VBox/com/com.h>
#include <VBox/com/string.h>
diff --git a/src/VBox/Frontends/VBoxManage/VBoxManageBandwidthControl.cpp b/src/VBox/Frontends/VBoxManage/VBoxManageBandwidthControl.cpp
index c8b423f..5b8ee6a 100644
--- a/src/VBox/Frontends/VBoxManage/VBoxManageBandwidthControl.cpp
+++ b/src/VBox/Frontends/VBoxManage/VBoxManageBandwidthControl.cpp
@@ -17,9 +17,10 @@
#ifndef VBOX_ONLY_DOCS
-/*******************************************************************************
-* Header Files *
-*******************************************************************************/
+
+/*********************************************************************************************************************************
+* Header Files *
+*********************************************************************************************************************************/
#include <VBox/com/com.h>
#include <VBox/com/array.h>
#include <VBox/com/ErrorInfo.h>
diff --git a/src/VBox/Frontends/VBoxManage/VBoxManageControlVM.cpp b/src/VBox/Frontends/VBoxManage/VBoxManageControlVM.cpp
index fa071d7..df94c02 100644
--- a/src/VBox/Frontends/VBoxManage/VBoxManageControlVM.cpp
+++ b/src/VBox/Frontends/VBoxManage/VBoxManageControlVM.cpp
@@ -16,9 +16,9 @@
*/
-/*******************************************************************************
-* Header Files *
-*******************************************************************************/
+/*********************************************************************************************************************************
+* Header Files *
+*********************************************************************************************************************************/
#include <VBox/com/com.h>
#include <VBox/com/string.h>
#include <VBox/com/Guid.h>
@@ -715,7 +715,6 @@ RTEXITCODE handleControlVM(HandlerArg *a)
{
if (!strcmp(a->argv[2], "null"))
{
- CHECK_ERROR_RET(adapter, COMSETTER(Enabled)(TRUE), RTEXITCODE_FAILURE);
CHECK_ERROR_RET(adapter, COMSETTER(AttachmentType)(NetworkAttachmentType_Null), RTEXITCODE_FAILURE);
}
else if (!strcmp(a->argv[2], "nat"))
diff --git a/src/VBox/Frontends/VBoxManage/VBoxManageDHCPServer.cpp b/src/VBox/Frontends/VBoxManage/VBoxManageDHCPServer.cpp
index 585e77e..f6fa526 100644
--- a/src/VBox/Frontends/VBoxManage/VBoxManageDHCPServer.cpp
+++ b/src/VBox/Frontends/VBoxManage/VBoxManageDHCPServer.cpp
@@ -15,9 +15,10 @@
* hope that it will be useful, but WITHOUT ANY WARRANTY of any kind.
*/
-/*******************************************************************************
-* Header Files *
-*******************************************************************************/
+
+/*********************************************************************************************************************************
+* Header Files *
+*********************************************************************************************************************************/
#ifndef VBOX_ONLY_DOCS
#include <VBox/com/com.h>
#include <VBox/com/array.h>
diff --git a/src/VBox/Frontends/VBoxManage/VBoxManageDebugVM.cpp b/src/VBox/Frontends/VBoxManage/VBoxManageDebugVM.cpp
index f92abd2..9f220cd 100644
--- a/src/VBox/Frontends/VBoxManage/VBoxManageDebugVM.cpp
+++ b/src/VBox/Frontends/VBoxManage/VBoxManageDebugVM.cpp
@@ -16,9 +16,9 @@
*/
-/*******************************************************************************
-* Header Files *
-*******************************************************************************/
+/*********************************************************************************************************************************
+* Header Files *
+*********************************************************************************************************************************/
#include <VBox/com/com.h>
#include <VBox/com/string.h>
#include <VBox/com/Guid.h>
diff --git a/src/VBox/Frontends/VBoxManage/VBoxManageDisk.cpp b/src/VBox/Frontends/VBoxManage/VBoxManageDisk.cpp
index dc669b5..2e59927 100644
--- a/src/VBox/Frontends/VBoxManage/VBoxManageDisk.cpp
+++ b/src/VBox/Frontends/VBoxManage/VBoxManageDisk.cpp
@@ -17,9 +17,10 @@
#ifndef VBOX_ONLY_DOCS
-/*******************************************************************************
-* Header Files *
-*******************************************************************************/
+
+/*********************************************************************************************************************************
+* Header Files *
+*********************************************************************************************************************************/
#include <VBox/com/com.h>
#include <VBox/com/array.h>
#include <VBox/com/ErrorInfo.h>
diff --git a/src/VBox/Frontends/VBoxManage/VBoxManageGuestCtrl.cpp b/src/VBox/Frontends/VBoxManage/VBoxManageGuestCtrl.cpp
index 9af0455..572b350 100644
--- a/src/VBox/Frontends/VBoxManage/VBoxManageGuestCtrl.cpp
+++ b/src/VBox/Frontends/VBoxManage/VBoxManageGuestCtrl.cpp
@@ -16,9 +16,9 @@
*/
-/*******************************************************************************
-* Header Files *
-*******************************************************************************/
+/*********************************************************************************************************************************
+* Header Files *
+*********************************************************************************************************************************/
#include "VBoxManage.h"
#include "VBoxManageGuestCtrl.h"
@@ -63,9 +63,10 @@
using namespace com;
-/*******************************************************************************
-* Defined Constants And Macros *
-*******************************************************************************/
+
+/*********************************************************************************************************************************
+* Defined Constants And Macros *
+*********************************************************************************************************************************/
#define GCTLCMD_COMMON_OPT_USER 999 /**< The --username option number. */
#define GCTLCMD_COMMON_OPT_PASSWORD 998 /**< The --password option number. */
#define GCTLCMD_COMMON_OPT_PASSWORD_FILE 997 /**< The --password-file option number. */
@@ -94,17 +95,17 @@ using namespace com;
} break
-/*******************************************************************************
-* Global Variables *
-*******************************************************************************/
+/*********************************************************************************************************************************
+* Global Variables *
+*********************************************************************************************************************************/
/** Set by the signal handler when current guest control
* action shall be aborted. */
static volatile bool g_fGuestCtrlCanceled = false;
-/*******************************************************************************
-* Structures and Typedefs *
-*******************************************************************************/
+/*********************************************************************************************************************************
+* Structures and Typedefs *
+*********************************************************************************************************************************/
/**
* Listener declarations.
*/
@@ -298,9 +299,9 @@ enum kStreamTransform
};
-/*******************************************************************************
-* Internal Functions *
-*******************************************************************************/
+/*********************************************************************************************************************************
+* Internal Functions *
+*********************************************************************************************************************************/
static int gctlCopyDirExists(PCOPYCONTEXT pContext, bool bGuest, const char *pszDir, bool *fExists);
#endif /* VBOX_ONLY_DOCS */
@@ -3724,7 +3725,7 @@ static DECLCALLBACK(RTEXITCODE) gctlHandleList(PGCTLCMDCTX pCtx, int argc, char
}
}
- if (fSeenListArg)
+ if (!fSeenListArg)
return errorSyntaxEx(USAGE_GUESTCONTROL, USAGE_GSTCTRL_LIST, "Missing list name");
Assert(fListAll || fListSessions);
diff --git a/src/VBox/Frontends/VBoxManage/VBoxManageGuestCtrlListener.cpp b/src/VBox/Frontends/VBoxManage/VBoxManageGuestCtrlListener.cpp
index 757097f..b220efe 100644
--- a/src/VBox/Frontends/VBoxManage/VBoxManageGuestCtrlListener.cpp
+++ b/src/VBox/Frontends/VBoxManage/VBoxManageGuestCtrlListener.cpp
@@ -16,9 +16,9 @@
*/
-/*******************************************************************************
-* Header Files *
-*******************************************************************************/
+/*********************************************************************************************************************************
+* Header Files *
+*********************************************************************************************************************************/
#include "VBoxManage.h"
#include "VBoxManageGuestCtrl.h"
diff --git a/src/VBox/Frontends/VBoxManage/VBoxManageGuestProp.cpp b/src/VBox/Frontends/VBoxManage/VBoxManageGuestProp.cpp
index ac6c43b..979a313 100644
--- a/src/VBox/Frontends/VBoxManage/VBoxManageGuestProp.cpp
+++ b/src/VBox/Frontends/VBoxManage/VBoxManageGuestProp.cpp
@@ -16,9 +16,9 @@
*/
-/*******************************************************************************
-* Header Files *
-*******************************************************************************/
+/*********************************************************************************************************************************
+* Header Files *
+*********************************************************************************************************************************/
#include "VBoxManage.h"
#ifndef VBOX_ONLY_DOCS
diff --git a/src/VBox/Frontends/VBoxManage/VBoxManageHelp.cpp b/src/VBox/Frontends/VBoxManage/VBoxManageHelp.cpp
index 4a0ffc3..221fc3b 100644
--- a/src/VBox/Frontends/VBoxManage/VBoxManageHelp.cpp
+++ b/src/VBox/Frontends/VBoxManage/VBoxManageHelp.cpp
@@ -16,9 +16,9 @@
*/
-/*******************************************************************************
-* Header Files *
-*******************************************************************************/
+/*********************************************************************************************************************************
+* Header Files *
+*********************************************************************************************************************************/
#include <VBox/version.h>
#include <iprt/buildconfig.h>
@@ -29,17 +29,18 @@
#include "VBoxManage.h"
-/*******************************************************************************
-* Defined Constants And Macros *
-*******************************************************************************/
+
+/*********************************************************************************************************************************
+* Defined Constants And Macros *
+*********************************************************************************************************************************/
/** If the usage is the given number of length long or longer, the error is
* repeated so the user can actually see it. */
#define ERROR_REPEAT_AFTER_USAGE_LENGTH 16
-/*******************************************************************************
-* Global Variables *
-*******************************************************************************/
+/*********************************************************************************************************************************
+* Global Variables *
+*********************************************************************************************************************************/
#ifndef VBOX_ONLY_DOCS
enum HELP_CMD_VBOXMANAGE g_enmCurCommand = HELP_CMD_VBOXMANAGE_INVALID;
/** The scope maskt for the current subcommand. */
@@ -1523,5 +1524,3 @@ RTEXITCODE errorArgument(const char *pszFormat, ...)
return RTEXITCODE_SYNTAX;
}
-
-
diff --git a/src/VBox/Frontends/VBoxManage/VBoxManageHostonly.cpp b/src/VBox/Frontends/VBoxManage/VBoxManageHostonly.cpp
index 84f62ce..084f541 100644
--- a/src/VBox/Frontends/VBoxManage/VBoxManageHostonly.cpp
+++ b/src/VBox/Frontends/VBoxManage/VBoxManageHostonly.cpp
@@ -15,9 +15,10 @@
* hope that it will be useful, but WITHOUT ANY WARRANTY of any kind.
*/
-/*******************************************************************************
-* Header Files *
-*******************************************************************************/
+
+/*********************************************************************************************************************************
+* Header Files *
+*********************************************************************************************************************************/
#ifndef VBOX_ONLY_DOCS
#include <VBox/com/com.h>
#include <VBox/com/array.h>
diff --git a/src/VBox/Frontends/VBoxManage/VBoxManageInfo.cpp b/src/VBox/Frontends/VBoxManage/VBoxManageInfo.cpp
index 58f0567..3403a85 100644
--- a/src/VBox/Frontends/VBoxManage/VBoxManageInfo.cpp
+++ b/src/VBox/Frontends/VBoxManage/VBoxManageInfo.cpp
@@ -17,9 +17,10 @@
#ifndef VBOX_ONLY_DOCS
-/*******************************************************************************
-* Header Files *
-*******************************************************************************/
+
+/*********************************************************************************************************************************
+* Header Files *
+*********************************************************************************************************************************/
#include <VBox/com/com.h>
#include <VBox/com/string.h>
#include <VBox/com/Guid.h>
diff --git a/src/VBox/Frontends/VBoxManage/VBoxManageList.cpp b/src/VBox/Frontends/VBoxManage/VBoxManageList.cpp
index 881c6c8..e0c2cc5 100644
--- a/src/VBox/Frontends/VBoxManage/VBoxManageList.cpp
+++ b/src/VBox/Frontends/VBoxManage/VBoxManageList.cpp
@@ -17,9 +17,10 @@
#ifndef VBOX_ONLY_DOCS
-/*******************************************************************************
-* Header Files *
-*******************************************************************************/
+
+/*********************************************************************************************************************************
+* Header Files *
+*********************************************************************************************************************************/
#include <VBox/com/com.h>
#include <VBox/com/string.h>
#include <VBox/com/Guid.h>
diff --git a/src/VBox/Frontends/VBoxManage/VBoxManageMetrics.cpp b/src/VBox/Frontends/VBoxManage/VBoxManageMetrics.cpp
index 7d821c2..b6f92b0 100644
--- a/src/VBox/Frontends/VBoxManage/VBoxManageMetrics.cpp
+++ b/src/VBox/Frontends/VBoxManage/VBoxManageMetrics.cpp
@@ -17,9 +17,10 @@
#ifndef VBOX_ONLY_DOCS
-/*******************************************************************************
-* Header Files *
-*******************************************************************************/
+
+/*********************************************************************************************************************************
+* Header Files *
+*********************************************************************************************************************************/
#include <VBox/com/com.h>
#include <VBox/com/array.h>
#include <VBox/com/ErrorInfo.h>
diff --git a/src/VBox/Frontends/VBoxManage/VBoxManageMisc.cpp b/src/VBox/Frontends/VBoxManage/VBoxManageMisc.cpp
index fed14a5..7600310 100644
--- a/src/VBox/Frontends/VBoxManage/VBoxManageMisc.cpp
+++ b/src/VBox/Frontends/VBoxManage/VBoxManageMisc.cpp
@@ -16,9 +16,9 @@
*/
-/*******************************************************************************
-* Header Files *
-*******************************************************************************/
+/*********************************************************************************************************************************
+* Header Files *
+*********************************************************************************************************************************/
#ifndef VBOX_ONLY_DOCS
# include <VBox/com/com.h>
# include <VBox/com/string.h>
diff --git a/src/VBox/Frontends/VBoxManage/VBoxManageModifyVM.cpp b/src/VBox/Frontends/VBoxManage/VBoxManageModifyVM.cpp
index e0f7459..756620b 100644
--- a/src/VBox/Frontends/VBoxManage/VBoxManageModifyVM.cpp
+++ b/src/VBox/Frontends/VBoxManage/VBoxManageModifyVM.cpp
@@ -15,9 +15,10 @@
* hope that it will be useful, but WITHOUT ANY WARRANTY of any kind.
*/
-/*******************************************************************************
-* Header Files *
-*******************************************************************************/
+
+/*********************************************************************************************************************************
+* Header Files *
+*********************************************************************************************************************************/
#ifndef VBOX_ONLY_DOCS
#include <VBox/com/com.h>
#include <VBox/com/array.h>
diff --git a/src/VBox/Frontends/VBoxManage/VBoxManageNATNetwork.cpp b/src/VBox/Frontends/VBoxManage/VBoxManageNATNetwork.cpp
index 304e689..feac22e 100644
--- a/src/VBox/Frontends/VBoxManage/VBoxManageNATNetwork.cpp
+++ b/src/VBox/Frontends/VBoxManage/VBoxManageNATNetwork.cpp
@@ -15,9 +15,10 @@
* hope that it will be useful, but WITHOUT ANY WARRANTY of any kind.
*/
-/*******************************************************************************
-* Header Files *
-*******************************************************************************/
+
+/*********************************************************************************************************************************
+* Header Files *
+*********************************************************************************************************************************/
#ifndef VBOX_ONLY_DOCS
#include <VBox/com/com.h>
diff --git a/src/VBox/Frontends/VBoxManage/VBoxManageSnapshot.cpp b/src/VBox/Frontends/VBoxManage/VBoxManageSnapshot.cpp
index e5be880..f300c19 100644
--- a/src/VBox/Frontends/VBoxManage/VBoxManageSnapshot.cpp
+++ b/src/VBox/Frontends/VBoxManage/VBoxManageSnapshot.cpp
@@ -15,9 +15,10 @@
* hope that it will be useful, but WITHOUT ANY WARRANTY of any kind.
*/
-/*******************************************************************************
-* Header Files *
-*******************************************************************************/
+
+/*********************************************************************************************************************************
+* Header Files *
+*********************************************************************************************************************************/
#include <VBox/com/com.h>
#include <VBox/com/string.h>
#include <VBox/com/array.h>
diff --git a/src/VBox/Frontends/VBoxManage/VBoxManageStorageController.cpp b/src/VBox/Frontends/VBoxManage/VBoxManageStorageController.cpp
index dc213b9..720abdb 100644
--- a/src/VBox/Frontends/VBoxManage/VBoxManageStorageController.cpp
+++ b/src/VBox/Frontends/VBoxManage/VBoxManageStorageController.cpp
@@ -17,9 +17,10 @@
#ifndef VBOX_ONLY_DOCS
-/*******************************************************************************
-* Header Files *
-*******************************************************************************/
+
+/*********************************************************************************************************************************
+* Header Files *
+*********************************************************************************************************************************/
#include <VBox/com/com.h>
#include <VBox/com/array.h>
#include <VBox/com/ErrorInfo.h>
diff --git a/src/VBox/Frontends/VBoxSDL/Framebuffer-darwin.m b/src/VBox/Frontends/VBoxSDL/Framebuffer-darwin.m
index acd48a3..fe44031 100644
--- a/src/VBox/Frontends/VBoxSDL/Framebuffer-darwin.m
+++ b/src/VBox/Frontends/VBoxSDL/Framebuffer-darwin.m
@@ -1,7 +1,8 @@
-/*******************************************************************************
-* Header Files *
-*******************************************************************************/
+
+/*********************************************************************************************************************************
+* Header Files *
+*********************************************************************************************************************************/
#define NO_SDL_H
#import "VBoxSDL.h"
#import <Cocoa/Cocoa.h>
diff --git a/src/VBox/Frontends/VBoxSDL/VBoxSDL.cpp b/src/VBox/Frontends/VBoxSDL/VBoxSDL.cpp
index b9ff676..92b306c 100644
--- a/src/VBox/Frontends/VBoxSDL/VBoxSDL.cpp
+++ b/src/VBox/Frontends/VBoxSDL/VBoxSDL.cpp
@@ -16,9 +16,10 @@
* hope that it will be useful, but WITHOUT ANY WARRANTY of any kind.
*/
-/*******************************************************************************
-* Header Files *
-*******************************************************************************/
+
+/*********************************************************************************************************************************
+* Header Files *
+*********************************************************************************************************************************/
#define LOG_GROUP LOG_GROUP_GUI
#include <VBox/com/com.h>
@@ -85,9 +86,10 @@ using namespace com;
#undef True
#undef False
-/*******************************************************************************
-* Defined Constants And Macros *
-*******************************************************************************/
+
+/*********************************************************************************************************************************
+* Defined Constants And Macros *
+*********************************************************************************************************************************/
#ifdef VBOX_SECURELABEL
/** extra data key for the secure label */
#define VBOXSDL_SECURELABEL_EXTRADATA "VBoxSDL/SecureLabel"
@@ -98,9 +100,10 @@ using namespace com;
/** Enables the rawr[0|3], patm, and casm options. */
#define VBOXSDL_ADVANCED_OPTIONS
-/*******************************************************************************
-* Structures and Typedefs *
-*******************************************************************************/
+
+/*********************************************************************************************************************************
+* Structures and Typedefs *
+*********************************************************************************************************************************/
/** Pointer shape change event data structure */
struct PointerShapeChangeData
{
@@ -140,9 +143,10 @@ enum TitlebarMode
TITLEBAR_SNAPSHOT = 4
};
-/*******************************************************************************
-* Internal Functions *
-*******************************************************************************/
+
+/*********************************************************************************************************************************
+* Internal Functions *
+*********************************************************************************************************************************/
static bool UseAbsoluteMouse(void);
static void ResetKeys(void);
static void ProcessKey(SDL_KeyboardEvent *ev);
@@ -166,9 +170,9 @@ static VBoxSDLFB * getFbFromWinId(SDL_WindowID id);
#endif
-/*******************************************************************************
-* Global Variables *
-*******************************************************************************/
+/*********************************************************************************************************************************
+* Global Variables *
+*********************************************************************************************************************************/
static int gHostKeyMod = KMOD_RCTRL;
static int gHostKeySym1 = SDLK_RCTRL;
static int gHostKeySym2 = SDLK_UNKNOWN;
diff --git a/src/VBox/Frontends/VBoxShell/vboxshell.py b/src/VBox/Frontends/VBoxShell/vboxshell.py
index b5835f7..4107e0f 100755
--- a/src/VBox/Frontends/VBoxShell/vboxshell.py
+++ b/src/VBox/Frontends/VBoxShell/vboxshell.py
@@ -30,7 +30,7 @@ Foundation, in version 2 as it comes in the "COPYING" file of the
VirtualBox OSE distribution. VirtualBox OSE is distributed in the
hope that it will be useful, but WITHOUT ANY WARRANTY of any kind.
"""
-__version__ = "$Revision: 100511 $"
+__version__ = "$Revision: 102429 $"
import os, sys
@@ -2234,7 +2234,7 @@ def registerHddCmd(ctx, args):
imageId = ""
setParentId = False
parentId = ""
- hdd = vbox.openMedium(loc, ctx['global'].constants.DeviceType_HardDisk, ctx['global'].constants.AccessMode_ReadWrite, false)
+ hdd = vbox.openMedium(loc, ctx['global'].constants.DeviceType_HardDisk, ctx['global'].constants.AccessMode_ReadWrite, False)
print "registered HDD as %s" % (hdd.id)
return 0
@@ -2253,7 +2253,7 @@ def attachHddCmd(ctx, args):
vbox = ctx['vb']
loc = args[2]
try:
- hdd = vbox.openMedium(loc, ctx['global'].constants.DeviceType_HardDisk, ctx['global'].constants.AccessMode_ReadWrite, false)
+ hdd = vbox.openMedium(loc, ctx['global'].constants.DeviceType_HardDisk, ctx['global'].constants.AccessMode_ReadWrite, False)
except:
print "no HDD with path %s registered" % (loc)
return 0
@@ -2288,7 +2288,7 @@ def detachHddCmd(ctx, args):
vbox = ctx['vb']
loc = args[2]
try:
- hdd = vbox.openMedium(loc, ctx['global'].constants.DeviceType_HardDisk, ctx['global'].constants.AccessMode_ReadWrite, false)
+ hdd = vbox.openMedium(loc, ctx['global'].constants.DeviceType_HardDisk, ctx['global'].constants.AccessMode_ReadWrite, False)
except:
print "no HDD with path %s registered" % (loc)
return 0
@@ -2308,7 +2308,7 @@ def unregisterHddCmd(ctx, args):
else:
vmunreg = 0
try:
- hdd = vbox.openMedium(loc, ctx['global'].constants.DeviceType_HardDisk, ctx['global'].constants.AccessMode_ReadWrite, false)
+ hdd = vbox.openMedium(loc, ctx['global'].constants.DeviceType_HardDisk, ctx['global'].constants.AccessMode_ReadWrite, False)
except:
print "no HDD with path %s registered" % (loc)
return 0
@@ -2333,7 +2333,7 @@ def removeHddCmd(ctx, args):
vbox = ctx['vb']
loc = args[1]
try:
- hdd = vbox.openMedium(loc, ctx['global'].constants.DeviceType_HardDisk, ctx['global'].constants.AccessMode_ReadWrite, false)
+ hdd = vbox.openMedium(loc, ctx['global'].constants.DeviceType_HardDisk, ctx['global'].constants.AccessMode_ReadWrite, False)
except:
print "no HDD with path %s registered" % (loc)
return 0
@@ -2350,7 +2350,7 @@ def registerIsoCmd(ctx, args):
vbox = ctx['vb']
loc = args[1]
- iso = vbox.openMedium(loc, ctx['global'].constants.DeviceType_DVD, ctx['global'].constants.AccessMode_ReadOnly, false)
+ iso = vbox.openMedium(loc, ctx['global'].constants.DeviceType_DVD, ctx['global'].constants.AccessMode_ReadOnly, False)
print "registered ISO as %s" % (iso.id)
return 0
@@ -2362,7 +2362,7 @@ def unregisterIsoCmd(ctx, args):
vbox = ctx['vb']
loc = args[1]
try:
- dvd = vbox.openMedium(loc, ctx['global'].constants.DeviceType_DVD, ctx['global'].constants.AccessMode_ReadOnly, false)
+ dvd = vbox.openMedium(loc, ctx['global'].constants.DeviceType_DVD, ctx['global'].constants.AccessMode_ReadOnly, False)
except:
print "no DVD with path %s registered" % (loc)
return 0
@@ -2380,7 +2380,7 @@ def removeIsoCmd(ctx, args):
vbox = ctx['vb']
loc = args[1]
try:
- dvd = vbox.openMedium(loc, ctx['global'].constants.DeviceType_DVD, ctx['global'].constants.AccessMode_ReadOnly, false)
+ dvd = vbox.openMedium(loc, ctx['global'].constants.DeviceType_DVD, ctx['global'].constants.AccessMode_ReadOnly, False)
except:
print "no DVD with path %s registered" % (loc)
return 0
@@ -2403,7 +2403,7 @@ def attachIsoCmd(ctx, args):
vbox = ctx['vb']
loc = args[2]
try:
- dvd = vbox.openMedium(loc, ctx['global'].constants.DeviceType_DVD, ctx['global'].constants.AccessMode_ReadOnly, false)
+ dvd = vbox.openMedium(loc, ctx['global'].constants.DeviceType_DVD, ctx['global'].constants.AccessMode_ReadOnly, False)
except:
print "no DVD with path %s registered" % (loc)
return 0
@@ -2426,7 +2426,7 @@ def detachIsoCmd(ctx, args):
vbox = ctx['vb']
loc = args[2]
try:
- dvd = vbox.openMedium(loc, ctx['global'].constants.DeviceType_DVD, ctx['global'].constants.AccessMode_ReadOnly, false)
+ dvd = vbox.openMedium(loc, ctx['global'].constants.DeviceType_DVD, ctx['global'].constants.AccessMode_ReadOnly, False)
except:
print "no DVD with path %s registered" % (loc)
return 0
@@ -2445,7 +2445,7 @@ def mountIsoCmd(ctx, args):
vbox = ctx['vb']
loc = args[2]
try:
- dvd = vbox.openMedium(loc, ctx['global'].constants.DeviceType_DVD, ctx['global'].constants.AccessMode_ReadOnly, false)
+ dvd = vbox.openMedium(loc, ctx['global'].constants.DeviceType_DVD, ctx['global'].constants.AccessMode_ReadOnly, False)
except:
print "no DVD with path %s registered" % (loc)
return 0
@@ -2526,7 +2526,7 @@ def detachCtrCmd(ctx, args):
def usbctr(ctx, mach, console, args):
if (args[0]):
- console.attachUSBDevice(args[1])
+ console.attachUSBDevice(args[1], "")
else:
console.detachUSBDevice(args[1])
@@ -2634,7 +2634,7 @@ def snapshotCmd(ctx, args):
desc = args[4]
else:
desc = ""
- cmdAnyVm(ctx, mach, lambda ctx, mach, console, args: progressBar(ctx, mach.takeSnapshot(name, desc, true)[1]))
+ cmdAnyVm(ctx, mach, lambda ctx, mach, console, args: progressBar(ctx, mach.takeSnapshot(name, desc, True)[0]))
return 0
if cmd == 'restore':
diff --git a/src/VBox/Frontends/VirtualBox/Makefile.kmk b/src/VBox/Frontends/VirtualBox/Makefile.kmk
index 9927244..314735e 100644
--- a/src/VBox/Frontends/VirtualBox/Makefile.kmk
+++ b/src/VBox/Frontends/VirtualBox/Makefile.kmk
@@ -300,6 +300,7 @@ VirtualBox_QT_MOCHDRS = \
src/extradata/UIExtraDataManager.h \
src/globals/UIActionPool.h \
src/globals/UIAnimationFramework.h \
+ src/globals/UIDesktopWidgetWatchdog.h \
src/globals/UIMainEventListener.h \
src/globals/UIMessageCenter.h \
src/globals/UIModalWindowManager.h \
@@ -500,6 +501,7 @@ VirtualBox_QT_MOCSRCS = \
src/extensions/QIAdvancedToolBar.cpp \
src/extradata/UIExtraDataManager.cpp \
src/globals/UIActionPool.cpp \
+ src/globals/UIDesktopWidgetWatchdog.cpp \
src/globals/UIThreadPool.cpp \
src/medium/UIMediumEnumerator.cpp \
src/medium/UIMediumManager.cpp \
@@ -579,6 +581,7 @@ VirtualBox_SOURCES = \
src/globals/COMDefs.cpp \
src/globals/UIActionPool.cpp \
src/globals/UIAnimationFramework.cpp \
+ src/globals/UIDesktopWidgetWatchdog.cpp \
src/globals/UIIconPool.cpp \
src/globals/UIImageTools.cpp \
src/globals/UIMainEventListener.cpp \
diff --git a/src/VBox/Frontends/VirtualBox/nls/VirtualBox_nl.ts b/src/VBox/Frontends/VirtualBox/nls/VirtualBox_nl.ts
index 5c1b30f..36cb266 100644
--- a/src/VBox/Frontends/VirtualBox/nls/VirtualBox_nl.ts
+++ b/src/VBox/Frontends/VirtualBox/nls/VirtualBox_nl.ts
@@ -962,7 +962,7 @@
</message>
<message>
<source>&Full-screen Mode</source>
- <translation>&Sschermvullende modus</translation>
+ <translation>&Schermvullende modus</translation>
</message>
<message>
<source>Switch between normal and full-screen mode</source>
@@ -6188,7 +6188,8 @@
</message>
<message>
<source>Remove disk from virtual drive</source>
- <translation>Verwijder schijf van virtuele station</translation>
+ <translatorcomment>zonder 'het' ervoor is het 'virtueel station' en niet 'virtuele station'</translatorcomment>
+ <translation>Schijf van virtueel station verwijderen</translation>
</message>
<message>
<source>Choose a virtual floppy disk file...</source>
@@ -6396,7 +6397,7 @@
</message>
<message>
<source>Remove Disk from Virtual Drive</source>
- <translation>Verwijder schijf van virtuele station</translation>
+ <translation>Schijf van virtueel station verwijderen</translation>
</message>
<message>
<source>Choose Virtual Floppy Disk File...</source>
@@ -8680,7 +8681,7 @@
</message>
<message>
<source>Encryption password for <nobr>ID = '%1'</nobr> is invalid.</source>
- <translation type="unfinished"></translation>
+ <translation>Ongeldig versleutelwachtwoord voor <nobr>ID = '%1'</nobr>.</translation>
</message>
</context>
<context>
@@ -10229,7 +10230,7 @@
</message>
<message>
<source>Export Virtual Appliance</source>
- <translation>Exporteer Virtual Applicance</translation>
+ <translation>Exporteer Virtual Appliance</translation>
</message>
<message>
<source>Restore Defaults</source>
@@ -10249,7 +10250,7 @@
</message>
<message>
<source>Appliance settings</source>
- <translation>Instellingen Appiance</translation>
+ <translation>Instellingen Appliance</translation>
</message>
<message>
<source>Please choose where to create the virtual appliance. You can create it on your own computer, on the Sun Cloud service or on an S3 storage server.</source>
@@ -10333,7 +10334,7 @@
</message>
<message>
<source>Appliance &settings</source>
- <translation>In&stellingen Appiance</translation>
+ <translation>In&stellingen Appliance</translation>
</message>
<message>
<source>&Destination</source>
@@ -10465,7 +10466,7 @@
</message>
<message>
<source>Appliance settings</source>
- <translation>Instellingen Appiance</translation>
+ <translation>Instellingen Appliance</translation>
</message>
<message>
<source>These are the virtual machines contained in the appliance and the suggested settings of the imported VirtualBox machines. You can change many of the properties shown by double-clicking on the items and disable others using the check boxes below.</source>
@@ -10473,7 +10474,7 @@
</message>
<message>
<source>Import Virtual Appliance</source>
- <translation>Importeer Virtual Applicance</translation>
+ <translation>Importeer Virtual Appliance</translation>
</message>
<message>
<source>Choose a virtual appliance file to import...</source>
diff --git a/src/VBox/Frontends/VirtualBox/src/UIVMInfoDialog.cpp b/src/VBox/Frontends/VirtualBox/src/UIVMInfoDialog.cpp
index 4f109ad..3c967be 100644
--- a/src/VBox/Frontends/VirtualBox/src/UIVMInfoDialog.cpp
+++ b/src/VBox/Frontends/VirtualBox/src/UIVMInfoDialog.cpp
@@ -476,7 +476,7 @@ void UIVMInfoDialog::loadSettings()
#else /* Q_WS_MAC */
setGeometry(m_geometry);
#endif /* !Q_WS_MAC */
- LogRel(("GUI: UIVMInfoDialog: Geometry loaded to: %dx%d @ %dx%d\n",
+ LogRel(("GUI: UIVMInfoDialog: Geometry loaded to: Origin=%dx%d, Size=%dx%d\n",
m_geometry.x(), m_geometry.y(), m_geometry.width(), m_geometry.height()));
/* Maximize (if necessary): */
@@ -495,7 +495,7 @@ void UIVMInfoDialog::saveSettings()
#else /* Q_WS_MAC */
gEDataManager->setInformationWindowGeometry(m_geometry, isMaximized(), vboxGlobal().managedVMUuid());
#endif /* !Q_WS_MAC */
- LogRel(("GUI: UIVMInfoDialog: Geometry saved as: %dx%d @ %dx%d\n",
+ LogRel(("GUI: UIVMInfoDialog: Geometry saved as: Origin=%dx%d, Size=%dx%d\n",
m_geometry.x(), m_geometry.y(), m_geometry.width(), m_geometry.height()));
}
}
diff --git a/src/VBox/Frontends/VirtualBox/src/UIVMLogViewer.cpp b/src/VBox/Frontends/VirtualBox/src/UIVMLogViewer.cpp
index 854274c..9cb6065 100644
--- a/src/VBox/Frontends/VirtualBox/src/UIVMLogViewer.cpp
+++ b/src/VBox/Frontends/VirtualBox/src/UIVMLogViewer.cpp
@@ -28,6 +28,7 @@
# include <QLabel>
# include <QScrollBar>
# include <QTextEdit>
+# include <QDesktopWidget>
/* GUI includes: */
# include "UIVMLogViewer.h"
@@ -37,6 +38,7 @@
# include "VBoxGlobal.h"
# include "UIMessageCenter.h"
# include "VBoxUtils.h"
+# include "UIExtraDataManager.h"
/* COM includes: */
# include "COMEnums.h"
@@ -300,9 +302,17 @@ private:
int iResult = -1;
if (fForward && (fStartCurrent || iPos < strText.size() - 1))
+ {
iResult = strText.indexOf(m_pSearchEditor->text(), iAnc + iDiff,
m_pCaseSensitiveCheckBox->isChecked() ?
Qt::CaseSensitive : Qt::CaseInsensitive);
+
+ /* When searchstring is changed, search from beginning of log again: */
+ if (iResult == -1 && fStartCurrent)
+ iResult = strText.indexOf(m_pSearchEditor->text(), 0,
+ m_pCaseSensitiveCheckBox->isChecked() ?
+ Qt::CaseSensitive : Qt::CaseInsensitive);
+ }
else if (!fForward && iAnc > 0)
iResult = strText.lastIndexOf(m_pSearchEditor->text(), iAnc - 1,
m_pCaseSensitiveCheckBox->isChecked() ?
@@ -411,12 +421,18 @@ UIVMLogViewer::UIVMLogViewer(QWidget *pParent, Qt::WindowFlags flags, const CMac
/* Reading log files: */
refresh();
+ /* Load settings: */
+ loadSettings();
+
/* Loading language constants */
retranslateUi();
}
UIVMLogViewer::~UIVMLogViewer()
{
+ /* Save settings: */
+ saveSettings();
+
if (!m_machine.isNull())
m_viewers.remove(m_machine.GetName());
}
@@ -478,6 +494,10 @@ void UIVMLogViewer::refresh()
/* Create a log viewer page and append the read text to it: */
QTextEdit *pLogViewer = createLogPage(QFileInfo(strFileName).fileName());
pLogViewer->setPlainText(strText);
+ /* Move the cursor position to end: */
+ QTextCursor cursor = pLogViewer->textCursor();
+ cursor.movePosition(QTextCursor::End, QTextCursor::MoveAnchor);
+ pLogViewer->setTextCursor(cursor);
/* Add the actual file name and the QTextEdit containing the content to a list: */
m_book << qMakePair(strFileName, pLogViewer);
isAnyLogPresent = true;
@@ -559,28 +579,12 @@ void UIVMLogViewer::showEvent(QShowEvent *pEvent)
if (m_fIsPolished)
return;
- m_fIsPolished = true;
-
- /* Resize the whole log-viewer to fit 80 symbols in
- * text-browser for the first time started: */
- QTextEdit *pFirstPage = currentLogPage();
- if (pFirstPage)
- {
- int fullWidth = pFirstPage->fontMetrics().width(QChar('x')) * 80 +
- pFirstPage->verticalScrollBar()->width() +
- pFirstPage->frameWidth() * 2 +
- /* m_pViewerContainer margin */ 10 * 2 +
- /* CentralWidget margin */ 10 * 2;
- resize(fullWidth, height());
- }
+ m_fIsPolished = true;
/* Make sure the log view widget has the focus */
QWidget *pCurrentLogPage = currentLogPage();
if (pCurrentLogPage)
- pCurrentLogPage->setFocus();
-
- /* Explicit widget centering relatively to it's parent: */
- VBoxGlobal::centerWidget(this, parentWidget(), false);
+ pCurrentLogPage->setFocus();
}
void UIVMLogViewer::keyPressEvent(QKeyEvent *pEvent)
@@ -639,5 +643,60 @@ QTextEdit* UIVMLogViewer::createLogPage(const QString &strName)
return pLogViewer;
}
+void UIVMLogViewer::loadSettings()
+{
+ /* Restore window geometry: */
+ {
+ /* Getting available geometry to calculate default geometry: */
+ const QRect desktopRect = QApplication::desktop()->availableGeometry(this);
+ int iDefaultWidth = desktopRect.width() * 0.5;
+ int iDefaultHeight = desktopRect.height() * 0.75;
+
+ /* Calculate default width to fit 132 characters: */
+ QTextEdit *pCurrentLogPage = currentLogPage();
+ if (pCurrentLogPage)
+ {
+ iDefaultWidth = pCurrentLogPage->fontMetrics().width(QChar('x')) * 132 +
+ pCurrentLogPage->verticalScrollBar()->width() +
+ pCurrentLogPage->frameWidth() * 2 +
+ /* m_pViewerContainer margin */ 10 * 2 +
+ /* CentralWidget margin */ 10 * 2;
+ }
+ QRect defaultGeometry(0, 0, iDefaultWidth, iDefaultHeight);
+ defaultGeometry.moveCenter(parentWidget()->geometry().center());
+
+ /* Load geometry: */
+ m_geometry = gEDataManager->logWindowGeometry(this, defaultGeometry);
+#ifdef Q_WS_MAC
+ move(m_geometry.topLeft());
+ resize(m_geometry.size());
+#else /* Q_WS_MAC */
+ setGeometry(m_geometry);
+#endif /* !Q_WS_MAC */
+ LogRel(("GUI: UIVMLogViewer: Geometry loaded to: Origin=%dx%d, Size=%dx%d\n",
+ m_geometry.x(), m_geometry.y(), m_geometry.width(), m_geometry.height()));
+
+ /* Maximize (if necessary): */
+ if (gEDataManager->logWindowShouldBeMaximized())
+ showMaximized();
+ }
+}
+
+void UIVMLogViewer::saveSettings()
+{
+ /* Save window geometry: */
+ {
+ /* Save geometry: */
+ const QRect saveGeometry = geometry();
+#ifdef Q_WS_MAC
+ gEDataManager->setLogWindowGeometry(saveGeometry, ::darwinIsWindowMaximized(this));
+#else /* Q_WS_MAC */
+ gEDataManager->setLogWindowGeometry(saveGeometry, isMaximized());
+#endif /* !Q_WS_MAC */
+ LogRel(("GUI: UIVMLogViewer: Geometry saved as: Origin=%dx%d, Size=%dx%d\n",
+ saveGeometry.x(), saveGeometry.y(), saveGeometry.width(), saveGeometry.height()));
+ }
+}
+
#include "UIVMLogViewer.moc"
diff --git a/src/VBox/Frontends/VirtualBox/src/UIVMLogViewer.h b/src/VBox/Frontends/VirtualBox/src/UIVMLogViewer.h
index 8b156ab..9c5c61d 100644
--- a/src/VBox/Frontends/VirtualBox/src/UIVMLogViewer.h
+++ b/src/VBox/Frontends/VirtualBox/src/UIVMLogViewer.h
@@ -81,6 +81,12 @@ private:
QTextEdit* currentLogPage();
QTextEdit* createLogPage(const QString &strPage);
+ /** Load settings helper. */
+ void loadSettings();
+
+ /** Save settings helper. */
+ void saveSettings();
+
/* Array containing all VM Log Viewers: */
static VMLogViewerMap m_viewers;
@@ -91,6 +97,9 @@ private:
UIVMLogViewerSearchPanel *m_pSearchPanel;
LogBook m_book;
+ /** Current dialog geometry. */
+ QRect m_geometry;
+
/* Buttons: */
QPushButton *mBtnHelp;
QPushButton *mBtnFind;
diff --git a/src/VBox/Frontends/VirtualBox/src/extensions/QIArrowSplitter.cpp b/src/VBox/Frontends/VirtualBox/src/extensions/QIArrowSplitter.cpp
index 9a9c1df..ea66611 100644
--- a/src/VBox/Frontends/VirtualBox/src/extensions/QIArrowSplitter.cpp
+++ b/src/VBox/Frontends/VirtualBox/src/extensions/QIArrowSplitter.cpp
@@ -21,7 +21,6 @@
/* Qt includes: */
# include <QApplication>
-# include <QDesktopWidget>
# include <QStyle>
# include <QHBoxLayout>
# include <QTextEdit>
@@ -31,6 +30,7 @@
# include "QIArrowButtonSwitch.h"
# include "QIArrowButtonPress.h"
# include "UIIconPool.h"
+# include "VBoxGlobal.h"
/* Other VBox includes: */
# include "iprt/assert.h"
@@ -82,7 +82,7 @@ QSize QIDetailsBrowser::minimumSizeHint() const
documentSize.setHeight(documentSize.height() + iDocumentMargin);
/* Get 40% of the screen-area to limit the resulting hint: */
- const QSize screenGeometryDot4 = QApplication::desktop()->screenGeometry(this).size() * .4;
+ const QSize screenGeometryDot4 = vboxGlobal().screenGeometry(this).size() * .4;
/* Calculate minimum size-hint which is document-size limited by screen-area: */
QSize mSizeHint = documentSize.boundedTo(screenGeometryDot4);
diff --git a/src/VBox/Frontends/VirtualBox/src/extradata/UIExtraDataDefs.cpp b/src/VBox/Frontends/VirtualBox/src/extradata/UIExtraDataDefs.cpp
index 1de7c90..460a887 100644
--- a/src/VBox/Frontends/VirtualBox/src/extradata/UIExtraDataDefs.cpp
+++ b/src/VBox/Frontends/VirtualBox/src/extradata/UIExtraDataDefs.cpp
@@ -164,3 +164,6 @@ const char* UIExtraDataDefs::GUI_ExtraDataManager_Geometry = "GUI/ExtraDataManag
const char* UIExtraDataDefs::GUI_ExtraDataManager_SplitterHints = "GUI/ExtraDataManager/SplitterHints";
#endif /* DEBUG */
+/* Virtual Machine: Log dialog: */
+const char* UIExtraDataDefs::GUI_LogWindowGeometry = "GUI/LogWindowGeometry";
+
diff --git a/src/VBox/Frontends/VirtualBox/src/extradata/UIExtraDataDefs.h b/src/VBox/Frontends/VirtualBox/src/extradata/UIExtraDataDefs.h
index d98ba95..f9b93b0 100644
--- a/src/VBox/Frontends/VirtualBox/src/extradata/UIExtraDataDefs.h
+++ b/src/VBox/Frontends/VirtualBox/src/extradata/UIExtraDataDefs.h
@@ -286,6 +286,12 @@ namespace UIExtraDataDefs
extern const char* GUI_ExtraDataManager_SplitterHints;
/** @} */
#endif /* DEBUG */
+
+ /** @name Virtual Machine: Log dialog
+ * @{ */
+ /** Holds log-window geometry. */
+ extern const char* GUI_LogWindowGeometry;
+ /** @} */
}
/** Extra-data meta definitions. */
@@ -649,3 +655,4 @@ enum MiniToolbarAlignment
#endif /* !Q_WS_MAC */
#endif /* !___UIExtraDataDefs_h___ */
+
diff --git a/src/VBox/Frontends/VirtualBox/src/extradata/UIExtraDataManager.cpp b/src/VBox/Frontends/VirtualBox/src/extradata/UIExtraDataManager.cpp
index 7eb4d77..d083793 100644
--- a/src/VBox/Frontends/VirtualBox/src/extradata/UIExtraDataManager.cpp
+++ b/src/VBox/Frontends/VirtualBox/src/extradata/UIExtraDataManager.cpp
@@ -22,7 +22,6 @@
/* Qt includes: */
# include <QMutex>
# include <QMetaEnum>
-# include <QDesktopWidget>
# ifdef DEBUG
# include <QMainWindow>
# include <QMenuBar>
@@ -1478,7 +1477,7 @@ void UIExtraDataManagerWindow::loadSettings()
#else /* Q_WS_MAC */
setGeometry(m_geometry);
#endif /* !Q_WS_MAC */
- LogRel(("GUI: UIExtraDataManagerWindow: Geometry loaded to: %dx%d @ %dx%d\n",
+ LogRel(("GUI: UIExtraDataManagerWindow: Geometry loaded to: Origin=%dx%d, Size=%dx%d\n",
m_geometry.x(), m_geometry.y(), m_geometry.width(), m_geometry.height()));
/* Maximize (if necessary): */
@@ -1507,7 +1506,7 @@ void UIExtraDataManagerWindow::saveSettings()
#else /* Q_WS_MAC */
gEDataManager->setExtraDataManagerGeometry(m_geometry, isMaximized());
#endif /* !Q_WS_MAC */
- LogRel(("GUI: UIExtraDataManagerWindow: Geometry saved as: %dx%d @ %dx%d\n",
+ LogRel(("GUI: UIExtraDataManagerWindow: Geometry saved as: Origin=%dx%d, Size=%dx%d\n",
m_geometry.x(), m_geometry.y(), m_geometry.width(), m_geometry.height()));
}
}
@@ -1803,7 +1802,8 @@ QStringList UIExtraDataManagerWindow::knownExtraDataKeys()
#ifdef VBOX_WITH_DEBUGGER_GUI
<< GUI_Dbg_Enabled << GUI_Dbg_AutoShow
#endif /* VBOX_WITH_DEBUGGER_GUI */
- << GUI_ExtraDataManager_Geometry << GUI_ExtraDataManager_SplitterHints;
+ << GUI_ExtraDataManager_Geometry << GUI_ExtraDataManager_SplitterHints
+ << GUI_LogWindowGeometry;
}
#endif /* DEBUG */
@@ -2225,20 +2225,20 @@ QRect UIExtraDataManager::selectorWindowGeometry(QWidget *pWidget)
/* Use geometry (loaded or default): */
QRect geometry = fOk ? QRect(iX, iY, iW, iH) : QRect(0, 0, 770, 550);
- /* Take widget into account: */
+ /* Take hint-widget into account: */
if (pWidget)
geometry.setSize(geometry.size().expandedTo(pWidget->minimumSizeHint()));
/* Get screen-geometry [of screen with point (iX, iY) if possible]: */
- const QRect screenGeometry = fOk ? QApplication::desktop()->availableGeometry(QPoint(iX, iY)) :
- QApplication::desktop()->availableGeometry();
+ const QRect availableGeometry = fOk ? vboxGlobal().availableGeometry(QPoint(iX, iY)) :
+ vboxGlobal().availableGeometry();
/* Make sure resulting geometry is within current bounds: */
- geometry = geometry.intersected(screenGeometry);
+ geometry = geometry.intersected(availableGeometry);
/* Move default-geometry to screen-geometry' center: */
if (!fOk)
- geometry.moveCenter(screenGeometry.center());
+ geometry.moveCenter(availableGeometry.center());
/* Return result: */
return geometry;
@@ -3426,11 +3426,11 @@ QRect UIExtraDataManager::informationWindowGeometry(QWidget *pWidget, QWidget *p
geometry.setSize(geometry.size().expandedTo(pWidget->minimumSizeHint()));
/* Get screen-geometry [of screen with point (iX, iY) if possible]: */
- const QRect screenGeometry = fOk ? QApplication::desktop()->availableGeometry(QPoint(iX, iY)) :
- QApplication::desktop()->availableGeometry();
+ const QRect availableGeometry = fOk ? vboxGlobal().availableGeometry(QPoint(iX, iY)) :
+ vboxGlobal().availableGeometry();
/* Make sure resulting geometry is within current bounds: */
- geometry = geometry.intersected(screenGeometry);
+ geometry = geometry.intersected(availableGeometry);
/* Move default-geometry to pParentWidget' geometry center: */
if (!fOk && pParentWidget)
@@ -3536,15 +3536,15 @@ QRect UIExtraDataManager::extraDataManagerGeometry(QWidget *pWidget)
geometry.setSize(geometry.size().expandedTo(pWidget->minimumSizeHint()));
/* Get screen-geometry [of screen with point (iX, iY) if possible]: */
- const QRect screenGeometry = fOk ? QApplication::desktop()->availableGeometry(QPoint(iX, iY)) :
- QApplication::desktop()->availableGeometry();
+ const QRect availableGeometry = fOk ? vboxGlobal().availableGeometry(QPoint(iX, iY)) :
+ vboxGlobal().availableGeometry();
/* Make sure resulting geometry is within current bounds: */
- geometry = geometry.intersected(screenGeometry);
+ geometry = geometry.intersected(availableGeometry);
/* Move default-geometry to current screen center: */
if (!fOk)
- geometry.moveCenter(screenGeometry.center());
+ geometry.moveCenter(availableGeometry.center());
/* Return result: */
return geometry;
@@ -3620,6 +3620,72 @@ void UIExtraDataManager::setExtraDataManagerSplitterHints(const QList<int> &hint
}
#endif /* DEBUG */
+QRect UIExtraDataManager::logWindowGeometry(QWidget *pWidget, const QRect &defaultGeometry)
+{
+ /* Get corresponding extra-data: */
+ const QStringList data = extraDataStringList(GUI_LogWindowGeometry);
+
+ /* Parse loaded data: */
+ int iX = 0, iY = 0, iW = 0, iH = 0;
+ bool fOk = data.size() >= 4;
+ do
+ {
+ if (!fOk) break;
+ iX = data[0].toInt(&fOk);
+ if (!fOk) break;
+ iY = data[1].toInt(&fOk);
+ if (!fOk) break;
+ iW = data[2].toInt(&fOk);
+ if (!fOk) break;
+ iH = data[3].toInt(&fOk);
+ }
+ while (0);
+
+ /* Use geometry (loaded or default): */
+ QRect geometry = fOk ? QRect(iX, iY, iW, iH) : defaultGeometry;
+
+ /* Take hint-widget into account: */
+ if (pWidget)
+ geometry.setSize(geometry.size().expandedTo(pWidget->minimumSizeHint()));
+
+ /* In Windows Qt fails to reposition out of screen window properly, so moving to centre: */
+#ifdef Q_WS_WIN
+ /* Get screen-geometry [of screen with point (iX, iY) if possible]: */
+ const QRect availableGeometry = vboxGlobal().availableGeometry(QPoint(iX, iY));
+
+ /* Make sure resulting geometry is within current bounds: */
+ if (!availableGeometry.contains(geometry, true))
+ geometry.moveCenter(defaultGeometry.center());
+#endif /* Q_WS_WIN */
+
+ /* Return result: */
+ return geometry;
+}
+
+bool UIExtraDataManager::logWindowShouldBeMaximized()
+{
+ /* Get corresponding extra-data: */
+ const QStringList data = extraDataStringList(GUI_LogWindowGeometry);
+
+ /* Make sure 5th item has required value: */
+ return data.size() == 5 && data[4] == GUI_Geometry_State_Max;
+}
+
+void UIExtraDataManager::setLogWindowGeometry(const QRect &geometry, bool fMaximized)
+{
+ /* Serialize passed values: */
+ QStringList data;
+ data << QString::number(geometry.x());
+ data << QString::number(geometry.y());
+ data << QString::number(geometry.width());
+ data << QString::number(geometry.height());
+ if (fMaximized)
+ data << GUI_Geometry_State_Max;
+
+ /* Re-cache corresponding extra-data: */
+ setExtraDataStringList(GUI_LogWindowGeometry, data);
+}
+
void UIExtraDataManager::sltExtraDataChange(QString strMachineID, QString strKey, QString strValue)
{
/* Re-cache value only if strMachineID known already: */
diff --git a/src/VBox/Frontends/VirtualBox/src/extradata/UIExtraDataManager.h b/src/VBox/Frontends/VirtualBox/src/extradata/UIExtraDataManager.h
index a015c23..204d911 100644
--- a/src/VBox/Frontends/VirtualBox/src/extradata/UIExtraDataManager.h
+++ b/src/VBox/Frontends/VirtualBox/src/extradata/UIExtraDataManager.h
@@ -533,6 +533,16 @@ public:
/** @} */
#endif /* DEBUG */
+ /** @name Virtual Machine: Log dialog
+ * @{ */
+ /** Returns log-window geometry using @a pWidget and @a defaultGeometry as hints. */
+ QRect logWindowGeometry(QWidget *pWidget, const QRect &defaultGeometry);
+ /** Returns whether log-window should be maximized or not. */
+ bool logWindowShouldBeMaximized();
+ /** Defines log-window @a geometry and @a fMaximized state. */
+ void setLogWindowGeometry(const QRect &geometry, bool fMaximized);
+ /** @} */
+
private slots:
/** Handles 'extra-data change' event: */
@@ -606,3 +616,4 @@ private:
#define gEDataManager UIExtraDataManager::instance()
#endif /* !___UIExtraDataManager_h___ */
+
diff --git a/src/VBox/Frontends/VirtualBox/src/globals/UIDesktopWidgetWatchdog.cpp b/src/VBox/Frontends/VirtualBox/src/globals/UIDesktopWidgetWatchdog.cpp
new file mode 100644
index 0000000..8255173
--- /dev/null
+++ b/src/VBox/Frontends/VirtualBox/src/globals/UIDesktopWidgetWatchdog.cpp
@@ -0,0 +1,212 @@
+/* $Id: UIDesktopWidgetWatchdog.cpp $ */
+/** @file
+ * VBox Qt GUI - UIDesktopWidgetWatchdog class implementation.
+ */
+
+/*
+ * Copyright (C) 2015 Oracle Corporation
+ *
+ * This file is part of VirtualBox Open Source Edition (OSE), as
+ * available from http://www.virtualbox.org. This file is free software;
+ * you can redistribute it and/or modify it under the terms of the GNU
+ * General Public License (GPL) as published by the Free Software
+ * Foundation, in version 2 as it comes in the "COPYING" file of the
+ * VirtualBox OSE distribution. VirtualBox OSE is distributed in the
+ * hope that it will be useful, but WITHOUT ANY WARRANTY of any kind.
+ */
+
+/* Qt includes: */
+#include <QApplication>
+#include <QDesktopWidget>
+#ifdef Q_WS_X11
+# include <QX11Info>
+#endif /* Q_WS_X11 */
+
+/* GUI includes: */
+#include "UIDesktopWidgetWatchdog.h"
+
+/* Other VBox includes: */
+#include <iprt/assert.h>
+
+/** QWidget extension used as
+ * an invisible window on the basis of which we
+ * can calculate available host-screen geometry. */
+class UIInvisibleWindow : public QWidget
+{
+ Q_OBJECT;
+
+signals:
+
+ /** Notifies listeners about host-screen available-geometry was calulated.
+ * @param iHostScreenIndex holds the index of the host-screen this window created for.
+ * @param availableGeometry holds the available-geometry of the host-screen this window created for. */
+ void sigHostScreenAvailableGeometryCalculated(int iHostScreenIndex, QRect availableGeometry);
+
+public:
+
+ /** Constructs invisible window for the host-screen with @a iHostScreenIndex. */
+ UIInvisibleWindow(int iHostScreenIndex);
+
+private:
+
+ /** Resize @a pEvent handler. */
+ void resizeEvent(QResizeEvent *pEvent);
+
+ /** Holds the index of the host-screen this window created for. */
+ int m_iHostScreenIndex;
+};
+
+UIInvisibleWindow::UIInvisibleWindow(int iHostScreenIndex)
+ : QWidget(0, Qt::Window | Qt::FramelessWindowHint)
+ , m_iHostScreenIndex(iHostScreenIndex)
+{
+ /* Resize to minimum size of 1 pixel: */
+ resize(1, 1);
+ /* Apply visual and mouse-event mask for that 1 pixel: */
+ setMask(QRect(0, 0, 1, 1));
+#ifdef Q_WS_X11
+ /* For composite WMs make this 1 pixel transparent: */
+ if (QX11Info::isCompositingManagerRunning())
+ setAttribute(Qt::WA_TranslucentBackground);
+#else /* !Q_WS_X11 */
+ /* Make this 1 pixel transparent: */
+ setAttribute(Qt::WA_TranslucentBackground);
+#endif /* !Q_WS_X11 */
+}
+
+void UIInvisibleWindow::resizeEvent(QResizeEvent *pEvent)
+{
+ /* Call to base-class: */
+ QWidget::resizeEvent(pEvent);
+
+ /* Ignore 'not-yet-shown' case: */
+ if (!isVisible())
+ return;
+
+ /* Notify listeners about host-screen available-geometry was calulated: */
+ emit sigHostScreenAvailableGeometryCalculated(m_iHostScreenIndex, QRect(x(), y(), width(), height()));
+}
+
+UIDesktopWidgetWatchdog::UIDesktopWidgetWatchdog(QObject *pParent)
+ : QObject(pParent)
+ , m_pDesktopWidget(QApplication::desktop())
+ , m_cHostScreenCount(-1)
+{
+ /* Prepare: */
+ prepare();
+}
+
+UIDesktopWidgetWatchdog::~UIDesktopWidgetWatchdog()
+{
+ /* Cleanup: */
+ cleanup();
+}
+
+const QRect UIDesktopWidgetWatchdog::screenGeometry(int iHostScreenIndex /* = -1 */) const
+{
+ /* Make sure index is valid: */
+ if (iHostScreenIndex < 0 || iHostScreenIndex >= m_cHostScreenCount)
+ iHostScreenIndex = m_pDesktopWidget->primaryScreen();
+ AssertReturn(iHostScreenIndex >= 0 && iHostScreenIndex < m_cHostScreenCount, QRect());
+
+ /* Redirect call to desktop-widget: */
+ return m_pDesktopWidget->screenGeometry(iHostScreenIndex);
+}
+
+const QRect UIDesktopWidgetWatchdog::availableGeometry(int iHostScreenIndex /* = -1 */) const
+{
+ /* Make sure index is valid: */
+ if (iHostScreenIndex < 0 || iHostScreenIndex >= m_cHostScreenCount)
+ iHostScreenIndex = m_pDesktopWidget->primaryScreen();
+ AssertReturn(iHostScreenIndex >= 0 && iHostScreenIndex < m_cHostScreenCount, QRect());
+
+ /* Return cached available-geometry: */
+ return m_availableGeometryData.value(iHostScreenIndex);
+}
+
+void UIDesktopWidgetWatchdog::sltUpdateHostScreenConfiguration(int cHostScreenCount /* = -1 */)
+{
+// printf("UIDesktopWidgetWatchdog::sltUpdateHostScreenConfiguration(%d)\n", cHostScreenCount);
+
+ /* Acquire new host-screen count: */
+ m_cHostScreenCount = cHostScreenCount != -1 ? cHostScreenCount : m_pDesktopWidget->screenCount();
+
+ /* Resize vectors to new host-screen count: */
+ qDeleteAll(m_availableGeometryWorkers);
+ m_availableGeometryWorkers.clear();
+ m_availableGeometryWorkers.resize(m_cHostScreenCount);
+ m_availableGeometryData.clear();
+ m_availableGeometryData.resize(m_cHostScreenCount);
+
+ /* Calculate host-screen available-geometry for each particular host-screen: */
+ for (int iHostScreenIndex = 0; iHostScreenIndex < m_cHostScreenCount; ++iHostScreenIndex)
+ sltRecalculateHostScreenAvailableGeometry(iHostScreenIndex);
+}
+
+void UIDesktopWidgetWatchdog::sltRecalculateHostScreenAvailableGeometry(int iHostScreenIndex)
+{
+// printf("UIDesktopWidgetWatchdog::sltRecalculateHostScreenAvailableGeometry(%d)\n", iHostScreenIndex);
+
+ /* Make sure index is valid: */
+ if (iHostScreenIndex < 0 || iHostScreenIndex >= m_cHostScreenCount)
+ iHostScreenIndex = m_pDesktopWidget->primaryScreen();
+ AssertReturnVoid(iHostScreenIndex >= 0 && iHostScreenIndex < m_cHostScreenCount);
+
+ /* Create invisible frame-less window worker: */
+ UIInvisibleWindow *pWorker = new UIInvisibleWindow(iHostScreenIndex);
+ AssertPtrReturnVoid(pWorker);
+ {
+ /* Remember created worker: */
+ if (m_availableGeometryWorkers.value(iHostScreenIndex))
+ delete m_availableGeometryWorkers.value(iHostScreenIndex);
+ m_availableGeometryWorkers[iHostScreenIndex] = pWorker;
+ /* Get the screen-geometry: */
+ const QRect hostScreenGeometry = screenGeometry(iHostScreenIndex);
+ /* Use the screen-geometry as the temporary value for available-geometry: */
+ m_availableGeometryData[iHostScreenIndex] = hostScreenGeometry;
+ /* Connect worker listener: */
+ connect(pWorker, SIGNAL(sigHostScreenAvailableGeometryCalculated(int, QRect)),
+ this, SLOT(sltHandleHostScreenAvailableGeometryCalculated(int, QRect)));
+ /* Place worker to corresponding host-screen: */
+ pWorker->move(hostScreenGeometry.topLeft());
+ /* And finally, maximize it: */
+ pWorker->showMaximized();
+ }
+}
+
+void UIDesktopWidgetWatchdog::sltHandleHostScreenAvailableGeometryCalculated(int iHostScreenIndex, QRect availableGeometry)
+{
+// printf("UIDesktopWidgetWatchdog::sltHandleHostScreenAvailableGeometryCalculated(%d): %dx%d x %dx%d\n",
+// iHostScreenIndex, availableGeometry.x(), availableGeometry.y(), availableGeometry.width(), availableGeometry.height());
+
+ /* Apply received data: */
+ m_availableGeometryData[iHostScreenIndex] = availableGeometry;
+ /* Forget finished worker: */
+ AssertPtrReturnVoid(m_availableGeometryWorkers.value(iHostScreenIndex));
+ m_availableGeometryWorkers.value(iHostScreenIndex)->deleteLater();
+ m_availableGeometryWorkers[iHostScreenIndex] = 0;
+}
+
+void UIDesktopWidgetWatchdog::prepare()
+{
+ /* Prepare connections: */
+ connect(m_pDesktopWidget, SIGNAL(screenCountChanged(int)), this, SLOT(sltUpdateHostScreenConfiguration(int)));
+ connect(m_pDesktopWidget, SIGNAL(resized(int)), this, SLOT(sltRecalculateHostScreenAvailableGeometry(int)));
+
+ /* Update host-screen configuration: */
+ sltUpdateHostScreenConfiguration();
+}
+
+void UIDesktopWidgetWatchdog::cleanup()
+{
+ /* Cleanup connections: */
+ disconnect(m_pDesktopWidget, SIGNAL(screenCountChanged(int)), this, SLOT(sltUpdateHostScreenConfiguration(int)));
+ disconnect(m_pDesktopWidget, SIGNAL(resized(int)), this, SLOT(sltRecalculateHostScreenAvailableGeometry(int)));
+
+ /* Cleanup existing workers: */
+ qDeleteAll(m_availableGeometryWorkers);
+ m_availableGeometryWorkers.clear();
+}
+
+#include "UIDesktopWidgetWatchdog.moc"
+
diff --git a/src/VBox/Frontends/VirtualBox/src/globals/UIDesktopWidgetWatchdog.h b/src/VBox/Frontends/VirtualBox/src/globals/UIDesktopWidgetWatchdog.h
new file mode 100644
index 0000000..2e53ce6
--- /dev/null
+++ b/src/VBox/Frontends/VirtualBox/src/globals/UIDesktopWidgetWatchdog.h
@@ -0,0 +1,81 @@
+/* $Id: UIDesktopWidgetWatchdog.h $ */
+/** @file
+ * VBox Qt GUI - UIDesktopWidgetWatchdog class declaration.
+ */
+
+/*
+ * Copyright (C) 2015 Oracle Corporation
+ *
+ * This file is part of VirtualBox Open Source Edition (OSE), as
+ * available from http://www.virtualbox.org. This file is free software;
+ * you can redistribute it and/or modify it under the terms of the GNU
+ * General Public License (GPL) as published by the Free Software
+ * Foundation, in version 2 as it comes in the "COPYING" file of the
+ * VirtualBox OSE distribution. VirtualBox OSE is distributed in the
+ * hope that it will be useful, but WITHOUT ANY WARRANTY of any kind.
+ */
+
+#ifndef ___UIDesktopWidgetWatchdog_h___
+#define ___UIDesktopWidgetWatchdog_h___
+
+/* Qt includes: */
+#include <QObject>
+#include <QVector>
+#include <QRect>
+
+/* Forward declarations: */
+class QDesktopWidget;
+
+/** QObject extension used as
+ * a desktop-widget watchdog aware
+ * of the host-screen geometry changes. */
+class UIDesktopWidgetWatchdog : public QObject
+{
+ Q_OBJECT;
+
+public:
+
+ /** Constructs watchdog for the @a pParent being passed into the base-class. */
+ UIDesktopWidgetWatchdog(QObject *pParent);
+ /** Destructs watchdog. */
+ ~UIDesktopWidgetWatchdog();
+
+ /** Returns the geometry of the host-screen with @a iHostScreenIndex.
+ * @note The default screen is used if @a iHostScreenIndex is -1. */
+ const QRect screenGeometry(int iHostScreenIndex = -1) const;
+ /** Returns the available-geometry of the host-screen with @a iHostScreenIndex.
+ * @note The default screen is used if @a iHostScreenIndex is -1. */
+ const QRect availableGeometry(int iHostScreenIndex = -1) const;
+
+private slots:
+
+ /** Updates host-screen configuration according to new @a cHostScreenCount.
+ * @note cHostScreenCount can be equal to -1 which means we have to acquire it ourselves. */
+ void sltUpdateHostScreenConfiguration(int cHostScreenCount = -1);
+
+ /** Recalculates available-geometry for the host-screen with @a iHostScreenIndex. */
+ void sltRecalculateHostScreenAvailableGeometry(int iHostScreenIndex);
+
+ /** Handles @a availableGeometry calculation result for the host-screen with @a iHostScreenIndex. */
+ void sltHandleHostScreenAvailableGeometryCalculated(int iHostScreenIndex, QRect availableGeometry);
+
+private:
+
+ /** Prepare routine. */
+ void prepare();
+ /** Cleanup routine. */
+ void cleanup();
+
+ /** Holds the desktop-widget reference pointer. */
+ QDesktopWidget *m_pDesktopWidget;
+
+ /** Holds current host-screen count. */
+ int m_cHostScreenCount;
+ /** Holds current host-screen available-geometries. */
+ QVector<QRect> m_availableGeometryData;
+ /** Holds current workers determining host-screen available-geometries. */
+ QVector<QWidget*> m_availableGeometryWorkers;
+};
+
+#endif /* !___UIDesktopWidgetWatchdog_h___ */
+
diff --git a/src/VBox/Frontends/VirtualBox/src/globals/UIMainEventListener.cpp b/src/VBox/Frontends/VirtualBox/src/globals/UIMainEventListener.cpp
index 625d5d7..d0048cd 100644
--- a/src/VBox/Frontends/VirtualBox/src/globals/UIMainEventListener.cpp
+++ b/src/VBox/Frontends/VirtualBox/src/globals/UIMainEventListener.cpp
@@ -21,6 +21,7 @@
/* GUI includes: */
# include "UIMainEventListener.h"
+# include "VBoxGlobal.h"
/* COM includes: */
# include "COMEnums.h"
@@ -66,6 +67,10 @@ UIMainEventListener::UIMainEventListener()
STDMETHODIMP UIMainEventListener::HandleEvent(VBoxEventType_T /* type */, IEvent *pEvent)
{
+ /* Try to acquire COM cleanup protection token first: */
+ if (!vboxGlobal().comTokenTryLockForRead())
+ return S_OK;
+
CEvent event(pEvent);
// printf("Event received: %d\n", event.GetType());
switch (event.GetType())
@@ -263,6 +268,10 @@ STDMETHODIMP UIMainEventListener::HandleEvent(VBoxEventType_T /* type */, IEvent
default: break;
}
+
+ /* Unlock COM cleanup protection token: */
+ vboxGlobal().comTokenUnlock();
+
return S_OK;
}
diff --git a/src/VBox/Frontends/VirtualBox/src/globals/UIMessageCenter.cpp b/src/VBox/Frontends/VirtualBox/src/globals/UIMessageCenter.cpp
index 2d3c21c..d70e9f6 100644
--- a/src/VBox/Frontends/VirtualBox/src/globals/UIMessageCenter.cpp
+++ b/src/VBox/Frontends/VirtualBox/src/globals/UIMessageCenter.cpp
@@ -21,7 +21,6 @@
/* Qt includes: */
# include <QDir>
-# include <QDesktopWidget>
# include <QFileInfo>
# include <QLocale>
# include <QThread>
@@ -1140,7 +1139,7 @@ void UIMessageCenter::cannotAttachDevice(const CMachine &machine, UIMediumType t
strMessage, formatErrorInfo(machine));
}
-bool UIMessageCenter::warnAboutIncorrectPort(QWidget *pParent /* = 0*/) const
+bool UIMessageCenter::warnAboutIncorrectPort(QWidget *pParent /* = 0 */) const
{
alert(pParent, MessageType_Error,
tr("The current port forwarding rules are not valid. "
@@ -1148,6 +1147,22 @@ bool UIMessageCenter::warnAboutIncorrectPort(QWidget *pParent /* = 0*/) const
return false;
}
+bool UIMessageCenter::warnAboutIncorrectAddress(QWidget *pParent /* = 0 */) const
+{
+ alert(pParent, MessageType_Error,
+ tr("The current port forwarding rules are not valid. "
+ "All of the host or guest address values should be correct or empty."));
+ return false;
+}
+
+bool UIMessageCenter::warnAboutEmptyGuestAddress(QWidget *pParent /* = 0 */) const
+{
+ alert(pParent, MessageType_Error,
+ tr("The current port forwarding rules are not valid. "
+ "None of the guest address values may be empty."));
+ return false;
+}
+
bool UIMessageCenter::warnAboutNameShouldBeUnique(QWidget *pParent /* = 0 */) const
{
alert(pParent, MessageType_Error,
diff --git a/src/VBox/Frontends/VirtualBox/src/globals/UIMessageCenter.h b/src/VBox/Frontends/VirtualBox/src/globals/UIMessageCenter.h
index 5b10618..ecb34fd 100644
--- a/src/VBox/Frontends/VirtualBox/src/globals/UIMessageCenter.h
+++ b/src/VBox/Frontends/VirtualBox/src/globals/UIMessageCenter.h
@@ -237,6 +237,8 @@ public:
int confirmRemovingOfLastDVDDevice(QWidget *pParent = 0) const;
void cannotAttachDevice(const CMachine &machine, UIMediumType type, const QString &strLocation, const StorageSlot &storageSlot, QWidget *pParent = 0);
bool warnAboutIncorrectPort(QWidget *pParent = 0) const;
+ bool warnAboutIncorrectAddress(QWidget *pParent = 0) const;
+ bool warnAboutEmptyGuestAddress(QWidget *pParent = 0) const;
bool warnAboutNameShouldBeUnique(QWidget *pParent = 0) const;
bool warnAboutRulesConflict(QWidget *pParent = 0) const;
bool confirmCancelingPortForwardingDialog(QWidget *pParent = 0) const;
diff --git a/src/VBox/Frontends/VirtualBox/src/globals/VBoxGlobal.cpp b/src/VBox/Frontends/VirtualBox/src/globals/VBoxGlobal.cpp
index fe38bc4..dbab6c0 100644
--- a/src/VBox/Frontends/VirtualBox/src/globals/VBoxGlobal.cpp
+++ b/src/VBox/Frontends/VirtualBox/src/globals/VBoxGlobal.cpp
@@ -76,8 +76,9 @@
# ifdef Q_WS_X11
# include "UIHostComboEditor.h"
+# include "UIDesktopWidgetWatchdog.h"
# ifndef VBOX_OSE
-# include "VBoxLicenseViewer.h"
+# include "VBoxLicenseViewer.h"
# endif /* VBOX_OSE */
# endif /* Q_WS_X11 */
@@ -217,8 +218,12 @@ void VBoxGlobal::destroy()
return;
}
- /* Cleanup instance: */
- /* Automatically on QApplication::aboutToQuit() signal: */
+ /* Cleanup instance:
+ * 1. By default, automatically on QApplication::aboutToQuit() signal.
+ * 2. But if QApplication was not started at all and we perform
+ * early shutdown, we should do cleanup ourselves. */
+ if (m_spInstance->isValid())
+ m_spInstance->cleanup();
/* Destroy instance: */
delete m_spInstance;
}
@@ -231,6 +236,7 @@ VBoxGlobal::VBoxGlobal()
, m_pMediumEnumerator(0)
#ifdef Q_WS_X11
, m_enmWindowManagerType(X11WMType_Unknown)
+ , m_pDesktopWidgetWatchdog(0)
#endif /* Q_WS_X11 */
#if defined(DEBUG_bird)
, mAgressiveCaching(false)
@@ -333,6 +339,74 @@ MacOSXRelease VBoxGlobal::osRelease()
}
#endif /* Q_WS_MAC */
+int VBoxGlobal::screenCount() const
+{
+ /* Redirect call to QDesktopWidget: */
+ return QApplication::desktop()->screenCount();
+}
+
+int VBoxGlobal::screenNumber(const QWidget *pWidget) const
+{
+ /* Redirect call to QDesktopWidget: */
+ return QApplication::desktop()->screenNumber(pWidget);
+}
+
+int VBoxGlobal::screenNumber(const QPoint &point) const
+{
+ /* Redirect call to QDesktopWidget: */
+ return QApplication::desktop()->screenNumber(point);
+}
+
+const QRect VBoxGlobal::screenGeometry(int iHostScreenIndex /* = -1 */) const
+{
+#ifdef Q_WS_X11
+ /* Make sure desktop-widget watchdog already created: */
+ AssertPtrReturn(m_pDesktopWidgetWatchdog, QApplication::desktop()->screenGeometry(iHostScreenIndex));
+ /* Redirect call to UIDesktopWidgetWatchdog: */
+ return m_pDesktopWidgetWatchdog->screenGeometry(iHostScreenIndex);
+#endif /* Q_WS_X11 */
+
+ /* Redirect call to QDesktopWidget: */
+ return QApplication::desktop()->screenGeometry(iHostScreenIndex);
+}
+
+const QRect VBoxGlobal::availableGeometry(int iHostScreenIndex /* = -1 */) const
+{
+#ifdef Q_WS_X11
+ /* Make sure desktop-widget watchdog already created: */
+ AssertPtrReturn(m_pDesktopWidgetWatchdog, QApplication::desktop()->availableGeometry(iHostScreenIndex));
+ /* Redirect call to UIDesktopWidgetWatchdog: */
+ return m_pDesktopWidgetWatchdog->availableGeometry(iHostScreenIndex);
+#endif /* Q_WS_X11 */
+
+ /* Redirect call to QDesktopWidget: */
+ return QApplication::desktop()->availableGeometry(iHostScreenIndex);
+}
+
+const QRect VBoxGlobal::screenGeometry(const QWidget *pWidget) const
+{
+ /* Redirect call to existing wrapper: */
+ return screenGeometry(screenNumber(pWidget));
+}
+
+const QRect VBoxGlobal::availableGeometry(const QWidget *pWidget) const
+{
+ /* Redirect call to existing wrapper: */
+ return availableGeometry(screenNumber(pWidget));
+}
+
+const QRect VBoxGlobal::screenGeometry(const QPoint &point) const
+{
+ /* Redirect call to existing wrapper: */
+ return screenGeometry(screenNumber(point));
+}
+
+const QRect VBoxGlobal::availableGeometry(const QPoint &point) const
+{
+ /* Redirect call to existing wrapper: */
+ return availableGeometry(screenNumber(point));
+}
+
/**
* Sets the new global settings and saves them to the VirtualBox server.
*/
@@ -2910,8 +2984,9 @@ quint64 VBoxGlobal::requiredVideoMemory(const QString &strGuestOSTypeId, int cMo
* correct, but as we can't predict on which host screens the user will
* open the guest windows, this is the best assumption we can do, cause it
* is the worst case. */
- QVector<int> screenSize(qMax(cMonitors, pDW->numScreens()), 0);
- for (int i = 0; i < pDW->numScreens(); ++i)
+ const int cHostScreens = pDW->screenCount();
+ QVector<int> screenSize(qMax(cMonitors, cHostScreens), 0);
+ for (int i = 0; i < cHostScreens; ++i)
{
QRect r = pDW->screenGeometry(i);
screenSize[i] = r.width() * r.height();
@@ -4039,6 +4114,9 @@ void VBoxGlobal::prepare()
#ifdef Q_WS_X11
/* Acquire current Window Manager type: */
m_enmWindowManagerType = X11WindowManagerType();
+
+ /* Create desktop-widget watchdog instance: */
+ m_pDesktopWidgetWatchdog = new UIDesktopWidgetWatchdog(this);
#endif /* Q_WS_X11 */
#ifdef VBOX_WITH_DEBUGGER_GUI
@@ -4381,17 +4459,24 @@ void VBoxGlobal::cleanup()
mFamilyIDs.clear();
mTypes.clear();
- /* the last steps to ensure we don't use COM any more */
- m_host.detach();
- m_vbox.detach();
- m_client.detach();
-
- /* There may be UIMedium(s)EnumeratedEvent instances still in the message
- * queue which reference COM objects. Remove them to release those objects
- * before uninitializing the COM subsystem. */
- QApplication::removePostedEvents (this);
-
- COMBase::CleanupCOM();
+ /* Starting COM cleanup: */
+ m_comCleanupProtectionToken.lockForWrite();
+ {
+ /* First, make sure we don't use COM any more: */
+ m_host.detach();
+ m_vbox.detach();
+ m_client.detach();
+
+ /* There may be UIMedium(s)EnumeratedEvent instances still in the message
+ * queue which reference COM objects. Remove them to release those objects
+ * before uninitializing the COM subsystem. */
+ QApplication::removePostedEvents(this);
+
+ /* Finally cleanup COM itself: */
+ COMBase::CleanupCOM();
+ }
+ /* Finishing COM cleanup: */
+ m_comCleanupProtectionToken.unlock();
/* Destroy popup-center: */
UIPopupCenter::destroy();
diff --git a/src/VBox/Frontends/VirtualBox/src/globals/VBoxGlobal.h b/src/VBox/Frontends/VirtualBox/src/globals/VBoxGlobal.h
index 2e9a0ce..ce66dc5 100644
--- a/src/VBox/Frontends/VirtualBox/src/globals/VBoxGlobal.h
+++ b/src/VBox/Frontends/VirtualBox/src/globals/VBoxGlobal.h
@@ -64,6 +64,9 @@ class QSpinBox;
class UIMediumEnumerator;
class UIMedium;
class UIIconPoolGeneral;
+#ifdef Q_WS_X11
+class UIDesktopWidgetWatchdog;
+#endif /* Q_WS_X11 */
// VBoxGlobal class
////////////////////////////////////////////////////////////////////////////////
@@ -119,6 +122,11 @@ public:
static MacOSXRelease osRelease();
#endif /* Q_WS_MAC */
+ /** Try to acquire COM cleanup protection token for reading. */
+ bool comTokenTryLockForRead() { return m_comCleanupProtectionToken.tryLockForRead(); }
+ /** Unlock previously acquired COM cleanup protection token. */
+ void comTokenUnlock() { return m_comCleanupProtectionToken.unlock(); }
+
/** Returns the copy of VirtualBox client wrapper. */
CVirtualBoxClient virtualBoxClient() const { return m_client; }
/** Returns the copy of VirtualBox object wrapper. */
@@ -131,6 +139,34 @@ public:
/** Returns the VBoxSVC availability value. */
bool isVBoxSVCAvailable() const { return m_fVBoxSVCAvailable; }
+ /** @name Host-screen geometry stuff
+ * @{ */
+ /** Returns the number of host-screens currently available on the system. */
+ int screenCount() const;
+
+ /** Returns the index of the screen which contains contains @a pWidget. */
+ int screenNumber(const QWidget *pWidget) const;
+ /** Returns the index of the screen which contains contains @a point. */
+ int screenNumber(const QPoint &point) const;
+
+ /** Returns the geometry of the host-screen with @a iHostScreenIndex.
+ * @note The default screen is used if @a iHostScreenIndex is -1. */
+ const QRect screenGeometry(int iHostScreenIndex = -1) const;
+ /** Returns the available-geometry of the host-screen with @a iHostScreenIndex.
+ * @note The default screen is used if @a iHostScreenIndex is -1. */
+ const QRect availableGeometry(int iHostScreenIndex = -1) const;
+
+ /** Returns the geometry of the host-screen which contains @a pWidget. */
+ const QRect screenGeometry(const QWidget *pWidget) const;
+ /** Returns the available-geometry of the host-screen which contains @a pWidget. */
+ const QRect availableGeometry(const QWidget *pWidget) const;
+
+ /** Returns the geometry of the host-screen which contains @a point. */
+ const QRect screenGeometry(const QPoint &point) const;
+ /** Returns the available-geometry of the host-screen which contains @a point. */
+ const QRect availableGeometry(const QPoint &point) const;
+ /** @} */
+
VBoxGlobalSettings &settings() { return gset; }
bool setSettings (VBoxGlobalSettings &gs);
@@ -481,6 +517,9 @@ private:
bool mValid;
+ /** COM cleanup protection token. */
+ QReadWriteLock m_comCleanupProtectionToken;
+
/** Holds the instance of VirtualBox client wrapper. */
CVirtualBoxClient m_client;
/** Holds the copy of VirtualBox object wrapper. */
@@ -513,33 +552,41 @@ private:
#ifdef Q_WS_X11
/** X11: Holds the type of the Window Manager we are running under. */
X11WMType m_enmWindowManagerType;
+
+ /** @name Host-screen geometry stuff
+ * @{ */
+ /** X11: Holds the desktop-widget watchdog instance aware of host-screen geometry changes. */
+ UIDesktopWidgetWatchdog *m_pDesktopWidgetWatchdog;
+ /** @} */
#endif /* Q_WS_X11 */
/** The --aggressive-caching / --no-aggressive-caching option. */
bool mAgressiveCaching;
/** The --restore-current option. */
bool mRestoreCurrentSnapshot;
+
/** @name Ad-hoc VM reconfiguration.
* @{ */
- /** Floppy image. */
- QString m_strFloppyImage;
- /** DVD image. */
- QString m_strDvdImage;
+ /** Floppy image. */
+ QString m_strFloppyImage;
+ /** DVD image. */
+ QString m_strDvdImage;
/** @} */
+
/** @name VMM options
* @{ */
- /** The --disable-patm option. */
- bool mDisablePatm;
- /** The --disable-csam option. */
- bool mDisableCsam;
- /** The --recompile-supervisor option. */
- bool mRecompileSupervisor;
- /** The --recompile-user option. */
- bool mRecompileUser;
- /** The --execute-all-in-iem option. */
- bool mExecuteAllInIem;
- /** The --warp-factor option value. */
- uint32_t mWarpPct;
+ /** The --disable-patm option. */
+ bool mDisablePatm;
+ /** The --disable-csam option. */
+ bool mDisableCsam;
+ /** The --recompile-supervisor option. */
+ bool mRecompileSupervisor;
+ /** The --recompile-user option. */
+ bool mRecompileUser;
+ /** The --execute-all-in-iem option. */
+ bool mExecuteAllInIem;
+ /** The --warp-factor option value. */
+ uint32_t mWarpPct;
/** @} */
#ifdef VBOX_WITH_DEBUGGER_GUI
diff --git a/src/VBox/Frontends/VirtualBox/src/main.cpp b/src/VBox/Frontends/VirtualBox/src/main.cpp
index 7382053..b9631e5 100644
--- a/src/VBox/Frontends/VirtualBox/src/main.cpp
+++ b/src/VBox/Frontends/VirtualBox/src/main.cpp
@@ -42,6 +42,7 @@
# include <QTranslator>
# include <iprt/buildconfig.h>
+# include <iprt/ctype.h>
# include <iprt/initterm.h>
# include <iprt/process.h>
# include <iprt/stream.h>
@@ -624,26 +625,71 @@ int main(int argc, char **argv, char **envp)
#else /* VBOX_WITH_HARDENING */
+
+/**
+ * Special entrypoint used by the hardening code when something goes south.
+ *
+ * Display an error dialog to the user.
+ *
+ * @param pszWhere Indicates where the error occured.
+ * @param enmWhat Indicates what init operation was going on at the time.
+ * @param rc The VBox status code corresponding to the error.
+ * @param pszMsgFmt The message format string.
+ * @param va Format arguments.
+ */
extern "C" DECLEXPORT(void) TrustedError(const char *pszWhere, SUPINITOP enmWhat, int rc, const char *pszMsgFmt, va_list va)
{
# ifdef RT_OS_DARWIN
ShutUpAppKit();
# endif /* RT_OS_DARWIN */
+ char szMsgBuf[_16K];
- /* We have to create QApplication anyway just to show the only one error-message.
- * This is a bit hackish as we don't have the argument vector handy. */
+ /*
+ * We have to create QApplication anyway just to show the only one error-message.
+ * This is a bit hackish as we don't have the argument vector handy.
+ */
int argc = 0;
char *argv[2] = { NULL, NULL };
QApplication a(argc, &argv[0]);
- /* Prepare the error-message: */
- QString strTitle = QApplication::tr("VirtualBox - Error In %1").arg(pszWhere);
-
- char szMsgBuf[1024];
+ /*
+ * The details starts off a properly formatted rc and where/what, we use
+ * the szMsgBuf for this, thus this have to come before the actual message
+ * formatting.
+ */
+ RTStrPrintf(szMsgBuf, sizeof(szMsgBuf),
+ "<!--EOM-->"
+ "where: %s\n"
+ "what: %d\n"
+ "%Rra\n",
+ pszWhere, enmWhat, rc);
+ QString strDetails = szMsgBuf;
+
+ /*
+ * Format the error message. Take whatever comes after a double new line as
+ * something better off in the details section.
+ */
RTStrPrintfV(szMsgBuf, sizeof(szMsgBuf), pszMsgFmt, va);
+
+ char *pszDetails = strstr(szMsgBuf, "\n\n");
+ if (pszDetails)
+ {
+ while (RT_C_IS_SPACE(*pszDetails))
+ *pszDetails++ = '\0';
+ if (*pszDetails)
+ {
+ strDetails += "\n";
+ strDetails += pszDetails;
+ }
+ RTStrStripR(szMsgBuf);
+ }
+
QString strText = QApplication::tr("<html><b>%1 (rc=%2)</b><br/><br/>").arg(szMsgBuf).arg(rc);
strText.replace(QString("\n"), QString("<br>"));
+ /*
+ * Append possibly helpful hints to the error message.
+ */
switch (enmWhat)
{
case kSupInitOp_Driver:
@@ -680,16 +726,28 @@ extern "C" DECLEXPORT(void) TrustedError(const char *pszWhere, SUPINITOP enmWhat
strText += "</html>";
+
# ifdef RT_OS_LINUX
- /* We have to to make sure that we display the error-message
- * after the parent displayed its own message. */
+ /*
+ * We have to to make sure that we display the error-message
+ * after the parent displayed its own message.
+ */
sleep(2);
-# endif /* RT_OS_LINUX */
+# endif
+
+ /*
+ * Create the message box and show it.
+ */
+ QString strTitle = QApplication::tr("VirtualBox - Error In %1").arg(pszWhere);
+ QIMessageBox msgBox(strTitle, strText, AlertIconType_Critical, AlertButton_Ok | AlertButtonOption_Default);
+ if (!strDetails.isEmpty())
+ msgBox.setDetailsText(strDetails);
+
+ msgBox.exec();
- QMessageBox::critical(0 /* parent */, strTitle, strText,
- QMessageBox::Abort /* 1st button */, 0 /* 2nd button */);
qFatal("%s", strText.toUtf8().constData());
}
#endif /* VBOX_WITH_HARDENING */
+
diff --git a/src/VBox/Frontends/VirtualBox/src/medium/UIMedium.cpp b/src/VBox/Frontends/VirtualBox/src/medium/UIMedium.cpp
index 6976fac..1e5116d 100644
--- a/src/VBox/Frontends/VirtualBox/src/medium/UIMedium.cpp
+++ b/src/VBox/Frontends/VirtualBox/src/medium/UIMedium.cpp
@@ -530,9 +530,9 @@ QString UIMedium::nullID()
/* static */
QString UIMedium::normalizedID(const QString &strID)
{
- AssertMsgReturn(QUuid(strID).toString().remove('{').remove('}') == strID,
- ("CMedium UUID is not valid: '%s'\n", strID.toAscii().constData()),
- nullID());
+ /* Handle wrong UUID (null/empty or invalid format): */
+ if (QUuid(strID).toString().remove('{').remove('}') != strID)
+ return nullID();
return strID;
}
diff --git a/src/VBox/Frontends/VirtualBox/src/net/UINetworkReply.cpp b/src/VBox/Frontends/VirtualBox/src/net/UINetworkReply.cpp
index df6ccd7..d18b95c 100644
--- a/src/VBox/Frontends/VirtualBox/src/net/UINetworkReply.cpp
+++ b/src/VBox/Frontends/VirtualBox/src/net/UINetworkReply.cpp
@@ -1,10 +1,10 @@
/* $Id: UINetworkReply.cpp $ */
/** @file
- * VBox Qt GUI - UINetworkReply stuff implementation.
+ * VBox Qt GUI - UINetworkReply, i.e. HTTP/HTTPS for update pings++.
*/
/*
- * Copyright (C) 2012-2013 Oracle Corporation
+ * Copyright (C) 2012-2015 Oracle Corporation
*
* This file is part of VirtualBox Open Source Edition (OSE), as
* available from http://www.virtualbox.org. This file is free software;
@@ -36,12 +36,18 @@
#endif /* !VBOX_WITH_PRECOMPILED_HEADERS */
-#include <iprt/http.h>
+#include <iprt/crypto/pem.h>
+#include <iprt/crypto/store.h>
#include <iprt/err.h>
+#include <iprt/http.h>
+#include <iprt/path.h>
+#include <iprt/sha.h>
#include <iprt/zip.h>
-/* Our network-reply thread: */
+/**
+ * Our network-reply thread
+ */
class UINetworkReplyPrivateThread : public QThread
{
Q_OBJECT;
@@ -51,133 +57,366 @@ public:
/* Constructor: */
UINetworkReplyPrivateThread(const QNetworkRequest &request);
- /* API: Read stuff: */
- const QByteArray& readAll() const { return m_reply; }
+ /** Returns short descriptive context of thread's current operation. */
+ const QString context() const { return m_strContext; }
- /* API: Error stuff: */
+ /** @name APIs
+ * @{ */
+ /** Read everything. */
+ const QByteArray& readAll() const { return m_reply; }
+ /** IRPT error status. */
int error() const { return m_iError; }
-
- /* API: HTTP stuff: */
+ /** Abort HTTP request. */
void abort();
+ /** @} */
private:
-
- /* Helpers: HTTP stuff: */
+ /** @name Helpers - HTTP stuff
+ * @{ */
int applyProxyRules();
int applyHttpsCertificates();
int applyRawHeaders();
int performMainRequest();
+ /** @} */
/* Helper: Main thread runner: */
void run();
- /* Static helper: File stuff: */
+ /** Info about wanted certificate. */
+ typedef struct CERTINFO
+ {
+ /** Gives the s_aCerts index this certificate is an alternative edition of,
+ * UINT8_MAX if no alternative. This is a complication caused by VeriSign
+ * reissuing certificates signed with md2WithRSAEncryption using
+ * sha1WithRSAEncryption, since MD2 is comprimised. (Public key unmodified.)
+ * It has no practical meaning for the trusted root anchor use we put it to. */
+ uint8_t iAlternativeTo;
+ /** Set if mandatory. */
+ bool fMandatory;
+ /** Filename in the zip file we download (PEM). */
+ const char *pszZipFile;
+ /** List of direct URLs to PEM formatted files.. */
+ const char *apszUrls[4];
+ } CERTINFO;
+
+ /** @name Static helpers for HTTP and Certificates handling.
+ * @{ */
static QString fullCertificateFileName();
-
- /* Static helpers: HTTP stuff: */
- static int abort(RTHTTP pHttp);
- static int applyProxyRules(RTHTTP pHttp, const QString &strHostName, int iPort);
- static int applyCertificates(RTHTTP pHttp, const QString &strFullCertificateFileName);
- static int applyRawHeaders(RTHTTP pHttp, const QList<QByteArray> &headers, const QNetworkRequest &request);
- static int performGetRequestForText(RTHTTP pHttp, const QNetworkRequest &request, QByteArray &reply);
- static int performGetRequestForBinary(RTHTTP pHttp, const QNetworkRequest &request, QByteArray &reply);
- static int checkCertificates(RTHTTP pHttp, const QString &strFullCertificateFileName);
- static int decompressCertificate(const QByteArray &package, QByteArray &certificate, const QString &strName);
- static int downloadCertificates(RTHTTP pHttp, const QString &strFullCertificateFileName);
- static int downloadCertificatePca3G5(RTHTTP pHttp, QByteArray &certificate);
- static int downloadCertificatePca3(RTHTTP pHttp, QByteArray &certificate);
- static int verifyCertificatePca3G5(RTHTTP pHttp, QByteArray &certificate);
- static int verifyCertificatePca3(RTHTTP pHttp, QByteArray &certificate);
- static int verifyCertificate(RTHTTP pHttp, QByteArray &certificate, const QByteArray &sha1, const QByteArray &sha512);
- static int saveCertificates(const QString &strFullCertificateFileName, const QByteArray &certificatePca3G5, const QByteArray &certificatePca3);
- static int saveCertificate(QFile &file, const QByteArray &certificate);
+ static int applyProxyRules(RTHTTP hHttp, const QString &strHostName, int iPort);
+ static int applyRawHeaders(RTHTTP hHttp, const QList<QByteArray> &headers, const QNetworkRequest &request);
+ static unsigned countCertsFound(bool const *pafFoundCerts);
+ static bool areAllCertsFound(bool const *pafFoundCerts, bool fOnlyMandatory);
+ static int adjustCertsFound(int rc, bool *pafFoundCerts);
+ static void refreshCertificates(RTHTTP hHttp, RTCRSTORE hOldStore, bool *pafFoundCerts, const char *pszCaCertFile);
+ static void downloadMissingCertificates(RTCRSTORE hNewStore, bool *pafNewFoundCerts, RTHTTP hHttp,
+ PRTERRINFOSTATIC pStaticErrInfo);
+ static int convertVerifyAndAddPemCertificateToStore(RTCRSTORE hStore, void const *pvResponse,
+ size_t cbResponse, PCRTCRCERTWANTED pWantedCert);
+ /** @} */
+
+ /** Holds short descriptive context of thread's current operation. */
+ QString m_strContext;
/* Variables: */
QNetworkRequest m_request;
int m_iError;
- RTHTTP m_pHttp;
+ /** IPRT HTTP client instance handle. */
+ RTHTTP m_hHttp;
QByteArray m_reply;
- static const QString m_strCertificateFileName;
+
+ static const QString s_strCertificateFileName;
+ static const RTCRCERTWANTED s_aCerts[3];
+ static const CERTINFO s_CertInfoPcaCls3Gen1Md2;
+ static const CERTINFO s_CertInfoPcaCls3Gen1Sha1;
+ static const CERTINFO s_CertInfoPcaCls3Gen5;
+};
+
+/*static*/ const UINetworkReplyPrivateThread::CERTINFO UINetworkReplyPrivateThread::s_CertInfoPcaCls3Gen1Sha1 =
+{
+ /*.iAlternativeTo =*/ 1,
+ /*.fMandatory =*/ false,
+ /*.pszZipFile =*/
+ "VeriSign Root Certificates/Generation 1 (G1) PCAs/Class 3 Public Primary Certification Authority.pem",
+ /*.apszUrls[3] =*/
+ {
+ "http://www.symantec.com/content/en/us/enterprise/verisign/roots/Class-3-Public-Primary-Certification-Authority.pem",
+ "http://www.verisign.com/repository/roots/root-certificates/PCA-3.pem", /* dead */
+ NULL,
+ "http://update.virtualbox.org/cacerts-symantec-PCA-3-pem-has-gone-missing-again" /* attention getter */
+ }
+};
+
+/*static*/ const UINetworkReplyPrivateThread::CERTINFO UINetworkReplyPrivateThread::s_CertInfoPcaCls3Gen1Md2 =
+{
+ /*.iAlternativeTo =*/ 0,
+ /*.fMandatory =*/ false,
+ /*.pszZipFile =*/ NULL,
+ /*.apszUrls[3] =*/ { NULL, NULL, NULL },
+};
+
+/*static*/ const UINetworkReplyPrivateThread::CERTINFO UINetworkReplyPrivateThread::s_CertInfoPcaCls3Gen5 =
+{
+ /*.iAlternativeTo =*/ UINT8_MAX,
+ /*.fMandatory =*/ true,
+ /*.pszZipFile =*/
+ "VeriSign Root Certificates/Generation 5 (G5) PCA/VeriSign Class 3 Public Primary Certification Authority - G5.pem",
+ /*.apszUrls[3] =*/
+ {
+ "http://www.symantec.com/content/en/us/enterprise/verisign/roots/VeriSign-Class%203-Public-Primary-Certification-Authority-G5.pem",
+ "http://www.symantec.com/content/en/us/enterprise/verisign/roots/VeriSign-Class-3-Public-Primary-Certification-Authority-G5.pem", /* (in case they correct above typo) */
+ "http://www.verisign.com/repository/roots/root-certificates/PCA-3G5.pem", /* dead */
+ "http://update.virtualbox.org/cacerts-symantec-PCA-3G5-pem-has-gone-missing-again" /* attention getter */
+ }
};
-/* static */
-const QString UINetworkReplyPrivateThread::m_strCertificateFileName = QString("vbox-ssl-cacertificate.crt");
+
+/**
+ * Details on the certificates we are after.
+ * The pvUser member points to a UINetworkReplyPrivateThread::CERTINFO.
+ */
+/* static */ const RTCRCERTWANTED UINetworkReplyPrivateThread::s_aCerts[3] =
+{
+ /*[0] =*/ /* The reissued version with the SHA-1 signature. */
+/** @todo r=bird: Why do we need this certificate? Neither update.virtualbox.org nor www.virtualbox.org uses it... ElCapitan doesn't ship this. */
+ {
+ /*.pszSubject =*/ "C=US, O=VeriSign, Inc., OU=Class 3 Public Primary Certification Authority",
+ /*.cbEncoded =*/ 0x240,
+ /*.Sha1Fingerprint =*/ true,
+ /*.Sha512Fingerprint =*/ true,
+ /*.abSha1 =*/
+ {
+ 0xa1, 0xdb, 0x63, 0x93, 0x91, 0x6f, 0x17, 0xe4, 0x18, 0x55,
+ 0x09, 0x40, 0x04, 0x15, 0xc7, 0x02, 0x40, 0xb0, 0xae, 0x6b
+ },
+ /*.abSha512 =*/
+ {
+ 0xbb, 0xf7, 0x8a, 0x19, 0x9f, 0x37, 0xee, 0xa2,
+ 0xce, 0xc8, 0xaf, 0xe3, 0xd6, 0x22, 0x54, 0x20,
+ 0x74, 0x67, 0x6e, 0xa5, 0x19, 0xb7, 0x62, 0x1e,
+ 0xc1, 0x2f, 0xd5, 0x08, 0xf4, 0x64, 0xc4, 0xc6,
+ 0xbb, 0xc2, 0xf2, 0x35, 0xe7, 0xbe, 0x32, 0x0b,
+ 0xde, 0xb2, 0xfc, 0x44, 0x92, 0x5b, 0x8b, 0x9b,
+ 0x77, 0xa5, 0x40, 0x22, 0x18, 0x12, 0xcb, 0x3d,
+ 0x0a, 0x67, 0x83, 0x87, 0xc5, 0x45, 0xc4, 0x99
+ },
+ /*.pvUser */ &UINetworkReplyPrivateThread::s_CertInfoPcaCls3Gen1Sha1
+ },
+ /*[1] =*/ /* The original version with the MD2 signature. */
+ {
+ /*.pszSubject =*/ "C=US, O=VeriSign, Inc., OU=Class 3 Public Primary Certification Authority",
+ /*.cbEncoded =*/ 0x240,
+ /*.Sha1Fingerprint =*/ true,
+ /*.Sha512Fingerprint =*/ true,
+ /*.abSha1 =*/
+ {
+ 0x74, 0x2c, 0x31, 0x92, 0xe6, 0x07, 0xe4, 0x24, 0xeb, 0x45,
+ 0x49, 0x54, 0x2b, 0xe1, 0xbb, 0xc5, 0x3e, 0x61, 0x74, 0xe2
+ },
+ /*.abSha512 =*/
+ {
+ 0x7c, 0x2f, 0x94, 0x22, 0x5f, 0x67, 0x98, 0x89,
+ 0xb9, 0xde, 0xd7, 0x41, 0xa0, 0x0d, 0xb1, 0x5c,
+ 0xc6, 0xca, 0x28, 0x12, 0xbf, 0xbc, 0xa8, 0x2b,
+ 0x22, 0x53, 0x7a, 0xf8, 0x32, 0x41, 0x2a, 0xbb,
+ 0xc1, 0x05, 0xe0, 0x0c, 0xd0, 0xa3, 0x97, 0x9d,
+ 0x5f, 0xcd, 0xe9, 0x9b, 0x68, 0x06, 0xe8, 0xe6,
+ 0xce, 0xef, 0xb2, 0x71, 0x8e, 0x91, 0x60, 0xa2,
+ 0xc8, 0x0c, 0x5a, 0xe7, 0x8b, 0x33, 0xf2, 0xaa
+ },
+ /*.pvUser */ &UINetworkReplyPrivateThread::s_CertInfoPcaCls3Gen1Md2
+ },
+ /*[2] =*/
+ {
+ /*.pszSubject =*/
+ "C=US, O=VeriSign, Inc., OU=VeriSign Trust Network, OU=(c) 2006 VeriSign, Inc. - For authorized use only, "
+ "CN=VeriSign Class 3 Public Primary Certification Authority - G5",
+ /*.cbEncoded =*/ 0x4d7,
+ /*.Sha1Fingerprint =*/ true,
+ /*.Sha512Fingerprint =*/ true,
+ /*.abSha1 =*/
+ {
+ 0x4e, 0xb6, 0xd5, 0x78, 0x49, 0x9b, 0x1c, 0xcf, 0x5f, 0x58,
+ 0x1e, 0xad, 0x56, 0xbe, 0x3d, 0x9b, 0x67, 0x44, 0xa5, 0xe5
+ },
+ /*.abSha512 =*/
+ {
+ 0xd4, 0xf8, 0x10, 0x54, 0x72, 0x77, 0x0a, 0x2d,
+ 0xe3, 0x17, 0xb3, 0xcf, 0xed, 0x61, 0xae, 0x5c,
+ 0x5d, 0x3e, 0xde, 0xa1, 0x41, 0x35, 0xb2, 0xdf,
+ 0x60, 0xe2, 0x61, 0xfe, 0x3a, 0xc1, 0x66, 0xa3,
+ 0x3c, 0x88, 0x54, 0x04, 0x4f, 0x1d, 0x13, 0x46,
+ 0xe3, 0x8c, 0x06, 0x92, 0x9d, 0x70, 0x54, 0xc3,
+ 0x44, 0xeb, 0x2c, 0x74, 0x25, 0x9e, 0x5d, 0xfb,
+ 0xd2, 0x6b, 0xa8, 0x9a, 0xf0, 0xb3, 0x6a, 0x01
+ },
+ /*.pvUser */ &UINetworkReplyPrivateThread::s_CertInfoPcaCls3Gen5
+ },
+};
+
+
+/** The certificate file name (no path). */
+/* static */ const QString UINetworkReplyPrivateThread::s_strCertificateFileName = QString("vbox-ssl-cacertificate.crt");
+
UINetworkReplyPrivateThread::UINetworkReplyPrivateThread(const QNetworkRequest &request)
: m_request(request)
, m_iError(VINF_SUCCESS)
- , m_pHttp(0)
+ , m_hHttp(NIL_RTHTTP)
{
}
void UINetworkReplyPrivateThread::abort()
{
/* Call for abort: */
- abort(m_pHttp);
+ if (m_hHttp != NIL_RTHTTP)
+ RTHttpAbort(m_hHttp);
}
int UINetworkReplyPrivateThread::applyProxyRules()
{
+ /* Set thread context: */
+ m_strContext = tr("During proxy configuration");
+
/* Make sure proxy is enabled in Proxy Manager: */
UIProxyManager proxyManager(vboxGlobal().settings().proxySettings());
if (!proxyManager.proxyEnabled())
return VINF_SUCCESS;
/* Apply proxy rules: */
- return applyProxyRules(m_pHttp,
+ return applyProxyRules(m_hHttp,
proxyManager.proxyHost(),
proxyManager.proxyPort().toUInt());
}
int UINetworkReplyPrivateThread::applyHttpsCertificates()
{
- /* Prepare variables: */
- const QString strFullCertificateFileName(fullCertificateFileName());
- int rc = VINF_SUCCESS;
+ /* Set thread context: */
+ m_strContext = tr("During certificate downloading");
- /* Check certificates if present: */
- if (QFile::exists(strFullCertificateFileName))
- rc = checkCertificates(m_pHttp, strFullCertificateFileName);
- else
- rc = VERR_FILE_NOT_FOUND;
-
- /* Download certificates if necessary: */
- if (!RT_SUCCESS(rc))
- rc = downloadCertificates(m_pHttp, strFullCertificateFileName);
-
- /* Apply certificates: */
+ /*
+ * Calc the filename of the CA certificate file.
+ */
+ const QString strFullCertificateFileName(fullCertificateFileName());
+ QByteArray utf8FullCertificateFileName = strFullCertificateFileName.toUtf8();
+ const char *pszCaCertFile = utf8FullCertificateFileName.constData();
+
+ /*
+ * Check the state of our CA certificate file, it's one of the following:
+ * - Missing, recreate from scratch (= refresh).
+ * - Everything is there and it is less than 28 days old, do nothing.
+ * - Everything is there but it's older than 28 days, refresh.
+ * - Missing certificates and is older than 1 min, refresh.
+ *
+ * Start by creating a store for loading the current state into, as we'll
+ * be need that for the refresh.
+ */
+ RTCRSTORE hCurStore = NIL_RTCRSTORE;
+ int rc = RTCrStoreCreateInMem(&hCurStore, 256);
if (RT_SUCCESS(rc))
- rc = applyCertificates(m_pHttp, strFullCertificateFileName);
+ {
+ bool fRefresh = true;
+ bool afCertsFound[RT_ELEMENTS(s_aCerts)];
+ RT_ZERO(afCertsFound);
+
+ /*
+ * Load the file if it exists.
+ *
+ * To effect regular updates, we need the modification date of the file,
+ * so we use RTPathQueryInfoEx here and not RTFileExists.
+ */
+ RTFSOBJINFO Info;
+ int rc = RTPathQueryInfoEx(pszCaCertFile, &Info, RTFSOBJATTRADD_NOTHING, RTPATH_F_FOLLOW_LINK);
+ if ( RT_SUCCESS(rc)
+ && RTFS_IS_FILE(Info.Attr.fMode))
+ {
+ RTERRINFOSTATIC StaticErrInfo;
+ rc = RTCrStoreCertAddFromFile(hCurStore, RTCRCERTCTX_F_ADD_CONTINUE_ON_ERROR, pszCaCertFile,
+ RTErrInfoInitStatic(&StaticErrInfo));
+ if (RTErrInfoIsSet(&StaticErrInfo.Core))
+ LogRel(("checkCertificates: %s\n", StaticErrInfo.Core.pszMsg));
+ else
+ AssertRC(rc);
+
+ /*
+ * Scan the store the for certificates we need, then see what we
+ * need to do wrt file age.
+ */
+ rc = RTCrStoreCertCheckWanted(hCurStore, s_aCerts, RT_ELEMENTS(s_aCerts), afCertsFound);
+ rc = adjustCertsFound(rc, afCertsFound);
+ AssertRC(rc);
+ RTTIMESPEC RefreshAge;
+ uint32_t cSecRefresh = rc == VINF_SUCCESS ? 28 * RT_SEC_1DAY /* all found */ : 60 /* stuff missing */;
+ fRefresh = RTTimeSpecCompare(&Info.ModificationTime, RTTimeSpecSubSeconds(RTTimeNow(&RefreshAge), cSecRefresh)) <= 0;
+ }
- /* Return result-code: */
+ /*
+ * Refresh the file if necessary.
+ */
+ if (fRefresh)
+ refreshCertificates(m_hHttp, hCurStore, afCertsFound, pszCaCertFile);
+
+ RTCrStoreRelease(hCurStore);
+
+ /*
+ * Final verdict.
+ */
+ if (areAllCertsFound(afCertsFound, true /*fOnlyMandatory*/))
+ rc = VINF_SUCCESS;
+ else
+ rc = VERR_NOT_FOUND; /** @todo r=bird: Why not try and let RTHttpGet* bitch if the necessary certs are missing? */
+
+ /*
+ * Set our custom CA file.
+ */
+ if (RT_SUCCESS(rc))
+ rc = RTHttpSetCAFile(m_hHttp, pszCaCertFile);
+ }
return rc;
}
int UINetworkReplyPrivateThread::applyRawHeaders()
{
+ /* Set thread context: */
+ m_strContext = tr("During network request");
+
/* Make sure we have a raw headers at all: */
QList<QByteArray> headers = m_request.rawHeaderList();
if (headers.isEmpty())
return VINF_SUCCESS;
/* Apply raw headers: */
- return applyRawHeaders(m_pHttp, headers, m_request);
+ return applyRawHeaders(m_hHttp, headers, m_request);
}
int UINetworkReplyPrivateThread::performMainRequest()
{
- /* Perform GET request: */
- return performGetRequestForText(m_pHttp, m_request, m_reply);
+ /* Set thread context: */
+ m_strContext = tr("During network request");
+
+ /* Paranoia: */
+ m_reply.clear();
+
+ /* Perform blocking HTTP GET request: */
+ char *pszResponse;
+ /** @todo r=bird: Use RTHttpGetBinary? */
+ int rc = RTHttpGetText(m_hHttp, m_request.url().toString().toUtf8().constData(), &pszResponse);
+ if (RT_SUCCESS(rc))
+ {
+ m_reply = QByteArray(pszResponse);
+ RTHttpFreeResponseText(pszResponse);
+ }
+
+ return rc;
}
void UINetworkReplyPrivateThread::run()
{
/* Init: */
- RTR3InitExeNoArguments(RTR3INIT_FLAGS_SUPLIB);
+ RTR3InitExeNoArguments(RTR3INIT_FLAGS_SUPLIB); /** @todo r=bird: WTF? */
/* Create HTTP object: */
if (RT_SUCCESS(m_iError))
- m_iError = RTHttpCreate(&m_pHttp);
+ m_iError = RTHttpCreate(&m_hHttp);
/* Apply proxy-rules: */
if (RT_SUCCESS(m_iError))
@@ -195,11 +434,13 @@ void UINetworkReplyPrivateThread::run()
if (RT_SUCCESS(m_iError))
m_iError = performMainRequest();
- /* Destroy HTTP object: */
- if (m_pHttp)
+ /* Destroy HTTP client instance: */
+ RTHTTP hHttp = m_hHttp;
+ if (hHttp != NIL_RTHTTP)
{
- RTHttpDestroy(m_pHttp);
- m_pHttp = 0;
+ /** @todo r=bird: There is a race here between this and abort()! */
+ m_hHttp = NIL_RTHTTP;
+ RTHttpDestroy(hHttp);
}
}
@@ -207,51 +448,29 @@ void UINetworkReplyPrivateThread::run()
QString UINetworkReplyPrivateThread::fullCertificateFileName()
{
const QDir homeDir(QDir::toNativeSeparators(vboxGlobal().homeFolder()));
- return QDir::toNativeSeparators(homeDir.absoluteFilePath(m_strCertificateFileName));
+ return QDir::toNativeSeparators(homeDir.absoluteFilePath(s_strCertificateFileName));
}
/* static */
-int UINetworkReplyPrivateThread::abort(RTHTTP pHttp)
+int UINetworkReplyPrivateThread::applyProxyRules(RTHTTP hHttp, const QString &strHostName, int iPort)
{
/* Make sure HTTP is created: */
- if (!pHttp)
- return VERR_INVALID_POINTER;
-
- /* Call for HTTP abort: */
- return RTHttpAbort(pHttp);
-}
-
-/* static */
-int UINetworkReplyPrivateThread::applyProxyRules(RTHTTP pHttp, const QString &strHostName, int iPort)
-{
- /* Make sure HTTP is created: */
- if (!pHttp)
- return VERR_INVALID_POINTER;
+ if (hHttp == NIL_RTHTTP)
+ return VERR_INVALID_HANDLE;
/* Apply HTTP proxy: */
- return RTHttpSetProxy(pHttp,
+ return RTHttpSetProxy(hHttp,
strHostName.toAscii().constData(),
iPort,
0 /* login */, 0 /* password */);
}
/* static */
-int UINetworkReplyPrivateThread::applyCertificates(RTHTTP pHttp, const QString &strFullCertificateFileName)
-{
- /* Make sure HTTP is created: */
- if (!pHttp)
- return VERR_INVALID_POINTER;
-
- /* Apply HTTPs certificates: */
- return RTHttpSetCAFile(pHttp, strFullCertificateFileName.toUtf8().constData());
-}
-
-/* static */
-int UINetworkReplyPrivateThread::applyRawHeaders(RTHTTP pHttp, const QList<QByteArray> &headers, const QNetworkRequest &request)
+int UINetworkReplyPrivateThread::applyRawHeaders(RTHTTP hHttp, const QList<QByteArray> &headers, const QNetworkRequest &request)
{
/* Make sure HTTP is created: */
- if (!pHttp)
- return VERR_INVALID_POINTER;
+ if (hHttp == NIL_RTHTTP)
+ return VERR_INVALID_HANDLE;
/* We should format them first: */
QVector<QByteArray> formattedHeaders;
@@ -266,335 +485,334 @@ int UINetworkReplyPrivateThread::applyRawHeaders(RTHTTP pHttp, const QList<QByte
const char **ppFormattedHeaders = formattedHeaderPointers.data();
/* Apply HTTP headers: */
- return RTHttpSetHeaders(pHttp, formattedHeaderPointers.size(), ppFormattedHeaders);
+ return RTHttpSetHeaders(hHttp, formattedHeaderPointers.size(), ppFormattedHeaders);
}
-/* static */
-int UINetworkReplyPrivateThread::performGetRequestForText(RTHTTP pHttp, const QNetworkRequest &request, QByteArray &reply)
+/**
+ * Adjusts the set of found certificates by marking all alternatives found if
+ * one is.
+ *
+ * @returns Adjusted rc (VINF_SUCCESS instead of VWRN_NOT_FOUND if all found).
+ * @param rc The status code.
+ * @param pafFoundCerts Array parallel to s_aCerts with the status of
+ * each wanted certificate.
+ */
+/*static*/ int
+UINetworkReplyPrivateThread::adjustCertsFound(int rc, bool *pafFoundCerts)
{
- /* Make sure HTTP is created: */
- if (!pHttp)
- return VERR_INVALID_POINTER;
+ for (uint32_t i = 0; i < RT_ELEMENTS(s_aCerts); i++)
+ if (pafFoundCerts[i])
+ {
+ uint8_t iAlt = i;
+ for (;;)
+ {
+ const CERTINFO *pCertInfo = (const CERTINFO *)s_aCerts[iAlt].pvUser;
+ iAlt = pCertInfo->iAlternativeTo;
+ if (iAlt >= RT_ELEMENTS(s_aCerts) || iAlt == i)
+ {
+ Assert(iAlt == UINT8_MAX || iAlt < RT_ELEMENTS(s_aCerts));
+ break;
+ }
+ if (!pafFoundCerts[iAlt])
+ pafFoundCerts[iAlt] = true;
+ }
+ }
- /* Perform blocking HTTP GET request: */
- char *pszBuffer = 0;
- int rc = RTHttpGetText(pHttp,
- request.url().toString().toAscii().constData(),
- &pszBuffer);
- reply = QByteArray(pszBuffer);
- RTMemFree(pszBuffer);
+ if (rc == VINF_SUCCESS || rc == VWRN_NOT_FOUND)
+ rc = countCertsFound(pafFoundCerts) == RT_ELEMENTS(s_aCerts) ? VINF_SUCCESS : VWRN_NOT_FOUND;
return rc;
}
-/* static */
-int UINetworkReplyPrivateThread::performGetRequestForBinary(RTHTTP pHttp, const QNetworkRequest &request, QByteArray &reply)
+/**
+ * Counts the number of certificates found in a search result array.
+ *
+ * @returns Number of wanted certifcates we've found.
+ * @param pafFoundCerts Array parallel to s_aCerts with the status of
+ * each wanted certificate.
+ */
+/*static*/ unsigned
+UINetworkReplyPrivateThread::countCertsFound(bool const *pafFoundCerts)
{
- /* Make sure HTTP is created: */
- if (!pHttp)
- return VERR_INVALID_POINTER;
-
- /* Perform blocking HTTP GET request: */
- void *pBuffer = 0;
- size_t size = 0;
- int rc = RTHttpGetBinary(pHttp,
- request.url().toString().toAscii().constData(),
- &pBuffer, &size);
- reply = QByteArray((const char*)pBuffer, (int)size);
- RTMemFree(pBuffer);
- return rc;
+ unsigned cFound = 0;
+ for (uint32_t i = 0; i < RT_ELEMENTS(s_aCerts); i++)
+ cFound += pafFoundCerts[i];
+ return cFound;
}
-/* static */
-int UINetworkReplyPrivateThread::checkCertificates(RTHTTP pHttp, const QString &strFullCertificateFileName)
+/**
+ * Checks if we've found all the necessary certificates or not.
+ *
+ * @returns true if we have, false if we haven't.
+ * @param pafFoundCerts Array parallel to s_aCerts with the status of
+ * each wanted certificate.
+ * @param fOnlyMandatory Only require mandatory certificates to be
+ * present. If false, all certificates must be
+ * found before we return true.
+ */
+/*static*/ bool
+UINetworkReplyPrivateThread::areAllCertsFound(bool const *pafFoundCerts, bool fOnlyMandatory)
{
- /* Open certificates file: */
- QFile file(strFullCertificateFileName);
- bool fFileOpened = file.open(QIODevice::ReadOnly);
- int rc = fFileOpened ? VINF_SUCCESS : VERR_OPEN_FAILED;
-
- /* Read certificates file: */
- if (RT_SUCCESS(rc))
+ if (fOnlyMandatory)
{
- /* Parse the file content: */
- QString strData(file.readAll());
-#define CERT "-{5}BEGIN CERTIFICATE-{5}[\\s\\S\\r{0,1}\\n]+-{5}END CERTIFICATE-{5}"
-#define REOLD "(" CERT ")\\r{0,1}\\n(" CERT ")\\r{0,1}\\n(" CERT ")"
-#define RENEW "(" CERT ")\\r{0,1}\\n(" CERT ")"
- /* First check if we have the old format with three certificates: */
- QRegExp regExp(REOLD);
- regExp.setMinimal(true);
-
- /* If so, fake an error to force re-downloading */
- if (regExp.indexIn(strData) != -1)
- rc = VERR_HTTP_CACERT_WRONG_FORMAT;
-
- /* Otherwise, check for two certificates: */
- if (RT_SUCCESS(rc))
- {
- regExp.setPattern(RENEW);
- regExp.setMinimal(true);
- if (regExp.indexIn(strData) == -1)
- rc = VERR_FILE_IO_ERROR;
- }
-
- /* Verify certificates: */
- if (RT_SUCCESS(rc))
- {
- QByteArray certificate = regExp.cap(1).toAscii();
- rc = verifyCertificatePca3G5(pHttp, certificate);
- }
- if (RT_SUCCESS(rc))
- {
- QByteArray certificate = regExp.cap(2).toAscii();
- rc = verifyCertificatePca3(pHttp, certificate);
- }
-#undef CERT
-#undef REOLD
-#undef RENEW
+ for (uint32_t i = 0; i < RT_ELEMENTS(s_aCerts); i++)
+ if ( !pafFoundCerts[i]
+ && ((const CERTINFO *)s_aCerts[i].pvUser)->fMandatory)
+ return false;
}
-
- /* Close certificates file: */
- if (fFileOpened)
- file.close();
-
- /* Return result-code: */
- return rc;
+ else
+ for (uint32_t i = 0; i < RT_ELEMENTS(s_aCerts); i++)
+ if (!pafFoundCerts[i])
+ return false;
+ return true;
}
-/* static */
-int UINetworkReplyPrivateThread::decompressCertificate(const QByteArray &package, QByteArray &certificate, const QString &strName)
+/*static*/ void
+UINetworkReplyPrivateThread::refreshCertificates(RTHTTP hHttp, RTCRSTORE hOldStore, bool *pafOldFoundCerts,
+ const char *pszCaCertFile)
{
- /* Decompress certificate: */
- void *pDecompressedBuffer;
- size_t cDecompressedSize;
- int rc = RTZipPkzipMemDecompress(&pDecompressedBuffer, &cDecompressedSize, package, package.size(), strName.toLatin1().constData());
+ /*
+ * Collect the standard assortment of SSL certificates.
+ */
+ uint32_t cHint = RTCrStoreCertCount(hOldStore);
+ RTCRSTORE hNewStore;
+ int rc = RTCrStoreCreateInMem(&hNewStore, cHint > 32 && cHint < _32K ? cHint + 16 : 256);
if (RT_SUCCESS(rc))
{
- /* Copy certificate: */
- certificate = QByteArray((const char*)pDecompressedBuffer, (int)cDecompressedSize);
- /* Free decompressed buffer: */
- RTMemFree(pDecompressedBuffer);
+ RTERRINFOSTATIC StaticErrInfo;
+ rc = RTHttpGatherCaCertsInStore(hNewStore, 0 /*fFlags*/, RTErrInfoInitStatic(&StaticErrInfo));
+ if (RTErrInfoIsSet(&StaticErrInfo.Core))
+ LogRel(("refreshCertificates/#1: %s\n", StaticErrInfo.Core.pszMsg));
+ else if (rc == VERR_NOT_FOUND)
+ LogRel(("refreshCertificates/#1: No trusted SSL certs found on the system, will try download...\n"));
+ else
+ AssertLogRelRC(rc);
+ if (RT_SUCCESS(rc) || rc == VERR_NOT_FOUND)
+ {
+ /*
+ * Check and see what we've got. If we haven't got all we desire,
+ * try add it from the previous store.
+ */
+ bool afNewFoundCerts[RT_ELEMENTS(s_aCerts)];
+ RT_ZERO(afNewFoundCerts); /* paranoia */
+
+ rc = RTCrStoreCertCheckWanted(hNewStore, s_aCerts, RT_ELEMENTS(s_aCerts), afNewFoundCerts);
+ rc = adjustCertsFound(rc, afNewFoundCerts);
+ AssertLogRelRC(rc);
+ Assert(rc != VINF_SUCCESS || areAllCertsFound(afNewFoundCerts, false /*fOnlyMandatory*/));
+ if (rc != VINF_SUCCESS)
+ {
+ rc = RTCrStoreCertAddWantedFromStore(hNewStore,
+ RTCRCERTCTX_F_ADD_IF_NOT_FOUND | RTCRCERTCTX_F_ADD_CONTINUE_ON_ERROR,
+ hOldStore, s_aCerts, RT_ELEMENTS(s_aCerts), afNewFoundCerts);
+ rc = adjustCertsFound(rc, afNewFoundCerts);
+ AssertLogRelRC(rc);
+ Assert(rc != VINF_SUCCESS || areAllCertsFound(afNewFoundCerts, false /*fOnlyMandatory*/));
+ }
+
+ /*
+ * If that didn't help, seek out certificates in more obscure places,
+ * like java, mozilla and mutt.
+ */
+ if (rc != VINF_SUCCESS)
+ {
+ rc = RTCrStoreCertAddWantedFromFishingExpedition(hNewStore,
+ RTCRCERTCTX_F_ADD_IF_NOT_FOUND
+ | RTCRCERTCTX_F_ADD_CONTINUE_ON_ERROR,
+ s_aCerts, RT_ELEMENTS(s_aCerts), afNewFoundCerts,
+ RTErrInfoInitStatic(&StaticErrInfo));
+ rc = adjustCertsFound(rc, afNewFoundCerts);
+ if (RTErrInfoIsSet(&StaticErrInfo.Core))
+ LogRel(("refreshCertificates/#2: %s\n", StaticErrInfo.Core.pszMsg));
+ Assert(rc != VINF_SUCCESS || areAllCertsFound(afNewFoundCerts, false /*fOnlyMandatory*/));
+ }
+
+ /*
+ * If that didn't help, try download the certificates.
+ */
+ if (rc != VINF_SUCCESS)
+ downloadMissingCertificates(hNewStore, afNewFoundCerts, hHttp, &StaticErrInfo);
+
+ /*
+ * If we've got the same or better hit rate than the old store,
+ * replace the CA certs file.
+ */
+ if ( areAllCertsFound(afNewFoundCerts, false /*fOnlyMandatory*/)
+ || ( countCertsFound(afNewFoundCerts) >= countCertsFound(pafOldFoundCerts)
+ && areAllCertsFound(afNewFoundCerts, true /*fOnlyMandatory*/)
+ >= areAllCertsFound(pafOldFoundCerts, true /*fOnlyMandatory*/) ) )
+ {
+ rc = RTCrStoreCertExportAsPem(hNewStore, 0 /*fFlags*/, pszCaCertFile);
+ if (RT_SUCCESS(rc))
+ {
+ memcpy(pafOldFoundCerts, afNewFoundCerts, sizeof(afNewFoundCerts));
+ LogRel(("refreshCertificates/#3: Found %u/%u SSL certs we/you trust (previously %u/%u).\n",
+ countCertsFound(afNewFoundCerts), RTCrStoreCertCount(hNewStore),
+ countCertsFound(pafOldFoundCerts), RTCrStoreCertCount(hOldStore) ));
+ }
+ else
+ {
+ RT_ZERO(pafOldFoundCerts);
+ LogRel(("refreshCertificates/#3: RTCrStoreCertExportAsPem unexpectedly failed with %Rrc\n", rc));
+ }
+ }
+ else
+ LogRel(("refreshCertificates/#3: Sticking with the old file, missing essential certs.\n"));
+ }
+ RTCrStoreRelease(hNewStore);
}
- /* Return result: */
- return rc;
}
-/* static */
-int UINetworkReplyPrivateThread::downloadCertificates(RTHTTP pHttp, const QString &strFullCertificateFileName)
+/*static*/ void
+UINetworkReplyPrivateThread::downloadMissingCertificates(RTCRSTORE hNewStore, bool *pafNewFoundCerts, RTHTTP hHttp,
+ PRTERRINFOSTATIC pStaticErrInfo)
{
- /* Prepare certificates: */
- QByteArray certificatePca3G5;
- QByteArray certificatePca3;
-
- /* Receive certificate package: */
- QByteArray package;
- const QNetworkRequest address(QUrl("http://www.verisign.com/support/roots.zip"));
- int rc = performGetRequestForBinary(pHttp, address, package);
- /* UnZIP PCA-3G5 certificate: */
- if (RT_SUCCESS(rc))
- {
- rc = decompressCertificate(package, certificatePca3G5,
- "VeriSign Root Certificates/Generation 5 (G5) PCA/VeriSign Class 3 Public Primary Certification Authority - G5.pem");
- /* Verify PCA-3G5 certificate: */
- if (RT_SUCCESS(rc))
- rc = verifyCertificatePca3G5(pHttp, certificatePca3G5);
- }
- /* UnZIP PCA-3 certificate: */
- if (RT_SUCCESS(rc))
- {
- rc = decompressCertificate(package, certificatePca3,
- "VeriSign Root Certificates/Generation 1 (G1) PCAs/Class 3 Public Primary Certification Authority.pem");
- /* Verify PCA-3 certificate: */
- if (RT_SUCCESS(rc))
- rc = verifyCertificatePca3(pHttp, certificatePca3);
- }
+ int rc;
- /* Fallback.. download certificates separately: */
- if (!RT_SUCCESS(rc))
+ /*
+ * Try get the roots.zip from symantec (or virtualbox.org) first.
+ */
+ static const char * const a_apszRootsZipUrls[] =
{
- /* Reset result: */
- rc = VINF_SUCCESS;
- /* Download PCA-3G5 certificate: */
- if (RT_SUCCESS(rc))
- rc = downloadCertificatePca3G5(pHttp, certificatePca3G5);
- /* Download PCA-3 certificate: */
+ "http://www.symantec.com/content/en/us/enterprise/verisign/roots/roots.zip",
+ "http://update.virtualbox.org/cacerts-symantec-roots-zip-has-gone-missing-again" /* Just to try grab our attention. */
+ };
+ for (uint32_t iUrl = 0; iUrl < RT_ELEMENTS(a_apszRootsZipUrls); iUrl++)
+ {
+ void *pvRootsZip;
+ size_t cbRootsZip;
+ rc = RTHttpGetBinary(hHttp, a_apszRootsZipUrls[iUrl], &pvRootsZip, &cbRootsZip);
if (RT_SUCCESS(rc))
- rc = downloadCertificatePca3(pHttp, certificatePca3);
+ {
+ for (uint32_t i = 0; i < RT_ELEMENTS(s_aCerts); i++)
+ if (!pafNewFoundCerts[i])
+ {
+ CERTINFO const *pInfo = (CERTINFO const *)s_aCerts[i].pvUser;
+ if (pInfo->pszZipFile)
+ {
+ void *pvFile;
+ size_t cbFile;
+ rc = RTZipPkzipMemDecompress(&pvFile, &cbFile, pvRootsZip, cbRootsZip, pInfo->pszZipFile);
+ if (RT_SUCCESS(rc))
+ {
+ rc = convertVerifyAndAddPemCertificateToStore(hNewStore, pvFile, cbFile, &s_aCerts[i]);
+ RTMemFree(pvFile);
+ if (RT_SUCCESS(rc))
+ {
+ /*
+ * Successfully added. Mark it as found and return if we've got them all.
+ */
+ pafNewFoundCerts[i] = true;
+ if (adjustCertsFound(VWRN_NOT_FOUND, pafNewFoundCerts) == VINF_SUCCESS)
+ {
+ RTHttpFreeResponse(pvRootsZip);
+ return;
+ }
+ }
+ }
+ }
+ }
+ RTHttpFreeResponse(pvRootsZip);
+ }
}
- /* Save certificates: */
- if (RT_SUCCESS(rc))
- saveCertificates(strFullCertificateFileName, certificatePca3G5, certificatePca3);
-
- /* Return result-code: */
- return rc;
-}
-
-/* static */
-int UINetworkReplyPrivateThread::downloadCertificatePca3G5(RTHTTP pHttp, QByteArray &certificate)
-{
- /* Receive certificate: */
- const QNetworkRequest address(QUrl("http://www.verisign.com/repository/roots/root-certificates/PCA-3G5.pem"));
- int rc = performGetRequestForText(pHttp, address, certificate);
-
- /* Verify certificate: */
- if (RT_SUCCESS(rc))
- rc = verifyCertificatePca3G5(pHttp, certificate);
-
- /* Return result-code: */
- return rc;
+ /*
+ * Try download certificates separately.
+ */
+ for (uint32_t i = 0; i < RT_ELEMENTS(s_aCerts); i++)
+ if (!pafNewFoundCerts[i])
+ {
+ CERTINFO const *pInfo = (CERTINFO const *)s_aCerts[i].pvUser;
+ for (uint32_t iUrl = 0; iUrl < RT_ELEMENTS(pInfo->apszUrls); i++)
+ if (pInfo->apszUrls[iUrl])
+ {
+ void *pvResponse;
+ size_t cbResponse;
+ rc = RTHttpGetBinary(hHttp, pInfo->apszUrls[iUrl], &pvResponse, &cbResponse);
+ if (RT_SUCCESS(rc))
+ {
+ rc = convertVerifyAndAddPemCertificateToStore(hNewStore, pvResponse, cbResponse, &s_aCerts[i]);
+ RTHttpFreeResponse(pvResponse);
+ if (RT_SUCCESS(rc))
+ {
+ pafNewFoundCerts[i] = true;
+ adjustCertsFound(VWRN_NOT_FOUND, pafNewFoundCerts);
+ break;
+ }
+ }
+ }
+ }
}
-/* static */
-int UINetworkReplyPrivateThread::downloadCertificatePca3(RTHTTP pHttp, QByteArray &certificate)
+/**
+ * Converts a PEM certificate, verifies it against @a pCertInfo and adds it to
+ * the given store.
+ *
+ * @returns IPRT status code.
+ * @param hStore The store to add it to.
+ * @param pvResponse The raw PEM certificate file bytes.
+ * @param cbResponse The number of bytes.
+ * @param pWantedCert The certificate info (we use hashes and encoded
+ * size).
+ */
+/*static*/ int
+UINetworkReplyPrivateThread::convertVerifyAndAddPemCertificateToStore(RTCRSTORE hStore,
+ void const *pvResponse, size_t cbResponse,
+ PCRTCRCERTWANTED pWantedCert)
{
- /* Receive certificate: */
- const QNetworkRequest address(QUrl("http://www.verisign.com/repository/roots/root-certificates/PCA-3.pem"));
- int rc = performGetRequestForText(pHttp, address, certificate);
-
- /* Verify certificate: */
+ /*
+ * Convert the PEM certificate to its binary form so we can hash it.
+ */
+ static RTCRPEMMARKERWORD const s_aWords_Certificate[] = { { RT_STR_TUPLE("CERTIFICATE") } };
+ static RTCRPEMMARKER const s_aCertificateMarkers[] = { { s_aWords_Certificate, RT_ELEMENTS(s_aWords_Certificate) }, };
+ RTERRINFOSTATIC StaticErrInfo;
+ PCRTCRPEMSECTION pSectionHead;
+ int rc = RTCrPemParseContent(pvResponse, cbResponse, 0 /*fFlags*/,
+ &s_aCertificateMarkers[0], RT_ELEMENTS(s_aCertificateMarkers),
+ &pSectionHead, RTErrInfoInitStatic(&StaticErrInfo));
+ if (RTErrInfoIsSet(&StaticErrInfo.Core))
+ LogRel(("RTCrPemParseContent: %s\n", StaticErrInfo.Core.pszMsg));
if (RT_SUCCESS(rc))
- rc = verifyCertificatePca3(pHttp, certificate);
-
- /* Return result-code: */
- return rc;
-}
-
-/* static */
-int UINetworkReplyPrivateThread::verifyCertificatePca3G5(RTHTTP pHttp, QByteArray &certificate)
-{
- /* PCA 3G5 secure hash algorithm 1: */
- const unsigned char baSha1PCA3G5[] =
{
- 0x4e, 0xb6, 0xd5, 0x78, 0x49, 0x9b, 0x1c, 0xcf, 0x5f, 0x58,
- 0x1e, 0xad, 0x56, 0xbe, 0x3d, 0x9b, 0x67, 0x44, 0xa5, 0xe5
- };
- /* PCA 3G5 secure hash algorithm 512: */
- const unsigned char baSha512PCA3G5[] =
- {
- 0xd4, 0xf8, 0x10, 0x54, 0x72, 0x77, 0x0a, 0x2d,
- 0xe3, 0x17, 0xb3, 0xcf, 0xed, 0x61, 0xae, 0x5c,
- 0x5d, 0x3e, 0xde, 0xa1, 0x41, 0x35, 0xb2, 0xdf,
- 0x60, 0xe2, 0x61, 0xfe, 0x3a, 0xc1, 0x66, 0xa3,
- 0x3c, 0x88, 0x54, 0x04, 0x4f, 0x1d, 0x13, 0x46,
- 0xe3, 0x8c, 0x06, 0x92, 0x9d, 0x70, 0x54, 0xc3,
- 0x44, 0xeb, 0x2c, 0x74, 0x25, 0x9e, 0x5d, 0xfb,
- 0xd2, 0x6b, 0xa8, 0x9a, 0xf0, 0xb3, 0x6a, 0x01
- };
- QByteArray pca3G5sha1 = QByteArray::fromRawData((const char *)baSha1PCA3G5, sizeof(baSha1PCA3G5));
- QByteArray pca3G5sha512 = QByteArray::fromRawData((const char *)baSha512PCA3G5, sizeof(baSha512PCA3G5));
-
- /* Verify certificate: */
- return verifyCertificate(pHttp, certificate, pca3G5sha1, pca3G5sha512);
-}
-
-/* static */
-int UINetworkReplyPrivateThread::verifyCertificatePca3(RTHTTP pHttp, QByteArray &certificate)
-{
- /* PCA 3 secure hash algorithm 1: */
- const unsigned char baSha1PCA3[] =
- {
- 0xa1, 0xdb, 0x63, 0x93, 0x91, 0x6f, 0x17, 0xe4, 0x18, 0x55,
- 0x09, 0x40, 0x04, 0x15, 0xc7, 0x02, 0x40, 0xb0, 0xae, 0x6b
- };
- /* PCA 3 secure hash algorithm 512: */
- const unsigned char baSha512PCA3[] =
- {
- 0xbb, 0xf7, 0x8a, 0x19, 0x9f, 0x37, 0xee, 0xa2,
- 0xce, 0xc8, 0xaf, 0xe3, 0xd6, 0x22, 0x54, 0x20,
- 0x74, 0x67, 0x6e, 0xa5, 0x19, 0xb7, 0x62, 0x1e,
- 0xc1, 0x2f, 0xd5, 0x08, 0xf4, 0x64, 0xc4, 0xc6,
- 0xbb, 0xc2, 0xf2, 0x35, 0xe7, 0xbe, 0x32, 0x0b,
- 0xde, 0xb2, 0xfc, 0x44, 0x92, 0x5b, 0x8b, 0x9b,
- 0x77, 0xa5, 0x40, 0x22, 0x18, 0x12, 0xcb, 0x3d,
- 0x0a, 0x67, 0x83, 0x87, 0xc5, 0x45, 0xc4, 0x99
- };
- QByteArray pca3sha1 = QByteArray::fromRawData((const char *)baSha1PCA3, sizeof(baSha1PCA3));
- QByteArray pca3sha512 = QByteArray::fromRawData((const char *)baSha512PCA3, sizeof(baSha512PCA3));
-
- /* Verify certificate: */
- return verifyCertificate(pHttp, certificate, pca3sha1, pca3sha512);
-}
-
-/* static */
-int UINetworkReplyPrivateThread::verifyCertificate(RTHTTP pHttp, QByteArray &certificate, const QByteArray &sha1, const QByteArray &sha512)
-{
- /* Make sure HTTP is created: */
- if (!pHttp)
- return VERR_INVALID_POINTER;
-
- /* Create digest: */
- uint8_t *abSha1;
- size_t cbSha1;
- uint8_t *abSha512;
- size_t cbSha512;
- int rc = RTHttpCertDigest(pHttp, certificate.data(), certificate.size(),
- &abSha1, &cbSha1, &abSha512, &cbSha512);
-
- /* Verify digest: */
- if (cbSha1 != (size_t)sha1.size())
- rc = VERR_HTTP_CACERT_WRONG_FORMAT;
- else if (memcmp(sha1.constData(), abSha1, cbSha1))
- rc = VERR_HTTP_CACERT_WRONG_FORMAT;
- if (cbSha512 != (size_t)sha512.size())
- rc = VERR_HTTP_CACERT_WRONG_FORMAT;
- else if (memcmp(sha512.constData(), abSha512, cbSha512))
- rc = VERR_HTTP_CACERT_WRONG_FORMAT;
-
- /* Cleanup digest: */
- RTMemFree(abSha1);
- RTMemFree(abSha512);
-
- /* Return result-code: */
- return rc;
-}
-
-/* static */
-int UINetworkReplyPrivateThread::saveCertificates(const QString &strFullCertificateFileName,
- const QByteArray &certificatePca3G5,
- const QByteArray &certificatePca3)
-{
- /* Open certificates file: */
- QFile file(strFullCertificateFileName);
- bool fFileOpened = file.open(QIODevice::WriteOnly);
- int rc = fFileOpened ? VINF_SUCCESS : VERR_OPEN_FAILED;
-
- /* Save certificates: */
- if (RT_SUCCESS(rc))
- rc = saveCertificate(file, certificatePca3G5);
- if (RT_SUCCESS(rc))
- rc = saveCertificate(file, certificatePca3);
-
- /* Close certificates file: */
- if (fFileOpened)
- file.close();
-
- /* Return result-code: */
- return rc;
-}
-
-/* static */
-int UINetworkReplyPrivateThread::saveCertificate(QFile &file, const QByteArray &certificate)
-{
- /* Save certificate: */
- int rc = VINF_SUCCESS;
- if (RT_SUCCESS(rc))
- rc = file.write(certificate) != -1 ? VINF_SUCCESS : VERR_WRITE_ERROR;
-
- /* Add 'new-line' character: */
- if (RT_SUCCESS(rc))
-#ifdef Q_WS_WIN
- rc = file.write("\r\n") != -1 ? VINF_SUCCESS : VERR_WRITE_ERROR;
-#else /* Q_WS_WIN */
- rc = file.write("\n") != -1 ? VINF_SUCCESS : VERR_WRITE_ERROR;
-#endif /* !Q_WS_WIN */
-
- /* Return result-code: */
+ /*
+ * Look at what we got back and hash it.
+ */
+ rc = VERR_NOT_FOUND;
+ for (PCRTCRPEMSECTION pCur = pSectionHead; pCur; pCur = pCur->pNext)
+ if (pCur->cbData == pWantedCert->cbEncoded)
+ {
+ if ( RTSha1Check(pCur->pbData, pCur->cbData, pWantedCert->abSha1)
+ && RTSha512Check(pCur->pbData, pCur->cbData, pWantedCert->abSha512))
+ {
+ /*
+ * Matching, add it to the store.
+ */
+ rc = RTCrStoreCertAddEncoded(hStore,
+ RTCRCERTCTX_F_ENC_X509_DER | RTCRCERTCTX_F_ADD_IF_NOT_FOUND,
+ pCur->pbData, pCur->cbData,
+ RTErrInfoInitStatic(&StaticErrInfo));
+ if (RTErrInfoIsSet(&StaticErrInfo.Core))
+ LogRel(("RTCrStoreCertAddEncoded: %s\n", StaticErrInfo.Core.pszMsg));
+ else if (RT_FAILURE(rc))
+ LogRel(("RTCrStoreCertAddEncoded: %Rrc\n", rc));
+ if (RT_SUCCESS(rc))
+ break;
+ }
+ else
+ LogRel(("convertVerifyAndAddPemCertificateToStore: hash mismatch (cbData=%#zx)\n", pCur->cbData));
+ }
+ else
+ LogRel(("convertVerifyAndAddPemCertificateToStore: cbData=%#zx expected %#zx\n",
+ pCur->cbData, pWantedCert->cbEncoded));
+
+ RTCrPemFreeSections(pSectionHead);
+ }
return rc;
}
-/* Our network-reply object: */
+/**
+ * Our network-reply (HTTP) object.
+ */
class UINetworkReplyPrivate : public QObject
{
Q_OBJECT;
@@ -612,6 +830,8 @@ public:
: m_error(QNetworkReply::NoError)
, m_pThread(0)
{
+ /* Prepare full error template: */
+ m_strErrorTemplate = tr("%1: %2", "Context description: Error description");
/* Create and run network-reply thread: */
m_pThread = new UINetworkReplyPrivateThread(request);
connect(m_pThread, SIGNAL(finished()), this, SLOT(sltFinished()));
@@ -642,21 +862,17 @@ public:
{
switch (m_error)
{
- case QNetworkReply::NoError:
- break;
- case QNetworkReply::HostNotFoundError:
- return tr("Host not found");
- case QNetworkReply::ContentAccessDenied:
- return tr("Content access denied");
- case QNetworkReply::ProtocolFailure:
- return tr("Protocol failure");
- case QNetworkReply::AuthenticationRequiredError:
- return tr("Wrong SSL certificate format");
- case QNetworkReply::SslHandshakeFailedError:
- return tr("SSL authentication failed");
- default:
- return tr("Unknown reason");
- break;
+ case QNetworkReply::NoError: break;
+ case QNetworkReply::RemoteHostClosedError: return m_strErrorTemplate.arg(m_pThread->context(), tr("Unable to initialize HTTP library"));
+ case QNetworkReply::HostNotFoundError: return m_strErrorTemplate.arg(m_pThread->context(), tr("Host not found"));
+ case QNetworkReply::ContentAccessDenied: return m_strErrorTemplate.arg(m_pThread->context(), tr("Content access denied"));
+ case QNetworkReply::ProtocolFailure: return m_strErrorTemplate.arg(m_pThread->context(), tr("Protocol failure"));
+ case QNetworkReply::ConnectionRefusedError: return m_strErrorTemplate.arg(m_pThread->context(), tr("Connection refused"));
+ case QNetworkReply::SslHandshakeFailedError: return m_strErrorTemplate.arg(m_pThread->context(), tr("SSL authentication failed"));
+ case QNetworkReply::AuthenticationRequiredError: return m_strErrorTemplate.arg(m_pThread->context(), tr("Wrong SSL certificate format"));
+ case QNetworkReply::ContentReSendError: return m_strErrorTemplate.arg(m_pThread->context(), tr("Content moved"));
+ case QNetworkReply::ProxyNotFoundError: return m_strErrorTemplate.arg(m_pThread->context(), tr("Proxy not found"));
+ default: return m_strErrorTemplate.arg(m_pThread->context(), tr("Unknown reason"));
}
return QString();
}
@@ -671,36 +887,28 @@ private slots:
{
switch (m_pThread->error())
{
- case VINF_SUCCESS:
- m_error = QNetworkReply::NoError;
- break;
- case VERR_HTTP_ABORTED:
- m_error = QNetworkReply::OperationCanceledError;
- break;
- case VERR_HTTP_NOT_FOUND:
- m_error = QNetworkReply::HostNotFoundError;
- break;
- case VERR_HTTP_ACCESS_DENIED:
- m_error = QNetworkReply::ContentAccessDenied;
- break;
- case VERR_HTTP_BAD_REQUEST:
- m_error = QNetworkReply::ProtocolFailure;
- break;
- case VERR_HTTP_CACERT_WRONG_FORMAT:
- m_error = QNetworkReply::AuthenticationRequiredError;
- break;
- case VERR_HTTP_CACERT_CANNOT_AUTHENTICATE:
- m_error = QNetworkReply::SslHandshakeFailedError;
- break;
- default:
- m_error = QNetworkReply::UnknownNetworkError;
- break;
+ case VINF_SUCCESS: m_error = QNetworkReply::NoError; break;
+ case VERR_HTTP_INIT_FAILED: m_error = QNetworkReply::RemoteHostClosedError; break;
+ case VERR_HTTP_NOT_FOUND: m_error = QNetworkReply::HostNotFoundError; break;
+ case VERR_HTTP_ACCESS_DENIED: m_error = QNetworkReply::ContentAccessDenied; break;
+ case VERR_HTTP_BAD_REQUEST: m_error = QNetworkReply::ProtocolFailure; break;
+ case VERR_HTTP_COULDNT_CONNECT: m_error = QNetworkReply::ConnectionRefusedError; break;
+ case VERR_HTTP_SSL_CONNECT_ERROR: m_error = QNetworkReply::SslHandshakeFailedError; break;
+ case VERR_HTTP_CACERT_WRONG_FORMAT: m_error = QNetworkReply::AuthenticationRequiredError; break;
+ case VERR_HTTP_CACERT_CANNOT_AUTHENTICATE: m_error = QNetworkReply::AuthenticationRequiredError; break;
+ case VERR_HTTP_ABORTED: m_error = QNetworkReply::OperationCanceledError; break;
+ case VERR_HTTP_REDIRECTED: m_error = QNetworkReply::ContentReSendError; break;
+ case VERR_HTTP_PROXY_NOT_FOUND: m_error = QNetworkReply::ProxyNotFoundError; break;
+ default: m_error = QNetworkReply::UnknownNetworkError; break;
}
emit finished();
}
private:
+ /** Holds full error template in "Context description: Error description" form. */
+ QString m_strErrorTemplate;
+
/* Variables: */
QNetworkReply::NetworkError m_error;
UINetworkReplyPrivateThread *m_pThread;
diff --git a/src/VBox/Frontends/VirtualBox/src/net/UINetworkRequestWidget.cpp b/src/VBox/Frontends/VirtualBox/src/net/UINetworkRequestWidget.cpp
index e412f2c..3de2ef3 100644
--- a/src/VBox/Frontends/VirtualBox/src/net/UINetworkRequestWidget.cpp
+++ b/src/VBox/Frontends/VirtualBox/src/net/UINetworkRequestWidget.cpp
@@ -179,6 +179,10 @@ void UINetworkRequestWidget::sltSetProgressToFailed(const QString &strError)
for (int i = 0; i < links.size(); ++i)
strErrorText = strErrorText.arg(QString("<b>%1</b>").arg(links[i]));
+ // @todo: NLS: Embed <br> directly into error header text.
+ /* Prepend the error-message with <br> symbol: */
+ strErrorText.prepend("<br>");
+
/* Show error label: */
m_pErrorPane->setHidden(false);
m_pErrorPane->setText(UINetworkManagerDialog::tr("The network operation failed with the following error: %1.").arg(strErrorText));
diff --git a/src/VBox/Frontends/VirtualBox/src/platform/darwin/DarwinKeyboard.cpp b/src/VBox/Frontends/VirtualBox/src/platform/darwin/DarwinKeyboard.cpp
index 437e981..5f5fac9 100644
--- a/src/VBox/Frontends/VirtualBox/src/platform/darwin/DarwinKeyboard.cpp
+++ b/src/VBox/Frontends/VirtualBox/src/platform/darwin/DarwinKeyboard.cpp
@@ -17,9 +17,10 @@
* hope that it will be useful, but WITHOUT ANY WARRANTY of any kind.
*/
-/*******************************************************************************
-* Header Files *
-*******************************************************************************/
+
+/*********************************************************************************************************************************
+* Header Files *
+*********************************************************************************************************************************/
#define LOG_GROUP LOG_GROUP_GUI
#define VBOX_WITH_KBD_LEDS_SYNC
@@ -79,9 +80,9 @@ extern CGError CGSSetGlobalHotKeyOperatingMode(CGSConnection Connection, CGSGlob
RT_C_DECLS_END
-/*******************************************************************************
-* Defined Constants And Macros *
-*******************************************************************************/
+/*********************************************************************************************************************************
+* Defined Constants And Macros *
+*********************************************************************************************************************************/
#define QZ_RMETA 0x36
#define QZ_LMETA 0x37
@@ -113,9 +114,10 @@ RT_C_DECLS_END
#endif
-/*******************************************************************************
-* Global Variables *
-*******************************************************************************/
+
+/*********************************************************************************************************************************
+* Global Variables *
+*********************************************************************************************************************************/
/**
* This is derived partially from SDL_QuartzKeys.h and partially from testing.
*
@@ -352,9 +354,10 @@ typedef struct VBoxHidsState_t {
} VBoxHidsState_t;
#endif /* !VBOX_WITH_KBD_LEDS_SYNC */
-/*******************************************************************************
-* Internal Functions *
-*******************************************************************************/
+
+/*********************************************************************************************************************************
+* Internal Functions *
+*********************************************************************************************************************************/
#ifdef USE_HID_FOR_MODIFIERS
static void darwinBruteForcePropertySearch(CFDictionaryRef DictRef, struct KeyboardCacheData *pKeyboardEntry);
#endif
diff --git a/src/VBox/Frontends/VirtualBox/src/platform/darwin/tstDarwinKeyboard.cpp b/src/VBox/Frontends/VirtualBox/src/platform/darwin/tstDarwinKeyboard.cpp
index 3e13284..21da3d0 100644
--- a/src/VBox/Frontends/VirtualBox/src/platform/darwin/tstDarwinKeyboard.cpp
+++ b/src/VBox/Frontends/VirtualBox/src/platform/darwin/tstDarwinKeyboard.cpp
@@ -18,9 +18,9 @@
*/
-/*******************************************************************************
-* Header Files *
-*******************************************************************************/
+/*********************************************************************************************************************************
+* Header Files *
+*********************************************************************************************************************************/
#ifdef VBOX_WITH_PRECOMPILED_HEADERS
# include <precomp.h>
#else /* !VBOX_WITH_PRECOMPILED_HEADERS */
diff --git a/src/VBox/Frontends/VirtualBox/src/platform/win/WinKeyboard.cpp b/src/VBox/Frontends/VirtualBox/src/platform/win/WinKeyboard.cpp
index 6db4a90..b6e8de3 100644
--- a/src/VBox/Frontends/VirtualBox/src/platform/win/WinKeyboard.cpp
+++ b/src/VBox/Frontends/VirtualBox/src/platform/win/WinKeyboard.cpp
@@ -65,6 +65,11 @@ static void winSetModifierState(int idModifier, bool fState)
keybd_event(idModifier, 0, KEYEVENTF_EXTENDEDKEY, 0);
keybd_event(idModifier, 0, KEYEVENTF_EXTENDEDKEY | KEYEVENTF_KEYUP, 0);
+ /* Process posted above keyboard events immediately: */
+ MSG msg;
+ while (::PeekMessage(&msg, NULL, WM_KEYFIRST, WM_KEYLAST, PM_REMOVE))
+ ::DispatchMessage(&msg);
+
LogRel2(("HID LEDs sync: setting %s state to %s (0x%X).\n",
VBOX_CONTROL_TO_STR_NAME(idModifier), VBOX_BOOL_TO_STR_STATE(fState), MapVirtualKey(idModifier, MAPVK_VK_TO_VSC)));
}
diff --git a/src/VBox/Frontends/VirtualBox/src/runtime/UIActionPoolRuntime.cpp b/src/VBox/Frontends/VirtualBox/src/runtime/UIActionPoolRuntime.cpp
index ef1923f..faefea4 100644
--- a/src/VBox/Frontends/VirtualBox/src/runtime/UIActionPoolRuntime.cpp
+++ b/src/VBox/Frontends/VirtualBox/src/runtime/UIActionPoolRuntime.cpp
@@ -2639,6 +2639,7 @@ void UIActionPoolRuntime::updateMenuViewScreen(QMenu *pMenu)
<< QSize(640, 480)
<< QSize(800, 600)
<< QSize(1024, 768)
+ << QSize(1152, 864)
<< QSize(1280, 720)
<< QSize(1280, 800)
<< QSize(1366, 768)
diff --git a/src/VBox/Frontends/VirtualBox/src/runtime/UIMachineLogic.cpp b/src/VBox/Frontends/VirtualBox/src/runtime/UIMachineLogic.cpp
index d412046..fc7cc84 100644
--- a/src/VBox/Frontends/VirtualBox/src/runtime/UIMachineLogic.cpp
+++ b/src/VBox/Frontends/VirtualBox/src/runtime/UIMachineLogic.cpp
@@ -20,7 +20,6 @@
#else /* !VBOX_WITH_PRECOMPILED_HEADERS */
/* Qt includes: */
-# include <QDesktopWidget>
# include <QDir>
# include <QFileInfo>
# include <QPainter>
diff --git a/src/VBox/Frontends/VirtualBox/src/runtime/UIMachineView.cpp b/src/VBox/Frontends/VirtualBox/src/runtime/UIMachineView.cpp
index 2a0ba68..6c938f3 100644
--- a/src/VBox/Frontends/VirtualBox/src/runtime/UIMachineView.cpp
+++ b/src/VBox/Frontends/VirtualBox/src/runtime/UIMachineView.cpp
@@ -279,6 +279,9 @@ void UIMachineView::sltHandleNotifyChange(int iWidth, int iHeight)
{
/* Assign new frame-buffer logical-size: */
frameBuffer()->setScaledSize(size());
+
+ /* Forget the last full-screen size: */
+ uisession()->setLastFullScreenSize(screenId(), QSize(-1, -1));
}
/* For other than 'scale' mode: */
else
@@ -286,8 +289,10 @@ void UIMachineView::sltHandleNotifyChange(int iWidth, int iHeight)
/* Adjust maximum-size restriction for machine-view: */
setMaximumSize(sizeHint());
- /* Disable the resize hint override hack: */
+ /* Disable the resize hint override hack and forget the last full-screen size: */
m_sizeHintOverride = QSize(-1, -1);
+ if (visualStateType() == UIVisualStateType_Normal)
+ uisession()->setLastFullScreenSize(screenId(), QSize(-1, -1));
/* Force machine-window update own layout: */
QCoreApplication::sendPostedEvents(0, QEvent::LayoutRequest);
@@ -842,7 +847,17 @@ UIMachineLogic* UIMachineView::machineLogic() const
QSize UIMachineView::sizeHint() const
{
- if (m_sizeHintOverride.isValid() && uisession()->isGuestSupportsGraphics())
+ /* Temporarily restrict the size to prevent a brief resize to the
+ * frame-buffer dimensions when we exit full-screen. This is only
+ * applied if the frame-buffer is at full-screen dimensions and
+ * until the first machine view resize. */
+
+ /* Get the frame-buffer dimensions: */
+ QSize frameBufferSize(frameBuffer()->width(), frameBuffer()->height());
+ /* Take the scale-factor(s) into account: */
+ frameBufferSize = scaledForward(frameBufferSize);
+ /* Check against the last full-screen size. */
+ if (frameBufferSize == uisession()->lastFullScreenSize(screenId()) && m_sizeHintOverride.isValid())
return m_sizeHintOverride;
/* Get frame-buffer size-hint: */
@@ -977,9 +992,6 @@ void UIMachineView::handleScaleChange()
/* Adjust maximum-size restriction for machine-view: */
setMaximumSize(sizeHint());
- /* Disable the resize hint override hack: */
- m_sizeHintOverride = QSize(-1, -1);
-
/* Force machine-window update own layout: */
QCoreApplication::sendPostedEvents(0, QEvent::LayoutRequest);
diff --git a/src/VBox/Frontends/VirtualBox/src/runtime/UIMouseHandler.cpp b/src/VBox/Frontends/VirtualBox/src/runtime/UIMouseHandler.cpp
index 7cb9ca6..392329b 100644
--- a/src/VBox/Frontends/VirtualBox/src/runtime/UIMouseHandler.cpp
+++ b/src/VBox/Frontends/VirtualBox/src/runtime/UIMouseHandler.cpp
@@ -187,7 +187,7 @@ void UIMouseHandler::captureMouse(ulong uScreenId)
QRect visibleRectangle = m_viewports[m_iMouseCaptureViewIndex]->visibleRegion().boundingRect();
QPoint visibleRectanglePos = m_views[m_iMouseCaptureViewIndex]->mapToGlobal(m_viewports[m_iMouseCaptureViewIndex]->pos());
visibleRectangle.translate(visibleRectanglePos);
- visibleRectangle = visibleRectangle.intersected(QApplication::desktop()->availableGeometry(machineLogic()->machineWindows()[m_iMouseCaptureViewIndex]));
+ visibleRectangle = visibleRectangle.intersected(vboxGlobal().availableGeometry(machineLogic()->machineWindows()[m_iMouseCaptureViewIndex]));
#ifdef Q_WS_WIN
/* Move the mouse to the center of the visible area: */
@@ -1120,7 +1120,7 @@ void UIMouseHandler::updateMouseCursorClipping()
/* Get full-viewport-rectangle in global coordinates: */
viewportRectangle.translate(viewportRectangleGlobalPos);
/* Trim full-viewport-rectangle by available geometry: */
- viewportRectangle = viewportRectangle.intersected(QApplication::desktop()->availableGeometry(machineLogic()->machineWindows()[m_iMouseCaptureViewIndex]));
+ viewportRectangle = viewportRectangle.intersected(vboxGlobal().availableGeometry(machineLogic()->machineWindows()[m_iMouseCaptureViewIndex]));
/* Trim partial-viewport-rectangle by top-most windows: */
QRegion viewportRegion(viewportRectangle);
QRegion topMostRegion(NativeWindowSubsystem::areaCoveredByTopMostWindows());
diff --git a/src/VBox/Frontends/VirtualBox/src/runtime/UIMultiScreenLayout.cpp b/src/VBox/Frontends/VirtualBox/src/runtime/UIMultiScreenLayout.cpp
index fedd0ba..0ee5852 100644
--- a/src/VBox/Frontends/VirtualBox/src/runtime/UIMultiScreenLayout.cpp
+++ b/src/VBox/Frontends/VirtualBox/src/runtime/UIMultiScreenLayout.cpp
@@ -21,7 +21,6 @@
/* Qt includes: */
# include <QApplication>
-# include <QDesktopWidget>
# include <QMenu>
/* GUI includes: */
@@ -71,7 +70,6 @@ void UIMultiScreenLayout::update()
CDisplay display = m_pMachineLogic->session().GetConsole().GetDisplay();
bool fShouldWeAutoMountGuestScreens = gEDataManager->autoMountGuestScreensEnabled(vboxGlobal().managedVMUuid());
LogRel(("GUI: UIMultiScreenLayout::update: GUI/AutomountGuestScreens is %s\n", fShouldWeAutoMountGuestScreens ? "enabled" : "disabled"));
- QDesktopWidget *pDW = QApplication::desktop();
foreach (int iGuestScreen, m_guestScreens)
{
/* Initialize variables: */
@@ -100,7 +98,7 @@ void UIMultiScreenLayout::update()
/* Get top-left corner position: */
QPoint topLeftPosition(geo.topLeft());
/* Check which host-screen the position belongs to: */
- iHostScreen = pDW->screenNumber(topLeftPosition);
+ iHostScreen = vboxGlobal().screenNumber(topLeftPosition);
/* Revalidate: */
fValid = iHostScreen >= 0 && iHostScreen < m_cHostScreens /* In the host screen bounds? */
&& m_screenMap.key(iHostScreen, -1) == -1; /* Not taken already? */
@@ -256,7 +254,7 @@ void UIMultiScreenLayout::sltHandleScreenLayoutChange(int iRequestedGuestScreen,
void UIMultiScreenLayout::calculateHostMonitorCount()
{
- m_cHostScreens = QApplication::desktop()->screenCount();
+ m_cHostScreens = vboxGlobal().screenCount();
}
void UIMultiScreenLayout::calculateGuestScreenCount()
@@ -295,9 +293,9 @@ quint64 UIMultiScreenLayout::memoryRequirements(const QMap<int, int> &screenLayo
{
QRect screen;
if (m_pMachineLogic->visualStateType() == UIVisualStateType_Seamless)
- screen = QApplication::desktop()->availableGeometry(screenLayout.value(iGuestScreen, 0));
+ screen = vboxGlobal().availableGeometry(screenLayout.value(iGuestScreen, 0));
else
- screen = QApplication::desktop()->screenGeometry(screenLayout.value(iGuestScreen, 0));
+ screen = vboxGlobal().screenGeometry(screenLayout.value(iGuestScreen, 0));
KGuestMonitorStatus monitorStatus = KGuestMonitorStatus_Enabled;
display.GetScreenResolution(iGuestScreen, width, height, guestBpp, xOrigin, yOrigin, monitorStatus);
usedBits += screen.width() * /* display width */
diff --git a/src/VBox/Frontends/VirtualBox/src/runtime/UISession.cpp b/src/VBox/Frontends/VirtualBox/src/runtime/UISession.cpp
index 946024a..b5d7137 100644
--- a/src/VBox/Frontends/VirtualBox/src/runtime/UISession.cpp
+++ b/src/VBox/Frontends/VirtualBox/src/runtime/UISession.cpp
@@ -798,11 +798,8 @@ void UISession::sltCheckIfHostDisplayChanged()
{
LogRelFlow(("GUI: UISession::sltCheckIfHostDisplayChanged()\n"));
- /* Acquire desktop wrapper: */
- QDesktopWidget *pDesktop = QApplication::desktop();
-
/* Check if display count changed: */
- if (pDesktop->screenCount() != m_hostScreens.size())
+ if (vboxGlobal().screenCount() != m_hostScreens.size())
{
/* Reset watchdog: */
m_pWatchdogDisplayChange->setProperty("tryNumber", 0);
@@ -812,9 +809,9 @@ void UISession::sltCheckIfHostDisplayChanged()
else
{
/* Check if at least one display geometry changed: */
- for (int iScreenIndex = 0; iScreenIndex < pDesktop->screenCount(); ++iScreenIndex)
+ for (int iScreenIndex = 0; iScreenIndex < vboxGlobal().screenCount(); ++iScreenIndex)
{
- if (pDesktop->screenGeometry(iScreenIndex) != m_hostScreens.at(iScreenIndex))
+ if (vboxGlobal().screenGeometry(iScreenIndex) != m_hostScreens.at(iScreenIndex))
{
/* Reset watchdog: */
m_pWatchdogDisplayChange->setProperty("tryNumber", 0);
@@ -1242,6 +1239,10 @@ void UISession::prepareScreens()
m_monitorVisibilityVector.fill(false);
m_monitorVisibilityVector[0] = true;
+ /* Prepare empty last full-screen size vector: */
+ m_monitorLastFullScreenSizeVector.resize(machine().GetMonitorCount());
+ m_monitorLastFullScreenSizeVector.fill(QSize(-1, -1));
+
/* If machine is in 'saved' state: */
if (isSaved())
{
@@ -1924,6 +1925,24 @@ void UISession::setScreenVisible(ulong uScreenId, bool fIsMonitorVisible)
gEDataManager->setLastGuestScreenVisibilityStatus(uScreenId, fIsMonitorVisible, vboxGlobal().managedVMUuid());
}
+QSize UISession::lastFullScreenSize(ulong uScreenId) const
+{
+ /* Make sure index fits the bounds: */
+ AssertReturn(uScreenId < (ulong)m_monitorLastFullScreenSizeVector.size(), QSize(-1, -1));
+
+ /* Return last full-screen size: */
+ return m_monitorLastFullScreenSizeVector.value((int)uScreenId);
+}
+
+void UISession::setLastFullScreenSize(ulong uScreenId, QSize size)
+{
+ /* Make sure index fits the bounds: */
+ AssertReturnVoid(uScreenId < (ulong)m_monitorLastFullScreenSizeVector.size());
+
+ /* Remember last full-screen size: */
+ m_monitorLastFullScreenSizeVector[(int)uScreenId] = size;
+}
+
int UISession::countOfVisibleWindows()
{
int cCountOfVisibleWindows = 0;
@@ -1949,9 +1968,8 @@ void UISession::setFrameBuffer(ulong uScreenId, UIFrameBuffer* pFrameBuffer)
void UISession::updateHostScreenData()
{
m_hostScreens.clear();
- QDesktopWidget *pDesktop = QApplication::desktop();
- for (int iScreenIndex = 0; iScreenIndex < pDesktop->screenCount(); ++iScreenIndex)
- m_hostScreens << pDesktop->screenGeometry(iScreenIndex);
+ for (int iScreenIndex = 0; iScreenIndex < vboxGlobal().screenCount(); ++iScreenIndex)
+ m_hostScreens << vboxGlobal().screenGeometry(iScreenIndex);
}
#ifdef VBOX_GUI_WITH_KEYS_RESET_HANDLER
diff --git a/src/VBox/Frontends/VirtualBox/src/runtime/UISession.h b/src/VBox/Frontends/VirtualBox/src/runtime/UISession.h
index 1bb5985..b64e03e 100644
--- a/src/VBox/Frontends/VirtualBox/src/runtime/UISession.h
+++ b/src/VBox/Frontends/VirtualBox/src/runtime/UISession.h
@@ -226,6 +226,10 @@ public:
bool isScreenVisible(ulong uScreenId) const;
void setScreenVisible(ulong uScreenId, bool fIsMonitorVisible);
+ /* Last screen full-screen size: */
+ QSize lastFullScreenSize(ulong uScreenId) const;
+ void setLastFullScreenSize(ulong uScreenId, QSize size);
+
/* Returns existing framebuffer for the given screen-number;
* Returns 0 (asserts) if screen-number attribute is out of bounds: */
UIFrameBuffer* frameBuffer(ulong uScreenId) const;
@@ -406,6 +410,9 @@ private:
/* Screen visibility vector: */
QVector<bool> m_monitorVisibilityVector;
+ /* Screen last full-screen size vector: */
+ QVector<QSize> m_monitorLastFullScreenSizeVector;
+
/* Frame-buffers vector: */
QVector<UIFrameBuffer*> m_frameBufferVector;
diff --git a/src/VBox/Frontends/VirtualBox/src/runtime/fullscreen/UIMachineLogicFullscreen.cpp b/src/VBox/Frontends/VirtualBox/src/runtime/fullscreen/UIMachineLogicFullscreen.cpp
index 22977b7..23e2dab 100644
--- a/src/VBox/Frontends/VirtualBox/src/runtime/fullscreen/UIMachineLogicFullscreen.cpp
+++ b/src/VBox/Frontends/VirtualBox/src/runtime/fullscreen/UIMachineLogicFullscreen.cpp
@@ -20,7 +20,6 @@
#else /* !VBOX_WITH_PRECOMPILED_HEADERS */
/* Qt includes: */
-# include <QDesktopWidget>
# include <QTimer>
/* GUI includes: */
@@ -756,9 +755,9 @@ void UIMachineLogicFullscreen::revalidateNativeFullScreen(UIMachineWindow *pMach
{
/* Variables to compare: */
const int iWantedHostScreenIndex = hostScreenForGuestScreen((int)uScreenID);
- const int iCurrentHostScreenIndex = QApplication::desktop()->screenNumber(pMachineWindow);
+ const int iCurrentHostScreenIndex = vboxGlobal().screenNumber(pMachineWindow);
const QSize frameBufferSize((int)uisession()->frameBuffer(uScreenID)->width(), (int)uisession()->frameBuffer(uScreenID)->height());
- const QSize screenSize = QApplication::desktop()->screenGeometry(iWantedHostScreenIndex).size();
+ const QSize screenSize = vboxGlobal().screenGeometry(iWantedHostScreenIndex).size();
/* If that window
* 1. shouldn't really be shown or
diff --git a/src/VBox/Frontends/VirtualBox/src/runtime/fullscreen/UIMachineViewFullscreen.cpp b/src/VBox/Frontends/VirtualBox/src/runtime/fullscreen/UIMachineViewFullscreen.cpp
index ae8675c..1f3ca40 100644
--- a/src/VBox/Frontends/VirtualBox/src/runtime/fullscreen/UIMachineViewFullscreen.cpp
+++ b/src/VBox/Frontends/VirtualBox/src/runtime/fullscreen/UIMachineViewFullscreen.cpp
@@ -21,7 +21,6 @@
/* Qt includes: */
# include <QApplication>
-# include <QDesktopWidget>
# include <QMainWindow>
# include <QTimer>
# ifdef Q_WS_MAC
@@ -208,6 +207,8 @@ void UIMachineViewFullscreen::adjustGuestScreenSize()
{
frameBuffer()->setAutoEnabled(false);
sltPerformGuestResize(workingArea().size());
+ /* And remember the size to know what we are resizing out of when we exit: */
+ uisession()->setLastFullScreenSize(screenId(), workingArea().size());
}
}
@@ -216,7 +217,7 @@ QRect UIMachineViewFullscreen::workingArea() const
/* Get corresponding screen: */
int iScreen = static_cast<UIMachineLogicFullscreen*>(machineLogic())->hostScreenForGuestScreen(screenId());
/* Return available geometry for that screen: */
- return QApplication::desktop()->screenGeometry(iScreen);
+ return vboxGlobal().screenGeometry(iScreen);
}
QSize UIMachineViewFullscreen::calculateMaxGuestSize() const
diff --git a/src/VBox/Frontends/VirtualBox/src/runtime/fullscreen/UIMachineWindowFullscreen.cpp b/src/VBox/Frontends/VirtualBox/src/runtime/fullscreen/UIMachineWindowFullscreen.cpp
index 94f8e4b..e97d3c5 100644
--- a/src/VBox/Frontends/VirtualBox/src/runtime/fullscreen/UIMachineWindowFullscreen.cpp
+++ b/src/VBox/Frontends/VirtualBox/src/runtime/fullscreen/UIMachineWindowFullscreen.cpp
@@ -20,7 +20,6 @@
#else /* !VBOX_WITH_PRECOMPILED_HEADERS */
/* Qt includes: */
-# include <QDesktopWidget>
# include <QMenu>
# include <QTimer>
@@ -312,19 +311,19 @@ void UIMachineWindowFullscreen::placeOnScreen()
/* Get corresponding host-screen: */
const int iHostScreen = qobject_cast<UIMachineLogicFullscreen*>(machineLogic())->hostScreenForGuestScreen(m_uScreenId);
/* And corresponding working area: */
- const QRect workingArea = QApplication::desktop()->screenGeometry(iHostScreen);
+ const QRect workingArea = vboxGlobal().screenGeometry(iHostScreen);
#if defined(Q_WS_WIN) || defined(Q_WS_X11)
/* Set appropriate geometry for window: */
- move(workingArea.topLeft());
resize(workingArea.size());
+ move(workingArea.topLeft());
/* If there is a mini-toolbar: */
if (m_pMiniToolBar)
{
/* Set appropriate geometry for mini-toolbar: */
- m_pMiniToolBar->move(workingArea.topLeft());
m_pMiniToolBar->resize(workingArea.size());
+ m_pMiniToolBar->move(workingArea.topLeft());
}
#elif defined(Q_WS_MAC)
/* Make sure this window has fullscreen logic: */
diff --git a/src/VBox/Frontends/VirtualBox/src/runtime/normal/UIMachineViewNormal.cpp b/src/VBox/Frontends/VirtualBox/src/runtime/normal/UIMachineViewNormal.cpp
index 2937a1a..14841e7 100644
--- a/src/VBox/Frontends/VirtualBox/src/runtime/normal/UIMachineViewNormal.cpp
+++ b/src/VBox/Frontends/VirtualBox/src/runtime/normal/UIMachineViewNormal.cpp
@@ -21,7 +21,6 @@
/* Qt includes: */
# include <QApplication>
-# include <QDesktopWidget>
# include <QMainWindow>
# include <QMenuBar>
# include <QScrollBar>
@@ -144,15 +143,11 @@ void UIMachineViewNormal::resendSizeHint()
/* Expand current limitations: */
setMaxGuestSize(sizeHint);
- if (uisession()->isGuestSupportsGraphics())
- {
- /* Temporarily restrict the size to prevent a brief resize to the
- * framebuffer dimensions (see @a UIMachineView::sizeHint()) before
- * the following resize() is acted upon. Expand current limitations
- * too. */
- setMaximumSize(sizeHint);
- m_sizeHintOverride = sizeHint;
- }
+ /* Temporarily restrict the size to prevent a brief resize to the
+ * frame-buffer dimensions when we exit full-screen. This is only
+ * applied if the frame-buffer is at full-screen dimensions and
+ * until the first machine view resize. */
+ m_sizeHintOverride = QSize(800, 600).expandedTo(sizeHint);
/* Send saved size-hint to the guest: */
/// @todo What if not m_bIsGuestAutoresizeEnabled?
@@ -223,7 +218,7 @@ void UIMachineViewNormal::adjustGuestScreenSize()
QRect UIMachineViewNormal::workingArea() const
{
- return QApplication::desktop()->availableGeometry(this);
+ return vboxGlobal().availableGeometry(this);
}
QSize UIMachineViewNormal::calculateMaxGuestSize() const
diff --git a/src/VBox/Frontends/VirtualBox/src/runtime/normal/UIMachineWindowNormal.cpp b/src/VBox/Frontends/VirtualBox/src/runtime/normal/UIMachineWindowNormal.cpp
index d688fb1..9c3f225 100644
--- a/src/VBox/Frontends/VirtualBox/src/runtime/normal/UIMachineWindowNormal.cpp
+++ b/src/VBox/Frontends/VirtualBox/src/runtime/normal/UIMachineWindowNormal.cpp
@@ -20,7 +20,6 @@
#else /* !VBOX_WITH_PRECOMPILED_HEADERS */
/* Qt includes: */
-# include <QDesktopWidget>
# include <QMenuBar>
# include <QTimer>
# include <QContextMenuEvent>
@@ -358,8 +357,8 @@ void UIMachineWindowNormal::loadSettings()
else
{
/* Get available geometry, for screen with (x,y) coords if possible: */
- QRect availableGeo = !geo.isNull() ? QApplication::desktop()->availableGeometry(QPoint(geo.x(), geo.y())) :
- QApplication::desktop()->availableGeometry(this);
+ QRect availableGeo = !geo.isNull() ? vboxGlobal().availableGeometry(QPoint(geo.x(), geo.y())) :
+ vboxGlobal().availableGeometry(this);
/* Normalize to the optimal size: */
normalizeGeometry(true /* adjust position */);
@@ -499,11 +498,7 @@ void UIMachineWindowNormal::normalizeGeometry(bool fAdjustPosition)
/* Adjust position if necessary: */
if (fAdjustPosition)
- {
- const QDesktopWidget *pDesktopWidget = QApplication::desktop();
- const QRegion availableGeo = pDesktopWidget->availableGeometry(pos());
- frameGeo = VBoxGlobal::normalizeGeometry(frameGeo, availableGeo);
- }
+ frameGeo = VBoxGlobal::normalizeGeometry(frameGeo, vboxGlobal().availableGeometry(pos()));
/* Finally, set the frame geometry: */
setGeometry(frameGeo.left() + dl, frameGeo.top() + dt,
diff --git a/src/VBox/Frontends/VirtualBox/src/runtime/scale/UIMachineViewScale.cpp b/src/VBox/Frontends/VirtualBox/src/runtime/scale/UIMachineViewScale.cpp
index 8d6ec48..f17184e 100644
--- a/src/VBox/Frontends/VirtualBox/src/runtime/scale/UIMachineViewScale.cpp
+++ b/src/VBox/Frontends/VirtualBox/src/runtime/scale/UIMachineViewScale.cpp
@@ -20,7 +20,6 @@
#else /* !VBOX_WITH_PRECOMPILED_HEADERS */
/* Qt includes: */
-# include <QDesktopWidget>
# include <QMainWindow>
# include <QTimer>
@@ -175,7 +174,7 @@ QSize UIMachineViewScale::sizeHint() const
QRect UIMachineViewScale::workingArea() const
{
- return QApplication::desktop()->availableGeometry(this);
+ return vboxGlobal().availableGeometry(this);
}
QSize UIMachineViewScale::calculateMaxGuestSize() const
diff --git a/src/VBox/Frontends/VirtualBox/src/runtime/scale/UIMachineWindowScale.cpp b/src/VBox/Frontends/VirtualBox/src/runtime/scale/UIMachineWindowScale.cpp
index cff4ea8..8cb4a10 100644
--- a/src/VBox/Frontends/VirtualBox/src/runtime/scale/UIMachineWindowScale.cpp
+++ b/src/VBox/Frontends/VirtualBox/src/runtime/scale/UIMachineWindowScale.cpp
@@ -20,7 +20,6 @@
#else /* !VBOX_WITH_PRECOMPILED_HEADERS */
/* Qt includes: */
-# include <QDesktopWidget>
# include <QMenu>
# include <QTimer>
# include <QSpacerItem>
@@ -100,8 +99,8 @@ void UIMachineWindowScale::loadSettings()
else
{
/* Get available geometry, for screen with (x,y) coords if possible: */
- QRect availableGeo = !geo.isNull() ? QApplication::desktop()->availableGeometry(QPoint(geo.x(), geo.y())) :
- QApplication::desktop()->availableGeometry(this);
+ QRect availableGeo = !geo.isNull() ? vboxGlobal().availableGeometry(QPoint(geo.x(), geo.y())) :
+ vboxGlobal().availableGeometry(this);
/* Resize to default size: */
resize(640, 480);
diff --git a/src/VBox/Frontends/VirtualBox/src/runtime/seamless/UIMachineLogicSeamless.cpp b/src/VBox/Frontends/VirtualBox/src/runtime/seamless/UIMachineLogicSeamless.cpp
index d83a5eb..b7cd846 100644
--- a/src/VBox/Frontends/VirtualBox/src/runtime/seamless/UIMachineLogicSeamless.cpp
+++ b/src/VBox/Frontends/VirtualBox/src/runtime/seamless/UIMachineLogicSeamless.cpp
@@ -20,7 +20,6 @@
#else /* !VBOX_WITH_PRECOMPILED_HEADERS */
/* Qt includes: */
-# include <QDesktopWidget>
# ifndef Q_WS_MAC
# include <QTimer>
# endif /* !Q_WS_MAC */
diff --git a/src/VBox/Frontends/VirtualBox/src/runtime/seamless/UIMachineViewSeamless.cpp b/src/VBox/Frontends/VirtualBox/src/runtime/seamless/UIMachineViewSeamless.cpp
index 3b7a2a7..206e463 100644
--- a/src/VBox/Frontends/VirtualBox/src/runtime/seamless/UIMachineViewSeamless.cpp
+++ b/src/VBox/Frontends/VirtualBox/src/runtime/seamless/UIMachineViewSeamless.cpp
@@ -21,7 +21,6 @@
/* Qt includes: */
# include <QApplication>
-# include <QDesktopWidget>
# include <QMainWindow>
# include <QTimer>
# ifdef Q_WS_MAC
@@ -216,6 +215,8 @@ void UIMachineViewSeamless::adjustGuestScreenSize()
{
frameBuffer()->setAutoEnabled(false);
sltPerformGuestResize(workingArea().size());
+ /* And remember the size to know what we are resizing out of when we exit: */
+ uisession()->setLastFullScreenSize(screenId(), workingArea().size());
}
}
@@ -224,7 +225,7 @@ QRect UIMachineViewSeamless::workingArea() const
/* Get corresponding screen: */
int iScreen = static_cast<UIMachineLogicSeamless*>(machineLogic())->hostScreenForGuestScreen(screenId());
/* Return available geometry for that screen: */
- return QApplication::desktop()->availableGeometry(iScreen);
+ return vboxGlobal().availableGeometry(iScreen);
}
QSize UIMachineViewSeamless::calculateMaxGuestSize() const
diff --git a/src/VBox/Frontends/VirtualBox/src/runtime/seamless/UIMachineWindowSeamless.cpp b/src/VBox/Frontends/VirtualBox/src/runtime/seamless/UIMachineWindowSeamless.cpp
index f2e8d4c..565a302 100644
--- a/src/VBox/Frontends/VirtualBox/src/runtime/seamless/UIMachineWindowSeamless.cpp
+++ b/src/VBox/Frontends/VirtualBox/src/runtime/seamless/UIMachineWindowSeamless.cpp
@@ -20,7 +20,6 @@
#else /* !VBOX_WITH_PRECOMPILED_HEADERS */
/* Qt includes: */
-# include <QDesktopWidget>
# include <QMenu>
# include <QTimer>
@@ -173,19 +172,19 @@ void UIMachineWindowSeamless::placeOnScreen()
/* Get corresponding host-screen: */
const int iHostScreen = qobject_cast<UIMachineLogicSeamless*>(machineLogic())->hostScreenForGuestScreen(m_uScreenId);
/* And corresponding working area: */
- const QRect workingArea = QApplication::desktop()->availableGeometry(iHostScreen);
+ const QRect workingArea = vboxGlobal().availableGeometry(iHostScreen);
/* Set appropriate geometry for window: */
- move(workingArea.topLeft());
resize(workingArea.size());
+ move(workingArea.topLeft());
#if defined(Q_WS_WIN) || defined(Q_WS_X11)
/* If there is a mini-toolbar: */
if (m_pMiniToolBar)
{
/* Set appropriate geometry for mini-toolbar: */
- m_pMiniToolBar->move(workingArea.topLeft());
m_pMiniToolBar->resize(workingArea.size());
+ m_pMiniToolBar->move(workingArea.topLeft());
}
#endif /* Q_WS_WIN || Q_WS_X11 */
}
diff --git a/src/VBox/Frontends/VirtualBox/src/selector/UISelectorWindow.cpp b/src/VBox/Frontends/VirtualBox/src/selector/UISelectorWindow.cpp
index 9fe78c0..0132812 100644
--- a/src/VBox/Frontends/VirtualBox/src/selector/UISelectorWindow.cpp
+++ b/src/VBox/Frontends/VirtualBox/src/selector/UISelectorWindow.cpp
@@ -1612,7 +1612,7 @@ void UISelectorWindow::loadSettings()
#else /* Q_WS_MAC */
setGeometry(m_geometry);
#endif /* !Q_WS_MAC */
- LogRel(("GUI: UISelectorWindow: Geometry loaded to: %dx%d @ %dx%d\n",
+ LogRel(("GUI: UISelectorWindow: Geometry loaded to: Origin=%dx%d, Size=%dx%d\n",
m_geometry.x(), m_geometry.y(), m_geometry.width(), m_geometry.height()));
/* Maximize (if necessary): */
@@ -1670,7 +1670,7 @@ void UISelectorWindow::saveSettings()
#else /* Q_WS_MAC */
gEDataManager->setSelectorWindowGeometry(m_geometry, isMaximized());
#endif /* !Q_WS_MAC */
- LogRel(("GUI: UISelectorWindow: Geometry saved as: %dx%d @ %dx%d\n",
+ LogRel(("GUI: UISelectorWindow: Geometry saved as: Origin=%dx%d, Size=%dx%d\n",
m_geometry.x(), m_geometry.y(), m_geometry.width(), m_geometry.height()));
}
}
diff --git a/src/VBox/Frontends/VirtualBox/src/settings/global/UIGlobalSettingsPortForwardingDlg.cpp b/src/VBox/Frontends/VirtualBox/src/settings/global/UIGlobalSettingsPortForwardingDlg.cpp
index 5ca658f..2c04bff 100644
--- a/src/VBox/Frontends/VirtualBox/src/settings/global/UIGlobalSettingsPortForwardingDlg.cpp
+++ b/src/VBox/Frontends/VirtualBox/src/settings/global/UIGlobalSettingsPortForwardingDlg.cpp
@@ -27,6 +27,7 @@
/* GUI includes: */
# include "UIGlobalSettingsPortForwardingDlg.h"
# include "UIIconPool.h"
+# include "UIMessageCenter.h"
# include "QIDialogButtonBox.h"
#endif /* !VBOX_WITH_PRECOMPILED_HEADERS */
@@ -50,8 +51,8 @@ UIGlobalSettingsPortForwardingDlg::UIGlobalSettingsPortForwardingDlg(QWidget *pP
m_pTabWidget = new QTabWidget;
{
/* Create table tabs: */
- m_pIPv4Table = new UIPortForwardingTable(ipv4rules, false);
- m_pIPv6Table = new UIPortForwardingTable(ipv6rules, true);
+ m_pIPv4Table = new UIPortForwardingTable(ipv4rules, false, false);
+ m_pIPv6Table = new UIPortForwardingTable(ipv6rules, true, false);
/* Add widgets into tab-widget: */
m_pTabWidget->addTab(m_pIPv4Table, QString());
m_pTabWidget->addTab(m_pIPv6Table, QString());
@@ -94,9 +95,9 @@ void UIGlobalSettingsPortForwardingDlg::accept()
void UIGlobalSettingsPortForwardingDlg::reject()
{
- /* Discard table: */
- bool fPassed = m_pIPv4Table->discard() && m_pIPv6Table->discard();
- if (!fPassed)
+ /* Ask user to discard table changes if necessary: */
+ if ( (m_pIPv4Table->isChanged() || m_pIPv6Table->isChanged())
+ && !msgCenter().confirmCancelingPortForwardingDialog(window()))
return;
/* Call to base-class: */
QIWithRetranslateUI<QIDialog>::reject();
diff --git a/src/VBox/Frontends/VirtualBox/src/settings/machine/UIMachineSettingsDisplay.cpp b/src/VBox/Frontends/VirtualBox/src/settings/machine/UIMachineSettingsDisplay.cpp
index 760070e..7d89b94 100644
--- a/src/VBox/Frontends/VirtualBox/src/settings/machine/UIMachineSettingsDisplay.cpp
+++ b/src/VBox/Frontends/VirtualBox/src/settings/machine/UIMachineSettingsDisplay.cpp
@@ -19,9 +19,6 @@
# include <precomp.h>
#else /* !VBOX_WITH_PRECOMPILED_HEADERS */
-/* Qt includes: */
-# include <QDesktopWidget>
-
/* GUI includes: */
# include "QIWidgetValidator.h"
# include "UIMachineSettingsDisplay.h"
@@ -770,7 +767,7 @@ void UIMachineSettingsDisplay::prepareScreenTab()
m_iMinVRAM = sys.GetMinGuestVRAM();
m_iMaxVRAM = sys.GetMaxGuestVRAM();
m_iMaxVRAMVisible = m_iMaxVRAM;
- const uint cHostScreens = QApplication::desktop()->screenCount();
+ const uint cHostScreens = vboxGlobal().screenCount();
m_pSliderVideoMemorySize->setMinimum(m_iMinVRAM);
m_pSliderVideoMemorySize->setMaximum(m_iMaxVRAMVisible);
m_pSliderVideoMemorySize->setPageStep(calcPageStep(m_iMaxVRAMVisible));
@@ -850,6 +847,7 @@ void UIMachineSettingsDisplay::prepareVideoCaptureTab()
m_pComboVideoCaptureSize->addItem("720 x 480 (3:2)", QSize(720, 480));
m_pComboVideoCaptureSize->addItem("800 x 600 (4:3)", QSize(800, 600));
m_pComboVideoCaptureSize->addItem("1024 x 768 (4:3)", QSize(1024, 768));
+ m_pComboVideoCaptureSize->addItem("1152 x 864 (4:3)", QSize(1152, 864));
m_pComboVideoCaptureSize->addItem("1280 x 720 (16:9)", QSize(1280, 720));
m_pComboVideoCaptureSize->addItem("1280 x 800 (16:10)", QSize(1280, 800));
m_pComboVideoCaptureSize->addItem("1280 x 960 (4:3)", QSize(1280, 960));
diff --git a/src/VBox/Frontends/VirtualBox/src/settings/machine/UIMachineSettingsPortForwardingDlg.cpp b/src/VBox/Frontends/VirtualBox/src/settings/machine/UIMachineSettingsPortForwardingDlg.cpp
index 7bd7379..7944535 100644
--- a/src/VBox/Frontends/VirtualBox/src/settings/machine/UIMachineSettingsPortForwardingDlg.cpp
+++ b/src/VBox/Frontends/VirtualBox/src/settings/machine/UIMachineSettingsPortForwardingDlg.cpp
@@ -26,6 +26,7 @@
/* GUI includes: */
# include "UIMachineSettingsPortForwardingDlg.h"
# include "UIIconPool.h"
+# include "UIMessageCenter.h"
# include "QIDialogButtonBox.h"
#endif /* !VBOX_WITH_PRECOMPILED_HEADERS */
@@ -44,7 +45,7 @@ UIMachineSettingsPortForwardingDlg::UIMachineSettingsPortForwardingDlg(QWidget *
QVBoxLayout *pMainLayout = new QVBoxLayout(this);
{
/* Create table: */
- m_pTable = new UIPortForwardingTable(rules, false);
+ m_pTable = new UIPortForwardingTable(rules, false, true);
/* Create button-box: */
m_pButtonBox = new QIDialogButtonBox(QDialogButtonBox::Ok | QDialogButtonBox::Cancel, Qt::Horizontal);
{
@@ -78,9 +79,9 @@ void UIMachineSettingsPortForwardingDlg::accept()
void UIMachineSettingsPortForwardingDlg::reject()
{
- /* Discard table: */
- bool fPassed = m_pTable->discard();
- if (!fPassed)
+ /* Ask user to discard table changes if necessary: */
+ if ( m_pTable->isChanged()
+ && !msgCenter().confirmCancelingPortForwardingDialog(window()))
return;
/* Call to base-class: */
QIWithRetranslateUI<QIDialog>::reject();
diff --git a/src/VBox/Frontends/VirtualBox/src/widgets/UIMiniToolBar.cpp b/src/VBox/Frontends/VirtualBox/src/widgets/UIMiniToolBar.cpp
index be66cc7..64a1985 100644
--- a/src/VBox/Frontends/VirtualBox/src/widgets/UIMiniToolBar.cpp
+++ b/src/VBox/Frontends/VirtualBox/src/widgets/UIMiniToolBar.cpp
@@ -24,7 +24,6 @@
# include <QTimer>
# include <QMdiArea>
# include <QMdiSubWindow>
-# include <QDesktopWidget>
# include <QLabel>
# include <QMenu>
# include <QToolButton>
diff --git a/src/VBox/Frontends/VirtualBox/src/widgets/UINameAndSystemEditor.cpp b/src/VBox/Frontends/VirtualBox/src/widgets/UINameAndSystemEditor.cpp
index 83732d3..6a6aa6c 100644
--- a/src/VBox/Frontends/VirtualBox/src/widgets/UINameAndSystemEditor.cpp
+++ b/src/VBox/Frontends/VirtualBox/src/widgets/UINameAndSystemEditor.cpp
@@ -204,9 +204,9 @@ void UINameAndSystemEditor::sltFamilyChanged(int iIndex)
QString strDefaultID = "Windows7";
if (ARCH_BITS == 64 && m_fSupportsHWVirtEx && m_fSupportsLongMode)
strDefaultID += "_64";
- int iIndexWinXP = m_pTypeCombo->findData(strDefaultID, TypeID);
- if (iIndexWinXP != -1)
- m_pTypeCombo->setCurrentIndex(iIndexWinXP);
+ int iIndexWin7 = m_pTypeCombo->findData(strDefaultID, TypeID);
+ if (iIndexWin7 != -1)
+ m_pTypeCombo->setCurrentIndex(iIndexWin7);
}
/* Or select Ubuntu item for Linux family as default: */
else if (strFamilyId == "Linux")
@@ -225,7 +225,7 @@ void UINameAndSystemEditor::sltFamilyChanged(int iIndex)
sltTypeChanged(m_pTypeCombo->currentIndex());
/* Unlock the signals of m_pTypeCombo: */
- m_pTypeCombo->blockSignals (false);
+ m_pTypeCombo->blockSignals(false);
}
void UINameAndSystemEditor::sltTypeChanged(int iIndex)
diff --git a/src/VBox/Frontends/VirtualBox/src/widgets/UIPortForwardingTable.cpp b/src/VBox/Frontends/VirtualBox/src/widgets/UIPortForwardingTable.cpp
index 496dfd8..bbe4ccf 100644
--- a/src/VBox/Frontends/VirtualBox/src/widgets/UIPortForwardingTable.cpp
+++ b/src/VBox/Frontends/VirtualBox/src/widgets/UIPortForwardingTable.cpp
@@ -218,7 +218,15 @@ public:
setFrame(false);
setAlignment(Qt::AlignCenter);
setValidator(new IPv4Validator(this));
- setInputMask("000.000.000.000");
+ connect(this, SIGNAL(textEdited(const QString&)), this, SLOT(sltTextEdited(const QString&)));
+ }
+
+private slots:
+
+ /** Drops the changed data to listener. */
+ void sltTextEdited(const QString&)
+ {
+ emit sigCommitData(this);
}
private:
@@ -255,7 +263,15 @@ public:
setFrame(false);
setAlignment(Qt::AlignCenter);
setValidator(new IPv6Validator(this));
- // setInputMask("000.000.000.000"); // No mask for now...
+ connect(this, SIGNAL(textEdited(const QString&)), this, SLOT(sltTextEdited(const QString&)));
+ }
+
+private slots:
+
+ /** Drops the changed data to listener. */
+ void sltTextEdited(const QString&)
+ {
+ emit sigCommitData(this);
}
private:
@@ -550,8 +566,9 @@ bool UIPortForwardingModel::setData(const QModelIndex &index, const QVariant &va
}
-UIPortForwardingTable::UIPortForwardingTable(const UIPortForwardingDataList &rules, bool fIPv6)
- : m_fIsTableDataChanged(false)
+UIPortForwardingTable::UIPortForwardingTable(const UIPortForwardingDataList &rules, bool fIPv6, bool fAllowEmptyGuestIPs)
+ : m_fAllowEmptyGuestIPs(fAllowEmptyGuestIPs)
+ , m_fIsTableDataChanged(false)
, m_pTableView(0)
, m_pToolBar(0)
, m_pModel(0)
@@ -694,49 +711,48 @@ const UIPortForwardingDataList& UIPortForwardingTable::rules() const
bool UIPortForwardingTable::validate() const
{
/* Validate table: */
- QSet<QString> usedNames;
- QMap<int, QString> rules;
+ QList<NameData> names;
+ QList<UIPortForwardingDataUnique> rules;
for (int i = 0; i < m_pModel->rowCount(); ++i)
{
+ /* Some of variables: */
+ const NameData name = m_pModel->data(m_pModel->index(i, UIPortForwardingModel::UIPortForwardingDataType_Name), Qt::EditRole).value<NameData>();
+ const KNATProtocol protocol = m_pModel->data(m_pModel->index(i, UIPortForwardingModel::UIPortForwardingDataType_Protocol), Qt::EditRole).value<KNATProtocol>();
+ const PortData hostPort = m_pModel->data(m_pModel->index(i, UIPortForwardingModel::UIPortForwardingDataType_HostPort), Qt::EditRole).value<PortData>().value();
+ const PortData guestPort = m_pModel->data(m_pModel->index(i, UIPortForwardingModel::UIPortForwardingDataType_GuestPort), Qt::EditRole).value<PortData>().value();
+ const IpData hostIp = m_pModel->data(m_pModel->index(i, UIPortForwardingModel::UIPortForwardingDataType_HostIp), Qt::EditRole).value<IpData>();
+ const IpData guestIp = m_pModel->data(m_pModel->index(i, UIPortForwardingModel::UIPortForwardingDataType_GuestIp), Qt::EditRole).value<IpData>();
+
/* If at aleast one port is 'zero': */
- if (m_pModel->data(m_pModel->index(i, UIPortForwardingModel::UIPortForwardingDataType_HostPort), Qt::EditRole).value<PortData>().value() == 0 ||
- m_pModel->data(m_pModel->index(i, UIPortForwardingModel::UIPortForwardingDataType_GuestPort), Qt::EditRole).value<PortData>().value() == 0)
+ if (hostPort.value() == 0 || guestPort.value() == 0)
return msgCenter().warnAboutIncorrectPort(window());
+ /* If at aleast one address is incorrect: */
+ if ( (!hostIp.isEmpty() && QHostAddress(hostIp).isNull())
+ || (!guestIp.isEmpty() && QHostAddress(guestIp).isNull()))
+ return msgCenter().warnAboutIncorrectAddress(window());
+
+ /* If empty guest address is not allowed: */
+ if ( !m_fAllowEmptyGuestIPs
+ && guestIp.isEmpty())
+ return msgCenter().warnAboutEmptyGuestAddress(window());
/* Make sure non of the names were previosly used: */
- const QString strName = m_pModel->data(m_pModel->index(i, UIPortForwardingModel::UIPortForwardingDataType_Name), Qt::EditRole).value<NameData>();
- if (!usedNames.contains(strName))
- usedNames << strName;
+ if (!names.contains(name))
+ names << name;
else
return msgCenter().warnAboutNameShouldBeUnique(window());
- /* Make sure rules are not in conflict: */
- const ushort iHostPort = m_pModel->data(m_pModel->index(i, UIPortForwardingModel::UIPortForwardingDataType_HostPort), Qt::EditRole).value<PortData>().value();
- const QString strHostAddressNew = m_pModel->data(m_pModel->index(i, UIPortForwardingModel::UIPortForwardingDataType_HostIp), Qt::EditRole).value<IpData>();
- if (rules.contains(iHostPort))
- {
- const QString strHostAddressOld = rules.value(iHostPort);
- if ( strHostAddressNew == strHostAddressOld
- || strHostAddressNew.isEmpty() || QHostAddress(strHostAddressNew).isNull()
- || strHostAddressOld.isEmpty() || QHostAddress(strHostAddressOld).isNull())
- return msgCenter().warnAboutRulesConflict(window());
- }
+ /* Make sure non of the rules were previosly used: */
+ UIPortForwardingDataUnique rule(protocol, hostPort, hostIp);
+ if (!rules.contains(rule))
+ rules << rule;
else
- rules[iHostPort] = strHostAddressNew;
+ return msgCenter().warnAboutRulesConflict(window());
}
/* True by default: */
return true;
}
-bool UIPortForwardingTable::discard() const
-{
- /* Check if table data was changed and user do not want to loose it: */
- if (m_fIsTableDataChanged && !msgCenter().confirmCancelingPortForwardingDialog(window()))
- return false;
- /* True by default: */
- return true;
-}
-
void UIPortForwardingTable::sltAddRule()
{
m_pModel->addRule(QModelIndex());
@@ -763,11 +779,6 @@ void UIPortForwardingTable::sltDelRule()
sltAdjustTable();
}
-void UIPortForwardingTable::sltTableDataChanged()
-{
- m_fIsTableDataChanged = true;
-}
-
void UIPortForwardingTable::sltCurrentChanged()
{
bool fTableFocused = m_pTableView->hasFocus();
diff --git a/src/VBox/Frontends/VirtualBox/src/widgets/UIPortForwardingTable.h b/src/VBox/Frontends/VirtualBox/src/widgets/UIPortForwardingTable.h
index e04606c..0071aff 100644
--- a/src/VBox/Frontends/VirtualBox/src/widgets/UIPortForwardingTable.h
+++ b/src/VBox/Frontends/VirtualBox/src/widgets/UIPortForwardingTable.h
@@ -96,6 +96,28 @@ struct UIPortForwardingData
PortData guestPort;
};
+/* Port forwarding data, unique part: */
+struct UIPortForwardingDataUnique
+{
+ UIPortForwardingDataUnique(KNATProtocol enmProtocol,
+ PortData uHostPort,
+ const IpData &strHostIp)
+ : protocol(enmProtocol)
+ , hostPort(uHostPort)
+ , hostIp(strHostIp) {}
+ bool operator==(const UIPortForwardingDataUnique &other)
+ {
+ return protocol == other.protocol
+ && hostPort == other.hostPort
+ && ( hostIp.isEmpty() || other.hostIp.isEmpty()
+ || hostIp == "0.0.0.0" || other.hostIp == "0.0.0.0"
+ || hostIp == other.hostIp);
+ }
+ KNATProtocol protocol;
+ PortData hostPort;
+ IpData hostIp;
+};
+
/* Port forwarding data list: */
typedef QList<UIPortForwardingData> UIPortForwardingDataList;
@@ -107,12 +129,14 @@ class UIPortForwardingTable : public QIWithRetranslateUI<QWidget>
public:
/* Constructor: */
- UIPortForwardingTable(const UIPortForwardingDataList &rules, bool fIPv6);
+ UIPortForwardingTable(const UIPortForwardingDataList &rules, bool fIPv6, bool fAllowEmptyGuestIPs);
/* API: Rules stuff: */
const UIPortForwardingDataList& rules() const;
bool validate() const;
- bool discard() const;
+
+ /** Returns whether the table data was changed. */
+ bool isChanged() const { return m_fIsTableDataChanged; }
private slots:
@@ -121,8 +145,10 @@ private slots:
void sltCopyRule();
void sltDelRule();
+ /** Marks table data as changed. */
+ void sltTableDataChanged() { m_fIsTableDataChanged = true; }
+
/* Handlers: Table stuff: */
- void sltTableDataChanged();
void sltCurrentChanged();
void sltShowTableContexMenu(const QPoint &position);
void sltAdjustTable();
@@ -136,6 +162,9 @@ private:
bool eventFilter(QObject *pObject, QEvent *pEvent);
/* Flags: */
+ bool m_fAllowEmptyGuestIPs;
+
+ /** Holds whether the table data was changed. */
bool m_fIsTableDataChanged;
/* Widgets: */
diff --git a/src/VBox/Frontends/VirtualBox/src/wizards/newvm/UIWizardNewVMPageBasic1.cpp b/src/VBox/Frontends/VirtualBox/src/wizards/newvm/UIWizardNewVMPageBasic1.cpp
index 8456e4e..cb5ca01 100644
--- a/src/VBox/Frontends/VirtualBox/src/wizards/newvm/UIWizardNewVMPageBasic1.cpp
+++ b/src/VBox/Frontends/VirtualBox/src/wizards/newvm/UIWizardNewVMPageBasic1.cpp
@@ -57,8 +57,9 @@ static const osTypePattern gs_OSTypePattern[] =
{ QRegExp( "Wi.*95", Qt::CaseInsensitive), "Windows95" },
{ QRegExp( "Wi.*Me", Qt::CaseInsensitive), "WindowsMe" },
{ QRegExp( "(Wi.*NT)|(NT4)", Qt::CaseInsensitive), "WindowsNT4" },
- { QRegExp("((Wi.*XP)|(\\bXP\\b)).*64", Qt::CaseInsensitive), "WindowsXP_64" },
- { QRegExp("((Wi.*XP)|(\\bXP\\b)).*32", Qt::CaseInsensitive), "WindowsXP" },
+ /* Note: Do not automatically set WindowsXP_64 on 64-bit hosts, as Windows XP 64-bit
+ * is extremely rare -- most users never heard of it even. So always default to 32-bit. */
+ { QRegExp("((Wi.*XP)|(XP)).*", Qt::CaseInsensitive), "WindowsXP" },
{ QRegExp("((Wi.*2003)|(W2K3)|(Win2K3)).*64", Qt::CaseInsensitive), "Windows2003_64" },
{ QRegExp("((Wi.*2003)|(W2K3)|(Win2K3)).*32", Qt::CaseInsensitive), "Windows2003" },
{ QRegExp("((Wi.*Vis)|(Vista)).*64", Qt::CaseInsensitive), "WindowsVista_64" },
@@ -76,8 +77,9 @@ static const osTypePattern gs_OSTypePattern[] =
{ QRegExp( "(Wi.*10.*64)|(W10.*64)", Qt::CaseInsensitive), "Windows10_64" },
{ QRegExp( "(Wi.*10.*32)|(W10.*32)", Qt::CaseInsensitive), "Windows10" },
{ QRegExp( "Wi.*3.*1", Qt::CaseInsensitive), "Windows31" },
- { QRegExp( "Wi.*64", Qt::CaseInsensitive), "WindowsXP_64" },
- { QRegExp( "Wi.*32", Qt::CaseInsensitive), "WindowsXP" },
+ /* Set Windows 7 as default for "Windows". */
+ { QRegExp( "Wi.*64", Qt::CaseInsensitive), "Windows7_64" },
+ { QRegExp( "Wi.*32", Qt::CaseInsensitive), "Windows7" },
/* Solaris: */
{ QRegExp("So.*11", Qt::CaseInsensitive), "Solaris11_64" },
diff --git a/src/VBox/GuestHost/DragAndDrop/DnDDir.cpp b/src/VBox/GuestHost/DragAndDrop/DnDDir.cpp
index d509261..2b8d2d2 100644
--- a/src/VBox/GuestHost/DragAndDrop/DnDDir.cpp
+++ b/src/VBox/GuestHost/DragAndDrop/DnDDir.cpp
@@ -15,9 +15,10 @@
* hope that it will be useful, but WITHOUT ANY WARRANTY of any kind.
*/
-/******************************************************************************
- * Header Files *
- ******************************************************************************/
+
+/*********************************************************************************************************************************
+* Header Files *
+*********************************************************************************************************************************/
#include <iprt/assert.h>
#include <iprt/dir.h>
@@ -128,7 +129,7 @@ int DnDDirDroppedFilesClose(PDNDDIRDROPPEDFILES pDir, bool fRemove)
int rc = VINF_SUCCESS;
if (pDir->fOpen)
{
- rc = RTDirClose(pDir->hDir);
+ rc = RTDirClose(pDir->hDir);
if (RT_SUCCESS(rc))
pDir->fOpen = false;
}
diff --git a/src/VBox/GuestHost/DragAndDrop/DnDMIME.cpp b/src/VBox/GuestHost/DragAndDrop/DnDMIME.cpp
index 2606bf4..329f4b7 100644
--- a/src/VBox/GuestHost/DragAndDrop/DnDMIME.cpp
+++ b/src/VBox/GuestHost/DragAndDrop/DnDMIME.cpp
@@ -15,9 +15,10 @@
* hope that it will be useful, but WITHOUT ANY WARRANTY of any kind.
*/
-/******************************************************************************
- * Header Files *
- ******************************************************************************/
+
+/*********************************************************************************************************************************
+* Header Files *
+*********************************************************************************************************************************/
#include <iprt/string.h>
diff --git a/src/VBox/GuestHost/DragAndDrop/DnDPath.cpp b/src/VBox/GuestHost/DragAndDrop/DnDPath.cpp
index 9ea6f92..6589ce8 100644
--- a/src/VBox/GuestHost/DragAndDrop/DnDPath.cpp
+++ b/src/VBox/GuestHost/DragAndDrop/DnDPath.cpp
@@ -15,9 +15,10 @@
* hope that it will be useful, but WITHOUT ANY WARRANTY of any kind.
*/
-/******************************************************************************
- * Header Files *
- ******************************************************************************/
+
+/*********************************************************************************************************************************
+* Header Files *
+*********************************************************************************************************************************/
#include <iprt/path.h>
#include <iprt/string.h>
diff --git a/src/VBox/GuestHost/DragAndDrop/DnDURIList.cpp b/src/VBox/GuestHost/DragAndDrop/DnDURIList.cpp
index d06c862..98aa40c 100644
--- a/src/VBox/GuestHost/DragAndDrop/DnDURIList.cpp
+++ b/src/VBox/GuestHost/DragAndDrop/DnDURIList.cpp
@@ -15,9 +15,10 @@
* hope that it will be useful, but WITHOUT ANY WARRANTY of any kind.
*/
-/******************************************************************************
- * Header Files *
- ******************************************************************************/
+
+/*********************************************************************************************************************************
+* Header Files *
+*********************************************************************************************************************************/
#include <iprt/dir.h>
#include <iprt/file.h>
@@ -58,9 +59,10 @@ int DnDURIList::addEntry(const char *pcszSource, const char *pcszTarget, uint32_
{
if (RTFS_IS_FILE(objInfo.Attr.fMode))
{
- LogFlowFunc(("File '%s' -> '%s' (%RU64)\n", pcszSource, pcszTarget, (uint64_t)objInfo.cbObject));
+ LogFlowFunc(("File '%s' -> '%s' (%RU64 bytes, file mode 0x%x)\n",
+ pcszSource, pcszTarget, (uint64_t)objInfo.cbObject, objInfo.Attr.fMode));
- DnDURIObject *pObjFile= new DnDURIObject(DnDURIObject::File, pcszSource, pcszTarget);
+ DnDURIObject *pObjFile = new DnDURIObject(DnDURIObject::File, pcszSource, pcszTarget);
if (pObjFile)
{
if (fFlags & DNDURILIST_FLAGS_KEEP_OPEN) /* Shall we keep the file open while being added to this list? */
@@ -76,26 +78,27 @@ int DnDURIList::addEntry(const char *pcszSource, const char *pcszTarget, uint32_
m_cTotal++;
m_cbTotal += pObjFile->GetSize();
}
+ else
+ delete pObjFile;
}
else
rc = VERR_NO_MEMORY;
}
else if (RTFS_IS_DIRECTORY(objInfo.Attr.fMode))
{
- LogFlowFunc(("Directory '%s' -> '%s' \n", pcszSource, pcszTarget));
+ LogFlowFunc(("Directory '%s' -> '%s' (file mode 0x%x)\n", pcszSource, pcszTarget, objInfo.Attr.fMode));
- DnDURIObject *pObjDir= new DnDURIObject(DnDURIObject::Directory, pcszSource, pcszTarget,
- objInfo.Attr.fMode, 0 /* Size */);
+ DnDURIObject *pObjDir = new DnDURIObject(DnDURIObject::Directory, pcszSource, pcszTarget,
+ objInfo.Attr.fMode, 0 /* Size */);
if (pObjDir)
{
m_lstTree.append(pObjDir);
+
+ /** @todo Add DNDURILIST_FLAGS_KEEP_OPEN handling? */
+ m_cTotal++;
}
else
rc = VERR_NO_MEMORY;
-
- /** @todo Add DNDURILIST_FLAGS_KEEP_OPEN handling. */
-
- m_cTotal++;
}
/* Note: Symlinks already should have been resolved at this point. */
else
diff --git a/src/VBox/GuestHost/DragAndDrop/DnDURIObject.cpp b/src/VBox/GuestHost/DragAndDrop/DnDURIObject.cpp
index 55cf184..d14a173 100644
--- a/src/VBox/GuestHost/DragAndDrop/DnDURIObject.cpp
+++ b/src/VBox/GuestHost/DragAndDrop/DnDURIObject.cpp
@@ -16,9 +16,10 @@
* hope that it will be useful, but WITHOUT ANY WARRANTY of any kind.
*/
-/******************************************************************************
- * Header Files *
- ******************************************************************************/
+
+/*********************************************************************************************************************************
+* Header Files *
+*********************************************************************************************************************************/
#include <iprt/dir.h>
#include <iprt/file.h>
@@ -362,12 +363,12 @@ void DnDURIObject::Reset(void)
{
Close();
- m_Type = Unknown;
- m_strSrcPath = "";
- m_strTgtPath = "";
- m_fMode = 0;
- m_cbSize = 0;
- m_cbProcessed = 0;
+ m_Type = Unknown;
+ m_strSrcPath = "";
+ m_strTgtPath = "";
+ m_fMode = 0;
+ m_cbSize = 0;
+ m_cbProcessed = 0;
}
int DnDURIObject::Write(const void *pvBuf, size_t cbBuf, uint32_t *pcbWritten)
diff --git a/src/VBox/GuestHost/OpenGL/error/error.py b/src/VBox/GuestHost/OpenGL/error/error.py
old mode 100755
new mode 100644
diff --git a/src/VBox/GuestHost/OpenGL/glapi_parser/apiutil.py b/src/VBox/GuestHost/OpenGL/glapi_parser/apiutil.py
old mode 100644
new mode 100755
diff --git a/src/VBox/GuestHost/OpenGL/packer/pack_header.py b/src/VBox/GuestHost/OpenGL/packer/pack_header.py
old mode 100755
new mode 100644
diff --git a/src/VBox/GuestHost/OpenGL/packer/packer_bbox.py b/src/VBox/GuestHost/OpenGL/packer/packer_bbox.py
old mode 100755
new mode 100644
diff --git a/src/VBox/GuestHost/OpenGL/spu_loader/dispatch.py b/src/VBox/GuestHost/OpenGL/spu_loader/dispatch.py
old mode 100755
new mode 100644
diff --git a/src/VBox/GuestHost/OpenGL/spu_loader/dispatchheader.py b/src/VBox/GuestHost/OpenGL/spu_loader/dispatchheader.py
old mode 100755
new mode 100644
diff --git a/src/VBox/GuestHost/OpenGL/spu_loader/glloader.py b/src/VBox/GuestHost/OpenGL/spu_loader/glloader.py
old mode 100755
new mode 100644
diff --git a/src/VBox/GuestHost/OpenGL/spu_loader/spuchange.py b/src/VBox/GuestHost/OpenGL/spu_loader/spuchange.py
old mode 100755
new mode 100644
diff --git a/src/VBox/GuestHost/OpenGL/spu_loader/spucopy.py b/src/VBox/GuestHost/OpenGL/spu_loader/spucopy.py
old mode 100755
new mode 100644
diff --git a/src/VBox/GuestHost/OpenGL/state_tracker/state_defs.py b/src/VBox/GuestHost/OpenGL/state_tracker/state_defs.py
old mode 100755
new mode 100644
diff --git a/src/VBox/GuestHost/OpenGL/state_tracker/state_funcs.py b/src/VBox/GuestHost/OpenGL/state_tracker/state_funcs.py
old mode 100755
new mode 100644
diff --git a/src/VBox/GuestHost/OpenGL/state_tracker/state_init.c b/src/VBox/GuestHost/OpenGL/state_tracker/state_init.c
index c47b753..c2e4116 100644
--- a/src/VBox/GuestHost/OpenGL/state_tracker/state_init.c
+++ b/src/VBox/GuestHost/OpenGL/state_tracker/state_init.c
@@ -463,7 +463,7 @@ crStateFreeContext(CRContext *ctx)
#ifdef CHROMIUM_THREADSAFE
# ifndef RT_OS_WINDOWS
-static DECLCALLBACK(void) crStateThreadTlsDtor(void *pvValue)
+static void crStateThreadTlsDtor(void *pvValue)
{
CRContext *pCtx = (CRContext*)pvValue;
VBoxTlsRefRelease(pCtx);
diff --git a/src/VBox/GuestHost/OpenGL/state_tracker/state_isenabled.py b/src/VBox/GuestHost/OpenGL/state_tracker/state_isenabled.py
old mode 100755
new mode 100644
diff --git a/src/VBox/GuestHost/OpenGL/util/debug_opcodes.py b/src/VBox/GuestHost/OpenGL/util/debug_opcodes.py
old mode 100755
new mode 100644
diff --git a/src/VBox/GuestHost/OpenGL/util/vboxhgcm.c b/src/VBox/GuestHost/OpenGL/util/vboxhgcm.c
index 6a5ea4a..d23dff9 100644
--- a/src/VBox/GuestHost/OpenGL/util/vboxhgcm.c
+++ b/src/VBox/GuestHost/OpenGL/util/vboxhgcm.c
@@ -306,7 +306,7 @@ static int _crVBoxHGSMIClientTerm(PCRVBOXHGSMI_CLIENT pClient, PVBOXUHGSMI *ppHg
#ifdef VBOX_CRHGSMI_WITH_D3DDEV
-DECLCALLBACK(HVBOXCRHGSMI_CLIENT) _crVBoxHGSMIClientCreate(PVBOXUHGSMI pHgsmi)
+static DECLCALLBACK(HVBOXCRHGSMI_CLIENT) _crVBoxHGSMIClientCreate(PVBOXUHGSMI pHgsmi)
{
PCRVBOXHGSMI_CLIENT pClient = crAlloc(sizeof (CRVBOXHGSMI_CLIENT));
@@ -324,7 +324,7 @@ DECLCALLBACK(HVBOXCRHGSMI_CLIENT) _crVBoxHGSMIClientCreate(PVBOXUHGSMI pHgsmi)
return NULL;
}
-DECLCALLBACK(void) _crVBoxHGSMIClientDestroy(HVBOXCRHGSMI_CLIENT hClient)
+static DECLCALLBACK(void) _crVBoxHGSMIClientDestroy(HVBOXCRHGSMI_CLIENT hClient)
{
PCRVBOXHGSMI_CLIENT pClient = (PCRVBOXHGSMI_CLIENT)hClient;
_crVBoxHGSMIClientTerm(pClient, NULL);
diff --git a/src/VBox/GuestHost/OpenGL/util/vboxhgsmi.c b/src/VBox/GuestHost/OpenGL/util/vboxhgsmi.c
index 3da3496..1c53f6f 100644
--- a/src/VBox/GuestHost/OpenGL/util/vboxhgsmi.c
+++ b/src/VBox/GuestHost/OpenGL/util/vboxhgsmi.c
@@ -1429,7 +1429,7 @@ static void crVBoxHGSMIHandleNewMessage( CRConnection *conn, CRMessage *msg, uns
VBOXCRHGSMIPROFILE_FUNC_EPILOGUE();
}
-DECLCALLBACK(HVBOXCRHGSMI_CLIENT) _crVBoxHGSMIClientCreate(PVBOXUHGSMI pHgsmi)
+static DECLCALLBACK(HVBOXCRHGSMI_CLIENT) _crVBoxHGSMIClientCreate(PVBOXUHGSMI pHgsmi)
{
PCRVBOXHGSMI_CLIENT pClient = crAlloc(sizeof (CRVBOXHGSMI_CLIENT));
@@ -1461,7 +1461,7 @@ DECLCALLBACK(HVBOXCRHGSMI_CLIENT) _crVBoxHGSMIClientCreate(PVBOXUHGSMI pHgsmi)
return NULL;
}
-DECLCALLBACK(void) _crVBoxHGSMIClientDestroy(HVBOXCRHGSMI_CLIENT hClient)
+static DECLCALLBACK(void) _crVBoxHGSMIClientDestroy(HVBOXCRHGSMI_CLIENT hClient)
{
Assert(0);
diff --git a/src/VBox/GuestHost/SharedClipboard/Makefile.kmk b/src/VBox/GuestHost/SharedClipboard/Makefile.kmk
index 6c21ab1..3e239d7 100644
--- a/src/VBox/GuestHost/SharedClipboard/Makefile.kmk
+++ b/src/VBox/GuestHost/SharedClipboard/Makefile.kmk
@@ -15,7 +15,7 @@
# hope that it will be useful, but WITHOUT ANY WARRANTY of any kind.
#
-SUB_DEPTH = ../../../../..
+SUB_DEPTH = ../../../..
include $(KBUILD_PATH)/subheader.kmk
if defined(VBOX_WITH_TESTCASES) && !defined(VBOX_ONLY_ADDITIONS) && !defined(VBOX_ONLY_SDK)
diff --git a/src/VBox/GuestHost/SharedClipboard/x11-clipboard.cpp b/src/VBox/GuestHost/SharedClipboard/x11-clipboard.cpp
index 5ed9e0b..e0e19e6 100644
--- a/src/VBox/GuestHost/SharedClipboard/x11-clipboard.cpp
+++ b/src/VBox/GuestHost/SharedClipboard/x11-clipboard.cpp
@@ -620,7 +620,7 @@ void clipPeekEventAndDoXFixesHandling(CLIPBACKEND *pCtx)
* The main loop of our clipboard reader.
* @note X11 backend code.
*/
-static int clipEventThread(RTTHREAD self, void *pvUser)
+static DECLCALLBACK(int) clipEventThread(RTTHREAD self, void *pvUser)
{
LogRel(("Shared clipboard: Starting shared clipboard thread\n"));
diff --git a/src/VBox/HostDrivers/Support/SUPDrv-dtrace.cpp b/src/VBox/HostDrivers/Support/SUPDrv-dtrace.cpp
index 67ad6dc..ecff728 100644
--- a/src/VBox/HostDrivers/Support/SUPDrv-dtrace.cpp
+++ b/src/VBox/HostDrivers/Support/SUPDrv-dtrace.cpp
@@ -25,9 +25,9 @@
*/
-/*******************************************************************************
-* Header Files *
-*******************************************************************************/
+/*********************************************************************************************************************************
+* Header Files *
+*********************************************************************************************************************************/
#define LOG_GROUP LOG_GROUP_SUP_DRV
#include "SUPDrvInternal.h"
@@ -107,9 +107,9 @@
#endif
-/*******************************************************************************
-* Structures and Typedefs *
-*******************************************************************************/
+/*********************************************************************************************************************************
+* Structures and Typedefs *
+*********************************************************************************************************************************/
/* Seems there is some return code difference here. Keep the return code and
case it to whatever the host desires. */
#ifdef RT_OS_DARWIN
@@ -171,9 +171,9 @@ typedef struct VBDTSTACKDATA
typedef VBDTSTACKDATA *PVBDTSTACKDATA;
-/*******************************************************************************
-* Defined Constants And Macros *
-*******************************************************************************/
+/*********************************************************************************************************************************
+* Defined Constants And Macros *
+*********************************************************************************************************************************/
/** The first magic value. */
#define SUPDRVDT_STACK_DATA_MAGIC1 RT_MAKE_U32_FROM_U8('S', 'U', 'P', 'D')
/** The second magic value. */
@@ -211,9 +211,9 @@ typedef VBDTSTACKDATA *PVBDTSTACKDATA;
#endif
-/*******************************************************************************
-* Global Variables *
-*******************************************************************************/
+/*********************************************************************************************************************************
+* Global Variables *
+*********************************************************************************************************************************/
#if defined(RT_OS_DARWIN) || defined(RT_OS_LINUX)
/** @name DTrace kernel interface used on Darwin and Linux.
* @{ */
diff --git a/src/VBox/HostDrivers/Support/SUPDrv.cpp b/src/VBox/HostDrivers/Support/SUPDrv.cpp
index 5d95e8c..944dee0 100644
--- a/src/VBox/HostDrivers/Support/SUPDrv.cpp
+++ b/src/VBox/HostDrivers/Support/SUPDrv.cpp
@@ -24,9 +24,10 @@
* terms and conditions of either the GPL or the CDDL or both.
*/
-/*******************************************************************************
-* Header Files *
-*******************************************************************************/
+
+/*********************************************************************************************************************************
+* Header Files *
+*********************************************************************************************************************************/
#define LOG_GROUP LOG_GROUP_SUP_DRV
#define SUPDRV_AGNOSTIC
#include "SUPDrvInternal.h"
@@ -90,9 +91,9 @@
*/
-/*******************************************************************************
-* Defined Constants And Macros *
-*******************************************************************************/
+/*********************************************************************************************************************************
+* Defined Constants And Macros *
+*********************************************************************************************************************************/
/** @def VBOX_SVN_REV
* The makefile should define this if it can. */
#ifndef VBOX_SVN_REV
@@ -126,9 +127,9 @@
#endif
-/*******************************************************************************
-* Internal Functions *
-*******************************************************************************/
+/*********************************************************************************************************************************
+* Internal Functions *
+*********************************************************************************************************************************/
static DECLCALLBACK(int) supdrvSessionObjHandleRetain(RTHANDLETABLE hHandleTable, void *pvObj, void *pvCtx, void *pvUser);
static DECLCALLBACK(void) supdrvSessionObjHandleDelete(RTHANDLETABLE hHandleTable, uint32_t h, void *pvObj, void *pvCtx, void *pvUser);
static int supdrvMemAdd(PSUPDRVMEMREF pMem, PSUPDRVSESSION pSession);
@@ -139,7 +140,7 @@ static int supdrvIOCtl_LdrFree(PSUPDRVDEVEXT pDevExt, PSUPDRVSE
static int supdrvIOCtl_LdrLockDown(PSUPDRVDEVEXT pDevExt);
static int supdrvIOCtl_LdrGetSymbol(PSUPDRVDEVEXT pDevExt, PSUPDRVSESSION pSession, PSUPLDRGETSYMBOL pReq);
static int supdrvIDC_LdrGetSymbol(PSUPDRVDEVEXT pDevExt, PSUPDRVSESSION pSession, PSUPDRVIDCREQGETSYM pReq);
-static int supdrvLdrSetVMMR0EPs(PSUPDRVDEVEXT pDevExt, void *pvVMMR0, void *pvVMMR0EntryInt,void *pvVMMR0EntryFast, void *pvVMMR0EntryEx);
+static int supdrvLdrSetVMMR0EPs(PSUPDRVDEVEXT pDevExt, void *pvVMMR0, void *pvVMMR0EntryFast, void *pvVMMR0EntryEx);
static void supdrvLdrUnsetVMMR0EPs(PSUPDRVDEVEXT pDevExt);
static int supdrvLdrAddUsage(PSUPDRVSESSION pSession, PSUPDRVLDRIMAGE pImage);
static void supdrvLdrFree(PSUPDRVDEVEXT pDevExt, PSUPDRVLDRIMAGE pImage);
@@ -151,9 +152,9 @@ static int supdrvIOCtl_MsrProber(PSUPDRVDEVEXT pDevExt, PSUPMSR
static int supdrvIOCtl_ResumeSuspendedKbds(void);
-/*******************************************************************************
-* Global Variables *
-*******************************************************************************/
+/*********************************************************************************************************************************
+* Global Variables *
+*********************************************************************************************************************************/
/**
* Array of the R0 SUP API.
*
@@ -4691,6 +4692,27 @@ static int supdrvLdrValidatePointer(PSUPDRVDEVEXT pDevExt, PSUPDRVLDRIMAGE pImag
/**
+ * Formats a load error message.
+ *
+ * @returns @a rc
+ * @param rc Return code.
+ * @param pReq The request.
+ * @param pszFormat The error message format string.
+ * @param ... Argument to the format string.
+ */
+int VBOXCALL supdrvLdrLoadError(int rc, PSUPLDRLOAD pReq, const char *pszFormat, ...)
+{
+ va_list va;
+ va_start(va, pszFormat);
+ pReq->u.Out.uErrorMagic = SUPLDRLOAD_ERROR_MAGIC;
+ RTStrPrintfV(pReq->u.Out.szError, sizeof(pReq->u.Out.szError), pszFormat, va);
+ va_end(va);
+ Log(("SUP_IOCTL_LDR_LOAD: %s [rc=%Rrc]\n", pReq->u.Out.szError, rc));
+ return rc;
+}
+
+
+/**
* Loads the image bits.
*
* This is the 2nd step of the loading.
@@ -4721,8 +4743,7 @@ static int supdrvIOCtl_LdrLoad(PSUPDRVDEVEXT pDevExt, PSUPDRVSESSION pSession, P
if (!pUsage)
{
supdrvLdrUnlock(pDevExt);
- Log(("SUP_IOCTL_LDR_LOAD: couldn't find image!\n"));
- return VERR_INVALID_HANDLE;
+ return supdrvLdrLoadError(VERR_INVALID_HANDLE, pReq, "Image not found");
}
pImage = pUsage->pImage;
@@ -4733,9 +4754,8 @@ static int supdrvIOCtl_LdrLoad(PSUPDRVDEVEXT pDevExt, PSUPDRVSESSION pSession, P
|| pImage->cbImageBits != pReq->u.In.cbImageBits)
{
supdrvLdrUnlock(pDevExt);
- Log(("SUP_IOCTL_LDR_LOAD: image size mismatch!! %d(prep) != %d(load) or %d != %d\n",
- pImage->cbImageWithTabs, pReq->u.In.cbImageWithTabs, pImage->cbImageBits, pReq->u.In.cbImageBits));
- return VERR_INVALID_HANDLE;
+ return supdrvLdrLoadError(VERR_INVALID_HANDLE, pReq, "Image size mismatch found: %d(prep) != %d(load) or %d != %d",
+ pImage->cbImageWithTabs, pReq->u.In.cbImageWithTabs, pImage->cbImageBits, pReq->u.In.cbImageBits);
}
if (pImage->uState != SUP_IOCTL_LDR_OPEN)
@@ -4744,6 +4764,7 @@ static int supdrvIOCtl_LdrLoad(PSUPDRVDEVEXT pDevExt, PSUPDRVSESSION pSession, P
supdrvLdrUnlock(pDevExt);
if (uState != SUP_IOCTL_LDR_LOAD)
AssertMsgFailed(("SUP_IOCTL_LDR_LOAD: invalid image state %d (%#x)!\n", uState, uState));
+ pReq->u.Out.uErrorMagic = 0;
return VERR_ALREADY_LOADED;
}
@@ -4751,8 +4772,7 @@ static int supdrvIOCtl_LdrLoad(PSUPDRVDEVEXT pDevExt, PSUPDRVSESSION pSession, P
if (pDevExt->fLdrLockedDown)
{
supdrvLdrUnlock(pDevExt);
- Log(("SUP_IOCTL_LDR_LOAD: Not loading '%s' image bits, loader interface is locked down!\n", pImage->szName));
- return VERR_PERMISSION_DENIED;
+ return supdrvLdrLoadError(VERR_PERMISSION_DENIED, pReq, "Loader is locked down");
}
switch (pReq->u.In.eEPType)
@@ -4763,45 +4783,42 @@ static int supdrvIOCtl_LdrLoad(PSUPDRVDEVEXT pDevExt, PSUPDRVSESSION pSession, P
case SUPLDRLOADEP_VMMR0:
rc = supdrvLdrValidatePointer( pDevExt, pImage, pReq->u.In.EP.VMMR0.pvVMMR0, false, pReq->u.In.abImage, "pvVMMR0");
if (RT_SUCCESS(rc))
- rc = supdrvLdrValidatePointer(pDevExt, pImage, pReq->u.In.EP.VMMR0.pvVMMR0EntryInt, false, pReq->u.In.abImage, "pvVMMR0EntryInt");
- if (RT_SUCCESS(rc))
rc = supdrvLdrValidatePointer(pDevExt, pImage, pReq->u.In.EP.VMMR0.pvVMMR0EntryFast, false, pReq->u.In.abImage, "pvVMMR0EntryFast");
if (RT_SUCCESS(rc))
rc = supdrvLdrValidatePointer(pDevExt, pImage, pReq->u.In.EP.VMMR0.pvVMMR0EntryEx, false, pReq->u.In.abImage, "pvVMMR0EntryEx");
if (RT_FAILURE(rc))
- return rc;
+ return supdrvLdrLoadError(rc, pReq, "Invalid VMMR0 pointer");
break;
case SUPLDRLOADEP_SERVICE:
rc = supdrvLdrValidatePointer(pDevExt, pImage, pReq->u.In.EP.Service.pfnServiceReq, false, pReq->u.In.abImage, "pfnServiceReq");
if (RT_FAILURE(rc))
- return rc;
+ return supdrvLdrLoadError(rc, pReq, "Invalid pfnServiceReq pointer: %p", pReq->u.In.EP.Service.pfnServiceReq);
if ( pReq->u.In.EP.Service.apvReserved[0] != NIL_RTR0PTR
|| pReq->u.In.EP.Service.apvReserved[1] != NIL_RTR0PTR
|| pReq->u.In.EP.Service.apvReserved[2] != NIL_RTR0PTR)
{
supdrvLdrUnlock(pDevExt);
- Log(("Out of range (%p LB %#x): apvReserved={%p,%p,%p} MBZ!\n",
- pImage->pvImage, pReq->u.In.cbImageWithTabs,
- pReq->u.In.EP.Service.apvReserved[0],
- pReq->u.In.EP.Service.apvReserved[1],
- pReq->u.In.EP.Service.apvReserved[2]));
- return VERR_INVALID_PARAMETER;
+ return supdrvLdrLoadError(VERR_INVALID_PARAMETER, pReq,
+ "Out of range (%p LB %#x): apvReserved={%p,%p,%p} MBZ!",
+ pImage->pvImage, pReq->u.In.cbImageWithTabs,
+ pReq->u.In.EP.Service.apvReserved[0],
+ pReq->u.In.EP.Service.apvReserved[1],
+ pReq->u.In.EP.Service.apvReserved[2]);
}
break;
default:
supdrvLdrUnlock(pDevExt);
- Log(("Invalid eEPType=%d\n", pReq->u.In.eEPType));
- return VERR_INVALID_PARAMETER;
+ return supdrvLdrLoadError(VERR_INVALID_PARAMETER, pReq, "Invalid eEPType=%d", pReq->u.In.eEPType);
}
rc = supdrvLdrValidatePointer(pDevExt, pImage, pReq->u.In.pfnModuleInit, true, pReq->u.In.abImage, "pfnModuleInit");
if (RT_FAILURE(rc))
- return rc;
+ return supdrvLdrLoadError(rc, pReq, "Invalid pfnModuleInit pointer: %p", pReq->u.In.pfnModuleInit);
rc = supdrvLdrValidatePointer(pDevExt, pImage, pReq->u.In.pfnModuleTerm, true, pReq->u.In.abImage, "pfnModuleTerm");
if (RT_FAILURE(rc))
- return rc;
+ return supdrvLdrLoadError(rc, pReq, "Invalid pfnModuleTerm pointer: %p", pReq->u.In.pfnModuleTerm);
SUPDRV_CHECK_SMAP_CHECK(pDevExt, RT_NOTHING);
/*
@@ -4815,7 +4832,7 @@ static int supdrvIOCtl_LdrLoad(PSUPDRVDEVEXT pDevExt, PSUPDRVSESSION pSession, P
if (pImage->pachStrTab)
memcpy(pImage->pachStrTab, &pReq->u.In.abImage[pReq->u.In.offStrTab], pImage->cbStrTab);
else
- rc = /*VERR_NO_MEMORY*/ VERR_INTERNAL_ERROR_3;
+ rc = supdrvLdrLoadError(VERR_NO_MEMORY, pReq, "Out of memory for string table: %#x", pImage->cbStrTab);
SUPDRV_CHECK_SMAP_CHECK(pDevExt, RT_NOTHING);
}
@@ -4827,7 +4844,7 @@ static int supdrvIOCtl_LdrLoad(PSUPDRVDEVEXT pDevExt, PSUPDRVSESSION pSession, P
if (pImage->paSymbols)
memcpy(pImage->paSymbols, &pReq->u.In.abImage[pReq->u.In.offSymbols], cbSymbols);
else
- rc = /*VERR_NO_MEMORY*/ VERR_INTERNAL_ERROR_4;
+ rc = supdrvLdrLoadError(VERR_NO_MEMORY, pReq, "Out of memory for symbol table: %#x", cbSymbols);
SUPDRV_CHECK_SMAP_CHECK(pDevExt, RT_NOTHING);
}
@@ -4862,7 +4879,7 @@ static int supdrvIOCtl_LdrLoad(PSUPDRVDEVEXT pDevExt, PSUPDRVSESSION pSession, P
rc = VINF_SUCCESS;
break;
case SUPLDRLOADEP_VMMR0:
- rc = supdrvLdrSetVMMR0EPs(pDevExt, pReq->u.In.EP.VMMR0.pvVMMR0, pReq->u.In.EP.VMMR0.pvVMMR0EntryInt,
+ rc = supdrvLdrSetVMMR0EPs(pDevExt, pReq->u.In.EP.VMMR0.pvVMMR0,
pReq->u.In.EP.VMMR0.pvVMMR0EntryFast, pReq->u.In.EP.VMMR0.pvVMMR0EntryEx);
break;
case SUPLDRLOADEP_SERVICE:
@@ -4886,12 +4903,20 @@ static int supdrvIOCtl_LdrLoad(PSUPDRVDEVEXT pDevExt, PSUPDRVSESSION pSession, P
SUPDRV_CHECK_SMAP_CHECK(pDevExt, RT_NOTHING);
pDevExt->pLdrInitImage = NULL;
pDevExt->hLdrInitThread = NIL_RTNATIVETHREAD;
- if (RT_FAILURE(rc) && pDevExt->pvVMMR0 == pImage->pvImage)
- supdrvLdrUnsetVMMR0EPs(pDevExt);
+ if (RT_FAILURE(rc))
+ {
+ if (pDevExt->pvVMMR0 == pImage->pvImage)
+ supdrvLdrUnsetVMMR0EPs(pDevExt);
+ supdrvLdrLoadError(rc, pReq, "ModuleInit failed: %Rrc", rc);
+ }
}
- SUPR0Printf("vboxdrv: %p %s\n", pImage->pvImage, pImage->szName);
-
- if (RT_FAILURE(rc))
+ if (RT_SUCCESS(rc))
+ {
+ SUPR0Printf("vboxdrv: %p %s\n", pImage->pvImage, pImage->szName);
+ pReq->u.Out.uErrorMagic = 0;
+ pReq->u.Out.szError[0] = '\0';
+ }
+ else
{
/* Inform the tracing component in case ModuleInit registered TPs. */
supdrvTracerModuleUnloading(pDevExt, pImage);
@@ -5208,15 +5233,14 @@ static int supdrvIDC_LdrGetSymbol(PSUPDRVDEVEXT pDevExt, PSUPDRVSESSION pSession
* @param pDevExt Device globals.
* @param pSession Session data.
* @param pVMMR0 VMMR0 image handle.
- * @param pvVMMR0EntryInt VMMR0EntryInt address.
* @param pvVMMR0EntryFast VMMR0EntryFast address.
* @param pvVMMR0EntryEx VMMR0EntryEx address.
* @remark Caller must own the loader mutex.
*/
-static int supdrvLdrSetVMMR0EPs(PSUPDRVDEVEXT pDevExt, void *pvVMMR0, void *pvVMMR0EntryInt, void *pvVMMR0EntryFast, void *pvVMMR0EntryEx)
+static int supdrvLdrSetVMMR0EPs(PSUPDRVDEVEXT pDevExt, void *pvVMMR0, void *pvVMMR0EntryFast, void *pvVMMR0EntryEx)
{
int rc = VINF_SUCCESS;
- LogFlow(("supdrvLdrSetR0EP pvVMMR0=%p pvVMMR0EntryInt=%p\n", pvVMMR0, pvVMMR0EntryInt));
+ LogFlow(("supdrvLdrSetR0EP pvVMMR0=%p pvVMMR0EntryFast=%p\n", pvVMMR0, pvVMMR0EntryFast));
/*
@@ -5225,7 +5249,6 @@ static int supdrvLdrSetVMMR0EPs(PSUPDRVDEVEXT pDevExt, void *pvVMMR0, void *pvVM
if (!pDevExt->pvVMMR0)
{
pDevExt->pvVMMR0 = pvVMMR0;
- *(void **)&pDevExt->pfnVMMR0EntryInt = pvVMMR0EntryInt;
*(void **)&pDevExt->pfnVMMR0EntryFast = pvVMMR0EntryFast;
*(void **)&pDevExt->pfnVMMR0EntryEx = pvVMMR0EntryEx;
ASMCompilerBarrier(); /* the above isn't nice, so be careful... */
@@ -5236,7 +5259,6 @@ static int supdrvLdrSetVMMR0EPs(PSUPDRVDEVEXT pDevExt, void *pvVMMR0, void *pvVM
* Return failure or success depending on whether the values match or not.
*/
if ( pDevExt->pvVMMR0 != pvVMMR0
- || (void *)pDevExt->pfnVMMR0EntryInt != pvVMMR0EntryInt
|| (void *)pDevExt->pfnVMMR0EntryFast != pvVMMR0EntryFast
|| (void *)pDevExt->pfnVMMR0EntryEx != pvVMMR0EntryEx)
{
@@ -5256,7 +5278,6 @@ static int supdrvLdrSetVMMR0EPs(PSUPDRVDEVEXT pDevExt, void *pvVMMR0, void *pvVM
static void supdrvLdrUnsetVMMR0EPs(PSUPDRVDEVEXT pDevExt)
{
pDevExt->pvVMMR0 = NULL;
- pDevExt->pfnVMMR0EntryInt = NULL;
pDevExt->pfnVMMR0EntryFast = NULL;
pDevExt->pfnVMMR0EntryEx = NULL;
}
diff --git a/src/VBox/HostDrivers/Support/SUPDrvGip.cpp b/src/VBox/HostDrivers/Support/SUPDrvGip.cpp
index eb833b1..10ac6ef 100644
--- a/src/VBox/HostDrivers/Support/SUPDrvGip.cpp
+++ b/src/VBox/HostDrivers/Support/SUPDrvGip.cpp
@@ -24,9 +24,10 @@
* terms and conditions of either the GPL or the CDDL or both.
*/
-/*******************************************************************************
-* Header Files *
-*******************************************************************************/
+
+/*********************************************************************************************************************************
+* Header Files *
+*********************************************************************************************************************************/
#define LOG_GROUP LOG_GROUP_SUP_DRV
#define SUPDRV_AGNOSTIC
#include "SUPDrvInternal.h"
@@ -68,9 +69,9 @@
#endif
-/*******************************************************************************
-* Defined Constants And Macros *
-*******************************************************************************/
+/*********************************************************************************************************************************
+* Defined Constants And Macros *
+*********************************************************************************************************************************/
/** The frequency by which we recalculate the u32UpdateHz and
* u32UpdateIntervalNS GIP members. The value must be a power of 2.
*
@@ -119,9 +120,9 @@ AssertCompile(GIP_TSC_DELTA_PRIMER_LOOPS + GIP_TSC_DELTA_READ_TIME_LOOPS < GIP_T
#endif
-/*******************************************************************************
-* Internal Functions *
-*******************************************************************************/
+/*********************************************************************************************************************************
+* Internal Functions *
+*********************************************************************************************************************************/
static DECLCALLBACK(void) supdrvGipSyncAndInvariantTimer(PRTTIMER pTimer, void *pvUser, uint64_t iTick);
static DECLCALLBACK(void) supdrvGipAsyncTimer(PRTTIMER pTimer, void *pvUser, uint64_t iTick);
static int supdrvGipSetFlags(PSUPDRVDEVEXT pDevExt, PSUPDRVSESSION pSession, uint32_t fOrMask, uint32_t fAndMask);
@@ -137,9 +138,9 @@ static int supdrvMeasureTscDeltaOne(PSUPDRVDEVEXT pDevExt, uint
#endif
-/*******************************************************************************
-* Global Variables *
-*******************************************************************************/
+/*********************************************************************************************************************************
+* Global Variables *
+*********************************************************************************************************************************/
DECLEXPORT(PSUPGLOBALINFOPAGE) g_pSUPGlobalInfoPage = NULL;
diff --git a/src/VBox/HostDrivers/Support/SUPDrvIOC.h b/src/VBox/HostDrivers/Support/SUPDrvIOC.h
index 06cf212..2d07f2c 100644
--- a/src/VBox/HostDrivers/Support/SUPDrvIOC.h
+++ b/src/VBox/HostDrivers/Support/SUPDrvIOC.h
@@ -214,7 +214,7 @@ typedef SUPREQHDR *PSUPREQHDR;
* @todo Pending work on next major version change:
* - nothing.
*/
-#define SUPDRV_IOC_VERSION 0x00230003
+#define SUPDRV_IOC_VERSION 0x00240000
/** SUP_IOCTL_COOKIE. */
typedef struct SUPCOOKIE
@@ -337,9 +337,9 @@ typedef struct SUPLDROPEN
* @{
*/
#define SUP_IOCTL_LDR_LOAD SUP_CTL_CODE_BIG(4)
-#define SUP_IOCTL_LDR_LOAD_SIZE(cbImage) RT_UOFFSETOF(SUPLDRLOAD, u.In.abImage[cbImage])
+#define SUP_IOCTL_LDR_LOAD_SIZE(cbImage) RT_MAX(RT_UOFFSETOF(SUPLDRLOAD, u.In.abImage[cbImage]), SUP_IOCTL_LDR_LOAD_SIZE_OUT)
#define SUP_IOCTL_LDR_LOAD_SIZE_IN(cbImage) RT_UOFFSETOF(SUPLDRLOAD, u.In.abImage[cbImage])
-#define SUP_IOCTL_LDR_LOAD_SIZE_OUT sizeof(SUPREQHDR)
+#define SUP_IOCTL_LDR_LOAD_SIZE_OUT (RT_UOFFSETOF(SUPLDRLOAD, u.Out.szError) + RT_SIZEOFMEMB(SUPLDRLOAD, u.Out.szError))
/**
* Module initialization callback function.
@@ -413,8 +413,6 @@ typedef struct SUPLDRLOAD
{
/** The module handle (i.e. address). */
RTR0PTR pvVMMR0;
- /** Address of VMMR0EntryInt function. */
- RTR0PTR pvVMMR0EntryInt;
/** Address of VMMR0EntryFast function. */
RTR0PTR pvVMMR0EntryFast;
/** Address of VMMR0EntryEx function. */
@@ -450,8 +448,20 @@ typedef struct SUPLDRLOAD
/** The image data. */
uint8_t abImage[1];
} In;
+ struct
+ {
+ /** Magic value indicating whether extended error information is
+ * present or not (SUPLDRLOAD_ERROR_MAGIC). */
+ uint64_t uErrorMagic;
+ /** Extended error information. */
+ char szError[2048];
+ } Out;
} u;
} SUPLDRLOAD, *PSUPLDRLOAD;
+/** Magic value that indicates that there is a valid error information string
+ * present on SUP_IOCTL_LDR_LOAD failure.
+ * @remarks The value is choosen to be an unlikely init and term address. */
+#define SUPLDRLOAD_ERROR_MAGIC UINT64_C(0xabcdefef0feddcb9)
/** @} */
diff --git a/src/VBox/HostDrivers/Support/SUPDrvInternal.h b/src/VBox/HostDrivers/Support/SUPDrvInternal.h
index 24fdb76..1990bcd 100644
--- a/src/VBox/HostDrivers/Support/SUPDrvInternal.h
+++ b/src/VBox/HostDrivers/Support/SUPDrvInternal.h
@@ -602,8 +602,6 @@ typedef struct SUPDRVDEVEXT
/** VMM Module 'handle'.
* 0 if the code VMM isn't loaded and Idt are nops. */
void * volatile pvVMMR0;
- /** VMMR0EntryInt() pointer. */
- DECLR0CALLBACKMEMBER(int, pfnVMMR0EntryInt, (PVM pVM, unsigned uOperation, void *pvArg));
/** VMMR0EntryFast() pointer. */
DECLR0CALLBACKMEMBER(void, pfnVMMR0EntryFast, (PVM pVM, VMCPUID idCpu, unsigned uOperation));
/** VMMR0EntryEx() pointer. */
@@ -956,6 +954,7 @@ uint32_t VBOXCALL supdrvSessionRetain(PSUPDRVSESSION pSession);
uint32_t VBOXCALL supdrvSessionRelease(PSUPDRVSESSION pSession);
void VBOXCALL supdrvBadContext(PSUPDRVDEVEXT pDevExt, const char *pszFile, uint32_t uLine, const char *pszExtra);
int VBOXCALL supdrvQueryVTCapsInternal(uint32_t *pfCaps);
+int VBOXCALL supdrvLdrLoadError(int rc, PSUPLDRLOAD pReq, const char *pszFormat, ...);
/* SUPDrvGip.cpp */
int VBOXCALL supdrvGipCreate(PSUPDRVDEVEXT pDevExt);
diff --git a/src/VBox/HostDrivers/Support/SUPDrvSem.cpp b/src/VBox/HostDrivers/Support/SUPDrvSem.cpp
index 7aba9f2..80d3d9a 100644
--- a/src/VBox/HostDrivers/Support/SUPDrvSem.cpp
+++ b/src/VBox/HostDrivers/Support/SUPDrvSem.cpp
@@ -24,9 +24,10 @@
* terms and conditions of either the GPL or the CDDL or both.
*/
-/*******************************************************************************
-* Header Files *
-*******************************************************************************/
+
+/*********************************************************************************************************************************
+* Header Files *
+*********************************************************************************************************************************/
#define LOG_GROUP LOG_GROUP_SUP_DRV
#define SUPDRV_AGNOSTIC
#include "SUPDrvInternal.h"
diff --git a/src/VBox/HostDrivers/Support/SUPDrvTracer.cpp b/src/VBox/HostDrivers/Support/SUPDrvTracer.cpp
index dc0ea23..c646cba 100644
--- a/src/VBox/HostDrivers/Support/SUPDrvTracer.cpp
+++ b/src/VBox/HostDrivers/Support/SUPDrvTracer.cpp
@@ -25,9 +25,9 @@
*/
-/*******************************************************************************
-* Header Files *
-*******************************************************************************/
+/*********************************************************************************************************************************
+* Header Files *
+*********************************************************************************************************************************/
#define LOG_GROUP LOG_GROUP_SUP_DRV
#define SUPDRV_AGNOSTIC
#include "SUPDrvInternal.h"
@@ -46,9 +46,9 @@
#include <iprt/uuid.h>
-/*******************************************************************************
-* Structures and Typedefs *
-*******************************************************************************/
+/*********************************************************************************************************************************
+* Structures and Typedefs *
+*********************************************************************************************************************************/
/** Pointer to a user tracer module registration record. */
typedef struct SUPDRVTRACERUMOD *PSUPDRVTRACERUMOD;
@@ -157,9 +157,9 @@ typedef struct SUPDRVTRACERUMOD
#define SUPDRVTRACERUMOD_MAGIC UINT32_C(0x00080486)
-/*******************************************************************************
-* Defined Constants And Macros *
-*******************************************************************************/
+/*********************************************************************************************************************************
+* Defined Constants And Macros *
+*********************************************************************************************************************************/
/** Simple SUPR0Printf-style logging. */
#ifdef DEBUG_bird
# define LOG_TRACER(a_Args) SUPR0Printf a_Args
@@ -168,16 +168,16 @@ typedef struct SUPDRVTRACERUMOD
#endif
-/*******************************************************************************
-* Global Variables *
-*******************************************************************************/
+/*********************************************************************************************************************************
+* Global Variables *
+*********************************************************************************************************************************/
/** The address of the current probe fire routine for kernel mode. */
PFNRT g_pfnSupdrvProbeFireKernel = supdrvTracerProbeFireStub;
-/*******************************************************************************
-* Internal Functions *
-*******************************************************************************/
+/*********************************************************************************************************************************
+* Internal Functions *
+*********************************************************************************************************************************/
static void supdrvVtgReleaseObjectCopy(PSUPDRVDEVEXT pDevExt, PSUPDRVVTGCOPY pThis);
diff --git a/src/VBox/HostDrivers/Support/SUPLib.cpp b/src/VBox/HostDrivers/Support/SUPLib.cpp
index 6aff7d1..197f651 100644
--- a/src/VBox/HostDrivers/Support/SUPLib.cpp
+++ b/src/VBox/HostDrivers/Support/SUPLib.cpp
@@ -42,9 +42,10 @@
* See @ref grp_sup "SUP - Support APIs" for API details.
*/
-/*******************************************************************************
-* Header Files *
-*******************************************************************************/
+
+/*********************************************************************************************************************************
+* Header Files *
+*********************************************************************************************************************************/
#define LOG_GROUP LOG_GROUP_SUP
#include <VBox/sup.h>
#include <VBox/err.h>
@@ -71,23 +72,23 @@
#include "SUPLibInternal.h"
-/*******************************************************************************
-* Defined Constants And Macros *
-*******************************************************************************/
+/*********************************************************************************************************************************
+* Defined Constants And Macros *
+*********************************************************************************************************************************/
/** R0 VMM module name. */
#define VMMR0_NAME "VMMR0"
-/*******************************************************************************
-* Structures and Typedefs *
-*******************************************************************************/
+/*********************************************************************************************************************************
+* Structures and Typedefs *
+*********************************************************************************************************************************/
typedef DECLCALLBACK(int) FNCALLVMMR0(PVMR0 pVMR0, unsigned uOperation, void *pvArg);
typedef FNCALLVMMR0 *PFNCALLVMMR0;
-/*******************************************************************************
-* Global Variables *
-*******************************************************************************/
+/*********************************************************************************************************************************
+* Global Variables *
+*********************************************************************************************************************************/
/** Init counter. */
static uint32_t g_cInits = 0;
/** Whether we've been preinitied. */
@@ -137,9 +138,9 @@ static bool g_fSupportsPageAllocNoKernel = true;
uint32_t g_uSupFakeMode = ~0;
-/*******************************************************************************
-* Internal Functions *
-*******************************************************************************/
+/*********************************************************************************************************************************
+* Internal Functions *
+*********************************************************************************************************************************/
static int supInitFake(PSUPDRVSESSION *ppSession);
static int supLoadModule(const char *pszFilename, const char *pszModule, const char *pszSrvReqHandler, void **ppvImageBase);
static DECLCALLBACK(int) supLoadModuleResolveImport(RTLDRMOD hLdrMod, const char *pszModule, const char *pszSymbol, unsigned uSymbol, RTUINTPTR *pValue, void *pvUser);
diff --git a/src/VBox/HostDrivers/Support/SUPLibAll.cpp b/src/VBox/HostDrivers/Support/SUPLibAll.cpp
index 6118df2..8b986f4 100644
--- a/src/VBox/HostDrivers/Support/SUPLibAll.cpp
+++ b/src/VBox/HostDrivers/Support/SUPLibAll.cpp
@@ -24,9 +24,10 @@
* terms and conditions of either the GPL or the CDDL or both.
*/
-/*******************************************************************************
-* Header Files *
-*******************************************************************************/
+
+/*********************************************************************************************************************************
+* Header Files *
+*********************************************************************************************************************************/
#include <VBox/sup.h>
#ifdef IN_RC
# include <VBox/vmm/vm.h>
diff --git a/src/VBox/HostDrivers/Support/SUPLibLdr.cpp b/src/VBox/HostDrivers/Support/SUPLibLdr.cpp
index 57fba4c..4b7bd83 100644
--- a/src/VBox/HostDrivers/Support/SUPLibLdr.cpp
+++ b/src/VBox/HostDrivers/Support/SUPLibLdr.cpp
@@ -42,9 +42,10 @@
* See @ref grp_sup "SUP - Support APIs" for API details.
*/
-/*******************************************************************************
-* Header Files *
-*******************************************************************************/
+
+/*********************************************************************************************************************************
+* Header Files *
+*********************************************************************************************************************************/
#define LOG_GROUP LOG_GROUP_SUP
#include <VBox/sup.h>
#include <VBox/err.h>
@@ -71,30 +72,30 @@
#include "SUPLibInternal.h"
-/*******************************************************************************
-* Defined Constants And Macros *
-*******************************************************************************/
+/*********************************************************************************************************************************
+* Defined Constants And Macros *
+*********************************************************************************************************************************/
/** R0 VMM module name. */
#define VMMR0_NAME "VMMR0"
-/*******************************************************************************
-* Structures and Typedefs *
-*******************************************************************************/
+/*********************************************************************************************************************************
+* Structures and Typedefs *
+*********************************************************************************************************************************/
typedef DECLCALLBACK(int) FNCALLVMMR0(PVMR0 pVMR0, unsigned uOperation, void *pvArg);
typedef FNCALLVMMR0 *PFNCALLVMMR0;
-/*******************************************************************************
-* Global Variables *
-*******************************************************************************/
+/*********************************************************************************************************************************
+* Global Variables *
+*********************************************************************************************************************************/
/** VMMR0 Load Address. */
static RTR0PTR g_pvVMMR0 = NIL_RTR0PTR;
-/*******************************************************************************
-* Internal Functions *
-*******************************************************************************/
+/*********************************************************************************************************************************
+* Internal Functions *
+*********************************************************************************************************************************/
static int supLoadModule(const char *pszFilename, const char *pszModule, const char *pszSrvReqHandler,
PRTERRINFO pErrInfo, void **ppvImageBase);
static DECLCALLBACK(int) supLoadModuleResolveImport(RTLDRMOD hLdrMod, const char *pszModule, const char *pszSymbol,
@@ -110,7 +111,7 @@ SUPR3DECL(int) SUPR3LoadModule(const char *pszFilename, const char *pszModule, v
if (RT_SUCCESS(rc))
{
rc = supLoadModule(pszFilename, pszModule, NULL, pErrInfo, ppvImageBase);
- if (RT_FAILURE(rc))
+ if (RT_FAILURE(rc) && !RTErrInfoIsSet(pErrInfo))
RTErrInfoSetF(pErrInfo, rc, "SUPR3LoadModule: supLoadModule returned %Rrc", rc);
}
return rc;
@@ -443,29 +444,32 @@ static int supLoadModule(const char *pszFilename, const char *pszModule, const c
/*
* Get the entry points.
*/
- RTUINTPTR VMMR0EntryInt = 0;
RTUINTPTR VMMR0EntryFast = 0;
RTUINTPTR VMMR0EntryEx = 0;
RTUINTPTR SrvReqHandler = 0;
RTUINTPTR ModuleInit = 0;
RTUINTPTR ModuleTerm = 0;
+ const char *pszEp = NULL;
if (fIsVMMR0)
{
- rc = RTLdrGetSymbolEx(hLdrMod, &pLoadReq->u.In.abImage[0], (uintptr_t)OpenReq.u.Out.pvImageBase, UINT32_MAX, "VMMR0EntryInt", &VMMR0EntryInt);
- if (RT_SUCCESS(rc))
- rc = RTLdrGetSymbolEx(hLdrMod, &pLoadReq->u.In.abImage[0], (uintptr_t)OpenReq.u.Out.pvImageBase, UINT32_MAX, "VMMR0EntryFast", &VMMR0EntryFast);
+ rc = RTLdrGetSymbolEx(hLdrMod, &pLoadReq->u.In.abImage[0], (uintptr_t)OpenReq.u.Out.pvImageBase,
+ UINT32_MAX, pszEp = "VMMR0EntryFast", &VMMR0EntryFast);
if (RT_SUCCESS(rc))
- rc = RTLdrGetSymbolEx(hLdrMod, &pLoadReq->u.In.abImage[0], (uintptr_t)OpenReq.u.Out.pvImageBase, UINT32_MAX, "VMMR0EntryEx", &VMMR0EntryEx);
+ rc = RTLdrGetSymbolEx(hLdrMod, &pLoadReq->u.In.abImage[0], (uintptr_t)OpenReq.u.Out.pvImageBase,
+ UINT32_MAX, pszEp = "VMMR0EntryEx", &VMMR0EntryEx);
}
else if (pszSrvReqHandler)
- rc = RTLdrGetSymbolEx(hLdrMod, &pLoadReq->u.In.abImage[0], (uintptr_t)OpenReq.u.Out.pvImageBase, UINT32_MAX, pszSrvReqHandler, &SrvReqHandler);
+ rc = RTLdrGetSymbolEx(hLdrMod, &pLoadReq->u.In.abImage[0], (uintptr_t)OpenReq.u.Out.pvImageBase,
+ UINT32_MAX, pszEp = pszSrvReqHandler, &SrvReqHandler);
if (RT_SUCCESS(rc))
{
- int rc2 = RTLdrGetSymbolEx(hLdrMod, &pLoadReq->u.In.abImage[0], (uintptr_t)OpenReq.u.Out.pvImageBase, UINT32_MAX, "ModuleInit", &ModuleInit);
+ int rc2 = RTLdrGetSymbolEx(hLdrMod, &pLoadReq->u.In.abImage[0], (uintptr_t)OpenReq.u.Out.pvImageBase,
+ UINT32_MAX, pszEp = "ModuleInit", &ModuleInit);
if (RT_FAILURE(rc2))
ModuleInit = 0;
- rc2 = RTLdrGetSymbolEx(hLdrMod, &pLoadReq->u.In.abImage[0], (uintptr_t)OpenReq.u.Out.pvImageBase, UINT32_MAX, "ModuleTerm", &ModuleTerm);
+ rc2 = RTLdrGetSymbolEx(hLdrMod, &pLoadReq->u.In.abImage[0], (uintptr_t)OpenReq.u.Out.pvImageBase,
+ UINT32_MAX, pszEp = "ModuleTerm", &ModuleTerm);
if (RT_FAILURE(rc2))
ModuleTerm = 0;
}
@@ -501,7 +505,6 @@ static int supLoadModule(const char *pszFilename, const char *pszModule, const c
{
pLoadReq->u.In.eEPType = SUPLDRLOADEP_VMMR0;
pLoadReq->u.In.EP.VMMR0.pvVMMR0 = OpenReq.u.Out.pvImageBase;
- pLoadReq->u.In.EP.VMMR0.pvVMMR0EntryInt = (RTR0PTR)VMMR0EntryInt;
pLoadReq->u.In.EP.VMMR0.pvVMMR0EntryFast= (RTR0PTR)VMMR0EntryFast;
pLoadReq->u.In.EP.VMMR0.pvVMMR0EntryEx = (RTR0PTR)VMMR0EntryEx;
}
@@ -543,8 +546,7 @@ static int supLoadModule(const char *pszFilename, const char *pszModule, const c
if (fIsVMMR0)
{
g_pvVMMR0 = OpenReq.u.Out.pvImageBase;
- LogRel(("SUP: VMMR0EntryEx located at %RTptr, VMMR0EntryFast at %RTptr and VMMR0EntryInt at %RTptr\n",
- VMMR0EntryEx, VMMR0EntryFast, VMMR0EntryInt));
+ LogRel(("SUP: VMMR0EntryEx located at %RTptr and VMMR0EntryFast at %RTptr\n", VMMR0EntryEx, VMMR0EntryFast));
}
#ifdef RT_OS_WINDOWS
LogRel(("SUP: windbg> .reload /f %s=%#p\n", pszFilename, OpenReq.u.Out.pvImageBase));
@@ -554,25 +556,50 @@ static int supLoadModule(const char *pszFilename, const char *pszModule, const c
RTLdrClose(hLdrMod);
return VINF_SUCCESS;
}
+
+ /*
+ * Failed, bail out.
+ */
+ LogRel(("SUP: Loading failed for %s (%s) rc=%Rrc\n", pszModule, pszFilename, rc));
+ if ( pLoadReq->u.Out.uErrorMagic == SUPLDRLOAD_ERROR_MAGIC
+ && pLoadReq->u.Out.szError[0] != '\0')
+ {
+ LogRel(("SUP: %s\n", pLoadReq->u.Out.szError));
+ RTErrInfoSet(pErrInfo, rc, pLoadReq->u.Out.szError);
+ }
else
- LogRel(("SUP: Loading failed for %s (%s) rc=%Rrc\n", pszModule, pszFilename, rc));
+ RTErrInfoSet(pErrInfo, rc, "SUP_IOCTL_LDR_LOAD failed");
}
else
+ {
LogRel(("SUP: RTLdrEnumSymbols failed for %s (%s) rc=%Rrc\n", pszModule, pszFilename, rc));
+ RTErrInfoSetF(pErrInfo, rc, "RTLdrEnumSymbols #2 failed");
+ }
}
else
- LogRel(("SUP: Failed to get entry points for %s (%s) rc=%Rrc\n", pszModule, pszFilename, rc));
+ {
+ LogRel(("SUP: Failed to get entry point '%s' for %s (%s) rc=%Rrc\n", pszEp, pszModule, pszFilename, rc));
+ RTErrInfoSetF(pErrInfo, rc, "Failed to resolve entry point '%s'", pszEp);
+ }
}
else
+ {
LogRel(("SUP: RTLdrGetBits failed for %s (%s). rc=%Rrc\n", pszModule, pszFilename, rc));
+ if (!RTErrInfoIsSet(pErrInfo))
+ RTErrInfoSetF(pErrInfo, rc, "RTLdrGetBits failed");
+ }
RTMemTmpFree(pLoadReq);
}
else
{
AssertMsgFailed(("failed to allocated %u bytes for SUPLDRLOAD_IN structure!\n", SUP_IOCTL_LDR_LOAD_SIZE(cbImageWithTabs)));
rc = VERR_NO_TMP_MEMORY;
+ RTErrInfoSetF(pErrInfo, rc, "Failed to allocate %u bytes for the load request", SUP_IOCTL_LDR_LOAD_SIZE(cbImageWithTabs));
}
}
+ /*
+ * Already loaded?
+ */
else if (RT_SUCCESS(rc))
{
if (fIsVMMR0)
@@ -583,7 +610,14 @@ static int supLoadModule(const char *pszFilename, const char *pszModule, const c
LogRel(("SUP: windbg> .reload /f %s=%#p\n", pszFilename, OpenReq.u.Out.pvImageBase));
#endif
}
+ /*
+ * No, failed.
+ */
+ else
+ RTErrInfoSet(pErrInfo, rc, "SUP_IOCTL_LDR_OPEN failed");
}
+ else
+ RTErrInfoSetF(pErrInfo, rc, "RTLdrEnumSymbols #1 failed");
RTLdrClose(hLdrMod);
return rc;
}
diff --git a/src/VBox/HostDrivers/Support/SUPLibSem.cpp b/src/VBox/HostDrivers/Support/SUPLibSem.cpp
index 1b34c3e..3b22d46 100644
--- a/src/VBox/HostDrivers/Support/SUPLibSem.cpp
+++ b/src/VBox/HostDrivers/Support/SUPLibSem.cpp
@@ -25,9 +25,9 @@
*/
-/*******************************************************************************
-* Header Files *
-*******************************************************************************/
+/*********************************************************************************************************************************
+* Header Files *
+*********************************************************************************************************************************/
#define LOG_GROUP LOG_GROUP_SUP
#include <VBox/sup.h>
diff --git a/src/VBox/HostDrivers/Support/SUPR0-def-lx.sed b/src/VBox/HostDrivers/Support/SUPR0-def-lx.sed
index 1332d47..8343427 100644
--- a/src/VBox/HostDrivers/Support/SUPR0-def-lx.sed
+++ b/src/VBox/HostDrivers/Support/SUPR0-def-lx.sed
@@ -36,12 +36,12 @@ $b footer
# Drop all lines not specifying an export.
/^ { "/!d
-# Handle trailing selection comment (/* solaris-only, os2-only */).
+# Handle trailing selection comment (/* solaris-only, os2-only */).
/\*\/ *$/!b transform
/only-os2/b transform
/only-/!b transform
d
-
+
:transform
# Transform the export line, the format is like this:
# { "g_pSUPGlobalInfoPage", (void *)&g_pSUPGlobalInfoPage }, /* SED: DATA */
diff --git a/src/VBox/HostDrivers/Support/SUPR0-def-pe.sed b/src/VBox/HostDrivers/Support/SUPR0-def-pe.sed
index 786c80a..765b494 100644
--- a/src/VBox/HostDrivers/Support/SUPR0-def-pe.sed
+++ b/src/VBox/HostDrivers/Support/SUPR0-def-pe.sed
@@ -36,12 +36,12 @@ $b footer
# Drop all lines not specifying an export.
/^ { "/!d
-# Handle trailing selection comment (/* solaris-only, windows-only */).
+# Handle trailing selection comment (/* solaris-only, windows-only */).
/\*\/ *$/!b transform
/only-windows/b transform
/only-/!b transform
d
-
+
:transform
# Transform the export line, the format is like this:
# { "g_pSUPGlobalInfoPage", (void *)&g_pSUPGlobalInfoPage }, /* SED: DATA */
diff --git a/src/VBox/HostDrivers/Support/SUPR0IdcClient.c b/src/VBox/HostDrivers/Support/SUPR0IdcClient.c
index 97b7b4e..d80dcf2 100644
--- a/src/VBox/HostDrivers/Support/SUPR0IdcClient.c
+++ b/src/VBox/HostDrivers/Support/SUPR0IdcClient.c
@@ -24,17 +24,18 @@
* terms and conditions of either the GPL or the CDDL or both.
*/
-/*******************************************************************************
-* Header Files *
-*******************************************************************************/
+
+/*********************************************************************************************************************************
+* Header Files *
+*********************************************************************************************************************************/
#include "SUPR0IdcClientInternal.h"
#include <VBox/err.h>
#include <iprt/asm.h>
-/*******************************************************************************
-* Global Variables *
-*******************************************************************************/
+/*********************************************************************************************************************************
+* Global Variables *
+*********************************************************************************************************************************/
static PSUPDRVIDCHANDLE volatile g_pMainHandle = NULL;
diff --git a/src/VBox/HostDrivers/Support/SUPR0IdcClientComponent.c b/src/VBox/HostDrivers/Support/SUPR0IdcClientComponent.c
index 555d4da..9fec82a 100644
--- a/src/VBox/HostDrivers/Support/SUPR0IdcClientComponent.c
+++ b/src/VBox/HostDrivers/Support/SUPR0IdcClientComponent.c
@@ -24,9 +24,10 @@
* terms and conditions of either the GPL or the CDDL or both.
*/
-/*******************************************************************************
-* Header Files *
-*******************************************************************************/
+
+/*********************************************************************************************************************************
+* Header Files *
+*********************************************************************************************************************************/
#include "SUPR0IdcClientInternal.h"
#include <VBox/err.h>
diff --git a/src/VBox/HostDrivers/Support/SUPR0IdcClientStubs.c b/src/VBox/HostDrivers/Support/SUPR0IdcClientStubs.c
index c05109c..6476812 100644
--- a/src/VBox/HostDrivers/Support/SUPR0IdcClientStubs.c
+++ b/src/VBox/HostDrivers/Support/SUPR0IdcClientStubs.c
@@ -24,9 +24,10 @@
* terms and conditions of either the GPL or the CDDL or both.
*/
-/*******************************************************************************
-* Header Files *
-*******************************************************************************/
+
+/*********************************************************************************************************************************
+* Header Files *
+*********************************************************************************************************************************/
#include "SUPR0IdcClientInternal.h"
#include <VBox/err.h>
#include <iprt/asm.h>
diff --git a/src/VBox/HostDrivers/Support/SUPR3HardenedIPRT.cpp b/src/VBox/HostDrivers/Support/SUPR3HardenedIPRT.cpp
index efa33fd..a126c64 100644
--- a/src/VBox/HostDrivers/Support/SUPR3HardenedIPRT.cpp
+++ b/src/VBox/HostDrivers/Support/SUPR3HardenedIPRT.cpp
@@ -24,9 +24,10 @@
* terms and conditions of either the GPL or the CDDL or both.
*/
-/*******************************************************************************
-* Header Files *
-*******************************************************************************/
+
+/*********************************************************************************************************************************
+* Header Files *
+*********************************************************************************************************************************/
#define LOG_GROUP LOG_GROUP_SUP
#include <VBox/sup.h>
#include <VBox/err.h>
diff --git a/src/VBox/HostDrivers/Support/SUPR3HardenedMain.cpp b/src/VBox/HostDrivers/Support/SUPR3HardenedMain.cpp
index 74f4f31..0ef1c29 100644
--- a/src/VBox/HostDrivers/Support/SUPR3HardenedMain.cpp
+++ b/src/VBox/HostDrivers/Support/SUPR3HardenedMain.cpp
@@ -24,9 +24,10 @@
* terms and conditions of either the GPL or the CDDL or both.
*/
-/*******************************************************************************
-* Header Files *
-*******************************************************************************/
+
+/*********************************************************************************************************************************
+* Header Files *
+*********************************************************************************************************************************/
#if defined(RT_OS_OS2)
# define INCL_BASE
# define INCL_ERRORS
@@ -88,9 +89,9 @@
#include "SUPLibInternal.h"
-/*******************************************************************************
-* Defined Constants And Macros *
-*******************************************************************************/
+/*********************************************************************************************************************************
+* Defined Constants And Macros *
+*********************************************************************************************************************************/
/** @def SUP_HARDENED_SUID
* Whether we're employing set-user-ID-on-execute in the hardening.
*/
@@ -110,9 +111,9 @@
#endif
-/*******************************************************************************
-* Structures and Typedefs *
-*******************************************************************************/
+/*********************************************************************************************************************************
+* Structures and Typedefs *
+*********************************************************************************************************************************/
/** @see RTR3InitEx */
typedef DECLCALLBACK(int) FNRTR3INITEX(uint32_t iVersion, uint32_t fFlags, int cArgs,
char **papszArgs, const char *pszProgramPath);
@@ -123,9 +124,9 @@ typedef DECLCALLBACK(void) FNRTLOGRELPRINTF(const char *pszFormat, ...);
typedef FNRTLOGRELPRINTF *PFNRTLOGRELPRINTF;
-/*******************************************************************************
-* Global Variables *
-*******************************************************************************/
+/*********************************************************************************************************************************
+* Global Variables *
+*********************************************************************************************************************************/
/** The pre-init data we pass on to SUPR3 (residing in VBoxRT). */
static SUPPREINITDATA g_SupPreInitData;
/** The program executable path. */
@@ -173,9 +174,9 @@ static RTUTF16 g_wszStartupLogVol[16];
#endif
-/*******************************************************************************
-* Internal Functions *
-*******************************************************************************/
+/*********************************************************************************************************************************
+* Internal Functions *
+*********************************************************************************************************************************/
#ifdef SUP_HARDENED_SUID
static void supR3HardenedMainDropPrivileges(void);
#endif
diff --git a/src/VBox/HostDrivers/Support/SUPR3HardenedNoCrt.cpp b/src/VBox/HostDrivers/Support/SUPR3HardenedNoCrt.cpp
index c1f25b4..594e6e7 100644
--- a/src/VBox/HostDrivers/Support/SUPR3HardenedNoCrt.cpp
+++ b/src/VBox/HostDrivers/Support/SUPR3HardenedNoCrt.cpp
@@ -24,9 +24,10 @@
* terms and conditions of either the GPL or the CDDL or both.
*/
-/*******************************************************************************
-* Header Files *
-*******************************************************************************/
+
+/*********************************************************************************************************************************
+* Header Files *
+*********************************************************************************************************************************/
#if RT_OS_WINDOWS
# include <Windows.h>
#endif
diff --git a/src/VBox/HostDrivers/Support/SUPR3HardenedVerify.cpp b/src/VBox/HostDrivers/Support/SUPR3HardenedVerify.cpp
index 5e6a738..cccb041 100644
--- a/src/VBox/HostDrivers/Support/SUPR3HardenedVerify.cpp
+++ b/src/VBox/HostDrivers/Support/SUPR3HardenedVerify.cpp
@@ -24,9 +24,10 @@
* terms and conditions of either the GPL or the CDDL or both.
*/
-/*******************************************************************************
-* Header Files *
-*******************************************************************************/
+
+/*********************************************************************************************************************************
+* Header Files *
+*********************************************************************************************************************************/
#if defined(RT_OS_OS2)
# define INCL_BASE
# define INCL_ERRORS
@@ -79,9 +80,9 @@
#endif
-/*******************************************************************************
-* Defined Constants And Macros *
-*******************************************************************************/
+/*********************************************************************************************************************************
+* Defined Constants And Macros *
+*********************************************************************************************************************************/
/** The max path length acceptable for a trusted path. */
#define SUPR3HARDENED_MAX_PATH 260U
@@ -97,9 +98,9 @@
#endif
-/*******************************************************************************
-* Global Variables *
-*******************************************************************************/
+/*********************************************************************************************************************************
+* Global Variables *
+*********************************************************************************************************************************/
/**
* The files that gets verified.
*
@@ -107,6 +108,9 @@
* @todo The excessive use of kSupID_AppSharedLib needs to be reviewed at some point. For
* the time being we're building the linux packages with SharedLib pointing to
* AppPrivArch (lazy bird).
+ *
+ * @remarks If you add executables here, you might need to update
+ * g_apszSupNtVpAllowedVmExes in SUPHardenedVerifyProcess-win.cpp.
*/
static SUPINSTFILE const g_aSupInstallFiles[] =
{
@@ -231,6 +235,7 @@ static SUPINSTFILE const g_aSupInstallFiles[] =
{ kSupIFT_TestExe, kSupID_Testcase, true, a_szName SUPLIB_EXE_SUFF }, \
{ kSupIFT_TestDll, kSupID_Testcase, true, a_szName SUPLIB_DLL_SUFF }
HARDENED_TESTCASE_ENTRY("tstCFGM"),
+ HARDENED_TESTCASE_ENTRY("tstGIP-2"),
HARDENED_TESTCASE_ENTRY("tstIntNet-1"),
HARDENED_TESTCASE_ENTRY("tstMMHyperHeap"),
HARDENED_TESTCASE_ENTRY("tstRTR0ThreadPreemptionDriver"),
diff --git a/src/VBox/HostDrivers/Support/SUPSvc.cpp b/src/VBox/HostDrivers/Support/SUPSvc.cpp
index 5f981ed..a8708fa 100644
--- a/src/VBox/HostDrivers/Support/SUPSvc.cpp
+++ b/src/VBox/HostDrivers/Support/SUPSvc.cpp
@@ -24,9 +24,10 @@
* terms and conditions of either the GPL or the CDDL or both.
*/
-/*******************************************************************************
-* Header Files *
-*******************************************************************************/
+
+/*********************************************************************************************************************************
+* Header Files *
+*********************************************************************************************************************************/
#define LOG_GROUP LOG_GROUP_SUP
#include <VBox/log.h>
#include <iprt/string.h>
@@ -37,9 +38,9 @@
#include "SUPSvcInternal.h"
-/*******************************************************************************
-* Structures and Typedefs *
-*******************************************************************************/
+/*********************************************************************************************************************************
+* Structures and Typedefs *
+*********************************************************************************************************************************/
/**
* Service state.
*/
@@ -107,9 +108,9 @@ typedef SUPSVCSERVICE const *PCSUPSVCSERVICE;
-/*******************************************************************************
-* Global Variables *
-*******************************************************************************/
+/*********************************************************************************************************************************
+* Global Variables *
+*********************************************************************************************************************************/
static SUPSVCSERVICE g_aServices[] =
{
{
diff --git a/src/VBox/HostDrivers/Support/SUPSvcGlobal.cpp b/src/VBox/HostDrivers/Support/SUPSvcGlobal.cpp
index beed1f1..e58a4d0 100644
--- a/src/VBox/HostDrivers/Support/SUPSvcGlobal.cpp
+++ b/src/VBox/HostDrivers/Support/SUPSvcGlobal.cpp
@@ -24,9 +24,10 @@
* terms and conditions of either the GPL or the CDDL or both.
*/
-/*******************************************************************************
-* Header Files *
-*******************************************************************************/
+
+/*********************************************************************************************************************************
+* Header Files *
+*********************************************************************************************************************************/
#include "SUPSvcInternal.h"
#include <iprt/err.h>
diff --git a/src/VBox/HostDrivers/Support/SUPSvcGrant.cpp b/src/VBox/HostDrivers/Support/SUPSvcGrant.cpp
index f17a443..4ec94f2 100644
--- a/src/VBox/HostDrivers/Support/SUPSvcGrant.cpp
+++ b/src/VBox/HostDrivers/Support/SUPSvcGrant.cpp
@@ -24,9 +24,10 @@
* terms and conditions of either the GPL or the CDDL or both.
*/
-/*******************************************************************************
-* Header Files *
-*******************************************************************************/
+
+/*********************************************************************************************************************************
+* Header Files *
+*********************************************************************************************************************************/
#define LOG_GROUP LOG_GROUP_SUP
#include "SUPSvcInternal.h"
@@ -42,9 +43,9 @@
#include <iprt/localipc.h>
-/*******************************************************************************
-* Structures and Typedefs *
-*******************************************************************************/
+/*********************************************************************************************************************************
+* Structures and Typedefs *
+*********************************************************************************************************************************/
/** Pointer to a client instance. */
typedef struct SUPSVCGRANTSESSION *PSUPSVCGRANTSESSION;
/** Pointer to a Grant service instance. */
@@ -144,9 +145,9 @@ typedef struct SUPSVCGRANT
} SUPSVCGRANT;
-/*******************************************************************************
-* Internal Functions *
-*******************************************************************************/
+/*********************************************************************************************************************************
+* Internal Functions *
+*********************************************************************************************************************************/
static const char *supSvcGrantStateName(SUPSVCGRANTSTATE enmState);
diff --git a/src/VBox/HostDrivers/Support/darwin/SUPDrv-darwin.cpp b/src/VBox/HostDrivers/Support/darwin/SUPDrv-darwin.cpp
index 6679f16..9d172b7 100644
--- a/src/VBox/HostDrivers/Support/darwin/SUPDrv-darwin.cpp
+++ b/src/VBox/HostDrivers/Support/darwin/SUPDrv-darwin.cpp
@@ -24,9 +24,10 @@
* terms and conditions of either the GPL or the CDDL or both.
*/
-/*******************************************************************************
-* Header Files *
-*******************************************************************************/
+
+/*********************************************************************************************************************************
+* Header Files *
+*********************************************************************************************************************************/
#define LOG_GROUP LOG_GROUP_SUP_DRV
#include "../../../Runtime/r0drv/darwin/the-darwin-kernel.h"
@@ -75,9 +76,9 @@ RT_C_DECLS_END
proc_selfname(pszProcName, VBOX_PROC_SELFNAME_LEN)
-/*******************************************************************************
-* Defined Constants And Macros *
-*******************************************************************************/
+/*********************************************************************************************************************************
+* Defined Constants And Macros *
+*********************************************************************************************************************************/
/** The system device node name. */
#define DEVICE_NAME_SYS "vboxdrv"
@@ -86,9 +87,9 @@ RT_C_DECLS_END
-/*******************************************************************************
-* Internal Functions *
-*******************************************************************************/
+/*********************************************************************************************************************************
+* Internal Functions *
+*********************************************************************************************************************************/
RT_C_DECLS_BEGIN
static kern_return_t VBoxDrvDarwinStart(struct kmod_info *pKModInfo, void *pvData);
static kern_return_t VBoxDrvDarwinStop(struct kmod_info *pKModInfo, void *pvData);
@@ -108,9 +109,9 @@ static int vboxdrvDarwinResolveSymbols(void);
static bool vboxdrvDarwinCpuHasSMAP(void);
-/*******************************************************************************
-* Structures and Typedefs *
-*******************************************************************************/
+/*********************************************************************************************************************************
+* Structures and Typedefs *
+*********************************************************************************************************************************/
/**
* The service class.
* This is just a formality really.
@@ -160,9 +161,9 @@ OSDefineMetaClassAndStructors(org_virtualbox_SupDrvClient, IOUserClient);
-/*******************************************************************************
-* Global Variables *
-*******************************************************************************/
+/*********************************************************************************************************************************
+* Global Variables *
+*********************************************************************************************************************************/
/**
* Declare the module stuff.
*/
@@ -715,17 +716,20 @@ static int VBoxDrvDarwinIOCtlSlow(PSUPDRVSESSION pSession, u_long iCmd, caddr_t
/*
* Get the header and figure out how much we're gonna have to read.
*/
+ IPRT_DARWIN_SAVE_EFL_AC();
SUPREQHDR Hdr;
pUser = (user_addr_t)*(void **)pData;
int rc = copyin(pUser, &Hdr, sizeof(Hdr));
if (RT_UNLIKELY(rc))
{
OSDBGPRINT(("VBoxDrvDarwinIOCtlSlow: copyin(%llx,Hdr,) -> %#x; iCmd=%#lx\n", (unsigned long long)pUser, rc, iCmd));
+ IPRT_DARWIN_RESTORE_EFL_AC();
return rc;
}
if (RT_UNLIKELY((Hdr.fFlags & SUPREQHDR_FLAGS_MAGIC_MASK) != SUPREQHDR_FLAGS_MAGIC))
{
OSDBGPRINT(("VBoxDrvDarwinIOCtlSlow: bad magic fFlags=%#x; iCmd=%#lx\n", Hdr.fFlags, iCmd));
+ IPRT_DARWIN_SAVE_EFL_AC();
return EINVAL;
}
cbReq = RT_MAX(Hdr.cbIn, Hdr.cbOut);
@@ -734,6 +738,7 @@ static int VBoxDrvDarwinIOCtlSlow(PSUPDRVSESSION pSession, u_long iCmd, caddr_t
|| cbReq > _1M*16))
{
OSDBGPRINT(("VBoxDrvDarwinIOCtlSlow: max(%#x,%#x); iCmd=%#lx\n", Hdr.cbIn, Hdr.cbOut, iCmd));
+ IPRT_DARWIN_SAVE_EFL_AC();
return EINVAL;
}
@@ -746,6 +751,7 @@ static int VBoxDrvDarwinIOCtlSlow(PSUPDRVSESSION pSession, u_long iCmd, caddr_t
if (RT_UNLIKELY(!pHdr))
{
OSDBGPRINT(("VBoxDrvDarwinIOCtlSlow: failed to allocate buffer of %d bytes; iCmd=%#lx\n", cbReq, iCmd));
+ IPRT_DARWIN_RESTORE_EFL_AC();
return ENOMEM;
}
rc = copyin(pUser, pHdr, Hdr.cbIn);
@@ -757,10 +763,12 @@ static int VBoxDrvDarwinIOCtlSlow(PSUPDRVSESSION pSession, u_long iCmd, caddr_t
IOFreeAligned(pvPageBuf, RT_ALIGN_Z(cbReq, PAGE_SIZE));
else
RTMemTmpFree(pHdr);
+ IPRT_DARWIN_RESTORE_EFL_AC();
return rc;
}
if (Hdr.cbIn < cbReq)
RT_BZERO((uint8_t *)pHdr + Hdr.cbIn, cbReq - Hdr.cbIn);
+ IPRT_DARWIN_RESTORE_EFL_AC();
}
else
{
@@ -779,6 +787,7 @@ static int VBoxDrvDarwinIOCtlSlow(PSUPDRVSESSION pSession, u_long iCmd, caddr_t
*/
if (pUser)
{
+ IPRT_DARWIN_SAVE_EFL_AC();
uint32_t cbOut = pHdr->cbOut;
if (cbOut > cbReq)
{
@@ -795,6 +804,7 @@ static int VBoxDrvDarwinIOCtlSlow(PSUPDRVSESSION pSession, u_long iCmd, caddr_t
IOFreeAligned(pvPageBuf, RT_ALIGN_Z(cbReq, PAGE_SIZE));
else
RTMemTmpFree(pHdr);
+ IPRT_DARWIN_RESTORE_EFL_AC();
}
}
else
@@ -805,7 +815,11 @@ static int VBoxDrvDarwinIOCtlSlow(PSUPDRVSESSION pSession, u_long iCmd, caddr_t
if (pUser)
{
if (pvPageBuf)
+ {
+ IPRT_DARWIN_SAVE_EFL_AC();
IOFreeAligned(pvPageBuf, RT_ALIGN_Z(cbReq, PAGE_SIZE));
+ IPRT_DARWIN_RESTORE_EFL_AC();
+ }
else
RTMemTmpFree(pHdr);
}
@@ -958,6 +972,7 @@ int VBOXCALL supdrvOSEnableVTx(bool fEnable)
# endif
)
{
+ IPRT_DARWIN_SAVE_EFL_AC();
if (fEnable)
{
/*
@@ -982,7 +997,10 @@ int VBOXCALL supdrvOSEnableVTx(bool fEnable)
rc = VERR_VMX_NO_VMX;
}
if (RT_FAILURE(rc))
+ {
+ IPRT_DARWIN_RESTORE_EFL_AC();
return rc;
+ }
}
g_fDoneCleanup = true;
}
@@ -1018,6 +1036,7 @@ int VBOXCALL supdrvOSEnableVTx(bool fEnable)
rc = VINF_SUCCESS;
LogRel(("VBoxDrv: host_vmxoff -> vmx_use_count=%d\n", *g_pVmxUseCount));
}
+ IPRT_DARWIN_RESTORE_EFL_AC();
}
else
{
@@ -1048,7 +1067,9 @@ bool VBOXCALL supdrvOSSuspendVTxOnCpu(void)
if ( g_pVmxUseCount
&& *g_pVmxUseCount > 0)
{
+ IPRT_DARWIN_SAVE_EFL_AC();
g_pfnVmxSuspend();
+ IPRT_DARWIN_RESTORE_EFL_AC();
return true;
}
return false;
@@ -1071,7 +1092,11 @@ void VBOXCALL supdrvOSResumeVTxOnCpu(bool fSuspended)
*/
if ( fSuspended
&& g_pfnVmxResume)
+ {
+ IPRT_DARWIN_SAVE_EFL_AC();
g_pfnVmxResume();
+ IPRT_DARWIN_RESTORE_EFL_AC();
+ }
else
Assert(!fSuspended);
#else
@@ -1193,7 +1218,11 @@ int VBOXCALL supdrvOSMsrProberRead(uint32_t uMsr, RTCPUID idCpu, uint64_t *pu
Args.rc = -1;
if (idCpu == NIL_RTCPUID)
+ {
+ IPRT_DARWIN_SAVE_EFL_AC();
supdrvDarwinMsrProberReadOnCpu(idCpu, &Args, NULL);
+ IPRT_DARWIN_RESTORE_EFL_AC();
+ }
else
{
int rc = RTMpOnSpecific(idCpu, supdrvDarwinMsrProberReadOnCpu, &Args, NULL);
@@ -1237,7 +1266,11 @@ int VBOXCALL supdrvOSMsrProberWrite(uint32_t uMsr, RTCPUID idCpu, uint64_t uV
Args.rc = -1;
if (idCpu == NIL_RTCPUID)
+ {
+ IPRT_DARWIN_SAVE_EFL_AC();
supdrvDarwinMsrProberWriteOnCpu(idCpu, &Args, NULL);
+ IPRT_DARWIN_RESTORE_EFL_AC();
+ }
else
{
int rc = RTMpOnSpecific(idCpu, supdrvDarwinMsrProberWriteOnCpu, &Args, NULL);
@@ -1320,7 +1353,9 @@ int VBOXCALL supdrvOSMsrProberModify(RTCPUID idCpu, PSUPMSRPROBER pReq)
return VERR_NOT_SUPPORTED;
if (idCpu == NIL_RTCPUID)
{
+ IPRT_DARWIN_SAVE_EFL_AC();
supdrvDarwinMsrProberModifyOnCpu(idCpu, pReq, NULL);
+ IPRT_DARWIN_RESTORE_EFL_AC();
return VINF_SUCCESS;
}
return RTMpOnSpecific(idCpu, supdrvDarwinMsrProberModifyOnCpu, pReq, NULL);
diff --git a/src/VBox/HostDrivers/Support/darwin/SUPLib-darwin.cpp b/src/VBox/HostDrivers/Support/darwin/SUPLib-darwin.cpp
index abd4bb3..3287403 100644
--- a/src/VBox/HostDrivers/Support/darwin/SUPLib-darwin.cpp
+++ b/src/VBox/HostDrivers/Support/darwin/SUPLib-darwin.cpp
@@ -24,9 +24,10 @@
* terms and conditions of either the GPL or the CDDL or both.
*/
-/*******************************************************************************
-* Header Files *
-*******************************************************************************/
+
+/*********************************************************************************************************************************
+* Header Files *
+*********************************************************************************************************************************/
#define LOG_GROUP LOG_GROUP_SUP
#ifdef IN_SUP_HARDENED_R3
# undef DEBUG /* Warning: disables RT_STRICT */
@@ -56,9 +57,9 @@
#include <IOKit/IOKitLib.h>
-/*******************************************************************************
-* Defined Constants And Macros *
-*******************************************************************************/
+/*********************************************************************************************************************************
+* Defined Constants And Macros *
+*********************************************************************************************************************************/
/** System device name. */
#define DEVICE_NAME_SYS "/dev/vboxdrv"
/** User device name. */
diff --git a/src/VBox/HostDrivers/Support/darwin/SUPR0IdcClient-darwin.c b/src/VBox/HostDrivers/Support/darwin/SUPR0IdcClient-darwin.c
index cbdd544..0c1b638 100644
--- a/src/VBox/HostDrivers/Support/darwin/SUPR0IdcClient-darwin.c
+++ b/src/VBox/HostDrivers/Support/darwin/SUPR0IdcClient-darwin.c
@@ -24,9 +24,10 @@
* terms and conditions of either the GPL or the CDDL or both.
*/
-/*******************************************************************************
-* Header Files *
-*******************************************************************************/
+
+/*********************************************************************************************************************************
+* Header Files *
+*********************************************************************************************************************************/
#include "../SUPR0IdcClientInternal.h"
#include <VBox/err.h>
diff --git a/src/VBox/HostDrivers/Support/freebsd/SUPDrv-freebsd.c b/src/VBox/HostDrivers/Support/freebsd/SUPDrv-freebsd.c
index f971c39..dd472b5 100644
--- a/src/VBox/HostDrivers/Support/freebsd/SUPDrv-freebsd.c
+++ b/src/VBox/HostDrivers/Support/freebsd/SUPDrv-freebsd.c
@@ -28,9 +28,10 @@
* OTHER DEALINGS IN THE SOFTWARE.
*/
-/*******************************************************************************
-* Header Files *
-*******************************************************************************/
+
+/*********************************************************************************************************************************
+* Header Files *
+*********************************************************************************************************************************/
#define LOG_GROUP LOG_GROUP_SUP_DRV
/* Deal with conflicts first. */
#include <sys/param.h>
@@ -63,9 +64,10 @@
# define VBOXDRV_PERM 0666
#endif
-/*******************************************************************************
-* Internal Functions *
-*******************************************************************************/
+
+/*********************************************************************************************************************************
+* Internal Functions *
+*********************************************************************************************************************************/
static int VBoxDrvFreeBSDModuleEvent(struct module *pMod, int enmEventType, void *pvArg);
static int VBoxDrvFreeBSDLoad(void);
static int VBoxDrvFreeBSDUnload(void);
@@ -77,9 +79,9 @@ static d_ioctl_t VBoxDrvFreeBSDIOCtl;
static int VBoxDrvFreeBSDIOCtlSlow(PSUPDRVSESSION pSession, u_long ulCmd, caddr_t pvData, struct thread *pTd);
-/*******************************************************************************
-* Global Variables *
-*******************************************************************************/
+/*********************************************************************************************************************************
+* Global Variables *
+*********************************************************************************************************************************/
/**
* Module info structure used by the kernel.
*/
diff --git a/src/VBox/HostDrivers/Support/freebsd/SUPLib-freebsd.cpp b/src/VBox/HostDrivers/Support/freebsd/SUPLib-freebsd.cpp
index ab5e8a7..3972ac2 100644
--- a/src/VBox/HostDrivers/Support/freebsd/SUPLib-freebsd.cpp
+++ b/src/VBox/HostDrivers/Support/freebsd/SUPLib-freebsd.cpp
@@ -24,9 +24,10 @@
* terms and conditions of either the GPL or the CDDL or both.
*/
-/*******************************************************************************
-* Header Files *
-*******************************************************************************/
+
+/*********************************************************************************************************************************
+* Header Files *
+*********************************************************************************************************************************/
#define LOG_GROUP LOG_GROUP_SUP
#ifdef IN_SUP_HARDENED_R3
# undef DEBUG /* Warning: disables RT_STRICT */
@@ -55,9 +56,10 @@
#include <stdlib.h>
#include <stdio.h>
-/*******************************************************************************
-* Defined Constants And Macros *
-*******************************************************************************/
+
+/*********************************************************************************************************************************
+* Defined Constants And Macros *
+*********************************************************************************************************************************/
/** System device name. */
#define DEVICE_NAME_SYS "/dev/vboxdrv"
/** User device name. */
diff --git a/src/VBox/HostDrivers/Support/freebsd/SUPR0IdcClient-freebsd.c b/src/VBox/HostDrivers/Support/freebsd/SUPR0IdcClient-freebsd.c
index 1f72066..d11ae58 100644
--- a/src/VBox/HostDrivers/Support/freebsd/SUPR0IdcClient-freebsd.c
+++ b/src/VBox/HostDrivers/Support/freebsd/SUPR0IdcClient-freebsd.c
@@ -24,9 +24,10 @@
* terms and conditions of either the GPL or the CDDL or both.
*/
-/*******************************************************************************
-* Header Files *
-*******************************************************************************/
+
+/*********************************************************************************************************************************
+* Header Files *
+*********************************************************************************************************************************/
#include "../SUPR0IdcClientInternal.h"
#include <VBox/err.h>
diff --git a/src/VBox/HostDrivers/Support/linux/SUPDrv-linux.c b/src/VBox/HostDrivers/Support/linux/SUPDrv-linux.c
index a602474..78fb72a 100644
--- a/src/VBox/HostDrivers/Support/linux/SUPDrv-linux.c
+++ b/src/VBox/HostDrivers/Support/linux/SUPDrv-linux.c
@@ -1,4 +1,4 @@
-/* $Rev: 102077 $ */
+/* $Rev: 102121 $ */
/** @file
* VBoxDrv - The VirtualBox Support Driver - Linux specifics.
*/
@@ -24,9 +24,10 @@
* terms and conditions of either the GPL or the CDDL or both.
*/
-/*******************************************************************************
-* Header Files *
-*******************************************************************************/
+
+/*********************************************************************************************************************************
+* Header Files *
+*********************************************************************************************************************************/
#define LOG_GROUP LOG_GROUP_SUP_DRV
#include "../SUPDrvInternal.h"
#include "the-linux-kernel.h"
@@ -66,9 +67,9 @@
#include <iprt/asm-amd64-x86.h>
-/*******************************************************************************
-* Defined Constants And Macros *
-*******************************************************************************/
+/*********************************************************************************************************************************
+* Defined Constants And Macros *
+*********************************************************************************************************************************/
/* check kernel version */
# ifndef SUPDRV_AGNOSTIC
# if LINUX_VERSION_CODE < KERNEL_VERSION(2, 6, 0)
@@ -103,9 +104,9 @@
-/*******************************************************************************
-* Internal Functions *
-*******************************************************************************/
+/*********************************************************************************************************************************
+* Internal Functions *
+*********************************************************************************************************************************/
static int VBoxDrvLinuxInit(void);
static void VBoxDrvLinuxUnload(void);
static int VBoxDrvLinuxCreateSys(struct inode *pInode, struct file *pFilp);
@@ -131,9 +132,9 @@ static void VBoxDevRelease(struct device *pDev);
#endif
-/*******************************************************************************
-* Global Variables *
-*******************************************************************************/
+/*********************************************************************************************************************************
+* Global Variables *
+*********************************************************************************************************************************/
/**
* Device extention & session data association structure.
*/
diff --git a/src/VBox/HostDrivers/Support/linux/SUPLib-linux.cpp b/src/VBox/HostDrivers/Support/linux/SUPLib-linux.cpp
index d6627fd..4612185 100644
--- a/src/VBox/HostDrivers/Support/linux/SUPLib-linux.cpp
+++ b/src/VBox/HostDrivers/Support/linux/SUPLib-linux.cpp
@@ -24,9 +24,10 @@
* terms and conditions of either the GPL or the CDDL or both.
*/
-/*******************************************************************************
-* Header Files *
-*******************************************************************************/
+
+/*********************************************************************************************************************************
+* Header Files *
+*********************************************************************************************************************************/
#define LOG_GROUP LOG_GROUP_SUP
#ifdef IN_SUP_HARDENED_R3
# undef DEBUG /* Warning: disables RT_STRICT */
@@ -57,9 +58,9 @@
#include "../SUPDrvIOC.h"
-/*******************************************************************************
-* Defined Constants And Macros *
-*******************************************************************************/
+/*********************************************************************************************************************************
+* Defined Constants And Macros *
+*********************************************************************************************************************************/
/** System device name. */
#define DEVICE_NAME_SYS "/dev/vboxdrv"
/** User device name. */
diff --git a/src/VBox/HostDrivers/Support/linux/SUPR0IdcClient-linux.c b/src/VBox/HostDrivers/Support/linux/SUPR0IdcClient-linux.c
index dc0bac6..ec9d54c 100644
--- a/src/VBox/HostDrivers/Support/linux/SUPR0IdcClient-linux.c
+++ b/src/VBox/HostDrivers/Support/linux/SUPR0IdcClient-linux.c
@@ -24,9 +24,10 @@
* terms and conditions of either the GPL or the CDDL or both.
*/
-/*******************************************************************************
-* Header Files *
-*******************************************************************************/
+
+/*********************************************************************************************************************************
+* Header Files *
+*********************************************************************************************************************************/
#include "../SUPR0IdcClientInternal.h"
#include <VBox/err.h>
diff --git a/src/VBox/HostDrivers/Support/os2/SUPDrv-os2.cpp b/src/VBox/HostDrivers/Support/os2/SUPDrv-os2.cpp
index 05a68f7..88c93ce 100644
--- a/src/VBox/HostDrivers/Support/os2/SUPDrv-os2.cpp
+++ b/src/VBox/HostDrivers/Support/os2/SUPDrv-os2.cpp
@@ -28,9 +28,10 @@
* OTHER DEALINGS IN THE SOFTWARE.
*/
-/*******************************************************************************
-* Header Files *
-*******************************************************************************/
+
+/*********************************************************************************************************************************
+* Header Files *
+*********************************************************************************************************************************/
#define LOG_GROUP LOG_GROUP_SUP_DRV
#define __STDC_CONSTANT_MACROS
#define __STDC_LIMIT_MACROS
@@ -49,9 +50,9 @@
#include <iprt/param.h>
-/*******************************************************************************
-* Global Variables *
-*******************************************************************************/
+/*********************************************************************************************************************************
+* Global Variables *
+*********************************************************************************************************************************/
/**
* Device extention & session data association structure.
*/
@@ -76,9 +77,9 @@ extern uint16_t g_cchInitTextMax;
RT_C_DECLS_END
-/*******************************************************************************
-* Internal Functions *
-*******************************************************************************/
+/*********************************************************************************************************************************
+* Internal Functions *
+*********************************************************************************************************************************/
diff --git a/src/VBox/HostDrivers/Support/os2/SUPLib-os2.cpp b/src/VBox/HostDrivers/Support/os2/SUPLib-os2.cpp
index 9439d79..8ff5a47 100644
--- a/src/VBox/HostDrivers/Support/os2/SUPLib-os2.cpp
+++ b/src/VBox/HostDrivers/Support/os2/SUPLib-os2.cpp
@@ -24,9 +24,10 @@
* terms and conditions of either the GPL or the CDDL or both.
*/
-/*******************************************************************************
-* Header Files *
-*******************************************************************************/
+
+/*********************************************************************************************************************************
+* Header Files *
+*********************************************************************************************************************************/
#define INCL_BASE
#define INCL_ERRORS
#include <os2.h>
@@ -55,9 +56,9 @@
#include <stdlib.h>
-/*******************************************************************************
-* Defined Constants And Macros *
-*******************************************************************************/
+/*********************************************************************************************************************************
+* Defined Constants And Macros *
+*********************************************************************************************************************************/
/** OS/2 Device name. */
#define DEVICE_NAME "/dev/vboxdrv$"
diff --git a/src/VBox/HostDrivers/Support/os2/SUPR0IdcClient-os2.c b/src/VBox/HostDrivers/Support/os2/SUPR0IdcClient-os2.c
index 0d02e82..c9e7bda 100644
--- a/src/VBox/HostDrivers/Support/os2/SUPR0IdcClient-os2.c
+++ b/src/VBox/HostDrivers/Support/os2/SUPR0IdcClient-os2.c
@@ -24,9 +24,10 @@
* terms and conditions of either the GPL or the CDDL or both.
*/
-/*******************************************************************************
-* Header Files *
-*******************************************************************************/
+
+/*********************************************************************************************************************************
+* Header Files *
+*********************************************************************************************************************************/
#include "../SUPR0IdcClientInternal.h"
#include <VBox/err.h>
diff --git a/src/VBox/HostDrivers/Support/solaris/SUPDrv-solaris.c b/src/VBox/HostDrivers/Support/solaris/SUPDrv-solaris.c
index ec3e915..a7f671a 100644
--- a/src/VBox/HostDrivers/Support/solaris/SUPDrv-solaris.c
+++ b/src/VBox/HostDrivers/Support/solaris/SUPDrv-solaris.c
@@ -24,9 +24,10 @@
* terms and conditions of either the GPL or the CDDL or both.
*/
-/*******************************************************************************
-* Header Files *
-*******************************************************************************/
+
+/*********************************************************************************************************************************
+* Header Files *
+*********************************************************************************************************************************/
#define LOG_GROUP LOG_GROUP_SUP_DRV
#include <sys/types.h>
#include <sys/param.h>
@@ -64,9 +65,9 @@
#include "dtrace/SUPDrv.h"
-/*******************************************************************************
-* Defined Constants And Macros *
-*******************************************************************************/
+/*********************************************************************************************************************************
+* Defined Constants And Macros *
+*********************************************************************************************************************************/
/** The system device name. */
#define DEVICE_NAME_SYS "vboxdrv"
/** The user device name. */
@@ -77,9 +78,9 @@
#define DEVICE_MAXINSTANCES 16
-/*******************************************************************************
-* Internal Functions *
-*******************************************************************************/
+/*********************************************************************************************************************************
+* Internal Functions *
+*********************************************************************************************************************************/
static int VBoxDrvSolarisOpen(dev_t *pDev, int fFlag, int fType, cred_t *pCred);
static int VBoxDrvSolarisClose(dev_t Dev, int fFlag, int fType, cred_t *pCred);
static int VBoxDrvSolarisRead(dev_t Dev, struct uio *pUio, cred_t *pCred);
@@ -94,9 +95,9 @@ static int VBoxSupDrvErr2SolarisErr(int rc);
static int VBoxDrvSolarisIOCtlSlow(PSUPDRVSESSION pSession, int Cmd, int Mode, intptr_t pArgs);
-/*******************************************************************************
-* Global Variables *
-*******************************************************************************/
+/*********************************************************************************************************************************
+* Global Variables *
+*********************************************************************************************************************************/
/**
* cb_ops: for drivers that support char/block entry points
*/
diff --git a/src/VBox/HostDrivers/Support/solaris/SUPLib-solaris.cpp b/src/VBox/HostDrivers/Support/solaris/SUPLib-solaris.cpp
index 34401af..c711317 100644
--- a/src/VBox/HostDrivers/Support/solaris/SUPLib-solaris.cpp
+++ b/src/VBox/HostDrivers/Support/solaris/SUPLib-solaris.cpp
@@ -24,9 +24,10 @@
* terms and conditions of either the GPL or the CDDL or both.
*/
-/*******************************************************************************
-* Header Files *
-*******************************************************************************/
+
+/*********************************************************************************************************************************
+* Header Files *
+*********************************************************************************************************************************/
#define LOG_GROUP LOG_GROUP_SUP
#ifdef IN_SUP_HARDENED_R3
# undef DEBUG /* Warning: disables RT_STRICT */
@@ -61,9 +62,9 @@
#include <zone.h>
-/*******************************************************************************
-* Defined Constants And Macros *
-*******************************************************************************/
+/*********************************************************************************************************************************
+* Defined Constants And Macros *
+*********************************************************************************************************************************/
/** Solaris device link - system. */
#define DEVICE_NAME_SYS "/devices/pseudo/vboxdrv at 0:vboxdrv"
/** Solaris device link - user. */
diff --git a/src/VBox/HostDrivers/Support/solaris/SUPR0IdcClient-solaris.c b/src/VBox/HostDrivers/Support/solaris/SUPR0IdcClient-solaris.c
index e1890f0..3a50c69 100644
--- a/src/VBox/HostDrivers/Support/solaris/SUPR0IdcClient-solaris.c
+++ b/src/VBox/HostDrivers/Support/solaris/SUPR0IdcClient-solaris.c
@@ -24,9 +24,10 @@
* terms and conditions of either the GPL or the CDDL or both.
*/
-/*******************************************************************************
-* Header Files *
-*******************************************************************************/
+
+/*********************************************************************************************************************************
+* Header Files *
+*********************************************************************************************************************************/
#include "../SUPR0IdcClientInternal.h"
#include <VBox/err.h>
diff --git a/src/VBox/HostDrivers/Support/testcase/Makefile.kmk b/src/VBox/HostDrivers/Support/testcase/Makefile.kmk
index 5a768b0..58c0721 100644
--- a/src/VBox/HostDrivers/Support/testcase/Makefile.kmk
+++ b/src/VBox/HostDrivers/Support/testcase/Makefile.kmk
@@ -40,7 +40,6 @@ PROGRAMS += \
tstInt \
tstLow \
tstPin \
- tstGIP-2 \
tstGetPagingMode \
tstSupLoadModule \
tstSupSem \
@@ -86,8 +85,29 @@ tstPin_SOURCES = tstPin.cpp
tstPage_TEMPLATE = VBOXR3TSTEXE
tstPage_SOURCES = tstPage.cpp
-tstGIP-2_TEMPLATE = VBOXR3TSTEXE
-tstGIP-2_SOURCES = tstGIP-2.cpp
+#
+# tstGIP-2
+#
+ifdef VBOX_WITH_TESTCASES
+ if defined(VBOX_WITH_HARDENING) && "$(KBUILD_TARGET)" == "win"
+ PROGRAMS += tstGIP-2Hardened
+ DLLS += tstGIP-2
+ else
+ PROGRAMS += tstGIP-2
+ endif
+endif
+
+tstGIP-2Hardened_TEMPLATE = VBoxR3HardenedTstExe
+tstGIP-2Hardened_DEFS = PROGRAM_NAME_STR=\"tstGIP-2\"
+tstGIP-2Hardened_SOURCES = ../SUPR3HardenedMainTemplateTestcase.cpp
+tstGIP-2Hardened_NAME = tstGIP-2
+
+if defined(VBOX_WITH_HARDENING) && "$(KBUILD_TARGET)" == "win"
+ tstGIP-2_TEMPLATE := VBoxR3HardenedTstDll
+else
+ tstGIP-2_TEMPLATE := VBOXR3TSTEXE
+endif
+tstGIP-2_SOURCES = tstGIP-2.cpp
tstGetPagingMode_TEMPLATE = VBOXR3TSTEXE
tstGetPagingMode_SOURCES = tstGetPagingMode.cpp
diff --git a/src/VBox/HostDrivers/Support/testcase/SUPInstall.cpp b/src/VBox/HostDrivers/Support/testcase/SUPInstall.cpp
index 46b6624..cb6eab5 100644
--- a/src/VBox/HostDrivers/Support/testcase/SUPInstall.cpp
+++ b/src/VBox/HostDrivers/Support/testcase/SUPInstall.cpp
@@ -25,9 +25,9 @@
*/
-/*******************************************************************************
-* Header Files *
-*******************************************************************************/
+/*********************************************************************************************************************************
+* Header Files *
+*********************************************************************************************************************************/
#include <VBox/sup.h>
#include <VBox/err.h>
#include <iprt/initterm.h>
diff --git a/src/VBox/HostDrivers/Support/testcase/SUPLoggerCtl.cpp b/src/VBox/HostDrivers/Support/testcase/SUPLoggerCtl.cpp
index ef78807..29bd511 100644
--- a/src/VBox/HostDrivers/Support/testcase/SUPLoggerCtl.cpp
+++ b/src/VBox/HostDrivers/Support/testcase/SUPLoggerCtl.cpp
@@ -24,9 +24,10 @@
* terms and conditions of either the GPL or the CDDL or both.
*/
-/*******************************************************************************
-* Header Files *
-*******************************************************************************/
+
+/*********************************************************************************************************************************
+* Header Files *
+*********************************************************************************************************************************/
#include <VBox/sup.h>
#include <iprt/buildconfig.h>
#include <iprt/initterm.h>
diff --git a/src/VBox/HostDrivers/Support/testcase/SUPUninstall.cpp b/src/VBox/HostDrivers/Support/testcase/SUPUninstall.cpp
index 5f612a0..a415132 100644
--- a/src/VBox/HostDrivers/Support/testcase/SUPUninstall.cpp
+++ b/src/VBox/HostDrivers/Support/testcase/SUPUninstall.cpp
@@ -25,9 +25,9 @@
*/
-/*******************************************************************************
-* Header Files *
-*******************************************************************************/
+/*********************************************************************************************************************************
+* Header Files *
+*********************************************************************************************************************************/
#include <VBox/sup.h>
#include <VBox/err.h>
#include <iprt/initterm.h>
diff --git a/src/VBox/HostDrivers/Support/testcase/tstContiguous.cpp b/src/VBox/HostDrivers/Support/testcase/tstContiguous.cpp
index d08a5b5..47b9236 100644
--- a/src/VBox/HostDrivers/Support/testcase/tstContiguous.cpp
+++ b/src/VBox/HostDrivers/Support/testcase/tstContiguous.cpp
@@ -25,9 +25,9 @@
*/
-/*******************************************************************************
-* Header Files *
-*******************************************************************************/
+/*********************************************************************************************************************************
+* Header Files *
+*********************************************************************************************************************************/
#include <VBox/sup.h>
#include <VBox/param.h>
#include <iprt/initterm.h>
diff --git a/src/VBox/HostDrivers/Support/testcase/tstGIP-2.cpp b/src/VBox/HostDrivers/Support/testcase/tstGIP-2.cpp
index 88bafb7..18fc69c 100644
--- a/src/VBox/HostDrivers/Support/testcase/tstGIP-2.cpp
+++ b/src/VBox/HostDrivers/Support/testcase/tstGIP-2.cpp
@@ -24,9 +24,10 @@
* terms and conditions of either the GPL or the CDDL or both.
*/
-/*******************************************************************************
-* Header Files *
-*******************************************************************************/
+
+/*********************************************************************************************************************************
+* Header Files *
+*********************************************************************************************************************************/
#include <VBox/sup.h>
#include <VBox/err.h>
#include <VBox/param.h>
@@ -40,7 +41,11 @@
#include <iprt/getopt.h>
#include <iprt/x86.h>
-int main(int argc, char **argv)
+
+/**
+ * Entry point.
+ */
+extern "C" DECLEXPORT(int) TrustedMain(int argc, char **argv)
{
RTR3InitExe(argc, &argv, 0);
@@ -59,17 +64,13 @@ int main(int argc, char **argv)
* implies updating GIP CpuHz even when invariant) */
};
- uint32_t cIterations = 40;
- bool fHex = true;
- bool fSpin = false;
- bool fCompat = true;
- bool fTestMode = true;
- int ch;
- uint64_t uCpuHzRef = UINT64_MAX;
- uint64_t uCpuHzOverallDeviation = 0;
- uint32_t cCpuHzNotCompat = 0;
- int64_t iCpuHzMaxDeviation = 0;
- int32_t cCpuHzOverallDevCnt = 0;
+ bool fHex = true;
+ bool fSpin = false;
+ bool fCompat = true;
+ bool fTestMode = true;
+ int ch;
+ uint32_t cIterations = 40;
+ uint64_t uCpuHzRef = UINT64_MAX;
RTGETOPTUNION ValueUnion;
RTGETOPTSTATE GetState;
RTGetOptInit(&GetState, argc, argv, g_aOptions, RT_ELEMENTS(g_aOptions), 1, RTGETOPTINIT_FLAGS_NO_STD_OPTS);
@@ -115,6 +116,12 @@ int main(int argc, char **argv)
{
if (g_pSUPGlobalInfoPage)
{
+ uint64_t uCpuHzOverallDeviation = 0;
+ uint32_t cCpuHzNotCompat = 0;
+ int64_t iCpuHzMaxDeviation = 0;
+ int32_t cCpuHzOverallDevCnt = 0;
+ uint32_t cCpuHzChecked = 0;
+
/* Pick current CpuHz as the reference if none was specified. */
if (uCpuHzRef == UINT64_MAX)
uCpuHzRef = SUPGetCpuHzFromGip(g_pSUPGlobalInfoPage);
@@ -123,7 +130,7 @@ int main(int argc, char **argv)
&& g_pSUPGlobalInfoPage->u32Mode == SUPGIPMODE_INVARIANT_TSC)
SUPR3GipSetFlags(SUPGIP_FLAGS_TESTING_ENABLE, UINT32_MAX);
- RTPrintf("tstGIP-2: cCpus=%d u32UpdateHz=%RU32 u32UpdateIntervalNS=%RU32 u64NanoTSLastUpdateHz=%RX64 u64CpuHz=%RU64 uCpuHzRef=%RU64 u32Mode=%d (%s) u32Version=%#x\n",
+ RTPrintf("tstGIP-2: cCpus=%d u32UpdateHz=%RU32 u32UpdateIntervalNS=%RU32 u64NanoTSLastUpdateHz=%RX64 u64CpuHz=%RU64 uCpuHzRef=%RU64 u32Mode=%d (%s) fTestMode=%RTbool u32Version=%#x\n",
g_pSUPGlobalInfoPage->cCpus,
g_pSUPGlobalInfoPage->u32UpdateHz,
g_pSUPGlobalInfoPage->u32UpdateIntervalNS,
@@ -132,6 +139,7 @@ int main(int argc, char **argv)
uCpuHzRef,
g_pSUPGlobalInfoPage->u32Mode,
SUPGetGIPModeName(g_pSUPGlobalInfoPage),
+ fTestMode,
g_pSUPGlobalInfoPage->u32Version);
RTPrintf(fHex
? "tstGIP-2: it: u64NanoTS delta u64TSC UpIntTSC H TransId CpuHz %sTSC Interval History...\n"
@@ -140,10 +148,10 @@ int main(int argc, char **argv)
static SUPGIPCPU s_aaCPUs[2][256];
for (uint32_t i = 0; i < cIterations; i++)
{
- /* copy the data */
+ /* Copy the data. */
memcpy(&s_aaCPUs[i & 1][0], &g_pSUPGlobalInfoPage->aCPUs[0], g_pSUPGlobalInfoPage->cCpus * sizeof(g_pSUPGlobalInfoPage->aCPUs[0]));
- /* display it & find something to spin on. */
+ /* Display it & find something to spin on. */
uint32_t u32TransactionId = 0;
uint32_t volatile *pu32TransactionId = NULL;
for (unsigned iCpu = 0; iCpu < g_pSUPGlobalInfoPage->cCpus; iCpu++)
@@ -154,29 +162,42 @@ int main(int argc, char **argv)
PSUPGIPCPU pCpu = &s_aaCPUs[i & 1][iCpu];
if (uCpuHzRef)
{
- int64_t iCpuHzDeviation = pCpu->u64CpuHz - uCpuHzRef;
- uint64_t uCpuHzDeviation = RT_ABS(iCpuHzDeviation);
- if (uCpuHzDeviation > 999999999)
- RTStrPrintf(szCpuHzDeviation, sizeof(szCpuHzDeviation), "%17s ", "?");
- else
+ /* Only CPU 0 is updated for invariant & sync modes, see supdrvGipUpdate(). */
+ if ( iCpu == 0
+ || g_pSUPGlobalInfoPage->u32Mode == SUPGIPMODE_ASYNC_TSC)
{
/* Wait until the history validation code takes effect. */
- bool fCurHzCompat = true;
if (pCpu->u32TransactionId > 23 + (8 * 2) + 1)
{
- if (RT_ABS(iCpuHzDeviation) > RT_ABS(iCpuHzMaxDeviation))
- iCpuHzMaxDeviation = iCpuHzDeviation;
- uCpuHzOverallDeviation += uCpuHzDeviation;
- cCpuHzOverallDevCnt++;
- fCurHzCompat = SUPIsTscFreqCompatibleEx(uCpuHzRef, pCpu->u64CpuHz, false /* fRelax */);
+ int64_t iCpuHzDeviation = pCpu->u64CpuHz - uCpuHzRef;
+ uint64_t uCpuHzDeviation = RT_ABS(iCpuHzDeviation);
+ bool fCurHzCompat = SUPIsTscFreqCompatibleEx(uCpuHzRef, pCpu->u64CpuHz, false /*fRelax*/);
+ if (uCpuHzDeviation <= 999999999)
+ {
+ if (RT_ABS(iCpuHzDeviation) > RT_ABS(iCpuHzMaxDeviation))
+ iCpuHzMaxDeviation = iCpuHzDeviation;
+ uCpuHzOverallDeviation += uCpuHzDeviation;
+ cCpuHzOverallDevCnt++;
+ uint32_t uPct = (uint32_t)(uCpuHzDeviation * 100000 / uCpuHzRef + 5);
+ RTStrPrintf(szCpuHzDeviation, sizeof(szCpuHzDeviation), "%10RI64%3d.%02d%% %RTbool ",
+ iCpuHzDeviation, uPct / 1000, (uPct % 1000) / 10, fCurHzCompat);
+ }
+ else
+ {
+ RTStrPrintf(szCpuHzDeviation, sizeof(szCpuHzDeviation), "%17s %RTbool ", "?",
+ fCurHzCompat);
+ }
+
+ if (!fCurHzCompat)
+ ++cCpuHzNotCompat;
+ fCompat &= fCurHzCompat;
+ ++cCpuHzChecked;
}
- uint32_t uPct = (uint32_t)(uCpuHzDeviation * 100000 / uCpuHzRef + 5);
- RTStrPrintf(szCpuHzDeviation, sizeof(szCpuHzDeviation), "%10RI64%3d.%02d%% %RTbool ",
- iCpuHzDeviation, uPct / 1000, (uPct % 1000) / 10, fCurHzCompat);
- if (!fCurHzCompat)
- ++cCpuHzNotCompat;
- fCompat &= fCurHzCompat;
+ else
+ RTStrPrintf(szCpuHzDeviation, sizeof(szCpuHzDeviation), "%25s ", "priming");
}
+ else
+ RTStrPrintf(szCpuHzDeviation, sizeof(szCpuHzDeviation), "%25s ", "");
}
else
szCpuHzDeviation[0] = '\0';
@@ -208,7 +229,7 @@ int main(int argc, char **argv)
}
}
- /* wait a bit / spin */
+ /* Wait a bit / spin. */
if (!fSpin)
RTThreadSleep(9);
else
@@ -250,20 +271,26 @@ int main(int argc, char **argv)
RTPrintf("tstGIP-2: enmUseTscDelta=%d fGetGipCpu=%#x\n",
g_pSUPGlobalInfoPage->enmUseTscDelta, g_pSUPGlobalInfoPage->fGetGipCpu);
- if ( uCpuHzRef
- && cCpuHzOverallDevCnt)
+ if (uCpuHzRef)
{
- uint32_t uPct = (uint32_t)(uCpuHzOverallDeviation * 100000 / cCpuHzOverallDevCnt / uCpuHzRef + 5);
- RTPrintf("tstGIP-2: Average CpuHz deviation: %d.%02d%%\n",
- uPct / 1000, (uPct % 1000) / 10);
+ if (cCpuHzOverallDevCnt)
+ {
+ uint32_t uPct = (uint32_t)(uCpuHzOverallDeviation * 100000 / cCpuHzOverallDevCnt / uCpuHzRef + 5);
+ RTPrintf("tstGIP-2: Average CpuHz deviation: %d.%02d%%\n",
+ uPct / 1000, (uPct % 1000) / 10);
- uint32_t uMaxPct = (uint32_t)(RT_ABS(iCpuHzMaxDeviation) * 100000 / uCpuHzRef + 5);
- RTPrintf("tstGIP-2: Maximum CpuHz deviation: %d.%02d%% (%RI64 ticks)\n",
- uMaxPct / 1000, (uMaxPct % 1000) / 10, iCpuHzMaxDeviation);
+ uint32_t uMaxPct = (uint32_t)(RT_ABS(iCpuHzMaxDeviation) * 100000 / uCpuHzRef + 5);
+ RTPrintf("tstGIP-2: Maximum CpuHz deviation: %d.%02d%% (%RI64 ticks)\n",
+ uMaxPct / 1000, (uMaxPct % 1000) / 10, iCpuHzMaxDeviation);
+ }
+ else
+ {
+ RTPrintf("tstGIP-2: Average CpuHz deviation: ??.??\n");
+ RTPrintf("tstGIP-2: Average CpuHz deviation: ??.??\n");
+ }
- RTPrintf("tstGIP-2: CpuHz compatibility: %RTbool (incompatible %u of %u times w/ %RU64 Hz %s GIP)\n", fCompat,
- cCpuHzNotCompat, cIterations * g_pSUPGlobalInfoPage->cCpus, uCpuHzRef,
- SUPGetGIPModeName(g_pSUPGlobalInfoPage));
+ RTPrintf("tstGIP-2: CpuHz compatibility: %RTbool (incompatible %u of %u times w/ %RU64 Hz - %s GIP)\n", fCompat,
+ cCpuHzNotCompat, cCpuHzChecked, uCpuHzRef, SUPGetGIPModeName(g_pSUPGlobalInfoPage));
if ( !fCompat
&& g_pSUPGlobalInfoPage->u32Mode == SUPGIPMODE_INVARIANT_TSC)
@@ -287,3 +314,13 @@ int main(int argc, char **argv)
return !!rc;
}
+#if !defined(VBOX_WITH_HARDENING) || !defined(RT_OS_WINDOWS)
+/**
+ * Main entry point.
+ */
+int main(int argc, char **argv)
+{
+ return TrustedMain(argc, argv);
+}
+#endif
+
diff --git a/src/VBox/HostDrivers/Support/testcase/tstGetPagingMode.cpp b/src/VBox/HostDrivers/Support/testcase/tstGetPagingMode.cpp
index 8b91528..8d18892 100644
--- a/src/VBox/HostDrivers/Support/testcase/tstGetPagingMode.cpp
+++ b/src/VBox/HostDrivers/Support/testcase/tstGetPagingMode.cpp
@@ -25,9 +25,9 @@
*/
-/*******************************************************************************
-* Header Files *
-*******************************************************************************/
+/*********************************************************************************************************************************
+* Header Files *
+*********************************************************************************************************************************/
#include <VBox/sup.h>
#include <VBox/err.h>
#include <iprt/initterm.h>
diff --git a/src/VBox/HostDrivers/Support/testcase/tstInit.cpp b/src/VBox/HostDrivers/Support/testcase/tstInit.cpp
index 101082f..5176de3 100644
--- a/src/VBox/HostDrivers/Support/testcase/tstInit.cpp
+++ b/src/VBox/HostDrivers/Support/testcase/tstInit.cpp
@@ -25,9 +25,9 @@
*/
-/*******************************************************************************
-* Header Files *
-*******************************************************************************/
+/*********************************************************************************************************************************
+* Header Files *
+*********************************************************************************************************************************/
#include <VBox/sup.h>
#include <VBox/err.h>
#include <iprt/initterm.h>
diff --git a/src/VBox/HostDrivers/Support/testcase/tstInt.cpp b/src/VBox/HostDrivers/Support/testcase/tstInt.cpp
index 91faa34..c942345 100644
--- a/src/VBox/HostDrivers/Support/testcase/tstInt.cpp
+++ b/src/VBox/HostDrivers/Support/testcase/tstInt.cpp
@@ -25,9 +25,9 @@
*/
-/*******************************************************************************
-* Header Files *
-*******************************************************************************/
+/*********************************************************************************************************************************
+* Header Files *
+*********************************************************************************************************************************/
#include <VBox/sup.h>
#include <VBox/vmm/vm.h>
#include <VBox/vmm/vmm.h>
diff --git a/src/VBox/HostDrivers/Support/testcase/tstLow.cpp b/src/VBox/HostDrivers/Support/testcase/tstLow.cpp
index 1c987c4..350fbf4 100644
--- a/src/VBox/HostDrivers/Support/testcase/tstLow.cpp
+++ b/src/VBox/HostDrivers/Support/testcase/tstLow.cpp
@@ -25,9 +25,9 @@
*/
-/*******************************************************************************
-* Header Files *
-*******************************************************************************/
+/*********************************************************************************************************************************
+* Header Files *
+*********************************************************************************************************************************/
#include <VBox/sup.h>
#include <VBox/param.h>
#include <VBox/err.h>
diff --git a/src/VBox/HostDrivers/Support/testcase/tstNtQueryStuff.cpp b/src/VBox/HostDrivers/Support/testcase/tstNtQueryStuff.cpp
index f56a39b..fc34d8c 100644
--- a/src/VBox/HostDrivers/Support/testcase/tstNtQueryStuff.cpp
+++ b/src/VBox/HostDrivers/Support/testcase/tstNtQueryStuff.cpp
@@ -25,17 +25,17 @@
*/
-/*******************************************************************************
-* Header Files *
-*******************************************************************************/
+/*********************************************************************************************************************************
+* Header Files *
+*********************************************************************************************************************************/
#include <iprt/nt/nt-and-windows.h>
#include <iprt/test.h>
#include <iprt/string.h>
-/*******************************************************************************
-* Structures and Typedefs *
-*******************************************************************************/
+/*********************************************************************************************************************************
+* Structures and Typedefs *
+*********************************************************************************************************************************/
typedef struct FLAGDESC
{
ULONG f;
@@ -45,9 +45,9 @@ typedef const FLAGDESC *PCFLAGDESC;
-/*******************************************************************************
-* Global Variables *
-*******************************************************************************/
+/*********************************************************************************************************************************
+* Global Variables *
+*********************************************************************************************************************************/
static RTTEST g_hTest = NIL_RTTEST;
static HANDLE g_hProcess = NULL;
diff --git a/src/VBox/HostDrivers/Support/testcase/tstPage.cpp b/src/VBox/HostDrivers/Support/testcase/tstPage.cpp
index 9ecdee7..183cb36 100644
--- a/src/VBox/HostDrivers/Support/testcase/tstPage.cpp
+++ b/src/VBox/HostDrivers/Support/testcase/tstPage.cpp
@@ -25,9 +25,9 @@
*/
-/*******************************************************************************
-* Header Files *
-*******************************************************************************/
+/*********************************************************************************************************************************
+* Header Files *
+*********************************************************************************************************************************/
#include <VBox/sup.h>
#include <VBox/param.h>
#include <iprt/initterm.h>
diff --git a/src/VBox/HostDrivers/Support/testcase/tstPin.cpp b/src/VBox/HostDrivers/Support/testcase/tstPin.cpp
index bb0ef88..b2d66eb 100644
--- a/src/VBox/HostDrivers/Support/testcase/tstPin.cpp
+++ b/src/VBox/HostDrivers/Support/testcase/tstPin.cpp
@@ -25,9 +25,9 @@
*/
-/*******************************************************************************
-* Header Files *
-*******************************************************************************/
+/*********************************************************************************************************************************
+* Header Files *
+*********************************************************************************************************************************/
#include <VBox/sup.h>
#include <VBox/param.h>
#include <VBox/err.h>
diff --git a/src/VBox/HostDrivers/Support/testcase/tstSupLoadModule.cpp b/src/VBox/HostDrivers/Support/testcase/tstSupLoadModule.cpp
index bddfef7..047c1f3 100644
--- a/src/VBox/HostDrivers/Support/testcase/tstSupLoadModule.cpp
+++ b/src/VBox/HostDrivers/Support/testcase/tstSupLoadModule.cpp
@@ -25,9 +25,9 @@
*/
-/*******************************************************************************
-* Header Files *
-*******************************************************************************/
+/*********************************************************************************************************************************
+* Header Files *
+*********************************************************************************************************************************/
#include <VBox/sup.h>
#include <VBox/err.h>
@@ -105,7 +105,7 @@ int main(int argc, char **argv)
return 1;
case 'V':
- RTPrintf("$Revision: 100877 $\n");
+ RTPrintf("$Revision: 102121 $\n");
return 0;
default:
diff --git a/src/VBox/HostDrivers/Support/testcase/tstSupSem-Zombie.cpp b/src/VBox/HostDrivers/Support/testcase/tstSupSem-Zombie.cpp
index 0910e7f..e155f85 100644
--- a/src/VBox/HostDrivers/Support/testcase/tstSupSem-Zombie.cpp
+++ b/src/VBox/HostDrivers/Support/testcase/tstSupSem-Zombie.cpp
@@ -25,9 +25,9 @@
*/
-/*******************************************************************************
-* Header Files *
-*******************************************************************************/
+/*********************************************************************************************************************************
+* Header Files *
+*********************************************************************************************************************************/
#include <VBox/sup.h>
#include <VBox/param.h>
@@ -42,9 +42,9 @@
#include <iprt/thread.h>
-/*******************************************************************************
-* Structures and Typedefs *
-*******************************************************************************/
+/*********************************************************************************************************************************
+* Structures and Typedefs *
+*********************************************************************************************************************************/
static PSUPDRVSESSION g_pSession;
static RTTEST g_hTest;
diff --git a/src/VBox/HostDrivers/Support/testcase/tstSupSem.cpp b/src/VBox/HostDrivers/Support/testcase/tstSupSem.cpp
index 7cd09ea..7ecbafb 100644
--- a/src/VBox/HostDrivers/Support/testcase/tstSupSem.cpp
+++ b/src/VBox/HostDrivers/Support/testcase/tstSupSem.cpp
@@ -25,9 +25,9 @@
*/
-/*******************************************************************************
-* Header Files *
-*******************************************************************************/
+/*********************************************************************************************************************************
+* Header Files *
+*********************************************************************************************************************************/
#include <VBox/sup.h>
#include <VBox/param.h>
@@ -43,9 +43,9 @@
#include <iprt/time.h>
-/*******************************************************************************
-* Structures and Typedefs *
-*******************************************************************************/
+/*********************************************************************************************************************************
+* Structures and Typedefs *
+*********************************************************************************************************************************/
static PSUPDRVSESSION g_pSession;
static RTTEST g_hTest;
static uint32_t g_cMillies; /* Used by the interruptible tests. */
diff --git a/src/VBox/HostDrivers/Support/testcase/tstSupTscDelta.cpp b/src/VBox/HostDrivers/Support/testcase/tstSupTscDelta.cpp
index a843112..0a0e341 100644
--- a/src/VBox/HostDrivers/Support/testcase/tstSupTscDelta.cpp
+++ b/src/VBox/HostDrivers/Support/testcase/tstSupTscDelta.cpp
@@ -24,9 +24,10 @@
* terms and conditions of either the GPL or the CDDL or both.
*/
-/*******************************************************************************
-* Header Files *
-*******************************************************************************/
+
+/*********************************************************************************************************************************
+* Header Files *
+*********************************************************************************************************************************/
#include <VBox/sup.h>
#include <VBox/err.h>
#include <iprt/assert.h>
diff --git a/src/VBox/HostDrivers/Support/win/SUPDrv-win.cpp b/src/VBox/HostDrivers/Support/win/SUPDrv-win.cpp
index 2fd1e16..ee5abba 100644
--- a/src/VBox/HostDrivers/Support/win/SUPDrv-win.cpp
+++ b/src/VBox/HostDrivers/Support/win/SUPDrv-win.cpp
@@ -24,9 +24,10 @@
* terms and conditions of either the GPL or the CDDL or both.
*/
-/*******************************************************************************
-* Header Files *
-*******************************************************************************/
+
+/*********************************************************************************************************************************
+* Header Files *
+*********************************************************************************************************************************/
#define IPRT_NT_MAP_TO_ZW
#define LOG_GROUP LOG_GROUP_SUP_DRV
#include "../SUPDrvInternal.h"
@@ -54,9 +55,9 @@
#endif
-/*******************************************************************************
-* Defined Constants And Macros *
-*******************************************************************************/
+/*********************************************************************************************************************************
+* Defined Constants And Macros *
+*********************************************************************************************************************************/
/** The support service name. */
#define SERVICE_NAME "VBoxDrv"
/** The Pool tag (VBox). */
@@ -85,9 +86,9 @@
#define VBOXDRV_WITH_FAST_IO
-/*******************************************************************************
-* Structures and Typedefs *
-*******************************************************************************/
+/*********************************************************************************************************************************
+* Structures and Typedefs *
+*********************************************************************************************************************************/
/**
* Device extension used by VBoxDrvU.
*/
@@ -155,7 +156,7 @@ typedef struct SUPDRVNTERRORINFO
/** Number of bytes of valid info. */
uint32_t cchErrorInfo;
/** The error info. */
- char szErrorInfo[2048];
+ char szErrorInfo[16384 - sizeof(RTLISTNODE) - sizeof(HANDLE)*2 - sizeof(uint64_t) - sizeof(uint32_t) - 0x20];
} SUPDRVNTERRORINFO;
/** Pointer to error info. */
typedef SUPDRVNTERRORINFO *PSUPDRVNTERRORINFO;
@@ -272,9 +273,9 @@ typedef NTSTATUS (NTAPI *PFNZWALPCCREATEPORT)(PHANDLE, POBJECT_ATTRIBUTES, struc
#endif /* VBOX_WITH_HARDENINIG */
-/*******************************************************************************
-* Internal Functions *
-*******************************************************************************/
+/*********************************************************************************************************************************
+* Internal Functions *
+*********************************************************************************************************************************/
static void _stdcall VBoxDrvNtUnload(PDRIVER_OBJECT pDrvObj);
static NTSTATUS _stdcall VBoxDrvNtCreate(PDEVICE_OBJECT pDevObj, PIRP pIrp);
static NTSTATUS _stdcall VBoxDrvNtCleanup(PDEVICE_OBJECT pDevObj, PIRP pIrp);
@@ -307,17 +308,17 @@ static void supdrvNtErrorInfoCleanupProcess(HANDLE hProcessId);
#endif
-/*******************************************************************************
-* Exported Functions *
-*******************************************************************************/
+/*********************************************************************************************************************************
+* Exported Functions *
+*********************************************************************************************************************************/
RT_C_DECLS_BEGIN
ULONG _stdcall DriverEntry(PDRIVER_OBJECT pDrvObj, PUNICODE_STRING pRegPath);
RT_C_DECLS_END
-/*******************************************************************************
-* Global Variables *
-*******************************************************************************/
+/*********************************************************************************************************************************
+* Global Variables *
+*********************************************************************************************************************************/
/** Pointer to the system device instance. */
static PDEVICE_OBJECT g_pDevObjSys = NULL;
/** Pointer to the user device instance. */
@@ -1841,15 +1842,16 @@ int VBOXCALL supdrvOSLdrValidatePointer(PSUPDRVDEVEXT pDevExt, PSUPDRVLDRIMAG
/**
- * memcmp + log.
+ * memcmp + errormsg + log.
*
* @returns Same as memcmp.
* @param pImage The image.
* @param pbImageBits The image bits ring-3 uploads.
* @param uRva The RVA to start comparing at.
* @param cb The number of bytes to compare.
+ * @param pReq The load request.
*/
-static int supdrvNtCompare(PSUPDRVLDRIMAGE pImage, const uint8_t *pbImageBits, uint32_t uRva, uint32_t cb)
+static int supdrvNtCompare(PSUPDRVLDRIMAGE pImage, const uint8_t *pbImageBits, uint32_t uRva, uint32_t cb, PSUPLDRLOAD pReq)
{
int iDiff = memcmp((uint8_t const *)pImage->pvImage + uRva, pbImageBits + uRva, cb);
if (iDiff)
@@ -1859,20 +1861,28 @@ static int supdrvNtCompare(PSUPDRVLDRIMAGE pImage, const uint8_t *pbImageBits, u
for (size_t off = uRva; cbLeft > 0; off++, cbLeft--)
if (pbNativeBits[off] != pbImageBits[off])
{
- char szBytes[128];
- RTStrPrintf(szBytes, sizeof(szBytes), "native: %.*Rhxs our: %.*Rhxs",
- RT_MIN(12, cbLeft), &pbNativeBits[off],
- RT_MIN(12, cbLeft), &pbImageBits[off]);
- SUPR0Printf("VBoxDrv: Mismatch at %#x of %s: %s\n", off, pImage->szName, szBytes);
+ /* Note! We need to copy image bits into a temporary stack buffer here as we'd
+ otherwise risk overwriting them while formatting the error message. */
+ uint8_t abBytes[64];
+ memcpy(abBytes, &pbImageBits[off], RT_MIN(64, cbLeft));
+ supdrvLdrLoadError(VERR_LDR_MISMATCH_NATIVE, pReq,
+ "Mismatch at %#x (%p) of %s loaded at %p:\n"
+ "ntld: %.*Rhxs\n"
+ "iprt: %.*Rhxs",
+ off, &pbNativeBits[off], pImage->szName, pImage->pvImage,
+ RT_MIN(64, cbLeft), &pbNativeBits[off],
+ RT_MIN(64, cbLeft), &abBytes[0]);
+ SUPR0Printf("VBoxDrv: %s", pReq->u.Out.szError);
break;
}
}
return iDiff;
}
+
int VBOXCALL supdrvOSLdrLoad(PSUPDRVDEVEXT pDevExt, PSUPDRVLDRIMAGE pImage, const uint8_t *pbImageBits, PSUPLDRLOAD pReq)
{
- NOREF(pDevExt); NOREF(pReq);
+ NOREF(pDevExt);
if (pImage->pvNtSectionObj)
{
/*
@@ -1882,25 +1892,44 @@ int VBOXCALL supdrvOSLdrLoad(PSUPDRVDEVEXT pDevExt, PSUPDRVLDRIMAGE pImage, c
return VINF_SUCCESS;
/*
- * However, on Windows Server 2003 (sp2 x86) both import thunk tables
- * are fixed up and we typically get a mismatch in the INIT section.
+ * On Windows 10 the ImageBase member of the optional header is sometimes
+ * updated with the actual load address and sometimes not. Try compare
+ *
+ */
+ uint32_t const offNtHdrs = *(uint16_t *)pbImageBits == IMAGE_DOS_SIGNATURE
+ ? ((IMAGE_DOS_HEADER const *)pbImageBits)->e_lfanew
+ : 0;
+ AssertLogRelReturn(offNtHdrs + sizeof(IMAGE_NT_HEADERS) < pImage->cbImageBits, VERR_INTERNAL_ERROR_5);
+ IMAGE_NT_HEADERS const *pNtHdrsIprt = (IMAGE_NT_HEADERS const *)(pbImageBits + offNtHdrs);
+ IMAGE_NT_HEADERS const *pNtHdrsNtLd = (IMAGE_NT_HEADERS const *)((uintptr_t)pImage->pvImage + offNtHdrs);
+
+ uint32_t const offImageBase = offNtHdrs + RT_OFFSETOF(IMAGE_NT_HEADERS, OptionalHeader.ImageBase);
+ uint32_t const cbImageBase = RT_SIZEOFMEMB(IMAGE_NT_HEADERS, OptionalHeader.ImageBase);
+ if ( pNtHdrsNtLd->OptionalHeader.ImageBase != pNtHdrsIprt->OptionalHeader.ImageBase
+ && ( pNtHdrsNtLd->OptionalHeader.ImageBase == (uintptr_t)pImage->pvImage
+ || pNtHdrsIprt->OptionalHeader.ImageBase == (uintptr_t)pImage->pvImage)
+ && pNtHdrsIprt->Signature == IMAGE_NT_SIGNATURE
+ && pNtHdrsIprt->OptionalHeader.Magic == IMAGE_NT_OPTIONAL_HDR_MAGIC
+ && !memcmp(pImage->pvImage, pbImageBits, offImageBase)
+ && !memcmp((uint8_t const *)pImage->pvImage + offImageBase + cbImageBase,
+ pbImageBits + offImageBase + cbImageBase,
+ pImage->cbImageBits - offImageBase - cbImageBase))
+ return VINF_SUCCESS;
+
+ /*
+ * On Windows Server 2003 (sp2 x86) both import thunk tables are fixed
+ * up and we typically get a mismatch in the INIT section.
*
* So, lets see if everything matches when excluding the
- * OriginalFirstThunk tables. To make life simpler, set the max number
- * of imports to 16 and just record and sort the locations that needs
- * to be excluded from the comparison.
+ * OriginalFirstThunk tables and (maybe) the ImageBase member.
+ * For simplicity the max number of exclusion regions is set to 16.
*/
- IMAGE_NT_HEADERS const *pNtHdrs;
- pNtHdrs = (IMAGE_NT_HEADERS const *)(pbImageBits
- + ( *(uint16_t *)pbImageBits == IMAGE_DOS_SIGNATURE
- ? ((IMAGE_DOS_HEADER const *)pbImageBits)->e_lfanew
- : 0));
- if ( pNtHdrs->Signature == IMAGE_NT_SIGNATURE
- && pNtHdrs->OptionalHeader.Magic == IMAGE_NT_OPTIONAL_HDR_MAGIC
- && pNtHdrs->OptionalHeader.NumberOfRvaAndSizes > IMAGE_DIRECTORY_ENTRY_IMPORT
- && pNtHdrs->OptionalHeader.DataDirectory[IMAGE_DIRECTORY_ENTRY_IMPORT].Size >= sizeof(IMAGE_IMPORT_DESCRIPTOR)
- && pNtHdrs->OptionalHeader.DataDirectory[IMAGE_DIRECTORY_ENTRY_IMPORT].VirtualAddress > sizeof(IMAGE_NT_HEADERS)
- && pNtHdrs->OptionalHeader.DataDirectory[IMAGE_DIRECTORY_ENTRY_IMPORT].VirtualAddress < pImage->cbImageBits
+ if ( pNtHdrsIprt->Signature == IMAGE_NT_SIGNATURE
+ && pNtHdrsIprt->OptionalHeader.Magic == IMAGE_NT_OPTIONAL_HDR_MAGIC
+ && pNtHdrsIprt->OptionalHeader.NumberOfRvaAndSizes > IMAGE_DIRECTORY_ENTRY_IMPORT
+ && pNtHdrsIprt->OptionalHeader.DataDirectory[IMAGE_DIRECTORY_ENTRY_IMPORT].Size >= sizeof(IMAGE_IMPORT_DESCRIPTOR)
+ && pNtHdrsIprt->OptionalHeader.DataDirectory[IMAGE_DIRECTORY_ENTRY_IMPORT].VirtualAddress > sizeof(IMAGE_NT_HEADERS)
+ && pNtHdrsIprt->OptionalHeader.DataDirectory[IMAGE_DIRECTORY_ENTRY_IMPORT].VirtualAddress < pImage->cbImageBits
)
{
struct MyRegion
@@ -1909,11 +1938,23 @@ int VBOXCALL supdrvOSLdrLoad(PSUPDRVDEVEXT pDevExt, PSUPDRVLDRIMAGE pImage, c
uint32_t cb;
} aExcludeRgns[16];
unsigned cExcludeRgns = 0;
- uint32_t cImpsLeft = pNtHdrs->OptionalHeader.DataDirectory[IMAGE_DIRECTORY_ENTRY_IMPORT].Size
+
+ /* ImageBase: */
+ if ( pNtHdrsNtLd->OptionalHeader.ImageBase != pNtHdrsIprt->OptionalHeader.ImageBase
+ && ( pNtHdrsNtLd->OptionalHeader.ImageBase == (uintptr_t)pImage->pvImage
+ || pNtHdrsIprt->OptionalHeader.ImageBase == (uintptr_t)pImage->pvImage) )
+ {
+ aExcludeRgns[cExcludeRgns].uRva = offImageBase;
+ aExcludeRgns[cExcludeRgns].cb = cbImageBase;
+ cExcludeRgns++;
+ }
+
+ /* Imports: */
+ uint32_t cImpsLeft = pNtHdrsIprt->OptionalHeader.DataDirectory[IMAGE_DIRECTORY_ENTRY_IMPORT].Size
/ sizeof(IMAGE_IMPORT_DESCRIPTOR);
- IMAGE_IMPORT_DESCRIPTOR const *pImp;
- pImp = (IMAGE_IMPORT_DESCRIPTOR const *)(pbImageBits
- + pNtHdrs->OptionalHeader.DataDirectory[IMAGE_DIRECTORY_ENTRY_IMPORT].VirtualAddress);
+ uint32_t offImps = pNtHdrsIprt->OptionalHeader.DataDirectory[IMAGE_DIRECTORY_ENTRY_IMPORT].VirtualAddress;
+ AssertLogRelReturn(offImps + cImpsLeft * sizeof(IMAGE_IMPORT_DESCRIPTOR) <= pImage->cbImageBits, VERR_INTERNAL_ERROR_3);
+ IMAGE_IMPORT_DESCRIPTOR const *pImp = (IMAGE_IMPORT_DESCRIPTOR const *)(pbImageBits + offImps);
while ( cImpsLeft-- > 0
&& cExcludeRgns < RT_ELEMENTS(aExcludeRgns))
{
@@ -1953,19 +1994,19 @@ int VBOXCALL supdrvOSLdrLoad(PSUPDRVDEVEXT pDevExt, PSUPDRVLDRIMAGE pImage, c
for (unsigned i = 0; !iDiff && i < cExcludeRgns; i++)
{
if (uRvaNext < aExcludeRgns[i].uRva)
- iDiff = supdrvNtCompare(pImage, pbImageBits, uRvaNext, aExcludeRgns[i].uRva - uRvaNext);
+ iDiff = supdrvNtCompare(pImage, pbImageBits, uRvaNext, aExcludeRgns[i].uRva - uRvaNext, pReq);
uRvaNext = aExcludeRgns[i].uRva + aExcludeRgns[i].cb;
}
if (!iDiff && uRvaNext < pImage->cbImageBits)
- iDiff = supdrvNtCompare(pImage, pbImageBits, uRvaNext, pImage->cbImageBits - uRvaNext);
+ iDiff = supdrvNtCompare(pImage, pbImageBits, uRvaNext, pImage->cbImageBits - uRvaNext, pReq);
if (!iDiff)
return VINF_SUCCESS;
}
else
- supdrvNtCompare(pImage, pbImageBits, 0, pImage->cbImageBits);
+ supdrvNtCompare(pImage, pbImageBits, 0, pImage->cbImageBits, pReq);
return VERR_LDR_MISMATCH_NATIVE;
}
- return VERR_INTERNAL_ERROR_4;
+ return supdrvLdrLoadError(VERR_INTERNAL_ERROR_4, pReq, "No NT section object! Impossible!");
}
diff --git a/src/VBox/HostDrivers/Support/win/SUPHardenedVerifyImage-win.cpp b/src/VBox/HostDrivers/Support/win/SUPHardenedVerifyImage-win.cpp
index 8f8947a..e8ad9a1 100644
--- a/src/VBox/HostDrivers/Support/win/SUPHardenedVerifyImage-win.cpp
+++ b/src/VBox/HostDrivers/Support/win/SUPHardenedVerifyImage-win.cpp
@@ -24,9 +24,10 @@
* terms and conditions of either the GPL or the CDDL or both.
*/
-/*******************************************************************************
-* Header Files *
-*******************************************************************************/
+
+/*********************************************************************************************************************************
+* Header Files *
+*********************************************************************************************************************************/
#ifdef IN_RING0
# define IPRT_NT_MAP_TO_ZW
# include <iprt/nt/nt.h>
@@ -59,9 +60,9 @@
#include "win/SUPHardenedVerify-win.h"
-/*******************************************************************************
-* Defined Constants And Macros *
-*******************************************************************************/
+/*********************************************************************************************************************************
+* Defined Constants And Macros *
+*********************************************************************************************************************************/
/** The size of static hash (output) buffers.
* Avoids dynamic allocations and cleanups for of small buffers as well as extra
* calls for getting the appropriate buffer size. The largest digest in regular
@@ -75,9 +76,9 @@
#endif
-/*******************************************************************************
-* Structures and Typedefs *
-*******************************************************************************/
+/*********************************************************************************************************************************
+* Structures and Typedefs *
+*********************************************************************************************************************************/
#ifdef IN_RING3
typedef LONG (WINAPI * PFNWINVERIFYTRUST)(HWND hwnd, GUID const *pgActionID, PVOID pWVTData);
@@ -103,9 +104,9 @@ typedef NTSTATUS (WINAPI *PFNBCRYPTOPENALGORTIHMPROVIDER)(BCRYPT_ALG_HANDLE *phA
#endif
-/*******************************************************************************
-* Global Variables *
-*******************************************************************************/
+/*********************************************************************************************************************************
+* Global Variables *
+*********************************************************************************************************************************/
/** The build certificate. */
static RTCRX509CERTIFICATE g_BuildX509Cert;
@@ -195,9 +196,9 @@ static uint32_t volatile g_idActiveThread = UINT32_MAX;
#endif
-/*******************************************************************************
-* Internal Functions *
-*******************************************************************************/
+/*********************************************************************************************************************************
+* Internal Functions *
+*********************************************************************************************************************************/
#ifdef IN_RING3
static int supR3HardNtViCallWinVerifyTrust(HANDLE hFile, PCRTUTF16 pwszName, uint32_t fFlags, PRTERRINFO pErrInfo,
PFNWINVERIFYTRUST pfnWinVerifyTrust, HRESULT *phrcWinVerifyTrust);
@@ -919,7 +920,17 @@ static int supHardNtViCheckIfNotSignedOk(RTLDRMOD hLdrMod, PCRTUTF16 pwszName, u
/**
- * @callback_method_impl{RTCRPKCS7VERIFYCERTCALLBACK,
+ * @callback_method_impl{FNRTDUMPPRINTFV, Formats into RTERRINFO. }
+ */
+static DECLCALLBACK(void) supHardNtViAsn1DumpToErrInfo(void *pvUser, const char *pszFormat, va_list va)
+{
+ PRTERRINFO pErrInfo = (PRTERRINFO)pvUser;
+ RTErrInfoAddV(pErrInfo, pErrInfo->rc, pszFormat, va);
+}
+
+
+/**
+ * @callback_method_impl{FNRTCRPKCS7VERIFYCERTCALLBACK,
* Standard code signing. Use this for Microsoft SPC.}
*/
static DECLCALLBACK(int) supHardNtViCertVerifyCallback(PCRTCRX509CERTIFICATE pCert, RTCRX509CERTPATHS hCertPaths,
@@ -937,7 +948,15 @@ static DECLCALLBACK(int) supHardNtViCertVerifyCallback(PCRTCRX509CERTIFICATE pCe
{
if (RTCrX509Certificate_Compare(pCert, &g_BuildX509Cert) == 0) /* healthy paranoia */
return VINF_SUCCESS;
- return RTErrInfoSetF(pErrInfo, VERR_SUP_VP_NOT_BUILD_CERT_IPE, "Not valid kernel code signature.");
+ int rc = RTErrInfoSetF(pErrInfo, VERR_SUP_VP_NOT_BUILD_CERT_IPE, "Not valid kernel code signature (fFlags=%#x).", fFlags);
+ if (pErrInfo)
+ {
+ RTErrInfoAdd(pErrInfo, rc, "\n\nExe cert:\n");
+ RTAsn1Dump(&pCert->SeqCore.Asn1Core, 0 /*fFlags*/, 0 /*uLevel*/, supHardNtViAsn1DumpToErrInfo, pErrInfo);
+ RTErrInfoAdd(pErrInfo, rc, "\n\nBuild cert:\n");
+ RTAsn1Dump(&g_BuildX509Cert.SeqCore.Asn1Core, 0 /*fFlags*/, 0 /*uLevel*/, supHardNtViAsn1DumpToErrInfo, pErrInfo);
+ }
+ return rc;
}
/*
diff --git a/src/VBox/HostDrivers/Support/win/SUPHardenedVerifyProcess-win.cpp b/src/VBox/HostDrivers/Support/win/SUPHardenedVerifyProcess-win.cpp
index 3120248..86821c0 100644
--- a/src/VBox/HostDrivers/Support/win/SUPHardenedVerifyProcess-win.cpp
+++ b/src/VBox/HostDrivers/Support/win/SUPHardenedVerifyProcess-win.cpp
@@ -24,9 +24,10 @@
* terms and conditions of either the GPL or the CDDL or both.
*/
-/*******************************************************************************
-* Header Files *
-*******************************************************************************/
+
+/*********************************************************************************************************************************
+* Header Files *
+*********************************************************************************************************************************/
#ifdef IN_RING0
# define IPRT_NT_MAP_TO_ZW
# include <iprt/nt/nt.h>
@@ -51,9 +52,9 @@
#include "win/SUPHardenedVerify-win.h"
-/*******************************************************************************
-* Structures and Typedefs *
-*******************************************************************************/
+/*********************************************************************************************************************************
+* Structures and Typedefs *
+*********************************************************************************************************************************/
/**
* Virtual address space region.
*/
@@ -168,9 +169,9 @@ typedef struct SUPHNTVPSTATE
typedef SUPHNTVPSTATE *PSUPHNTVPSTATE;
-/*******************************************************************************
-* Global Variables *
-*******************************************************************************/
+/*********************************************************************************************************************************
+* Global Variables *
+*********************************************************************************************************************************/
/**
* System DLLs allowed to be loaded into the process.
* @remarks supHardNtVpCheckDlls assumes these are lower case.
@@ -205,7 +206,8 @@ static const char *g_apszSupNtVpAllowedDlls[] =
/**
* VBox executables allowed to start VMs.
- * @remarks Remember to keep in sync with SUPR3HardenedVerify.cpp.
+ * @remarks Remember to keep in sync with g_aSupInstallFiles in
+ * SUPR3HardenedVerify.cpp.
*/
static const char *g_apszSupNtVpAllowedVmExes[] =
{
@@ -221,6 +223,7 @@ static const char *g_apszSupNtVpAllowedVmExes[] =
"tstVMM.exe",
"tstVMREQ.exe",
"tstCFGM.exe",
+ "tstGIP-2.exe",
"tstIntNet-1.exe",
"tstMMHyperHeap.exe",
"tstRTR0ThreadPreemptionDriver.exe",
diff --git a/src/VBox/HostDrivers/Support/win/SUPLib-win.cpp b/src/VBox/HostDrivers/Support/win/SUPLib-win.cpp
index c4050f3..4ffd922 100644
--- a/src/VBox/HostDrivers/Support/win/SUPLib-win.cpp
+++ b/src/VBox/HostDrivers/Support/win/SUPLib-win.cpp
@@ -24,9 +24,10 @@
* terms and conditions of either the GPL or the CDDL or both.
*/
-/*******************************************************************************
-* Header Files *
-*******************************************************************************/
+
+/*********************************************************************************************************************************
+* Header Files *
+*********************************************************************************************************************************/
#define LOG_GROUP LOG_GROUP_SUP
#ifdef IN_SUP_HARDENED_R3
# undef DEBUG /* Warning: disables RT_STRICT */
@@ -56,16 +57,16 @@
#endif
-/*******************************************************************************
-* Defined Constants And Macros *
-*******************************************************************************/
+/*********************************************************************************************************************************
+* Defined Constants And Macros *
+*********************************************************************************************************************************/
/** The support service name. */
#define SERVICE_NAME "VBoxDrv"
-/*******************************************************************************
-* Internal Functions *
-*******************************************************************************/
+/*********************************************************************************************************************************
+* Internal Functions *
+*********************************************************************************************************************************/
#ifndef IN_SUP_HARDENED_R3
static int suplibOsCreateService(void);
//unused: static int suplibOsUpdateService(void);
@@ -79,9 +80,10 @@ static int suplibConvertNtStatus(NTSTATUS rcNt);
static int suplibConvertWin32Err(int);
#endif
-/*******************************************************************************
-* Global Variables *
-*******************************************************************************/
+
+/*********************************************************************************************************************************
+* Global Variables *
+*********************************************************************************************************************************/
static bool g_fHardenedVerifyInited = false;
diff --git a/src/VBox/HostDrivers/Support/win/SUPR0IdcClient-win.c b/src/VBox/HostDrivers/Support/win/SUPR0IdcClient-win.c
index 019e122..ef6f7cf 100644
--- a/src/VBox/HostDrivers/Support/win/SUPR0IdcClient-win.c
+++ b/src/VBox/HostDrivers/Support/win/SUPR0IdcClient-win.c
@@ -24,16 +24,17 @@
* terms and conditions of either the GPL or the CDDL or both.
*/
-/*******************************************************************************
-* Header Files *
-*******************************************************************************/
+
+/*********************************************************************************************************************************
+* Header Files *
+*********************************************************************************************************************************/
#include "../SUPR0IdcClientInternal.h"
#include <VBox/err.h>
-/*******************************************************************************
-* Defined Constants And Macros *
-*******************************************************************************/
+/*********************************************************************************************************************************
+* Defined Constants And Macros *
+*********************************************************************************************************************************/
/** NT Device name. */
#define DEVICE_NAME_NT L"\\Device\\VBoxDrv"
diff --git a/src/VBox/HostDrivers/Support/win/SUPR3HardenedMain-win.cpp b/src/VBox/HostDrivers/Support/win/SUPR3HardenedMain-win.cpp
index 1fb7e5f..bc06f44 100644
--- a/src/VBox/HostDrivers/Support/win/SUPR3HardenedMain-win.cpp
+++ b/src/VBox/HostDrivers/Support/win/SUPR3HardenedMain-win.cpp
@@ -24,9 +24,10 @@
* terms and conditions of either the GPL or the CDDL or both.
*/
-/*******************************************************************************
-* Header Files *
-*******************************************************************************/
+
+/*********************************************************************************************************************************
+* Header Files *
+*********************************************************************************************************************************/
#include <iprt/nt/nt-and-windows.h>
#include <AccCtrl.h>
#include <AclApi.h>
@@ -60,9 +61,9 @@
#endif
-/*******************************************************************************
-* Defined Constants And Macros *
-*******************************************************************************/
+/*********************************************************************************************************************************
+* Defined Constants And Macros *
+*********************************************************************************************************************************/
/** The first argument of a respawed stub when respawned for the first time.
* This just needs to be unique enough to avoid most confusion with real
* executable names, there are other checks in place to make sure we've respanwed. */
@@ -97,9 +98,9 @@
} while (0)
-/*******************************************************************************
-* Structures and Typedefs *
-*******************************************************************************/
+/*********************************************************************************************************************************
+* Structures and Typedefs *
+*********************************************************************************************************************************/
/**
* Security descriptor cleanup structure.
*/
@@ -215,7 +216,7 @@ typedef struct SUPR3WINPROCPARAMS
/** Where if message. */
char szWhere[80];
/** Error message / path name string space. */
- char szErrorMsg[4096];
+ char szErrorMsg[16384+1024];
} SUPR3WINPROCPARAMS;
@@ -254,9 +255,9 @@ typedef struct SUPR3HARDNTCHILD
typedef SUPR3HARDNTCHILD *PSUPR3HARDNTCHILD;
-/*******************************************************************************
-* Global Variables *
-*******************************************************************************/
+/*********************************************************************************************************************************
+* Global Variables *
+*********************************************************************************************************************************/
/** Process parameters. Specified by parent if VM process, see
* supR3HardenedVmProcessInit. */
static SUPR3WINPROCPARAMS g_ProcParams = { NULL, NULL, 0, (SUPR3WINCHILDREQ)0, 0 };
@@ -371,9 +372,9 @@ static uint32_t g_fSupAdversaries = 0;
/** @} */
-/*******************************************************************************
-* Internal Functions *
-*******************************************************************************/
+/*********************************************************************************************************************************
+* Internal Functions *
+*********************************************************************************************************************************/
static NTSTATUS supR3HardenedScreenImage(HANDLE hFile, bool fImage, bool fIgnoreArch, PULONG pfAccess, PULONG pfProtect,
bool *pfCallRealApi, const char *pszCaller, bool fAvoidWinVerifyTrust,
bool *pfQuiet);
@@ -4363,7 +4364,7 @@ static void supR3HardenedWinOpenStubDevice(void)
* extra information that goes into VBoxStartup.log so that we stand a
* better chance resolving the issue.
*/
- char szErrorInfo[_4K];
+ char szErrorInfo[16384];
int rc = VERR_OPEN_FAILED;
if (SUP_NT_STATUS_IS_VBOX(rcNt)) /* See VBoxDrvNtErr2NtStatus. */
{
@@ -4409,7 +4410,7 @@ static void supR3HardenedWinOpenStubDevice(void)
supR3HardenedFatalMsg("supR3HardenedWinReSpawn", kSupInitOp_Driver, rc,
"NtCreateFile(%ls) failed: %Rrc (rcNt=%#x)%s", s_wszName, rc, rcNt,
supR3HardenedWinReadErrorInfoDevice(szErrorInfo, sizeof(szErrorInfo),
- "\nVBoxDrvStub error: "));
+ "\nVBoxDrvStub error: "));
}
else
{
diff --git a/src/VBox/HostDrivers/Support/win/SUPR3HardenedMainA-win.asm b/src/VBox/HostDrivers/Support/win/SUPR3HardenedMainA-win.asm
index efa7f9c..ebbe01f 100644
--- a/src/VBox/HostDrivers/Support/win/SUPR3HardenedMainA-win.asm
+++ b/src/VBox/HostDrivers/Support/win/SUPR3HardenedMainA-win.asm
@@ -163,6 +163,18 @@ BEGINPROC %1 %+ _SyscallType1
syscall
ret
ENDPROC %1 %+ _SyscallType1
+BEGINPROC %1 %+ _SyscallType2 ; Introduced with build 10525
+ SEH64_END_PROLOGUE
+ mov eax, [NAME(g_uApiNo %+ %1) xWrtRIP]
+ test byte [07ffe0308h], 1 ; SharedUserData!Something
+ mov r10, rcx
+ jnz .int_alternative
+ syscall
+ ret
+.int_alternative:
+ int 2eh
+ ret
+ENDPROC %1 %+ _SyscallType2
%else
BEGINPROC %1 %+ _SyscallType1
mov edx, 07ffe0300h ; SharedUserData!SystemCallStub
diff --git a/src/VBox/HostDrivers/Support/win/SUPR3HardenedMainImports-win.cpp b/src/VBox/HostDrivers/Support/win/SUPR3HardenedMainImports-win.cpp
index 662cc76..4017c57 100644
--- a/src/VBox/HostDrivers/Support/win/SUPR3HardenedMainImports-win.cpp
+++ b/src/VBox/HostDrivers/Support/win/SUPR3HardenedMainImports-win.cpp
@@ -24,9 +24,10 @@
* terms and conditions of either the GPL or the CDDL or both.
*/
-/*******************************************************************************
-* Header Files *
-*******************************************************************************/
+
+/*********************************************************************************************************************************
+* Header Files *
+*********************************************************************************************************************************/
#include <iprt/nt/nt-and-windows.h>
#include <VBox/sup.h>
@@ -40,9 +41,9 @@
#include "SUPHardenedVerify-win.h"
-/*******************************************************************************
-* Defined Constants And Macros *
-*******************************************************************************/
+/*********************************************************************************************************************************
+* Defined Constants And Macros *
+*********************************************************************************************************************************/
#define SUPHARNT_COMMENT(a_Blah) /* nothing */
#define VBOX_HARDENED_STUB_WITHOUT_IMPORTS
@@ -59,9 +60,9 @@
#endif
-/*******************************************************************************
-* Defined Constants And Macros *
-*******************************************************************************/
+/*********************************************************************************************************************************
+* Defined Constants And Macros *
+*********************************************************************************************************************************/
/**
* Import function entry.
*/
@@ -91,9 +92,9 @@ typedef struct SUPHNTIMPSYSCALL
uint32_t *puApiNo;
/** Assembly system call routine, type 1. */
PFNRT pfnType1;
-#ifdef RT_ARCH_X86
/** Assembly system call routine, type 2. */
PFNRT pfnType2;
+#ifdef RT_ARCH_X86
/** The parameter size in bytes for a standard call. */
uint32_t cbParams;
#endif
@@ -219,7 +220,7 @@ static const SUPHNTIMPFUNC g_aSupNtImpKernel32Functions[] =
# define SUPHARNT_IMPORT_STDCALL(a_Name, a_cbParamsX86) \
{ NULL, NULL },
# define SUPHARNT_IMPORT_SYSCALL(a_Name, a_cbParamsX86) \
- { &RT_CONCAT(g_uApiNo, a_Name), &RT_CONCAT(a_Name, _SyscallType1) },
+ { &RT_CONCAT(g_uApiNo, a_Name), &RT_CONCAT(a_Name, _SyscallType1), &RT_CONCAT(a_Name, _SyscallType2) },
#elif defined(RT_ARCH_X86)
# define SUPHARNT_IMPORT_STDCALL(a_Name, a_cbParamsX86) \
{ NULL, NULL, NULL, 0 },
@@ -455,14 +456,27 @@ static void supR3HardenedDirectSyscall(PSUPHNTIMPDLL pDll, PCSUPHNTIMPFUNC pImpo
* Parse the code and extract the API call number.
*/
#ifdef RT_ARCH_AMD64
- /* Pattern #1: XP64/W2K3-64 thru Windows 8.1
- 0:000> u ntdll!NtCreateSection
- ntdll!NtCreateSection:
- 00000000`779f1750 4c8bd1 mov r10,rcx
- 00000000`779f1753 b847000000 mov eax,47h
- 00000000`779f1758 0f05 syscall
- 00000000`779f175a c3 ret
- 00000000`779f175b 0f1f440000 nop dword ptr [rax+rax] */
+ /* Pattern #1: XP64/W2K3-64 thru Windows 10 build 10240.
+ 0:000> u ntdll!NtCreateSection
+ ntdll!NtCreateSection:
+ 00000000`779f1750 4c8bd1 mov r10,rcx
+ 00000000`779f1753 b847000000 mov eax,47h
+ 00000000`779f1758 0f05 syscall
+ 00000000`779f175a c3 ret
+ 00000000`779f175b 0f1f440000 nop dword ptr [rax+rax]
+
+ Pattern #2: Windows 10 build 10525+.
+ 0:000> u ntdll_7ffc26300000!NtCreateSection
+ ntdll_7ffc26300000!ZwCreateSection:
+ 00007ffc`263943e0 4c8bd1 mov r10,rcx
+ 00007ffc`263943e3 b84a000000 mov eax,4Ah
+ 00007ffc`263943e8 f604250803fe7f01 test byte ptr [SharedUserData+0x308 (00000000`7ffe0308)],1
+ 00007ffc`263943f0 7503 jne ntdll_7ffc26300000!ZwCreateSection+0x15 (00007ffc`263943f5)
+ 00007ffc`263943f2 0f05 syscall
+ 00007ffc`263943f4 c3 ret
+ 00007ffc`263943f5 cd2e int 2Eh
+ 00007ffc`263943f7 c3 ret
+ */
if ( pbFunction[ 0] == 0x4c /* mov r10, rcx */
&& pbFunction[ 1] == 0x8b
&& pbFunction[ 2] == 0xd1
@@ -470,14 +484,37 @@ static void supR3HardenedDirectSyscall(PSUPHNTIMPDLL pDll, PCSUPHNTIMPFUNC pImpo
//&& pbFunction[ 4] == 0xZZ
//&& pbFunction[ 5] == 0xYY
&& pbFunction[ 6] == 0x00
- && pbFunction[ 7] == 0x00
- && pbFunction[ 8] == 0x0f /* syscall */
- && pbFunction[ 9] == 0x05
- && pbFunction[10] == 0xc3 /* ret */ )
+ && pbFunction[ 7] == 0x00)
{
- *pSyscall->puApiNo = RT_MAKE_U16(pbFunction[4], pbFunction[5]);
- *pImport->ppfnImport = pSyscall->pfnType1;
- return;
+ if ( pbFunction[ 8] == 0x0f /* syscall */
+ && pbFunction[ 9] == 0x05
+ && pbFunction[10] == 0xc3 /* ret */ )
+ {
+ *pSyscall->puApiNo = RT_MAKE_U16(pbFunction[4], pbFunction[5]);
+ *pImport->ppfnImport = pSyscall->pfnType1;
+ return;
+ }
+ if ( pbFunction[ 8] == 0xf6 /* test byte ptr [SharedUserData+0x308 (00000000`7ffe0308)],1 */
+ && pbFunction[ 9] == 0x04
+ && pbFunction[10] == 0x25
+ && pbFunction[11] == 0x08
+ && pbFunction[12] == 0x03
+ && pbFunction[13] == 0xfe
+ && pbFunction[14] == 0x7f
+ && pbFunction[15] == 0x01
+ && pbFunction[16] == 0x75 /* jnz +3 */
+ && pbFunction[17] == 0x03
+ && pbFunction[18] == 0x0f /* syscall*/
+ && pbFunction[19] == 0x05
+ && pbFunction[20] == 0xc3 /* ret */
+ && pbFunction[21] == 0xcd /* int 2eh */
+ && pbFunction[22] == 0x2e
+ && pbFunction[23] == 0xc3 /* ret */ )
+ {
+ *pSyscall->puApiNo = RT_MAKE_U16(pbFunction[4], pbFunction[5]);
+ *pImport->ppfnImport = pSyscall->pfnType2;
+ return;
+ }
}
#else
/* Pattern #1: XP thru Windows 7
diff --git a/src/VBox/HostDrivers/Support/win/SUPR3HardenedNoCrt-win.cpp b/src/VBox/HostDrivers/Support/win/SUPR3HardenedNoCrt-win.cpp
index 2a48486..d943d4a 100644
--- a/src/VBox/HostDrivers/Support/win/SUPR3HardenedNoCrt-win.cpp
+++ b/src/VBox/HostDrivers/Support/win/SUPR3HardenedNoCrt-win.cpp
@@ -24,9 +24,10 @@
* terms and conditions of either the GPL or the CDDL or both.
*/
-/*******************************************************************************
-* Header Files *
-*******************************************************************************/
+
+/*********************************************************************************************************************************
+* Header Files *
+*********************************************************************************************************************************/
#include <iprt/nt/nt-and-windows.h>
#include <AccCtrl.h>
#include <AclApi.h>
@@ -245,25 +246,25 @@ DECLHIDDEN(void) supR3HardenedWinCompactHeaps(void)
-RTDECL(void *) RTMemTmpAllocTag(size_t cb, const char *pszTag) RT_NO_THROW
+RTDECL(void *) RTMemTmpAllocTag(size_t cb, const char *pszTag) RT_NO_THROW_DEF
{
return RTMemAllocTag(cb, pszTag);
}
-RTDECL(void *) RTMemTmpAllocZTag(size_t cb, const char *pszTag) RT_NO_THROW
+RTDECL(void *) RTMemTmpAllocZTag(size_t cb, const char *pszTag) RT_NO_THROW_DEF
{
return RTMemAllocZTag(cb, pszTag);
}
-RTDECL(void) RTMemTmpFree(void *pv) RT_NO_THROW
+RTDECL(void) RTMemTmpFree(void *pv) RT_NO_THROW_DEF
{
RTMemFree(pv);
}
-RTDECL(void *) RTMemAllocTag(size_t cb, const char *pszTag) RT_NO_THROW
+RTDECL(void *) RTMemAllocTag(size_t cb, const char *pszTag) RT_NO_THROW_DEF
{
HANDLE hHeap = g_hSupR3HardenedHeap;
if (!hHeap)
@@ -281,7 +282,7 @@ RTDECL(void *) RTMemAllocTag(size_t cb, const char *pszTag) RT_NO_THROW
}
-RTDECL(void *) RTMemAllocZTag(size_t cb, const char *pszTag) RT_NO_THROW
+RTDECL(void *) RTMemAllocZTag(size_t cb, const char *pszTag) RT_NO_THROW_DEF
{
HANDLE hHeap = g_hSupR3HardenedHeap;
if (!hHeap)
@@ -299,7 +300,7 @@ RTDECL(void *) RTMemAllocZTag(size_t cb, const char *pszTag) RT_NO_THROW
}
-RTDECL(void *) RTMemAllocVarTag(size_t cbUnaligned, const char *pszTag) RT_NO_THROW
+RTDECL(void *) RTMemAllocVarTag(size_t cbUnaligned, const char *pszTag) RT_NO_THROW_DEF
{
size_t cbAligned;
if (cbUnaligned >= 16)
@@ -310,7 +311,7 @@ RTDECL(void *) RTMemAllocVarTag(size_t cbUnaligned, const char *pszTag) RT_NO_TH
}
-RTDECL(void *) RTMemAllocZVarTag(size_t cbUnaligned, const char *pszTag) RT_NO_THROW
+RTDECL(void *) RTMemAllocZVarTag(size_t cbUnaligned, const char *pszTag) RT_NO_THROW_DEF
{
size_t cbAligned;
if (cbUnaligned >= 16)
@@ -321,7 +322,7 @@ RTDECL(void *) RTMemAllocZVarTag(size_t cbUnaligned, const char *pszTag) RT_NO_T
}
-RTDECL(void *) RTMemReallocTag(void *pvOld, size_t cbNew, const char *pszTag) RT_NO_THROW
+RTDECL(void *) RTMemReallocTag(void *pvOld, size_t cbNew, const char *pszTag) RT_NO_THROW_DEF
{
if (!pvOld)
return RTMemAllocZTag(cbNew, pszTag);
@@ -382,7 +383,7 @@ RTDECL(void *) RTMemReallocTag(void *pvOld, size_t cbNew, const char *pszTag) RT
}
-RTDECL(void) RTMemFree(void *pv) RT_NO_THROW
+RTDECL(void) RTMemFree(void *pv) RT_NO_THROW_DEF
{
if (pv)
{
@@ -417,7 +418,7 @@ RTDECL(void) RTMemFree(void *pv) RT_NO_THROW
* random number code.
*/
-RTDECL(void) RTMemWipeThoroughly(void *pv, size_t cb, size_t cMinPasses) RT_NO_THROW
+RTDECL(void) RTMemWipeThoroughly(void *pv, size_t cb, size_t cMinPasses) RT_NO_THROW_DEF
{
size_t cPasses = RT_MIN(cMinPasses, 6);
static const uint32_t s_aPatterns[] = { 0x00, 0xaa, 0x55, 0xff, 0xf0, 0x0f, 0xcc, 0x3c, 0xc3 };
diff --git a/src/VBox/HostDrivers/Support/win/SUPSvc-win.cpp b/src/VBox/HostDrivers/Support/win/SUPSvc-win.cpp
index ea0347b..d575941 100644
--- a/src/VBox/HostDrivers/Support/win/SUPSvc-win.cpp
+++ b/src/VBox/HostDrivers/Support/win/SUPSvc-win.cpp
@@ -24,9 +24,10 @@
* terms and conditions of either the GPL or the CDDL or both.
*/
-/*******************************************************************************
-* Header Files *
-*******************************************************************************/
+
+/*********************************************************************************************************************************
+* Header Files *
+*********************************************************************************************************************************/
#define LOG_GROUP LOG_GROUP_SUP
#include <Windows.h>
@@ -45,18 +46,18 @@
#include "../SUPSvcInternal.h"
-/*******************************************************************************
-* Defined Constants And Macros *
-*******************************************************************************/
+/*********************************************************************************************************************************
+* Defined Constants And Macros *
+*********************************************************************************************************************************/
/** The service name. */
#define SUPSVC_SERVICE_NAME "VBoxSupSvc"
/** The service display name. */
#define SUPSVC_SERVICE_DISPLAY_NAME "VirtualBox Support Service"
-/*******************************************************************************
-* Global Variables *
-*******************************************************************************/
+/*********************************************************************************************************************************
+* Global Variables *
+*********************************************************************************************************************************/
/** The service control handler handle. */
static SERVICE_STATUS_HANDLE g_hSupSvcWinCtrlHandler = NULL;
/** The service status. */
@@ -65,9 +66,9 @@ static uint32_t volatile g_u32SupSvcWinStatus = SERVICE_STOPPED;
static RTSEMEVENTMULTI g_hSupSvcWinEvent = NIL_RTSEMEVENTMULTI;
-/*******************************************************************************
-* Internal Functions *
-*******************************************************************************/
+/*********************************************************************************************************************************
+* Internal Functions *
+*********************************************************************************************************************************/
static SC_HANDLE supSvcWinOpenSCManager(const char *pszAction, DWORD dwAccess);
diff --git a/src/VBox/HostDrivers/Support/win/VBoxSupLib-win.cpp b/src/VBox/HostDrivers/Support/win/VBoxSupLib-win.cpp
index a6a83c4..bc3e372 100644
--- a/src/VBox/HostDrivers/Support/win/VBoxSupLib-win.cpp
+++ b/src/VBox/HostDrivers/Support/win/VBoxSupLib-win.cpp
@@ -25,9 +25,9 @@
*/
-/*******************************************************************************
-* Header Files *
-*******************************************************************************/
+/*********************************************************************************************************************************
+* Header Files *
+*********************************************************************************************************************************/
#include <iprt/nt/nt-and-windows.h>
#include <iprt/path.h>
diff --git a/src/VBox/HostDrivers/VBoxNetAdp/VBoxNetAdp.c b/src/VBox/HostDrivers/VBoxNetAdp/VBoxNetAdp.c
index 57649ba..567cae5 100644
--- a/src/VBox/HostDrivers/VBoxNetAdp/VBoxNetAdp.c
+++ b/src/VBox/HostDrivers/VBoxNetAdp/VBoxNetAdp.c
@@ -25,9 +25,10 @@
*
*/
-/*******************************************************************************
-* Header Files *
-*******************************************************************************/
+
+/*********************************************************************************************************************************
+* Header Files *
+*********************************************************************************************************************************/
#define LOG_GROUP LOG_GROUP_NET_ADP_DRV
#include "VBoxNetAdpInternal.h"
@@ -57,9 +58,9 @@
#endif
-/*******************************************************************************
-* Defined Constants And Macros *
-*******************************************************************************/
+/*********************************************************************************************************************************
+* Defined Constants And Macros *
+*********************************************************************************************************************************/
#define IFPORT_2_VBOXNETADP(pIfPort) \
( (PVBOXNETADP)((uint8_t *)pIfPort - RT_OFFSETOF(VBOXNETADP, MyPort)) )
diff --git a/src/VBox/HostDrivers/VBoxNetAdp/darwin/VBoxNetAdp-darwin.cpp b/src/VBox/HostDrivers/VBoxNetAdp/darwin/VBoxNetAdp-darwin.cpp
index 7a5a5a2..5ee5681 100644
--- a/src/VBox/HostDrivers/VBoxNetAdp/darwin/VBoxNetAdp-darwin.cpp
+++ b/src/VBox/HostDrivers/VBoxNetAdp/darwin/VBoxNetAdp-darwin.cpp
@@ -15,9 +15,10 @@
* hope that it will be useful, but WITHOUT ANY WARRANTY of any kind.
*/
-/*******************************************************************************
-* Header Files *
-*******************************************************************************/
+
+/*********************************************************************************************************************************
+* Header Files *
+*********************************************************************************************************************************/
#define LOG_GROUP LOG_GROUP_NET_ADP_DRV
#include "../../../Runtime/r0drv/darwin/the-darwin-kernel.h"
@@ -56,9 +57,10 @@ extern "C" {
#define VBOXNETADP_OS_SPECFIC 1
#include "../VBoxNetAdpInternal.h"
-/*******************************************************************************
-* Defined Constants And Macros *
-*******************************************************************************/
+
+/*********************************************************************************************************************************
+* Defined Constants And Macros *
+*********************************************************************************************************************************/
/** The maximum number of SG segments.
* Used to prevent stack overflow and similar bad stuff. */
#define VBOXNETADP_DARWIN_MAX_SEGS 32
@@ -69,9 +71,10 @@ extern "C" {
#define VBOXNETADP_FROM_IFACE(iface) ((PVBOXNETADP) ifnet_softc(iface))
-/*******************************************************************************
-* Internal Functions *
-*******************************************************************************/
+
+/*********************************************************************************************************************************
+* Internal Functions *
+*********************************************************************************************************************************/
RT_C_DECLS_BEGIN
static kern_return_t VBoxNetAdpDarwinStart(struct kmod_info *pKModInfo, void *pvData);
static kern_return_t VBoxNetAdpDarwinStop(struct kmod_info *pKModInfo, void *pvData);
@@ -81,9 +84,10 @@ static int VBoxNetAdpDarwinOpen(dev_t Dev, int fFlags, int fDevType, struct proc
static int VBoxNetAdpDarwinClose(dev_t Dev, int fFlags, int fDevType, struct proc *pProcess);
static int VBoxNetAdpDarwinIOCtl(dev_t Dev, u_long iCmd, caddr_t pData, int fFlags, struct proc *pProcess);
-/*******************************************************************************
-* Global Variables *
-*******************************************************************************/
+
+/*********************************************************************************************************************************
+* Global Variables *
+*********************************************************************************************************************************/
/**
* Declare the module stuff.
*/
diff --git a/src/VBox/HostDrivers/VBoxNetAdp/freebsd/VBoxNetAdp-freebsd.c b/src/VBox/HostDrivers/VBoxNetAdp/freebsd/VBoxNetAdp-freebsd.c
index 977f8b4..a873ca8 100644
--- a/src/VBox/HostDrivers/VBoxNetAdp/freebsd/VBoxNetAdp-freebsd.c
+++ b/src/VBox/HostDrivers/VBoxNetAdp/freebsd/VBoxNetAdp-freebsd.c
@@ -28,9 +28,10 @@
* OTHER DEALINGS IN THE SOFTWARE.
*/
-/*******************************************************************************
-* Header Files *
-*******************************************************************************/
+
+/*********************************************************************************************************************************
+* Header Files *
+*********************************************************************************************************************************/
#include <sys/param.h>
#undef PVM
#include <sys/types.h>
diff --git a/src/VBox/HostDrivers/VBoxNetAdp/linux/VBoxNetAdp-linux.c b/src/VBox/HostDrivers/VBoxNetAdp/linux/VBoxNetAdp-linux.c
index 0a805fb..ca39ff6 100644
--- a/src/VBox/HostDrivers/VBoxNetAdp/linux/VBoxNetAdp-linux.c
+++ b/src/VBox/HostDrivers/VBoxNetAdp/linux/VBoxNetAdp-linux.c
@@ -15,9 +15,10 @@
* hope that it will be useful, but WITHOUT ANY WARRANTY of any kind.
*/
-/*******************************************************************************
-* Header Files *
-*******************************************************************************/
+
+/*********************************************************************************************************************************
+* Header Files *
+*********************************************************************************************************************************/
#include "the-linux-kernel.h"
#include "version-generated.h"
#include "product-generated.h"
@@ -44,17 +45,19 @@
#define VBOXNETADP_OS_SPECFIC 1
#include "../VBoxNetAdpInternal.h"
-/*******************************************************************************
-* Defined Constants And Macros *
-*******************************************************************************/
+
+/*********************************************************************************************************************************
+* Defined Constants And Macros *
+*********************************************************************************************************************************/
#define VBOXNETADP_LINUX_NAME "vboxnet%d"
#define VBOXNETADP_CTL_DEV_NAME "vboxnetctl"
#define VBOXNETADP_FROM_IFACE(iface) ((PVBOXNETADP) ifnet_softc(iface))
-/*******************************************************************************
-* Internal Functions *
-*******************************************************************************/
+
+/*********************************************************************************************************************************
+* Internal Functions *
+*********************************************************************************************************************************/
static int VBoxNetAdpLinuxInit(void);
static void VBoxNetAdpLinuxUnload(void);
@@ -68,9 +71,10 @@ static long VBoxNetAdpLinuxIOCtlUnlocked(struct file *pFilp,
unsigned int uCmd, unsigned long ulArg);
#endif /* LINUX_VERSION_CODE >= KERNEL_VERSION(2, 6, 36) */
-/*******************************************************************************
-* Global Variables *
-*******************************************************************************/
+
+/*********************************************************************************************************************************
+* Global Variables *
+*********************************************************************************************************************************/
module_init(VBoxNetAdpLinuxInit);
module_exit(VBoxNetAdpLinuxUnload);
diff --git a/src/VBox/HostDrivers/VBoxNetAdp/solaris/VBoxNetAdp-solaris.c b/src/VBox/HostDrivers/VBoxNetAdp/solaris/VBoxNetAdp-solaris.c
index 0feda73..7a46774 100644
--- a/src/VBox/HostDrivers/VBoxNetAdp/solaris/VBoxNetAdp-solaris.c
+++ b/src/VBox/HostDrivers/VBoxNetAdp/solaris/VBoxNetAdp-solaris.c
@@ -24,9 +24,10 @@
* terms and conditions of either the GPL or the CDDL or both.
*/
-/*******************************************************************************
-* Header Files *
-*******************************************************************************/
+
+/*********************************************************************************************************************************
+* Header Files *
+*********************************************************************************************************************************/
#define LOG_GROUP LOG_GROUP_NET_ADP_DRV
#include <VBox/log.h>
#include <VBox/err.h>
@@ -54,17 +55,18 @@
#include "../VBoxNetAdpInternal.h"
-/*******************************************************************************
-* Defined Constants And Macros *
-*******************************************************************************/
+
+/*********************************************************************************************************************************
+* Defined Constants And Macros *
+*********************************************************************************************************************************/
#define DEVICE_NAME "vboxnet"
/** The module descriptions as seen in 'modinfo'. */
#define DEVICE_DESC_DRV "VirtualBox NetAdp"
-/*******************************************************************************
-* Internal Functions *
-*******************************************************************************/
+/*********************************************************************************************************************************
+* Internal Functions *
+*********************************************************************************************************************************/
static int VBoxNetAdpSolarisAttach(dev_info_t *pDip, ddi_attach_cmd_t enmCmd);
static int VBoxNetAdpSolarisDetach(dev_info_t *pDip, ddi_detach_cmd_t enmCmd);
static int VBoxNetAdpSolarisQuiesceNotNeeded(dev_info_t *pDip);
@@ -186,9 +188,9 @@ static struct modlinkage g_VBoxNetAdpSolarisModLinkage =
};
-/*******************************************************************************
-* Global Variables *
-*******************************************************************************/
+/*********************************************************************************************************************************
+* Global Variables *
+*********************************************************************************************************************************/
/** The default ethernet broadcast address */
static uchar_t achBroadcastAddr[] = { 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF };
@@ -203,9 +205,9 @@ typedef struct vboxnetadp_state_t
} vboxnetadp_state_t;
-/*******************************************************************************
-* Internal Functions *
-*******************************************************************************/
+/*********************************************************************************************************************************
+* Internal Functions *
+*********************************************************************************************************************************/
static int vboxNetAdpSolarisGenerateMac(PRTMAC pMac);
static int vboxNetAdpSolarisSetMacAddress(gld_mac_info_t *pMacInfo, unsigned char *pszMacAddr);
static int vboxNetAdpSolarisSend(gld_mac_info_t *pMacInfo, mblk_t *pMsg);
@@ -258,9 +260,11 @@ int _fini(void)
/*
* Undo the work done during start (in reverse order).
*/
- RTR0Term();
+ int rc = mod_remove(&g_VBoxNetAdpSolarisModLinkage);
+ if (!rc)
+ RTR0Term();
- return mod_remove(&g_VBoxNetAdpSolarisModLinkage);
+ return rc;
}
diff --git a/src/VBox/HostDrivers/VBoxNetFlt/VBoxNetFlt.c b/src/VBox/HostDrivers/VBoxNetFlt/VBoxNetFlt.c
index bd760a9..ff943e7 100644
--- a/src/VBox/HostDrivers/VBoxNetFlt/VBoxNetFlt.c
+++ b/src/VBox/HostDrivers/VBoxNetFlt/VBoxNetFlt.c
@@ -244,9 +244,10 @@
*
*/
-/*******************************************************************************
-* Header Files *
-*******************************************************************************/
+
+/*********************************************************************************************************************************
+* Header Files *
+*********************************************************************************************************************************/
#define LOG_GROUP LOG_GROUP_NET_FLT_DRV
#include "VBoxNetFltInternal.h"
@@ -263,9 +264,9 @@
#include <iprt/thread.h>
-/*******************************************************************************
-* Defined Constants And Macros *
-*******************************************************************************/
+/*********************************************************************************************************************************
+* Defined Constants And Macros *
+*********************************************************************************************************************************/
#define IFPORT_2_VBOXNETFLTINS(pIfPort) \
( (PVBOXNETFLTINS)((uint8_t *)pIfPort - RT_OFFSETOF(VBOXNETFLTINS, MyPort)) )
diff --git a/src/VBox/HostDrivers/VBoxNetFlt/darwin/VBoxNetFlt-darwin.cpp b/src/VBox/HostDrivers/VBoxNetFlt/darwin/VBoxNetFlt-darwin.cpp
index f40a211..7097832 100644
--- a/src/VBox/HostDrivers/VBoxNetFlt/darwin/VBoxNetFlt-darwin.cpp
+++ b/src/VBox/HostDrivers/VBoxNetFlt/darwin/VBoxNetFlt-darwin.cpp
@@ -15,9 +15,10 @@
* hope that it will be useful, but WITHOUT ANY WARRANTY of any kind.
*/
-/*******************************************************************************
-* Header Files *
-*******************************************************************************/
+
+/*********************************************************************************************************************************
+* Header Files *
+*********************************************************************************************************************************/
#define LOG_GROUP LOG_GROUP_NET_FLT_DRV
#include "../../../Runtime/r0drv/darwin/the-darwin-kernel.h"
@@ -65,9 +66,9 @@ RT_C_DECLS_END
#include "../VBoxNetFltInternal.h"
-/*******************************************************************************
-* Defined Constants And Macros *
-*******************************************************************************/
+/*********************************************************************************************************************************
+* Defined Constants And Macros *
+*********************************************************************************************************************************/
/** The maximum number of SG segments.
* Used to prevent stack overflow and similar bad stuff. */
#define VBOXNETFLT_DARWIN_MAX_SEGS 32
@@ -83,9 +84,9 @@ RT_C_DECLS_END
-/*******************************************************************************
-* Internal Functions *
-*******************************************************************************/
+/*********************************************************************************************************************************
+* Internal Functions *
+*********************************************************************************************************************************/
RT_C_DECLS_BEGIN
static kern_return_t VBoxNetFltDarwinStart(struct kmod_info *pKModInfo, void *pvData);
static kern_return_t VBoxNetFltDarwinStop(struct kmod_info *pKModInfo, void *pvData);
@@ -94,9 +95,9 @@ static void vboxNetFltDarwinSysSockUpcall(socket_t pSysSock, void *pvData, int f
RT_C_DECLS_END
-/*******************************************************************************
-* Structures and Typedefs *
-*******************************************************************************/
+/*********************************************************************************************************************************
+* Structures and Typedefs *
+*********************************************************************************************************************************/
/**
* The mbuf tag data.
*
@@ -116,9 +117,9 @@ typedef VBOXNETFLTTAG *PVBOXNETFLTTAG;
typedef VBOXNETFLTTAG const *PCVBOXNETFLTTAG;
-/*******************************************************************************
-* Global Variables *
-*******************************************************************************/
+/*********************************************************************************************************************************
+* Global Variables *
+*********************************************************************************************************************************/
/**
* Declare the module stuff.
*/
diff --git a/src/VBox/HostDrivers/VBoxNetFlt/freebsd/VBoxNetFlt-freebsd.c b/src/VBox/HostDrivers/VBoxNetFlt/freebsd/VBoxNetFlt-freebsd.c
index d5b9912..3b46704 100644
--- a/src/VBox/HostDrivers/VBoxNetFlt/freebsd/VBoxNetFlt-freebsd.c
+++ b/src/VBox/HostDrivers/VBoxNetFlt/freebsd/VBoxNetFlt-freebsd.c
@@ -28,9 +28,10 @@
* OTHER DEALINGS IN THE SOFTWARE.
*/
-/*******************************************************************************
-* Header Files *
-*******************************************************************************/
+
+/*********************************************************************************************************************************
+* Header Files *
+*********************************************************************************************************************************/
#include <sys/param.h>
#undef PVM
#include <sys/types.h>
diff --git a/src/VBox/HostDrivers/VBoxNetFlt/linux/VBoxNetFlt-linux.c b/src/VBox/HostDrivers/VBoxNetFlt/linux/VBoxNetFlt-linux.c
index 1a796e7..d20f91e 100644
--- a/src/VBox/HostDrivers/VBoxNetFlt/linux/VBoxNetFlt-linux.c
+++ b/src/VBox/HostDrivers/VBoxNetFlt/linux/VBoxNetFlt-linux.c
@@ -15,9 +15,10 @@
* hope that it will be useful, but WITHOUT ANY WARRANTY of any kind.
*/
-/*******************************************************************************
-* Header Files *
-*******************************************************************************/
+
+/*********************************************************************************************************************************
+* Header Files *
+*********************************************************************************************************************************/
#define LOG_GROUP LOG_GROUP_NET_FLT_DRV
#define VBOXNETFLT_LINUX_NO_XMIT_QUEUE
#include "the-linux-kernel.h"
@@ -72,9 +73,9 @@ typedef struct VBOXNETFLTNOTIFIER *PVBOXNETFLTNOTIFIER;
#endif
-/*******************************************************************************
-* Defined Constants And Macros *
-*******************************************************************************/
+/*********************************************************************************************************************************
+* Defined Constants And Macros *
+*********************************************************************************************************************************/
#define VBOX_FLT_NB_TO_INST(pNB) RT_FROM_MEMBER(pNB, VBOXNETFLTINS, u.s.Notifier)
#define VBOX_FLT_PT_TO_INST(pPT) RT_FROM_MEMBER(pPT, VBOXNETFLTINS, u.s.PacketType)
#ifndef VBOXNETFLT_LINUX_NO_XMIT_QUEUE
@@ -170,17 +171,18 @@ typedef struct VBOXNETFLTNOTIFIER *PVBOXNETFLTNOTIFIER;
# endif
#endif
-/*******************************************************************************
-* Internal Functions *
-*******************************************************************************/
+
+/*********************************************************************************************************************************
+* Internal Functions *
+*********************************************************************************************************************************/
static int VBoxNetFltLinuxInit(void);
static void VBoxNetFltLinuxUnload(void);
static void vboxNetFltLinuxForwardToIntNet(PVBOXNETFLTINS pThis, struct sk_buff *pBuf);
-/*******************************************************************************
-* Global Variables *
-*******************************************************************************/
+/*********************************************************************************************************************************
+* Global Variables *
+*********************************************************************************************************************************/
/**
* The (common) global data.
*/
@@ -2289,8 +2291,8 @@ void vboxNetFltOsDeleteInstance(PVBOXNETFLTINS pThis)
int vboxNetFltOsInitInstance(PVBOXNETFLTINS pThis, void *pvContext)
{
int err;
- NOREF(pvContext);
IPRT_LINUX_SAVE_EFL_AC();
+ NOREF(pvContext);
pThis->u.s.Notifier.notifier_call = vboxNetFltLinuxNotifierCallback;
err = register_netdevice_notifier(&pThis->u.s.Notifier);
diff --git a/src/VBox/HostDrivers/VBoxNetFlt/solaris/VBoxNetFlt-solaris.c b/src/VBox/HostDrivers/VBoxNetFlt/solaris/VBoxNetFlt-solaris.c
index d92c040..8db5212 100644
--- a/src/VBox/HostDrivers/VBoxNetFlt/solaris/VBoxNetFlt-solaris.c
+++ b/src/VBox/HostDrivers/VBoxNetFlt/solaris/VBoxNetFlt-solaris.c
@@ -24,9 +24,10 @@
* terms and conditions of either the GPL or the CDDL or both.
*/
-/*******************************************************************************
-* Header Files *
-*******************************************************************************/
+
+/*********************************************************************************************************************************
+* Header Files *
+*********************************************************************************************************************************/
#define LOG_GROUP LOG_GROUP_NET_FLT_DRV
#include <VBox/log.h>
#include <VBox/err.h>
@@ -84,9 +85,10 @@
#define VBOXNETFLT_OS_SPECFIC 1
#include "../VBoxNetFltInternal.h"
-/*******************************************************************************
-* Defined Constants And Macros *
-*******************************************************************************/
+
+/*********************************************************************************************************************************
+* Defined Constants And Macros *
+*********************************************************************************************************************************/
/** The module name. */
#define DEVICE_NAME "vboxflt"
/** The module descriptions as seen in 'modinfo'. */
@@ -114,9 +116,10 @@ typedef struct VLANHEADER
} VLANHEADER;
typedef struct VLANHEADER *PVLANHEADER;
-/*******************************************************************************
-* Global Functions *
-*******************************************************************************/
+
+/*********************************************************************************************************************************
+* Global Functions *
+*********************************************************************************************************************************/
/**
* Stream Driver hooks.
*/
@@ -134,9 +137,9 @@ static int VBoxNetFltSolarisModReadPut(queue_t *pQueue, mblk_t *pMsg);
static int VBoxNetFltSolarisModWritePut(queue_t *pQueue, mblk_t *pMsg);
-/*******************************************************************************
-* Structures and Typedefs *
-*******************************************************************************/
+/*********************************************************************************************************************************
+* Structures and Typedefs *
+*********************************************************************************************************************************/
/**
* Streams: module info.
*/
@@ -349,9 +352,9 @@ typedef struct vboxnetflt_promisc_params_t
} vboxnetflt_promisc_params_t;
-/*******************************************************************************
-* Internal Functions *
-*******************************************************************************/
+/*********************************************************************************************************************************
+* Internal Functions *
+*********************************************************************************************************************************/
static int vboxNetFltSolarisSetRawMode(vboxnetflt_promisc_stream_t *pPromiscStream);
/* static int vboxNetFltSolarisSetFastMode(queue_t *pQueue); */
@@ -375,9 +378,9 @@ static int vboxNetFltSolarisRecv(PVBOXNETFLTINS pThis, vboxnetflt_stream_t *pStr
/* static void vboxNetFltSolarisAnalyzeMBlk(mblk_t *pMsg); */
-/*******************************************************************************
-* Global Variables *
-*******************************************************************************/
+/*********************************************************************************************************************************
+* Global Variables *
+*********************************************************************************************************************************/
/** Global device info handle. */
static dev_info_t *g_pVBoxNetFltSolarisDip = NULL;
diff --git a/src/VBox/HostDrivers/VBoxNetFlt/solaris/VBoxNetFltBow-solaris.c b/src/VBox/HostDrivers/VBoxNetFlt/solaris/VBoxNetFltBow-solaris.c
index a081ec8..7b8ed3c 100644
--- a/src/VBox/HostDrivers/VBoxNetFlt/solaris/VBoxNetFltBow-solaris.c
+++ b/src/VBox/HostDrivers/VBoxNetFlt/solaris/VBoxNetFltBow-solaris.c
@@ -24,9 +24,10 @@
* terms and conditions of either the GPL or the CDDL or both.
*/
-/*******************************************************************************
-* Header Files *
-*******************************************************************************/
+
+/*********************************************************************************************************************************
+* Header Files *
+*********************************************************************************************************************************/
#define LOG_GROUP LOG_GROUP_NET_FLT_DRV
#include <VBox/log.h>
#include <VBox/err.h>
@@ -66,9 +67,10 @@
#define VBOXNETFLT_OS_SPECFIC 1
#include "../VBoxNetFltInternal.h"
-/*******************************************************************************
-* Defined Constants And Macros *
-*******************************************************************************/
+
+/*********************************************************************************************************************************
+* Defined Constants And Macros *
+*********************************************************************************************************************************/
/** The module name. */
#define DEVICE_NAME "vboxbow"
/** The module descriptions as seen in 'modinfo'. */
@@ -113,17 +115,17 @@ extern void mac_client_get_resources(mac_client_handle_t hClient, mac_resour
extern int mac_client_set_resources(mac_client_handle_t hClient, mac_resource_props_t *pResources);
-/*******************************************************************************
-* Kernel Entry Hooks *
-*******************************************************************************/
+/*********************************************************************************************************************************
+* Kernel Entry Hooks *
+*********************************************************************************************************************************/
LOCAL int VBoxNetFltSolarisAttach(dev_info_t *pDip, ddi_attach_cmd_t enmCmd);
LOCAL int VBoxNetFltSolarisDetach(dev_info_t *pDip, ddi_detach_cmd_t enmCmd);
LOCAL int VBoxNetFltSolarisGetInfo(dev_info_t *pDip, ddi_info_cmd_t enmCmd, void *pArg, void **ppResult);
-/*******************************************************************************
-* Structures and Typedefs *
-*******************************************************************************/
+/*********************************************************************************************************************************
+* Structures and Typedefs *
+*********************************************************************************************************************************/
/**
* cb_ops: for drivers that support char/block entry points
*/
@@ -235,9 +237,9 @@ typedef struct VBOXNETFLTVNIC
typedef struct VBOXNETFLTVNIC *PVBOXNETFLTVNIC;
-/*******************************************************************************
-* Global Variables *
-*******************************************************************************/
+/*********************************************************************************************************************************
+* Global Variables *
+*********************************************************************************************************************************/
/** Global Device handle we only support one instance. */
static dev_info_t *g_pVBoxNetFltSolarisDip = NULL;
/** The (common) global data. */
@@ -246,9 +248,9 @@ static VBOXNETFLTGLOBALS g_VBoxNetFltSolarisGlobals;
static volatile uint64_t g_VBoxNetFltSolarisVNICId;
-/*******************************************************************************
-* Internal Functions *
-*******************************************************************************/
+/*********************************************************************************************************************************
+* Internal Functions *
+*********************************************************************************************************************************/
LOCAL mblk_t *vboxNetFltSolarisMBlkFromSG(PVBOXNETFLTINS pThis, PINTNETSG pSG, uint32_t fDst);
LOCAL unsigned vboxNetFltSolarisMBlkCalcSGSegs(PVBOXNETFLTINS pThis, mblk_t *pMsg);
LOCAL int vboxNetFltSolarisMBlkToSG(PVBOXNETFLTINS pThis, mblk_t *pMsg, PINTNETSG pSG, unsigned cSegs, uint32_t fSrc);
diff --git a/src/VBox/HostDrivers/VBoxNetFlt/win/cfg/VBoxNetCfg.cpp b/src/VBox/HostDrivers/VBoxNetFlt/win/cfg/VBoxNetCfg.cpp
index 4a2f7b4..542d508 100644
--- a/src/VBox/HostDrivers/VBoxNetFlt/win/cfg/VBoxNetCfg.cpp
+++ b/src/VBox/HostDrivers/VBoxNetFlt/win/cfg/VBoxNetCfg.cpp
@@ -56,6 +56,21 @@ static VOID DoLogging(LPCSTR szString, ...);
#define VBOX_NETCFG_LOCK_TIME_OUT 5000 /** @todo r=bird: What does this do? */
+/*
+ * For some weird reason we do not want to use IPRT here, hence the following
+ * function provides a replacement for BstrFmt.
+ */
+static bstr_t bstr_printf(const char *cszFmt, ...)
+{
+ char szBuffer[4096];
+ szBuffer[sizeof(szBuffer) - 1] = 0; /* Make sure the string will be null-terminated */
+ va_list va;
+ va_start(va, cszFmt);
+ _vsnprintf(szBuffer, sizeof(szBuffer) - 1, cszFmt, va);
+ va_end(va);
+ return bstr_t(szBuffer);
+}
+
static HRESULT vboxNetCfgWinINetCfgLock(IN INetCfg *pNetCfg,
IN LPCWSTR pszwClientDescription,
IN DWORD cmsTimeout,
@@ -2462,12 +2477,14 @@ VBOXNETCFGWIN_DECL(HRESULT) VBoxNetCfgWinRenameConnection (LPWSTR pGuid, PCWSTR
if (1) { \
hrc = E_FAIL; \
NonStandardLog strAndArgs; \
+ bstrError = bstr_printf strAndArgs; \
break; \
} else do {} while (0)
VBOXNETCFGWIN_DECL(HRESULT) VBoxNetCfgWinRemoveHostOnlyNetworkInterface(IN const GUID *pGUID, OUT BSTR *pErrMsg)
{
HRESULT hrc = S_OK;
+ bstr_t bstrError;
do
{
@@ -2667,6 +2684,9 @@ VBOXNETCFGWIN_DECL(HRESULT) VBoxNetCfgWinRemoveHostOnlyNetworkInterface(IN const
}
while (0);
+ if (pErrMsg && bstrError.length())
+ *pErrMsg = bstrError.Detach();
+
return hrc;
}
@@ -2689,6 +2709,8 @@ VBOXNETCFGWIN_DECL(HRESULT) VBoxNetCfgWinCreateHostOnlyNetworkInterface(IN LPCWS
BOOL destroyList = FALSE;
WCHAR pWCfgGuidString [50];
WCHAR DevName[256];
+ HKEY hkey = (HKEY)INVALID_HANDLE_VALUE;
+ bstr_t bstrError;
do
{
@@ -2703,7 +2725,6 @@ VBOXNETCFGWIN_DECL(HRESULT) VBoxNetCfgWinCreateHostOnlyNetworkInterface(IN LPCWS
* of the VBoxNetAdp driver. */
DWORD detailBuf [2048];
- HKEY hkey = NULL;
DWORD cbSize;
DWORD dwValueType;
@@ -2989,6 +3010,9 @@ VBOXNETCFGWIN_DECL(HRESULT) VBoxNetCfgWinCreateHostOnlyNetworkInterface(IN LPCWS
break;
}
+ if (ret != ERROR_SUCCESS)
+ SetErrBreak(("Querying NetCfgInstanceId failed (0x%08X)", GetLastError()));
+
/*
* We need to query the device name after we have succeeded in querying its
* instance ID to avoid similar waiting-and-retrying loop (see @bugref{7973}).
@@ -3020,16 +3044,15 @@ VBOXNETCFGWIN_DECL(HRESULT) VBoxNetCfgWinCreateHostOnlyNetworkInterface(IN LPCWS
err));
}
}
- RegCloseKey (hkey);
-
- if (ret != ERROR_SUCCESS)
- SetErrBreak(("Querying NetCfgInstanceId failed (0x%08X)", GetLastError()));
}
while (0);
/*
* cleanup
*/
+ if (hkey != INVALID_HANDLE_VALUE)
+ RegCloseKey (hkey);
+
if (pQueueCallbackContext)
SetupTermDefaultQueueCallback(pQueueCallbackContext);
@@ -3117,6 +3140,10 @@ VBOXNETCFGWIN_DECL(HRESULT) VBoxNetCfgWinCreateHostOnlyNetworkInterface(IN LPCWS
else
NonStandardLogFlow(("VBoxNetCfgWinQueryINetCfg failed, hr 0x%x\n", hr));
}
+
+ if (pErrMsg && bstrError.length())
+ *pErrMsg = bstrError.Detach();
+
return hrc;
}
diff --git a/src/VBox/HostDrivers/VBoxNetFlt/win/drv/VBoxNetLwf-win.cpp b/src/VBox/HostDrivers/VBoxNetFlt/win/drv/VBoxNetLwf-win.cpp
index 8226323..fb63e82 100644
--- a/src/VBox/HostDrivers/VBoxNetFlt/win/drv/VBoxNetLwf-win.cpp
+++ b/src/VBox/HostDrivers/VBoxNetFlt/win/drv/VBoxNetLwf-win.cpp
@@ -16,7 +16,6 @@
#define LOG_GROUP LOG_GROUP_NET_FLT_DRV
//#define VBOXNETLWF_SYNC_SEND
-#define VBOXNETLWF_NO_BYPASS
#include <VBox/version.h>
#include <VBox/err.h>
@@ -99,7 +98,6 @@ FILTER_OID_REQUEST vboxNetLwfWinOidRequest;
FILTER_OID_REQUEST_COMPLETE vboxNetLwfWinOidRequestComplete;
//FILTER_CANCEL_OID_REQUEST vboxNetLwfWinCancelOidRequest;
FILTER_STATUS vboxNetLwfWinStatus;
-FILTER_SET_MODULE_OPTIONS vboxNetLwfWinSetModuleOptions;
//FILTER_NET_PNP_EVENT vboxNetLwfWinPnPEvent;
FILTER_SEND_NET_BUFFER_LISTS vboxNetLwfWinSendNetBufferLists;
FILTER_SEND_NET_BUFFER_LISTS_COMPLETE vboxNetLwfWinSendNetBufferListsComplete;
@@ -1426,7 +1424,7 @@ VOID vboxNetLwfWinSendNetBufferLists(IN NDIS_HANDLE hModuleCtx, IN PNET_BUFFER_L
size_t cb = 0;
LogFlow(("==>vboxNetLwfWinSendNetBufferLists: module=%p\n", hModuleCtx));
PVBOXNETLWF_MODULE pModule = (PVBOXNETLWF_MODULE)hModuleCtx;
-#ifdef VBOXNETLWF_NO_BYPASS
+
if (!ASMAtomicReadBool(&pModule->fActive))
{
/*
@@ -1436,7 +1434,7 @@ VOID vboxNetLwfWinSendNetBufferLists(IN NDIS_HANDLE hModuleCtx, IN PNET_BUFFER_L
NdisFSendNetBufferLists(pModule->hFilter, pBufLists, nPort, fFlags);
return;
}
-#endif
+
if (vboxNetLwfWinIsRunning(pModule))
{
PNET_BUFFER_LIST pNext = NULL;
@@ -1561,7 +1559,7 @@ VOID vboxNetLwfWinReceiveNetBufferLists(IN NDIS_HANDLE hModuleCtx,
/// @todo Do we need loopback handling?
LogFlow(("==>vboxNetLwfWinReceiveNetBufferLists: module=%p\n", hModuleCtx));
PVBOXNETLWF_MODULE pModule = (PVBOXNETLWF_MODULE)hModuleCtx;
-#ifdef VBOXNETLWF_NO_BYPASS
+
if (!ASMAtomicReadBool(&pModule->fActive))
{
/*
@@ -1572,7 +1570,7 @@ VOID vboxNetLwfWinReceiveNetBufferLists(IN NDIS_HANDLE hModuleCtx,
LogFlow(("<==vboxNetLwfWinReceiveNetBufferLists: inactive trunk\n"));
return;
}
-#endif
+
if (vboxNetLwfWinIsRunning(pModule))
{
if (NDIS_TEST_RECEIVE_CANNOT_PEND(fFlags))
@@ -1718,40 +1716,6 @@ VOID vboxNetLwfWinReturnNetBufferLists(IN NDIS_HANDLE hModuleCtx, IN PNET_BUFFER
LogFlow(("<==vboxNetLwfWinReturnNetBufferLists\n"));
}
-NDIS_STATUS vboxNetLwfWinSetModuleOptions(IN NDIS_HANDLE hModuleCtx)
-{
- LogFlow(("==>vboxNetLwfWinSetModuleOptions: module=%p\n", hModuleCtx));
- PVBOXNETLWF_MODULE pModuleCtx = (PVBOXNETLWF_MODULE)hModuleCtx;
- NDIS_FILTER_PARTIAL_CHARACTERISTICS PChars;
-
- NdisZeroMemory(&PChars, sizeof(PChars));
-
- PChars.Header.Type = NDIS_OBJECT_TYPE_FILTER_PARTIAL_CHARACTERISTICS;
- PChars.Header.Size = NDIS_SIZEOF_FILTER_PARTIAL_CHARACTERISTICS_REVISION_1;
- PChars.Header.Revision = NDIS_FILTER_PARTIAL_CHARACTERISTICS_REVISION_1;
-
-#ifndef VBOXNETLWF_NO_BYPASS
- if (ASMAtomicReadBool(&pModuleCtx->fActive))
-#endif
- {
- Log(("vboxNetLwfWinSetModuleOptions: active mode\n"));
- PChars.SendNetBufferListsHandler = vboxNetLwfWinSendNetBufferLists;
- PChars.SendNetBufferListsCompleteHandler = vboxNetLwfWinSendNetBufferListsComplete;
- PChars.ReceiveNetBufferListsHandler = vboxNetLwfWinReceiveNetBufferLists;
- PChars.ReturnNetBufferListsHandler = vboxNetLwfWinReturnNetBufferLists;
- }
-#ifndef VBOXNETLWF_NO_BYPASS
- else
- {
- Log(("vboxNetLwfWinSetModuleOptions: bypass mode\n"));
- }
-#endif
- NDIS_STATUS Status = NdisSetOptionalHandlers(pModuleCtx->hFilter,
- (PNDIS_DRIVER_OPTIONAL_HANDLERS)&PChars);
- LogFlow(("<==vboxNetLwfWinSetModuleOptions: status=0x%x\n", Status));
- return Status;
-}
-
/**
* register the filter driver
*/
@@ -1791,9 +1755,8 @@ DECLHIDDEN(NDIS_STATUS) vboxNetLwfWinRegister(PDRIVER_OBJECT pDriverObject, PUNI
//FChars.CancelOidRequestHandler = vboxNetLwfWinCancelOidRequest;
FChars.StatusHandler = vboxNetLwfWinStatus;
//FChars.NetPnPEventHandler = vboxNetLwfWinPnPEvent;
- FChars.SetFilterModuleOptionsHandler = vboxNetLwfWinSetModuleOptions;
- /* Optional functions */
+ /* Datapath functions */
FChars.SendNetBufferListsHandler = vboxNetLwfWinSendNetBufferLists;
FChars.SendNetBufferListsCompleteHandler = vboxNetLwfWinSendNetBufferListsComplete;
FChars.ReceiveNetBufferListsHandler = vboxNetLwfWinReceiveNetBufferLists;
@@ -2162,9 +2125,6 @@ void vboxNetFltPortOsSetActive(PVBOXNETFLTINS pThis, bool fActive)
bool fOldActive = ASMAtomicXchgBool(&pModuleCtx->fActive, fActive);
if (fOldActive != fActive)
{
- /// @todo Shouldn't we wait for traffic to cease here? Probably not.
- /* Schedule restart to enable/disable bypass mode */
- NdisFRestartFilter(pModuleCtx->hFilter);
Status = vboxNetLwfWinSetPacketFilter(pModuleCtx, fActive);
LogFlow(("<==vboxNetFltPortOsSetActive: vboxNetLwfWinSetPacketFilter() returned 0x%x\n", Status));
}
diff --git a/src/VBox/HostDrivers/VBoxPci/linux/VBoxPci-linux.c b/src/VBox/HostDrivers/VBoxPci/linux/VBoxPci-linux.c
index 0a064bb..96e82d8 100644
--- a/src/VBox/HostDrivers/VBoxPci/linux/VBoxPci-linux.c
+++ b/src/VBox/HostDrivers/VBoxPci/linux/VBoxPci-linux.c
@@ -15,9 +15,10 @@
* hope that it will be useful, but WITHOUT ANY WARRANTY of any kind.
*/
-/*******************************************************************************
- * Header Files *
- *******************************************************************************/
+
+/*********************************************************************************************************************************
+* Header Files *
+*********************************************************************************************************************************/
#include "the-linux-kernel.h"
#include "version-generated.h"
#include "product-generated.h"
@@ -52,15 +53,16 @@
#endif /* VBOX_WITH_IOMMU */
-/*******************************************************************************
- * Internal Functions *
- *******************************************************************************/
+/*********************************************************************************************************************************
+* Internal Functions *
+*********************************************************************************************************************************/
static int VBoxPciLinuxInit(void);
static void VBoxPciLinuxUnload(void);
-/*******************************************************************************
- * Global Variables *
- *******************************************************************************/
+
+/*********************************************************************************************************************************
+* Global Variables *
+*********************************************************************************************************************************/
static VBOXRAWPCIGLOBALS g_VBoxPciGlobals;
module_init(VBoxPciLinuxInit);
@@ -147,7 +149,9 @@ static int __init VBoxPciLinuxInit(void)
{
# if LINUX_VERSION_CODE >= KERNEL_VERSION(2, 6, 30)
/* find_module() is static before Linux 2.6.30 */
+ mutex_lock(&module_mutex);
g_VBoxPciGlobals.pciStubModule = find_module(PCI_STUB_MODULE_NAME);
+ mutex_unlock(&module_mutex);
if (g_VBoxPciGlobals.pciStubModule)
{
if (try_module_get(g_VBoxPciGlobals.pciStubModule))
diff --git a/src/VBox/HostDrivers/VBoxUSB/USBFilter.cpp b/src/VBox/HostDrivers/VBoxUSB/USBFilter.cpp
index a4bd9e3..86eb0ae 100644
--- a/src/VBox/HostDrivers/VBoxUSB/USBFilter.cpp
+++ b/src/VBox/HostDrivers/VBoxUSB/USBFilter.cpp
@@ -16,9 +16,9 @@
*/
-/*******************************************************************************
-* Header Files *
-*******************************************************************************/
+/*********************************************************************************************************************************
+* Header Files *
+*********************************************************************************************************************************/
#include <VBox/usbfilter.h>
#include <VBox/err.h>
#include <VBox/log.h>
diff --git a/src/VBox/HostDrivers/VBoxUSB/USBLib.cpp b/src/VBox/HostDrivers/VBoxUSB/USBLib.cpp
index 56fa7d4..e6a6bc5 100644
--- a/src/VBox/HostDrivers/VBoxUSB/USBLib.cpp
+++ b/src/VBox/HostDrivers/VBoxUSB/USBLib.cpp
@@ -16,9 +16,9 @@
*/
-/*******************************************************************************
-* Header Files *
-*******************************************************************************/
+/*********************************************************************************************************************************
+* Header Files *
+*********************************************************************************************************************************/
#include <VBox/usblib.h>
diff --git a/src/VBox/HostDrivers/VBoxUSB/VBoxUSBFilterMgr.cpp b/src/VBox/HostDrivers/VBoxUSB/VBoxUSBFilterMgr.cpp
index 7aced78..d124883 100644
--- a/src/VBox/HostDrivers/VBoxUSB/VBoxUSBFilterMgr.cpp
+++ b/src/VBox/HostDrivers/VBoxUSB/VBoxUSBFilterMgr.cpp
@@ -15,9 +15,10 @@
* hope that it will be useful, but WITHOUT ANY WARRANTY of any kind.
*/
-/*******************************************************************************
-* Header Files *
-*******************************************************************************/
+
+/*********************************************************************************************************************************
+* Header Files *
+*********************************************************************************************************************************/
#include <VBox/usbfilter.h>
#include "VBoxUSBFilterMgr.h"
@@ -30,9 +31,9 @@
#include <iprt/string.h>
-/*******************************************************************************
-* Defined Constants And Macros *
-*******************************************************************************/
+/*********************************************************************************************************************************
+* Defined Constants And Macros *
+*********************************************************************************************************************************/
/** @def VBOXUSBFILTERMGR_LOCK
* Locks the filter list. Careful with scoping since this may
@@ -61,9 +62,9 @@
#endif
-/*******************************************************************************
-* Structures and Typedefs *
-*******************************************************************************/
+/*********************************************************************************************************************************
+* Structures and Typedefs *
+*********************************************************************************************************************************/
/** Pointer to an VBoxUSB filter. */
typedef struct VBOXUSBFILTER *PVBOXUSBFILTER;
/** Pointer to PVBOXUSBFILTER. */
@@ -98,9 +99,9 @@ typedef struct VBOXUSBFILTERLIST
typedef VBOXUSBFILTERLIST *PVBOXUSBFILTERLIST;
-/*******************************************************************************
-* Global Variables *
-*******************************************************************************/
+/*********************************************************************************************************************************
+* Global Variables *
+*********************************************************************************************************************************/
#ifdef VBOXUSBFILTERMGR_USB_SPINLOCK
/** Spinlock protecting the filter lists. */
static RTSPINLOCK g_Spinlock = NIL_RTSPINLOCK;
diff --git a/src/VBox/HostDrivers/VBoxUSB/darwin/USBLib-darwin.cpp b/src/VBox/HostDrivers/VBoxUSB/darwin/USBLib-darwin.cpp
index 59b4b0e..f42d2fe 100644
--- a/src/VBox/HostDrivers/VBoxUSB/darwin/USBLib-darwin.cpp
+++ b/src/VBox/HostDrivers/VBoxUSB/darwin/USBLib-darwin.cpp
@@ -16,9 +16,9 @@
*/
-/*******************************************************************************
-* Header Files *
-*******************************************************************************/
+/*********************************************************************************************************************************
+* Header Files *
+*********************************************************************************************************************************/
#include <VBox/usblib.h>
#include <VBox/err.h>
#include <VBox/log.h>
@@ -30,16 +30,17 @@
#include <mach/mach_port.h>
#include <IOKit/IOKitLib.h>
-/*******************************************************************************
-* Defined Constants And Macros *
-*******************************************************************************/
+
+/*********************************************************************************************************************************
+* Defined Constants And Macros *
+*********************************************************************************************************************************/
/** The IOClass key of the service (see VBoxUSB.cpp / Info.plist). */
#define IOCLASS_NAME "org_virtualbox_VBoxUSB"
-/*******************************************************************************
-* Global Variables *
-*******************************************************************************/
+/*********************************************************************************************************************************
+* Global Variables *
+*********************************************************************************************************************************/
/** Reference counter. */
static uint32_t volatile g_cUsers = 0;
/** The IOMasterPort. */
diff --git a/src/VBox/HostDrivers/VBoxUSB/darwin/VBoxUSB.cpp b/src/VBox/HostDrivers/VBoxUSB/darwin/VBoxUSB.cpp
index 112130a..878fba4 100644
--- a/src/VBox/HostDrivers/VBoxUSB/darwin/VBoxUSB.cpp
+++ b/src/VBox/HostDrivers/VBoxUSB/darwin/VBoxUSB.cpp
@@ -20,9 +20,9 @@
*/
-/*******************************************************************************
-* Header Files *
-*******************************************************************************/
+/*********************************************************************************************************************************
+* Header Files *
+*********************************************************************************************************************************/
#define LOG_GROUP LOG_GROUP_USB_DRV
/* Deal with conflicts first.
* (This is mess inherited from BSD. The *BSDs has clean this up long ago.) */
@@ -66,27 +66,27 @@ extern void *get_bsdtask_info(task_t);
RT_C_DECLS_END
-/*******************************************************************************
-* Defined Constants And Macros *
-*******************************************************************************/
+/*********************************************************************************************************************************
+* Defined Constants And Macros *
+*********************************************************************************************************************************/
/** Locks the lists. */
#define VBOXUSB_LOCK() do { int rc = RTSemFastMutexRequest(g_Mtx); AssertRC(rc); } while (0)
/** Unlocks the lists. */
#define VBOXUSB_UNLOCK() do { int rc = RTSemFastMutexRelease(g_Mtx); AssertRC(rc); } while (0)
-/*******************************************************************************
-* Internal Functions *
-*******************************************************************************/
+/*********************************************************************************************************************************
+* Internal Functions *
+*********************************************************************************************************************************/
RT_C_DECLS_BEGIN
static kern_return_t VBoxUSBStart(struct kmod_info *pKModInfo, void *pvData);
static kern_return_t VBoxUSBStop(struct kmod_info *pKModInfo, void *pvData);
RT_C_DECLS_END
-/*******************************************************************************
-* Structures and Typedefs *
-*******************************************************************************/
+/*********************************************************************************************************************************
+* Structures and Typedefs *
+*********************************************************************************************************************************/
/**
* The service class.
*
@@ -265,9 +265,9 @@ OSDefineMetaClassAndStructors(org_virtualbox_VBoxUSBInterface, IOUSBUserClientIn
-/*******************************************************************************
-* Global Variables *
-*******************************************************************************/
+/*********************************************************************************************************************************
+* Global Variables *
+*********************************************************************************************************************************/
/*
* Declare the module stuff.
*/
diff --git a/src/VBox/HostDrivers/VBoxUSB/darwin/testcase/tstOpenUSBDev.cpp b/src/VBox/HostDrivers/VBoxUSB/darwin/testcase/tstOpenUSBDev.cpp
index 03e1844..3ee74de 100644
--- a/src/VBox/HostDrivers/VBoxUSB/darwin/testcase/tstOpenUSBDev.cpp
+++ b/src/VBox/HostDrivers/VBoxUSB/darwin/testcase/tstOpenUSBDev.cpp
@@ -16,9 +16,9 @@
*/
-/*******************************************************************************
-* Header Files *
-*******************************************************************************/
+/*********************************************************************************************************************************
+* Header Files *
+*********************************************************************************************************************************/
#include <mach/mach.h>
#include <Carbon/Carbon.h>
#include <IOKit/IOKitLib.h>
@@ -206,7 +206,7 @@ int main(int argc, char **argv)
case 'h':
return tstSyntax(argv[0]);
case 'V':
- RTPrintf("$Revision: 100877 $\n");
+ RTPrintf("$Revision: 102121 $\n");
return 0;
default:
diff --git a/src/VBox/HostDrivers/VBoxUSB/solaris/USBLib-solaris.cpp b/src/VBox/HostDrivers/VBoxUSB/solaris/USBLib-solaris.cpp
index 72185cd..a3ce960 100644
--- a/src/VBox/HostDrivers/VBoxUSB/solaris/USBLib-solaris.cpp
+++ b/src/VBox/HostDrivers/VBoxUSB/solaris/USBLib-solaris.cpp
@@ -16,9 +16,9 @@
*/
-/*******************************************************************************
-* Header Files *
-*******************************************************************************/
+/*********************************************************************************************************************************
+* Header Files *
+*********************************************************************************************************************************/
#include <VBox/usblib.h>
#include <VBox/err.h>
#include <VBox/log.h>
@@ -40,25 +40,25 @@
# include <strings.h>
-/*******************************************************************************
-* Defined Constants And Macros *
-*******************************************************************************/
+/*********************************************************************************************************************************
+* Defined Constants And Macros *
+*********************************************************************************************************************************/
/** Logging class. */
#define USBLIBR3 "USBLibR3"
-/*******************************************************************************
-* Global Variables *
-*******************************************************************************/
+/*********************************************************************************************************************************
+* Global Variables *
+*********************************************************************************************************************************/
/** Reference counter. */
static uint32_t volatile g_cUsers = 0;
/** VBoxUSB Device handle. */
static RTFILE g_hFile = NIL_RTFILE;
-/*******************************************************************************
-* Internal Functions *
-*******************************************************************************/
+/*********************************************************************************************************************************
+* Internal Functions *
+*********************************************************************************************************************************/
static int usblibDoIOCtl(unsigned iFunction, void *pvData, size_t cbData);
diff --git a/src/VBox/HostDrivers/VBoxUSB/solaris/VBoxUSB-solaris.c b/src/VBox/HostDrivers/VBoxUSB/solaris/VBoxUSB-solaris.c
index 999a0ac..a432c68 100644
--- a/src/VBox/HostDrivers/VBoxUSB/solaris/VBoxUSB-solaris.c
+++ b/src/VBox/HostDrivers/VBoxUSB/solaris/VBoxUSB-solaris.c
@@ -24,9 +24,10 @@
* terms and conditions of either the GPL or the CDDL or both.
*/
-/*******************************************************************************
-* Header Files *
-*******************************************************************************/
+
+/*********************************************************************************************************************************
+* Header Files *
+*********************************************************************************************************************************/
#define LOG_GROUP LOG_GROUP_USB_DRV
#include <VBox/version.h>
#include <VBox/log.h>
@@ -55,9 +56,10 @@
/** @todo review the locking here, verify assumptions about code executed
* without the vboxusb_state_t::Mtx mutex */
-/*******************************************************************************
-* Defined Constants And Macros *
-*******************************************************************************/
+
+/*********************************************************************************************************************************
+* Defined Constants And Macros *
+*********************************************************************************************************************************/
/** The module name. */
#define DEVICE_NAME "vboxusb"
/** The module description as seen in 'modinfo'. */
@@ -111,9 +113,9 @@
#endif
-/*******************************************************************************
-* Kernel Entry Hooks *
-*******************************************************************************/
+/*********************************************************************************************************************************
+* Kernel Entry Hooks *
+*********************************************************************************************************************************/
int VBoxUSBSolarisOpen(dev_t *pDev, int fFlag, int fType, cred_t *pCred);
int VBoxUSBSolarisClose(dev_t Dev, int fFlag, int fType, cred_t *pCred);
int VBoxUSBSolarisRead(dev_t Dev, struct uio *pUio, cred_t *pCred);
@@ -126,9 +128,9 @@ int VBoxUSBSolarisDetach(dev_info_t *pDip, ddi_detach_cmd_t enmCmd);
int VBoxUSBSolarisPower(dev_info_t *pDip, int Component, int Level);
-/*******************************************************************************
-* Structures and Typedefs *
-*******************************************************************************/
+/*********************************************************************************************************************************
+* Structures and Typedefs *
+*********************************************************************************************************************************/
/**
* cb_ops: for drivers that support char/block entry points
*/
@@ -294,9 +296,9 @@ typedef struct vboxusb_state_t
} vboxusb_state_t;
-/*******************************************************************************
-* Internal Functions *
-*******************************************************************************/
+/*********************************************************************************************************************************
+* Internal Functions *
+*********************************************************************************************************************************/
LOCAL int vboxUSBSolarisInitEndPoint(vboxusb_state_t *pState, usb_ep_data_t *pEpData, uchar_t uCfgValue,
uchar_t uInterface, uchar_t uAlt);
LOCAL int vboxUSBSolarisInitAllEndPoints(vboxusb_state_t *pState);
@@ -359,9 +361,9 @@ int VBoxUSBMonSolarisUnregisterClient(dev_info_t *pClientDip);
LOCAL int vboxUSBSolarisSetConsumerCredentials(RTPROCESS Process, int Instance, void *pvReserved);
-/*******************************************************************************
-* Global Variables *
-*******************************************************************************/
+/*********************************************************************************************************************************
+* Global Variables *
+*********************************************************************************************************************************/
/** Global list of all device instances. */
static void *g_pVBoxUSBSolarisState;
diff --git a/src/VBox/HostDrivers/VBoxUSB/solaris/VBoxUSBMon-solaris.c b/src/VBox/HostDrivers/VBoxUSB/solaris/VBoxUSBMon-solaris.c
index 34259ff..c0d9c9e 100644
--- a/src/VBox/HostDrivers/VBoxUSB/solaris/VBoxUSBMon-solaris.c
+++ b/src/VBox/HostDrivers/VBoxUSB/solaris/VBoxUSBMon-solaris.c
@@ -24,9 +24,10 @@
* terms and conditions of either the GPL or the CDDL or both.
*/
-/*******************************************************************************
-* Header Files *
-*******************************************************************************/
+
+/*********************************************************************************************************************************
+* Header Files *
+*********************************************************************************************************************************/
#define LOG_GROUP LOG_GROUP_USB_DRV
#include "VBoxUSBFilterMgr.h"
#include <VBox/usblib-solaris.h>
@@ -57,17 +58,18 @@
#include <sys/cmn_err.h>
-/*******************************************************************************
-* Defined Constants And Macros *
-*******************************************************************************/
+/*********************************************************************************************************************************
+* Defined Constants And Macros *
+*********************************************************************************************************************************/
/** The module name. */
#define DEVICE_NAME "vboxusbmon"
/** The module description as seen in 'modinfo'. */
#define DEVICE_DESC_DRV "VirtualBox USBMon"
-/*******************************************************************************
-* Internal Functions *
-*******************************************************************************/
+
+/*********************************************************************************************************************************
+* Internal Functions *
+*********************************************************************************************************************************/
static int VBoxUSBMonSolarisOpen(dev_t *pDev, int fFlag, int fType, cred_t *pCred);
static int VBoxUSBMonSolarisClose(dev_t Dev, int fFlag, int fType, cred_t *pCred);
static int VBoxUSBMonSolarisRead(dev_t Dev, struct uio *pUio, cred_t *pCred);
@@ -77,9 +79,10 @@ static int VBoxUSBMonSolarisGetInfo(dev_info_t *pDip, ddi_info_cmd_t enmCmd, voi
static int VBoxUSBMonSolarisAttach(dev_info_t *pDip, ddi_attach_cmd_t enmCmd);
static int VBoxUSBMonSolarisDetach(dev_info_t *pDip, ddi_detach_cmd_t enmCmd);
-/*******************************************************************************
-* Structures and Typedefs *
-*******************************************************************************/
+
+/*********************************************************************************************************************************
+* Structures and Typedefs *
+*********************************************************************************************************************************/
/**
* cb_ops: for drivers that support char/block entry points
*/
@@ -161,9 +164,9 @@ typedef struct
} vboxusbmon_state_t;
-/*******************************************************************************
-* Global Variables *
-*******************************************************************************/
+/*********************************************************************************************************************************
+* Global Variables *
+*********************************************************************************************************************************/
/** Global Device handle we only support one instance. */
static dev_info_t *g_pDip = NULL;
/** Global Mutex. */
@@ -175,16 +178,17 @@ vboxusbmon_client_t *g_pVBoxUSBMonSolarisClients = NULL;
/** Opaque pointer to list of soft states. */
static void *g_pVBoxUSBMonSolarisState;
-/*******************************************************************************
-* Internal Functions *
-*******************************************************************************/
+
+/*********************************************************************************************************************************
+* Internal Functions *
+*********************************************************************************************************************************/
static int vboxUSBMonSolarisProcessIOCtl(int iFunction, void *pvState, void *pvData, size_t cbData, size_t *pcbReturnedData);
static int vboxUSBMonSolarisResetDevice(char *pszDevicePath, bool fReattach);
-/*******************************************************************************
-* Monitor Global Hooks *
-*******************************************************************************/
+/*********************************************************************************************************************************
+* Monitor Global Hooks *
+*********************************************************************************************************************************/
static int vboxUSBMonSolarisClientInfo(vboxusbmon_state_t *pState, PVBOXUSB_CLIENT_INFO pClientInfo);
int VBoxUSBMonSolarisRegisterClient(dev_info_t *pClientDip, PVBOXUSB_CLIENT_INFO pClientInfo);
int VBoxUSBMonSolarisUnregisterClient(dev_info_t *pClientDip);
diff --git a/src/VBox/HostDrivers/VBoxUSB/testcase/tstUSBFilter.cpp b/src/VBox/HostDrivers/VBoxUSB/testcase/tstUSBFilter.cpp
index 8ea8533..1d41392 100644
--- a/src/VBox/HostDrivers/VBoxUSB/testcase/tstUSBFilter.cpp
+++ b/src/VBox/HostDrivers/VBoxUSB/testcase/tstUSBFilter.cpp
@@ -16,9 +16,9 @@
*/
-/*******************************************************************************
-* Header Files *
-*******************************************************************************/
+/*********************************************************************************************************************************
+* Header Files *
+*********************************************************************************************************************************/
#include <VBox/usbfilter.h>
#include <VBox/err.h>
@@ -27,9 +27,10 @@
#include <iprt/assert.h>
#include <iprt/initterm.h>
-/*******************************************************************************
-* Defined Constants And Macros *
-*******************************************************************************/
+
+/*********************************************************************************************************************************
+* Defined Constants And Macros *
+*********************************************************************************************************************************/
#define TESTCASE "tstUSBFilter"
#define TST_CHECK_RC(expr) do { \
@@ -50,9 +51,10 @@
} \
} while (0)
-/*******************************************************************************
-* Global Variables *
-*******************************************************************************/
+
+/*********************************************************************************************************************************
+* Global Variables *
+*********************************************************************************************************************************/
static const char g_szString64[64+1] =
{
"abcdefghijklmnopqrstuvwxyz012345"
diff --git a/src/VBox/HostDrivers/VBoxUSB/win/Install/USBInstall.cpp b/src/VBox/HostDrivers/VBoxUSB/win/Install/USBInstall.cpp
index 5e3522a..baef0d2 100644
--- a/src/VBox/HostDrivers/VBoxUSB/win/Install/USBInstall.cpp
+++ b/src/VBox/HostDrivers/VBoxUSB/win/Install/USBInstall.cpp
@@ -16,9 +16,9 @@
*/
-/*******************************************************************************
-* Header Files *
-*******************************************************************************/
+/*********************************************************************************************************************************
+* Header Files *
+*********************************************************************************************************************************/
#include <windows.h>
#include <setupapi.h>
#include <newdev.h>
diff --git a/src/VBox/HostDrivers/VBoxUSB/win/Install/USBUninstall.cpp b/src/VBox/HostDrivers/VBoxUSB/win/Install/USBUninstall.cpp
index 55d0c00..55beba8 100644
--- a/src/VBox/HostDrivers/VBoxUSB/win/Install/USBUninstall.cpp
+++ b/src/VBox/HostDrivers/VBoxUSB/win/Install/USBUninstall.cpp
@@ -16,9 +16,9 @@
*/
-/*******************************************************************************
-* Header Files *
-*******************************************************************************/
+/*********************************************************************************************************************************
+* Header Files *
+*********************************************************************************************************************************/
#include <windows.h>
#include <setupapi.h>
#include <newdev.h>
diff --git a/src/VBox/HostDrivers/VBoxUSB/win/lib/VBoxUsbLib-win.cpp b/src/VBox/HostDrivers/VBoxUSB/win/lib/VBoxUsbLib-win.cpp
index f59de25..2f95541 100644
--- a/src/VBox/HostDrivers/VBoxUSB/win/lib/VBoxUsbLib-win.cpp
+++ b/src/VBox/HostDrivers/VBoxUSB/win/lib/VBoxUsbLib-win.cpp
@@ -15,9 +15,10 @@
* hope that it will be useful, but WITHOUT ANY WARRANTY of any kind.
*/
-/*******************************************************************************
-* Header Files *
-*******************************************************************************/
+
+/*********************************************************************************************************************************
+* Header Files *
+*********************************************************************************************************************************/
#define LOG_GROUP LOG_GROUP_DRV_USBPROXY
#include <windows.h>
@@ -47,9 +48,10 @@
# include <Dbt.h>
#endif
-/*******************************************************************************
-* Structures and Typedefs *
-*******************************************************************************/
+
+/*********************************************************************************************************************************
+* Structures and Typedefs *
+*********************************************************************************************************************************/
typedef struct _USB_INTERFACE_DESCRIPTOR2
{
UCHAR bLength;
@@ -96,9 +98,9 @@ typedef struct VBOXUSB_DEV
} VBOXUSB_DEV, *PVBOXUSB_DEV;
-/*******************************************************************************
-* Global Variables *
-*******************************************************************************/
+/*********************************************************************************************************************************
+* Global Variables *
+*********************************************************************************************************************************/
static VBOXUSBGLOBALSTATE g_VBoxUsbGlobal;
diff --git a/src/VBox/HostDrivers/VBoxUSB/win/mon/VBoxUsbFlt.cpp b/src/VBox/HostDrivers/VBoxUSB/win/mon/VBoxUsbFlt.cpp
index ae411e9..2f03906 100644
--- a/src/VBox/HostDrivers/VBoxUSB/win/mon/VBoxUsbFlt.cpp
+++ b/src/VBox/HostDrivers/VBoxUSB/win/mon/VBoxUsbFlt.cpp
@@ -15,9 +15,9 @@
*/
-/*******************************************************************************
-* Header Files *
-*******************************************************************************/
+/*********************************************************************************************************************************
+* Header Files *
+*********************************************************************************************************************************/
#include "VBoxUsbMon.h"
#include "../cmn/VBoxUsbTool.h"
diff --git a/src/VBox/HostDrivers/VBoxUSB/win/testcase/USBTest.cpp b/src/VBox/HostDrivers/VBoxUSB/win/testcase/USBTest.cpp
index fda8786..2324131 100644
--- a/src/VBox/HostDrivers/VBoxUSB/win/testcase/USBTest.cpp
+++ b/src/VBox/HostDrivers/VBoxUSB/win/testcase/USBTest.cpp
@@ -16,9 +16,9 @@
*/
-/*******************************************************************************
-* Header Files *
-*******************************************************************************/
+/*********************************************************************************************************************************
+* Header Files *
+*********************************************************************************************************************************/
#include <windows.h>
#include <setupapi.h>
#include <newdev.h>
diff --git a/src/VBox/HostServices/DragAndDrop/dndmanager.cpp b/src/VBox/HostServices/DragAndDrop/dndmanager.cpp
index e38e07e..434ab6f 100644
--- a/src/VBox/HostServices/DragAndDrop/dndmanager.cpp
+++ b/src/VBox/HostServices/DragAndDrop/dndmanager.cpp
@@ -15,9 +15,10 @@
* hope that it will be useful, but WITHOUT ANY WARRANTY of any kind.
*/
-/******************************************************************************
- * Header Files *
- ******************************************************************************/
+
+/*********************************************************************************************************************************
+* Header Files *
+*********************************************************************************************************************************/
#ifdef LOG_GROUP
#undef LOG_GROUP
@@ -32,9 +33,10 @@
#include <iprt/path.h>
#include <iprt/uri.h>
-/******************************************************************************
- * DnDManager *
- ******************************************************************************/
+
+/*********************************************************************************************************************************
+* DnDManager *
+*********************************************************************************************************************************/
int DnDManager::addMessage(uint32_t uMsg, uint32_t cParms, VBOXHGCMSVCPARM paParms[], bool fAppend /* = true */)
{
diff --git a/src/VBox/HostServices/DragAndDrop/service.cpp b/src/VBox/HostServices/DragAndDrop/service.cpp
index 8ee6594..5adeccb 100644
--- a/src/VBox/HostServices/DragAndDrop/service.cpp
+++ b/src/VBox/HostServices/DragAndDrop/service.cpp
@@ -51,9 +51,10 @@
* clients and reports it to this service's callback).
*/
-/******************************************************************************
- * Header Files *
- ******************************************************************************/
+
+/*********************************************************************************************************************************
+* Header Files *
+*********************************************************************************************************************************/
#ifdef LOG_GROUP
#undef LOG_GROUP
#endif
@@ -63,9 +64,10 @@
#include "dndmanager.h"
-/******************************************************************************
- * Service class declaration *
- ******************************************************************************/
+
+/*********************************************************************************************************************************
+* Service class declaration *
+*********************************************************************************************************************************/
/** Map holding pointers to HGCM clients. Key is the (unique) HGCM client ID. */
typedef std::map<uint32_t, HGCM::Client*> DnDClientMap;
@@ -108,9 +110,10 @@ protected:
uint32_t m_u32Mode;
};
-/******************************************************************************
- * Service class implementation *
- ******************************************************************************/
+
+/*********************************************************************************************************************************
+* Service class implementation *
+*********************************************************************************************************************************/
int DragAndDropService::init(VBOXHGCMSVCFNTABLE *pTable)
{
diff --git a/src/VBox/HostServices/GuestControl/gctrl.cpp b/src/VBox/HostServices/GuestControl/gctrl.cpp
index 0a5aaf5..6875bf3 100644
--- a/src/VBox/HostServices/GuestControl/gctrl.cpp
+++ b/src/VBox/HostServices/GuestControl/gctrl.cpp
@@ -15,9 +15,10 @@
* hope that it will be useful, but WITHOUT ANY WARRANTY of any kind.
*/
-/*******************************************************************************
-* Header Files *
-*******************************************************************************/
+
+/*********************************************************************************************************************************
+* Header Files *
+*********************************************************************************************************************************/
#define LOG_GROUP LOG_GROUP_HGCM
#include <VBox/HostServices/GuestControlSvc.h>
diff --git a/src/VBox/HostServices/GuestControl/service.cpp b/src/VBox/HostServices/GuestControl/service.cpp
index c4e55d3..6748207 100644
--- a/src/VBox/HostServices/GuestControl/service.cpp
+++ b/src/VBox/HostServices/GuestControl/service.cpp
@@ -55,9 +55,10 @@
* compatibility between older hosts and to manage guest session on the host.
*/
-/*******************************************************************************
-* Header Files *
-*******************************************************************************/
+
+/*********************************************************************************************************************************
+* Header Files *
+*********************************************************************************************************************************/
#ifdef LOG_GROUP
#undef LOG_GROUP
#endif
diff --git a/src/VBox/HostServices/GuestControl/testcase/tstGuestControlSvc.cpp b/src/VBox/HostServices/GuestControl/testcase/tstGuestControlSvc.cpp
index e2b193c..3710329 100644
--- a/src/VBox/HostServices/GuestControl/testcase/tstGuestControlSvc.cpp
+++ b/src/VBox/HostServices/GuestControl/testcase/tstGuestControlSvc.cpp
@@ -16,9 +16,10 @@
* hope that it will be useful, but WITHOUT ANY WARRANTY of any kind.
*/
-/*******************************************************************************
-* Header Files *
-*******************************************************************************/
+
+/*********************************************************************************************************************************
+* Header Files *
+*********************************************************************************************************************************/
#include <VBox/HostServices/GuestControlSvc.h>
#include <iprt/initterm.h>
#include <iprt/stream.h>
@@ -26,9 +27,10 @@
#include "../gctrl.h"
-/*******************************************************************************
-* Global Variables *
-*******************************************************************************/
+
+/*********************************************************************************************************************************
+* Global Variables *
+*********************************************************************************************************************************/
static RTTEST g_hTest = NIL_RTTEST;
using namespace guestControl;
@@ -43,7 +45,7 @@ struct VBOXHGCMCALLHANDLE_TYPEDEF
};
/** Call completion callback for guest calls. */
-static void callComplete(VBOXHGCMCALLHANDLE callHandle, int32_t rc)
+static DECLCALLBACK(void) callComplete(VBOXHGCMCALLHANDLE callHandle, int32_t rc)
{
callHandle->rc = rc;
}
diff --git a/src/VBox/HostServices/GuestProperties/service.cpp b/src/VBox/HostServices/GuestProperties/service.cpp
index bd3a162..80fc9b2 100644
--- a/src/VBox/HostServices/GuestProperties/service.cpp
+++ b/src/VBox/HostServices/GuestProperties/service.cpp
@@ -34,9 +34,10 @@
* is changed or when the request times out.
*/
-/*******************************************************************************
-* Header Files *
-*******************************************************************************/
+
+/*********************************************************************************************************************************
+* Header Files *
+*********************************************************************************************************************************/
#define LOG_GROUP LOG_GROUP_HGCM
#include <VBox/HostServices/GuestPropertySvc.h>
diff --git a/src/VBox/HostServices/GuestProperties/testcase/tstGuestPropSvc.cpp b/src/VBox/HostServices/GuestProperties/testcase/tstGuestPropSvc.cpp
index a1d3c38..d22e135 100644
--- a/src/VBox/HostServices/GuestProperties/testcase/tstGuestPropSvc.cpp
+++ b/src/VBox/HostServices/GuestProperties/testcase/tstGuestPropSvc.cpp
@@ -16,17 +16,18 @@
* hope that it will be useful, but WITHOUT ANY WARRANTY of any kind.
*/
-/*******************************************************************************
-* Header Files *
-*******************************************************************************/
+
+/*********************************************************************************************************************************
+* Header Files *
+*********************************************************************************************************************************/
#include <VBox/HostServices/GuestPropertySvc.h>
#include <iprt/test.h>
#include <iprt/time.h>
-/*******************************************************************************
-* Global Variables *
-*******************************************************************************/
+/*********************************************************************************************************************************
+* Global Variables *
+*********************************************************************************************************************************/
static RTTEST g_hTest = NIL_RTTEST;
using namespace guestProp;
@@ -41,7 +42,7 @@ struct VBOXHGCMCALLHANDLE_TYPEDEF
};
/** Call completion callback for guest calls. */
-static void callComplete(VBOXHGCMCALLHANDLE callHandle, int32_t rc)
+static DECLCALLBACK(void) callComplete(VBOXHGCMCALLHANDLE callHandle, int32_t rc)
{
callHandle->rc = rc;
}
diff --git a/src/VBox/HostServices/SharedFolders/testcase/tstSharedFolderService.cpp b/src/VBox/HostServices/SharedFolders/testcase/tstSharedFolderService.cpp
index 760bb82..7e4a397 100644
--- a/src/VBox/HostServices/SharedFolders/testcase/tstSharedFolderService.cpp
+++ b/src/VBox/HostServices/SharedFolders/testcase/tstSharedFolderService.cpp
@@ -21,9 +21,10 @@
* hope that it will be useful, but WITHOUT ANY WARRANTY of any kind.
*/
-/******************************************************************************
-* Header Files *
-******************************************************************************/
+
+/*********************************************************************************************************************************
+* Header Files *
+*********************************************************************************************************************************/
#include "tstSharedFolderService.h"
#include "vbsf.h"
@@ -39,21 +40,21 @@
#include "teststubs.h"
-/******************************************************************************
-* Global Variables *
-******************************************************************************/
+/*********************************************************************************************************************************
+* Global Variables *
+*********************************************************************************************************************************/
static RTTEST g_hTest = NIL_RTTEST;
-/******************************************************************************
-* Declarations *
-******************************************************************************/
+/*********************************************************************************************************************************
+* Declarations *
+*********************************************************************************************************************************/
extern "C" DECLCALLBACK(DECLEXPORT(int)) VBoxHGCMSvcLoad (VBOXHGCMSVCFNTABLE *ptable);
-/******************************************************************************
-* Helpers *
-******************************************************************************/
+/*********************************************************************************************************************************
+* Helpers *
+*********************************************************************************************************************************/
/** Simple call handle structure for the guest call completion callback */
struct VBOXHGCMCALLHANDLE_TYPEDEF
@@ -63,7 +64,7 @@ struct VBOXHGCMCALLHANDLE_TYPEDEF
};
/** Call completion callback for guest calls. */
-static void callComplete(VBOXHGCMCALLHANDLE callHandle, int32_t rc)
+static DECLCALLBACK(void) callComplete(VBOXHGCMCALLHANDLE callHandle, int32_t rc)
{
callHandle->rc = rc;
}
@@ -110,9 +111,9 @@ static void bufferFromPath(void *pvDest, size_t cb, const char *pcszSrc)
} while (0)
-/******************************************************************************
-* Stub functions and data *
-******************************************************************************/
+/*********************************************************************************************************************************
+* Stub functions and data *
+*********************************************************************************************************************************/
static PRTDIR testRTDirClosepDir;
@@ -407,9 +408,9 @@ extern int testRTSymlinkRead(const char *pszSymlink, char *pszTarget,
{ RTPrintf("%s\n", __PRETTY_FUNCTION__); return 0; }
-/******************************************************************************
-* Tests *
-******************************************************************************/
+/*********************************************************************************************************************************
+* Tests *
+*********************************************************************************************************************************/
/* Sub-tests for testMappingsQuery(). */
void testMappingsQuerySimple(RTTEST hTest) {}
@@ -1111,9 +1112,10 @@ void testLockFileSimple(RTTEST hTest)
(hTest, "File=%llu\n", LLUIFY(testRTFileCloseFile)));
}
-/******************************************************************************
-* Main code *
-******************************************************************************/
+
+/*********************************************************************************************************************************
+* Main code *
+*********************************************************************************************************************************/
static void testAPI(RTTEST hTest)
{
diff --git a/src/VBox/HostServices/SharedFolders/testcase/tstShflCase.cpp b/src/VBox/HostServices/SharedFolders/testcase/tstShflCase.cpp
index bbc3e66..bd1153a 100644
--- a/src/VBox/HostServices/SharedFolders/testcase/tstShflCase.cpp
+++ b/src/VBox/HostServices/SharedFolders/testcase/tstShflCase.cpp
@@ -14,9 +14,10 @@
* hope that it will be useful, but WITHOUT ANY WARRANTY of any kind.
*/
-/*******************************************************************************
-* Header Files *
-*******************************************************************************/
+
+/*********************************************************************************************************************************
+* Header Files *
+*********************************************************************************************************************************/
#define LOG_GROUP LOG_GROUP_MISC
#define LOG_ENABLED
#include <VBox/shflsvc.h>
@@ -33,9 +34,9 @@
#include <stdio.h>
-/*******************************************************************************
-* Defined Constants And Macros *
-*******************************************************************************/
+/*********************************************************************************************************************************
+* Defined Constants And Macros *
+*********************************************************************************************************************************/
/* Override slash for non-windows hosts. */
#undef RTPATH_DELIMITER
#define RTPATH_DELIMITER '\\'
@@ -47,9 +48,9 @@
#define RTDirReadEx rtDirReadEx
-/*******************************************************************************
-* Global Variables *
-*******************************************************************************/
+/*********************************************************************************************************************************
+* Global Variables *
+*********************************************************************************************************************************/
static int iDirList = 0;
static int iDirFile = 0;
diff --git a/src/VBox/HostServices/SharedFolders/testcase/tstShflSizes.cpp b/src/VBox/HostServices/SharedFolders/testcase/tstShflSizes.cpp
index ce94fdb..77866fa 100644
--- a/src/VBox/HostServices/SharedFolders/testcase/tstShflSizes.cpp
+++ b/src/VBox/HostServices/SharedFolders/testcase/tstShflSizes.cpp
@@ -15,9 +15,10 @@
* hope that it will be useful, but WITHOUT ANY WARRANTY of any kind.
*/
-/*******************************************************************************
-* Header Files *
-*******************************************************************************/
+
+/*********************************************************************************************************************************
+* Header Files *
+*********************************************************************************************************************************/
#include <VBox/shflsvc.h>
#include <iprt/string.h>
#include <stdio.h>
diff --git a/src/VBox/HostServices/SharedFolders/vbsf.cpp b/src/VBox/HostServices/SharedFolders/vbsf.cpp
index 388e584..efc5cac 100644
--- a/src/VBox/HostServices/SharedFolders/vbsf.cpp
+++ b/src/VBox/HostServices/SharedFolders/vbsf.cpp
@@ -1295,6 +1295,17 @@ int vbsfReadLink(SHFLCLIENTDATA *pClient, SHFLROOT root, SHFLSTRING *pPath, uint
if (RT_SUCCESS(rc))
{
rc = RTSymlinkRead(pszFullPath, (char *) pBuffer, cbBuffer, 0);
+ if (RT_SUCCESS(rc))
+ {
+ /* Convert the slashes in the link target to the guest path separator characters. */
+ char *psz = (char *)pBuffer;
+ while (*psz != '\0')
+ {
+ if (*psz == RTPATH_DELIMITER)
+ *psz = pClient->PathDelimiter;
+ psz++;
+ }
+ }
/* free the path string */
vbsfFreeFullPath(pszFullPath);
@@ -1845,6 +1856,7 @@ int vbsfSymlink(SHFLCLIENTDATA *pClient, SHFLROOT root, SHFLSTRING *pNewPath, SH
int rc = VINF_SUCCESS;
char *pszFullNewPath = NULL;
+ char *pszFullOldPath = NULL;
const char *pszOldPath = (const char *)pOldPath->String.utf8;
/* XXX: no support for UCS2 at the moment. */
@@ -1860,6 +1872,14 @@ int vbsfSymlink(SHFLCLIENTDATA *pClient, SHFLROOT root, SHFLSTRING *pNewPath, SH
rc = vbsfBuildFullPath(pClient, root, pNewPath, pNewPath->u16Size + SHFLSTRING_HEADER_SIZE, &pszFullNewPath, NULL);
AssertRCReturn(rc, rc);
+ /* Verify that the link target can be a valid host path, i.e. does not contain invalid characters. */
+ rc = vbsfBuildFullPath(pClient, root, pOldPath, pOldPath->u16Size + SHFLSTRING_HEADER_SIZE, &pszFullOldPath, NULL);
+ if (RT_FAILURE(rc))
+ {
+ vbsfFreeFullPath(pszFullNewPath);
+ return rc;
+ }
+
rc = RTSymlinkCreate(pszFullNewPath, (const char *)pOldPath->String.utf8,
RTSYMLINKTYPE_UNKNOWN, 0);
if (RT_SUCCESS(rc))
@@ -1870,6 +1890,7 @@ int vbsfSymlink(SHFLCLIENTDATA *pClient, SHFLROOT root, SHFLSTRING *pNewPath, SH
vbfsCopyFsObjInfoFromIprt(pInfo, &info);
}
+ vbsfFreeFullPath(pszFullOldPath);
vbsfFreeFullPath(pszFullNewPath);
return rc;
diff --git a/src/VBox/HostServices/SharedFolders/vbsfpath.h b/src/VBox/HostServices/SharedFolders/vbsfpath.h
index 6b0fad8..f105d0a 100644
--- a/src/VBox/HostServices/SharedFolders/vbsfpath.h
+++ b/src/VBox/HostServices/SharedFolders/vbsfpath.h
@@ -24,7 +24,7 @@
#define VBSF_F_PATH_HAS_WILDCARD_IN_PREFIX UINT32_C(0x00000001) /* A component before the last one contains a wildcard. */
#define VBSF_F_PATH_HAS_WILDCARD_IN_LAST UINT32_C(0x00000002) /* The last component contains a wildcard. */
-/**
+/**
*
* @param pClient Shared folder client.
* @param hRoot Root handle.
diff --git a/src/VBox/HostServices/SharedOpenGL/Makefile.kmk b/src/VBox/HostServices/SharedOpenGL/Makefile.kmk
index a6d6b31..e92e1cd 100644
--- a/src/VBox/HostServices/SharedOpenGL/Makefile.kmk
+++ b/src/VBox/HostServices/SharedOpenGL/Makefile.kmk
@@ -29,10 +29,6 @@ BLDDIRS += \
$(VBOX_PATH_CROGL_GENFILES)/
endif
-ifeq ($(KBUILD_TARGET),darwin)
- VBOX_WITH_CR_DISPLAY_LISTS=1
-endif
-
ifdef VBOX_WITH_CR_DISPLAY_LISTS
LIBRARIES += VBoxOGLcrdlm
DLLS += VBoxOGLexpandospu
diff --git a/src/VBox/HostServices/SharedOpenGL/crserverlib/server_dispatch.py b/src/VBox/HostServices/SharedOpenGL/crserverlib/server_dispatch.py
old mode 100755
new mode 100644
diff --git a/src/VBox/HostServices/SharedOpenGL/crserverlib/server_dispatch_header.py b/src/VBox/HostServices/SharedOpenGL/crserverlib/server_dispatch_header.py
old mode 100755
new mode 100644
diff --git a/src/VBox/HostServices/SharedOpenGL/crserverlib/server_get.py b/src/VBox/HostServices/SharedOpenGL/crserverlib/server_get.py
old mode 100755
new mode 100644
diff --git a/src/VBox/HostServices/SharedOpenGL/crserverlib/server_retval.py b/src/VBox/HostServices/SharedOpenGL/crserverlib/server_retval.py
old mode 100755
new mode 100644
diff --git a/src/VBox/HostServices/SharedOpenGL/dlm/dlm_generated.py b/src/VBox/HostServices/SharedOpenGL/dlm/dlm_generated.py
old mode 100644
new mode 100755
diff --git a/src/VBox/HostServices/SharedOpenGL/expando/expando.py b/src/VBox/HostServices/SharedOpenGL/expando/expando.py
old mode 100755
new mode 100644
diff --git a/src/VBox/HostServices/SharedOpenGL/unpacker/unpack.py b/src/VBox/HostServices/SharedOpenGL/unpacker/unpack.py
old mode 100755
new mode 100644
diff --git a/src/VBox/HostServices/SharedOpenGL/unpacker/unpack_extend.py b/src/VBox/HostServices/SharedOpenGL/unpacker/unpack_extend.py
old mode 100755
new mode 100644
diff --git a/src/VBox/HostServices/SharedOpenGL/unpacker/unpack_header.py b/src/VBox/HostServices/SharedOpenGL/unpacker/unpack_header.py
old mode 100755
new mode 100644
diff --git a/src/VBox/HostServices/testcase/tstHGCMSvc.cpp b/src/VBox/HostServices/testcase/tstHGCMSvc.cpp
index fcd3961..1284f92 100644
--- a/src/VBox/HostServices/testcase/tstHGCMSvc.cpp
+++ b/src/VBox/HostServices/testcase/tstHGCMSvc.cpp
@@ -15,9 +15,10 @@
* hope that it will be useful, but WITHOUT ANY WARRANTY of any kind.
*/
-/*****************************************************************************
-* Header Files *
-*****************************************************************************/
+
+/*********************************************************************************************************************************
+* Header Files *
+*********************************************************************************************************************************/
#include <VBox/hgcmsvc.h>
#include <iprt/initterm.h>
#include <iprt/test.h>
diff --git a/src/VBox/ImageMounter/VBoxFUSE/VBoxFUSE.cpp b/src/VBox/ImageMounter/VBoxFUSE/VBoxFUSE.cpp
index f394524..6edff0e 100644
--- a/src/VBox/ImageMounter/VBoxFUSE/VBoxFUSE.cpp
+++ b/src/VBox/ImageMounter/VBoxFUSE/VBoxFUSE.cpp
@@ -16,9 +16,9 @@
*/
-/*******************************************************************************
-* Header Files *
-*******************************************************************************/
+/*********************************************************************************************************************************
+* Header Files *
+*********************************************************************************************************************************/
#define LOG_GROUP LOG_GROUP_DEFAULT /** @todo log group */
#include <iprt/types.h>
@@ -54,9 +54,9 @@
#include <iprt/stream.h>
-/*******************************************************************************
-* Structures and Typedefs *
-*******************************************************************************/
+/*********************************************************************************************************************************
+* Structures and Typedefs *
+*********************************************************************************************************************************/
/**
* Node type.
*/
@@ -153,18 +153,18 @@ typedef VBOXFUSEDIR *PVBOXFUSEDIR;
#define VBOXFUSE_DIR_GROW_BY 2 /* 32 */
-/*******************************************************************************
-* Global Variables *
-*******************************************************************************/
+/*********************************************************************************************************************************
+* Global Variables *
+*********************************************************************************************************************************/
/** The root of the file hierarchy. */
static VBOXFUSEDIR *g_pTreeRoot;
/** The next inode number. */
static RTINODE volatile g_NextIno = 1;
-/*******************************************************************************
-* Internal Functions *
-*******************************************************************************/
+/*********************************************************************************************************************************
+* Internal Functions *
+*********************************************************************************************************************************/
static int vboxfuseTreeLookupParent(const char *pszPath, const char **ppszName, PVBOXFUSEDIR *ppDir);
static int vboxfuseTreeLookupParentForInsert(const char *pszPath, const char **ppszName, PVBOXFUSEDIR *ppDir);
diff --git a/src/VBox/Installer/darwin/Makefile.kmk b/src/VBox/Installer/darwin/Makefile.kmk
index bd4616e..d4d3eee 100644
--- a/src/VBox/Installer/darwin/Makefile.kmk
+++ b/src/VBox/Installer/darwin/Makefile.kmk
@@ -150,8 +150,10 @@ endif
$(MKDIR) -m 1333 $(VBOX_PATH_PACK_TMP)/DiskImage/.Trashes
@# Change the owners.
sudo chown -R root:admin $(VBOX_PATH_PACK_TMP)/DiskImage
- @# Create the image.
- sudo hdiutil create -format UDBZ -volname "VirtualBox" -srcfolder "$(VBOX_PATH_PACK_TMP)/DiskImage" "$@"
+ @# Create the image. We calculate the size our selves, adding 8MB for fudging (it's about 100-120MB atm).
+ sudo hdiutil create -format UDBZ -volname "VirtualBox" -srcfolder "$(VBOX_PATH_PACK_TMP)/DiskImage" \
+ -size $(DOLLAR)((`/usr/bin/du -d 0 -k "$(VBOX_PATH_PACK_TMP)/DiskImage/" | /usr/bin/cut -f1` + 8192))k \
+ "$@"
@# Change (back) the owner so it can be deleted by the user.
sudo chown "$(shell whoami)" "$@"
sudo chown -R "$(shell whoami)" $(VBOX_PATH_PACK_TMP)/DiskImage
@@ -370,6 +372,11 @@ ifdef VBOX_WITH_CROGL
MacOS/VBoxOGLhosterrorspu.dylib \
MacOS/VBoxOGLrenderspu.dylib \
MacOS/VBoxSharedCrOpenGL.dylib
+
+ ifdef VBOX_WITH_CR_DISPLAY_LISTS
+ VBOX_DI_VBAPP_DYLIBS += \
+ MacOS/VBoxOGLexpandospu.dylib
+ endif
endif
ifdef VBOX_WITH_DEBUGGER_GUI
VBOX_DI_VBAPP_DYLIBS += \
diff --git a/src/VBox/Installer/solaris/Makefile.kmk b/src/VBox/Installer/solaris/Makefile.kmk
index 6db5620..f75fba5 100644
--- a/src/VBox/Installer/solaris/Makefile.kmk
+++ b/src/VBox/Installer/solaris/Makefile.kmk
@@ -541,7 +541,7 @@ $(VBOX_PATH_SI_SCRATCH)/$(PKG_FILENAME).pkg: \
\
$(if-expr defined(VBOX_WITH_QTGUI) && defined(VBOX_WITH_QT4_SUN),$(VBOX_PATH_QT4)/bin/qtconfig,) \
$(if-expr defined(VBOX_WITH_ADDITIONS_PACKING),$(PATH_STAGE_BIN)/additions/VBoxGuestAdditions.iso,) \
- $(if-expr !defined(VBOX_OSE) && defined(VBOX_WITH_VBOXSDL),$(PATH_DEVTOOLS_TRG)/libSDL/v1.2.13/lib/libSDL-1.2.so.0.11.2,) \
+ $(if-expr !defined(VBOX_OSE) && defined(VBOX_WITH_VBOXSDL),$(PATH_DEVTOOLS_TRG)/libsdl/v1.2.13/lib/libSDL-1.2.so.0.11.2,) \
\
$(foreach var, $(SOLARIS_FILE_LIST_VARS),$(foreach file, $($(var)), $($(var).SRC)/$(file))) \
\
@@ -613,7 +613,7 @@ $(VBOX_PATH_SI_SCRATCH)/$(PKG_FILENAME).pkg: \
,$(NLTAB)$(LN_SYMLINK) ../VBoxGuestAdditions.iso $(VBOX_PATH_SI_SCRATCH_PKG)/opt/VirtualBox/$(VBOX_SI_ARCH)/,)
$(if-expr !defined(VBOX_OSE) && defined(VBOX_WITH_VBOXSDL) \
- ,$(INSTALL) -m 0644 $(PATH_DEVTOOLS_TRG)/libSDL/v1.2.13/lib/libSDL-1.2.so.0.11.2 \
+ ,$(INSTALL) -m 0644 $(PATH_DEVTOOLS_TRG)/libsdl/v1.2.13/lib/libSDL-1.2.so.0.11.2 \
$(VBOX_PATH_SI_SCRATCH_PKG)/opt/VirtualBox/$(VBOX_SI_ARCH)/libSDL-1.2.so.0,)
$(if-expr defined(VBOX_WITH_EFIFW_PACKING) \
diff --git a/src/VBox/Installer/solaris/VBoxISAExec.c b/src/VBox/Installer/solaris/VBoxISAExec.c
index 754d038..b9d93dd 100644
--- a/src/VBox/Installer/solaris/VBoxISAExec.c
+++ b/src/VBox/Installer/solaris/VBoxISAExec.c
@@ -15,9 +15,10 @@
* hope that it will be useful, but WITHOUT ANY WARRANTY of any kind.
*/
-/*******************************************************************************
-* Header Files *
-*******************************************************************************/
+
+/*********************************************************************************************************************************
+* Header Files *
+*********************************************************************************************************************************/
#include <stdio.h>
#include <stdlib.h>
#include <unistd.h>
diff --git a/src/VBox/Installer/solaris/VBoxZoneAccess.c b/src/VBox/Installer/solaris/VBoxZoneAccess.c
index 55ae684..0d0b4c1 100644
--- a/src/VBox/Installer/solaris/VBoxZoneAccess.c
+++ b/src/VBox/Installer/solaris/VBoxZoneAccess.c
@@ -15,9 +15,10 @@
* hope that it will be useful, but WITHOUT ANY WARRANTY of any kind.
*/
-/*******************************************************************************
-* Header Files *
-*******************************************************************************/
+
+/*********************************************************************************************************************************
+* Header Files *
+*********************************************************************************************************************************/
#include <stdio.h>
#include <signal.h>
#include <unistd.h>
@@ -26,9 +27,10 @@
#include <iprt/process.h>
-/*******************************************************************************
-* Defined Constants And Macros *
-*******************************************************************************/
+
+/*********************************************************************************************************************************
+* Defined Constants And Macros *
+*********************************************************************************************************************************/
#define DEVICE_NAME "/devices/pseudo/vboxdrv at 0:vboxdrv"
#define DEVICE_NAME_USR "/devices/pseudo/vboxdrv at 0:vboxdrvu"
diff --git a/src/VBox/Installer/win/InstallHelper/VBoxCommon.cpp b/src/VBox/Installer/win/InstallHelper/VBoxCommon.cpp
index db6336a..6ea608c 100644
--- a/src/VBox/Installer/win/InstallHelper/VBoxCommon.cpp
+++ b/src/VBox/Installer/win/InstallHelper/VBoxCommon.cpp
@@ -16,9 +16,9 @@
*/
-/*******************************************************************************
-* Header Files *
-*******************************************************************************/
+/*********************************************************************************************************************************
+* Header Files *
+*********************************************************************************************************************************/
#include <windows.h>
#include <tchar.h>
#include <stdio.h>
diff --git a/src/VBox/Installer/win/InstallHelper/VBoxInstallHelper.cpp b/src/VBox/Installer/win/InstallHelper/VBoxInstallHelper.cpp
index 70a1dc6..93b864e 100644
--- a/src/VBox/Installer/win/InstallHelper/VBoxInstallHelper.cpp
+++ b/src/VBox/Installer/win/InstallHelper/VBoxInstallHelper.cpp
@@ -16,9 +16,9 @@
*/
-/*******************************************************************************
-* Header Files *
-*******************************************************************************/
+/*********************************************************************************************************************************
+* Header Files *
+*********************************************************************************************************************************/
#ifdef VBOX_WITH_NETFLT
# include "VBox/VBoxNetCfg-win.h"
# include "VBox/VBoxDrvCfg-win.h"
@@ -52,9 +52,9 @@
#endif
-/*******************************************************************************
-* Header Files *
-*******************************************************************************/
+/*********************************************************************************************************************************
+* Header Files *
+*********************************************************************************************************************************/
#ifdef DEBUG
# define NonStandardAssert(_expr) assert(_expr)
#else
diff --git a/src/VBox/Installer/win/Stub/VBoxStub.cpp b/src/VBox/Installer/win/Stub/VBoxStub.cpp
index 98d06b0..ecc98c1 100644
--- a/src/VBox/Installer/win/Stub/VBoxStub.cpp
+++ b/src/VBox/Installer/win/Stub/VBoxStub.cpp
@@ -15,9 +15,10 @@
* hope that it will be useful, but WITHOUT ANY WARRANTY of any kind.
*/
-/*******************************************************************************
-* Header Files *
-*******************************************************************************/
+
+/*********************************************************************************************************************************
+* Header Files *
+*********************************************************************************************************************************/
#if defined(_WIN32_WINNT) && _WIN32_WINNT < 0x0501
# undef _WIN32_WINNT
# define _WIN32_WINNT 0x0501 /* AttachConsole() / FreeConsole(). */
@@ -67,16 +68,17 @@
# define VBOX_STUB_WITH_OWN_CONSOLE
#endif
-/*******************************************************************************
-* Defined Constants And Macros *
-*******************************************************************************/
+
+/*********************************************************************************************************************************
+* Defined Constants And Macros *
+*********************************************************************************************************************************/
#define MY_UNICODE_SUB(str) L ##str
#define MY_UNICODE(str) MY_UNICODE_SUB(str)
-/*******************************************************************************
-* Structures and Typedefs *
-*******************************************************************************/
+/*********************************************************************************************************************************
+* Structures and Typedefs *
+*********************************************************************************************************************************/
/**
* Cleanup record.
*/
@@ -93,9 +95,9 @@ typedef struct STUBCLEANUPREC
typedef STUBCLEANUPREC *PSTUBCLEANUPREC;
-/*******************************************************************************
-* Global Variables *
-*******************************************************************************/
+/*********************************************************************************************************************************
+* Global Variables *
+*********************************************************************************************************************************/
/** Whether it's a silent or interactive GUI driven install. */
static bool g_fSilent = false;
/** List of temporary files. */
diff --git a/src/VBox/Installer/win/Stub/VBoxStubCertUtil.cpp b/src/VBox/Installer/win/Stub/VBoxStubCertUtil.cpp
index 83843e7..c948ccf 100644
--- a/src/VBox/Installer/win/Stub/VBoxStubCertUtil.cpp
+++ b/src/VBox/Installer/win/Stub/VBoxStubCertUtil.cpp
@@ -18,9 +18,10 @@
* hope that it will be useful, but WITHOUT ANY WARRANTY of any kind.
*/
-/*******************************************************************************
-* Header Files *
-*******************************************************************************/
+
+/*********************************************************************************************************************************
+* Header Files *
+*********************************************************************************************************************************/
#include <Windows.h>
#include <Wincrypt.h>
diff --git a/src/VBox/Installer/win/StubBld/VBoxStubBld.cpp b/src/VBox/Installer/win/StubBld/VBoxStubBld.cpp
index 9d3842c..02140a7 100644
--- a/src/VBox/Installer/win/StubBld/VBoxStubBld.cpp
+++ b/src/VBox/Installer/win/StubBld/VBoxStubBld.cpp
@@ -15,9 +15,10 @@
* hope that it will be useful, but WITHOUT ANY WARRANTY of any kind.
*/
-/*******************************************************************************
-* Header Files *
-*******************************************************************************/
+
+/*********************************************************************************************************************************
+* Header Files *
+*********************************************************************************************************************************/
#include <windows.h>
#include <shellapi.h>
#include <strsafe.h>
diff --git a/src/VBox/Main/Makefile.kmk b/src/VBox/Main/Makefile.kmk
index 4cf6a8d..882f237 100644
--- a/src/VBox/Main/Makefile.kmk
+++ b/src/VBox/Main/Makefile.kmk
@@ -522,7 +522,7 @@ ifdef VBOX_WITH_MAIN_USB_ID_DATABASE # Generate a database of USB vendor IDs an
USBIdDatabaseGenerator_TEMPLATE = VBoxAdvBldProg
USBIdDatabaseGenerator_SOURCES = src-server/USBIdDatabaseGenerator.cpp
else
- VBoxSVC_SOURCES += src-server/USBIdDatabaseStub.cpp
+ VBoxSVC_SOURCES += src-server/USBIdDatabaseStub.cpp
endif
src-server/win/VBoxSVC.rc_INCS = $(VBoxSVC_0_OUTDIR)
diff --git a/src/VBox/Main/cbinding/VBoxCAPIGlue.c b/src/VBox/Main/cbinding/VBoxCAPIGlue.c
index 9ee6ed7..e0c1f49 100644
--- a/src/VBox/Main/cbinding/VBoxCAPIGlue.c
+++ b/src/VBox/Main/cbinding/VBoxCAPIGlue.c
@@ -28,9 +28,10 @@
* OTHER DEALINGS IN THE SOFTWARE.
*/
-/*******************************************************************************
-* Header Files *
-*******************************************************************************/
+
+/*********************************************************************************************************************************
+* Header Files *
+*********************************************************************************************************************************/
#include "VBoxCAPIGlue.h"
#include <stdio.h>
@@ -46,9 +47,9 @@
#endif /* WIN32 */
-/*******************************************************************************
-* Defined Constants And Macros *
-*******************************************************************************/
+/*********************************************************************************************************************************
+* Defined Constants And Macros *
+*********************************************************************************************************************************/
#if defined(__linux__) || defined(__linux_gnu__) || defined(__sun__) || defined(__FreeBSD__)
# define DYNLIB_NAME "VBoxXPCOMC.so"
#elif defined(__APPLE__)
@@ -62,9 +63,9 @@
#endif
-/*******************************************************************************
-* Global Variables *
-*******************************************************************************/
+/*********************************************************************************************************************************
+* Global Variables *
+*********************************************************************************************************************************/
/** The so/dynsym/dll handle for VBoxCAPI. */
#ifndef WIN32
void *g_hVBoxCAPI = NULL;
diff --git a/src/VBox/Main/cbinding/tstCAPIGlue.c b/src/VBox/Main/cbinding/tstCAPIGlue.c
index 70de489..ba939f0 100644
--- a/src/VBox/Main/cbinding/tstCAPIGlue.c
+++ b/src/VBox/Main/cbinding/tstCAPIGlue.c
@@ -19,9 +19,10 @@
* hope that it will be useful, but WITHOUT ANY WARRANTY of any kind.
*/
-/*******************************************************************************
-* Header Files *
-*******************************************************************************/
+
+/*********************************************************************************************************************************
+* Header Files *
+*********************************************************************************************************************************/
#include "VBoxCAPIGlue.h"
#include <stdio.h>
#include <string.h>
@@ -40,9 +41,9 @@
#undef USE_ACTIVE_EVENT_LISTENER
-/*******************************************************************************
-* Global Variables *
-*******************************************************************************/
+/*********************************************************************************************************************************
+* Global Variables *
+*********************************************************************************************************************************/
/** Set by Ctrl+C handler. */
static volatile int g_fStop = 0;
diff --git a/src/VBox/Main/glue/AutoLock.cpp b/src/VBox/Main/glue/AutoLock.cpp
index fa909b9..0f6246c 100644
--- a/src/VBox/Main/glue/AutoLock.cpp
+++ b/src/VBox/Main/glue/AutoLock.cpp
@@ -16,15 +16,15 @@
*/
-/*******************************************************************************
-* Defined Constants And Macros *
-*******************************************************************************/
+/*********************************************************************************************************************************
+* Defined Constants And Macros *
+*********************************************************************************************************************************/
#define GLUE_USE_CRITSECTRW
-/*******************************************************************************
-* Header Files *
-*******************************************************************************/
+/*********************************************************************************************************************************
+* Header Files *
+*********************************************************************************************************************************/
#include <iprt/cdefs.h>
#include <iprt/critsect.h>
#include <iprt/thread.h>
diff --git a/src/VBox/Main/glue/com.cpp b/src/VBox/Main/glue/com.cpp
index b16e6cc..39a6831 100644
--- a/src/VBox/Main/glue/com.cpp
+++ b/src/VBox/Main/glue/com.cpp
@@ -271,7 +271,7 @@ int GetVBoxUserHomeDirectory(char *aDir, size_t aDirLen, bool fCreateDir)
static const char *g_pszLogEntity = NULL;
-static void vboxHeaderFooter(PRTLOGGER pReleaseLogger, RTLOGPHASE enmPhase, PFNRTLOGPHASEMSG pfnLog)
+static DECLCALLBACK(void) vboxHeaderFooter(PRTLOGGER pReleaseLogger, RTLOGPHASE enmPhase, PFNRTLOGPHASEMSG pfnLog)
{
/* some introductory information */
static RTTIMESPEC s_TimeSpec;
diff --git a/src/VBox/Main/glue/constants-python.xsl b/src/VBox/Main/glue/constants-python.xsl
old mode 100644
new mode 100755
diff --git a/src/VBox/Main/idl/VirtualBox.xidl b/src/VBox/Main/idl/VirtualBox.xidl
index 2848655..a004601 100644
--- a/src/VBox/Main/idl/VirtualBox.xidl
+++ b/src/VBox/Main/idl/VirtualBox.xidl
@@ -5219,7 +5219,13 @@ and "VAR" for unsetting. -->
<ul>
<li><tt>"gui"</tt>: VirtualBox Qt GUI front-end</li>
<li><tt>"headless"</tt>: VBoxHeadless (VRDE Server) front-end</li>
+ <li><tt>"capture"</tt>: VBoxHeadless (VRDE Server) front-end with
+ video capturing enabled</li>
<li><tt>"sdl"</tt>: VirtualBox SDL front-end</li>
+ <li><tt>"gui/separate"</tt>: VirtualBox Qt GUI front-end together with
+ a separate headless process</li>
+ <li><tt>"sdl/separate"</tt>: VirtualBox SDL front-end together with
+ a separate headless process</li>
<li><tt>"emergencystop"</tt>: reserved value, used for aborting
the currently running VM or session owner. In this case the
@a session parameter may be @c null (if it is non-null it isn't
diff --git a/src/VBox/Main/include/ApplianceImplPrivate.h b/src/VBox/Main/include/ApplianceImplPrivate.h
index d123192..5d357b2 100644
--- a/src/VBox/Main/include/ApplianceImplPrivate.h
+++ b/src/VBox/Main/include/ApplianceImplPrivate.h
@@ -142,7 +142,7 @@ struct Appliance::TaskOVF
rc(S_OK)
{}
- static int updateProgress(unsigned uPercent, void *pvUser);
+ static DECLCALLBACK(int) updateProgress(unsigned uPercent, void *pvUser);
HRESULT startThread();
diff --git a/src/VBox/Main/include/GuestDnDPrivate.h b/src/VBox/Main/include/GuestDnDPrivate.h
index 229ab47..679f64d 100644
--- a/src/VBox/Main/include/GuestDnDPrivate.h
+++ b/src/VBox/Main/include/GuestDnDPrivate.h
@@ -90,6 +90,48 @@ typedef struct GuestDnDData
} GuestDnDData;
/**
+ * Structure for keeping an URI object's context around.
+ */
+typedef struct GuestDnDURIObjCtx
+{
+ GuestDnDURIObjCtx(void)
+ : pObjURI(NULL)
+ , fAllocated(false)
+ , fHeaderSent(false) { }
+
+ virtual ~GuestDnDURIObjCtx(void)
+ {
+ Reset();
+ }
+
+public:
+
+ void Reset(void)
+ {
+ if ( pObjURI
+ && fAllocated)
+ {
+ delete pObjURI;
+ }
+
+ pObjURI = NULL;
+
+ fAllocated = false;
+ fHeaderSent = false;
+ }
+
+
+ /** Pointer to current object being handled. */
+ DnDURIObject *pObjURI;
+ /** Flag whether pObjURI needs deletion after use. */
+ bool fAllocated;
+ /** Flag whether the object's file header has been sent already. */
+ bool fHeaderSent;
+ /** @todo Add more statistics / information here. */
+
+} GuestDnDURIObjCtx;
+
+/**
* Structure for keeping around URI (list) data.
*/
typedef struct GuestDnDURIData
@@ -106,10 +148,26 @@ typedef struct GuestDnDURIData
Reset();
}
+ int Init(size_t cbBuf = _64K)
+ {
+ Reset();
+
+ pvScratchBuf = RTMemAlloc(cbBuf);
+ if (!pvScratchBuf)
+ return VERR_NO_MEMORY;
+
+ cbScratchBuf = cbBuf;
+ return VINF_SUCCESS;
+ }
+
+ void * GetBufferMutable(void) { return pvScratchBuf; }
+
+ size_t GetBufferSize(void) { return cbScratchBuf; }
+
void Reset(void)
{
lstURI.Clear();
- objURI.Close();
+ objCtx.Reset();
DnDDirDroppedFilesRollback(&mDropDir);
DnDDirDroppedFilesClose(&mDropDir, true /* fRemove */);
@@ -124,10 +182,15 @@ typedef struct GuestDnDURIData
}
DNDDIRDROPPEDFILES mDropDir;
- /** (Non-recursive) List of root URI objects to receive. */
+ /** (Non-recursive) List of URI objects to handle. */
DnDURIList lstURI;
- /** Current object to receive. */
- DnDURIObject objURI;
+ /** Context to current object being handled.
+ * As we currently do all transfers one after another we
+ * only have one context at a time. */
+ GuestDnDURIObjCtx objCtx;
+
+protected:
+
/** Pointer to an optional scratch buffer to use for
* doing the actual chunk transfers. */
void *pvScratchBuf;
diff --git a/src/VBox/Main/include/GuestDnDSourceImpl.h b/src/VBox/Main/include/GuestDnDSourceImpl.h
index c195e20..d516da2 100644
--- a/src/VBox/Main/include/GuestDnDSourceImpl.h
+++ b/src/VBox/Main/include/GuestDnDSourceImpl.h
@@ -66,8 +66,8 @@ protected:
* @{ */
int i_onReceiveData(PRECVDATACTX pCtx, const void *pvData, uint32_t cbData, uint64_t cbTotalSize);
int i_onReceiveDir(PRECVDATACTX pCtx, const char *pszPath, uint32_t cbPath, uint32_t fMode);
- int i_onReceiveFileHdr(PRECVDATACTX pCtx, const char *pszPath, uint32_t cbPath, uint64_t cbSize, uint32_t fMode, uint32_t fFlags);
- int i_onReceiveFileData(PRECVDATACTX pCtx, const void *pvData, uint32_t cbData);
+ int i_onReceiveFileHdr(PRECVDATACTX pCtx, GuestDnDURIObjCtx *pObjCtx, const char *pszPath, uint32_t cbPath, uint64_t cbSize, uint32_t fMode, uint32_t fFlags);
+ int i_onReceiveFileData(PRECVDATACTX pCtx, GuestDnDURIObjCtx *pObjCtx, const void *pvData, uint32_t cbData);
/** @} */
#endif
diff --git a/src/VBox/Main/include/GuestDnDTargetImpl.h b/src/VBox/Main/include/GuestDnDTargetImpl.h
index 2c9889d..12716f9 100644
--- a/src/VBox/Main/include/GuestDnDTargetImpl.h
+++ b/src/VBox/Main/include/GuestDnDTargetImpl.h
@@ -84,9 +84,9 @@ protected:
int i_cancelOperation(void);
int i_sendData(PSENDDATACTX pCtx, RTMSINTERVAL msTimeout);
- int i_sendDirectory(PSENDDATACTX pCtx, GuestDnDMsg *pMsg, DnDURIObject *pObject);
- int i_sendFile(PSENDDATACTX pCtx, GuestDnDMsg *pMsg, DnDURIObject *pObject);
- int i_sendFileData(PSENDDATACTX pCtx, GuestDnDMsg *pMsg, DnDURIObject *pObject);
+ int i_sendDirectory(PSENDDATACTX pCtx, GuestDnDURIObjCtx *pObjCtx, GuestDnDMsg *pMsg);
+ int i_sendFile(PSENDDATACTX pCtx, GuestDnDURIObjCtx *pObjCtx, GuestDnDMsg *pMsg);
+ int i_sendFileData(PSENDDATACTX pCtx, GuestDnDURIObjCtx *pObjCtx, GuestDnDMsg *pMsg);
int i_sendURIData(PSENDDATACTX pCtx, RTMSINTERVAL msTimeout);
int i_sendRawData(PSENDDATACTX pCtx, RTMSINTERVAL msTimeout);
int i_sendURIDataLoop(PSENDDATACTX pCtx, GuestDnDMsg *pMsg);
diff --git a/src/VBox/Main/include/GuestImpl.h b/src/VBox/Main/include/GuestImpl.h
index a3f1ce2..daf4581 100644
--- a/src/VBox/Main/include/GuestImpl.h
+++ b/src/VBox/Main/include/GuestImpl.h
@@ -168,8 +168,9 @@ private:
/** @name Private internal methods.
* @{ */
void i_updateStats(uint64_t iTick);
- static int i_staticEnumStatsCallback(const char *pszName, STAMTYPE enmType, void *pvSample, STAMUNIT enmUnit,
- STAMVISIBILITY enmVisiblity, const char *pszDesc, void *pvUser);
+ static DECLCALLBACK(int) i_staticEnumStatsCallback(const char *pszName, STAMTYPE enmType, void *pvSample,
+ STAMUNIT enmUnit, STAMVISIBILITY enmVisiblity,
+ const char *pszDesc, void *pvUser);
/** @} */
diff --git a/src/VBox/Main/include/GuestSessionImpl.h b/src/VBox/Main/include/GuestSessionImpl.h
index 1f93c06..ffbace7 100644
--- a/src/VBox/Main/include/GuestSessionImpl.h
+++ b/src/VBox/Main/include/GuestSessionImpl.h
@@ -82,7 +82,7 @@ public:
int Run(int *pGuestRc);
int RunAsync(const Utf8Str &strDesc, ComObjPtr<Progress> &pProgress);
- static int taskThread(RTTHREAD Thread, void *pvUser);
+ static DECLCALLBACK(int) taskThread(RTTHREAD Thread, void *pvUser);
protected:
@@ -112,7 +112,7 @@ public:
int Run(void);
int RunAsync(const Utf8Str &strDesc, ComObjPtr<Progress> &pProgress);
- static int taskThread(RTTHREAD Thread, void *pvUser);
+ static DECLCALLBACK(int) taskThread(RTTHREAD Thread, void *pvUser);
protected:
@@ -140,7 +140,7 @@ public:
int Run(void);
int RunAsync(const Utf8Str &strDesc, ComObjPtr<Progress> &pProgress);
- static int taskThread(RTTHREAD Thread, void *pvUser);
+ static DECLCALLBACK(int) taskThread(RTTHREAD Thread, void *pvUser);
protected:
@@ -166,7 +166,7 @@ public:
int Run(void);
int RunAsync(const Utf8Str &strDesc, ComObjPtr<Progress> &pProgress);
- static int taskThread(RTTHREAD Thread, void *pvUser);
+ static DECLCALLBACK(int) taskThread(RTTHREAD Thread, void *pvUser);
protected:
diff --git a/src/VBox/Main/include/PerformanceImpl.h b/src/VBox/Main/include/PerformanceImpl.h
index a4fa26e..269ec05 100644
--- a/src/VBox/Main/include/PerformanceImpl.h
+++ b/src/VBox/Main/include/PerformanceImpl.h
@@ -162,7 +162,7 @@ private:
HRESULT toIPerformanceMetric(pm::Metric *src, ComPtr<IPerformanceMetric> &dst);
HRESULT toIPerformanceMetric(pm::BaseMetric *src, ComPtr<IPerformanceMetric> &dst);
- static void staticSamplerCallback(RTTIMERLR hTimerLR, void *pvUser, uint64_t iTick);
+ static DECLCALLBACK(void) staticSamplerCallback(RTTIMERLR hTimerLR, void *pvUser, uint64_t iTick);
void samplerCallback(uint64_t iTick);
const Utf8Str& getFailedGuestName();
diff --git a/src/VBox/Main/include/USBIdDatabase.h b/src/VBox/Main/include/USBIdDatabase.h
index 55fe11c..301f803 100644
--- a/src/VBox/Main/include/USBIdDatabase.h
+++ b/src/VBox/Main/include/USBIdDatabase.h
@@ -22,7 +22,7 @@
*/
#define USBKEY(vendorId, productId) (((uint32_t)(vendorId) << 16) | (productId))
-/**
+/**
* Elements of Aliases table
*/
class Product
@@ -63,7 +63,7 @@ public:
};
-/**
+/**
* Wrapper for static array of Aliases.
*/
class AliasDictionary
@@ -78,14 +78,14 @@ public:
static const char* findProduct(unsigned short vendorId, unsigned short productId)
{
Product lookFor = { USBKEY(vendorId, productId) };
- Product* it = std::lower_bound(productArray, productArray + products_size + 1, lookFor, ProductLess());
+ Product* it = std::lower_bound(productArray, productArray + products_size, lookFor, ProductLess());
return lookFor.key == it->key ? it->product : NULL;
}
static const char* findVendor(unsigned short vendorID)
{
Vendor lookFor = { vendorID };
- Vendor* it = std::lower_bound(vendorArray, vendorArray + vendors_size + 1, lookFor, VendorLess());
+ Vendor* it = std::lower_bound(vendorArray, vendorArray + vendors_size, lookFor, VendorLess());
return lookFor.vendorID == it->vendorID ? it->vendor : NULL;
}
};
diff --git a/src/VBox/Main/src-all/ExtPackManagerImpl.cpp b/src/VBox/Main/src-all/ExtPackManagerImpl.cpp
index a6f914d..3fdfde6 100644
--- a/src/VBox/Main/src-all/ExtPackManagerImpl.cpp
+++ b/src/VBox/Main/src-all/ExtPackManagerImpl.cpp
@@ -16,9 +16,9 @@
*/
-/*******************************************************************************
-* Header Files *
-*******************************************************************************/
+/*********************************************************************************************************************************
+* Header Files *
+*********************************************************************************************************************************/
#include "ExtPackManagerImpl.h"
#include "ExtPackUtil.h"
@@ -51,9 +51,9 @@
#endif
-/*******************************************************************************
-* Defined Constants And Macros *
-*******************************************************************************/
+/*********************************************************************************************************************************
+* Defined Constants And Macros *
+*********************************************************************************************************************************/
/** @name VBOX_EXTPACK_HELPER_NAME
* The name of the utility application we employ to install and uninstall the
* extension packs. This is a set-uid-to-root binary on unixy platforms, which
@@ -66,9 +66,9 @@
#endif
-/*******************************************************************************
-* Structures and Typedefs *
-*******************************************************************************/
+/*********************************************************************************************************************************
+* Structures and Typedefs *
+*********************************************************************************************************************************/
struct ExtPackBaseData
{
public:
diff --git a/src/VBox/Main/src-all/ExtPackUtil.cpp b/src/VBox/Main/src-all/ExtPackUtil.cpp
index dd1e81f..7065486 100644
--- a/src/VBox/Main/src-all/ExtPackUtil.cpp
+++ b/src/VBox/Main/src-all/ExtPackUtil.cpp
@@ -16,9 +16,9 @@
*/
-/*******************************************************************************
-* Header Files *
-*******************************************************************************/
+/*********************************************************************************************************************************
+* Header Files *
+*********************************************************************************************************************************/
#include "../include/ExtPackUtil.h"
#include <iprt/ctype.h>
diff --git a/src/VBox/Main/src-all/HashedPw.cpp b/src/VBox/Main/src-all/HashedPw.cpp
index 4f2385e..5e6fbb3 100644
--- a/src/VBox/Main/src-all/HashedPw.cpp
+++ b/src/VBox/Main/src-all/HashedPw.cpp
@@ -15,9 +15,10 @@
* hope that it will be useful, but WITHOUT ANY WARRANTY of any kind.
*/
-/*******************************************************************************
-* Header Files *
-*******************************************************************************/
+
+/*********************************************************************************************************************************
+* Header Files *
+*********************************************************************************************************************************/
#include "HashedPw.h"
#include <iprt/assert.h>
@@ -26,9 +27,9 @@
#include <iprt/string.h>
-/*******************************************************************************
-* Global Variables *
-*******************************************************************************/
+/*********************************************************************************************************************************
+* Global Variables *
+*********************************************************************************************************************************/
/**
* The prefix of a hashed password.
*/
diff --git a/src/VBox/Main/src-client/ConsoleImpl.cpp b/src/VBox/Main/src-client/ConsoleImpl.cpp
index 68df1c7..4c35c05 100644
--- a/src/VBox/Main/src-client/ConsoleImpl.cpp
+++ b/src/VBox/Main/src-client/ConsoleImpl.cpp
@@ -4082,6 +4082,10 @@ HRESULT Console::i_onNATRedirectRuleChange(ULONG ulInstance, BOOL aNatRuleRemove
int vrc = PDMR3QueryLun(ptrVM.rawUVM(), pszAdapterName, ulInstance, 0, &pBase);
if (RT_FAILURE(vrc))
{
+ /* This may happen if the NAT network adapter is currently not attached.
+ * This is a valid condition. */
+ if (vrc == VERR_PDM_NO_DRIVER_ATTACHED_TO_LUN)
+ break;
ComAssertRC(vrc);
rc = E_FAIL;
break;
@@ -5858,7 +5862,7 @@ HRESULT Console::i_enumerateGuestProperties(const Utf8Str &aPatterns,
/*
* Internal: helper function for connecting progress reporting
*/
-static int onlineMergeMediumProgress(void *pvUser, unsigned uPercentage)
+static DECLCALLBACK(int) onlineMergeMediumProgress(void *pvUser, unsigned uPercentage)
{
HRESULT rc = S_OK;
IProgress *pProgress = static_cast<IProgress *>(pvUser);
diff --git a/src/VBox/Main/src-client/ConsoleImpl2.cpp b/src/VBox/Main/src-client/ConsoleImpl2.cpp
index 4ed89d0..3498750 100644
--- a/src/VBox/Main/src-client/ConsoleImpl2.cpp
+++ b/src/VBox/Main/src-client/ConsoleImpl2.cpp
@@ -20,9 +20,10 @@
* hope that it will be useful, but WITHOUT ANY WARRANTY of any kind.
*/
-/*******************************************************************************
-* Header Files *
-*******************************************************************************/
+
+/*********************************************************************************************************************************
+* Header Files *
+*********************************************************************************************************************************/
/* For some reason Windows burns in sdk\...\winsock.h if this isn't included first. */
#include "VBox/com/ptr.h"
@@ -122,9 +123,9 @@
#endif
-/*******************************************************************************
-* Internal Functions *
-*******************************************************************************/
+/*********************************************************************************************************************************
+* Internal Functions *
+*********************************************************************************************************************************/
static Utf8Str *GetExtraDataBoth(IVirtualBox *pVirtualBox, IMachine *pMachine, const char *pszName, Utf8Str *pStrValue);
@@ -2971,7 +2972,7 @@ int Console::i_configConstructorInner(PUVM pUVM, PVM pVM, AutoWriteLock *pAlock)
}
else
{
- LogRel(("Shared crOpenGL service loaded\n"));
+ LogRel(("Shared OpenGL service loaded -- 3D enabled\n"));
/* Setup the service. */
VBOXHGCMSVCPARM parm;
diff --git a/src/VBox/Main/src-client/ConsoleImplTeleporter.cpp b/src/VBox/Main/src-client/ConsoleImplTeleporter.cpp
index 988ddd4..3c541d6 100644
--- a/src/VBox/Main/src-client/ConsoleImplTeleporter.cpp
+++ b/src/VBox/Main/src-client/ConsoleImplTeleporter.cpp
@@ -16,9 +16,9 @@
*/
-/*******************************************************************************
-* Header Files *
-*******************************************************************************/
+/*********************************************************************************************************************************
+* Header Files *
+*********************************************************************************************************************************/
#include "ConsoleImpl.h"
#include "Global.h"
#include "ProgressImpl.h"
@@ -42,9 +42,9 @@
#include "VBox/com/ErrorInfo.h"
-/*******************************************************************************
-* Structures and Typedefs *
-*******************************************************************************/
+/*********************************************************************************************************************************
+* Structures and Typedefs *
+*********************************************************************************************************************************/
/**
* Base class for the teleporter state.
*
@@ -168,9 +168,9 @@ typedef struct TELEPORTERTCPHDR
#define TELEPORTERTCPHDR_MAX_SIZE UINT32_C(0x00fffff8)
-/*******************************************************************************
-* Global Variables *
-*******************************************************************************/
+/*********************************************************************************************************************************
+* Global Variables *
+*********************************************************************************************************************************/
static const char g_szWelcome[] = "VirtualBox-Teleporter-1.0\n";
diff --git a/src/VBox/Main/src-client/DrvAudioVRDE.cpp b/src/VBox/Main/src-client/DrvAudioVRDE.cpp
index 8db82d0..3dc91df 100644
--- a/src/VBox/Main/src-client/DrvAudioVRDE.cpp
+++ b/src/VBox/Main/src-client/DrvAudioVRDE.cpp
@@ -16,9 +16,9 @@
*/
-/*******************************************************************************
-* Header Files *
-*******************************************************************************/
+/*********************************************************************************************************************************
+* Header Files *
+*********************************************************************************************************************************/
#define LOG_GROUP LOG_GROUP_DRV_VRDE_AUDIO
#include <VBox/log.h>
#include "DrvAudioVRDE.h"
@@ -40,9 +40,10 @@
#include <VBox/vmm/cfgm.h>
#include <VBox/err.h>
-/*******************************************************************************
-* Structures and Typedefs *
-*******************************************************************************/
+
+/*********************************************************************************************************************************
+* Structures and Typedefs *
+*********************************************************************************************************************************/
/**
* Audio VRDE driver instance data.
*/
@@ -211,7 +212,7 @@ static DECLCALLBACK(int) drvAudioVRDEPlayOut(PPDMIHOSTAUDIO pInterface, PPDMAUDI
PVRDESTREAMOUT pVRDEStrmOut = (PVRDESTREAMOUT)pHstStrmOut;
AssertPtrReturn(pVRDEStrmOut, VERR_INVALID_POINTER);
- uint32_t live = drvAudioHstOutSamplesLive(pHstStrmOut, NULL /* pcStreamsLive */);
+ uint32_t live = drvAudioHstOutSamplesLive(pHstStrmOut);
uint64_t now = PDMDrvHlpTMGetVirtualTime(pDrv->pDrvIns);
uint64_t ticks = now - pVRDEStrmOut->old_ticks;
uint64_t ticks_per_second = PDMDrvHlpTMGetVirtualFreq(pDrv->pDrvIns);
diff --git a/src/VBox/Main/src-client/GuestCtrlPrivate.cpp b/src/VBox/Main/src-client/GuestCtrlPrivate.cpp
index f84ac8a..a8cce6b 100644
--- a/src/VBox/Main/src-client/GuestCtrlPrivate.cpp
+++ b/src/VBox/Main/src-client/GuestCtrlPrivate.cpp
@@ -15,9 +15,10 @@
* hope that it will be useful, but WITHOUT ANY WARRANTY of any kind.
*/
-/******************************************************************************
- * Header Files *
- ******************************************************************************/
+
+/*********************************************************************************************************************************
+* Header Files *
+*********************************************************************************************************************************/
#ifndef VBOX_WITH_GUEST_CONTROL
# error "VBOX_WITH_GUEST_CONTROL must defined in this file"
#endif
diff --git a/src/VBox/Main/src-client/GuestDirectoryImpl.cpp b/src/VBox/Main/src-client/GuestDirectoryImpl.cpp
index 5964e04..97028fe 100644
--- a/src/VBox/Main/src-client/GuestDirectoryImpl.cpp
+++ b/src/VBox/Main/src-client/GuestDirectoryImpl.cpp
@@ -16,9 +16,9 @@
*/
-/*******************************************************************************
-* Header Files *
-*******************************************************************************/
+/*********************************************************************************************************************************
+* Header Files *
+*********************************************************************************************************************************/
#ifndef VBOX_WITH_GUEST_CONTROL
# error "VBOX_WITH_GUEST_CONTROL must defined in this file"
#endif
diff --git a/src/VBox/Main/src-client/GuestDnDPrivate.cpp b/src/VBox/Main/src-client/GuestDnDPrivate.cpp
index ef08f32..d50da2a 100644
--- a/src/VBox/Main/src-client/GuestDnDPrivate.cpp
+++ b/src/VBox/Main/src-client/GuestDnDPrivate.cpp
@@ -420,7 +420,7 @@ int GuestDnDResponse::onDispatch(uint32_t u32Function, void *pvParms, uint32_t c
AssertReturn(DragAndDropSvc::CB_MAGIC_DND_GH_ACK_PENDING == pCBData->hdr.u32Magic, VERR_INVALID_PARAMETER);
if ( pCBData->cbFormat == 0
- || pCBData->cbFormat > _64K)
+ || pCBData->cbFormat > _64K) /** @todo Make the maximum size configurable? */
{
rc = VERR_INVALID_PARAMETER;
}
diff --git a/src/VBox/Main/src-client/GuestDnDSourceImpl.cpp b/src/VBox/Main/src-client/GuestDnDSourceImpl.cpp
index 59d7210..7088e1d 100644
--- a/src/VBox/Main/src-client/GuestDnDSourceImpl.cpp
+++ b/src/VBox/Main/src-client/GuestDnDSourceImpl.cpp
@@ -16,9 +16,9 @@
*/
-/*******************************************************************************
-* Header Files *
-*******************************************************************************/
+/*********************************************************************************************************************************
+* Header Files *
+*********************************************************************************************************************************/
#include "GuestImpl.h"
#include "GuestDnDSourceImpl.h"
#include "GuestDnDPrivate.h"
@@ -619,10 +619,11 @@ int GuestDnDSource::i_onReceiveDir(PRECVDATACTX pCtx, const char *pszPath, uint3
return rc;
}
-int GuestDnDSource::i_onReceiveFileHdr(PRECVDATACTX pCtx, const char *pszPath, uint32_t cbPath,
+int GuestDnDSource::i_onReceiveFileHdr(PRECVDATACTX pCtx, GuestDnDURIObjCtx *pObjCtx, const char *pszPath, uint32_t cbPath,
uint64_t cbSize, uint32_t fMode, uint32_t fFlags)
{
AssertPtrReturn(pCtx, VERR_INVALID_POINTER);
+ AssertPtrReturn(pObjCtx, VERR_INVALID_POINTER);
AssertPtrReturn(pszPath, VERR_INVALID_POINTER);
AssertReturn(cbPath, VERR_INVALID_PARAMETER);
AssertReturn(fMode, VERR_INVALID_PARAMETER);
@@ -634,17 +635,21 @@ int GuestDnDSource::i_onReceiveFileHdr(PRECVDATACTX pCtx, const char *pszPath, u
do
{
- if ( pCtx->mURI.objURI.IsOpen()
- && !pCtx->mURI.objURI.IsComplete())
+ DnDURIObject *pObj = pObjCtx->pObjURI;
+
+ if ( pObj
+ && pObj->IsOpen()
+ && !pObj->IsComplete())
{
- AssertMsgFailed(("Object '%s' not complete yet\n", pCtx->mURI.objURI.GetDestPath().c_str()));
+ AssertMsgFailed(("Object '%s' not complete yet\n", pObj->GetDestPath().c_str()));
rc = VERR_WRONG_ORDER;
break;
}
- if (pCtx->mURI.objURI.IsOpen()) /* File already opened? */
+ if ( pObj
+ && pObj->IsOpen()) /* File already opened? */
{
- AssertMsgFailed(("Current opened object is '%s', close this first\n", pCtx->mURI.objURI.GetDestPath().c_str()));
+ AssertMsgFailed(("Current opened object is '%s', close this first\n", pObj->GetDestPath().c_str()));
rc = VERR_WRONG_ORDER;
break;
}
@@ -673,29 +678,53 @@ int GuestDnDSource::i_onReceiveFileHdr(PRECVDATACTX pCtx, const char *pszPath, u
LogFunc(("Rebased to: %s\n", pszPathAbs));
- /** @todo Add sparse file support based on fFlags? (Use Open(..., fFlags | SPARSE). */
- rc = pCtx->mURI.objURI.OpenEx(pszPathAbs, DnDURIObject::File, DnDURIObject::Target,
- RTFILE_O_CREATE_REPLACE | RTFILE_O_WRITE | RTFILE_O_DENY_WRITE,
- (fMode & RTFS_UNIX_MASK) | RTFS_UNIX_IRUSR | RTFS_UNIX_IWUSR);
+ if ( pObj
+ && pObjCtx->fAllocated)
+ {
+ delete pObj;
+ pObj = NULL;
+ }
+
+ try
+ {
+ pObj = new DnDURIObject();
+
+ pObjCtx->pObjURI = pObj;
+ pObjCtx->fAllocated = true;
+ }
+ catch (std::bad_alloc &)
+ {
+ rc = VERR_NO_MEMORY;
+ }
+
+ if (RT_SUCCESS(rc))
+ {
+ /** @todo Add sparse file support based on fFlags? (Use Open(..., fFlags | SPARSE). */
+ rc = pObj->OpenEx(pszPathAbs, DnDURIObject::File, DnDURIObject::Target,
+ RTFILE_O_CREATE_REPLACE | RTFILE_O_WRITE | RTFILE_O_DENY_WRITE,
+ (fMode & RTFS_UNIX_MASK) | RTFS_UNIX_IRUSR | RTFS_UNIX_IWUSR);
+ }
+
if (RT_SUCCESS(rc))
{
/* Note: Protocol v1 does not send any file sizes, so always 0. */
if (mDataBase.mProtocolVersion >= 2)
- rc = pCtx->mURI.objURI.SetSize(cbSize);
+ rc = pObj->SetSize(cbSize);
/** @todo Unescpae path before printing. */
LogRel2(("DnD: Transferring guest file to host: %s (%RU64 bytes, mode 0x%x)\n",
- pCtx->mURI.objURI.GetDestPath().c_str(), pCtx->mURI.objURI.GetSize(), pCtx->mURI.objURI.GetMode()));
+ pObj->GetDestPath().c_str(), pObj->GetSize(), pObj->GetMode()));
/** @todo Set progress object title to current file being transferred? */
if (!cbSize) /* 0-byte file? Close again. */
- pCtx->mURI.objURI.Close();
+ pObj->Close();
}
- else
+
+ if (RT_FAILURE(rc))
{
LogRel2(("DnD: Error opening/creating guest file '%s' on host, rc=%Rrc\n",
- pCtx->mURI.objURI.GetDestPath().c_str(), rc));
+ pObj->GetDestPath().c_str(), rc));
break;
}
@@ -705,9 +734,10 @@ int GuestDnDSource::i_onReceiveFileHdr(PRECVDATACTX pCtx, const char *pszPath, u
return rc;
}
-int GuestDnDSource::i_onReceiveFileData(PRECVDATACTX pCtx, const void *pvData, uint32_t cbData)
+int GuestDnDSource::i_onReceiveFileData(PRECVDATACTX pCtx, GuestDnDURIObjCtx *pObjCtx, const void *pvData, uint32_t cbData)
{
AssertPtrReturn(pCtx, VERR_INVALID_POINTER);
+ AssertPtrReturn(pObjCtx, VERR_INVALID_POINTER);
AssertPtrReturn(pvData, VERR_INVALID_POINTER);
AssertReturn(cbData, VERR_INVALID_PARAMETER);
@@ -715,22 +745,29 @@ int GuestDnDSource::i_onReceiveFileData(PRECVDATACTX pCtx, const void *pvData, u
do
{
- if (pCtx->mURI.objURI.IsComplete())
+ DnDURIObject *pObj = pObjCtx->pObjURI;
+ if (!pObj)
+ {
+ rc = VERR_INVALID_PARAMETER;
+ break;
+ }
+
+ if (pObj->IsComplete())
{
- LogFlowFunc(("Warning: Object '%s' already completed\n", pCtx->mURI.objURI.GetDestPath().c_str()));
+ LogFlowFunc(("Warning: Object '%s' already completed\n", pObj->GetDestPath().c_str()));
rc = VERR_WRONG_ORDER;
break;
}
- if (!pCtx->mURI.objURI.IsOpen()) /* File opened on host? */
+ if (!pObj->IsOpen()) /* File opened on host? */
{
- LogFlowFunc(("Warning: Object '%s' not opened\n", pCtx->mURI.objURI.GetDestPath().c_str()));
+ LogFlowFunc(("Warning: Object '%s' not opened\n", pObj->GetDestPath().c_str()));
rc = VERR_WRONG_ORDER;
break;
}
uint32_t cbWritten;
- rc = pCtx->mURI.objURI.Write(pvData, cbData, &cbWritten);
+ rc = pObj->Write(pvData, cbData, &cbWritten);
if (RT_SUCCESS(rc))
{
Assert(cbWritten <= cbData);
@@ -746,20 +783,26 @@ int GuestDnDSource::i_onReceiveFileData(PRECVDATACTX pCtx, const void *pvData, u
if (RT_SUCCESS(rc))
{
- if (pCtx->mURI.objURI.IsComplete())
+ if (pObj->IsComplete())
{
/** @todo Sanitize path. */
- LogRel2(("DnD: File transfer to host complete: %s\n", pCtx->mURI.objURI.GetDestPath().c_str()));
+ LogRel2(("DnD: File transfer to host complete: %s\n", pObj->GetDestPath().c_str()));
rc = VINF_EOF;
- /* Prepare URI object for next use. */
- pCtx->mURI.objURI.Reset();
+ /* Deletion needed? */
+ if (pObjCtx->fAllocated)
+ {
+ delete pObj;
+ pObj = NULL;
+
+ pObjCtx->fAllocated = false;
+ }
}
}
else
{
/** @todo What to do when the host's disk is full? */
- LogRel(("DnD: Error writing guest file to host to '%s': %Rrc\n", pCtx->mURI.objURI.GetDestPath().c_str(), rc));
+ LogRel(("DnD: Error writing guest file to host to '%s': %Rrc\n", pObj->GetDestPath().c_str(), rc));
}
} while (0);
@@ -1179,7 +1222,7 @@ DECLCALLBACK(int) GuestDnDSource::i_receiveURIDataCallback(uint32_t uMsg, void *
AssertReturn(sizeof(DragAndDropSvc::VBOXDNDCBSNDFILEHDRDATA) == cbParms, VERR_INVALID_PARAMETER);
AssertReturn(DragAndDropSvc::CB_MAGIC_DND_GH_SND_FILE_HDR == pCBData->hdr.u32Magic, VERR_INVALID_PARAMETER);
- rc = pThis->i_onReceiveFileHdr(pCtx, pCBData->pszFilePath, pCBData->cbFilePath,
+ rc = pThis->i_onReceiveFileHdr(pCtx, &pCtx->mURI.objCtx, pCBData->pszFilePath, pCBData->cbFilePath,
pCBData->cbSize, pCBData->fMode, pCBData->fFlags);
break;
}
@@ -1199,14 +1242,14 @@ DECLCALLBACK(int) GuestDnDSource::i_receiveURIDataCallback(uint32_t uMsg, void *
* - There was no information whatsoever about the total file size; the old code only
* appended data to the desired file. So just pass 0 as cbSize.
*/
- rc = pThis->i_onReceiveFileHdr(pCtx,
+ rc = pThis->i_onReceiveFileHdr(pCtx, &pCtx->mURI.objCtx,
pCBData->u.v1.pszFilePath, pCBData->u.v1.cbFilePath,
0 /* cbSize */, pCBData->u.v1.fMode, 0 /* fFlags */);
if (RT_SUCCESS(rc))
- rc = pThis->i_onReceiveFileData(pCtx, pCBData->pvData, pCBData->cbData);
+ rc = pThis->i_onReceiveFileData(pCtx, &pCtx->mURI.objCtx, pCBData->pvData, pCBData->cbData);
}
else /* Protocol v2 and up. */
- rc = pThis->i_onReceiveFileData(pCtx, pCBData->pvData, pCBData->cbData);
+ rc = pThis->i_onReceiveFileData(pCtx, &pCtx->mURI.objCtx, pCBData->pvData, pCBData->cbData);
break;
}
case DragAndDropSvc::GUEST_DND_GH_EVT_ERROR:
diff --git a/src/VBox/Main/src-client/GuestDnDTargetImpl.cpp b/src/VBox/Main/src-client/GuestDnDTargetImpl.cpp
index dfe8782..96d63b0 100644
--- a/src/VBox/Main/src-client/GuestDnDTargetImpl.cpp
+++ b/src/VBox/Main/src-client/GuestDnDTargetImpl.cpp
@@ -16,9 +16,9 @@
*/
-/*******************************************************************************
-* Header Files *
-*******************************************************************************/
+/*********************************************************************************************************************************
+* Header Files *
+*********************************************************************************************************************************/
#include "GuestImpl.h"
#include "GuestDnDTargetImpl.h"
#include "ConsoleImpl.h"
@@ -770,18 +770,20 @@ int GuestDnDTarget::i_sendData(PSENDDATACTX pCtx, RTMSINTERVAL msTimeout)
ASMAtomicWriteBool(&pCtx->mIsActive, false);
-#undef DATA_IS_VALID_BREAK
-
LogFlowFuncLeaveRC(rc);
return rc;
}
-int GuestDnDTarget::i_sendDirectory(PSENDDATACTX pCtx, GuestDnDMsg *pMsg, DnDURIObject *pObject)
+int GuestDnDTarget::i_sendDirectory(PSENDDATACTX pCtx, GuestDnDURIObjCtx *pObjCtx, GuestDnDMsg *pMsg)
{
- AssertPtrReturn(pObject, VERR_INVALID_POINTER);
AssertPtrReturn(pCtx, VERR_INVALID_POINTER);
+ AssertPtrReturn(pObjCtx, VERR_INVALID_POINTER);
+ AssertPtrReturn(pMsg, VERR_INVALID_POINTER);
+
+ DnDURIObject *pObj = pObjCtx->pObjURI;
+ AssertPtr(pObj);
- RTCString strPath = pObject->GetDestPath();
+ RTCString strPath = pObj->GetDestPath();
if (strPath.isEmpty())
return VERR_INVALID_PARAMETER;
if (strPath.length() >= RTPATH_MAX) /* Note: Maximum is RTPATH_MAX on guest side. */
@@ -792,41 +794,45 @@ int GuestDnDTarget::i_sendDirectory(PSENDDATACTX pCtx, GuestDnDMsg *pMsg, DnDURI
pMsg->setType(DragAndDropSvc::HOST_DND_HG_SND_DIR);
pMsg->setNextString(strPath.c_str()); /* path */
pMsg->setNextUInt32((uint32_t)(strPath.length() + 1)); /* path length - note: Maximum is RTPATH_MAX on guest side. */
- pMsg->setNextUInt32(pObject->GetMode()); /* mode */
+ pMsg->setNextUInt32(pObj->GetMode()); /* mode */
return VINF_SUCCESS;
}
-int GuestDnDTarget::i_sendFile(PSENDDATACTX pCtx, GuestDnDMsg *pMsg, DnDURIObject *pObject)
+int GuestDnDTarget::i_sendFile(PSENDDATACTX pCtx, GuestDnDURIObjCtx *pObjCtx, GuestDnDMsg *pMsg)
{
- AssertPtrReturn(pObject, VERR_INVALID_POINTER);
AssertPtrReturn(pCtx, VERR_INVALID_POINTER);
+ AssertPtrReturn(pObjCtx, VERR_INVALID_POINTER);
+ AssertPtrReturn(pMsg, VERR_INVALID_POINTER);
+
+ DnDURIObject *pObj = pObjCtx->pObjURI;
+ AssertPtr(pObj);
- RTCString strPathSrc = pObject->GetSourcePath();
+ RTCString strPathSrc = pObj->GetSourcePath();
if (strPathSrc.isEmpty())
return VERR_INVALID_PARAMETER;
int rc = VINF_SUCCESS;
- LogFlowFunc(("Sending \"%s\" (%RU32 bytes buffer) using protocol v%RU32 ...\n",
- strPathSrc.c_str(), mData.mcbBlockSize, mDataBase.mProtocolVersion));
+ LogFlowFunc(("Sending file with %RU32 bytes buffer, using protocol v%RU32 ...\n",
+ mData.mcbBlockSize, mDataBase.mProtocolVersion));
+ LogFlowFunc(("strPathSrc=%s, fIsOpen=%RTbool, cbSize=%RU64\n", strPathSrc.c_str(), pObj->IsOpen(), pObj->GetSize()));
- bool fOpen = pObject->IsOpen();
- if (!fOpen)
+ if (!pObj->IsOpen())
{
- LogFlowFunc(("Opening \"%s\" ...\n", strPathSrc.c_str()));
- rc = pObject->OpenEx(strPathSrc, DnDURIObject::File, DnDURIObject::Source,
+ LogRel2(("DnD: Opening host file for transferring to guest: %s\n", strPathSrc.c_str()));
+ rc = pObj->OpenEx(strPathSrc, DnDURIObject::File, DnDURIObject::Source,
RTFILE_O_OPEN | RTFILE_O_READ | RTFILE_O_DENY_WRITE, 0 /* fFlags */);
if (RT_FAILURE(rc))
- LogRel(("DnD: Error opening host file \"%s\", rc=%Rrc\n", strPathSrc.c_str(), rc));
+ LogRel(("DnD: Error opening host file '%s', rc=%Rrc\n", strPathSrc.c_str(), rc));
}
- bool fSendFileData = false;
+ bool fSendData = false;
if (RT_SUCCESS(rc))
{
if (mDataBase.mProtocolVersion >= 2)
{
- if (!fOpen)
+ if (!pObjCtx->fHeaderSent)
{
/*
* Since protocol v2 the file header and the actual file contents are
@@ -834,61 +840,59 @@ int GuestDnDTarget::i_sendFile(PSENDDATACTX pCtx, GuestDnDMsg *pMsg, DnDURIObjec
* The just registered callback will be called by the guest afterwards.
*/
pMsg->setType(DragAndDropSvc::HOST_DND_HG_SND_FILE_HDR);
- pMsg->setNextUInt32(0); /* context ID */
- rc = pMsg->setNextString(pObject->GetDestPath().c_str()); /* pvName */
+ pMsg->setNextUInt32(0); /* uContextID */
+ rc = pMsg->setNextString(pObj->GetDestPath().c_str()); /* pvName */
AssertRC(rc);
- pMsg->setNextUInt32((uint32_t)(pObject->GetDestPath().length() + 1)); /* cbName */
+ pMsg->setNextUInt32((uint32_t)(pObj->GetDestPath().length() + 1)); /* cbName */
pMsg->setNextUInt32(0); /* uFlags */
- pMsg->setNextUInt32(pObject->GetMode()); /* fMode */
- pMsg->setNextUInt64(pObject->GetSize()); /* uSize */
+ pMsg->setNextUInt32(pObj->GetMode()); /* fMode */
+ pMsg->setNextUInt64(pObj->GetSize()); /* uSize */
LogFlowFunc(("Sending file header ...\n"));
LogRel2(("DnD: Transferring host file to guest: %s (%RU64 bytes, mode 0x%x)\n",
- strPathSrc.c_str(), pObject->GetSize(), pObject->GetMode()));
+ strPathSrc.c_str(), pObj->GetSize(), pObj->GetMode()));
/** @todo Set progress object title to current file being transferred? */
+
+ pObjCtx->fHeaderSent = true;
}
else
{
/* File header was sent, so only send the actual file data. */
- fSendFileData = true;
+ fSendData = true;
}
}
else /* Protocol v1. */
{
/* Always send the file data, every time. */
- fSendFileData = true;
+ fSendData = true;
}
}
if ( RT_SUCCESS(rc)
- && fSendFileData)
+ && fSendData)
{
- rc = i_sendFileData(pCtx, pMsg, pObject);
+ rc = i_sendFileData(pCtx, pObjCtx, pMsg);
}
LogFlowFuncLeaveRC(rc);
return rc;
}
-int GuestDnDTarget::i_sendFileData(PSENDDATACTX pCtx, GuestDnDMsg *pMsg, DnDURIObject *pObject)
+int GuestDnDTarget::i_sendFileData(PSENDDATACTX pCtx, GuestDnDURIObjCtx *pObjCtx, GuestDnDMsg *pMsg)
{
- AssertPtrReturn(pObject, VERR_INVALID_POINTER);
AssertPtrReturn(pCtx, VERR_INVALID_POINTER);
+ AssertPtrReturn(pObjCtx, VERR_INVALID_POINTER);
AssertPtrReturn(pMsg, VERR_INVALID_POINTER);
+ DnDURIObject *pObj = pObjCtx->pObjURI;
+ AssertPtr(pObj);
+
GuestDnDResponse *pResp = pCtx->mpResp;
AssertPtr(pResp);
/** @todo Don't allow concurrent reads per context! */
- /* Something to transfer? */
- if ( pCtx->mURI.lstURI.IsEmpty()
- || !pCtx->mIsActive)
- {
- return VERR_WRONG_ORDER;
- }
-
/*
* Start sending stuff.
*/
@@ -900,39 +904,44 @@ int GuestDnDTarget::i_sendFileData(PSENDDATACTX pCtx, GuestDnDMsg *pMsg, DnDURIO
* In protocol version 2 we only do this once with HOST_DND_HG_SND_FILE_HDR. */
if (mDataBase.mProtocolVersion <= 1)
{
- pMsg->setNextString(pObject->GetDestPath().c_str()); /* pvName */
- pMsg->setNextUInt32((uint32_t)(pObject->GetDestPath().length() + 1)); /* cbName */
+ pMsg->setNextString(pObj->GetDestPath().c_str()); /* pvName */
+ pMsg->setNextUInt32((uint32_t)(pObj->GetDestPath().length() + 1)); /* cbName */
}
else
{
/* Protocol version 2 also sends the context ID. Currently unused. */
- pMsg->setNextUInt32(0); /* context ID */
+ pMsg->setNextUInt32(0); /* context ID */
}
uint32_t cbRead = 0;
- int rc = pObject->Read(pCtx->mURI.pvScratchBuf, pCtx->mURI.cbScratchBuf, &cbRead);
+ int rc = pObj->Read(pCtx->mURI.GetBufferMutable(), pCtx->mURI.GetBufferSize(), &cbRead);
if (RT_SUCCESS(rc))
{
pCtx->mData.cbProcessed += cbRead;
+ LogFlowFunc(("cbBufSize=%zu, cbRead=%RU32, cbProcessed=%RU64, rc=%Rrc\n",
+ pCtx->mURI.GetBufferSize(), cbRead, pCtx->mData.cbProcessed, rc));
if (mDataBase.mProtocolVersion <= 1)
{
- pMsg->setNextPointer(pCtx->mURI.pvScratchBuf, cbRead); /* pvData */
- pMsg->setNextUInt32(cbRead); /* cbData */
- pMsg->setNextUInt32(pObject->GetMode()); /* fMode */
+ pMsg->setNextPointer(pCtx->mURI.GetBufferMutable(), cbRead); /* pvData */
+ pMsg->setNextUInt32(cbRead); /* cbData */
+ pMsg->setNextUInt32(pObj->GetMode()); /* fMode */
}
else
{
- pMsg->setNextPointer(pCtx->mURI.pvScratchBuf, cbRead); /* pvData */
- pMsg->setNextUInt32(cbRead); /* cbData */
+ pMsg->setNextPointer(pCtx->mURI.GetBufferMutable(), cbRead); /* pvData */
+ pMsg->setNextUInt32(cbRead); /* cbData */
}
- if (pObject->IsComplete()) /* Done reading? */
+ if (pObj->IsComplete()) /* Done reading? */
{
- LogRel2(("DnD: File transfer to guest complete: %s\n", pObject->GetSourcePath().c_str()));
- LogFlowFunc(("File \"%s\" complete\n", pObject->GetSourcePath().c_str()));
- rc = VINF_EOF;
+ LogRel2(("DnD: File transfer to guest complete: %s\n", pObj->GetSourcePath().c_str()));
+ LogFlowFunc(("File '%s' complete\n", pObj->GetSourcePath().c_str()));
+
+ /* DnDURIObject::Read() returns VINF_EOF when finished reading the entire fire,
+ * but we don't want this here -- so just override this with VINF_SUCCESS. */
+ rc = VINF_SUCCESS;
}
}
@@ -951,9 +960,8 @@ DECLCALLBACK(int) GuestDnDTarget::i_sendURIDataCallback(uint32_t uMsg, void *pvP
LogFlowFunc(("pThis=%p, uMsg=%RU32\n", pThis, uMsg));
- int rc = VINF_SUCCESS; /* Will be reported back to guest. */
-
- int rcCallback = VINF_SUCCESS; /* rc for the callback. */
+ int rc = VINF_SUCCESS; /* Will be reported back to guest. */
+ int rcGuest = VINF_SUCCESS; /* Contains error code from guest in case of VERR_GSTDND_GUEST_ERROR. */
bool fNotify = false;
switch (uMsg)
@@ -970,7 +978,11 @@ DECLCALLBACK(int) GuestDnDTarget::i_sendURIDataCallback(uint32_t uMsg, void *pvP
GuestDnDMsg *pMsg = new GuestDnDMsg();
rc = pThis->i_sendURIDataLoop(pCtx, pMsg);
- if (RT_SUCCESS(rc))
+ if (rc == VINF_EOF) /* Transfer complete? */
+ {
+ LogFlowFunc(("Last URI item processed, bailing out\n"));
+ }
+ else if (RT_SUCCESS(rc))
{
rc = pThis->msgQueueAdd(pMsg);
if (RT_SUCCESS(rc)) /* Return message type & required parameter count to the guest. */
@@ -981,8 +993,12 @@ DECLCALLBACK(int) GuestDnDTarget::i_sendURIDataCallback(uint32_t uMsg, void *pvP
}
}
- if (RT_FAILURE(rc))
+ if ( RT_FAILURE(rc)
+ || rc == VINF_EOF) /* Transfer complete? */
+ {
delete pMsg;
+ pMsg = NULL;
+ }
}
catch(std::bad_alloc & /*e*/)
{
@@ -1000,12 +1016,18 @@ DECLCALLBACK(int) GuestDnDTarget::i_sendURIDataCallback(uint32_t uMsg, void *pvP
pCtx->mpResp->reset();
if (RT_SUCCESS(pCBData->rc))
+ {
+ AssertMsgFailed(("Guest has sent an error event but did not specify an actual error code\n"));
pCBData->rc = VERR_GENERAL_FAILURE; /* Make sure some error is set. */
+ }
rc = pCtx->mpResp->setProgress(100, DragAndDropSvc::DND_PROGRESS_ERROR, pCBData->rc,
GuestDnDTarget::i_guestErrorToString(pCBData->rc));
if (RT_SUCCESS(rc))
- rcCallback = VERR_GSTDND_GUEST_ERROR;
+ {
+ rc = VERR_GSTDND_GUEST_ERROR;
+ rcGuest = pCBData->rc;
+ }
break;
}
case DragAndDropSvc::HOST_DND_HG_SND_DIR:
@@ -1060,47 +1082,70 @@ DECLCALLBACK(int) GuestDnDTarget::i_sendURIDataCallback(uint32_t uMsg, void *pvP
break;
}
- if ( RT_FAILURE(rc)
- || RT_FAILURE(rcCallback))
- {
- fNotify = true;
- if (RT_SUCCESS(rcCallback))
- rcCallback = rc;
- }
+ int rcToGuest = VINF_SUCCESS; /* Status which will be sent back to the guest. */
- if (RT_FAILURE(rc))
+ /*
+ * Resolve errors.
+ */
+ switch (rc)
{
- switch (rc)
+ case VINF_SUCCESS:
+ break;
+
+ case VINF_EOF:
+ {
+ LogRel2(("DnD: Transfer to guest complete\n"));
+
+ /* Complete operation on host side. */
+ fNotify = true;
+
+ /* The guest expects VERR_NO_DATA if the transfer is complete. */
+ rcToGuest = VERR_NO_DATA;
+ break;
+ }
+
+ case VERR_GSTDND_GUEST_ERROR:
{
- case VERR_NO_DATA:
- LogRel2(("DnD: Transfer to guest complete\n"));
- break;
+ LogRel(("DnD: Guest reported error %Rrc, aborting transfer to guest\n", rcGuest));
+ break;
+ }
- case VERR_CANCELLED:
- LogRel2(("DnD: Transfer to guest canceled\n"));
- break;
+ case VERR_CANCELLED:
+ {
+ LogRel2(("DnD: Transfer to guest canceled\n"));
+ rcToGuest = VERR_CANCELLED; /* Also cancel on guest side. */
+ break;
+ }
- default:
- LogRel(("DnD: Error %Rrc occurred, aborting transfer to guest\n", rc));
- break;
+ default:
+ {
+ LogRel(("DnD: Host error %Rrc occurred, aborting transfer to guest\n", rc));
+ rcToGuest = VERR_CANCELLED; /* Also cancel on guest side. */
+ break;
}
+ }
+ if (RT_FAILURE(rc))
+ {
/* Unregister this callback. */
AssertPtr(pCtx->mpResp);
int rc2 = pCtx->mpResp->setCallback(uMsg, NULL /* PFNGUESTDNDCALLBACK */);
AssertRC(rc2);
+
+ /* Let the waiter(s) know. */
+ fNotify = true;
}
- LogFlowFunc(("fNotify=%RTbool, rcCallback=%Rrc, rc=%Rrc\n", fNotify, rcCallback, rc));
+ LogFlowFunc(("fNotify=%RTbool, rc=%Rrc, rcToGuest=%Rrc\n", fNotify, rc, rcToGuest));
if (fNotify)
{
- int rc2 = pCtx->mCallback.Notify(rcCallback);
+ int rc2 = pCtx->mCallback.Notify(rc); /** @todo Also pass guest error back? */
AssertRC(rc2);
}
LogFlowFuncLeaveRC(rc);
- return rc; /* Tell the guest. */
+ return rcToGuest; /* Tell the guest. */
}
int GuestDnDTarget::i_sendURIData(PSENDDATACTX pCtx, RTMSINTERVAL msTimeout)
@@ -1116,12 +1161,6 @@ int GuestDnDTarget::i_sendURIData(PSENDDATACTX pCtx, RTMSINTERVAL msTimeout)
break; \
}
- void *pvBuf = RTMemAlloc(mData.mcbBlockSize);
- if (!pvBuf)
- return VERR_NO_MEMORY;
-
- int rc;
-
#define REGISTER_CALLBACK(x) \
rc = pCtx->mpResp->setCallback(x, i_sendURIDataCallback, pCtx); \
if (RT_FAILURE(rc)) \
@@ -1133,6 +1172,10 @@ int GuestDnDTarget::i_sendURIData(PSENDDATACTX pCtx, RTMSINTERVAL msTimeout)
AssertRC(rc2); \
}
+ int rc = pCtx->mURI.Init(mData.mcbBlockSize);
+ if (RT_FAILURE(rc))
+ return rc;
+
rc = pCtx->mCallback.Reset();
if (RT_FAILURE(rc))
return rc;
@@ -1152,12 +1195,6 @@ int GuestDnDTarget::i_sendURIData(PSENDDATACTX pCtx, RTMSINTERVAL msTimeout)
do
{
/*
- * Set our scratch buffer.
- */
- pCtx->mURI.pvScratchBuf = pvBuf;
- pCtx->mURI.cbScratchBuf = mData.mcbBlockSize;
-
- /*
* Extract URI list from byte data.
*/
DnDURIList &lstURI = pCtx->mURI.lstURI; /* Use the URI list from the context. */
@@ -1171,7 +1208,9 @@ int GuestDnDTarget::i_sendURIData(PSENDDATACTX pCtx, RTMSINTERVAL msTimeout)
RTCList<RTCString> lstURIOrg = RTCString(pszList, cbList).split("\r\n");
URI_DATA_IS_VALID_BREAK(!lstURIOrg.isEmpty());
- rc = lstURI.AppendURIPathsFromList(lstURIOrg, 0 /* fFlags */);
+ /* Note: All files to be transferred will be kept open during the entire DnD
+ * operation, also to keep the accounting right. */
+ rc = lstURI.AppendURIPathsFromList(lstURIOrg, DNDURILIST_FLAGS_KEEP_OPEN);
if (RT_SUCCESS(rc))
LogFlowFunc(("URI root objects: %zu, total bytes (raw data to transfer): %zu\n",
lstURI.RootCount(), lstURI.TotalBytes()));
@@ -1243,10 +1282,6 @@ int GuestDnDTarget::i_sendURIData(PSENDDATACTX pCtx, RTMSINTERVAL msTimeout)
AssertRC(rc2);
}
- /* Destroy temporary scratch buffer. */
- if (pvBuf)
- RTMemFree(pvBuf);
-
#undef URI_DATA_IS_VALID_BREAK
LogFlowFuncLeaveRC(rc);
@@ -1259,8 +1294,6 @@ int GuestDnDTarget::i_sendURIDataLoop(PSENDDATACTX pCtx, GuestDnDMsg *pMsg)
DnDURIList &lstURI = pCtx->mURI.lstURI;
- int rc;
-
uint64_t cbTotal = pCtx->mData.cbToProcess;
uint8_t uPercent = pCtx->mData.cbProcessed * 100 / (cbTotal ? cbTotal : 1);
@@ -1278,27 +1311,31 @@ int GuestDnDTarget::i_sendURIDataLoop(PSENDDATACTX pCtx, GuestDnDMsg *pMsg)
}
if (fComplete)
- {
- LogFlowFunc(("Last URI item processed, bailing out\n"));
- return VERR_NO_DATA;
- }
+ return VINF_EOF;
Assert(!lstURI.IsEmpty());
DnDURIObject *pCurObj = lstURI.First();
+ /* As we transfer all objects one after another at a time at the moment,
+ * we only need one object context at the moment. */
+ GuestDnDURIObjCtx *pObjCtx = &pCtx->mURI.objCtx;
+
+ /* Assign the pointer of the current object to our context. */
+ pObjCtx->pObjURI = pCurObj;
+
uint32_t fMode = pCurObj->GetMode();
LogFlowFunc(("Processing srcPath=%s, dstPath=%s, fMode=0x%x, cbSize=%RU32, fIsDir=%RTbool, fIsFile=%RTbool\n",
pCurObj->GetSourcePath().c_str(), pCurObj->GetDestPath().c_str(),
fMode, pCurObj->GetSize(),
RTFS_IS_DIRECTORY(fMode), RTFS_IS_FILE(fMode)));
-
+ int rc;
if (RTFS_IS_DIRECTORY(fMode))
{
- rc = i_sendDirectory(pCtx, pMsg, pCurObj);
+ rc = i_sendDirectory(pCtx, pObjCtx, pMsg);
}
else if (RTFS_IS_FILE(fMode))
{
- rc = i_sendFile(pCtx, pMsg, pCurObj);
+ rc = i_sendFile(pCtx, pObjCtx, pMsg);
}
else
{
diff --git a/src/VBox/Main/src-client/GuestFileImpl.cpp b/src/VBox/Main/src-client/GuestFileImpl.cpp
index 1c1fca0..a19d323 100644
--- a/src/VBox/Main/src-client/GuestFileImpl.cpp
+++ b/src/VBox/Main/src-client/GuestFileImpl.cpp
@@ -16,9 +16,9 @@
*/
-/*******************************************************************************
-* Header Files *
-*******************************************************************************/
+/*********************************************************************************************************************************
+* Header Files *
+*********************************************************************************************************************************/
#ifndef VBOX_WITH_GUEST_CONTROL
# error "VBOX_WITH_GUEST_CONTROL must defined in this file"
#endif
diff --git a/src/VBox/Main/src-client/GuestFsObjInfoImpl.cpp b/src/VBox/Main/src-client/GuestFsObjInfoImpl.cpp
index 8112cab..32f01da 100644
--- a/src/VBox/Main/src-client/GuestFsObjInfoImpl.cpp
+++ b/src/VBox/Main/src-client/GuestFsObjInfoImpl.cpp
@@ -16,9 +16,9 @@
*/
-/*******************************************************************************
-* Header Files *
-*******************************************************************************/
+/*********************************************************************************************************************************
+* Header Files *
+*********************************************************************************************************************************/
#ifndef VBOX_WITH_GUEST_CONTROL
# error "VBOX_WITH_GUEST_CONTROL must defined in this file"
#endif
diff --git a/src/VBox/Main/src-client/GuestImpl.cpp b/src/VBox/Main/src-client/GuestImpl.cpp
index 0225040..5670600 100644
--- a/src/VBox/Main/src-client/GuestImpl.cpp
+++ b/src/VBox/Main/src-client/GuestImpl.cpp
@@ -205,8 +205,9 @@ DECLCALLBACK(void) Guest::i_staticUpdateStats(RTTIMERLR hTimerLR, void *pvUser,
}
/* static */
-int Guest::i_staticEnumStatsCallback(const char *pszName, STAMTYPE enmType, void *pvSample, STAMUNIT enmUnit,
- STAMVISIBILITY enmVisiblity, const char *pszDesc, void *pvUser)
+DECLCALLBACK(int) Guest::i_staticEnumStatsCallback(const char *pszName, STAMTYPE enmType, void *pvSample,
+ STAMUNIT enmUnit, STAMVISIBILITY enmVisiblity,
+ const char *pszDesc, void *pvUser)
{
AssertLogRelMsgReturn(enmType == STAMTYPE_COUNTER, ("Unexpected sample type %d ('%s')\n", enmType, pszName), VINF_SUCCESS);
AssertLogRelMsgReturn(enmUnit == STAMUNIT_BYTES, ("Unexpected sample unit %d ('%s')\n", enmUnit, pszName), VINF_SUCCESS);
diff --git a/src/VBox/Main/src-client/GuestProcessImpl.cpp b/src/VBox/Main/src-client/GuestProcessImpl.cpp
index 5408a28..cbc9371 100644
--- a/src/VBox/Main/src-client/GuestProcessImpl.cpp
+++ b/src/VBox/Main/src-client/GuestProcessImpl.cpp
@@ -24,9 +24,10 @@
* - Only keep Read/WriteLocks as short as possible and only when necessary.
*/
-/*******************************************************************************
-* Header Files *
-*******************************************************************************/
+
+/*********************************************************************************************************************************
+* Header Files *
+*********************************************************************************************************************************/
#ifndef VBOX_WITH_GUEST_CONTROL
# error "VBOX_WITH_GUEST_CONTROL must defined in this file"
#endif
diff --git a/src/VBox/Main/src-client/GuestSessionImpl.cpp b/src/VBox/Main/src-client/GuestSessionImpl.cpp
index 3dafeb4..7f9289e 100644
--- a/src/VBox/Main/src-client/GuestSessionImpl.cpp
+++ b/src/VBox/Main/src-client/GuestSessionImpl.cpp
@@ -16,9 +16,9 @@
*/
-/*******************************************************************************
-* Header Files *
-*******************************************************************************/
+/*********************************************************************************************************************************
+* Header Files *
+*********************************************************************************************************************************/
#include "GuestImpl.h"
#ifndef VBOX_WITH_GUEST_CONTROL
# error "VBOX_WITH_GUEST_CONTROL must defined in this file"
diff --git a/src/VBox/Main/src-client/GuestSessionImplTasks.cpp b/src/VBox/Main/src-client/GuestSessionImplTasks.cpp
index ea3e90c..75418d7 100644
--- a/src/VBox/Main/src-client/GuestSessionImplTasks.cpp
+++ b/src/VBox/Main/src-client/GuestSessionImplTasks.cpp
@@ -16,9 +16,9 @@
*/
-/*******************************************************************************
-* Header Files *
-*******************************************************************************/
+/*********************************************************************************************************************************
+* Header Files *
+*********************************************************************************************************************************/
#include "GuestImpl.h"
#ifndef VBOX_WITH_GUEST_CONTROL
# error "VBOX_WITH_GUEST_CONTROL must defined in this file"
@@ -43,9 +43,9 @@
#include <VBox/log.h>
-/*******************************************************************************
-* Defines *
-*******************************************************************************/
+/*********************************************************************************************************************************
+* Defines *
+*********************************************************************************************************************************/
/**
* Update file flags.
@@ -209,7 +209,7 @@ int SessionTaskOpen::RunAsync(const Utf8Str &strDesc, ComObjPtr<Progress> &pProg
}
/* static */
-int SessionTaskOpen::taskThread(RTTHREAD Thread, void *pvUser)
+DECLCALLBACK(int) SessionTaskOpen::taskThread(RTTHREAD Thread, void *pvUser)
{
std::auto_ptr<SessionTaskOpen> task(static_cast<SessionTaskOpen*>(pvUser));
AssertReturn(task.get(), VERR_GENERAL_FAILURE);
@@ -569,7 +569,7 @@ int SessionTaskCopyTo::RunAsync(const Utf8Str &strDesc, ComObjPtr<Progress> &pPr
}
/* static */
-int SessionTaskCopyTo::taskThread(RTTHREAD Thread, void *pvUser)
+DECLCALLBACK(int) SessionTaskCopyTo::taskThread(RTTHREAD Thread, void *pvUser)
{
std::auto_ptr<SessionTaskCopyTo> task(static_cast<SessionTaskCopyTo*>(pvUser));
AssertReturn(task.get(), VERR_GENERAL_FAILURE);
@@ -841,7 +841,7 @@ int SessionTaskCopyFrom::RunAsync(const Utf8Str &strDesc, ComObjPtr<Progress> &p
}
/* static */
-int SessionTaskCopyFrom::taskThread(RTTHREAD Thread, void *pvUser)
+DECLCALLBACK(int) SessionTaskCopyFrom::taskThread(RTTHREAD Thread, void *pvUser)
{
std::auto_ptr<SessionTaskCopyFrom> task(static_cast<SessionTaskCopyFrom*>(pvUser));
AssertReturn(task.get(), VERR_GENERAL_FAILURE);
@@ -1537,7 +1537,7 @@ int SessionTaskUpdateAdditions::RunAsync(const Utf8Str &strDesc, ComObjPtr<Progr
}
/* static */
-int SessionTaskUpdateAdditions::taskThread(RTTHREAD Thread, void *pvUser)
+DECLCALLBACK(int) SessionTaskUpdateAdditions::taskThread(RTTHREAD Thread, void *pvUser)
{
std::auto_ptr<SessionTaskUpdateAdditions> task(static_cast<SessionTaskUpdateAdditions*>(pvUser));
AssertReturn(task.get(), VERR_GENERAL_FAILURE);
diff --git a/src/VBox/Main/src-client/MachineDebuggerImpl.cpp b/src/VBox/Main/src-client/MachineDebuggerImpl.cpp
index 82df83e..d0052a2 100644
--- a/src/VBox/Main/src-client/MachineDebuggerImpl.cpp
+++ b/src/VBox/Main/src-client/MachineDebuggerImpl.cpp
@@ -15,9 +15,10 @@
* hope that it will be useful, but WITHOUT ANY WARRANTY of any kind.
*/
-/*******************************************************************************
-* Header Files *
-*******************************************************************************/
+
+/*********************************************************************************************************************************
+* Header Files *
+*********************************************************************************************************************************/
#include "MachineDebuggerImpl.h"
#include "Global.h"
diff --git a/src/VBox/Main/src-client/Nvram.cpp b/src/VBox/Main/src-client/Nvram.cpp
index bcd0361..1c13d36 100644
--- a/src/VBox/Main/src-client/Nvram.cpp
+++ b/src/VBox/Main/src-client/Nvram.cpp
@@ -15,9 +15,10 @@
* hope that it will be useful, but WITHOUT ANY WARRANTY of any kind.
*/
-/*******************************************************************************
-* Header Files *
-*******************************************************************************/
+
+/*********************************************************************************************************************************
+* Header Files *
+*********************************************************************************************************************************/
#include "Nvram.h"
#include "ConsoleImpl.h"
#include "Global.h"
@@ -39,9 +40,9 @@
#include <iprt/semaphore.h>
-/*******************************************************************************
-* Structures and Typedefs *
-*******************************************************************************/
+/*********************************************************************************************************************************
+* Structures and Typedefs *
+*********************************************************************************************************************************/
typedef struct NVRAM NVRAM;
typedef struct NVRAM *PNVRAM;
@@ -67,9 +68,9 @@ struct NVRAM
};
-/*******************************************************************************
-* Defined Constants And Macros *
-*******************************************************************************/
+/*********************************************************************************************************************************
+* Defined Constants And Macros *
+*********************************************************************************************************************************/
/** The default NVRAM attribute value (non-volatile, boot servier access,
runtime access). */
#define NVRAM_DEFAULT_ATTRIB UINT32_C(0x7)
diff --git a/src/VBox/Main/src-client/UsbCardReader.cpp b/src/VBox/Main/src-client/UsbCardReader.cpp
index 5700757..a9ff2f6 100644
--- a/src/VBox/Main/src-client/UsbCardReader.cpp
+++ b/src/VBox/Main/src-client/UsbCardReader.cpp
@@ -16,9 +16,9 @@
*/
-/*******************************************************************************
-* Header Files *
-*******************************************************************************/
+/*********************************************************************************************************************************
+* Header Files *
+*********************************************************************************************************************************/
#define LOG_GROUP LOG_GROUP_USB_CARDREADER
#include "UsbCardReader.h"
#include "ConsoleImpl.h"
@@ -30,9 +30,9 @@
#include <iprt/req.h>
-/*******************************************************************************
-* Structures and Typedefs *
-*******************************************************************************/
+/*********************************************************************************************************************************
+* Structures and Typedefs *
+*********************************************************************************************************************************/
typedef struct USBCARDREADER USBCARDREADER;
typedef struct USBCARDREADER *PUSBCARDREADER;
@@ -1854,8 +1854,7 @@ int UsbCardReader::SetAttrib(struct USBCARDREADER *pDrv,
pThis->hReqQCardReaderCmd = NIL_RTREQQUEUE;
}
- /** @todo r=bird: why doesn't this set pThis->pUsbCardReader->mpDrv to NULL like
- * everyone else? */
+ pThis->pUsbCardReader->mpDrv = NULL;
pThis->pUsbCardReader = NULL;
LogFlowFuncLeave();
}
diff --git a/src/VBox/Main/src-client/VBoxDriversRegister.cpp b/src/VBox/Main/src-client/VBoxDriversRegister.cpp
index a9a70c2..b8e9190 100644
--- a/src/VBox/Main/src-client/VBoxDriversRegister.cpp
+++ b/src/VBox/Main/src-client/VBoxDriversRegister.cpp
@@ -17,9 +17,9 @@
*/
-/*******************************************************************************
-* Header Files *
-*******************************************************************************/
+/*********************************************************************************************************************************
+* Header Files *
+*********************************************************************************************************************************/
#include "MouseImpl.h"
#include "KeyboardImpl.h"
#include "DisplayImpl.h"
diff --git a/src/VBox/Main/src-client/win/dllmain.cpp b/src/VBox/Main/src-client/win/dllmain.cpp
index 2410e97..0bad180 100644
--- a/src/VBox/Main/src-client/win/dllmain.cpp
+++ b/src/VBox/Main/src-client/win/dllmain.cpp
@@ -16,9 +16,9 @@
*/
-/*******************************************************************************
-* Header Files *
-*******************************************************************************/
+/*********************************************************************************************************************************
+* Header Files *
+*********************************************************************************************************************************/
#include "VBox/com/defs.h"
#include <SessionImpl.h>
@@ -32,9 +32,9 @@
#include <iprt/string.h>
-/*******************************************************************************
-* Global Variables *
-*******************************************************************************/
+/*********************************************************************************************************************************
+* Global Variables *
+*********************************************************************************************************************************/
CComModule _Module;
BEGIN_OBJECT_MAP(ObjectMap)
@@ -74,9 +74,9 @@ static const char * const g_apszTypelibVersions[] =
#endif
-/*******************************************************************************
-* Internal Functions *
-*******************************************************************************/
+/*********************************************************************************************************************************
+* Internal Functions *
+*********************************************************************************************************************************/
#ifdef WITH_MANUAL_CLEANUP
static void removeOldMess(void);
#endif
diff --git a/src/VBox/Main/src-helper-apps/VBoxExtPackHelperApp.cpp b/src/VBox/Main/src-helper-apps/VBoxExtPackHelperApp.cpp
index a3be343..ba454b8 100644
--- a/src/VBox/Main/src-helper-apps/VBoxExtPackHelperApp.cpp
+++ b/src/VBox/Main/src-helper-apps/VBoxExtPackHelperApp.cpp
@@ -16,9 +16,9 @@
*/
-/*******************************************************************************
-* Header Files *
-*******************************************************************************/
+/*********************************************************************************************************************************
+* Header Files *
+*********************************************************************************************************************************/
#include "../include/ExtPackUtil.h"
#include <iprt/buildconfig.h>
@@ -70,9 +70,9 @@
#endif
-/*******************************************************************************
-* Defined Constants And Macros *
-*******************************************************************************/
+/*********************************************************************************************************************************
+* Defined Constants And Macros *
+*********************************************************************************************************************************/
/** Enable elevation on Windows and Darwin. */
#if !defined(RT_OS_OS2) || defined(DOXYGEN_RUNNING)
# define WITH_ELEVATION
@@ -93,9 +93,9 @@
/** @} */
-/*******************************************************************************
-* Global Variables *
-*******************************************************************************/
+/*********************************************************************************************************************************
+* Global Variables *
+*********************************************************************************************************************************/
#ifdef RT_OS_WINDOWS
static HINSTANCE g_hInstance;
#endif
diff --git a/src/VBox/Main/src-helper-apps/VBoxVolInfo.cpp b/src/VBox/Main/src-helper-apps/VBoxVolInfo.cpp
index ec1c265..a2bb7d8 100644
--- a/src/VBox/Main/src-helper-apps/VBoxVolInfo.cpp
+++ b/src/VBox/Main/src-helper-apps/VBoxVolInfo.cpp
@@ -17,9 +17,9 @@
-/*******************************************************************************
-* Header Files *
-*******************************************************************************/
+/*********************************************************************************************************************************
+* Header Files *
+*********************************************************************************************************************************/
#include <dirent.h>
extern "C"
{
@@ -31,9 +31,10 @@ extern "C"
#include <sys/stat.h>
#include <unistd.h>
-/*******************************************************************************
-* Function Prototypes *
-*******************************************************************************/
+
+/*********************************************************************************************************************************
+* Function Prototypes *
+*********************************************************************************************************************************/
void print_dev_name(dev_t devid);
/*
diff --git a/src/VBox/Main/src-server/ApplianceImpl.cpp b/src/VBox/Main/src-server/ApplianceImpl.cpp
index 5e0c79e..dabb29a 100644
--- a/src/VBox/Main/src-server/ApplianceImpl.cpp
+++ b/src/VBox/Main/src-server/ApplianceImpl.cpp
@@ -1276,7 +1276,7 @@ DECLCALLBACK(int) Appliance::i_taskThreadImportOrExport(RTTHREAD /* aThread */,
}
/* static */
-int Appliance::TaskOVF::updateProgress(unsigned uPercent, void *pvUser)
+DECLCALLBACK(int) Appliance::TaskOVF::updateProgress(unsigned uPercent, void *pvUser)
{
Appliance::TaskOVF* pTask = *(Appliance::TaskOVF**)pvUser;
diff --git a/src/VBox/Main/src-server/ApplianceImplIO.cpp b/src/VBox/Main/src-server/ApplianceImplIO.cpp
index 4776f8d..ed3dd06 100644
--- a/src/VBox/Main/src-server/ApplianceImplIO.cpp
+++ b/src/VBox/Main/src-server/ApplianceImplIO.cpp
@@ -15,9 +15,10 @@
* hope that it will be useful, but WITHOUT ANY WARRANTY of any kind.
*/
-/******************************************************************************
- * Header Files *
- ******************************************************************************/
+
+/*********************************************************************************************************************************
+* Header Files *
+*********************************************************************************************************************************/
#include "ProgressImpl.h"
#include "ApplianceImpl.h"
@@ -39,9 +40,9 @@
#include "Logging.h"
-/******************************************************************************
- * Structures and Typedefs *
- ******************************************************************************/
+/*********************************************************************************************************************************
+* Structures and Typedefs *
+*********************************************************************************************************************************/
typedef struct FILESTORAGEINTERNAL
{
/** File handle. */
@@ -99,9 +100,10 @@ typedef struct SHASTORAGEINTERNAL
// uint64_t waits;
} SHASTORAGEINTERNAL, *PSHASTORAGEINTERNAL;
-/******************************************************************************
- * Defined Constants And Macros *
- ******************************************************************************/
+
+/*********************************************************************************************************************************
+* Defined Constants And Macros *
+*********************************************************************************************************************************/
#define STATUS_WAIT UINT32_C(0)
#define STATUS_WRITE UINT32_C(1)
@@ -117,9 +119,10 @@ typedef struct SHASTORAGEINTERNAL
# define DEBUG_PRINT_FLOW() do {} while (0)
#endif
-/******************************************************************************
- * Internal Functions *
- ******************************************************************************/
+
+/*********************************************************************************************************************************
+* Internal Functions *
+*********************************************************************************************************************************/
/** @name VDINTERFACEIO stubs returning not-implemented.
@@ -190,8 +193,8 @@ static DECLCALLBACK(int) notImpl_FlushSync(void *pvUser, void *pvStorage)
* Internal: RTFile interface
******************************************************************************/
-static int fileOpenCallback(void * /* pvUser */, const char *pszLocation, uint32_t fOpen,
- PFNVDCOMPLETED pfnCompleted, void **ppInt)
+static DECLCALLBACK(int) fileOpenCallback(void * /* pvUser */, const char *pszLocation, uint32_t fOpen,
+ PFNVDCOMPLETED pfnCompleted, void **ppInt)
{
/* Validate input. */
AssertPtrReturn(ppInt, VERR_INVALID_POINTER);
@@ -215,7 +218,7 @@ static int fileOpenCallback(void * /* pvUser */, const char *pszLocation, uint32
return rc;
}
-static int fileCloseCallback(void * /* pvUser */, void *pvStorage)
+static DECLCALLBACK(int) fileCloseCallback(void * /* pvUser */, void *pvStorage)
{
/* Validate input. */
AssertPtrReturn(pvStorage, VERR_INVALID_POINTER);
@@ -232,21 +235,21 @@ static int fileCloseCallback(void * /* pvUser */, void *pvStorage)
return rc;
}
-static int fileDeleteCallback(void * /* pvUser */, const char *pcszFilename)
+static DECLCALLBACK(int) fileDeleteCallback(void * /* pvUser */, const char *pcszFilename)
{
DEBUG_PRINT_FLOW();
return RTFileDelete(pcszFilename);
}
-static int fileMoveCallback(void * /* pvUser */, const char *pcszSrc, const char *pcszDst, unsigned fMove)
+static DECLCALLBACK(int) fileMoveCallback(void * /* pvUser */, const char *pcszSrc, const char *pcszDst, unsigned fMove)
{
DEBUG_PRINT_FLOW();
return RTFileMove(pcszSrc, pcszDst, fMove);
}
-static int fileGetFreeSpaceCallback(void * /* pvUser */, const char *pcszFilename, int64_t *pcbFreeSpace)
+static DECLCALLBACK(int) fileGetFreeSpaceCallback(void * /* pvUser */, const char *pcszFilename, int64_t *pcbFreeSpace)
{
/* Validate input. */
AssertPtrReturn(pcszFilename, VERR_INVALID_POINTER);
@@ -257,7 +260,8 @@ static int fileGetFreeSpaceCallback(void * /* pvUser */, const char *pcszFilenam
return VERR_NOT_IMPLEMENTED;
}
-static int fileGetModificationTimeCallback(void * /* pvUser */, const char *pcszFilename, PRTTIMESPEC pModificationTime)
+static DECLCALLBACK(int) fileGetModificationTimeCallback(void * /* pvUser */, const char *pcszFilename,
+ PRTTIMESPEC pModificationTime)
{
/* Validate input. */
AssertPtrReturn(pcszFilename, VERR_INVALID_POINTER);
@@ -268,7 +272,7 @@ static int fileGetModificationTimeCallback(void * /* pvUser */, const char *pcsz
return VERR_NOT_IMPLEMENTED;
}
-static int fileGetSizeCallback(void * /* pvUser */, void *pvStorage, uint64_t *pcbSize)
+static DECLCALLBACK(int) fileGetSizeCallback(void * /* pvUser */, void *pvStorage, uint64_t *pcbSize)
{
/* Validate input. */
AssertPtrReturn(pvStorage, VERR_INVALID_POINTER);
@@ -280,7 +284,7 @@ static int fileGetSizeCallback(void * /* pvUser */, void *pvStorage, uint64_t *p
return RTFileGetSize(pInt->file, pcbSize);
}
-static int fileSetSizeCallback(void * /* pvUser */, void *pvStorage, uint64_t cbSize)
+static DECLCALLBACK(int) fileSetSizeCallback(void * /* pvUser */, void *pvStorage, uint64_t cbSize)
{
/* Validate input. */
AssertPtrReturn(pvStorage, VERR_INVALID_POINTER);
@@ -292,8 +296,8 @@ static int fileSetSizeCallback(void * /* pvUser */, void *pvStorage, uint64_t cb
return RTFileSetSize(pInt->file, cbSize);
}
-static int fileWriteSyncCallback(void * /* pvUser */, void *pvStorage, uint64_t uOffset,
- const void *pvBuf, size_t cbWrite, size_t *pcbWritten)
+static DECLCALLBACK(int) fileWriteSyncCallback(void * /* pvUser */, void *pvStorage, uint64_t uOffset,
+ const void *pvBuf, size_t cbWrite, size_t *pcbWritten)
{
/* Validate input. */
AssertPtrReturn(pvStorage, VERR_INVALID_POINTER);
@@ -303,8 +307,8 @@ static int fileWriteSyncCallback(void * /* pvUser */, void *pvStorage, uint64_t
return RTFileWriteAt(pInt->file, uOffset, pvBuf, cbWrite, pcbWritten);
}
-static int fileReadSyncCallback(void * /* pvUser */, void *pvStorage, uint64_t uOffset,
- void *pvBuf, size_t cbRead, size_t *pcbRead)
+static DECLCALLBACK(int) fileReadSyncCallback(void * /* pvUser */, void *pvStorage, uint64_t uOffset,
+ void *pvBuf, size_t cbRead, size_t *pcbRead)
{
/* Validate input. */
AssertPtrReturn(pvStorage, VERR_INVALID_POINTER);
@@ -316,7 +320,7 @@ static int fileReadSyncCallback(void * /* pvUser */, void *pvStorage, uint64_t u
return RTFileReadAt(pInt->file, uOffset, pvBuf, cbRead, pcbRead);
}
-static int fileFlushSyncCallback(void * /* pvUser */, void *pvStorage)
+static DECLCALLBACK(int) fileFlushSyncCallback(void * /* pvUser */, void *pvStorage)
{
/* Validate input. */
AssertPtrReturn(pvStorage, VERR_INVALID_POINTER);
@@ -582,7 +586,7 @@ static DECLCALLBACK(int) fssRdOnly_Open(void *pvUser, const char *pszLocation, u
}
/** @interface_method_impl{VDINTERFACEIO,pfnClose} */
-static int fssRdOnly_Close(void *pvUser, void *pvStorage)
+static DECLCALLBACK(int) fssRdOnly_Close(void *pvUser, void *pvStorage)
{
PIOSRDONLYINTERNAL pFile = (PIOSRDONLYINTERNAL)pvStorage;
AssertPtrReturn(pvUser, VERR_INVALID_POINTER);
@@ -1023,8 +1027,8 @@ DECLINLINE(int) shaFlushCurBuf(PSHASTORAGEINTERNAL pInt)
return rc;
}
-static int shaOpenCallback(void *pvUser, const char *pszLocation, uint32_t fOpen,
- PFNVDCOMPLETED pfnCompleted, void **ppInt)
+static DECLCALLBACK(int) shaOpenCallback(void *pvUser, const char *pszLocation, uint32_t fOpen,
+ PFNVDCOMPLETED pfnCompleted, void **ppInt)
{
/* Validate input. */
AssertPtrReturn(pvUser, VERR_INVALID_PARAMETER);
@@ -1133,7 +1137,7 @@ static int shaOpenCallback(void *pvUser, const char *pszLocation, uint32_t fOpen
return rc;
}
-static int shaCloseCallback(void *pvUser, void *pvStorage)
+static DECLCALLBACK(int) shaCloseCallback(void *pvUser, void *pvStorage)
{
/* Validate input. */
AssertPtrReturn(pvUser, VERR_INVALID_POINTER);
@@ -1209,7 +1213,7 @@ static int shaCloseCallback(void *pvUser, void *pvStorage)
return rc;
}
-static int shaDeleteCallback(void *pvUser, const char *pcszFilename)
+static DECLCALLBACK(int) shaDeleteCallback(void *pvUser, const char *pcszFilename)
{
/* Validate input. */
AssertPtrReturn(pvUser, VERR_INVALID_POINTER);
@@ -1223,7 +1227,7 @@ static int shaDeleteCallback(void *pvUser, const char *pcszFilename)
return vdIfIoFileDelete(pIfIo, pcszFilename);
}
-static int shaMoveCallback(void *pvUser, const char *pcszSrc, const char *pcszDst, unsigned fMove)
+static DECLCALLBACK(int) shaMoveCallback(void *pvUser, const char *pcszSrc, const char *pcszDst, unsigned fMove)
{
/* Validate input. */
AssertPtrReturn(pvUser, VERR_INVALID_POINTER);
@@ -1238,7 +1242,7 @@ static int shaMoveCallback(void *pvUser, const char *pcszSrc, const char *pcszDs
return vdIfIoFileMove(pIfIo, pcszSrc, pcszDst, fMove);
}
-static int shaGetFreeSpaceCallback(void *pvUser, const char *pcszFilename, int64_t *pcbFreeSpace)
+static DECLCALLBACK(int) shaGetFreeSpaceCallback(void *pvUser, const char *pcszFilename, int64_t *pcbFreeSpace)
{
/* Validate input. */
AssertPtrReturn(pvUser, VERR_INVALID_POINTER);
@@ -1252,7 +1256,7 @@ static int shaGetFreeSpaceCallback(void *pvUser, const char *pcszFilename, int64
return vdIfIoFileGetFreeSpace(pIfIo, pcszFilename, pcbFreeSpace);
}
-static int shaGetModificationTimeCallback(void *pvUser, const char *pcszFilename, PRTTIMESPEC pModificationTime)
+static DECLCALLBACK(int) shaGetModificationTimeCallback(void *pvUser, const char *pcszFilename, PRTTIMESPEC pModificationTime)
{
/* Validate input. */
AssertPtrReturn(pvUser, VERR_INVALID_POINTER);
@@ -1267,7 +1271,7 @@ static int shaGetModificationTimeCallback(void *pvUser, const char *pcszFilename
}
-static int shaGetSizeCallback(void *pvUser, void *pvStorage, uint64_t *pcbSize)
+static DECLCALLBACK(int) shaGetSizeCallback(void *pvUser, void *pvStorage, uint64_t *pcbSize)
{
/* Validate input. */
AssertPtrReturn(pvUser, VERR_INVALID_POINTER);
@@ -1291,7 +1295,7 @@ static int shaGetSizeCallback(void *pvUser, void *pvStorage, uint64_t *pcbSize)
return VINF_SUCCESS;
}
-static int shaSetSizeCallback(void *pvUser, void *pvStorage, uint64_t cbSize)
+static DECLCALLBACK(int) shaSetSizeCallback(void *pvUser, void *pvStorage, uint64_t cbSize)
{
/* Validate input. */
AssertPtrReturn(pvUser, VERR_INVALID_POINTER);
@@ -1308,8 +1312,8 @@ static int shaSetSizeCallback(void *pvUser, void *pvStorage, uint64_t cbSize)
return vdIfIoFileSetSize(pIfIo, pInt->pvStorage, cbSize);
}
-static int shaWriteSyncCallback(void *pvUser, void *pvStorage, uint64_t uOffset,
- const void *pvBuf, size_t cbWrite, size_t *pcbWritten)
+static DECLCALLBACK(int) shaWriteSyncCallback(void *pvUser, void *pvStorage, uint64_t uOffset,
+ const void *pvBuf, size_t cbWrite, size_t *pcbWritten)
{
/* Validate input. */
AssertPtrReturn(pvUser, VERR_INVALID_POINTER);
@@ -1404,8 +1408,8 @@ static int shaWriteSyncCallback(void *pvUser, void *pvStorage, uint64_t uOffset,
return rc;
}
-static int shaReadSyncCallback(void *pvUser, void *pvStorage, uint64_t uOffset,
- void *pvBuf, size_t cbRead, size_t *pcbRead)
+static DECLCALLBACK(int) shaReadSyncCallback(void *pvUser, void *pvStorage, uint64_t uOffset,
+ void *pvBuf, size_t cbRead, size_t *pcbRead)
{
/* Validate input. */
AssertPtrReturn(pvUser, VERR_INVALID_POINTER);
@@ -1502,7 +1506,7 @@ static int shaReadSyncCallback(void *pvUser, void *pvStorage, uint64_t uOffset,
return rc;
}
-static int shaFlushSyncCallback(void *pvUser, void *pvStorage)
+static DECLCALLBACK(int) shaFlushSyncCallback(void *pvUser, void *pvStorage)
{
/* Validate input. */
AssertPtrReturn(pvUser, VERR_INVALID_POINTER);
diff --git a/src/VBox/Main/src-server/HostDnsService.cpp b/src/VBox/Main/src-server/HostDnsService.cpp
index ab2304b..46992ea 100644
--- a/src/VBox/Main/src-server/HostDnsService.cpp
+++ b/src/VBox/Main/src-server/HostDnsService.cpp
@@ -307,7 +307,7 @@ void HostDnsMonitor::monitorThreadInitializationDone()
}
-int HostDnsMonitor::threadMonitoringRoutine(RTTHREAD, void *pvUser)
+DECLCALLBACK(int) HostDnsMonitor::threadMonitoringRoutine(RTTHREAD, void *pvUser)
{
HostDnsMonitor *pThis = static_cast<HostDnsMonitor *>(pvUser);
return pThis->monitorWorker();
diff --git a/src/VBox/Main/src-server/HostDnsService.h b/src/VBox/Main/src-server/HostDnsService.h
index b78ba17..70da69d 100644
--- a/src/VBox/Main/src-server/HostDnsService.h
+++ b/src/VBox/Main/src-server/HostDnsService.h
@@ -76,7 +76,7 @@ class HostDnsMonitor
private:
HostDnsMonitor(const HostDnsMonitor &);
HostDnsMonitor& operator= (const HostDnsMonitor &);
- static int threadMonitoringRoutine(RTTHREAD, void *);
+ static DECLCALLBACK(int) threadMonitoringRoutine(RTTHREAD, void *);
void pollGlobalExtraData();
protected:
diff --git a/src/VBox/Main/src-server/HostPower.cpp b/src/VBox/Main/src-server/HostPower.cpp
index 4dfae2f..1fc5186 100644
--- a/src/VBox/Main/src-server/HostPower.cpp
+++ b/src/VBox/Main/src-server/HostPower.cpp
@@ -17,9 +17,9 @@
*/
-/*******************************************************************************
-* Header Files *
-*******************************************************************************/
+/*********************************************************************************************************************************
+* Header Files *
+*********************************************************************************************************************************/
#include "HostPower.h"
#include "Logging.h"
diff --git a/src/VBox/Main/src-server/HostUSBDeviceImpl.cpp b/src/VBox/Main/src-server/HostUSBDeviceImpl.cpp
index f4bc0ae..142809a 100644
--- a/src/VBox/Main/src-server/HostUSBDeviceImpl.cpp
+++ b/src/VBox/Main/src-server/HostUSBDeviceImpl.cpp
@@ -348,8 +348,7 @@ com::Utf8Str HostUSBDevice::i_getName()
else
{
name = "<unknown>";
- LogRel(("USB: Unknown USB device detected ( idVendor: 0x%04x, idProduct: 0x%04x ). \
- Please, report the idVendor and idProduct to vbox.org.\n", vendorName, productName));
+ LogRel(("USB: Unknown USB device detected (idVendor: 0x%04x, idProduct: 0x%04x). Please, report the idVendor and idProduct to virtualbox.org.\n", vendorName, productName));
}
}
diff --git a/src/VBox/Main/src-server/MachineImpl.cpp b/src/VBox/Main/src-server/MachineImpl.cpp
index 147e5dd..3d634b7 100644
--- a/src/VBox/Main/src-server/MachineImpl.cpp
+++ b/src/VBox/Main/src-server/MachineImpl.cpp
@@ -10220,6 +10220,7 @@ HRESULT Machine::i_saveHardware(settings::Hardware &data, settings::Debugging *p
if (FAILED(rc)) throw rc;
/* USB Controller (required) */
+ data.usbSettings.llUSBControllers.clear();
for (USBControllerList::const_iterator it = mUSBControllers->begin(); it != mUSBControllers->end(); ++it)
{
ComObjPtr<USBController> ctrl = *it;
diff --git a/src/VBox/Main/src-server/MachineImplCloneVM.cpp b/src/VBox/Main/src-server/MachineImplCloneVM.cpp
index 9681c5b..fcde9ad 100644
--- a/src/VBox/Main/src-server/MachineImplCloneVM.cpp
+++ b/src/VBox/Main/src-server/MachineImplCloneVM.cpp
@@ -84,7 +84,7 @@ struct MachineCloneVMPrivate
"MachineClone");
}
- static int workerThread(RTTHREAD /* Thread */, void *pvUser)
+ static DECLCALLBACK(int) workerThread(RTTHREAD /* Thread */, void *pvUser)
{
MachineCloneVMPrivate *pTask = static_cast<MachineCloneVMPrivate*>(pvUser);
AssertReturn(pTask, VERR_INVALID_POINTER);
@@ -122,7 +122,7 @@ struct MachineCloneVMPrivate
HRESULT createDifferencingMedium(const ComObjPtr<Machine> &pMachine, const ComObjPtr<Medium> &pParent,
const Utf8Str &strSnapshotFolder, RTCList<ComObjPtr<Medium> > &newMedia,
ComObjPtr<Medium> *ppDiff) const;
- static int copyStateFileProgress(unsigned uPercentage, void *pvUser);
+ static DECLCALLBACK(int) copyStateFileProgress(unsigned uPercentage, void *pvUser);
/* Private q and parent pointer */
MachineCloneVM *q_ptr;
@@ -747,7 +747,7 @@ HRESULT MachineCloneVMPrivate::createDifferencingMedium(const ComObjPtr<Machine>
}
/* static */
-int MachineCloneVMPrivate::copyStateFileProgress(unsigned uPercentage, void *pvUser)
+DECLCALLBACK(int) MachineCloneVMPrivate::copyStateFileProgress(unsigned uPercentage, void *pvUser)
{
ComObjPtr<Progress> pProgress = *static_cast< ComObjPtr<Progress>* >(pvUser);
diff --git a/src/VBox/Main/src-server/MediumImpl.cpp b/src/VBox/Main/src-server/MediumImpl.cpp
index 1757a02..e07913d 100644
--- a/src/VBox/Main/src-server/MediumImpl.cpp
+++ b/src/VBox/Main/src-server/MediumImpl.cpp
@@ -248,7 +248,7 @@ public:
HRESULT rc() const { return mRC; }
bool isOk() const { return SUCCEEDED(rc()); }
- static int fntMediumTask(RTTHREAD aThread, void *pvUser);
+ static DECLCALLBACK(int) fntMediumTask(RTTHREAD aThread, void *pvUser);
bool isAsync() { return mThread != NIL_RTTHREAD; }
diff --git a/src/VBox/Main/src-server/PerformanceImpl.cpp b/src/VBox/Main/src-server/PerformanceImpl.cpp
index fb8d221..e527a6c 100644
--- a/src/VBox/Main/src-server/PerformanceImpl.cpp
+++ b/src/VBox/Main/src-server/PerformanceImpl.cpp
@@ -634,8 +634,8 @@ void PerformanceCollector::resumeSampling()
///////////////////////////////////////////////////////////////////////////////
/* static */
-void PerformanceCollector::staticSamplerCallback(RTTIMERLR hTimerLR, void *pvUser,
- uint64_t iTick)
+DECLCALLBACK(void) PerformanceCollector::staticSamplerCallback(RTTIMERLR hTimerLR, void *pvUser,
+ uint64_t iTick)
{
AssertReturnVoid(pvUser != NULL);
PerformanceCollector *collector = static_cast <PerformanceCollector *> (pvUser);
diff --git a/src/VBox/Main/src-server/USBIdDatabaseGenerator.cpp b/src/VBox/Main/src-server/USBIdDatabaseGenerator.cpp
index 2546328..b51d109 100644
--- a/src/VBox/Main/src-server/USBIdDatabaseGenerator.cpp
+++ b/src/VBox/Main/src-server/USBIdDatabaseGenerator.cpp
@@ -18,42 +18,43 @@
#include <string>
#include <iprt/string.h>
+#include <iprt/stream.h>
using namespace std;
const char* header = "/*\n\
-* Copyright(C) 2005 - 2015 Oracle Corporation\n\
-*\n\
-* This file is part of VirtualBox Open Source Edition(OSE), as\n\
-* available from http ://www.virtualbox.org. This file is free software;\n\
-* you can redistribute it and / or modify it under the terms of the GNU\n\
-* General Public License(GPL) as published by the Free Software\n\
-* Foundation, in version 2 as it comes in the \"COPYING\" file of the\n\
-* VirtualBox OSE distribution.VirtualBox OSE is distributed in the\n\
-* hope that it will be useful, but WITHOUT ANY WARRANTY of any kind.\n\
-*\n\
-*/\
-\n\
-\n\
-#include \"USBIdDatabase.h\"\n\
-\n\
-/** USB devices aliases array.\n\
-* Format: VendorId, ProductId, Vendor Name, Product Name\n\
-* The source of the list is http://www.linux-usb.org/usb.ids\n\
-*/\n\
-Product AliasDictionary::productArray[] = { \n";
+ * Copyright(C) 2005 - 2015 Oracle Corporation\n\
+ *\n\
+ * This file is part of VirtualBox Open Source Edition(OSE), as\n\
+ * available from http ://www.virtualbox.org. This file is free software;\n\
+ * you can redistribute it and / or modify it under the terms of the GNU\n\
+ * General Public License(GPL) as published by the Free Software\n\
+ * Foundation, in version 2 as it comes in the \"COPYING\" file of the\n\
+ * VirtualBox OSE distribution.VirtualBox OSE is distributed in the\n\
+ * hope that it will be useful, but WITHOUT ANY WARRANTY of any kind.\n\
+ *\n\
+ */\
+ \n\
+ \n\
+ #include \"USBIdDatabase.h\"\n\
+ \n\
+ /** USB devices aliases array.\n\
+ * Format: VendorId, ProductId, Vendor Name, Product Name\n\
+ * The source of the list is http://www.linux-usb.org/usb.ids\n\
+ */\n\
+ Product AliasDictionary::productArray[] = { \n";
const char* footer = "};\n\
-\n\
-const size_t AliasDictionary::products_size = sizeof(AliasDictionary::productArray) / sizeof(Product); \n";
+ \n\
+ const size_t AliasDictionary::products_size = sizeof(AliasDictionary::productArray) / sizeof(Product); \n";
const char* vendor_header = "\nVendor AliasDictionary::vendorArray[] = { \n";
const char* vendor_footer = "};\n\
\n\
const size_t AliasDictionary::vendors_size = sizeof(AliasDictionary::vendorArray) / sizeof(Vendor);";
-const wchar_t* start_block = L"# interface interface_name <-- two tabs";
-const wchar_t* end_block = L"# List of known device classes, subclasses and protocols";
+const char* start_block = "# interface interface_name <-- two tabs";
+const char* end_block = "# List of known device classes, subclasses and protocols";
#define USBKEY(vendorId, productId) (((vendorId) << 16) | (productId))
@@ -67,7 +68,7 @@ const wchar_t* end_block = L"# List of known device classes, subclasses and prot
struct VendorRecord
{
size_t vendorID;
- wstring vendor;
+ string vendor;
};
struct ProductRecord
@@ -75,7 +76,7 @@ struct ProductRecord
size_t key;
size_t vendorID;
size_t productID;
- wstring product;
+ string product;
};
bool operator < (const ProductRecord& lh, const ProductRecord& rh)
@@ -98,21 +99,16 @@ bool operator == (const VendorRecord& lh, const VendorRecord& rh)
return lh.vendorID == rh.vendorID;
}
-string conv(const wstring& src)
+string conv(const string& src)
{
- string res;
- char* buf = NULL;
-
- if (RTUtf16ToLatin1((PRTUTF16)src.c_str(), &buf) == VINF_SUCCESS)
+ string res = src;
+ for (size_t i = 0; i < res.length(); i++)
{
- size_t len = strlen(buf);
- for (size_t i = 0; i < len; i++)
+ switch (res[i])
{
- if (buf[i] == '"')
- buf[i] = '\'';
+ case '"':
+ case '\\': res.insert(i++, "\\");
}
- res = buf;
- RTStrFree(buf);
}
return res;
}
@@ -125,14 +121,6 @@ ostream& operator <<(ostream& stream, const ProductRecord product)
return stream;
}
-wostream& operator <<(wostream& stream, const ProductRecord product)
-{
- stream << L"{USBKEY(0x" << hex << product.vendorID
- << L", 0x" << product.productID << L"), "
- << L"\"" << product.product.c_str() << L"\" }," << endl;
- return stream;
-}
-
ostream& operator <<(ostream& stream, const VendorRecord vendor)
{
stream << "{0x" << hex << vendor.vendorID
@@ -140,13 +128,6 @@ ostream& operator <<(ostream& stream, const VendorRecord vendor)
return stream;
}
-wostream& operator <<(wostream& stream, const VendorRecord vendor)
-{
- stream << L"{0x" << hex << vendor.vendorID
- << L", \"" << vendor.vendor.c_str() << L"\" }," << endl;
- return stream;
-}
-
namespace State
{
typedef int Value;
@@ -164,17 +145,17 @@ ProductsSet g_products;
VendorsSet g_vendors;
-int ParseAlias(const wstring& src, size_t& id, wstring& desc)
+int ParseAlias(const string& src, size_t& id, string& desc)
{
- int i = 0;
+ unsigned int i = 0;
int idx = 0;
- wstring sin;
+ string sin;
- if (swscanf(src.c_str(), L"%x", &i) != 1)
+ if (sscanf(src.c_str(), "%x", &i) != 1)
return ERROR_IN_PARSE_LINE;
- size_t index = src.find_first_of(L" \t", 1);
- index = src.find_first_not_of(L" \t", index);
+ size_t index = src.find_first_of(" \t", 1);
+ index = src.find_first_not_of(" \t", index);
if (index == string::npos)
return ERROR_IN_PARSE_LINE;
@@ -186,18 +167,36 @@ int ParseAlias(const wstring& src, size_t& id, wstring& desc)
return 0;
}
-bool IsCommentOrEmptyLine(const wstring& str)
+bool IsCommentOrEmptyLine(const string& str)
+{
+ size_t index = str.find_first_not_of(" \t");// skip left spaces
+ return index == string::npos || str[index] == '#';
+}
+
+bool getline(PRTSTREAM instream, string& resString)
{
- size_t index = str.find_first_not_of(L" \t");// skip left spaces
- return index == string::npos || str[index] == L'#';
+ const size_t szBuf = 4096;
+ char buf[szBuf] = { 0 };
+
+ int rc = RTStrmGetLine(instream, buf, szBuf);
+ if (RT_SUCCESS(rc))
+ {
+ resString = buf;
+ return true;
+ }
+ else if (rc != VERR_EOF)
+ {
+ cerr << "Warning: Invalid line in file. Error: " << hex << rc << endl;
+ }
+ return false;
}
-int ParseUsbIds(wifstream& instream)
+int ParseUsbIds(PRTSTREAM instream)
{
State::Value state = State::lookForStartBlock;
- wstring line;
+ string line;
int res = 0;
- VendorRecord vendor = { 0, L"" };
+ VendorRecord vendor = { 0, "" };
while (state != State::finished && getline(instream, line))
{
@@ -227,7 +226,7 @@ int ParseUsbIds(wifstream& instream)
<< line.c_str() << "'" << endl;
return ERROR_WRONG_FILE_FORMAT;
}
- ProductRecord product = { 0, vendor.vendorID, 0, L"" };
+ ProductRecord product = { 0, vendor.vendorID, 0, "" };
if (ParseAlias(line.substr(1), product.productID, product.product) != 0)
{
cerr << "Error in parsing product line: '"
@@ -273,11 +272,12 @@ int main(int argc, char* argv[])
return ERROR_INVALID_ARGUMENTS;
}
ofstream fout;
- wifstream fin;
+ PRTSTREAM fin;
g_products.reserve(20000);
g_vendors.reserve(3500);
char* outName = NULL;
+ int rc = 0;
for (int i = 1; i < argc; i++)
{
if (strcmp(argv[i], "-o") == 0)
@@ -286,12 +286,11 @@ int main(int argc, char* argv[])
continue;
}
- fin.open(argv[i]);
- if (!fin.is_open())
+ if (RT_FAILURE(rc = RTStrmOpen(argv[i], "r", &fin)))
{
cerr << "Format: " << argv[0] <<
" [linux.org usb list file] [custom usb list file] [-o output file]" << endl;
- cerr << "Error: Can not open file '" << argv[i] << "'." << endl;
+ cerr << "Error: Can not open file '" << argv[i] << "'. Error: " << hex << rc << endl;
return ERROR_OPEN_FILE;
}
@@ -300,21 +299,21 @@ int main(int argc, char* argv[])
{
cerr << "Error in parsing USB devices file '" <<
argv[i] << "'" << endl;
- fin.close();
+ RTStrmClose(fin);
return res;
}
- fin.close();
+ RTStrmClose(fin);
}
sort(g_products.begin(), g_products.end());
sort(g_vendors.begin(), g_vendors.end());
// validate that all records are unique
- ProductsSet::iterator it = adjacent_find(g_products.begin(), g_products.end());
- if (it != g_products.end())
+ ProductsSet::iterator ita = adjacent_find(g_products.begin(), g_products.end());
+ if (ita != g_products.end())
{
- cerr << "Error: Duplicate alias detected. " << *it << endl;
- return ERROR_DUPLICATE_ENTRY;
+ cerr << "Warning: Duplicate alias detected. " << *ita << endl;
+ return 0;
}
if (!outName)
@@ -335,16 +334,16 @@ int main(int argc, char* argv[])
}
fout << header;
- for (ProductsSet::iterator it = g_products.begin(); it != g_products.end(); ++it)
+ for (ProductsSet::iterator itp = g_products.begin(); itp != g_products.end(); ++itp)
{
- fout << *it;
+ fout << *itp;
}
fout << footer;
fout << vendor_header;
- for (VendorsSet::iterator it = g_vendors.begin(); it != g_vendors.end(); ++it)
+ for (VendorsSet::iterator itv = g_vendors.begin(); itv != g_vendors.end(); ++itv)
{
- fout << *it;
+ fout << *itv;
}
fout << vendor_footer;
diff --git a/src/VBox/Main/src-server/USBIdDatabaseStub.cpp b/src/VBox/Main/src-server/USBIdDatabaseStub.cpp
index 0423b1e..5010bb5 100644
--- a/src/VBox/Main/src-server/USBIdDatabaseStub.cpp
+++ b/src/VBox/Main/src-server/USBIdDatabaseStub.cpp
@@ -19,8 +19,8 @@
*/
Product AliasDictionary::productArray[] = {0};
-const size_t AliasDictionary::products_size = sizeof(AliasDictionary::productArray) / sizeof(Product);
+const size_t AliasDictionary::products_size = sizeof(AliasDictionary::productArray) / sizeof(Product);
Vendor AliasDictionary::vendorArray[] = {0};
-const size_t AliasDictionary::vendors_size = sizeof(AliasDictionary::vendorArray) / sizeof(Vendor);
\ No newline at end of file
+const size_t AliasDictionary::vendors_size = sizeof(AliasDictionary::vendorArray) / sizeof(Vendor);
diff --git a/src/VBox/Main/src-server/VFSExplorerImpl.cpp b/src/VBox/Main/src-server/VFSExplorerImpl.cpp
index 83cd1bf..3a4a919 100644
--- a/src/VBox/Main/src-server/VFSExplorerImpl.cpp
+++ b/src/VBox/Main/src-server/VFSExplorerImpl.cpp
@@ -166,8 +166,8 @@ struct VFSExplorer::TaskVFSExplorer
~TaskVFSExplorer() {}
int startThread();
- static int taskThread(RTTHREAD aThread, void *pvUser);
- static int uploadProgress(unsigned uPercent, void *pvUser);
+ static DECLCALLBACK(int) taskThread(RTTHREAD aThread, void *pvUser);
+ static DECLCALLBACK(int) uploadProgress(unsigned uPercent, void *pvUser);
TaskType taskType;
VFSExplorer *pVFSExplorer;
@@ -241,7 +241,7 @@ DECLCALLBACK(int) VFSExplorer::TaskVFSExplorer::taskThread(RTTHREAD /* aThread *
}
/* static */
-int VFSExplorer::TaskVFSExplorer::uploadProgress(unsigned uPercent, void *pvUser)
+DECLCALLBACK(int) VFSExplorer::TaskVFSExplorer::uploadProgress(unsigned uPercent, void *pvUser)
{
VFSExplorer::TaskVFSExplorer* pTask = *(VFSExplorer::TaskVFSExplorer**)pvUser;
diff --git a/src/VBox/Main/src-server/VirtualBoxImpl.cpp b/src/VBox/Main/src-server/VirtualBoxImpl.cpp
index f9f9ccc..8178760 100644
--- a/src/VBox/Main/src-server/VirtualBoxImpl.cpp
+++ b/src/VBox/Main/src-server/VirtualBoxImpl.cpp
@@ -1410,7 +1410,7 @@ void sanitiseMachineFilename(Utf8Str &strName)
#ifdef DEBUG
/** Simple unit test/operation examples for sanitiseMachineFilename(). */
-static unsigned testSanitiseMachineFilename(void (*pfnPrintf)(const char *, ...))
+static unsigned testSanitiseMachineFilename(DECLCALLBACKMEMBER(void, pfnPrintf)(const char *, ...))
{
unsigned cErrors = 0;
@@ -3883,7 +3883,7 @@ struct SaveMediaRegistriesDesc
ComObjPtr<VirtualBox> pVirtualBox;
};
-static int fntSaveMediaRegistries(RTTHREAD ThreadSelf, void *pvUser)
+static DECLCALLBACK(int) fntSaveMediaRegistries(RTTHREAD ThreadSelf, void *pvUser)
{
NOREF(ThreadSelf);
SaveMediaRegistriesDesc *pDesc = (SaveMediaRegistriesDesc *)pvUser;
diff --git a/src/VBox/Main/src-server/darwin/NetIf-darwin.cpp b/src/VBox/Main/src-server/darwin/NetIf-darwin.cpp
index 1be1f92..0979f6f 100644
--- a/src/VBox/Main/src-server/darwin/NetIf-darwin.cpp
+++ b/src/VBox/Main/src-server/darwin/NetIf-darwin.cpp
@@ -17,9 +17,9 @@
-/*******************************************************************************
-* Header Files *
-*******************************************************************************/
+/*********************************************************************************************************************************
+* Header Files *
+*********************************************************************************************************************************/
/*
* Deal with conflicts first.
* PVM - BSD mess, that FreeBSD has correct a long time ago.
diff --git a/src/VBox/Main/src-server/darwin/USBProxyServiceDarwin.cpp b/src/VBox/Main/src-server/darwin/USBProxyServiceDarwin.cpp
index 8953a5b..df16a5e 100644
--- a/src/VBox/Main/src-server/darwin/USBProxyServiceDarwin.cpp
+++ b/src/VBox/Main/src-server/darwin/USBProxyServiceDarwin.cpp
@@ -16,9 +16,9 @@
*/
-/*******************************************************************************
-* Header Files *
-*******************************************************************************/
+/*********************************************************************************************************************************
+* Header Files *
+*********************************************************************************************************************************/
#include "USBProxyService.h"
#include "Logging.h"
#include "iokit.h"
diff --git a/src/VBox/Main/src-server/darwin/iokit.cpp b/src/VBox/Main/src-server/darwin/iokit.cpp
index 89672b0..193194b 100644
--- a/src/VBox/Main/src-server/darwin/iokit.cpp
+++ b/src/VBox/Main/src-server/darwin/iokit.cpp
@@ -20,9 +20,9 @@
*/
-/*******************************************************************************
-* Header Files *
-*******************************************************************************/
+/*********************************************************************************************************************************
+* Header Files *
+*********************************************************************************************************************************/
#define LOG_GROUP LOG_GROUP_MAIN
#ifdef STANDALONE_TESTCASE
# define VBOX_WITH_USB
@@ -62,9 +62,9 @@
#endif
-/*******************************************************************************
-* Defined Constants And Macros *
-*******************************************************************************/
+/*********************************************************************************************************************************
+* Defined Constants And Macros *
+*********************************************************************************************************************************/
/** An attempt at catching reference leaks. */
#define MY_CHECK_CREFS(cRefs) do { AssertMsg(cRefs < 25, ("%ld\n", cRefs)); NOREF(cRefs); } while (0)
@@ -76,9 +76,9 @@
#define VBOXUSBDEVICE_CLASS_NAME "org_virtualbox_VBoxUSBDevice"
-/*******************************************************************************
-* Global Variables *
-*******************************************************************************/
+/*********************************************************************************************************************************
+* Global Variables *
+*********************************************************************************************************************************/
/** The IO Master Port. */
static mach_port_t g_MasterPort = NULL;
diff --git a/src/VBox/Main/src-server/freebsd/HostHardwareFreeBSD.cpp b/src/VBox/Main/src-server/freebsd/HostHardwareFreeBSD.cpp
index 0e4f385..6a84156 100644
--- a/src/VBox/Main/src-server/freebsd/HostHardwareFreeBSD.cpp
+++ b/src/VBox/Main/src-server/freebsd/HostHardwareFreeBSD.cpp
@@ -17,9 +17,10 @@
#define LOG_GROUP LOG_GROUP_MAIN
-/*******************************************************************************
-* Header Files *
-*******************************************************************************/
+
+/*********************************************************************************************************************************
+* Header Files *
+*********************************************************************************************************************************/
#include <HostHardwareLinux.h>
@@ -47,9 +48,10 @@
#endif /* RT_OS_FREEBSD */
#include <vector>
-/******************************************************************************
-* Typedefs and Defines *
-******************************************************************************/
+
+/*********************************************************************************************************************************
+* Typedefs and Defines *
+*********************************************************************************************************************************/
static int getDriveInfoFromEnv(const char *pcszVar, DriveInfoList *pList,
bool isDVD, bool *pfSuccess);
diff --git a/src/VBox/Main/src-server/freebsd/NetIf-freebsd.cpp b/src/VBox/Main/src-server/freebsd/NetIf-freebsd.cpp
index 2c0a0ed..5b142f0 100644
--- a/src/VBox/Main/src-server/freebsd/NetIf-freebsd.cpp
+++ b/src/VBox/Main/src-server/freebsd/NetIf-freebsd.cpp
@@ -20,9 +20,10 @@
* to VirtualBox under the MIT license by the author.
*/
-/*******************************************************************************
-* Header Files *
-*******************************************************************************/
+
+/*********************************************************************************************************************************
+* Header Files *
+*********************************************************************************************************************************/
#define LOG_GROUP LOG_GROUP_MAIN
#include <sys/types.h>
diff --git a/src/VBox/Main/src-server/freebsd/USBProxyServiceFreeBSD.cpp b/src/VBox/Main/src-server/freebsd/USBProxyServiceFreeBSD.cpp
index da509e3..8f28482 100644
--- a/src/VBox/Main/src-server/freebsd/USBProxyServiceFreeBSD.cpp
+++ b/src/VBox/Main/src-server/freebsd/USBProxyServiceFreeBSD.cpp
@@ -16,9 +16,9 @@
*/
-/*******************************************************************************
-* Header Files *
-*******************************************************************************/
+/*********************************************************************************************************************************
+* Header Files *
+*********************************************************************************************************************************/
#include "USBProxyService.h"
#include "Logging.h"
@@ -46,14 +46,15 @@
#include <dev/usb/usb.h>
#include <dev/usb/usb_ioctl.h>
-/*******************************************************************************
-* Structures and Typedefs *
-*******************************************************************************/
+/*********************************************************************************************************************************
+* Structures and Typedefs *
+*********************************************************************************************************************************/
-/*******************************************************************************
-* Global Variables *
-*******************************************************************************/
+
+/*********************************************************************************************************************************
+* Global Variables *
+*********************************************************************************************************************************/
/**
* Initialize data members.
diff --git a/src/VBox/Main/src-server/linux/HostHardwareLinux.cpp b/src/VBox/Main/src-server/linux/HostHardwareLinux.cpp
index be52f53..518fea7 100644
--- a/src/VBox/Main/src-server/linux/HostHardwareLinux.cpp
+++ b/src/VBox/Main/src-server/linux/HostHardwareLinux.cpp
@@ -19,9 +19,10 @@
#define LOG_GROUP LOG_GROUP_MAIN
-/*******************************************************************************
-* Header Files *
-*******************************************************************************/
+
+/*********************************************************************************************************************************
+* Header Files *
+*********************************************************************************************************************************/
#include <HostHardwareLinux.h>
#include <vector.h>
@@ -64,9 +65,10 @@
#include <stdlib.h>
#include <sys/types.h>
-/******************************************************************************
-* Global Variables *
-******************************************************************************/
+
+/*********************************************************************************************************************************
+* Global Variables *
+*********************************************************************************************************************************/
#ifdef TESTCASE
static bool testing() { return true; }
@@ -79,9 +81,10 @@ static bool noProbe() { return false; }
static void setNoProbe(bool val) { (void)val; }
#endif
-/******************************************************************************
-* Typedefs and Defines *
-******************************************************************************/
+
+/*********************************************************************************************************************************
+* Typedefs and Defines *
+*********************************************************************************************************************************/
static int getDriveInfoFromEnv(const char *pcszVar, DriveInfoList *pList,
bool isDVD, bool *pfSuccess);
diff --git a/src/VBox/Main/src-server/linux/HostPowerLinux.cpp b/src/VBox/Main/src-server/linux/HostPowerLinux.cpp
index 10ad11c..bd5c314 100644
--- a/src/VBox/Main/src-server/linux/HostPowerLinux.cpp
+++ b/src/VBox/Main/src-server/linux/HostPowerLinux.cpp
@@ -22,16 +22,20 @@
#include <iprt/power.h>
#include <iprt/time.h>
-static bool checkDBusError(DBusError *pError, DBusConnection *pConnection)
+static bool checkDBusError(DBusError *pError, DBusConnection **pConnection)
{
if (dbus_error_is_set(pError))
{
LogRel(("HostPowerServiceLinux: DBus connection Error (%s)\n", pError->message));
dbus_error_free(pError);
- /* Close the socket or whatever underlying the connection. */
- dbus_connection_close(pConnection);
- /* Free in-process resources used for the now-closed connection. */
- dbus_connection_unref(pConnection);
+ if (*pConnection)
+ {
+ /* Close the socket or whatever underlying the connection. */
+ dbus_connection_close(*pConnection);
+ /* Free in-process resources used for the now-closed connection. */
+ dbus_connection_unref(*pConnection);
+ *pConnection = NULL;
+ }
return true;
}
return false;
@@ -58,7 +62,7 @@ HostPowerServiceLinux::HostPowerServiceLinux(VirtualBox *aVirtualBox)
* The session bus allows up to 100000 connections per user as it "is just
* running as the user anyway" (see session.conf.in in the DBus sources). */
mpConnection = dbus_bus_get_private(DBUS_BUS_SYSTEM, &error);
- if (checkDBusError(&error, mpConnection))
+ if (checkDBusError(&error, &mpConnection))
return;
/* We do not want to exit(1) if the connection is broken. */
dbus_connection_set_exit_on_disconnect(mpConnection, FALSE);
@@ -68,7 +72,7 @@ HostPowerServiceLinux::HostPowerServiceLinux(VirtualBox *aVirtualBox)
/* The previous UPower interfaces (2010 - ca 2013). */
dbus_bus_add_match(mpConnection, "type='signal',interface='org.freedesktop.UPower'", &error);
dbus_connection_flush(mpConnection);
- if (checkDBusError(&error, mpConnection))
+ if (checkDBusError(&error, &mpConnection))
return;
/* Create the new worker thread. */
rc = RTThreadCreate(&mThread, HostPowerServiceLinux::powerChangeNotificationThread, this, 0 /* cbStack */,
diff --git a/src/VBox/Main/src-server/linux/NetIf-linux.cpp b/src/VBox/Main/src-server/linux/NetIf-linux.cpp
index 2384cc5..e77a129 100644
--- a/src/VBox/Main/src-server/linux/NetIf-linux.cpp
+++ b/src/VBox/Main/src-server/linux/NetIf-linux.cpp
@@ -17,9 +17,9 @@
-/*******************************************************************************
-* Header Files *
-*******************************************************************************/
+/*********************************************************************************************************************************
+* Header Files *
+*********************************************************************************************************************************/
#define LOG_GROUP LOG_GROUP_MAIN
#include <iprt/err.h>
diff --git a/src/VBox/Main/src-server/linux/USBGetDevices.cpp b/src/VBox/Main/src-server/linux/USBGetDevices.cpp
index a88fcbd..8145ef8 100644
--- a/src/VBox/Main/src-server/linux/USBGetDevices.cpp
+++ b/src/VBox/Main/src-server/linux/USBGetDevices.cpp
@@ -16,9 +16,9 @@
*/
-/*******************************************************************************
-* Header Files *
-*******************************************************************************/
+/*********************************************************************************************************************************
+* Header Files *
+*********************************************************************************************************************************/
#include "USBGetDevices.h"
@@ -57,9 +57,10 @@
#include <string.h>
#include <unistd.h>
-/*******************************************************************************
-* Structures and Typedefs *
-*******************************************************************************/
+
+/*********************************************************************************************************************************
+* Structures and Typedefs *
+*********************************************************************************************************************************/
/** Suffix translation. */
typedef struct USBSUFF
{
@@ -82,9 +83,10 @@ typedef struct USBDeviceInfo
VECTOR_PTR(char *) mvecpszInterfaces;
} USBDeviceInfo;
-/*******************************************************************************
-* Global Variables *
-*******************************************************************************/
+
+/*********************************************************************************************************************************
+* Global Variables *
+*********************************************************************************************************************************/
/**
* Suffixes for the endpoint polling interval.
*/
diff --git a/src/VBox/Main/src-server/linux/USBProxyServiceLinux.cpp b/src/VBox/Main/src-server/linux/USBProxyServiceLinux.cpp
index a613c8a..cdc247d 100644
--- a/src/VBox/Main/src-server/linux/USBProxyServiceLinux.cpp
+++ b/src/VBox/Main/src-server/linux/USBProxyServiceLinux.cpp
@@ -16,9 +16,9 @@
*/
-/*******************************************************************************
-* Header Files *
-*******************************************************************************/
+/*********************************************************************************************************************************
+* Header Files *
+*********************************************************************************************************************************/
#include "USBProxyService.h"
#include "USBGetDevices.h"
#include "Logging.h"
diff --git a/src/VBox/Main/src-server/os2/NetIf-os2.cpp b/src/VBox/Main/src-server/os2/NetIf-os2.cpp
index cac174a..e25ff4e 100644
--- a/src/VBox/Main/src-server/os2/NetIf-os2.cpp
+++ b/src/VBox/Main/src-server/os2/NetIf-os2.cpp
@@ -17,9 +17,9 @@
-/*******************************************************************************
-* Header Files *
-*******************************************************************************/
+/*********************************************************************************************************************************
+* Header Files *
+*********************************************************************************************************************************/
#define LOG_GROUP LOG_GROUP_MAIN
#include <iprt/err.h>
diff --git a/src/VBox/Main/src-server/os2/USBProxyServiceOs2.cpp b/src/VBox/Main/src-server/os2/USBProxyServiceOs2.cpp
index c6284b0..7963a54 100644
--- a/src/VBox/Main/src-server/os2/USBProxyServiceOs2.cpp
+++ b/src/VBox/Main/src-server/os2/USBProxyServiceOs2.cpp
@@ -16,9 +16,9 @@
*/
-/*******************************************************************************
-* Header Files *
-*******************************************************************************/
+/*********************************************************************************************************************************
+* Header Files *
+*********************************************************************************************************************************/
#define INCL_BASE
#define INCL_ERRORS
#include "USBProxyService.h"
diff --git a/src/VBox/Main/src-server/solaris/NetIf-solaris.cpp b/src/VBox/Main/src-server/solaris/NetIf-solaris.cpp
index 78056b1..0eb3f33 100644
--- a/src/VBox/Main/src-server/solaris/NetIf-solaris.cpp
+++ b/src/VBox/Main/src-server/solaris/NetIf-solaris.cpp
@@ -17,9 +17,9 @@
-/*******************************************************************************
-* Header Files *
-*******************************************************************************/
+/*********************************************************************************************************************************
+* Header Files *
+*********************************************************************************************************************************/
#define LOG_GROUP LOG_GROUP_MAIN
#include <iprt/err.h>
diff --git a/src/VBox/Main/src-server/solaris/USBProxyServiceSolaris.cpp b/src/VBox/Main/src-server/solaris/USBProxyServiceSolaris.cpp
index f48ab36..322df8a 100644
--- a/src/VBox/Main/src-server/solaris/USBProxyServiceSolaris.cpp
+++ b/src/VBox/Main/src-server/solaris/USBProxyServiceSolaris.cpp
@@ -16,9 +16,9 @@
*/
-/*******************************************************************************
-* Header Files *
-*******************************************************************************/
+/*********************************************************************************************************************************
+* Header Files *
+*********************************************************************************************************************************/
#include "USBProxyService.h"
#include "Logging.h"
@@ -31,17 +31,18 @@
#include <sys/usb/usba.h>
#include <syslog.h>
-/*******************************************************************************
-* Internal Functions *
-*******************************************************************************/
+
+/*********************************************************************************************************************************
+* Internal Functions *
+*********************************************************************************************************************************/
static int solarisWalkDeviceNode(di_node_t Node, void *pvArg);
static void solarisFreeUSBDevice(PUSBDEVICE pDevice);
static USBDEVICESTATE solarisDetermineUSBDeviceState(PUSBDEVICE pDevice, di_node_t Node);
-/*******************************************************************************
-* Structures and Typedefs *
-*******************************************************************************/
+/*********************************************************************************************************************************
+* Structures and Typedefs *
+*********************************************************************************************************************************/
typedef struct USBDEVICELIST
{
PUSBDEVICE pHead;
diff --git a/src/VBox/Main/src-server/win/HostPowerWin.cpp b/src/VBox/Main/src-server/win/HostPowerWin.cpp
index 1e3e40e..1d2bb9b 100644
--- a/src/VBox/Main/src-server/win/HostPowerWin.cpp
+++ b/src/VBox/Main/src-server/win/HostPowerWin.cpp
@@ -16,9 +16,10 @@
* hope that it will be useful, but WITHOUT ANY WARRANTY of any kind.
*/
-/*******************************************************************************
-* Header Files *
-*******************************************************************************/
+
+/*********************************************************************************************************************************
+* Header Files *
+*********************************************************************************************************************************/
#include <windows.h>
/* Some SDK versions lack the extern "C" and thus cause linking failures.
* This workaround isn't pretty, but there are not many options. */
diff --git a/src/VBox/Main/src-server/win/NetIf-win.cpp b/src/VBox/Main/src-server/win/NetIf-win.cpp
index bf0f964..7b78abf 100644
--- a/src/VBox/Main/src-server/win/NetIf-win.cpp
+++ b/src/VBox/Main/src-server/win/NetIf-win.cpp
@@ -17,11 +17,13 @@
-/*******************************************************************************
-* Header Files *
-*******************************************************************************/
+/*********************************************************************************************************************************
+* Header Files *
+*********************************************************************************************************************************/
#define LOG_GROUP LOG_GROUP_MAIN
+#define NETIF_WITHOUT_NETCFG
+
#include <iprt/asm.h>
#include <iprt/err.h>
#include <list>
@@ -335,7 +337,8 @@ static HRESULT netIfNetworkInterfaceHelperClient(SVCHlpClient *aClient,
vrc = aClient->read(errMsg);
if (RT_FAILURE(vrc)) break;
- rc = E_FAIL;//TODO: setError(E_FAIL, errMsg);
+ rc = E_FAIL;
+ d->iface->setError(E_FAIL, errMsg.c_str());
endLoop = true;
break;
}
@@ -388,7 +391,8 @@ static HRESULT netIfNetworkInterfaceHelperClient(SVCHlpClient *aClient,
vrc = aClient->read(errMsg);
if (RT_FAILURE(vrc)) break;
- rc = E_FAIL; // TODO: setError(E_FAIL, errMsg);
+ rc = E_FAIL;
+ d->iface->setError(E_FAIL, errMsg.c_str());
endLoop = true;
break;
}
@@ -441,7 +445,8 @@ static HRESULT netIfNetworkInterfaceHelperClient(SVCHlpClient *aClient,
vrc = aClient->read(errMsg);
if (RT_FAILURE(vrc)) break;
- rc = E_FAIL; // TODO: setError(E_FAIL, errMsg);
+ rc = E_FAIL;
+ d->iface->setError(E_FAIL, errMsg.c_str());
endLoop = true;
break;
}
@@ -498,7 +503,8 @@ static HRESULT netIfNetworkInterfaceHelperClient(SVCHlpClient *aClient,
vrc = aClient->read(errMsg);
if (RT_FAILURE(vrc)) break;
- rc = E_FAIL; // TODO: setError(E_FAIL, errMsg);
+ rc = E_FAIL;
+ d->iface->setError(E_FAIL, errMsg.c_str());
endLoop = true;
break;
}
@@ -555,7 +561,8 @@ static HRESULT netIfNetworkInterfaceHelperClient(SVCHlpClient *aClient,
vrc = aClient->read(errMsg);
if (RT_FAILURE(vrc)) break;
- rc = E_FAIL; // TODO: setError(E_FAIL, errMsg);
+ rc = E_FAIL;
+ d->iface->setError(E_FAIL, errMsg.c_str());
endLoop = true;
break;
}
@@ -608,7 +615,8 @@ static HRESULT netIfNetworkInterfaceHelperClient(SVCHlpClient *aClient,
vrc = aClient->read(errMsg);
if (RT_FAILURE(vrc)) break;
- rc = E_FAIL; // TODO: setError(E_FAIL, errMsg);
+ rc = E_FAIL;
+ d->iface->setError(E_FAIL, errMsg.c_str());
endLoop = true;
break;
}
@@ -960,27 +968,33 @@ static int vboxNetWinAddComponent(std::list<ComObjPtr<HostNetworkInterface> > *
rc = collectNetIfInfo(name, Guid(IfGuid), &Info, iDefaultInterface);
if (RT_FAILURE(rc))
{
- Log(("vboxNetWinAddComponent: collectNetIfInfo() -> %Rrc\n", rc));
+ LogRel(("vboxNetWinAddComponent: collectNetIfInfo() -> %Rrc\n", rc));
}
+ Log(("vboxNetWinAddComponent: adding %ls\n", lpszName));
/* create a new object and add it to the list */
ComObjPtr<HostNetworkInterface> iface;
iface.createObject();
/* remove the curly bracket at the end */
- if (SUCCEEDED(iface->init(name, enmType, &Info)))
+ rc = iface->init(name, enmType, &Info);
+ if (SUCCEEDED(rc))
{
if (Info.bIsDefault)
pPist->push_front(iface);
else
pPist->push_back(iface);
- rc = VINF_SUCCESS;
}
else
{
+ LogRel(("vboxNetWinAddComponent: HostNetworkInterface::init() -> %Rrc\n", rc));
Assert(0);
}
}
+ else
+ LogRel(("vboxNetWinAddComponent: failed to get device instance GUID (0x%x)\n", hr));
CoTaskMemFree(lpszName);
}
+ else
+ LogRel(("vboxNetWinAddComponent: failed to get device display name (0x%x)\n", hr));
return rc;
}
@@ -988,67 +1002,59 @@ static int vboxNetWinAddComponent(std::list<ComObjPtr<HostNetworkInterface> > *
#endif /* VBOX_WITH_NETFLT */
-static int netIfListHostAdapters(std::list<ComObjPtr<HostNetworkInterface> > &list)
+static int netIfListHostAdapters(INetCfg *pNc, std::list<ComObjPtr<HostNetworkInterface> > &list)
{
#ifndef VBOX_WITH_NETFLT
/* VBoxNetAdp is available only when VBOX_WITH_NETFLT is enabled */
return VERR_NOT_IMPLEMENTED;
#else /* # if defined VBOX_WITH_NETFLT */
- INetCfg *pNc;
INetCfgComponent *pMpNcc;
- LPWSTR lpszApp = NULL;
HRESULT hr;
IEnumNetCfgComponent *pEnumComponent;
- /* we are using the INetCfg API for getting the list of miniports */
- hr = VBoxNetCfgWinQueryINetCfg(&pNc, FALSE,
- VBOX_APP_NAME,
- 10000,
- &lpszApp);
- Assert(hr == S_OK);
+ hr = pNc->EnumComponents(&GUID_DEVCLASS_NET, &pEnumComponent);
if (hr == S_OK)
{
- hr = pNc->EnumComponents(&GUID_DEVCLASS_NET, &pEnumComponent);
- if (hr == S_OK)
+ while ((hr = pEnumComponent->Next(1, &pMpNcc, NULL)) == S_OK)
{
- while ((hr = pEnumComponent->Next(1, &pMpNcc, NULL)) == S_OK)
+ LPWSTR pwszName;
+ ULONG uComponentStatus;
+ hr = pMpNcc->GetDisplayName(&pwszName);
+ if (hr == S_OK)
+ Log(("netIfListHostAdapters: %ls\n", pwszName));
+ else
+ LogRel(("netIfListHostAdapters: failed to get device display name (0x%x)\n", hr));
+ hr = pMpNcc->GetDeviceStatus(&uComponentStatus);
+ if (hr == S_OK)
{
- ULONG uComponentStatus;
- hr = pMpNcc->GetDeviceStatus(&uComponentStatus);
- if (hr == S_OK)
+ if (uComponentStatus == 0)
{
- if (uComponentStatus == 0)
+ LPWSTR pId;
+ hr = pMpNcc->GetId(&pId);
+ Assert(hr == S_OK);
+ if (hr == S_OK)
{
- LPWSTR pId;
- hr = pMpNcc->GetId(&pId);
- Assert(hr == S_OK);
- if (hr == S_OK)
+ Log(("netIfListHostAdapters: id = %ls\n", pId));
+ if (!_wcsnicmp(pId, L"sun_VBoxNetAdp", sizeof(L"sun_VBoxNetAdp")/2))
{
- if (!_wcsnicmp(pId, L"sun_VBoxNetAdp", sizeof(L"sun_VBoxNetAdp")/2))
- {
- vboxNetWinAddComponent(&list, pMpNcc, HostNetworkInterfaceType_HostOnly, -1);
- }
- CoTaskMemFree(pId);
+ vboxNetWinAddComponent(&list, pMpNcc, HostNetworkInterfaceType_HostOnly, -1);
}
+ CoTaskMemFree(pId);
}
+ else
+ LogRel(("netIfListHostAdapters: failed to get device id (0x%x)\n", hr));
}
- pMpNcc->Release();
}
- Assert(hr == S_OK || hr == S_FALSE);
-
- pEnumComponent->Release();
- }
- else
- {
- LogRel((__FUNCTION__": EnumComponents error (0x%x)", hr));
+ else
+ LogRel(("netIfListHostAdapters: failed to get device status (0x%x)\n", hr));
+ pMpNcc->Release();
}
+ Assert(hr == S_OK || hr == S_FALSE);
- VBoxNetCfgWinReleaseINetCfg(pNc, FALSE);
- }
- else if (lpszApp)
- {
- CoTaskMemFree(lpszApp);
+ pEnumComponent->Release();
}
+ else
+ LogRel(("netIfListHostAdapters: EnumComponents error (0x%x)\n", hr));
#endif /* # if defined VBOX_WITH_NETFLT */
return VINF_SUCCESS;
}
@@ -1452,12 +1458,13 @@ int NetIfDhcpRediscover(VirtualBox *vBox, HostNetworkInterface * pIf)
#endif
}
+#ifndef NETIF_WITHOUT_NETCFG
int NetIfList(std::list<ComObjPtr<HostNetworkInterface> > &list)
{
#ifndef VBOX_WITH_NETFLT
return VERR_NOT_IMPLEMENTED;
#else /* # if defined VBOX_WITH_NETFLT */
- INetCfg *pNc;
+ INetCfg *pNc = NULL;
INetCfgComponent *pMpNcc;
INetCfgComponent *pTcpIpNcc;
LPWSTR lpszApp;
@@ -1468,12 +1475,35 @@ int NetIfList(std::list<ComObjPtr<HostNetworkInterface> > &list)
INetCfgBindingInterface *pBi;
int iDefault = getDefaultInterfaceIndex();
+ Log(("NetIfList: building the list of interfaces\n"));
/* we are using the INetCfg API for getting the list of miniports */
hr = VBoxNetCfgWinQueryINetCfg(&pNc, FALSE,
VBOX_APP_NAME,
10000,
&lpszApp);
Assert(hr == S_OK);
+ if (hr != S_OK)
+ {
+ if (pNc)
+ pNc->Release();
+ pNc = NULL;
+ LogRel(("NetIfList: failed to acquire INetCfg interface (0x%x), trying CoCreateInstance...\n", hr));
+ hr = CoCreateInstance(CLSID_CNetCfg, NULL, CLSCTX_INPROC_SERVER, IID_INetCfg, (PVOID*)&pNc);
+ if (SUCCEEDED(hr))
+ {
+ hr = pNc->Initialize(NULL);
+ if (FAILED(hr))
+ {
+ LogRel(("NetIfList: INetCfg::Initialize failed with 0x%x\n", hr));
+ if (pNc)
+ pNc->Release();
+ pNc = NULL;
+ }
+ }
+ else
+ LogRel(("NetIfList: CoCreateInstance failed with 0x%x\n", hr));
+ }
+
if (hr == S_OK)
{
# ifdef VBOX_NETFLT_ONDEMAND_BIND
@@ -1484,6 +1514,7 @@ int NetIfList(std::list<ComObjPtr<HostNetworkInterface> > &list)
hr = pNc->FindComponent(L"oracle_VBoxNetLwf", &pTcpIpNcc);
if (hr != S_OK)
{
+ LogRel(("NetIfList: could not find VBoxNetLwf component (error 0x%x), trying VBoxNetFlt instead\n", hr));
/* fall back to NDIS5 miniport lookup (sun_VBoxNetFlt) */
hr = pNc->FindComponent(L"sun_VBoxNetFlt", &pTcpIpNcc);
}
@@ -1513,6 +1544,7 @@ int NetIfList(std::list<ComObjPtr<HostNetworkInterface> > &list)
{
while ((hr = pEnumBp->Next(1, &pBp, NULL)) == S_OK)
{
+ Log(("NetIfList: fetched INetCfgBindingPath interface\n"));
/* S_OK == enabled, S_FALSE == disabled */
if (pBp->IsEnabled() == S_OK)
{
@@ -1526,11 +1558,18 @@ int NetIfList(std::list<ComObjPtr<HostNetworkInterface> > &list)
{
while ((hr = pEnumBi->Next(1, &pBi, NULL)) == S_OK)
{
+ Log(("NetIfList: fetched INetCfgBindingInterface interface\n"));
hr = pBi->GetLowerComponent(&pMpNcc);
Assert(hr == S_OK);
if (hr == S_OK)
{
+ LPWSTR pwszName;
ULONG uComponentStatus;
+ hr = pMpNcc->GetDisplayName(&pwszName);
+ if (hr == S_OK)
+ Log(("NetIfList: got %ls\n", pwszName));
+ else
+ LogRel(("NetIfList: failed to get device display name (0x%x)\n", hr));
hr = pMpNcc->GetDeviceStatus(&uComponentStatus);
if (hr == S_OK)
{
@@ -1541,6 +1580,7 @@ int NetIfList(std::list<ComObjPtr<HostNetworkInterface> > &list)
Assert(hr == S_OK);
if (hr == S_OK)
{
+ Log(("NetIfList: fetched network adapter id: %.80ls\n", pId));
/*
* Host-only interfaces are ignored here and included into the list
* later in netIfListHostAdapters()
@@ -1552,25 +1592,45 @@ int NetIfList(std::list<ComObjPtr<HostNetworkInterface> > &list)
}
CoTaskMemFree(pId);
}
+ else
+ LogRel(("NetIfList: failed to get device id (0x%x)\n", hr));
}
+ else
+ LogRel(("NetIfList: wrong device status (0x%x)\n", uComponentStatus));
}
+ else
+ LogRel(("NetIfList: failed to get device status (0x%x)\n", hr));
pMpNcc->Release();
}
+ else
+ LogRel(("NetIfList: failed to get lower component (0x%x)\n", hr));
pBi->Release();
}
Assert(hr == S_OK || hr == S_FALSE);
}
+ else
+ LogRel(("NetIfList: IEnumNetCfgBindingInterface::Reset failed (0x%x)\n", hr));
pEnumBi->Release();
}
+ else
+ LogRel(("NetIfList: failed to enumerate binding interfaces (0x%x)\n", hr));
}
+ else
+ LogRel(("NetIfList: INetCfgBindingPath is disabled\n"));
pBp->Release();
}
Assert(hr == S_OK || hr == S_FALSE);
}
+ else
+ LogRel(("NetIfList: IEnumNetCfgBindingPath::Reset failed (0x%x)\n", hr));
pEnumBp->Release();
}
+ else
+ LogRel(("NetIfList: EnumBindingPaths failed (0x%x)\n", hr));
pBindings->Release();
}
+ else
+ LogRel(("NetIfList: failed to acquire INetCfgComponentBindings interface\n"));
pTcpIpNcc->Release();
}
else
@@ -1578,12 +1638,179 @@ int NetIfList(std::list<ComObjPtr<HostNetworkInterface> > &list)
LogRel(("failed to get the oracle_VBoxNetLwf(sun_VBoxNetFlt) component, error (0x%x)\n", hr));
}
+ /* Add host-only adapters to the list */
+ netIfListHostAdapters(pNc, list);
+
VBoxNetCfgWinReleaseINetCfg(pNc, FALSE);
}
- /* Add host-only adapters to the list */
- netIfListHostAdapters(list);
-
return VINF_SUCCESS;
#endif /* # if defined VBOX_WITH_NETFLT */
}
+
+#else /* !NETIF_WITHOUT_NETCFG */
+int NetIfList(std::list<ComObjPtr<HostNetworkInterface> > &list)
+{
+ DWORD dwRc;
+ int rc = VINF_SUCCESS;
+ int iDefault = getDefaultInterfaceIndex();
+ /*
+ * Most of the hosts probably have less than 10 adapters,
+ * so we'll mostly succeed from the first attempt.
+ */
+ ULONG uBufLen = sizeof(IP_ADAPTER_ADDRESSES) * 10;
+ PIP_ADAPTER_ADDRESSES pAddresses = (PIP_ADAPTER_ADDRESSES)RTMemAlloc(uBufLen);
+ if (!pAddresses)
+ return VERR_NO_MEMORY;
+ dwRc = GetAdaptersAddresses(AF_UNSPEC, GAA_FLAG_INCLUDE_PREFIX, NULL, pAddresses, &uBufLen);
+ if (dwRc == ERROR_BUFFER_OVERFLOW)
+ {
+ /* Impressive! More than 10 adapters! Get more memory and try again. */
+ RTMemFree(pAddresses);
+ pAddresses = (PIP_ADAPTER_ADDRESSES)RTMemAlloc(uBufLen);
+ if (!pAddresses)
+ return VERR_NO_MEMORY;
+ dwRc = GetAdaptersAddresses(AF_UNSPEC, GAA_FLAG_INCLUDE_PREFIX, NULL, pAddresses, &uBufLen);
+ }
+ if (dwRc == NO_ERROR)
+ {
+ PIP_ADAPTER_ADDRESSES pAdapter;
+ for (pAdapter = pAddresses; pAdapter; pAdapter = pAdapter->Next)
+ {
+ Log(("Enumerating %s\n", pAdapter->AdapterName));
+ /* Vista+ systems introduced separate type for wireless adapters */
+ if (pAdapter->IfType != IF_TYPE_ETHERNET_CSMACD && pAdapter->IfType != IF_TYPE_IEEE80211)
+ {
+ LogRel(("Skipped non-Ethernet '%ls'\n", pAdapter->FriendlyName));
+ continue;
+ }
+
+ NETIFINFO Info;
+ RT_ZERO(Info);
+
+ if (pAdapter->AdapterName[0] == '{')
+ {
+ char *pszUuid = pAdapter->AdapterName + 1;
+ size_t len = strlen(pszUuid) - 1;
+ if (pszUuid[len] != '}')
+ {
+ LogRel(("%s is not a valid UUID!\n", pAdapter->AdapterName));
+ continue;
+ }
+ pszUuid[len] = 0;
+ rc = RTUuidFromStr(&Info.Uuid, pszUuid);
+ if (RT_FAILURE(rc))
+ {
+ LogRel(("NetIfList: Failed to convert %s to UUID (%Rrc)\n", pszUuid, rc));
+ continue;
+ }
+ bool fIPv4Found, fIPv6Found;
+ PIP_ADAPTER_UNICAST_ADDRESS pAddr;
+ fIPv4Found = fIPv6Found = false;
+ for (pAddr = pAdapter->FirstUnicastAddress;
+ pAddr && !(fIPv4Found && fIPv6Found);
+ pAddr = pAddr->Next)
+ {
+ switch (pAddr->Address.lpSockaddr->sa_family)
+ {
+ case AF_INET:
+ if (!fIPv4Found)
+ {
+ fIPv4Found = true;
+ memcpy(&Info.IPAddress,
+ &((struct sockaddr_in *)pAddr->Address.lpSockaddr)->sin_addr.s_addr,
+ sizeof(Info.IPAddress));
+ }
+ break;
+ case AF_INET6:
+ if (!fIPv6Found)
+ {
+ fIPv6Found = true;
+ memcpy(&Info.IPv6Address,
+ ((struct sockaddr_in6 *)pAddr->Address.lpSockaddr)->sin6_addr.s6_addr,
+ sizeof(Info.IPv6Address));
+ }
+ break;
+ }
+ }
+ PIP_ADAPTER_PREFIX pPrefix;
+ fIPv4Found = fIPv6Found = false;
+ for (pPrefix = pAdapter->FirstPrefix;
+ pPrefix && !(fIPv4Found && fIPv6Found);
+ pPrefix = pPrefix->Next)
+ {
+ switch (pPrefix->Address.lpSockaddr->sa_family)
+ {
+ case AF_INET:
+ if (!fIPv4Found)
+ {
+ if (pPrefix->PrefixLength <= sizeof(Info.IPNetMask) * 8)
+ {
+ fIPv4Found = true;
+ ASMBitSetRange(&Info.IPNetMask, 0, pPrefix->PrefixLength);
+ }
+ else
+ LogRel(("NetIfList: Unexpected IPv4 prefix length of %d\n",
+ pPrefix->PrefixLength));
+ }
+ break;
+ case AF_INET6:
+ if (!fIPv6Found)
+ {
+ if (pPrefix->PrefixLength <= sizeof(Info.IPv6NetMask) * 8)
+ {
+ fIPv6Found = true;
+ ASMBitSetRange(&Info.IPv6NetMask, 0, pPrefix->PrefixLength);
+ }
+ else
+ LogRel(("NetIfList: Unexpected IPv6 prefix length of %d\n",
+ pPrefix->PrefixLength));
+ }
+ break;
+ }
+ }
+ if (sizeof(Info.MACAddress) != pAdapter->PhysicalAddressLength)
+ LogRel(("NetIfList: Unexpected physical address length: %u\n",
+ pAdapter->PhysicalAddressLength));
+ else
+ memcpy(Info.MACAddress.au8, pAdapter->PhysicalAddress, sizeof(Info.MACAddress));
+ Info.enmMediumType = NETIF_T_ETHERNET;
+ Info.enmStatus = pAdapter->OperStatus == IfOperStatusUp ? NETIF_S_UP : NETIF_S_DOWN;
+ Info.bDhcpEnabled = !!(pAdapter->Flags & IP_ADAPTER_DHCP_ENABLED);
+ Info.bIsDefault = (pAdapter->IfIndex == iDefault);
+ HostNetworkInterfaceType enmType;
+ /*
+ * For some reason, I would not even want to speculate what it is, the users see
+ * adapter's description as its name in its property dialog box.
+ */
+ enmType = wcsncmp(pAdapter->Description, L"VirtualBox", 10) == 0
+ ? HostNetworkInterfaceType_HostOnly
+ : HostNetworkInterfaceType_Bridged;
+ Log(("Adding %ls as %s\n", pAdapter->Description,
+ enmType == HostNetworkInterfaceType_Bridged ? "bridged" : "host-only"));
+ /* create a new object and add it to the list */
+ ComObjPtr<HostNetworkInterface> iface;
+ iface.createObject();
+ /* remove the curly bracket at the end */
+ rc = iface->init(pAdapter->Description, enmType, &Info);
+ if (SUCCEEDED(rc))
+ {
+ if (Info.bIsDefault)
+ list.push_front(iface);
+ else
+ list.push_back(iface);
+ }
+ else
+ {
+ LogRel(("NetIfList: HostNetworkInterface::init() -> %Rrc\n", rc));
+ Assert(0);
+ }
+ }
+ }
+ }
+
+ RTMemFree(pAddresses);
+
+ return VINF_SUCCESS;
+}
+#endif /* !NETIF_WITHOUT_NETCFG */
diff --git a/src/VBox/Main/src-server/win/USBProxyServiceWindows.cpp b/src/VBox/Main/src-server/win/USBProxyServiceWindows.cpp
index c4788c5..9b5c266 100644
--- a/src/VBox/Main/src-server/win/USBProxyServiceWindows.cpp
+++ b/src/VBox/Main/src-server/win/USBProxyServiceWindows.cpp
@@ -16,9 +16,9 @@
*/
-/*******************************************************************************
-* Header Files *
-*******************************************************************************/
+/*********************************************************************************************************************************
+* Header Files *
+*********************************************************************************************************************************/
#include "USBProxyService.h"
#include "Logging.h"
diff --git a/src/VBox/Main/src-server/xpcom/server.cpp b/src/VBox/Main/src-server/xpcom/server.cpp
index dd13e67..4fa2a9e 100644
--- a/src/VBox/Main/src-server/xpcom/server.cpp
+++ b/src/VBox/Main/src-server/xpcom/server.cpp
@@ -325,7 +325,7 @@ public:
}
};
- static void ShutdownTimer(RTTIMERLR hTimerLR, void *pvUser, uint64_t /*iTick*/)
+ static DECLCALLBACK(void) ShutdownTimer(RTTIMERLR hTimerLR, void *pvUser, uint64_t /*iTick*/)
{
NOREF(hTimerLR);
NOREF(pvUser);
diff --git a/src/VBox/Main/testcase/tstCollector.cpp b/src/VBox/Main/testcase/tstCollector.cpp
index 6c27115..e6e04d9 100644
--- a/src/VBox/Main/testcase/tstCollector.cpp
+++ b/src/VBox/Main/testcase/tstCollector.cpp
@@ -73,6 +73,12 @@
RTPrintf("%70s -- %u calls per second\n", #fn, nCalls); \
} while (0)
+void shutdownProcessList(std::vector<RTPROCESS> const &rProcesses)
+{
+ for (size_t i = 0; i < rProcesses.size(); i++)
+ RTProcTerminate(rProcesses[i]);
+}
+
void measurePerformance(pm::CollectorHAL *collector, const char *pszName, int cVMs)
{
@@ -90,7 +96,8 @@ void measurePerformance(pm::CollectorHAL *collector, const char *pszName, int cV
if (RT_FAILURE(rc))
{
hints.getProcesses(processes);
- std::for_each(processes.begin(), processes.end(), std::ptr_fun(RTProcTerminate));
+ shutdownProcessList(processes);
+
RTPrintf("tstCollector: RTProcCreate() -> %Rrc\n", rc);
return;
}
@@ -140,7 +147,7 @@ void measurePerformance(pm::CollectorHAL *collector, const char *pszName, int cV
printf("\n%u VMs -- %.2f%% of CPU time\n", cVMs, (RTTimeNanoTS() - start) / 10000000. / times);
/* Shut down fake VMs */
- std::for_each(processes.begin(), processes.end(), std::ptr_fun(RTProcTerminate));
+ shutdownProcessList(processes);
}
#ifdef RT_OS_SOLARIS
diff --git a/src/VBox/Main/testcase/tstGuid.cpp b/src/VBox/Main/testcase/tstGuid.cpp
index 1199845..54650f0 100644
--- a/src/VBox/Main/testcase/tstGuid.cpp
+++ b/src/VBox/Main/testcase/tstGuid.cpp
@@ -15,9 +15,10 @@
* hope that it will be useful, but WITHOUT ANY WARRANTY of any kind.
*/
-/*******************************************************************************
-* Header Files *
-*******************************************************************************/
+
+/*********************************************************************************************************************************
+* Header Files *
+*********************************************************************************************************************************/
#include <VBox/com/Guid.h>
#include <iprt/err.h>
diff --git a/src/VBox/Main/testcase/tstUSBProxyLinux.cpp b/src/VBox/Main/testcase/tstUSBProxyLinux.cpp
index 8897959..4b828b8 100644
--- a/src/VBox/Main/testcase/tstUSBProxyLinux.cpp
+++ b/src/VBox/Main/testcase/tstUSBProxyLinux.cpp
@@ -15,9 +15,10 @@
* hope that it will be useful, but WITHOUT ANY WARRANTY of any kind.
*/
-/******************************************************************************
-* Header Files *
-******************************************************************************/
+
+/*********************************************************************************************************************************
+* Header Files *
+*********************************************************************************************************************************/
#include "USBProxyService.h"
#include "USBGetDevices.h"
diff --git a/src/VBox/Main/testcase/tstVBoxAPI.cpp b/src/VBox/Main/testcase/tstVBoxAPI.cpp
index e85c029..cefb0e2 100644
--- a/src/VBox/Main/testcase/tstVBoxAPI.cpp
+++ b/src/VBox/Main/testcase/tstVBoxAPI.cpp
@@ -16,9 +16,9 @@
*/
-/*******************************************************************************
-* Header Files *
-*******************************************************************************/
+/*********************************************************************************************************************************
+* Header Files *
+*********************************************************************************************************************************/
#include <VBox/com/com.h>
#include <VBox/com/string.h>
#include <VBox/com/array.h>
@@ -34,9 +34,9 @@
using namespace com;
-/*******************************************************************************
-* Global Variables *
-*******************************************************************************/
+/*********************************************************************************************************************************
+* Global Variables *
+*********************************************************************************************************************************/
static RTTEST g_hTest;
static Bstr tstMachineName = "tstVBoxAPI test VM";
diff --git a/src/VBox/Main/testcase/tstVBoxAPIPerf.cpp b/src/VBox/Main/testcase/tstVBoxAPIPerf.cpp
index 7fdc680..33bdecd 100644
--- a/src/VBox/Main/testcase/tstVBoxAPIPerf.cpp
+++ b/src/VBox/Main/testcase/tstVBoxAPIPerf.cpp
@@ -16,9 +16,9 @@
*/
-/*******************************************************************************
-* Header Files *
-*******************************************************************************/
+/*********************************************************************************************************************************
+* Header Files *
+*********************************************************************************************************************************/
#include <VBox/com/com.h>
#include <VBox/com/string.h>
#include <VBox/com/array.h>
@@ -32,9 +32,9 @@
-/*******************************************************************************
-* Global Variables *
-*******************************************************************************/
+/*********************************************************************************************************************************
+* Global Variables *
+*********************************************************************************************************************************/
static RTTEST g_hTest;
diff --git a/src/VBox/Main/webservice/Makefile.kmk b/src/VBox/Main/webservice/Makefile.kmk
index 2e91a8e..14ee540 100644
--- a/src/VBox/Main/webservice/Makefile.kmk
+++ b/src/VBox/Main/webservice/Makefile.kmk
@@ -375,7 +375,7 @@ VBoxJWs-inst-jar_GENERATEDSOURCES = $(addprefix $(VBoxJWs-inst-jar_BLDDIRS)/,$(V
VBoxJWSGlue_KMK = $(PATH_OUT)/vboxjwsglue.kmk
include $(VBoxJWSGlue_KMK)
-$(VBoxJWSGlue_KMK).ts +| $(VBoxJWSGlue_KMK): $(VBOXWEB_IDL_SRC_ORIG) $(VBOX_GLUE_XSLT_DIR)/glue-java.xsl
+$(VBoxJWSGlue_KMK).ts +| $(VBoxJWSGlue_KMK): $(VBOXWEB_IDL_SRC_ORIG) $(VBOX_GLUE_XSLT_DIR)/glue-java.xsl $(VBOX_VERSION_STAMP)
$(call MSG_GENERATE,,$(VBoxJWSGlue_KMK))
$(QUIET)$(RM) -f $@
$(QUIET)$(MKDIR) -p $(@D)
@@ -391,7 +391,8 @@ $(VBOX_JWS_GEN_RAWSRC) \
+| $(VBoxJWs-inst-jar_GENERATEDSOURCES): \
$(VBOXWEB_IDL_SRC_ORIG) \
$(VBOX_GLUE_XSLT_DIR)/glue-java.xsl \
- $(VBOX_FILESPLIT)
+ $(VBOX_FILESPLIT) \
+ $(VBOX_VERSION_STAMP)
$(call MSG_L1,Generating JAX-WS Java glue files from XIDL)
$(QUIET)$(RM) -f $(filter-out $(VBoxJWs-inst-jar_GENERATEDSOURCES),$(wildcard $(VBOX_JWS_GEN)/java/*/*/*.java))
$(QUIET)$(MKDIR) -p $(@D)
diff --git a/src/VBox/Main/webservice/vboxweb.cpp b/src/VBox/Main/webservice/vboxweb.cpp
index c04fc06..284e968 100644
--- a/src/VBox/Main/webservice/vboxweb.cpp
+++ b/src/VBox/Main/webservice/vboxweb.cpp
@@ -99,7 +99,7 @@ typedef WebsessionsMap::iterator WebsessionsMapIterator;
typedef std::map<RTTHREAD, com::Utf8Str> ThreadsMap;
-static int fntWatchdog(RTTHREAD ThreadSelf, void *pvUser);
+static DECLCALLBACK(int) fntWatchdog(RTTHREAD ThreadSelf, void *pvUser);
/****************************************************************************
*
@@ -402,7 +402,7 @@ public:
* @param pvThread
* @return
*/
- static int fntWrapper(RTTHREAD pThread, void *pvThread)
+ static DECLCALLBACK(int) fntWrapper(RTTHREAD pThread, void *pvThread)
{
SoapThread *pst = (SoapThread*)pvThread;
pst->process();
@@ -959,7 +959,7 @@ static void doQueuesLoop()
* the loop that takes SOAP calls from HTTP and serves them by handing sockets to the
* SOAP queue worker threads.
*/
-static int fntQPumper(RTTHREAD ThreadSelf, void *pvUser)
+static DECLCALLBACK(int) fntQPumper(RTTHREAD ThreadSelf, void *pvUser)
{
// store a log prefix for this thread
util::AutoWriteLock thrLock(g_pThreadsLockHandle COMMA_LOCKVAL_SRC_POS);
@@ -1419,8 +1419,7 @@ int main(int argc, char *argv[])
* for whether they have been no requests in a configurable timeout period. In
* that case, the websession is automatically logged off.
*/
-/* static */
-int fntWatchdog(RTTHREAD ThreadSelf, void *pvUser)
+static DECLCALLBACK(int) fntWatchdog(RTTHREAD ThreadSelf, void *pvUser)
{
// store a log prefix for this thread
util::AutoWriteLock thrLock(g_pThreadsLockHandle COMMA_LOCKVAL_SRC_POS);
diff --git a/src/VBox/NetworkServices/DHCP/NetworkManagerDhcp.cpp b/src/VBox/NetworkServices/DHCP/NetworkManagerDhcp.cpp
index c33fba2..3511eb3 100644
--- a/src/VBox/NetworkServices/DHCP/NetworkManagerDhcp.cpp
+++ b/src/VBox/NetworkServices/DHCP/NetworkManagerDhcp.cpp
@@ -15,9 +15,10 @@
* hope that it will be useful, but WITHOUT ANY WARRANTY of any kind.
*/
-/*******************************************************************************
-* Header Files *
-*******************************************************************************/
+
+/*********************************************************************************************************************************
+* Header Files *
+*********************************************************************************************************************************/
#include <iprt/asm.h>
#include <iprt/cdefs.h>
#include <iprt/getopt.h>
diff --git a/src/VBox/NetworkServices/DHCP/VBoxNetDHCP.cpp b/src/VBox/NetworkServices/DHCP/VBoxNetDHCP.cpp
index 5f5f725..2a7ce59 100644
--- a/src/VBox/NetworkServices/DHCP/VBoxNetDHCP.cpp
+++ b/src/VBox/NetworkServices/DHCP/VBoxNetDHCP.cpp
@@ -21,9 +21,10 @@
*
*/
-/*******************************************************************************
-* Header Files *
-*******************************************************************************/
+
+/*********************************************************************************************************************************
+* Header Files *
+*********************************************************************************************************************************/
#include <VBox/com/com.h>
#include <VBox/com/listeners.h>
#include <VBox/com/string.h>
@@ -79,9 +80,11 @@
#include "Config.h"
-/*******************************************************************************
-* Structures and Typedefs *
-*******************************************************************************/
+
+
+/*********************************************************************************************************************************
+* Structures and Typedefs *
+*********************************************************************************************************************************/
/**
* DHCP server instance.
*/
@@ -177,9 +180,10 @@ static inline int configGetBoundryAddress(const ComDhcpServerPtr& dhcp, bool fUp
return RTNetStrToIPv4Addr(com::Utf8Str(strAddress).c_str(), &boundryAddress);
}
-/*******************************************************************************
-* Global Variables *
-*******************************************************************************/
+
+/*********************************************************************************************************************************
+* Global Variables *
+*********************************************************************************************************************************/
/** Pointer to the DHCP server. */
static VBoxNetDhcp *g_pDhcp;
diff --git a/src/VBox/NetworkServices/NAT/VBoxNetLwipNAT.cpp b/src/VBox/NetworkServices/NAT/VBoxNetLwipNAT.cpp
index 9c52865..7d4fa2f 100644
--- a/src/VBox/NetworkServices/NAT/VBoxNetLwipNAT.cpp
+++ b/src/VBox/NetworkServices/NAT/VBoxNetLwipNAT.cpp
@@ -18,8 +18,6 @@
/* Must be included before winutils.h (lwip/def.h), otherwise Windows build breaks. */
#define LOG_GROUP LOG_GROUP_NAT_SERVICE
-#include <iprt/cpp/mem.h>
-
#include "winutils.h"
#include <VBox/com/assert.h>
@@ -182,11 +180,11 @@ class VBoxNetLwipNAT: public VBoxNetBaseService, public NATNetworkEventAdapter
* on startup, and then on sync them on events.
*/
bool fDontLoadRulesOnStartup;
- static void onLwipTcpIpInit(void *arg);
- static void onLwipTcpIpFini(void *arg);
+ static DECLCALLBACK(void) onLwipTcpIpInit(void *arg);
+ static DECLCALLBACK(void) onLwipTcpIpFini(void *arg);
static err_t netifInit(netif *pNetif);
static err_t netifLinkoutput(netif *pNetif, pbuf *pBuf);
- static int intNetThreadRecv(RTTHREAD, void *);
+ /* static int intNetThreadRecv(RTTHREAD, void *); - unused */
VECNATSERVICEPF m_vecPortForwardRule4;
VECNATSERVICEPF m_vecPortForwardRule6;
@@ -293,8 +291,7 @@ HRESULT VBoxNetLwipNAT::HandleEvent(VBoxEventType_T aEventType, IEvent *pEvent)
break;
default:
- LogRel(("Event: %s %s port-forwarding rule \"%s\":"
- " invalid protocol %d\n",
+ LogRel(("Event: %s %s port-forwarding rule \"%s\": invalid protocol %d\n",
fCreateFW ? "Add" : "Remove",
fIPv6FW ? "IPv6" : "IPv4",
com::Utf8Str(name).c_str(),
@@ -302,8 +299,7 @@ HRESULT VBoxNetLwipNAT::HandleEvent(VBoxEventType_T aEventType, IEvent *pEvent)
goto port_forward_done;
}
- LogRel(("Event: %s %s port-forwarding rule \"%s\":"
- " %s %s%s%s:%d -> %s%s%s:%d\n",
+ LogRel(("Event: %s %s port-forwarding rule \"%s\": %s %s%s%s:%d -> %s%s%s:%d\n",
fCreateFW ? "Add" : "Remove",
fIPv6FW ? "IPv6" : "IPv4",
com::Utf8Str(name).c_str(),
@@ -352,25 +348,22 @@ HRESULT VBoxNetLwipNAT::HandleEvent(VBoxEventType_T aEventType, IEvent *pEvent)
for (it = rules.begin(); it != rules.end(); ++it)
{
/* compare */
- NATSEVICEPORTFORWARDRULE& natFw = *it;
+ NATSEVICEPORTFORWARDRULE &natFw = *it;
if ( natFw.Pfr.iPfrProto == r.Pfr.iPfrProto
&& natFw.Pfr.u16PfrHostPort == r.Pfr.u16PfrHostPort
- && (strncmp(natFw.Pfr.szPfrHostAddr, r.Pfr.szPfrHostAddr, INET6_ADDRSTRLEN) == 0)
+ && strncmp(natFw.Pfr.szPfrHostAddr, r.Pfr.szPfrHostAddr, INET6_ADDRSTRLEN) == 0
&& natFw.Pfr.u16PfrGuestPort == r.Pfr.u16PfrGuestPort
- && (strncmp(natFw.Pfr.szPfrGuestAddr, r.Pfr.szPfrGuestAddr, INET6_ADDRSTRLEN) == 0))
+ && strncmp(natFw.Pfr.szPfrGuestAddr, r.Pfr.szPfrGuestAddr, INET6_ADDRSTRLEN) == 0)
{
- RTCMemAutoPtr<fwspec> pFwCopy;
- if (RT_UNLIKELY(!pFwCopy.alloc()))
- break;
-
- memcpy(pFwCopy.get(), &natFw.FWSpec, sizeof(natFw.FWSpec));
-
- int status = portfwd_rule_del(pFwCopy.get());
- if (status != 0)
- break;
-
- pFwCopy.release(); /* owned by lwip thread now */
- rules.erase(it);
+ fwspec *pFwCopy = (fwspec *)RTMemDup(&natFw.FWSpec, sizeof(natFw.FWSpec));
+ if (pFwCopy)
+ {
+ int status = portfwd_rule_del(pFwCopy);
+ if (status == 0)
+ rules.erase(it); /* (pFwCopy is owned by lwip thread now.) */
+ else
+ RTMemFree(pFwCopy);
+ }
break;
}
} /* loop over vector elements */
@@ -426,7 +419,7 @@ HRESULT VBoxNetLwipNAT::HandleEvent(VBoxEventType_T aEventType, IEvent *pEvent)
}
-void VBoxNetLwipNAT::onLwipTcpIpInit(void* arg)
+/*static*/ DECLCALLBACK(void) VBoxNetLwipNAT::onLwipTcpIpInit(void *arg)
{
AssertPtrReturnVoid(arg);
VBoxNetLwipNAT *pNat = static_cast<VBoxNetLwipNAT *>(arg);
@@ -519,7 +512,7 @@ void VBoxNetLwipNAT::onLwipTcpIpInit(void* arg)
}
-void VBoxNetLwipNAT::onLwipTcpIpFini(void* arg)
+/*static*/ DECLCALLBACK(void) VBoxNetLwipNAT::onLwipTcpIpFini(void* arg)
{
AssertPtrReturnVoid(arg);
VBoxNetLwipNAT *pThis = (VBoxNetLwipNAT *)arg;
@@ -534,7 +527,7 @@ void VBoxNetLwipNAT::onLwipTcpIpFini(void* arg)
/*
* Callback for netif_add() to initialize the interface.
*/
-err_t VBoxNetLwipNAT::netifInit(netif *pNetif)
+/*static*/ err_t VBoxNetLwipNAT::netifInit(netif *pNetif)
{
err_t rcLwip = ERR_OK;
@@ -596,7 +589,7 @@ err_t VBoxNetLwipNAT::netifInit(netif *pNetif)
}
-err_t VBoxNetLwipNAT::netifLinkoutput(netif *pNetif, pbuf *pPBuf)
+/*static*/ err_t VBoxNetLwipNAT::netifLinkoutput(netif *pNetif, pbuf *pPBuf)
{
AssertPtrReturn(pNetif, ERR_ARG);
AssertPtrReturn(pPBuf, ERR_ARG);
@@ -701,7 +694,7 @@ VBoxNetLwipNAT::~VBoxNetLwipNAT()
}
-int VBoxNetLwipNAT::natServicePfRegister(NATSEVICEPORTFORWARDRULE& natPf)
+/*static*/ int VBoxNetLwipNAT::natServicePfRegister(NATSEVICEPORTFORWARDRULE& natPf)
{
int lrc;
@@ -738,27 +731,23 @@ int VBoxNetLwipNAT::natServicePfRegister(NATSEVICEPORTFORWARDRULE& natPf)
if (lrc != 0)
return VERR_IGNORED;
- RTCMemAutoPtr<fwspec> pFwCopy;
- if (RT_UNLIKELY(!pFwCopy.alloc()))
+ fwspec *pFwCopy = (fwspec *)RTMemDup(&natPf.FWSpec, sizeof(natPf.FWSpec));
+ if (pFwCopy)
{
+ lrc = portfwd_rule_add(pFwCopy);
+ if (lrc == 0)
+ return VINF_SUCCESS; /* (pFwCopy is owned by lwip thread now.) */
+ RTMemFree(pFwCopy);
+ }
+ else
LogRel(("Unable to allocate memory for %s rule \"%s\"\n",
natPf.Pfr.fPfrIPv6 ? "IPv6" : "IPv4",
natPf.Pfr.szPfrName));
- return VERR_IGNORED;
- }
-
- memcpy(pFwCopy.get(), &natPf.FWSpec, sizeof(natPf.FWSpec));
-
- lrc = portfwd_rule_add(pFwCopy.get());
- if (lrc != 0)
- return VERR_IGNORED;
-
- pFwCopy.release(); /* owned by lwip thread now */
- return VINF_SUCCESS;
+ return VERR_IGNORED;
}
-int VBoxNetLwipNAT::natServiceProcessRegisteredPf(VECNATSERVICEPF& vecRules)
+/*static*/ int VBoxNetLwipNAT::natServiceProcessRegisteredPf(VECNATSERVICEPF& vecRules)
{
ITERATORNATSERVICEPF it;
for (it = vecRules.begin(); it != vecRules.end(); ++it)
diff --git a/src/VBox/NetworkServices/NetLib/ComHostUtils.cpp b/src/VBox/NetworkServices/NetLib/ComHostUtils.cpp
index f75a4ef..2c5fcba 100644
--- a/src/VBox/NetworkServices/NetLib/ComHostUtils.cpp
+++ b/src/VBox/NetworkServices/NetLib/ComHostUtils.cpp
@@ -15,9 +15,10 @@
* hope that it will be useful, but WITHOUT ANY WARRANTY of any kind.
*/
-/*******************************************************************************
-* Header Files *
-*******************************************************************************/
+
+/*********************************************************************************************************************************
+* Header Files *
+*********************************************************************************************************************************/
#ifdef RT_OS_WINDOWS
# define VBOX_COM_OUTOFPROC_MODULE
#endif
diff --git a/src/VBox/NetworkServices/NetLib/VBoxNetARP.cpp b/src/VBox/NetworkServices/NetLib/VBoxNetARP.cpp
index 3ed3ac7..02ea7d7 100644
--- a/src/VBox/NetworkServices/NetLib/VBoxNetARP.cpp
+++ b/src/VBox/NetworkServices/NetLib/VBoxNetARP.cpp
@@ -15,9 +15,10 @@
* hope that it will be useful, but WITHOUT ANY WARRANTY of any kind.
*/
-/*******************************************************************************
-* Header Files *
-*******************************************************************************/
+
+/*********************************************************************************************************************************
+* Header Files *
+*********************************************************************************************************************************/
#define LOG_GROUP LOG_GROUP_DEFAULT
#include "VBoxNetLib.h"
#include <iprt/string.h>
diff --git a/src/VBox/NetworkServices/NetLib/VBoxNetBaseService.cpp b/src/VBox/NetworkServices/NetLib/VBoxNetBaseService.cpp
index 8f40cf5..e4779c8 100644
--- a/src/VBox/NetworkServices/NetLib/VBoxNetBaseService.cpp
+++ b/src/VBox/NetworkServices/NetLib/VBoxNetBaseService.cpp
@@ -15,9 +15,10 @@
* hope that it will be useful, but WITHOUT ANY WARRANTY of any kind.
*/
-/*******************************************************************************
-* Header Files *
-*******************************************************************************/
+
+/*********************************************************************************************************************************
+* Header Files *
+*********************************************************************************************************************************/
#define LOG_GROUP LOG_GROUP_NET_SERVICE
#include <VBox/com/com.h>
@@ -67,9 +68,9 @@
#endif
-/*******************************************************************************
-* Structures and Typedefs *
-*******************************************************************************/
+/*********************************************************************************************************************************
+* Structures and Typedefs *
+*********************************************************************************************************************************/
struct VBoxNetBaseService::Data
{
Data(const std::string& aServiceName, const std::string& aNetworkName):
@@ -122,12 +123,13 @@ struct VBoxNetBaseService::Data
RTTHREAD m_hThrRecv;
bool fShutdown;
- static int recvLoop(RTTHREAD, void *);
+ static DECLCALLBACK(int) recvLoop(RTTHREAD, void *);
};
-/*******************************************************************************
-* Global Variables *
-*******************************************************************************/
+
+/*********************************************************************************************************************************
+* Global Variables *
+*********************************************************************************************************************************/
/* Commonly used options for network configuration */
static RTGETOPTDEF g_aGetOptDef[] =
{
@@ -143,7 +145,7 @@ static RTGETOPTDEF g_aGetOptDef[] =
};
-int VBoxNetBaseService::Data::recvLoop(RTTHREAD, void *pvUser)
+DECLCALLBACK(int) VBoxNetBaseService::Data::recvLoop(RTTHREAD, void *pvUser)
{
VBoxNetBaseService *pThis = static_cast<VBoxNetBaseService *>(pvUser);
diff --git a/src/VBox/NetworkServices/NetLib/VBoxNetIntIf.cpp b/src/VBox/NetworkServices/NetLib/VBoxNetIntIf.cpp
index 2a85cfa..bf278fc 100644
--- a/src/VBox/NetworkServices/NetLib/VBoxNetIntIf.cpp
+++ b/src/VBox/NetworkServices/NetLib/VBoxNetIntIf.cpp
@@ -15,9 +15,10 @@
* hope that it will be useful, but WITHOUT ANY WARRANTY of any kind.
*/
-/*******************************************************************************
-* Header Files *
-*******************************************************************************/
+
+/*********************************************************************************************************************************
+* Header Files *
+*********************************************************************************************************************************/
#define LOG_GROUP LOG_GROUP_DEFAULT
#include "VBoxNetLib.h"
#include <VBox/intnet.h>
diff --git a/src/VBox/NetworkServices/NetLib/VBoxNetPortForwardString.cpp b/src/VBox/NetworkServices/NetLib/VBoxNetPortForwardString.cpp
index 7285860..0cb32b7 100644
--- a/src/VBox/NetworkServices/NetLib/VBoxNetPortForwardString.cpp
+++ b/src/VBox/NetworkServices/NetLib/VBoxNetPortForwardString.cpp
@@ -15,9 +15,10 @@
* hope that it will be useful, but WITHOUT ANY WARRANTY of any kind.
*/
-/*******************************************************************************
-* Header Files *
-*******************************************************************************/
+
+/*********************************************************************************************************************************
+* Header Files *
+*********************************************************************************************************************************/
#ifndef RT_OS_WINDOWS
#include <netinet/in.h>
#else
diff --git a/src/VBox/NetworkServices/NetLib/VBoxNetUDP.cpp b/src/VBox/NetworkServices/NetLib/VBoxNetUDP.cpp
index 56f0aaf..01e7b75 100644
--- a/src/VBox/NetworkServices/NetLib/VBoxNetUDP.cpp
+++ b/src/VBox/NetworkServices/NetLib/VBoxNetUDP.cpp
@@ -15,9 +15,10 @@
* hope that it will be useful, but WITHOUT ANY WARRANTY of any kind.
*/
-/*******************************************************************************
-* Header Files *
-*******************************************************************************/
+
+/*********************************************************************************************************************************
+* Header Files *
+*********************************************************************************************************************************/
#define LOG_GROUP LOG_GROUP_DEFAULT
#include "VBoxNetLib.h"
#include <iprt/stream.h>
diff --git a/src/VBox/RDP/client-1.8.3/rdesktop.c b/src/VBox/RDP/client-1.8.3/rdesktop.c
index 27300f5..205713b 100644
--- a/src/VBox/RDP/client-1.8.3/rdesktop.c
+++ b/src/VBox/RDP/client-1.8.3/rdesktop.c
@@ -556,7 +556,7 @@ parse_server_and_port(char *server)
#ifdef VBOX
/* This disables iprt logging */
-DECLEXPORT(PRTLOGGER) RTLogDefaultInit(void)
+DECLEXPORT(PRTLOGGER) RTCALL RTLogDefaultInit(void)
{
return NULL;
}
diff --git a/src/VBox/Runtime/Makefile.kmk b/src/VBox/Runtime/Makefile.kmk
index e1dc9c9..57a57e4 100644
--- a/src/VBox/Runtime/Makefile.kmk
+++ b/src/VBox/Runtime/Makefile.kmk
@@ -367,7 +367,10 @@ RuntimeR3_SOURCES = \
common/crypto/tsp-sanity.cpp \
common/crypto/store.cpp \
common/crypto/store-inmem.cpp \
- common/crypto/RTCrStoreCertAddFromFile.cpp \
+ common/crypto/store-cert-add-basic.cpp \
+ common/crypto/RTCrStoreCertAddFromJavaKeyStore.cpp \
+ common/crypto/RTCrStoreCertAddWantedFromFishingExpedition.cpp \
+ common/crypto/RTCrStoreCertExportAsPem.cpp \
common/dbg/dbg.cpp \
common/dbg/dbgas.cpp \
common/dbg/dbgcfg.cpp \
@@ -457,8 +460,10 @@ RuntimeR3_SOURCES = \
common/path/RTPathChangeToUnixSlashes.cpp \
common/path/RTPathCopyComponents.cpp \
common/path/RTPathCountComponents.cpp \
+ common/path/RTPathEnsureTrailingSeparator.cpp \
common/path/RTPathExt.cpp \
common/path/RTPathFilename.cpp \
+ common/path/RTPathGlob.cpp \
common/path/RTPathHasExt.cpp \
common/path/RTPathHasPath.cpp \
common/path/RTPathJoin.cpp \
@@ -734,6 +739,7 @@ RuntimeR3_SOURCES.win = \
r3/nt/pathint-nt.cpp \
r3/nt/RTProcQueryParent-r3-nt.cpp \
r3/win/env-win.cpp \
+ r3/win/RTCrStoreCreateSnapshotById-win.cpp \
r3/win/RTHandleGetStandard-win.cpp \
r3/win/RTSystemQueryOSInfo-win.cpp \
r3/win/RTSystemShutdown-win.cpp \
@@ -778,6 +784,7 @@ RuntimeR3_SOURCES.win.x86 := $(RuntimeWin32ASM_SOURCES)
RuntimeR3_SOURCES.linux = \
generic/cdrom-generic.cpp \
+ generic/RTCrStoreCreateSnapshotById-generic.cpp \
generic/RTDirQueryInfo-generic.cpp \
generic/RTDirSetTimes-generic.cpp \
generic/RTFileMove-generic.cpp \
@@ -864,6 +871,7 @@ endif
RuntimeR3_SOURCES.os2 = \
generic/cdrom-generic.cpp \
+ generic/RTCrStoreCreateSnapshotById-generic.cpp \
generic/RTDirQueryInfo-generic.cpp \
generic/RTDirSetTimes-generic.cpp \
generic/RTFileMove-generic.cpp \
@@ -962,6 +970,7 @@ RuntimeR3_SOURCES.darwin = \
generic/uuid-generic.cpp\
generic/RTProcIsRunningByName-generic.cpp \
generic/RTThreadGetNativeState-generic.cpp \
+ r3/darwin/RTCrStoreCreateSnapshotById-darwin.cpp \
r3/darwin/filelock-darwin.cpp \
r3/darwin/mp-darwin.cpp \
r3/darwin/pathhost-darwin.cpp \
@@ -1007,6 +1016,7 @@ RuntimeR3_SOURCES.darwin = \
## @todo Make BSD sched, implement RTMP*.
RuntimeR3_SOURCES.freebsd = \
generic/cdrom-generic.cpp \
+ generic/RTCrStoreCreateSnapshotById-generic.cpp \
generic/RTDirQueryInfo-generic.cpp \
generic/RTDirSetTimes-generic.cpp \
generic/RTFileMove-generic.cpp \
@@ -1078,6 +1088,7 @@ RuntimeR3_SOURCES.freebsd = \
RuntimeR3_SOURCES.solaris = \
generic/cdrom-generic.cpp \
+ generic/RTCrStoreCreateSnapshotById-generic.cpp \
generic/RTDirQueryInfo-generic.cpp \
generic/RTDirSetTimes-generic.cpp \
generic/RTFileMove-generic.cpp \
@@ -1152,6 +1163,7 @@ RuntimeR3_SOURCES.solaris.sparc64 = \
generic/RTSystemQueryDmiString-generic.cpp
RuntimeR3_SOURCES.haiku = \
+ generic/RTCrStoreCreateSnapshotById-generic.cpp \
generic/RTDirQueryInfo-generic.cpp \
generic/RTDirSetTimes-generic.cpp \
generic/RTFileMove-generic.cpp \
@@ -1406,7 +1418,12 @@ VBoxRT_LIBS.win = \
$(PATH_SDK_$(VBOX_WINDDK)_LIB)/vccomsup.lib \
$(PATH_SDK_$(VBOX_WINDDK)_LIB)/wbemuuid.lib \
$(PATH_TOOL_$(VBOX_VCC_TOOL)_LIB)/delayimp.lib
-VBoxRT_LDFLAGS.darwin = -framework IOKit -framework CoreFoundation -framework CoreServices -install_name $(VBOX_DYLD_EXECUTABLE_PATH)/VBoxRT.dylib
+VBoxRT_LDFLAGS.darwin = \
+ -framework IOKit \
+ -framework CoreFoundation \
+ -framework CoreServices \
+ -framework Security \
+ -install_name $(VBOX_DYLD_EXECUTABLE_PATH)/VBoxRT.dylib
VBoxRT_LDFLAGS.win = /MANIFEST \
/delayload:gdi32.dll \
/delayload:user32.dll \
diff --git a/src/VBox/Runtime/VBox/RTAssertShouldPanic-vbox.cpp b/src/VBox/Runtime/VBox/RTAssertShouldPanic-vbox.cpp
index 3ec7575..9d1219e 100644
--- a/src/VBox/Runtime/VBox/RTAssertShouldPanic-vbox.cpp
+++ b/src/VBox/Runtime/VBox/RTAssertShouldPanic-vbox.cpp
@@ -25,9 +25,9 @@
*/
-/*******************************************************************************
-* Header Files *
-*******************************************************************************/
+/*********************************************************************************************************************************
+* Header Files *
+*********************************************************************************************************************************/
#include <iprt/assert.h>
#include <iprt/env.h>
#include <iprt/err.h>
diff --git a/src/VBox/Runtime/VBox/VBoxRTDeps.cpp b/src/VBox/Runtime/VBox/VBoxRTDeps.cpp
index e0fc16c..d7b2edd 100644
--- a/src/VBox/Runtime/VBox/VBoxRTDeps.cpp
+++ b/src/VBox/Runtime/VBox/VBoxRTDeps.cpp
@@ -24,9 +24,10 @@
* terms and conditions of either the GPL or the CDDL or both.
*/
-/*******************************************************************************
-* Header Files *
-*******************************************************************************/
+
+/*********************************************************************************************************************************
+* Header Files *
+*********************************************************************************************************************************/
#ifndef RT_NO_GIP
# include <VBox/sup.h>
#endif
@@ -46,9 +47,9 @@
#include <openssl/rand.h>
-/*******************************************************************************
-* Global Variables *
-*******************************************************************************/
+/*********************************************************************************************************************************
+* Global Variables *
+*********************************************************************************************************************************/
PFNRT g_VBoxRTDeps[] =
{
#ifndef RT_NO_GIP
diff --git a/src/VBox/Runtime/VBox/log-vbox.cpp b/src/VBox/Runtime/VBox/log-vbox.cpp
index daf961f..7401a45 100644
--- a/src/VBox/Runtime/VBox/log-vbox.cpp
+++ b/src/VBox/Runtime/VBox/log-vbox.cpp
@@ -123,9 +123,9 @@
*/
-/*******************************************************************************
-* Header Files *
-*******************************************************************************/
+/*********************************************************************************************************************************
+* Header Files *
+*********************************************************************************************************************************/
#ifdef IN_RING3
# if defined(RT_OS_WINDOWS)
# include <Windows.h>
@@ -168,9 +168,9 @@
#endif
-/*******************************************************************************
-* Global Variables *
-*******************************************************************************/
+/*********************************************************************************************************************************
+* Global Variables *
+*********************************************************************************************************************************/
/** The default logger. */
static PRTLOGGER g_pLogger = NULL;
/** The default logger groups.
diff --git a/src/VBox/Runtime/VBox/logbackdoor-redirect.cpp b/src/VBox/Runtime/VBox/logbackdoor-redirect.cpp
index 900585b..b078d4c 100644
--- a/src/VBox/Runtime/VBox/logbackdoor-redirect.cpp
+++ b/src/VBox/Runtime/VBox/logbackdoor-redirect.cpp
@@ -27,9 +27,9 @@
*/
-/*******************************************************************************
-* Header Files *
-*******************************************************************************/
+/*********************************************************************************************************************************
+* Header Files *
+*********************************************************************************************************************************/
#include <VBox/log.h>
#include <VBox/err.h>
diff --git a/src/VBox/Runtime/VBox/logbackdoor.cpp b/src/VBox/Runtime/VBox/logbackdoor.cpp
index 46d617a..143cc34 100644
--- a/src/VBox/Runtime/VBox/logbackdoor.cpp
+++ b/src/VBox/Runtime/VBox/logbackdoor.cpp
@@ -24,9 +24,10 @@
* terms and conditions of either the GPL or the CDDL or both.
*/
-/*******************************************************************************
-* Header Files *
-*******************************************************************************/
+
+/*********************************************************************************************************************************
+* Header Files *
+*********************************************************************************************************************************/
#include <VBox/log.h>
#include "internal/iprt.h"
#include <iprt/asm-amd64-x86.h>
@@ -36,9 +37,9 @@
#endif
-/*******************************************************************************
-* Internal Functions *
-*******************************************************************************/
+/*********************************************************************************************************************************
+* Internal Functions *
+*********************************************************************************************************************************/
static DECLCALLBACK(size_t) rtLogBackdoorOutput(void *pv, const char *pachChars, size_t cbChars);
diff --git a/src/VBox/Runtime/common/alloc/alloc.cpp b/src/VBox/Runtime/common/alloc/alloc.cpp
index 2c32217..136ff6d 100644
--- a/src/VBox/Runtime/common/alloc/alloc.cpp
+++ b/src/VBox/Runtime/common/alloc/alloc.cpp
@@ -25,9 +25,9 @@
*/
-/*******************************************************************************
-* Header Files *
-*******************************************************************************/
+/*********************************************************************************************************************************
+* Header Files *
+*********************************************************************************************************************************/
#ifndef RTMEM_NO_WRAP_TO_EF_APIS
# define RTMEM_NO_WRAP_TO_EF_APIS
#endif
@@ -39,7 +39,7 @@
-RTDECL(void *) RTMemDupTag(const void *pvSrc, size_t cb, const char *pszTag) RT_NO_THROW
+RTDECL(void *) RTMemDupTag(const void *pvSrc, size_t cb, const char *pszTag) RT_NO_THROW_DEF
{
void *pvDst = RTMemAllocTag(cb, pszTag);
if (pvDst)
@@ -49,7 +49,7 @@ RTDECL(void *) RTMemDupTag(const void *pvSrc, size_t cb, const char *pszTag) RT_
RT_EXPORT_SYMBOL(RTMemDupTag);
-RTDECL(void *) RTMemDupExTag(const void *pvSrc, size_t cbSrc, size_t cbExtra, const char *pszTag) RT_NO_THROW
+RTDECL(void *) RTMemDupExTag(const void *pvSrc, size_t cbSrc, size_t cbExtra, const char *pszTag) RT_NO_THROW_DEF
{
void *pvDst = RTMemAllocTag(cbSrc + cbExtra, pszTag);
if (pvDst)
diff --git a/src/VBox/Runtime/common/alloc/heapoffset.cpp b/src/VBox/Runtime/common/alloc/heapoffset.cpp
index d621812..ec1e529 100644
--- a/src/VBox/Runtime/common/alloc/heapoffset.cpp
+++ b/src/VBox/Runtime/common/alloc/heapoffset.cpp
@@ -25,9 +25,9 @@
*/
-/*******************************************************************************
-* Header Files *
-*******************************************************************************/
+/*********************************************************************************************************************************
+* Header Files *
+*********************************************************************************************************************************/
#define LOG_GROUP RTLOGGROUP_DEFAULT
#include <iprt/heap.h>
#include "internal/iprt.h"
@@ -42,9 +42,9 @@
#include "internal/magics.h"
-/*******************************************************************************
-* Structures and Typedefs *
-*******************************************************************************/
+/*********************************************************************************************************************************
+* Structures and Typedefs *
+*********************************************************************************************************************************/
/** Pointer to the heap anchor block. */
typedef struct RTHEAPOFFSETINTERNAL *PRTHEAPOFFSETINTERNAL;
/** Pointer to a heap block. */
@@ -164,9 +164,9 @@ AssertCompile(RTHEAPOFFSET_MIN_BLOCK >= sizeof(RTHEAPOFFSETFREE) - sizeof(RTHEAP
#define RTHEAPOFFSET_ALIGNMENT (sizeof(RTHEAPOFFSETBLOCK))
-/*******************************************************************************
-* Defined Constants And Macros *
-*******************************************************************************/
+/*********************************************************************************************************************************
+* Defined Constants And Macros *
+*********************************************************************************************************************************/
#ifdef RT_STRICT
# define RTHEAPOFFSET_STRICT 1
#endif
@@ -323,9 +323,9 @@ AssertCompile(RTHEAPOFFSET_MIN_BLOCK >= sizeof(RTHEAPOFFSETFREE) - sizeof(RTHEAP
} while (0)
-/*******************************************************************************
-* Internal Functions *
-*******************************************************************************/
+/*********************************************************************************************************************************
+* Internal Functions *
+*********************************************************************************************************************************/
#ifdef RTHEAPOFFSET_STRICT
static void rtHeapOffsetAssertAll(PRTHEAPOFFSETINTERNAL pHeapInt);
#endif
diff --git a/src/VBox/Runtime/common/alloc/heapsimple.cpp b/src/VBox/Runtime/common/alloc/heapsimple.cpp
index 8591640..5c44d33 100644
--- a/src/VBox/Runtime/common/alloc/heapsimple.cpp
+++ b/src/VBox/Runtime/common/alloc/heapsimple.cpp
@@ -25,9 +25,9 @@
*/
-/*******************************************************************************
-* Header Files *
-*******************************************************************************/
+/*********************************************************************************************************************************
+* Header Files *
+*********************************************************************************************************************************/
#define LOG_GROUP RTLOGGROUP_DEFAULT
#include <iprt/heap.h>
#include "internal/iprt.h"
@@ -42,9 +42,9 @@
#include "internal/magics.h"
-/*******************************************************************************
-* Structures and Typedefs *
-*******************************************************************************/
+/*********************************************************************************************************************************
+* Structures and Typedefs *
+*********************************************************************************************************************************/
/** Pointer to the heap anchor block. */
typedef struct RTHEAPSIMPLEINTERNAL *PRTHEAPSIMPLEINTERNAL;
/** Pointer to a heap block. */
@@ -164,9 +164,9 @@ AssertCompile(RTHEAPSIMPLE_MIN_BLOCK >= sizeof(RTHEAPSIMPLEFREE) - sizeof(RTHEAP
#define RTHEAPSIMPLE_ALIGNMENT (sizeof(RTHEAPSIMPLEBLOCK))
-/*******************************************************************************
-* Defined Constants And Macros *
-*******************************************************************************/
+/*********************************************************************************************************************************
+* Defined Constants And Macros *
+*********************************************************************************************************************************/
#ifdef RT_STRICT
# define RTHEAPSIMPLE_STRICT 1
#endif
@@ -267,9 +267,9 @@ AssertCompile(RTHEAPSIMPLE_MIN_BLOCK >= sizeof(RTHEAPSIMPLEFREE) - sizeof(RTHEAP
} while (0)
-/*******************************************************************************
-* Internal Functions *
-*******************************************************************************/
+/*********************************************************************************************************************************
+* Internal Functions *
+*********************************************************************************************************************************/
#ifdef RTHEAPSIMPLE_STRICT
static void rtHeapSimpleAssertAll(PRTHEAPSIMPLEINTERNAL pHeapInt);
#endif
diff --git a/src/VBox/Runtime/common/alloc/memcache.cpp b/src/VBox/Runtime/common/alloc/memcache.cpp
index 0c6ea0b..5096125 100644
--- a/src/VBox/Runtime/common/alloc/memcache.cpp
+++ b/src/VBox/Runtime/common/alloc/memcache.cpp
@@ -25,9 +25,9 @@
*/
-/*******************************************************************************
-* Header Files *
-*******************************************************************************/
+/*********************************************************************************************************************************
+* Header Files *
+*********************************************************************************************************************************/
#include <iprt/memcache.h>
#include "internal/iprt.h"
@@ -41,9 +41,9 @@
#include "internal/magics.h"
-/*******************************************************************************
-* Structures and Typedefs *
-*******************************************************************************/
+/*********************************************************************************************************************************
+* Structures and Typedefs *
+*********************************************************************************************************************************/
/** Pointer to a cache instance. */
typedef struct RTMEMCACHEINT *PRTMEMCACHEINT;
/** Pointer to a cache page. */
@@ -149,9 +149,9 @@ typedef struct RTMEMCACHEINT
} RTMEMCACHEINT;
-/*******************************************************************************
-* Internal Functions *
-*******************************************************************************/
+/*********************************************************************************************************************************
+* Internal Functions *
+*********************************************************************************************************************************/
static void rtMemCacheFreeList(RTMEMCACHEINT *pThis, PRTMEMCACHEFREEOBJ pHead);
diff --git a/src/VBox/Runtime/common/alloc/memtracker.cpp b/src/VBox/Runtime/common/alloc/memtracker.cpp
index 1b4cdf1..ee6e7ad 100644
--- a/src/VBox/Runtime/common/alloc/memtracker.cpp
+++ b/src/VBox/Runtime/common/alloc/memtracker.cpp
@@ -25,9 +25,9 @@
*/
-/*******************************************************************************
-* Header Files *
-*******************************************************************************/
+/*********************************************************************************************************************************
+* Header Files *
+*********************************************************************************************************************************/
#include <iprt/memtracker.h>
#include "internal/iprt.h"
@@ -51,9 +51,9 @@
#include "internal/strhash.h"
-/*******************************************************************************
-* Structures and Typedefs *
-*******************************************************************************/
+/*********************************************************************************************************************************
+* Structures and Typedefs *
+*********************************************************************************************************************************/
/** Pointer to a memory tracker instance */
typedef struct RTMEMTRACKERINT *PRTMEMTRACKERINT;
@@ -193,9 +193,9 @@ typedef struct RTMEMTRACKEROUTPUT
typedef RTMEMTRACKEROUTPUT *PRTMEMTRACKEROUTPUT;
-/*******************************************************************************
-* Global Variables *
-*******************************************************************************/
+/*********************************************************************************************************************************
+* Global Variables *
+*********************************************************************************************************************************/
/** Pointer to the default memory tracker. */
static PRTMEMTRACKERINT g_pDefaultTracker = NULL;
diff --git a/src/VBox/Runtime/common/asm/asm-fake.cpp b/src/VBox/Runtime/common/asm/asm-fake.cpp
index 2ea244f..bc9778c 100644
--- a/src/VBox/Runtime/common/asm/asm-fake.cpp
+++ b/src/VBox/Runtime/common/asm/asm-fake.cpp
@@ -25,9 +25,9 @@
*/
-/*******************************************************************************
-* Header Files *
-*******************************************************************************/
+/*********************************************************************************************************************************
+* Header Files *
+*********************************************************************************************************************************/
#include <iprt/asm.h>
#include "internal/iprt.h"
diff --git a/src/VBox/Runtime/common/asn1/asn1-basics.cpp b/src/VBox/Runtime/common/asn1/asn1-basics.cpp
index 7840792..bf90b00 100644
--- a/src/VBox/Runtime/common/asn1/asn1-basics.cpp
+++ b/src/VBox/Runtime/common/asn1/asn1-basics.cpp
@@ -24,9 +24,10 @@
* terms and conditions of either the GPL or the CDDL or both.
*/
-/*******************************************************************************
-* Header Files *
-*******************************************************************************/
+
+/*********************************************************************************************************************************
+* Header Files *
+*********************************************************************************************************************************/
#include "internal/iprt.h"
#include <iprt/asn1.h>
@@ -40,9 +41,9 @@
#include <iprt/formats/asn1.h>
-/*******************************************************************************
-* Structures and Typedefs *
-*******************************************************************************/
+/*********************************************************************************************************************************
+* Structures and Typedefs *
+*********************************************************************************************************************************/
/**
* ASN.1 content/value allocation.
*
diff --git a/src/VBox/Runtime/common/asn1/asn1-cursor.cpp b/src/VBox/Runtime/common/asn1/asn1-cursor.cpp
index 6d39e12..f1ce0b6 100644
--- a/src/VBox/Runtime/common/asn1/asn1-cursor.cpp
+++ b/src/VBox/Runtime/common/asn1/asn1-cursor.cpp
@@ -24,9 +24,10 @@
* terms and conditions of either the GPL or the CDDL or both.
*/
-/*******************************************************************************
-* Header Files *
-*******************************************************************************/
+
+/*********************************************************************************************************************************
+* Header Files *
+*********************************************************************************************************************************/
#include "internal/iprt.h"
#include <iprt/asn1.h>
@@ -38,9 +39,9 @@
#include <iprt/formats/asn1.h>
-/*******************************************************************************
-* Defined Constants And Macros *
-*******************************************************************************/
+/*********************************************************************************************************************************
+* Defined Constants And Macros *
+*********************************************************************************************************************************/
/** @def RTASN1_MAX_NESTING
* The maximum nesting depth we allow. This limit is enforced to avoid running
* out of stack due to malformed ASN.1 input.
@@ -56,9 +57,9 @@
#endif
-/*******************************************************************************
-* Global Variables *
-*******************************************************************************/
+/*********************************************************************************************************************************
+* Global Variables *
+*********************************************************************************************************************************/
static char const g_achDigits[11] = "0123456789";
diff --git a/src/VBox/Runtime/common/asn1/asn1-default-allocator.cpp b/src/VBox/Runtime/common/asn1/asn1-default-allocator.cpp
index d610a01..657d984 100644
--- a/src/VBox/Runtime/common/asn1/asn1-default-allocator.cpp
+++ b/src/VBox/Runtime/common/asn1/asn1-default-allocator.cpp
@@ -24,9 +24,10 @@
* terms and conditions of either the GPL or the CDDL or both.
*/
-/*******************************************************************************
-* Header Files *
-*******************************************************************************/
+
+/*********************************************************************************************************************************
+* Header Files *
+*********************************************************************************************************************************/
#include "internal/iprt.h"
#include <iprt/asn1.h>
diff --git a/src/VBox/Runtime/common/asn1/asn1-dump.cpp b/src/VBox/Runtime/common/asn1/asn1-dump.cpp
index 0e52069..8983096 100644
--- a/src/VBox/Runtime/common/asn1/asn1-dump.cpp
+++ b/src/VBox/Runtime/common/asn1/asn1-dump.cpp
@@ -24,9 +24,10 @@
* terms and conditions of either the GPL or the CDDL or both.
*/
-/*******************************************************************************
-* Header Files *
-*******************************************************************************/
+
+/*********************************************************************************************************************************
+* Header Files *
+*********************************************************************************************************************************/
#include "internal/iprt.h"
#include <iprt/asn1.h>
@@ -40,9 +41,9 @@
#include <iprt/formats/asn1.h>
-/*******************************************************************************
-* Structures and Typedefs *
-*******************************************************************************/
+/*********************************************************************************************************************************
+* Structures and Typedefs *
+*********************************************************************************************************************************/
/**
* Dump data structure.
*/
diff --git a/src/VBox/Runtime/common/asn1/asn1-efence-allocator.cpp b/src/VBox/Runtime/common/asn1/asn1-efence-allocator.cpp
index 55732ac..516fbb9 100644
--- a/src/VBox/Runtime/common/asn1/asn1-efence-allocator.cpp
+++ b/src/VBox/Runtime/common/asn1/asn1-efence-allocator.cpp
@@ -24,9 +24,10 @@
* terms and conditions of either the GPL or the CDDL or both.
*/
-/*******************************************************************************
-* Header Files *
-*******************************************************************************/
+
+/*********************************************************************************************************************************
+* Header Files *
+*********************************************************************************************************************************/
#include "internal/iprt.h"
#include <iprt/asn1.h>
diff --git a/src/VBox/Runtime/common/asn1/asn1-encode.cpp b/src/VBox/Runtime/common/asn1/asn1-encode.cpp
index df8b76c..566803b 100644
--- a/src/VBox/Runtime/common/asn1/asn1-encode.cpp
+++ b/src/VBox/Runtime/common/asn1/asn1-encode.cpp
@@ -24,9 +24,10 @@
* terms and conditions of either the GPL or the CDDL or both.
*/
-/*******************************************************************************
-* Header Files *
-*******************************************************************************/
+
+/*********************************************************************************************************************************
+* Header Files *
+*********************************************************************************************************************************/
#include "internal/iprt.h"
#include <iprt/asn1.h>
@@ -38,9 +39,9 @@
#include <iprt/formats/asn1.h>
-/*******************************************************************************
-* Structures and Typedefs *
-*******************************************************************************/
+/*********************************************************************************************************************************
+* Structures and Typedefs *
+*********************************************************************************************************************************/
/**
* Argument package for rtAsn1EncodePrepareCallback passed by RTAsn1EncodePrepare.
*/
diff --git a/src/VBox/Runtime/common/asn1/asn1-ut-bitstring-decode.cpp b/src/VBox/Runtime/common/asn1/asn1-ut-bitstring-decode.cpp
index 0599f35..e455339 100644
--- a/src/VBox/Runtime/common/asn1/asn1-ut-bitstring-decode.cpp
+++ b/src/VBox/Runtime/common/asn1/asn1-ut-bitstring-decode.cpp
@@ -24,9 +24,10 @@
* terms and conditions of either the GPL or the CDDL or both.
*/
-/*******************************************************************************
-* Header Files *
-*******************************************************************************/
+
+/*********************************************************************************************************************************
+* Header Files *
+*********************************************************************************************************************************/
#include "internal/iprt.h"
#include <iprt/asn1.h>
diff --git a/src/VBox/Runtime/common/asn1/asn1-ut-bitstring.cpp b/src/VBox/Runtime/common/asn1/asn1-ut-bitstring.cpp
index d36901a..7067356 100644
--- a/src/VBox/Runtime/common/asn1/asn1-ut-bitstring.cpp
+++ b/src/VBox/Runtime/common/asn1/asn1-ut-bitstring.cpp
@@ -26,9 +26,10 @@
* terms and conditions of either the GPL or the CDDL or both.
*/
-/*******************************************************************************
-* Header Files *
-*******************************************************************************/
+
+/*********************************************************************************************************************************
+* Header Files *
+*********************************************************************************************************************************/
#include "internal/iprt.h"
#include <iprt/asn1.h>
@@ -42,9 +43,9 @@
#include <iprt/formats/asn1.h>
-/*******************************************************************************
-* Structures and Typedefs *
-*******************************************************************************/
+/*********************************************************************************************************************************
+* Structures and Typedefs *
+*********************************************************************************************************************************/
typedef struct RTASN1BITSTRINGWRITERCTX
{
/** Pointer to the output buffer. */
diff --git a/src/VBox/Runtime/common/asn1/asn1-ut-boolean-decode.cpp b/src/VBox/Runtime/common/asn1/asn1-ut-boolean-decode.cpp
index 7fcbc83..7b03689 100644
--- a/src/VBox/Runtime/common/asn1/asn1-ut-boolean-decode.cpp
+++ b/src/VBox/Runtime/common/asn1/asn1-ut-boolean-decode.cpp
@@ -24,9 +24,10 @@
* terms and conditions of either the GPL or the CDDL or both.
*/
-/*******************************************************************************
-* Header Files *
-*******************************************************************************/
+
+/*********************************************************************************************************************************
+* Header Files *
+*********************************************************************************************************************************/
#include "internal/iprt.h"
#include <iprt/asn1.h>
diff --git a/src/VBox/Runtime/common/asn1/asn1-ut-boolean.cpp b/src/VBox/Runtime/common/asn1/asn1-ut-boolean.cpp
index a3d89fb..3bb5538 100644
--- a/src/VBox/Runtime/common/asn1/asn1-ut-boolean.cpp
+++ b/src/VBox/Runtime/common/asn1/asn1-ut-boolean.cpp
@@ -24,9 +24,10 @@
* terms and conditions of either the GPL or the CDDL or both.
*/
-/*******************************************************************************
-* Header Files *
-*******************************************************************************/
+
+/*********************************************************************************************************************************
+* Header Files *
+*********************************************************************************************************************************/
#include "internal/iprt.h"
#include <iprt/asn1.h>
@@ -37,9 +38,9 @@
#include <iprt/formats/asn1.h>
-/*******************************************************************************
-* Global Variables *
-*******************************************************************************/
+/*********************************************************************************************************************************
+* Global Variables *
+*********************************************************************************************************************************/
/** The false value (DER & CER). */
static const uint8_t g_bFalse = 0;
/** The true value (DER & CER). */
diff --git a/src/VBox/Runtime/common/asn1/asn1-ut-core-decode.cpp b/src/VBox/Runtime/common/asn1/asn1-ut-core-decode.cpp
index 19652d2..b697230 100644
--- a/src/VBox/Runtime/common/asn1/asn1-ut-core-decode.cpp
+++ b/src/VBox/Runtime/common/asn1/asn1-ut-core-decode.cpp
@@ -24,9 +24,10 @@
* terms and conditions of either the GPL or the CDDL or both.
*/
-/*******************************************************************************
-* Header Files *
-*******************************************************************************/
+
+/*********************************************************************************************************************************
+* Header Files *
+*********************************************************************************************************************************/
#include "internal/iprt.h"
#include <iprt/asn1.h>
diff --git a/src/VBox/Runtime/common/asn1/asn1-ut-core.cpp b/src/VBox/Runtime/common/asn1/asn1-ut-core.cpp
index 5b86e88..58325c9 100644
--- a/src/VBox/Runtime/common/asn1/asn1-ut-core.cpp
+++ b/src/VBox/Runtime/common/asn1/asn1-ut-core.cpp
@@ -24,9 +24,10 @@
* terms and conditions of either the GPL or the CDDL or both.
*/
-/*******************************************************************************
-* Header Files *
-*******************************************************************************/
+
+/*********************************************************************************************************************************
+* Header Files *
+*********************************************************************************************************************************/
#include "internal/iprt.h"
#include <iprt/asn1.h>
diff --git a/src/VBox/Runtime/common/asn1/asn1-ut-dyntype-decode.cpp b/src/VBox/Runtime/common/asn1/asn1-ut-dyntype-decode.cpp
index be36d02..65792f0 100644
--- a/src/VBox/Runtime/common/asn1/asn1-ut-dyntype-decode.cpp
+++ b/src/VBox/Runtime/common/asn1/asn1-ut-dyntype-decode.cpp
@@ -24,9 +24,10 @@
* terms and conditions of either the GPL or the CDDL or both.
*/
-/*******************************************************************************
-* Header Files *
-*******************************************************************************/
+
+/*********************************************************************************************************************************
+* Header Files *
+*********************************************************************************************************************************/
#include "internal/iprt.h"
#include <iprt/asn1.h>
diff --git a/src/VBox/Runtime/common/asn1/asn1-ut-dyntype.cpp b/src/VBox/Runtime/common/asn1/asn1-ut-dyntype.cpp
index 03662ec..b78f771 100644
--- a/src/VBox/Runtime/common/asn1/asn1-ut-dyntype.cpp
+++ b/src/VBox/Runtime/common/asn1/asn1-ut-dyntype.cpp
@@ -24,9 +24,10 @@
* terms and conditions of either the GPL or the CDDL or both.
*/
-/*******************************************************************************
-* Header Files *
-*******************************************************************************/
+
+/*********************************************************************************************************************************
+* Header Files *
+*********************************************************************************************************************************/
#include "internal/iprt.h"
#include <iprt/asn1.h>
diff --git a/src/VBox/Runtime/common/asn1/asn1-ut-integer-decode.cpp b/src/VBox/Runtime/common/asn1/asn1-ut-integer-decode.cpp
index 8aa0847..c159b47 100644
--- a/src/VBox/Runtime/common/asn1/asn1-ut-integer-decode.cpp
+++ b/src/VBox/Runtime/common/asn1/asn1-ut-integer-decode.cpp
@@ -24,9 +24,10 @@
* terms and conditions of either the GPL or the CDDL or both.
*/
-/*******************************************************************************
-* Header Files *
-*******************************************************************************/
+
+/*********************************************************************************************************************************
+* Header Files *
+*********************************************************************************************************************************/
#include "internal/iprt.h"
#include <iprt/asn1.h>
diff --git a/src/VBox/Runtime/common/asn1/asn1-ut-integer.cpp b/src/VBox/Runtime/common/asn1/asn1-ut-integer.cpp
index fa271f6..291c423 100644
--- a/src/VBox/Runtime/common/asn1/asn1-ut-integer.cpp
+++ b/src/VBox/Runtime/common/asn1/asn1-ut-integer.cpp
@@ -24,9 +24,10 @@
* terms and conditions of either the GPL or the CDDL or both.
*/
-/*******************************************************************************
-* Header Files *
-*******************************************************************************/
+
+/*********************************************************************************************************************************
+* Header Files *
+*********************************************************************************************************************************/
#include "internal/iprt.h"
#include <iprt/asn1.h>
@@ -37,9 +38,9 @@
#include <iprt/formats/asn1.h>
-/*******************************************************************************
-* Global Variables *
-*******************************************************************************/
+/*********************************************************************************************************************************
+* Global Variables *
+*********************************************************************************************************************************/
/** Fixed on-byte constants for small numbers.
* Good for structure version values and such. */
static const uint8_t g_abSmall[] =
diff --git a/src/VBox/Runtime/common/asn1/asn1-ut-null-decode.cpp b/src/VBox/Runtime/common/asn1/asn1-ut-null-decode.cpp
index 905fb5d..a9477d3 100644
--- a/src/VBox/Runtime/common/asn1/asn1-ut-null-decode.cpp
+++ b/src/VBox/Runtime/common/asn1/asn1-ut-null-decode.cpp
@@ -24,9 +24,10 @@
* terms and conditions of either the GPL or the CDDL or both.
*/
-/*******************************************************************************
-* Header Files *
-*******************************************************************************/
+
+/*********************************************************************************************************************************
+* Header Files *
+*********************************************************************************************************************************/
#include "internal/iprt.h"
#include <iprt/asn1.h>
diff --git a/src/VBox/Runtime/common/asn1/asn1-ut-null.cpp b/src/VBox/Runtime/common/asn1/asn1-ut-null.cpp
index f3ae956..a96ccb5 100644
--- a/src/VBox/Runtime/common/asn1/asn1-ut-null.cpp
+++ b/src/VBox/Runtime/common/asn1/asn1-ut-null.cpp
@@ -24,9 +24,10 @@
* terms and conditions of either the GPL or the CDDL or both.
*/
-/*******************************************************************************
-* Header Files *
-*******************************************************************************/
+
+/*********************************************************************************************************************************
+* Header Files *
+*********************************************************************************************************************************/
#include "internal/iprt.h"
#include <iprt/asn1.h>
diff --git a/src/VBox/Runtime/common/asn1/asn1-ut-objid-decode.cpp b/src/VBox/Runtime/common/asn1/asn1-ut-objid-decode.cpp
index 150250c..1567e49 100644
--- a/src/VBox/Runtime/common/asn1/asn1-ut-objid-decode.cpp
+++ b/src/VBox/Runtime/common/asn1/asn1-ut-objid-decode.cpp
@@ -24,9 +24,10 @@
* terms and conditions of either the GPL or the CDDL or both.
*/
-/*******************************************************************************
-* Header Files *
-*******************************************************************************/
+
+/*********************************************************************************************************************************
+* Header Files *
+*********************************************************************************************************************************/
#include "internal/iprt.h"
#include <iprt/asn1.h>
@@ -38,15 +39,15 @@
#include <iprt/formats/asn1.h>
-/*******************************************************************************
-* Global Variables *
-*******************************************************************************/
+/*********************************************************************************************************************************
+* Global Variables *
+*********************************************************************************************************************************/
static char const g_achDigits[11] = "0123456789";
-/*******************************************************************************
-* Internal Functions *
-*******************************************************************************/
+/*********************************************************************************************************************************
+* Internal Functions *
+*********************************************************************************************************************************/
DECLHIDDEN(int) rtAsn1ObjId_InternalFormatComponent(uint32_t uValue, char **ppszObjId, size_t *pcbObjId); /* asn1-ut-objid.cpp */
diff --git a/src/VBox/Runtime/common/asn1/asn1-ut-objid.cpp b/src/VBox/Runtime/common/asn1/asn1-ut-objid.cpp
index e630533..661dcd6 100644
--- a/src/VBox/Runtime/common/asn1/asn1-ut-objid.cpp
+++ b/src/VBox/Runtime/common/asn1/asn1-ut-objid.cpp
@@ -24,9 +24,10 @@
* terms and conditions of either the GPL or the CDDL or both.
*/
-/*******************************************************************************
-* Header Files *
-*******************************************************************************/
+
+/*********************************************************************************************************************************
+* Header Files *
+*********************************************************************************************************************************/
#include "internal/iprt.h"
#include <iprt/asn1.h>
@@ -40,9 +41,9 @@
#include <iprt/formats/asn1.h>
-/*******************************************************************************
-* Global Variables *
-*******************************************************************************/
+/*********************************************************************************************************************************
+* Global Variables *
+*********************************************************************************************************************************/
static char const g_szDefault[] = "2.16.840.1.113894";
static uint32_t const g_auDefault[] = { 2, 16, 840, 1, 113894 };
static uint8_t const g_abDefault[] =
@@ -51,9 +52,9 @@ static uint8_t const g_abDefault[] =
};
-/*******************************************************************************
-* Internal Functions *
-*******************************************************************************/
+/*********************************************************************************************************************************
+* Internal Functions *
+*********************************************************************************************************************************/
DECLHIDDEN(int) rtAsn1ObjId_InternalFormatComponent(uint32_t uValue, char **ppszObjId, size_t *pcbObjId); /* asn1-ut-objid.cpp */
/** @todo check if we really need this. */
diff --git a/src/VBox/Runtime/common/asn1/asn1-ut-octetstring-decode.cpp b/src/VBox/Runtime/common/asn1/asn1-ut-octetstring-decode.cpp
index daadd77..8a1abad 100644
--- a/src/VBox/Runtime/common/asn1/asn1-ut-octetstring-decode.cpp
+++ b/src/VBox/Runtime/common/asn1/asn1-ut-octetstring-decode.cpp
@@ -24,9 +24,10 @@
* terms and conditions of either the GPL or the CDDL or both.
*/
-/*******************************************************************************
-* Header Files *
-*******************************************************************************/
+
+/*********************************************************************************************************************************
+* Header Files *
+*********************************************************************************************************************************/
#include "internal/iprt.h"
#include <iprt/asn1.h>
diff --git a/src/VBox/Runtime/common/asn1/asn1-ut-octetstring.cpp b/src/VBox/Runtime/common/asn1/asn1-ut-octetstring.cpp
index e2fde5b..4246379 100644
--- a/src/VBox/Runtime/common/asn1/asn1-ut-octetstring.cpp
+++ b/src/VBox/Runtime/common/asn1/asn1-ut-octetstring.cpp
@@ -26,9 +26,10 @@
* terms and conditions of either the GPL or the CDDL or both.
*/
-/*******************************************************************************
-* Header Files *
-*******************************************************************************/
+
+/*********************************************************************************************************************************
+* Header Files *
+*********************************************************************************************************************************/
#include "internal/iprt.h"
#include <iprt/asn1.h>
@@ -42,9 +43,9 @@
#include <iprt/formats/asn1.h>
-/*******************************************************************************
-* Structures and Typedefs *
-*******************************************************************************/
+/*********************************************************************************************************************************
+* Structures and Typedefs *
+*********************************************************************************************************************************/
typedef struct RTASN1OCTETSTRINGWRITERCTX
{
/** Pointer to the output buffer. */
diff --git a/src/VBox/Runtime/common/asn1/asn1-ut-string-decode.cpp b/src/VBox/Runtime/common/asn1/asn1-ut-string-decode.cpp
index 020d74c..276fc01 100644
--- a/src/VBox/Runtime/common/asn1/asn1-ut-string-decode.cpp
+++ b/src/VBox/Runtime/common/asn1/asn1-ut-string-decode.cpp
@@ -24,9 +24,10 @@
* terms and conditions of either the GPL or the CDDL or both.
*/
-/*******************************************************************************
-* Header Files *
-*******************************************************************************/
+
+/*********************************************************************************************************************************
+* Header Files *
+*********************************************************************************************************************************/
#include "internal/iprt.h"
#include <iprt/asn1.h>
diff --git a/src/VBox/Runtime/common/asn1/asn1-ut-string.cpp b/src/VBox/Runtime/common/asn1/asn1-ut-string.cpp
index 2fc651b..da12973 100644
--- a/src/VBox/Runtime/common/asn1/asn1-ut-string.cpp
+++ b/src/VBox/Runtime/common/asn1/asn1-ut-string.cpp
@@ -24,9 +24,10 @@
* terms and conditions of either the GPL or the CDDL or both.
*/
-/*******************************************************************************
-* Header Files *
-*******************************************************************************/
+
+/*********************************************************************************************************************************
+* Header Files *
+*********************************************************************************************************************************/
#include "internal/iprt.h"
#include <iprt/asn1.h>
@@ -38,9 +39,9 @@
#include <iprt/formats/asn1.h>
-/*******************************************************************************
-* Global Variables *
-*******************************************************************************/
+/*********************************************************************************************************************************
+* Global Variables *
+*********************************************************************************************************************************/
static uint8_t const g_acbStringTags[] =
{
/* [ASN1_TAG_EOC] = */ 0,
diff --git a/src/VBox/Runtime/common/asn1/asn1-ut-time-decode.cpp b/src/VBox/Runtime/common/asn1/asn1-ut-time-decode.cpp
index ca9e22a..94e1835 100644
--- a/src/VBox/Runtime/common/asn1/asn1-ut-time-decode.cpp
+++ b/src/VBox/Runtime/common/asn1/asn1-ut-time-decode.cpp
@@ -24,9 +24,10 @@
* terms and conditions of either the GPL or the CDDL or both.
*/
-/*******************************************************************************
-* Header Files *
-*******************************************************************************/
+
+/*********************************************************************************************************************************
+* Header Files *
+*********************************************************************************************************************************/
#include "internal/iprt.h"
#include <iprt/asn1.h>
diff --git a/src/VBox/Runtime/common/asn1/asn1-ut-time.cpp b/src/VBox/Runtime/common/asn1/asn1-ut-time.cpp
index 95f1ecb..cb77e27 100644
--- a/src/VBox/Runtime/common/asn1/asn1-ut-time.cpp
+++ b/src/VBox/Runtime/common/asn1/asn1-ut-time.cpp
@@ -24,9 +24,10 @@
* terms and conditions of either the GPL or the CDDL or both.
*/
-/*******************************************************************************
-* Header Files *
-*******************************************************************************/
+
+/*********************************************************************************************************************************
+* Header Files *
+*********************************************************************************************************************************/
#include "internal/iprt.h"
#include <iprt/asn1.h>
@@ -38,9 +39,9 @@
#include <iprt/formats/asn1.h>
-/*******************************************************************************
-* Global Variables *
-*******************************************************************************/
+/*********************************************************************************************************************************
+* Global Variables *
+*********************************************************************************************************************************/
/** The UTC TIME encoding of the IPRT epoch time. */
static const char g_szEpochUtc[] = "700101000000Z";
/** The GENERALIZED TIME encoding of the IPRT epoch time. */
diff --git a/src/VBox/Runtime/common/checksum/RTSha1Digest.cpp b/src/VBox/Runtime/common/checksum/RTSha1Digest.cpp
index 864ab8c..2e2d70f 100644
--- a/src/VBox/Runtime/common/checksum/RTSha1Digest.cpp
+++ b/src/VBox/Runtime/common/checksum/RTSha1Digest.cpp
@@ -28,9 +28,9 @@
*/
-/*******************************************************************************
-* Header Files *
-*******************************************************************************/
+/*********************************************************************************************************************************
+* Header Files *
+*********************************************************************************************************************************/
#include "internal/iprt.h"
#include <iprt/sha.h>
diff --git a/src/VBox/Runtime/common/checksum/RTSha256Digest.cpp b/src/VBox/Runtime/common/checksum/RTSha256Digest.cpp
index 160c93a..305770e 100644
--- a/src/VBox/Runtime/common/checksum/RTSha256Digest.cpp
+++ b/src/VBox/Runtime/common/checksum/RTSha256Digest.cpp
@@ -28,9 +28,9 @@
*/
-/*******************************************************************************
-* Header Files *
-*******************************************************************************/
+/*********************************************************************************************************************************
+* Header Files *
+*********************************************************************************************************************************/
#include "internal/iprt.h"
#include <iprt/sha.h>
diff --git a/src/VBox/Runtime/common/checksum/adler32.cpp b/src/VBox/Runtime/common/checksum/adler32.cpp
index 371e234..c524818 100644
--- a/src/VBox/Runtime/common/checksum/adler32.cpp
+++ b/src/VBox/Runtime/common/checksum/adler32.cpp
@@ -25,9 +25,9 @@
*/
-/*******************************************************************************
-* Header Files *
-*******************************************************************************/
+/*********************************************************************************************************************************
+* Header Files *
+*********************************************************************************************************************************/
#include <iprt/crc.h>
#include "internal/iprt.h"
@@ -35,9 +35,9 @@
#include <iprt/assert.h>
-/*******************************************************************************
-* Defined Constants And Macros *
-*******************************************************************************/
+/*********************************************************************************************************************************
+* Defined Constants And Macros *
+*********************************************************************************************************************************/
#define RTCRC_ADLER_32_NUMBER 65521
diff --git a/src/VBox/Runtime/common/checksum/alt-md2.cpp b/src/VBox/Runtime/common/checksum/alt-md2.cpp
index 058b223..dd10c1c 100644
--- a/src/VBox/Runtime/common/checksum/alt-md2.cpp
+++ b/src/VBox/Runtime/common/checksum/alt-md2.cpp
@@ -25,18 +25,18 @@
*/
-/*******************************************************************************
-* Defined Constants And Macros *
-*******************************************************************************/
+/*********************************************************************************************************************************
+* Defined Constants And Macros *
+*********************************************************************************************************************************/
/** The MD2 block size. */
#define RTMD2_BLOCK_SIZE 16
/** The offset of the buffer into RTMD2ALTPRIVATECTX::abStateX. */
#define RTMD2_BUF_OFF RTMD2_BLOCK_SIZE
-/*******************************************************************************
-* Header Files *
-*******************************************************************************/
+/*********************************************************************************************************************************
+* Header Files *
+*********************************************************************************************************************************/
#include "internal/iprt.h"
#include <iprt/types.h>
@@ -62,9 +62,9 @@ typedef struct RTMD2ALTPRIVATECTX
AssertCompile(RT_SIZEOFMEMB(RTMD2CONTEXT, abPadding) >= RT_SIZEOFMEMB(RTMD2CONTEXT, AltPrivate));
-/*******************************************************************************
-* Global Variables *
-*******************************************************************************/
+/*********************************************************************************************************************************
+* Global Variables *
+*********************************************************************************************************************************/
/** PI substitation used by MD2. */
static uint8_t const g_PiSubst[256] =
{
diff --git a/src/VBox/Runtime/common/checksum/alt-md5.cpp b/src/VBox/Runtime/common/checksum/alt-md5.cpp
index 84e93f2..8a6e9ce 100644
--- a/src/VBox/Runtime/common/checksum/alt-md5.cpp
+++ b/src/VBox/Runtime/common/checksum/alt-md5.cpp
@@ -45,9 +45,10 @@
* will fill a supplied 16-byte array with the digest.
*/
-/*******************************************************************************
-* Header Files *
-*******************************************************************************/
+
+/*********************************************************************************************************************************
+* Header Files *
+*********************************************************************************************************************************/
#include <iprt/md5.h>
#include "internal/iprt.h"
@@ -57,9 +58,9 @@
#endif
-/*******************************************************************************
-* Defined Constants And Macros *
-*******************************************************************************/
+/*********************************************************************************************************************************
+* Defined Constants And Macros *
+*********************************************************************************************************************************/
/* The four core functions - F1 is optimized somewhat */
#if 1
/* #define F1(x, y, z) (x & y | ~x & z) */
diff --git a/src/VBox/Runtime/common/checksum/alt-sha1.cpp b/src/VBox/Runtime/common/checksum/alt-sha1.cpp
index b0f9a0d..5526929 100644
--- a/src/VBox/Runtime/common/checksum/alt-sha1.cpp
+++ b/src/VBox/Runtime/common/checksum/alt-sha1.cpp
@@ -25,9 +25,9 @@
*/
-/*******************************************************************************
-* Defined Constants And Macros *
-*******************************************************************************/
+/*********************************************************************************************************************************
+* Defined Constants And Macros *
+*********************************************************************************************************************************/
/** The SHA-1 block size (in bytes). */
#define RTSHA1_BLOCK_SIZE 64U
@@ -35,9 +35,9 @@
#define RTSHA1_UNROLLED 1
-/*******************************************************************************
-* Header Files *
-*******************************************************************************/
+/*********************************************************************************************************************************
+* Header Files *
+*********************************************************************************************************************************/
#include "internal/iprt.h"
#include <iprt/types.h>
#include <iprt/assert.h>
@@ -441,7 +441,7 @@ RTDECL(void) RTSha1Update(PRTSHA1CONTEXT pCtx, const void *pvBuf, size_t cbBuf)
RT_EXPORT_SYMBOL(RTSha1Update);
-RTDECL(void) RTSha1Final(PRTSHA1CONTEXT pCtx, uint8_t pabDigest[RTSHA1_HASH_SIZE])
+static void rtSha1FinalInternal(PRTSHA1CONTEXT pCtx)
{
Assert(pCtx->AltPrivate.cbMessage < UINT64_MAX / 2);
@@ -480,12 +480,22 @@ RTDECL(void) RTSha1Final(PRTSHA1CONTEXT pCtx, uint8_t pabDigest[RTSHA1_HASH_SIZE
pCtx->AltPrivate.auH[2] = RT_H2BE_U32(pCtx->AltPrivate.auH[2]);
pCtx->AltPrivate.auH[3] = RT_H2BE_U32(pCtx->AltPrivate.auH[3]);
pCtx->AltPrivate.auH[4] = RT_H2BE_U32(pCtx->AltPrivate.auH[4]);
+}
- memcpy(pabDigest, &pCtx->AltPrivate.auH[0], RTSHA1_HASH_SIZE);
+DECLINLINE(void) rtSha1WipeCtx(PRTSHA1CONTEXT pCtx)
+{
RT_ZERO(pCtx->AltPrivate);
pCtx->AltPrivate.cbMessage = UINT64_MAX;
}
+
+
+RTDECL(void) RTSha1Final(PRTSHA1CONTEXT pCtx, uint8_t pabDigest[RTSHA1_HASH_SIZE])
+{
+ rtSha1FinalInternal(pCtx);
+ memcpy(pabDigest, &pCtx->AltPrivate.auH[0], RTSHA1_HASH_SIZE);
+ rtSha1WipeCtx(pCtx);
+}
RT_EXPORT_SYMBOL(RTSha1Final);
@@ -498,3 +508,18 @@ RTDECL(void) RTSha1(const void *pvBuf, size_t cbBuf, uint8_t pabDigest[RTSHA1_HA
}
RT_EXPORT_SYMBOL(RTSha1);
+
+RTDECL(bool) RTSha1Check(const void *pvBuf, size_t cbBuf, uint8_t const pabHash[RTSHA1_HASH_SIZE])
+{
+ RTSHA1CONTEXT Ctx;
+ RTSha1Init(&Ctx);
+ RTSha1Update(&Ctx, pvBuf, cbBuf);
+ rtSha1FinalInternal(&Ctx);
+
+ bool fRet = memcmp(pabHash, &Ctx.AltPrivate.auH[0], RTSHA1_HASH_SIZE) == 0;
+
+ rtSha1WipeCtx(&Ctx);
+ return fRet;
+}
+RT_EXPORT_SYMBOL(RTSha1Check);
+
diff --git a/src/VBox/Runtime/common/checksum/alt-sha256.cpp b/src/VBox/Runtime/common/checksum/alt-sha256.cpp
index 987f45e..4c40d3c 100644
--- a/src/VBox/Runtime/common/checksum/alt-sha256.cpp
+++ b/src/VBox/Runtime/common/checksum/alt-sha256.cpp
@@ -25,9 +25,9 @@
*/
-/*******************************************************************************
-* Defined Constants And Macros *
-*******************************************************************************/
+/*********************************************************************************************************************************
+* Defined Constants And Macros *
+*********************************************************************************************************************************/
/** The SHA-256 block size (in bytes). */
#define RTSHA256_BLOCK_SIZE 64U
@@ -35,9 +35,9 @@
#define RTSHA256_UNROLLED 1
-/*******************************************************************************
-* Header Files *
-*******************************************************************************/
+/*********************************************************************************************************************************
+* Header Files *
+*********************************************************************************************************************************/
#include "internal/iprt.h"
#include <iprt/types.h>
#include <iprt/assert.h>
@@ -67,9 +67,9 @@ AssertCompile(RT_SIZEOFMEMB(RTSHA256CONTEXT, abPadding) >= RT_SIZEOFMEMB(RTSHA25
AssertCompileMemberSize(RTSHA256ALTPRIVATECTX, auH, RTSHA256_HASH_SIZE);
-/*******************************************************************************
-* Global Variables *
-*******************************************************************************/
+/*********************************************************************************************************************************
+* Global Variables *
+*********************************************************************************************************************************/
#ifndef RTSHA256_UNROLLED
/** The K constants */
static uint32_t const g_auKs[] =
@@ -606,6 +606,21 @@ RTDECL(void) RTSha256(const void *pvBuf, size_t cbBuf, uint8_t pabDigest[RTSHA25
RT_EXPORT_SYMBOL(RTSha256);
+RTDECL(bool) RTSha256Check(const void *pvBuf, size_t cbBuf, uint8_t const pabHash[RTSHA256_HASH_SIZE])
+{
+ RTSHA256CONTEXT Ctx;
+ RTSha256Init(&Ctx);
+ RTSha256Update(&Ctx, pvBuf, cbBuf);
+ rtSha256FinalInternal(&Ctx);
+
+ bool fRet = memcmp(pabHash, &Ctx.AltPrivate.auH[0], RTSHA256_HASH_SIZE) == 0;
+
+ RT_ZERO(Ctx.AltPrivate.auH);
+ return fRet;
+}
+RT_EXPORT_SYMBOL(RTSha256Check);
+
+
/*
* SHA-224 is just SHA-256 with different initial values an a truncated result.
@@ -651,3 +666,18 @@ RTDECL(void) RTSha224(const void *pvBuf, size_t cbBuf, uint8_t pabDigest[RTSHA22
}
RT_EXPORT_SYMBOL(RTSha224);
+
+RTDECL(bool) RTSha224Check(const void *pvBuf, size_t cbBuf, uint8_t const pabHash[RTSHA224_HASH_SIZE])
+{
+ RTSHA224CONTEXT Ctx;
+ RTSha224Init(&Ctx);
+ RTSha224Update(&Ctx, pvBuf, cbBuf);
+ rtSha256FinalInternal(&Ctx);
+
+ bool fRet = memcmp(pabHash, &Ctx.AltPrivate.auH[0], RTSHA224_HASH_SIZE) == 0;
+
+ RT_ZERO(Ctx.AltPrivate.auH);
+ return fRet;
+}
+RT_EXPORT_SYMBOL(RTSha224Check);
+
diff --git a/src/VBox/Runtime/common/checksum/alt-sha512.cpp b/src/VBox/Runtime/common/checksum/alt-sha512.cpp
index 775f88f..fdf1169 100644
--- a/src/VBox/Runtime/common/checksum/alt-sha512.cpp
+++ b/src/VBox/Runtime/common/checksum/alt-sha512.cpp
@@ -25,9 +25,9 @@
*/
-/*******************************************************************************
-* Defined Constants And Macros *
-*******************************************************************************/
+/*********************************************************************************************************************************
+* Defined Constants And Macros *
+*********************************************************************************************************************************/
/** The SHA-512 block size (in bytes). */
#define RTSHA512_BLOCK_SIZE 128U
@@ -35,9 +35,9 @@
#define RTSHA512_UNROLLED 1
-/*******************************************************************************
-* Header Files *
-*******************************************************************************/
+/*********************************************************************************************************************************
+* Header Files *
+*********************************************************************************************************************************/
#include "internal/iprt.h"
#include <iprt/types.h>
#include <iprt/assert.h>
@@ -67,9 +67,9 @@ AssertCompile(RT_SIZEOFMEMB(RTSHA512CONTEXT, abPadding) >= RT_SIZEOFMEMB(RTSHA51
AssertCompileMemberSize(RTSHA512ALTPRIVATECTX, auH, RTSHA512_HASH_SIZE);
-/*******************************************************************************
-* Global Variables *
-*******************************************************************************/
+/*********************************************************************************************************************************
+* Global Variables *
+*********************************************************************************************************************************/
#ifndef RTSHA512_UNROLLED
/** The K constants. */
static uint64_t const g_auKs[] =
@@ -595,6 +595,21 @@ RTDECL(void) RTSha512(const void *pvBuf, size_t cbBuf, uint8_t pabDigest[RTSHA51
RT_EXPORT_SYMBOL(RTSha512);
+RTDECL(bool) RTSha512Check(const void *pvBuf, size_t cbBuf, uint8_t const pabHash[RTSHA512_HASH_SIZE])
+{
+ RTSHA512CONTEXT Ctx;
+ RTSha512Init(&Ctx);
+ RTSha512Update(&Ctx, pvBuf, cbBuf);
+ rtSha512FinalInternal(&Ctx);
+
+ bool fRet = memcmp(pabHash, &Ctx.AltPrivate.auH[0], RTSHA512_HASH_SIZE) == 0;
+
+ RT_ZERO(Ctx.AltPrivate.auH);
+ return fRet;
+}
+RT_EXPORT_SYMBOL(RTSha512Check);
+
+
/*
* SHA-384 is just SHA-512 with different initial values an a truncated result.
@@ -642,6 +657,21 @@ RTDECL(void) RTSha384(const void *pvBuf, size_t cbBuf, uint8_t pabDigest[RTSHA38
RT_EXPORT_SYMBOL(RTSha384);
+RTDECL(bool) RTSha384Check(const void *pvBuf, size_t cbBuf, uint8_t const pabHash[RTSHA384_HASH_SIZE])
+{
+ RTSHA384CONTEXT Ctx;
+ RTSha384Init(&Ctx);
+ RTSha384Update(&Ctx, pvBuf, cbBuf);
+ rtSha512FinalInternal(&Ctx);
+
+ bool fRet = memcmp(pabHash, &Ctx.AltPrivate.auH[0], RTSHA384_HASH_SIZE) == 0;
+
+ RT_ZERO(Ctx.AltPrivate.auH);
+ return fRet;
+}
+RT_EXPORT_SYMBOL(RTSha384Check);
+
+
/*
* SHA-512/224 is just SHA-512 with different initial values an a truncated result.
*/
@@ -688,6 +718,21 @@ RTDECL(void) RTSha512t224(const void *pvBuf, size_t cbBuf, uint8_t pabDigest[RTS
RT_EXPORT_SYMBOL(RTSha512t224);
+RTDECL(bool) RTSha512t224Check(const void *pvBuf, size_t cbBuf, uint8_t const pabHash[RTSHA512T224_HASH_SIZE])
+{
+ RTSHA512T224CONTEXT Ctx;
+ RTSha512t224Init(&Ctx);
+ RTSha512t224Update(&Ctx, pvBuf, cbBuf);
+ rtSha512FinalInternal(&Ctx);
+
+ bool fRet = memcmp(pabHash, &Ctx.AltPrivate.auH[0], RTSHA512T224_HASH_SIZE) == 0;
+
+ RT_ZERO(Ctx.AltPrivate.auH);
+ return fRet;
+}
+RT_EXPORT_SYMBOL(RTSha512t224Check);
+
+
/*
* SHA-512/256 is just SHA-512 with different initial values an a truncated result.
*/
@@ -733,3 +778,18 @@ RTDECL(void) RTSha512t256(const void *pvBuf, size_t cbBuf, uint8_t pabDigest[RTS
}
RT_EXPORT_SYMBOL(RTSha512t256);
+
+RTDECL(bool) RTSha512t256Check(const void *pvBuf, size_t cbBuf, uint8_t const pabHash[RTSHA512T256_HASH_SIZE])
+{
+ RTSHA512T256CONTEXT Ctx;
+ RTSha512t256Init(&Ctx);
+ RTSha512t256Update(&Ctx, pvBuf, cbBuf);
+ rtSha512FinalInternal(&Ctx);
+
+ bool fRet = memcmp(pabHash, &Ctx.AltPrivate.auH[0], RTSHA512T256_HASH_SIZE) == 0;
+
+ RT_ZERO(Ctx.AltPrivate.auH);
+ return fRet;
+}
+RT_EXPORT_SYMBOL(RTSha512t256Check);
+
diff --git a/src/VBox/Runtime/common/checksum/crc32-zlib.cpp b/src/VBox/Runtime/common/checksum/crc32-zlib.cpp
index ebc96ea..e0dacca 100644
--- a/src/VBox/Runtime/common/checksum/crc32-zlib.cpp
+++ b/src/VBox/Runtime/common/checksum/crc32-zlib.cpp
@@ -25,9 +25,9 @@
*/
-/*******************************************************************************
-* Header Files *
-*******************************************************************************/
+/*********************************************************************************************************************************
+* Header Files *
+*********************************************************************************************************************************/
#include "internal/iprt.h"
#include <iprt/crc.h>
diff --git a/src/VBox/Runtime/common/checksum/crc64.cpp b/src/VBox/Runtime/common/checksum/crc64.cpp
index 91e7d6d..bb0e250 100644
--- a/src/VBox/Runtime/common/checksum/crc64.cpp
+++ b/src/VBox/Runtime/common/checksum/crc64.cpp
@@ -30,16 +30,16 @@
*/
-/*******************************************************************************
-* Header Files *
-*******************************************************************************/
+/*********************************************************************************************************************************
+* Header Files *
+*********************************************************************************************************************************/
#include <iprt/crc.h>
#include "internal/iprt.h"
-/*******************************************************************************
-* Global Variables *
-*******************************************************************************/
+/*********************************************************************************************************************************
+* Global Variables *
+*********************************************************************************************************************************/
/**
* Lookup table (precomputed CRC64 values for each 8 bit string) computation
* takes into account the fact that the reverse polynom has zeros in lower 8 bits:
diff --git a/src/VBox/Runtime/common/checksum/ipv4.cpp b/src/VBox/Runtime/common/checksum/ipv4.cpp
index 1e8c4e8..209484b 100644
--- a/src/VBox/Runtime/common/checksum/ipv4.cpp
+++ b/src/VBox/Runtime/common/checksum/ipv4.cpp
@@ -25,9 +25,9 @@
*/
-/*******************************************************************************
-* Header Files *
-*******************************************************************************/
+/*********************************************************************************************************************************
+* Header Files *
+*********************************************************************************************************************************/
#include <iprt/net.h>
#include "internal/iprt.h"
diff --git a/src/VBox/Runtime/common/checksum/ipv6.cpp b/src/VBox/Runtime/common/checksum/ipv6.cpp
index 8a74d12..4c19af1 100644
--- a/src/VBox/Runtime/common/checksum/ipv6.cpp
+++ b/src/VBox/Runtime/common/checksum/ipv6.cpp
@@ -25,9 +25,9 @@
*/
-/*******************************************************************************
-* Header Files *
-*******************************************************************************/
+/*********************************************************************************************************************************
+* Header Files *
+*********************************************************************************************************************************/
#include <iprt/net.h>
#include "internal/iprt.h"
diff --git a/src/VBox/Runtime/common/checksum/manifest-file.cpp b/src/VBox/Runtime/common/checksum/manifest-file.cpp
index d41e196..31be4e2 100644
--- a/src/VBox/Runtime/common/checksum/manifest-file.cpp
+++ b/src/VBox/Runtime/common/checksum/manifest-file.cpp
@@ -25,9 +25,9 @@
*/
-/*******************************************************************************
-* Header Files *
-*******************************************************************************/
+/*********************************************************************************************************************************
+* Header Files *
+*********************************************************************************************************************************/
#include "internal/iprt.h"
#include <iprt/manifest.h>
diff --git a/src/VBox/Runtime/common/checksum/manifest.cpp b/src/VBox/Runtime/common/checksum/manifest.cpp
index 3e9e564..8720721 100644
--- a/src/VBox/Runtime/common/checksum/manifest.cpp
+++ b/src/VBox/Runtime/common/checksum/manifest.cpp
@@ -25,9 +25,9 @@
*/
-/*******************************************************************************
-* Header Files *
-*******************************************************************************/
+/*********************************************************************************************************************************
+* Header Files *
+*********************************************************************************************************************************/
#include "internal/iprt.h"
#include <iprt/manifest.h>
@@ -40,9 +40,9 @@
#include <iprt/string.h>
-/*******************************************************************************
-* Structures and Typedefs *
-*******************************************************************************/
+/*********************************************************************************************************************************
+* Structures and Typedefs *
+*********************************************************************************************************************************/
/**
* Internal per file structure used by RTManifestVerify
*/
@@ -89,7 +89,7 @@ DECLINLINE(size_t) rtManifestIndexOfCharInBuf(char const *pv, size_t cb, char c)
return cb;
}
-int rtSHAProgressCallback(unsigned uPercent, void *pvUser)
+static DECLCALLBACK(int) rtSHAProgressCallback(unsigned uPercent, void *pvUser)
{
PRTMANIFESTCALLBACKDATA pData = (PRTMANIFESTCALLBACKDATA)pvUser;
return pData->pfnProgressCallback((unsigned)( (uPercent + (float)pData->cCurrentFile * 100.0)
diff --git a/src/VBox/Runtime/common/checksum/manifest2.cpp b/src/VBox/Runtime/common/checksum/manifest2.cpp
index c3dc8e1..1f18c0e 100644
--- a/src/VBox/Runtime/common/checksum/manifest2.cpp
+++ b/src/VBox/Runtime/common/checksum/manifest2.cpp
@@ -25,9 +25,9 @@
*/
-/*******************************************************************************
-* Header Files *
-*******************************************************************************/
+/*********************************************************************************************************************************
+* Header Files *
+*********************************************************************************************************************************/
#include "internal/iprt.h"
#include <iprt/manifest.h>
@@ -45,9 +45,9 @@
#include "internal/magics.h"
-/*******************************************************************************
-* Structures and Typedefs *
-*******************************************************************************/
+/*********************************************************************************************************************************
+* Structures and Typedefs *
+*********************************************************************************************************************************/
/**
* Manifest attribute.
*
diff --git a/src/VBox/Runtime/common/checksum/manifest3.cpp b/src/VBox/Runtime/common/checksum/manifest3.cpp
index 3a0acf3..8e47d06 100644
--- a/src/VBox/Runtime/common/checksum/manifest3.cpp
+++ b/src/VBox/Runtime/common/checksum/manifest3.cpp
@@ -25,9 +25,9 @@
*/
-/*******************************************************************************
-* Header Files *
-*******************************************************************************/
+/*********************************************************************************************************************************
+* Header Files *
+*********************************************************************************************************************************/
#include "internal/iprt.h"
#include <iprt/manifest.h>
@@ -43,9 +43,9 @@
#include <iprt/vfslowlevel.h>
-/*******************************************************************************
-* Structures and Typedefs *
-*******************************************************************************/
+/*********************************************************************************************************************************
+* Structures and Typedefs *
+*********************************************************************************************************************************/
/**
* Hashes data.
*
diff --git a/src/VBox/Runtime/common/checksum/md2str.cpp b/src/VBox/Runtime/common/checksum/md2str.cpp
index d78aaca..2c7bf2e 100644
--- a/src/VBox/Runtime/common/checksum/md2str.cpp
+++ b/src/VBox/Runtime/common/checksum/md2str.cpp
@@ -25,9 +25,9 @@
*/
-/*******************************************************************************
-* Header Files *
-*******************************************************************************/
+/*********************************************************************************************************************************
+* Header Files *
+*********************************************************************************************************************************/
#include "internal/iprt.h"
#include <iprt/md2.h>
diff --git a/src/VBox/Runtime/common/checksum/md5str.cpp b/src/VBox/Runtime/common/checksum/md5str.cpp
index 7dd6e5e..5049860 100644
--- a/src/VBox/Runtime/common/checksum/md5str.cpp
+++ b/src/VBox/Runtime/common/checksum/md5str.cpp
@@ -25,9 +25,9 @@
*/
-/*******************************************************************************
-* Header Files *
-*******************************************************************************/
+/*********************************************************************************************************************************
+* Header Files *
+*********************************************************************************************************************************/
#include "internal/iprt.h"
#include <iprt/md5.h>
diff --git a/src/VBox/Runtime/common/checksum/openssl-md2.cpp b/src/VBox/Runtime/common/checksum/openssl-md2.cpp
index 07e82ff..c878c4c 100644
--- a/src/VBox/Runtime/common/checksum/openssl-md2.cpp
+++ b/src/VBox/Runtime/common/checksum/openssl-md2.cpp
@@ -25,9 +25,9 @@
*/
-/*******************************************************************************
-* Header Files *
-*******************************************************************************/
+/*********************************************************************************************************************************
+* Header Files *
+*********************************************************************************************************************************/
#include "internal/iprt.h"
#include <openssl/opensslconf.h>
diff --git a/src/VBox/Runtime/common/checksum/openssl-md5.cpp b/src/VBox/Runtime/common/checksum/openssl-md5.cpp
index 6fa2dba..0c93b52 100644
--- a/src/VBox/Runtime/common/checksum/openssl-md5.cpp
+++ b/src/VBox/Runtime/common/checksum/openssl-md5.cpp
@@ -25,9 +25,9 @@
*/
-/*******************************************************************************
-* Header Files *
-*******************************************************************************/
+/*********************************************************************************************************************************
+* Header Files *
+*********************************************************************************************************************************/
#include "internal/iprt.h"
#include <openssl/md5.h>
diff --git a/src/VBox/Runtime/common/checksum/openssl-sha1.cpp b/src/VBox/Runtime/common/checksum/openssl-sha1.cpp
index bb84180..98e566a 100644
--- a/src/VBox/Runtime/common/checksum/openssl-sha1.cpp
+++ b/src/VBox/Runtime/common/checksum/openssl-sha1.cpp
@@ -25,9 +25,9 @@
*/
-/*******************************************************************************
-* Header Files *
-*******************************************************************************/
+/*********************************************************************************************************************************
+* Header Files *
+*********************************************************************************************************************************/
#include "internal/iprt.h"
#include <openssl/sha.h>
@@ -36,6 +36,8 @@
#include <iprt/sha.h>
#include <iprt/assert.h>
+#include <iprt/string.h>
+
AssertCompile(RT_SIZEOFMEMB(RTSHA1CONTEXT, abPadding) >= RT_SIZEOFMEMB(RTSHA1CONTEXT, Private));
@@ -50,6 +52,20 @@ RTDECL(void) RTSha1(const void *pvBuf, size_t cbBuf, uint8_t pabDigest[RTSHA1_HA
RT_EXPORT_SYMBOL(RTSha1);
+RTDECL(bool) RTSha1Check(const void *pvBuf, size_t cbBuf, uint8_t const pabDigest[RTSHA1_HASH_SIZE])
+{
+ RTSHA1CONTEXT Ctx;
+ RTSha1Init(&Ctx);
+ RTSha1Update(&Ctx, pvBuf, cbBuf);
+ uint8_t abActualDigest[RTSHA1_HASH_SIZE];
+ RTSha1Final(&Ctx, abActualDigest);
+ bool fRet = memcmp(pabDigest, abActualDigest, RTSHA1_HASH_SIZE) == 0;
+ RT_ZERO(abActualDigest);
+ return fRet;
+}
+RT_EXPORT_SYMBOL(RTSha1Check);
+
+
RTDECL(void) RTSha1Init(PRTSHA1CONTEXT pCtx)
{
SHA1_Init(&pCtx->Private);
@@ -64,7 +80,7 @@ RTDECL(void) RTSha1Update(PRTSHA1CONTEXT pCtx, const void *pvBuf, size_t cbBuf)
RT_EXPORT_SYMBOL(RTSha1Update);
-RTDECL(void) RTSha1Final(PRTSHA1CONTEXT pCtx, uint8_t pabDigest[32])
+RTDECL(void) RTSha1Final(PRTSHA1CONTEXT pCtx, uint8_t pabDigest[RTSHA1_HASH_SIZE])
{
SHA1_Final((unsigned char *)&pabDigest[0], &pCtx->Private);
}
diff --git a/src/VBox/Runtime/common/checksum/openssl-sha256.cpp b/src/VBox/Runtime/common/checksum/openssl-sha256.cpp
index affdddc..81d24fd 100644
--- a/src/VBox/Runtime/common/checksum/openssl-sha256.cpp
+++ b/src/VBox/Runtime/common/checksum/openssl-sha256.cpp
@@ -25,9 +25,9 @@
*/
-/*******************************************************************************
-* Header Files *
-*******************************************************************************/
+/*********************************************************************************************************************************
+* Header Files *
+*********************************************************************************************************************************/
#include "internal/iprt.h"
#include <openssl/sha.h>
@@ -36,6 +36,8 @@
#include <iprt/sha.h>
#include <iprt/assert.h>
+#include <iprt/string.h>
+
AssertCompile(RT_SIZEOFMEMB(RTSHA256CONTEXT, abPadding) >= RT_SIZEOFMEMB(RTSHA256CONTEXT, Private));
@@ -50,6 +52,20 @@ RTDECL(void) RTSha256(const void *pvBuf, size_t cbBuf, uint8_t pabDigest[RTSHA25
RT_EXPORT_SYMBOL(RTSha256);
+RTDECL(bool) RTSha256Check(const void *pvBuf, size_t cbBuf, uint8_t const pabDigest[RTSHA256_HASH_SIZE])
+{
+ RTSHA256CONTEXT Ctx;
+ RTSha256Init(&Ctx);
+ RTSha256Update(&Ctx, pvBuf, cbBuf);
+ uint8_t abActualDigest[RTSHA256_HASH_SIZE];
+ RTSha256Final(&Ctx, abActualDigest);
+ bool fRet = memcmp(pabDigest, abActualDigest, RTSHA256_HASH_SIZE) == 0;
+ RT_ZERO(abActualDigest);
+ return fRet;
+}
+RT_EXPORT_SYMBOL(RTSha256Check);
+
+
RTDECL(void) RTSha256Init(PRTSHA256CONTEXT pCtx)
{
SHA256_Init(&pCtx->Private);
@@ -86,6 +102,20 @@ RTDECL(void) RTSha224(const void *pvBuf, size_t cbBuf, uint8_t pabDigest[RTSHA22
RT_EXPORT_SYMBOL(RTSha224);
+RTDECL(bool) RTSha224Check(const void *pvBuf, size_t cbBuf, uint8_t const pabDigest[RTSHA224_HASH_SIZE])
+{
+ RTSHA224CONTEXT Ctx;
+ RTSha224Init(&Ctx);
+ RTSha224Update(&Ctx, pvBuf, cbBuf);
+ uint8_t abActualDigest[RTSHA224_HASH_SIZE];
+ RTSha224Final(&Ctx, abActualDigest);
+ bool fRet = memcmp(pabDigest, abActualDigest, RTSHA224_HASH_SIZE) == 0;
+ RT_ZERO(abActualDigest);
+ return fRet;
+}
+RT_EXPORT_SYMBOL(RTSha224Check);
+
+
RTDECL(void) RTSha224Init(PRTSHA224CONTEXT pCtx)
{
SHA224_Init(&pCtx->Private);
diff --git a/src/VBox/Runtime/common/checksum/openssl-sha512.cpp b/src/VBox/Runtime/common/checksum/openssl-sha512.cpp
index 83ea9d5..10a728b 100644
--- a/src/VBox/Runtime/common/checksum/openssl-sha512.cpp
+++ b/src/VBox/Runtime/common/checksum/openssl-sha512.cpp
@@ -25,9 +25,9 @@
*/
-/*******************************************************************************
-* Header Files *
-*******************************************************************************/
+/*********************************************************************************************************************************
+* Header Files *
+*********************************************************************************************************************************/
#include "internal/iprt.h"
#include <openssl/sha.h>
@@ -36,6 +36,8 @@
#include <iprt/sha.h>
#include <iprt/assert.h>
+#include <iprt/string.h>
+
AssertCompile(RT_SIZEOFMEMB(RTSHA512CONTEXT, abPadding) >= RT_SIZEOFMEMB(RTSHA512CONTEXT, Private));
@@ -50,6 +52,20 @@ RTDECL(void) RTSha512(const void *pvBuf, size_t cbBuf, uint8_t pabDigest[RTSHA51
RT_EXPORT_SYMBOL(RTSha512);
+RTDECL(bool) RTSha512Check(const void *pvBuf, size_t cbBuf, uint8_t const pabDigest[RTSHA512_HASH_SIZE])
+{
+ RTSHA512CONTEXT Ctx;
+ RTSha512Init(&Ctx);
+ RTSha512Update(&Ctx, pvBuf, cbBuf);
+ uint8_t abActualDigest[RTSHA512_HASH_SIZE];
+ RTSha512Final(&Ctx, abActualDigest);
+ bool fRet = memcmp(pabDigest, abActualDigest, RTSHA512_HASH_SIZE) == 0;
+ RT_ZERO(abActualDigest);
+ return fRet;
+}
+RT_EXPORT_SYMBOL(RTSha512Check);
+
+
RTDECL(void) RTSha512Init(PRTSHA512CONTEXT pCtx)
{
SHA512_Init(&pCtx->Private);
@@ -87,6 +103,20 @@ RTDECL(void) RTSha384(const void *pvBuf, size_t cbBuf, uint8_t pabDigest[RTSHA38
RT_EXPORT_SYMBOL(RTSha384);
+RTDECL(bool) RTSha384Check(const void *pvBuf, size_t cbBuf, uint8_t const pabDigest[RTSHA384_HASH_SIZE])
+{
+ RTSHA384CONTEXT Ctx;
+ RTSha384Init(&Ctx);
+ RTSha384Update(&Ctx, pvBuf, cbBuf);
+ uint8_t abActualDigest[RTSHA384_HASH_SIZE];
+ RTSha384Final(&Ctx, abActualDigest);
+ bool fRet = memcmp(pabDigest, abActualDigest, RTSHA384_HASH_SIZE) == 0;
+ RT_ZERO(abActualDigest);
+ return fRet;
+}
+RT_EXPORT_SYMBOL(RTSha384Check);
+
+
RTDECL(void) RTSha384Init(PRTSHA384CONTEXT pCtx)
{
SHA384_Init(&pCtx->Private);
diff --git a/src/VBox/Runtime/common/checksum/sha1str.cpp b/src/VBox/Runtime/common/checksum/sha1str.cpp
index 85f0835..f03d9ef 100644
--- a/src/VBox/Runtime/common/checksum/sha1str.cpp
+++ b/src/VBox/Runtime/common/checksum/sha1str.cpp
@@ -25,9 +25,9 @@
*/
-/*******************************************************************************
-* Header Files *
-*******************************************************************************/
+/*********************************************************************************************************************************
+* Header Files *
+*********************************************************************************************************************************/
#include "internal/iprt.h"
#include <iprt/sha.h>
diff --git a/src/VBox/Runtime/common/checksum/sha224str.cpp b/src/VBox/Runtime/common/checksum/sha224str.cpp
index 0a724b9..dc2b159 100644
--- a/src/VBox/Runtime/common/checksum/sha224str.cpp
+++ b/src/VBox/Runtime/common/checksum/sha224str.cpp
@@ -25,9 +25,9 @@
*/
-/*******************************************************************************
-* Header Files *
-*******************************************************************************/
+/*********************************************************************************************************************************
+* Header Files *
+*********************************************************************************************************************************/
#include "internal/iprt.h"
#include <iprt/sha.h>
diff --git a/src/VBox/Runtime/common/checksum/sha256str.cpp b/src/VBox/Runtime/common/checksum/sha256str.cpp
index 2b6ad5a..900bc74 100644
--- a/src/VBox/Runtime/common/checksum/sha256str.cpp
+++ b/src/VBox/Runtime/common/checksum/sha256str.cpp
@@ -25,9 +25,9 @@
*/
-/*******************************************************************************
-* Header Files *
-*******************************************************************************/
+/*********************************************************************************************************************************
+* Header Files *
+*********************************************************************************************************************************/
#include "internal/iprt.h"
#include <iprt/sha.h>
diff --git a/src/VBox/Runtime/common/checksum/sha384str.cpp b/src/VBox/Runtime/common/checksum/sha384str.cpp
index d841cf9..3cf3278 100644
--- a/src/VBox/Runtime/common/checksum/sha384str.cpp
+++ b/src/VBox/Runtime/common/checksum/sha384str.cpp
@@ -25,9 +25,9 @@
*/
-/*******************************************************************************
-* Header Files *
-*******************************************************************************/
+/*********************************************************************************************************************************
+* Header Files *
+*********************************************************************************************************************************/
#include "internal/iprt.h"
#include <iprt/sha.h>
diff --git a/src/VBox/Runtime/common/checksum/sha512str.cpp b/src/VBox/Runtime/common/checksum/sha512str.cpp
index bc30e0e..9813a82 100644
--- a/src/VBox/Runtime/common/checksum/sha512str.cpp
+++ b/src/VBox/Runtime/common/checksum/sha512str.cpp
@@ -25,9 +25,9 @@
*/
-/*******************************************************************************
-* Header Files *
-*******************************************************************************/
+/*********************************************************************************************************************************
+* Header Files *
+*********************************************************************************************************************************/
#include "internal/iprt.h"
#include <iprt/sha.h>
diff --git a/src/VBox/Runtime/common/checksum/sha512t224str.cpp b/src/VBox/Runtime/common/checksum/sha512t224str.cpp
index 02440e7..e68c530 100644
--- a/src/VBox/Runtime/common/checksum/sha512t224str.cpp
+++ b/src/VBox/Runtime/common/checksum/sha512t224str.cpp
@@ -25,9 +25,9 @@
*/
-/*******************************************************************************
-* Header Files *
-*******************************************************************************/
+/*********************************************************************************************************************************
+* Header Files *
+*********************************************************************************************************************************/
#include "internal/iprt.h"
#include <iprt/sha.h>
diff --git a/src/VBox/Runtime/common/checksum/sha512t256str.cpp b/src/VBox/Runtime/common/checksum/sha512t256str.cpp
index c2415f5..9ed05ae 100644
--- a/src/VBox/Runtime/common/checksum/sha512t256str.cpp
+++ b/src/VBox/Runtime/common/checksum/sha512t256str.cpp
@@ -25,9 +25,9 @@
*/
-/*******************************************************************************
-* Header Files *
-*******************************************************************************/
+/*********************************************************************************************************************************
+* Header Files *
+*********************************************************************************************************************************/
#include "internal/iprt.h"
#include <iprt/sha.h>
diff --git a/src/VBox/Runtime/common/checksum/x509.cpp b/src/VBox/Runtime/common/checksum/x509.cpp
index 6204f4c..9000f17 100644
--- a/src/VBox/Runtime/common/checksum/x509.cpp
+++ b/src/VBox/Runtime/common/checksum/x509.cpp
@@ -25,9 +25,9 @@
*/
-/*******************************************************************************
-* Header Files *
-*******************************************************************************/
+/*********************************************************************************************************************************
+* Header Files *
+*********************************************************************************************************************************/
#include "internal/iprt.h"
#include <iprt/x509-branch-collision.h>
diff --git a/src/VBox/Runtime/common/crypto/RTCrStoreCertAddFromFile.cpp b/src/VBox/Runtime/common/crypto/RTCrStoreCertAddFromFile.cpp
deleted file mode 100644
index 6a3c634..0000000
--- a/src/VBox/Runtime/common/crypto/RTCrStoreCertAddFromFile.cpp
+++ /dev/null
@@ -1,114 +0,0 @@
-/* $Id: RTCrStoreCertAddFromFile.cpp $ */
-/** @file
- * IPRT - Cryptographic (Certificate) Store, RTCrStoreCertAddFromFile.
- */
-
-/*
- * Copyright (C) 2006-2015 Oracle Corporation
- *
- * This file is part of VirtualBox Open Source Edition (OSE), as
- * available from http://www.virtualbox.org. This file is free software;
- * you can redistribute it and/or modify it under the terms of the GNU
- * General Public License (GPL) as published by the Free Software
- * Foundation, in version 2 as it comes in the "COPYING" file of the
- * VirtualBox OSE distribution. VirtualBox OSE is distributed in the
- * hope that it will be useful, but WITHOUT ANY WARRANTY of any kind.
- *
- * The contents of this file may alternatively be used under the terms
- * of the Common Development and Distribution License Version 1.0
- * (CDDL) only, as it comes in the "COPYING.CDDL" file of the
- * VirtualBox OSE distribution, in which case the provisions of the
- * CDDL are applicable instead of those of the GPL.
- *
- * You may elect to license modified versions of this file under the
- * terms and conditions of either the GPL or the CDDL or both.
- */
-
-
-/*******************************************************************************
-* Header Files *
-*******************************************************************************/
-#include "internal/iprt.h"
-#include <iprt/crypto/store.h>
-
-#include <iprt/assert.h>
-#include <iprt/err.h>
-#include <iprt/crypto/pem.h>
-
-
-/*******************************************************************************
-* Global Variables *
-*******************************************************************************/
-static RTCRPEMMARKERWORD const g_aWords_Certificate[] = { { RT_STR_TUPLE("CERTIFICATE") } };
-/** X509 Certificate markers. */
-static RTCRPEMMARKER const g_aCertificateMarkers[] = { { g_aWords_Certificate, RT_ELEMENTS(g_aWords_Certificate) } };
-
-
-#if 0
-RTDECL(int) RTCrX509Certificates_ReadFromFile(const char *pszFilename, uint32_t fFlags,
- PRTCRX509CERTIFICATES pCertificates, PRTERRINFO pErrInfo)
-{
- AssertReturn(!fFlags, VERR_INVALID_FLAGS);
- PCRTCRPEMSECTION pSectionHead;
- int rc = RTCrPemReadFile(pszFilename, 0, g_aCertificateMarkers, RT_ELEMENTS(g_aCertificateMarkers), &pSectionHead, pErrInfo);
- if (RT_SUCCESS(rc))
- {
- pCertificates->Allocation
-
- PCRTCRPEMSECTION pCurSec = pSectionHead;
- while (pCurSec)
- {
-
- pCurSec = pCurSec->pNext;
- }
-
- RTCrPemFreeSections(pSectionHead);
- }
- return rc;
-}
-#endif
-
-
-RTDECL(int) RTCrStoreCertAddFromFile(RTCRSTORE hStore, uint32_t fFlags, const char *pszFilename, PRTERRINFO pErrInfo)
-{
- AssertReturn(!fFlags, VERR_INVALID_FLAGS);
-#if 0
- RTCRX509CERTIFICATES Certs;
- int rc = RTCrX509Certificates_ReadFromFile(pszFilename, 0, &Certs, pErrInfo);
- if (RT_SUCCESS(rc))
- {
- for (uint32_t i = 0; i < Certs.cCerts; i++)
- {
- int rc2 = RTCrStoreCertAddEncoded(hStore, RTCRCERTCTX_F_ENC_X509_DER,
- RTASN1CORE_GET_RAW_ASN1_PTR(&Certs.paCerts[i].SeqCore.Asn1Core),
- RTASN1CORE_GET_RAW_ASN1_SIZE(&Certs.paCerts[i].SeqCore.Asn1Core),
- RT_SUCCESS(rc) ? pErrInfo : NULL);
- if (RT_FAILURE(rc2) && RT_SUCCESS(rc))
- rc = rc2;
- }
-
- RTAsn1Destroy(&Certs.SetCore.Asn1Core);
- }
- return rc;
-#else
-
- PCRTCRPEMSECTION pSectionHead;
- int rc = RTCrPemReadFile(pszFilename, 0, g_aCertificateMarkers, RT_ELEMENTS(g_aCertificateMarkers), &pSectionHead, pErrInfo);
- if (RT_SUCCESS(rc))
- {
- PCRTCRPEMSECTION pCurSec = pSectionHead;
- while (pCurSec)
- {
- int rc2 = RTCrStoreCertAddEncoded(hStore, RTCRCERTCTX_F_ENC_X509_DER, pCurSec->pbData, pCurSec->cbData,
- RT_SUCCESS(rc) ? pErrInfo : NULL);
- if (RT_FAILURE(rc2) && RT_SUCCESS(rc))
- rc = rc2;
- pCurSec = pCurSec->pNext;
- }
-
- RTCrPemFreeSections(pSectionHead);
- }
- return rc;
-#endif
-}
-
diff --git a/src/VBox/Runtime/common/crypto/RTCrStoreCertAddFromJavaKeyStore.cpp b/src/VBox/Runtime/common/crypto/RTCrStoreCertAddFromJavaKeyStore.cpp
new file mode 100644
index 0000000..94a4218
--- /dev/null
+++ b/src/VBox/Runtime/common/crypto/RTCrStoreCertAddFromJavaKeyStore.cpp
@@ -0,0 +1,310 @@
+/* $Id: RTCrStoreCertAddFromJavaKeyStore.cpp $ */
+/** @file
+ * IPRT - Cryptographic (Certificate) Store, RTCrStoreCertAddFromJavaKeyStore.
+ */
+
+/*
+ * Copyright (C) 2006-2015 Oracle Corporation
+ *
+ * This file is part of VirtualBox Open Source Edition (OSE), as
+ * available from http://www.virtualbox.org. This file is free software;
+ * you can redistribute it and/or modify it under the terms of the GNU
+ * General Public License (GPL) as published by the Free Software
+ * Foundation, in version 2 as it comes in the "COPYING" file of the
+ * VirtualBox OSE distribution. VirtualBox OSE is distributed in the
+ * hope that it will be useful, but WITHOUT ANY WARRANTY of any kind.
+ *
+ * The contents of this file may alternatively be used under the terms
+ * of the Common Development and Distribution License Version 1.0
+ * (CDDL) only, as it comes in the "COPYING.CDDL" file of the
+ * VirtualBox OSE distribution, in which case the provisions of the
+ * CDDL are applicable instead of those of the GPL.
+ *
+ * You may elect to license modified versions of this file under the
+ * terms and conditions of either the GPL or the CDDL or both.
+ */
+
+
+/*********************************************************************************************************************************
+* Header Files *
+*********************************************************************************************************************************/
+#define LOG_GROUP RTLOGGROUP_CRYPTO
+#include "internal/iprt.h"
+#include <iprt/crypto/store.h>
+
+#include <iprt/asm.h>
+#include <iprt/assert.h>
+#include <iprt/err.h>
+#include <iprt/file.h>
+#include <iprt/sha.h>
+#include <iprt/string.h>
+#include <iprt/log.h>
+
+
+/*********************************************************************************************************************************
+* Defined Constants And Macros *
+*********************************************************************************************************************************/
+/** The java key store magic number (file endian). */
+#define JKS_MAGIC RT_H2BE_U32_C(UINT32_C(0xfeedfeed))
+/** Java key store format version 2 (file endian). */
+#define JKS_VERSION_2 RT_H2BE_U32_C(2)
+
+
+/*********************************************************************************************************************************
+* Structures and Typedefs *
+*********************************************************************************************************************************/
+/**
+ * Java key store (JKS) header.
+ */
+typedef struct JKSHEADER
+{
+ /** The magic (big endian) - JKS_MAGIC. */
+ uint32_t uMagic;
+ /** Format version number (big endian) - JKS_VERSION_2. */
+ uint32_t uVersion;
+ /** The number of keystore entries (big endian). */
+ uint32_t cEntries;
+} JKSHEADER;
+/** Pointer to a const java key store header. */
+typedef JKSHEADER const *PCJKSHEADER;
+
+
+RTDECL(int) RTCrStoreCertAddFromJavaKeyStoreInMem(RTCRSTORE hStore, uint32_t fFlags, void const *pvContent, size_t cbContent,
+ const char *pszErrorName, PRTERRINFO pErrInfo)
+{
+ uint8_t const *pbContent = (uint8_t const *)pvContent;
+
+ /*
+ * Check the header.
+ */
+ if (cbContent < sizeof(JKSHEADER) + RTSHA1_HASH_SIZE)
+ return RTErrInfoAddF(pErrInfo, VERR_WRONG_TYPE /** @todo better status codes */,
+ " Too small (%zu bytes) for java key store (%s)", cbContent, pszErrorName);
+ PCJKSHEADER pHdr = (PCJKSHEADER)pbContent;
+ if (pHdr->uMagic != JKS_MAGIC)
+ return RTErrInfoAddF(pErrInfo, VERR_WRONG_TYPE /** @todo better status codes */,
+ " Not java key store magic %#x (%s)", RT_BE2H_U32(pHdr->uMagic), pszErrorName);
+ if (pHdr->uVersion != JKS_VERSION_2)
+ return RTErrInfoAddF(pErrInfo, VERR_WRONG_TYPE /** @todo better status codes */,
+ " Unsupported java key store version %#x (%s)", RT_BE2H_U32(pHdr->uVersion), pszErrorName);
+ uint32_t const cEntries = RT_BE2H_U32(pHdr->cEntries);
+ if (cEntries > cbContent / 24) /* 24 = 4 for type, 4+ alias, 8 byte timestamp, 4 byte len, "X.509" or 4 cert count */
+ return RTErrInfoAddF(pErrInfo, VERR_WRONG_TYPE /** @todo better status codes */,
+ " Entry count %u is to high for %zu byte JKS (%s)", cEntries, cbContent, pszErrorName);
+
+ /*
+ * Here we should check the store signature. However, it always includes
+ * some kind of password, and that's somewhere we don't want to go right
+ * now. Later perhaps.
+ *
+ * We subtract it from the content size to make EOF checks simpler.
+ */
+ int rc = VINF_SUCCESS;
+#if 0 /* later */
+ RTSHA1CONTEXT Ctx;
+ RTSha1Init(&Ctx);
+
+ const char *pszCur = pszPassword;
+ for (;;)
+ {
+ RTUNICP Cp;
+ rc = RTStrGetCpEx(&pszCur, &Cp);
+ AssertRCReturn(rc, rc);
+ if (!Cp)
+ break;
+ uint8_t abWChar[2];
+ abWChar[0] = RT_BYTE2(Cp);
+ abWChar[1] = RT_BYTE1(Cp);
+ RTSha1Update(&Ctx, &abWChar, sizeof(abWChar));
+ }
+
+ RTSha1Update(&Ctx, RT_STR_TUPLE("Mighty Aphrodite"));
+
+ RTSha1Update(&Ctx, pbContent, cbContent - RTSHA1_HASH_SIZE);
+
+ uint8_t abSignature[RTSHA1_HASH_SIZE];
+ RTSha1Final(&Ctx, abSignature);
+
+ if (memcmp(&pbContent[cbContent - RTSHA1_HASH_SIZE], abSignature, RTSHA1_HASH_SIZE) != 0)
+ {
+ rc = RTErrInfoAddF(pErrInfo, VERR_MISMATCH, " File SHA-1 signature mismatch, %.*Rhxs instead of %.*Rhxs, for '%s'",
+ RTSHA1_HASH_SIZE, abSignature,
+ RTSHA1_HASH_SIZE, &pbContent[cbContent - RTSHA1_HASH_SIZE],
+ pszErrorName);
+ if (!(fFlags & RTCRCERTCTX_F_ADD_CONTINUE_ON_ERROR))
+ return rc;
+ }
+#endif
+ cbContent -= RTSHA1_HASH_SIZE;
+
+
+ /*
+ * A bunch of macros to make decoding easier.
+ */
+#define ENSURE_CONTENT_OR_BREAK_EX(a_cbNeeded, a_pszWhat) \
+ do { \
+ if (RT_LIKELY(off + (a_cbNeeded) <= cbContent)) \
+ { /* likely */ } \
+ else \
+ { \
+ rc = RTErrInfoAddF(pErrInfo, VERR_EOF, " Unexpected end of data at %#x need %u bytes for %s (entry #%u in %s)", \
+ off, a_cbNeeded, a_pszWhat, iEntry, pszErrorName); \
+ break; \
+ } \
+ } while (0)
+#define ENSURE_CONTENT_OR_BREAK(a_Var) ENSURE_CONTENT_OR_BREAK_EX(sizeof(a_Var), #a_Var)
+#define GET_BE_U32_OR_BREAK(a_uVar) \
+ do { \
+ ENSURE_CONTENT_OR_BREAK(a_uVar); \
+ AssertCompile(sizeof(a_uVar) == sizeof(uint32_t)); \
+ a_uVar = RT_MAKE_U32_FROM_U8(pbContent[off + 3], pbContent[off + 2], pbContent[off + 1], pbContent[off + 0]); \
+ off += sizeof(uint32_t); \
+ } while (0)
+#define GET_BE_U16_OR_BREAK(a_uVar) \
+ do { \
+ ENSURE_CONTENT_OR_BREAK(a_uVar); \
+ AssertCompile(sizeof(a_uVar) == sizeof(uint16_t)); \
+ a_uVar = RT_MAKE_U16(pbContent[off + 1], pbContent[off + 0]); \
+ off += sizeof(uint16_t); \
+ } while (0)
+#define SKIP_CONTENT_BYTES_OR_BREAK(a_cbToSkip, a_pszWhat) \
+ do { \
+ ENSURE_CONTENT_OR_BREAK_EX(a_cbToSkip, a_pszWhat); \
+ off += a_cbToSkip; \
+ } while (0)
+#define CHECK_OR_BREAK(a_Expr, a_RTErrInfoAddFArgs) \
+ do { \
+ if (RT_LIKELY(a_Expr)) \
+ { /* likely */ } \
+ else \
+ { \
+ rc = RTErrInfoAddF a_RTErrInfoAddFArgs; \
+ break; \
+ } \
+ } while (0)
+
+ /*
+ * Work our way thru the keystore.
+ */
+ Log(("JKS: %u entries - '%s'\n", cEntries, pszErrorName));
+ size_t off = sizeof(JKSHEADER);
+ uint32_t iEntry = 0;
+ for (;;)
+ {
+ size_t const offEntry = off; NOREF(offEntry);
+
+ /* The entry type. */
+ uint32_t uType;
+ GET_BE_U32_OR_BREAK(uType);
+ CHECK_OR_BREAK(uType == 1 || uType == 2,
+ (pErrInfo, VERR_WRONG_TYPE, " uType=%#x (entry #%u in %s)", uType, iEntry, pszErrorName));
+
+ /* Skip the alias string. */
+ uint16_t cbAlias;
+ GET_BE_U16_OR_BREAK(cbAlias);
+ SKIP_CONTENT_BYTES_OR_BREAK(cbAlias, "szAlias");
+
+ /* Skip the creation timestamp. */
+ SKIP_CONTENT_BYTES_OR_BREAK(sizeof(uint64_t), "tsCreated");
+
+ uint32_t cTrustCerts = 0;
+ if (uType == 1)
+ {
+ /*
+ * It is a private key.
+ */
+ Log(("JKS: %#08zx: entry #%u: Private key\n", offEntry, iEntry));
+
+ /* The encoded key. */
+ uint32_t cbKey;
+ GET_BE_U32_OR_BREAK(cbKey);
+ SKIP_CONTENT_BYTES_OR_BREAK(cbKey, "key data");
+
+ /* The number of trust certificates following it. */
+ GET_BE_U32_OR_BREAK(cTrustCerts);
+ }
+ else if (uType == 2)
+ {
+ /*
+ * It is a certificate.
+ */
+ Log(("JKS: %#08zx: entry #%u: Trust certificate\n", offEntry, iEntry));
+ cTrustCerts = 1;
+ }
+ else
+ AssertFailedBreakStmt(rc = VERR_INTERNAL_ERROR_2);
+
+ /*
+ * Decode trust certificates. Keys have 0 or more of these associated with them.
+ */
+ for (uint32_t iCert = 0; iCert < cTrustCerts; iCert++)
+ {
+ /* X.509 signature */
+ static const char a_achCertType[] = { 0, 5, 'X', '.', '5', '0', '9' };
+ ENSURE_CONTENT_OR_BREAK(a_achCertType);
+ CHECK_OR_BREAK(memcmp(&pbContent[off], a_achCertType, sizeof(a_achCertType)) == 0,
+ (pErrInfo, VERR_WRONG_TYPE, " Unsupported certificate type %.7Rhxs (entry #%u in %s)",
+ &pbContent[off], iEntry, pszErrorName));
+ off += sizeof(a_achCertType);
+
+ /* The encoded certificate length. */
+ uint32_t cbEncoded;
+ GET_BE_U32_OR_BREAK(cbEncoded);
+ ENSURE_CONTENT_OR_BREAK_EX(cbEncoded, "certificate data");
+ Log(("JKS: %#08zx: %#x certificate bytes\n", off, cbEncoded, cbEncoded));
+
+ /* Try add the certificate. */
+ RTERRINFOSTATIC StaticErrInfo;
+ int rc2 = RTCrStoreCertAddEncoded(hStore,
+ RTCRCERTCTX_F_ENC_X509_DER | (fFlags & RTCRCERTCTX_F_ADD_IF_NOT_FOUND),
+ &pbContent[off], cbEncoded, RTErrInfoInitStatic(&StaticErrInfo));
+ if (RT_FAILURE(rc2))
+ {
+ if (RTErrInfoIsSet(&StaticErrInfo.Core))
+ rc = RTErrInfoAddF(pErrInfo, rc2, " entry #%u: %s", iEntry, StaticErrInfo.Core.pszMsg);
+ else
+ rc = RTErrInfoAddF(pErrInfo, rc2, " entry #%u: %Rrc adding cert", iEntry, rc2);
+ if (!(fFlags & RTCRCERTCTX_F_ADD_CONTINUE_ON_ERROR))
+ break;
+ }
+ off += cbEncoded;
+ }
+
+ /*
+ * Advance.
+ */
+ iEntry++;
+ if (iEntry >= cEntries)
+ {
+ if (off != cbContent)
+ rc = RTErrInfoAddF(pErrInfo, VERR_TOO_MUCH_DATA, " %zu tailing bytes (%s)", cbContent - off, pszErrorName);
+ break;
+ }
+ }
+
+ return rc;
+}
+
+
+RTDECL(int) RTCrStoreCertAddFromJavaKeyStore(RTCRSTORE hStore, uint32_t fFlags, const char *pszFilename, PRTERRINFO pErrInfo)
+{
+ AssertReturn(!(fFlags & ~(RTCRCERTCTX_F_ADD_IF_NOT_FOUND | RTCRCERTCTX_F_ADD_CONTINUE_ON_ERROR)), VERR_INVALID_FLAGS);
+
+ /*
+ * Read the whole thing into memory as that's much more convenient to work
+ * with and we don't expect a java key store to take up a lot of space.
+ */
+ size_t cbContent;
+ void *pvContent;
+ int rc = RTFileReadAllEx(pszFilename, 0, 32U*_1M, RTFILE_RDALL_O_DENY_WRITE, &pvContent, &cbContent);
+ if (RT_SUCCESS(rc))
+ {
+ rc = RTCrStoreCertAddFromJavaKeyStoreInMem(hStore, fFlags, pvContent, cbContent, pszFilename, pErrInfo);
+ RTFileReadAllFree(pvContent, cbContent);
+ }
+ else
+ rc = RTErrInfoSetF(pErrInfo, rc, "RTFileReadAllEx failed with %Rrc on '%s'", rc, pszFilename);
+ return rc;
+}
+RT_EXPORT_SYMBOL(RTCrStoreCertAddFromJavaKeyStore);
+
diff --git a/src/VBox/Runtime/common/crypto/RTCrStoreCertAddWantedFromFishingExpedition.cpp b/src/VBox/Runtime/common/crypto/RTCrStoreCertAddWantedFromFishingExpedition.cpp
new file mode 100644
index 0000000..0f476b7
--- /dev/null
+++ b/src/VBox/Runtime/common/crypto/RTCrStoreCertAddWantedFromFishingExpedition.cpp
@@ -0,0 +1,237 @@
+/* $Id: RTCrStoreCertAddWantedFromFishingExpedition.cpp $ */
+/** @file
+ * IPRT - Cryptographic (Certificate) Store, RTCrStoreCertAddFromFishingExpedition.
+ */
+
+/*
+ * Copyright (C) 2006-2015 Oracle Corporation
+ *
+ * This file is part of VirtualBox Open Source Edition (OSE), as
+ * available from http://www.virtualbox.org. This file is free software;
+ * you can redistribute it and/or modify it under the terms of the GNU
+ * General Public License (GPL) as published by the Free Software
+ * Foundation, in version 2 as it comes in the "COPYING" file of the
+ * VirtualBox OSE distribution. VirtualBox OSE is distributed in the
+ * hope that it will be useful, but WITHOUT ANY WARRANTY of any kind.
+ *
+ * The contents of this file may alternatively be used under the terms
+ * of the Common Development and Distribution License Version 1.0
+ * (CDDL) only, as it comes in the "COPYING.CDDL" file of the
+ * VirtualBox OSE distribution, in which case the provisions of the
+ * CDDL are applicable instead of those of the GPL.
+ *
+ * You may elect to license modified versions of this file under the
+ * terms and conditions of either the GPL or the CDDL or both.
+ */
+
+
+/*********************************************************************************************************************************
+* Header Files *
+*********************************************************************************************************************************/
+#include "internal/iprt.h"
+#include <iprt/crypto/store.h>
+
+#include <iprt/assert.h>
+#include <iprt/err.h>
+#include <iprt/mem.h>
+#include <iprt/path.h>
+
+#include "x509-internal.h"
+
+
+/*********************************************************************************************************************************
+* Defined Constants And Macros *
+*********************************************************************************************************************************/
+#ifdef RT_OS_WINDOWS
+# define PREFIX_UNIXROOT "${SystemDrive}/cygwin"
+#elif defined(RT_OS_OS2)
+# define PREFIX_UNIXROOT "/@unixroot@"
+#else
+# define PREFIX_UNIXROOT
+#endif
+
+
+/**
+ * Count the number of found certificates.
+ *
+ * @returns Number found.
+ * @param afFound Indicator array.
+ * @param cWanted Number of wanted certificates.
+ */
+DECLINLINE(size_t) rtCrStoreCountFound(bool const *afFound, size_t cWanted)
+{
+ size_t cFound = 0;
+ while (cWanted-- > 0)
+ if (afFound[cWanted])
+ cFound++;
+ return cFound;
+}
+
+
+RTDECL(int) RTCrStoreCertAddWantedFromFishingExpedition(RTCRSTORE hStore, uint32_t fFlags,
+ PCRTCRCERTWANTED paWanted, size_t cWanted,
+ bool *pafFound, PRTERRINFO pErrInfo)
+{
+ int rc = VINF_SUCCESS;
+ int rc2;
+
+ /*
+ * Validate input.
+ */
+ AssertReturn(!(fFlags & ~(RTCRCERTCTX_F_ADD_IF_NOT_FOUND | RTCRCERTCTX_F_ADD_CONTINUE_ON_ERROR)), VERR_INVALID_FLAGS);
+ fFlags |= RTCRCERTCTX_F_ADD_IF_NOT_FOUND | RTCRCERTCTX_F_ADD_CONTINUE_ON_ERROR; /* force these! */
+ AssertReturn(cWanted, VERR_NOT_FOUND);
+ for (uint32_t i = 0; i < cWanted; i++)
+ {
+ AssertReturn(!paWanted[i].pszSubject || *paWanted[i].pszSubject, VERR_INVALID_PARAMETER);
+ AssertReturn( paWanted[i].pszSubject
+ || paWanted[i].fSha1Fingerprint
+ || paWanted[i].fSha512Fingerprint,
+ VERR_INVALID_PARAMETER);
+ }
+
+ /*
+ * Make sure we've got a result array.
+ */
+ bool *pafFoundFree = NULL;
+ if (!pafFound)
+ {
+ pafFound = pafFoundFree = (bool *)RTMemTmpAllocZ(sizeof(bool) * cWanted);
+ AssertReturn(pafFound, VERR_NO_TMP_MEMORY);
+ }
+
+ /*
+ * Search the user and system stores first.
+ */
+ bool fAllFound = false;
+ RTCRSTORE hTmpStore;
+ for (int iStoreId = RTCRSTOREID_INVALID + 1; iStoreId < RTCRSTOREID_END; iStoreId++)
+ {
+ rc2 = RTCrStoreCreateSnapshotById(&hTmpStore, (RTCRSTOREID)iStoreId, NULL);
+ if (RT_SUCCESS(rc2))
+ {
+ rc2 = RTCrStoreCertAddWantedFromStore(hStore, fFlags, hTmpStore, paWanted, cWanted, pafFound);
+ RTCrStoreRelease(hTmpStore);
+ fAllFound = rc2 == VINF_SUCCESS;
+ if (fAllFound)
+ break;
+ }
+ }
+
+ /*
+ * Search alternative file based stores.
+ */
+ if (!fAllFound)
+ {
+ static const char * const s_apszFiles[] =
+ {
+ PREFIX_UNIXROOT "/usr/share/ca-certificates/trust-source/mozilla.neutral-trust.crt",
+ PREFIX_UNIXROOT "/usr/share/ca-certificates/trust-source/mozilla.trust.crt",
+ PREFIX_UNIXROOT "/usr/share/doc/mutt/samples/ca-bundle.crt",
+ PREFIX_UNIXROOT "/usr/jdk/latest/jre/lib/security/cacerts",
+ PREFIX_UNIXROOT "/usr/share/curl/curl-ca-bundle.crt",
+#ifdef RT_OS_DARWIN
+ "/opt/local/share/curl/curl-ca-bundle.crt",
+ "/Library/Internet Plug-Ins/JavaAppletPlugin.plugin/Contents/Home/lib/security/cacerts",
+ "/System/Library/Java/Support/CoreDeploy.bundle/Contents/Home/lib/security/cacerts",
+ "/System/Library/Java/Support/CoreDeploy.bundle/Contents/JavaAppletPlugin.plugin/Contents/Home/lib/security/cacerts",
+ "/System/Library/Java/Support/Deploy.bundle/Contents/Home/lib/security/cacerts",
+ "/Applications/Xcode.app/Contents/Applications/Application Loader.app/Contents/MacOS/itms/java/lib/security/cacerts",
+ "/Applications/Xcode.app/Contents/Applications/Application Loader.app/Contents/itms/java/lib/security/cacerts",
+ "/Applications/Xcode-beta.app/Contents/Applications/Application Loader.app/Contents/itms/java/lib/security/cacerts",
+ "/System/Library/Java/JavaVirtualMachines/*/Contents/Home/lib/security/cacerts",
+#endif
+#ifdef RT_OS_LINUX
+ PREFIX_UNIXROOT "/opt/*/jre/lib/security/cacerts",
+#endif
+#ifdef RT_OS_WINDOWS
+ "${AllProgramFiles}/Git/bin/curl-ca-bundle.crt",
+ "${AllProgramFiles}/Mercurial/hgrc.d/cacert.pem",
+ "${AllProgramFiles}/Java/jre*/lib/security/cacerts",
+ "${AllProgramFiles}/Java/jdk*/jre/lib/security/cacerts",
+ "${AllProgramFiles}/HexChat/cert.pem",
+ "${SystemDrive}/BitNami/*/git/bin/curl-ca-bundle.crt",
+ "${SystemDrive}/BitNami/*/heroku/data/cacert.pem",
+ "${SystemDrive}/BitNami/*/heroku/vendor/gems/excon*/data/cacert.pem",
+ "${SystemDrive}/BitNami/*/php/PEAR/AWSSDKforPHP/lib/requstcore/cacert.pem",
+#endif
+ };
+ for (uint32_t i = 0; i < RT_ELEMENTS(s_apszFiles) && !fAllFound; i++)
+ {
+ PCRTPATHGLOBENTRY pResultHead;
+ rc2 = RTPathGlob(s_apszFiles[i], RTPATHGLOB_F_NO_DIRS, &pResultHead, NULL);
+ if (RT_SUCCESS(rc2))
+ {
+ for (PCRTPATHGLOBENTRY pCur = pResultHead; pCur; pCur = pCur->pNext)
+ {
+ rc2 = RTCrStoreCertAddWantedFromFile(hStore, fFlags, pCur->szPath, paWanted, cWanted, pafFound, pErrInfo);
+ fAllFound = rc2 == VINF_SUCCESS;
+ if (fAllFound)
+ break;
+ }
+ RTPathGlobFree(pResultHead);
+ }
+ }
+ }
+
+ /*
+ * Search alternative directory based stores.
+ */
+ if (!fAllFound)
+ {
+ static const char * const s_apszFiles[] =
+ {
+ PREFIX_UNIXROOT "/usr/share/ca-certificates/mozilla/",
+#ifdef RT_OS_DARWIN
+ "/System/Library/Frameworks/Ruby.framework/Versions/2.0/usr/lib/ruby/2.0.0/rubygems/ssl_certs/"
+#endif
+#ifdef RT_OS_WINDOWS
+ "${AllProgramFiles}/Git/ssl/certs/",
+ "${AllProgramFiles}/Git/ssl/certs/expired/",
+ "${AllProgramFiles}/Common Files/Apple/Internet Services/security.resources/roots/",
+ "${AllProgramFiles}/Raptr/ca-certs/",
+ "${SystemDrive}/Bitname/*/git/ssl/certs/",
+ "${SystemDrive}/Bitnami/*/git/ssl/certs/expired/",
+#endif
+ };
+ for (uint32_t i = 0; i < RT_ELEMENTS(s_apszFiles) && !fAllFound; i++)
+ {
+ PCRTPATHGLOBENTRY pResultHead;
+ rc2 = RTPathGlob(s_apszFiles[i], RTPATHGLOB_F_ONLY_DIRS, &pResultHead, NULL);
+ if (RT_SUCCESS(rc2))
+ {
+ for (PCRTPATHGLOBENTRY pCur = pResultHead; pCur; pCur = pCur->pNext)
+ {
+ rc2 = RTCrStoreCertAddWantedFromDir(hStore, fFlags, pCur->szPath, NULL /*paSuffixes*/, 0 /*cSuffixes*/,
+ paWanted, cWanted, pafFound, pErrInfo);
+ fAllFound = rc2 == VINF_SUCCESS;
+ if (fAllFound)
+ break;
+ }
+ RTPathGlobFree(pResultHead);
+ }
+ }
+ }
+
+ /*
+ * If all found, return VINF_SUCCESS, otherwise warn that we didn't find everything.
+ */
+ if (RT_SUCCESS(rc))
+ {
+ size_t cFound = rtCrStoreCountFound(pafFound, cWanted);
+ Assert(cFound == cWanted || !fAllFound);
+ if (cFound == cWanted)
+ rc = VINF_SUCCESS;
+ else if (cFound > 0)
+ rc = VWRN_NOT_FOUND;
+ else
+ rc = VERR_NOT_FOUND;
+ }
+
+ if (pafFoundFree)
+ RTMemTmpFree(pafFoundFree);
+ return rc;
+}
+RT_EXPORT_SYMBOL(RTCrStoreCertAddWantedFromFishingExpedition);
+
+
diff --git a/src/VBox/Runtime/common/crypto/RTCrStoreCertExportAsPem.cpp b/src/VBox/Runtime/common/crypto/RTCrStoreCertExportAsPem.cpp
new file mode 100644
index 0000000..b7bc5c8
--- /dev/null
+++ b/src/VBox/Runtime/common/crypto/RTCrStoreCertExportAsPem.cpp
@@ -0,0 +1,137 @@
+/* $Id: RTCrStoreCertExportAsPem.cpp $ */
+/** @file
+ * IPRT - Cryptographic (Certificate) Store, RTCrStoreCertExportAsPem.
+ */
+
+/*
+ * Copyright (C) 2006-2015 Oracle Corporation
+ *
+ * This file is part of VirtualBox Open Source Edition (OSE), as
+ * available from http://www.virtualbox.org. This file is free software;
+ * you can redistribute it and/or modify it under the terms of the GNU
+ * General Public License (GPL) as published by the Free Software
+ * Foundation, in version 2 as it comes in the "COPYING" file of the
+ * VirtualBox OSE distribution. VirtualBox OSE is distributed in the
+ * hope that it will be useful, but WITHOUT ANY WARRANTY of any kind.
+ *
+ * The contents of this file may alternatively be used under the terms
+ * of the Common Development and Distribution License Version 1.0
+ * (CDDL) only, as it comes in the "COPYING.CDDL" file of the
+ * VirtualBox OSE distribution, in which case the provisions of the
+ * CDDL are applicable instead of those of the GPL.
+ *
+ * You may elect to license modified versions of this file under the
+ * terms and conditions of either the GPL or the CDDL or both.
+ */
+
+
+/*********************************************************************************************************************************
+* Header Files *
+*********************************************************************************************************************************/
+#include "internal/iprt.h"
+#include <iprt/crypto/store.h>
+
+#include <iprt/assert.h>
+#include <iprt/base64.h>
+#include <iprt/dir.h>
+#include <iprt/err.h>
+#include <iprt/mem.h>
+#include <iprt/stream.h>
+
+
+
+RTDECL(int) RTCrStoreCertExportAsPem(RTCRSTORE hStore, uint32_t fFlags, const char *pszFilename)
+{
+ /*
+ * Validate input.
+ */
+ AssertReturn(!fFlags, VERR_INVALID_FLAGS);
+
+ /*
+ * Start the enumeration first as this validates the store handle.
+ */
+ RTCRSTORECERTSEARCH Search;
+ int rc = RTCrStoreCertFindAll(hStore, &Search);
+ if (RT_SUCCESS(rc))
+ {
+ /*
+ * Open the file for writing.
+ *
+ * Note! We must use text and no binary here, because the base-64 API
+ * below will use host specific EOL markers, not CRLF as PEM
+ * specifies.
+ */
+ PRTSTREAM hStrm;
+ rc = RTStrmOpen(pszFilename, "w", &hStrm);
+ if (RT_SUCCESS(rc))
+ {
+ /*
+ * Enumerate the certificates in the store, writing them out one by one.
+ */
+ size_t cbBase64 = 0;
+ char *pszBase64 = NULL;
+ PCRTCRCERTCTX pCertCtx;
+ while ((pCertCtx = RTCrStoreCertSearchNext(hStore, &Search)) != NULL)
+ {
+ const char *pszMarker;
+ switch (pCertCtx->fFlags & RTCRCERTCTX_F_ENC_MASK)
+ {
+ case RTCRCERTCTX_F_ENC_X509_DER: pszMarker = "CERTIFICATE"; break;
+ case RTCRCERTCTX_F_ENC_TAF_DER: pszMarker = "TRUST ANCHOR"; break;
+ default: pszMarker = NULL; break;
+ }
+ if (pszMarker && pCertCtx->cbEncoded > 0)
+ {
+ /*
+ * Do the base64 conversion first.
+ */
+ size_t cchEncoded = RTBase64EncodedLength(pCertCtx->cbEncoded);
+ if (cchEncoded < cbBase64)
+ { /* likely */ }
+ else
+ {
+ size_t cbNew = RT_ALIGN(cchEncoded + 64, 128);
+ void *pvNew = RTMemRealloc(pszBase64, cbNew);
+ if (!pvNew)
+ {
+ rc = VERR_NO_MEMORY;
+ break;
+ }
+ cbBase64 = cbNew;
+ pszBase64 = (char *)pvNew;
+ }
+ rc = RTBase64Encode(pCertCtx->pabEncoded, pCertCtx->cbEncoded, pszBase64, cbBase64, &cchEncoded);
+ if (RT_FAILURE(rc))
+ break;
+
+ RTStrmPrintf(hStrm, "-----BEGIN %s-----\n", pszMarker);
+ RTStrmWrite(hStrm, pszBase64, cchEncoded);
+ rc = RTStrmPrintf(hStrm, "\n-----END %s-----\n", pszMarker);
+ if (RT_FAILURE(rc))
+ break;
+ }
+
+ RTCrCertCtxRelease(pCertCtx);
+ }
+ if (pCertCtx)
+ RTCrCertCtxRelease(pCertCtx);
+ RTMemFree(pszBase64);
+
+ /*
+ * Flush the output file before closing.
+ */
+ int rc2 = RTStrmFlush(hStrm);
+ if (RT_FAILURE(rc2) && RT_SUCCESS(rc))
+ rc = rc2;
+ RTStrmClearError(hStrm); /** @todo fix RTStrmClose... */
+ rc2 = RTStrmClose(hStrm);
+ if (RT_FAILURE(rc2) && RT_SUCCESS(rc))
+ rc = rc2;
+ }
+
+ int rc2 = RTCrStoreCertSearchDestroy(hStore, &Search); AssertRC(rc2);
+ }
+ return rc;
+}
+RT_EXPORT_SYMBOL(RTCrStoreCertExportAsPem);
+
diff --git a/src/VBox/Runtime/common/crypto/digest-builtin.cpp b/src/VBox/Runtime/common/crypto/digest-builtin.cpp
index d2b75e8..f63b037 100644
--- a/src/VBox/Runtime/common/crypto/digest-builtin.cpp
+++ b/src/VBox/Runtime/common/crypto/digest-builtin.cpp
@@ -25,9 +25,9 @@
*/
-/*******************************************************************************
-* Header Files *
-*******************************************************************************/
+/*********************************************************************************************************************************
+* Header Files *
+*********************************************************************************************************************************/
#include "internal/iprt.h"
#include <iprt/crypto/digest.h>
diff --git a/src/VBox/Runtime/common/crypto/digest-core.cpp b/src/VBox/Runtime/common/crypto/digest-core.cpp
index 6d8460e..3131798 100644
--- a/src/VBox/Runtime/common/crypto/digest-core.cpp
+++ b/src/VBox/Runtime/common/crypto/digest-core.cpp
@@ -25,9 +25,9 @@
*/
-/*******************************************************************************
-* Header Files *
-*******************************************************************************/
+/*********************************************************************************************************************************
+* Header Files *
+*********************************************************************************************************************************/
#include "internal/iprt.h"
#include <iprt/crypto/digest.h>
@@ -37,9 +37,9 @@
#include <iprt/string.h>
-/*******************************************************************************
-* Structures and Typedefs *
-*******************************************************************************/
+/*********************************************************************************************************************************
+* Structures and Typedefs *
+*********************************************************************************************************************************/
/**
* Generic message digest instance.
*/
diff --git a/src/VBox/Runtime/common/crypto/iprt-openssl.cpp b/src/VBox/Runtime/common/crypto/iprt-openssl.cpp
index e03e5ac..75deec4 100644
--- a/src/VBox/Runtime/common/crypto/iprt-openssl.cpp
+++ b/src/VBox/Runtime/common/crypto/iprt-openssl.cpp
@@ -25,9 +25,9 @@
*/
-/*******************************************************************************
-* Header Files *
-*******************************************************************************/
+/*********************************************************************************************************************************
+* Header Files *
+*********************************************************************************************************************************/
#include "internal/iprt.h"
#ifdef IPRT_WITH_OPENSSL /* Whole file. */
diff --git a/src/VBox/Runtime/common/crypto/pemfile.cpp b/src/VBox/Runtime/common/crypto/pemfile.cpp
index 28d454f..505a5cc 100644
--- a/src/VBox/Runtime/common/crypto/pemfile.cpp
+++ b/src/VBox/Runtime/common/crypto/pemfile.cpp
@@ -25,9 +25,9 @@
*/
-/*******************************************************************************
-* Header Files *
-*******************************************************************************/
+/*********************************************************************************************************************************
+* Header Files *
+*********************************************************************************************************************************/
#include "internal/iprt.h"
#include <iprt/crypto/pem.h>
@@ -124,8 +124,7 @@ static bool rtCrPemFindMarker(uint8_t const *pbContent, size_t cbContent, size_t
*/
uint8_t const *pbSavedContent = pbContent;
size_t const cbSavedContent = cbContent;
- uint32_t iMarker = 0;
- while (iMarker < cMarkers)
+ for (uint32_t iMarker = 0; iMarker < cMarkers; iMarker++)
{
pbContent = pbSavedContent;
cbContent = cbSavedContent;
@@ -142,13 +141,16 @@ static bool rtCrPemFindMarker(uint8_t const *pbContent, size_t cbContent, size_t
pbContent += cchWord;
cbContent -= cchWord;
- if (!cbContent || !RT_C_IS_BLANK(*pbContent))
+ if (!cbContent)
+ break;
+ if (RT_C_IS_BLANK(*pbContent))
+ do
+ {
+ pbContent++;
+ cbContent--;
+ } while (cbContent > 0 && RT_C_IS_BLANK(*pbContent));
+ else if (cWords > 1 || pbContent[0] != '-')
break;
- do
- {
- pbContent++;
- cbContent--;
- } while (cbContent > 0 && RT_C_IS_BLANK(*pbContent));
cWords--;
if (cWords == 0)
@@ -174,7 +176,7 @@ static bool rtCrPemFindMarker(uint8_t const *pbContent, size_t cbContent, size_t
pbContent++, cbContent--;
if (poffEnd)
*poffEnd = pbContent - pbStart;
- if (*ppMatch)
+ if (ppMatch)
*ppMatch = &paMarkers[iMarker];
return true;
}
@@ -261,31 +263,38 @@ static int rtCrPemDecodeBase64(uint8_t const *pbContent, size_t cbContent, void
* @param pbFile The file bytes to scan.
* @param cbFile The number of bytes.
*/
-static bool rtCrPemIsBinaryFile(uint8_t *pbFile, size_t cbFile)
+static bool rtCrPemIsBinaryBlob(uint8_t const *pbFile, size_t cbFile)
{
/*
- * Assume a well formed PEM file contains only 7-bit ASCII and restricts
- * itself to the following control characters:
+ * Well formed PEM files should probably only contain 7-bit ASCII and
+ * restrict thenselfs to the following control characters:
* tab, newline, return, form feed
+ *
+ * However, if we wan't to read PEM files which contains human readable
+ * certificate details before or after each base-64 section, we can't stick
+ * to 7-bit ASCII. We could say it must be UTF-8, but that's probably to
+ * limited too. So, we'll settle for detecting binary files by control
+ * characters alone (safe enough for DER encoded stuff, I think).
*/
while (cbFile-- > 0)
{
uint8_t const b = *pbFile++;
- if ( b >= 0x7f
- || (b < 32 && b != '\t' && b != '\n' && b != '\r' && b != '\f') )
+ if (b < 32 && b != '\t' && b != '\n' && b != '\r' && b != '\f')
{
/* Ignore EOT (4), SUB (26) and NUL (0) at the end of the file. */
if ( (b == 4 || b == 26)
&& ( cbFile == 0
|| ( cbFile == 1
&& *pbFile == '\0')))
- return true;
+ return false;
+
if (b == 0 && cbFile == 0)
- return true;
- return false;
+ return false;
+
+ return true;
}
}
- return true;
+ return false;
}
@@ -296,123 +305,152 @@ RTDECL(int) RTCrPemFreeSections(PCRTCRPEMSECTION pSectionHead)
PRTCRPEMSECTION pFree = (PRTCRPEMSECTION)pSectionHead;
pSectionHead = pSectionHead->pNext;
- if (pFree->pMarker)
- {
- if (pFree->pbData)
- {
- RTMemFree(pFree->pbData);
- pFree->pbData = NULL;
- pFree->cbData = 0;
- }
+ Assert(pFree->pMarker || !pFree->pszPreamble);
- if (pFree->pszPreamble)
- {
- RTMemFree(pFree->pszPreamble);
- pFree->pszPreamble = NULL;
- pFree->cchPreamble = 0;
- }
+ if (pFree->pbData)
+ {
+ RTMemFree(pFree->pbData);
+ pFree->pbData = NULL;
+ pFree->cbData = 0;
}
- else
+
+ if (pFree->pszPreamble)
{
- RTFileReadAllFree(pFree->pbData, pFree->cbData);
- Assert(!pFree->pszPreamble);
+ RTMemFree(pFree->pszPreamble);
+ pFree->pszPreamble = NULL;
+ pFree->cchPreamble = 0;
}
- pFree->pbData = NULL;
- pFree->cbData = 0;
}
return VINF_SUCCESS;
}
-RTDECL(int) RTCrPemReadFile(const char *pszFilename, uint32_t fFlags, PCRTCRPEMMARKER paMarkers, size_t cMarkers,
- PCRTCRPEMSECTION *ppSectionHead, PRTERRINFO pErrInfo)
+RTDECL(int) RTCrPemParseContent(void const *pvContent, size_t cbContent, uint32_t fFlags,
+ PCRTCRPEMMARKER paMarkers, size_t cMarkers,
+ PCRTCRPEMSECTION *ppSectionHead, PRTERRINFO pErrInfo)
{
- AssertReturn(!fFlags, VERR_INVALID_FLAGS);
+ /*
+ * Input validation.
+ */
+ AssertPtr(ppSectionHead);
+ *ppSectionHead = NULL;
+ AssertReturn(cbContent, VINF_EOF);
+ AssertPtr(pvContent);
+ AssertPtr(paMarkers);
- size_t cbContent;
- uint8_t *pbContent;
- int rc = RTFileReadAllEx(pszFilename, 0, 64U*_1M, RTFILE_RDALL_O_DENY_WRITE, (void **)&pbContent, &cbContent);
- if (RT_SUCCESS(rc))
+ /*
+ * Pre-allocate a section.
+ */
+ int rc = VINF_SUCCESS;
+ PRTCRPEMSECTION pSection = (PRTCRPEMSECTION)RTMemAllocZ(sizeof(*pSection));
+ if (pSection)
{
- PRTCRPEMSECTION pSection = (PRTCRPEMSECTION)RTMemAllocZ(sizeof(*pSection));
- if (pSection)
+ /*
+ * Try locate the first section.
+ */
+ uint8_t const *pbContent = (uint8_t const *)pvContent;
+ size_t offBegin, offEnd, offResume;
+ PCRTCRPEMMARKER pMatch;
+ if ( !rtCrPemIsBinaryBlob(pbContent, cbContent)
+ && rtCrPemFindMarkerSection(pbContent, cbContent, 0 /*offStart*/, paMarkers, cMarkers,
+ &pMatch, &offBegin, &offEnd, &offResume) )
{
- /*
- * Try locate the first section.
- */
- size_t offBegin, offEnd, offResume;
- PCRTCRPEMMARKER pMatch;
- if ( !rtCrPemIsBinaryFile(pbContent, cbContent)
- && rtCrPemFindMarkerSection(pbContent, cbContent, 0 /*offStart*/, paMarkers, cMarkers,
- &pMatch, &offBegin, &offEnd, &offResume) )
+ PCRTCRPEMSECTION *ppNext = ppSectionHead;
+ for (;;)
{
- PCRTCRPEMSECTION *ppNext = ppSectionHead;
- for (;;)
+ //pSection->pNext = NULL;
+ pSection->pMarker = pMatch;
+ //pSection->pbData = NULL;
+ //pSection->cbData = 0;
+ //pSection->pszPreamble = NULL;
+ //pSection->cchPreamble = 0;
+
+ *ppNext = pSection;
+ ppNext = &pSection->pNext;
+
+ /* Decode the section. */
+ /** @todo copy the preamble as well. */
+ int rc2 = rtCrPemDecodeBase64(pbContent + offBegin, offEnd - offBegin,
+ (void **)&pSection->pbData, &pSection->cbData);
+ if (RT_FAILURE(rc2))
{
- //pSection->pNext = NULL;
- pSection->pMarker = pMatch;
- //pSection->pbData = NULL;
- //pSection->cbData = 0;
- //pSection->pszPreamble = NULL;
- //pSection->cchPreamble = 0;
-
- *ppNext = pSection;
- ppNext = &pSection->pNext;
-
- /* Decode the section. */
- /** @todo copy the preamble as well. */
- rc = rtCrPemDecodeBase64(pbContent + offBegin, offEnd - offBegin,
- (void **)&pSection->pbData, &pSection->cbData);
- if (RT_FAILURE(rc))
+ pSection->pbData = NULL;
+ pSection->cbData = 0;
+ if ( rc2 == VERR_INVALID_BASE64_ENCODING
+ && (fFlags & RTCRPEMREADFILE_F_CONTINUE_ON_ENCODING_ERROR))
+ rc = -rc2;
+ else
{
- pSection->pbData = NULL;
- pSection->cbData = 0;
+ rc = rc2;
break;
}
+ }
- /* More sections? */
- if ( offResume + 12 >= cbContent
- || offResume >= cbContent
- || !rtCrPemFindMarkerSection(pbContent, cbContent, offResume, paMarkers, cMarkers,
- &pMatch, &offBegin, &offEnd, &offResume) )
- break; /* No. */
+ /* More sections? */
+ if ( offResume + 12 >= cbContent
+ || offResume >= cbContent
+ || !rtCrPemFindMarkerSection(pbContent, cbContent, offResume, paMarkers, cMarkers,
+ &pMatch, &offBegin, &offEnd, &offResume) )
+ break; /* No. */
- /* Ok, allocate a new record for it. */
- pSection = (PRTCRPEMSECTION)RTMemAllocZ(sizeof(*pSection));
- if (RT_UNLIKELY(!pSection))
- {
- rc = VERR_NO_MEMORY;
- break;
- }
- }
- if (RT_SUCCESS(rc))
+ /* Ok, allocate a new record for it. */
+ pSection = (PRTCRPEMSECTION)RTMemAllocZ(sizeof(*pSection));
+ if (RT_UNLIKELY(!pSection))
{
- RTFileReadAllFree(pbContent, cbContent);
- return rc;
+ rc = VERR_NO_MEMORY;
+ break;
}
-
- RTCrPemFreeSections(*ppSectionHead);
}
- else
+ if (RT_SUCCESS(rc))
+ return rc;
+
+ RTCrPemFreeSections(*ppSectionHead);
+ }
+ else
+ {
+ /*
+ * No PEM section found. Return the whole file as one binary section.
+ */
+ //pSection->pNext = NULL;
+ //pSection->pMarker = NULL;
+ pSection->pbData = (uint8_t *)RTMemDup(pbContent, cbContent);
+ pSection->cbData = cbContent;
+ //pSection->pszPreamble = NULL;
+ //pSection->cchPreamble = 0;
+ if (pSection->pbData)
{
- /*
- * No PEM section found. Return the whole file as one binary section.
- */
- //pSection->pNext = NULL;
- //pSection->pMarker = NULL;
- pSection->pbData = pbContent;
- pSection->cbData = cbContent;
- //pSection->pszPreamble = NULL;
- //pSection->cchPreamble = 0;
*ppSectionHead = pSection;
return VINF_SUCCESS;
}
- }
- else
+
rc = VERR_NO_MEMORY;
- RTFileReadAllFree(pbContent, cbContent);
+ RTMemFree(pSection);
+ }
}
+ else
+ rc = VERR_NO_MEMORY;
*ppSectionHead = NULL;
return rc;
}
+
+
+RTDECL(int) RTCrPemReadFile(const char *pszFilename, uint32_t fFlags, PCRTCRPEMMARKER paMarkers, size_t cMarkers,
+ PCRTCRPEMSECTION *ppSectionHead, PRTERRINFO pErrInfo)
+{
+ *ppSectionHead = NULL;
+ AssertReturn(!(fFlags & ~RTCRPEMREADFILE_F_CONTINUE_ON_ENCODING_ERROR), VERR_INVALID_FLAGS);
+
+ size_t cbContent;
+ void *pvContent;
+ int rc = RTFileReadAllEx(pszFilename, 0, 64U*_1M, RTFILE_RDALL_O_DENY_WRITE, &pvContent, &cbContent);
+ if (RT_SUCCESS(rc))
+ {
+ rc = RTCrPemParseContent(pvContent, cbContent, fFlags, paMarkers, cMarkers, ppSectionHead, pErrInfo);
+ RTFileReadAllFree(pvContent, cbContent);
+ }
+ else
+ rc = RTErrInfoSetF(pErrInfo, rc, "RTFileReadAllEx failed with %Rrc on '%s'", rc, pszFilename);
+ return rc;
+}
+
diff --git a/src/VBox/Runtime/common/crypto/pkcs7-asn1-decoder.cpp b/src/VBox/Runtime/common/crypto/pkcs7-asn1-decoder.cpp
index 40db5c1..c421dd7 100644
--- a/src/VBox/Runtime/common/crypto/pkcs7-asn1-decoder.cpp
+++ b/src/VBox/Runtime/common/crypto/pkcs7-asn1-decoder.cpp
@@ -25,9 +25,9 @@
*/
-/*******************************************************************************
-* Header Files *
-*******************************************************************************/
+/*********************************************************************************************************************************
+* Header Files *
+*********************************************************************************************************************************/
#include "internal/iprt.h"
#include <iprt/crypto/pkcs7.h>
diff --git a/src/VBox/Runtime/common/crypto/pkcs7-core.cpp b/src/VBox/Runtime/common/crypto/pkcs7-core.cpp
index 0a928e5..0348c97 100644
--- a/src/VBox/Runtime/common/crypto/pkcs7-core.cpp
+++ b/src/VBox/Runtime/common/crypto/pkcs7-core.cpp
@@ -25,9 +25,9 @@
*/
-/*******************************************************************************
-* Header Files *
-*******************************************************************************/
+/*********************************************************************************************************************************
+* Header Files *
+*********************************************************************************************************************************/
#include "internal/iprt.h"
#include <iprt/crypto/pkcs7.h>
diff --git a/src/VBox/Runtime/common/crypto/pkcs7-init.cpp b/src/VBox/Runtime/common/crypto/pkcs7-init.cpp
index 9b66ec2..35993e9 100644
--- a/src/VBox/Runtime/common/crypto/pkcs7-init.cpp
+++ b/src/VBox/Runtime/common/crypto/pkcs7-init.cpp
@@ -25,9 +25,9 @@
*/
-/*******************************************************************************
-* Header Files *
-*******************************************************************************/
+/*********************************************************************************************************************************
+* Header Files *
+*********************************************************************************************************************************/
#include "internal/iprt.h"
#include <iprt/crypto/pkcs7.h>
diff --git a/src/VBox/Runtime/common/crypto/pkcs7-sanity.cpp b/src/VBox/Runtime/common/crypto/pkcs7-sanity.cpp
index 8b9325c..cebeb6b 100644
--- a/src/VBox/Runtime/common/crypto/pkcs7-sanity.cpp
+++ b/src/VBox/Runtime/common/crypto/pkcs7-sanity.cpp
@@ -25,9 +25,9 @@
*/
-/*******************************************************************************
-* Header Files *
-*******************************************************************************/
+/*********************************************************************************************************************************
+* Header Files *
+*********************************************************************************************************************************/
#include "internal/iprt.h"
#include <iprt/crypto/pkcs7.h>
diff --git a/src/VBox/Runtime/common/crypto/pkcs7-verify.cpp b/src/VBox/Runtime/common/crypto/pkcs7-verify.cpp
index cdec7b6..f0a99bf 100644
--- a/src/VBox/Runtime/common/crypto/pkcs7-verify.cpp
+++ b/src/VBox/Runtime/common/crypto/pkcs7-verify.cpp
@@ -25,9 +25,9 @@
*/
-/*******************************************************************************
-* Header Files *
-*******************************************************************************/
+/*********************************************************************************************************************************
+* Header Files *
+*********************************************************************************************************************************/
#include "internal/iprt.h"
#include <iprt/crypto/pkcs7.h>
diff --git a/src/VBox/Runtime/common/crypto/pkix-signature-builtin.cpp b/src/VBox/Runtime/common/crypto/pkix-signature-builtin.cpp
index 815f072..a717c61 100644
--- a/src/VBox/Runtime/common/crypto/pkix-signature-builtin.cpp
+++ b/src/VBox/Runtime/common/crypto/pkix-signature-builtin.cpp
@@ -25,9 +25,9 @@
*/
-/*******************************************************************************
-* Header Files *
-*******************************************************************************/
+/*********************************************************************************************************************************
+* Header Files *
+*********************************************************************************************************************************/
#include "internal/iprt.h"
#include <iprt/crypto/pkix.h>
@@ -42,9 +42,9 @@
#include "pkix-signature-builtin.h"
-/*******************************************************************************
-* Global Variables *
-*******************************************************************************/
+/*********************************************************************************************************************************
+* Global Variables *
+*********************************************************************************************************************************/
/**
* Array of built in message digest vtables.
*/
diff --git a/src/VBox/Runtime/common/crypto/pkix-signature-core.cpp b/src/VBox/Runtime/common/crypto/pkix-signature-core.cpp
index 41740a0..0ea3046 100644
--- a/src/VBox/Runtime/common/crypto/pkix-signature-core.cpp
+++ b/src/VBox/Runtime/common/crypto/pkix-signature-core.cpp
@@ -25,9 +25,9 @@
*/
-/*******************************************************************************
-* Header Files *
-*******************************************************************************/
+/*********************************************************************************************************************************
+* Header Files *
+*********************************************************************************************************************************/
#include "internal/iprt.h"
#include <iprt/crypto/pkix.h>
@@ -39,9 +39,9 @@
#include <iprt/crypto/digest.h>
-/*******************************************************************************
-* Structures and Typedefs *
-*******************************************************************************/
+/*********************************************************************************************************************************
+* Structures and Typedefs *
+*********************************************************************************************************************************/
/**
* Generic public key signature scheme instance.
*/
diff --git a/src/VBox/Runtime/common/crypto/pkix-signature-rsa.cpp b/src/VBox/Runtime/common/crypto/pkix-signature-rsa.cpp
index 5e3edc9..5bec5d7 100644
--- a/src/VBox/Runtime/common/crypto/pkix-signature-rsa.cpp
+++ b/src/VBox/Runtime/common/crypto/pkix-signature-rsa.cpp
@@ -25,9 +25,9 @@
*/
-/*******************************************************************************
-* Header Files *
-*******************************************************************************/
+/*********************************************************************************************************************************
+* Header Files *
+*********************************************************************************************************************************/
#include "internal/iprt.h"
#include <iprt/crypto/rsa.h>
@@ -42,9 +42,9 @@
#include "pkix-signature-builtin.h"
-/*******************************************************************************
-* Structures and Typedefs *
-*******************************************************************************/
+/*********************************************************************************************************************************
+* Structures and Typedefs *
+*********************************************************************************************************************************/
/**
* RSA signature provider instance.
*/
@@ -77,9 +77,9 @@ typedef struct RTCRPKIXSIGNATURERSA
typedef RTCRPKIXSIGNATURERSA *PRTCRPKIXSIGNATURERSA;
-/*******************************************************************************
-* Global Variables *
-*******************************************************************************/
+/*********************************************************************************************************************************
+* Global Variables *
+*********************************************************************************************************************************/
/** @name Pre-encoded DigestInfo DER sequences.
* @{ */
static const uint8_t g_abMd2[] =
diff --git a/src/VBox/Runtime/common/crypto/pkix-util.cpp b/src/VBox/Runtime/common/crypto/pkix-util.cpp
index a4a1d7e..d94f2f5 100644
--- a/src/VBox/Runtime/common/crypto/pkix-util.cpp
+++ b/src/VBox/Runtime/common/crypto/pkix-util.cpp
@@ -25,9 +25,9 @@
*/
-/*******************************************************************************
-* Header Files *
-*******************************************************************************/
+/*********************************************************************************************************************************
+* Header Files *
+*********************************************************************************************************************************/
#include "internal/iprt.h"
#include <iprt/crypto/pkix.h>
diff --git a/src/VBox/Runtime/common/crypto/pkix-verify.cpp b/src/VBox/Runtime/common/crypto/pkix-verify.cpp
index 46c03dc..389203e 100644
--- a/src/VBox/Runtime/common/crypto/pkix-verify.cpp
+++ b/src/VBox/Runtime/common/crypto/pkix-verify.cpp
@@ -25,9 +25,9 @@
*/
-/*******************************************************************************
-* Header Files *
-*******************************************************************************/
+/*********************************************************************************************************************************
+* Header Files *
+*********************************************************************************************************************************/
#include "internal/iprt.h"
#include <iprt/crypto/pkix.h>
diff --git a/src/VBox/Runtime/common/crypto/rsa-asn1-decoder.cpp b/src/VBox/Runtime/common/crypto/rsa-asn1-decoder.cpp
index ef1fb46..f878034 100644
--- a/src/VBox/Runtime/common/crypto/rsa-asn1-decoder.cpp
+++ b/src/VBox/Runtime/common/crypto/rsa-asn1-decoder.cpp
@@ -25,9 +25,9 @@
*/
-/*******************************************************************************
-* Header Files *
-*******************************************************************************/
+/*********************************************************************************************************************************
+* Header Files *
+*********************************************************************************************************************************/
#include "internal/iprt.h"
#include <iprt/crypto/rsa.h>
diff --git a/src/VBox/Runtime/common/crypto/rsa-core.cpp b/src/VBox/Runtime/common/crypto/rsa-core.cpp
index e95d551..c58a1a1 100644
--- a/src/VBox/Runtime/common/crypto/rsa-core.cpp
+++ b/src/VBox/Runtime/common/crypto/rsa-core.cpp
@@ -25,9 +25,9 @@
*/
-/*******************************************************************************
-* Header Files *
-*******************************************************************************/
+/*********************************************************************************************************************************
+* Header Files *
+*********************************************************************************************************************************/
#include "internal/iprt.h"
#include <iprt/crypto/rsa.h>
diff --git a/src/VBox/Runtime/common/crypto/rsa-init.cpp b/src/VBox/Runtime/common/crypto/rsa-init.cpp
index 73c2d33..7515191 100644
--- a/src/VBox/Runtime/common/crypto/rsa-init.cpp
+++ b/src/VBox/Runtime/common/crypto/rsa-init.cpp
@@ -25,9 +25,9 @@
*/
-/*******************************************************************************
-* Header Files *
-*******************************************************************************/
+/*********************************************************************************************************************************
+* Header Files *
+*********************************************************************************************************************************/
#include "internal/iprt.h"
#include <iprt/crypto/rsa.h>
diff --git a/src/VBox/Runtime/common/crypto/rsa-sanity.cpp b/src/VBox/Runtime/common/crypto/rsa-sanity.cpp
index 2c099ce..ee48b3e 100644
--- a/src/VBox/Runtime/common/crypto/rsa-sanity.cpp
+++ b/src/VBox/Runtime/common/crypto/rsa-sanity.cpp
@@ -25,9 +25,9 @@
*/
-/*******************************************************************************
-* Header Files *
-*******************************************************************************/
+/*********************************************************************************************************************************
+* Header Files *
+*********************************************************************************************************************************/
#include "internal/iprt.h"
#include <iprt/crypto/rsa.h>
diff --git a/src/VBox/Runtime/common/crypto/spc-asn1-decoder.cpp b/src/VBox/Runtime/common/crypto/spc-asn1-decoder.cpp
index d73fc08..77d7cde 100644
--- a/src/VBox/Runtime/common/crypto/spc-asn1-decoder.cpp
+++ b/src/VBox/Runtime/common/crypto/spc-asn1-decoder.cpp
@@ -25,9 +25,9 @@
*/
-/*******************************************************************************
-* Header Files *
-*******************************************************************************/
+/*********************************************************************************************************************************
+* Header Files *
+*********************************************************************************************************************************/
#include "internal/iprt.h"
#include <iprt/crypto/spc.h>
diff --git a/src/VBox/Runtime/common/crypto/spc-core.cpp b/src/VBox/Runtime/common/crypto/spc-core.cpp
index 025ab47..c308617 100644
--- a/src/VBox/Runtime/common/crypto/spc-core.cpp
+++ b/src/VBox/Runtime/common/crypto/spc-core.cpp
@@ -25,9 +25,9 @@
*/
-/*******************************************************************************
-* Header Files *
-*******************************************************************************/
+/*********************************************************************************************************************************
+* Header Files *
+*********************************************************************************************************************************/
#include "internal/iprt.h"
#include <iprt/crypto/spc.h>
diff --git a/src/VBox/Runtime/common/crypto/spc-init.cpp b/src/VBox/Runtime/common/crypto/spc-init.cpp
index f0c35ab..219e76f 100644
--- a/src/VBox/Runtime/common/crypto/spc-init.cpp
+++ b/src/VBox/Runtime/common/crypto/spc-init.cpp
@@ -25,9 +25,9 @@
*/
-/*******************************************************************************
-* Header Files *
-*******************************************************************************/
+/*********************************************************************************************************************************
+* Header Files *
+*********************************************************************************************************************************/
#include "internal/iprt.h"
#include <iprt/crypto/spc.h>
diff --git a/src/VBox/Runtime/common/crypto/spc-sanity.cpp b/src/VBox/Runtime/common/crypto/spc-sanity.cpp
index b521f16..4b2fd33 100644
--- a/src/VBox/Runtime/common/crypto/spc-sanity.cpp
+++ b/src/VBox/Runtime/common/crypto/spc-sanity.cpp
@@ -25,9 +25,9 @@
*/
-/*******************************************************************************
-* Header Files *
-*******************************************************************************/
+/*********************************************************************************************************************************
+* Header Files *
+*********************************************************************************************************************************/
#include "internal/iprt.h"
#include <iprt/crypto/spc.h>
diff --git a/src/VBox/Runtime/common/crypto/store-cert-add-basic.cpp b/src/VBox/Runtime/common/crypto/store-cert-add-basic.cpp
new file mode 100644
index 0000000..260de32
--- /dev/null
+++ b/src/VBox/Runtime/common/crypto/store-cert-add-basic.cpp
@@ -0,0 +1,849 @@
+/* $Id: store-cert-add-basic.cpp $ */
+/** @file
+ * IPRT - Cryptographic (Certificate) Store, RTCrStoreCertAddFromDir.
+ */
+
+/*
+ * Copyright (C) 2006-2015 Oracle Corporation
+ *
+ * This file is part of VirtualBox Open Source Edition (OSE), as
+ * available from http://www.virtualbox.org. This file is free software;
+ * you can redistribute it and/or modify it under the terms of the GNU
+ * General Public License (GPL) as published by the Free Software
+ * Foundation, in version 2 as it comes in the "COPYING" file of the
+ * VirtualBox OSE distribution. VirtualBox OSE is distributed in the
+ * hope that it will be useful, but WITHOUT ANY WARRANTY of any kind.
+ *
+ * The contents of this file may alternatively be used under the terms
+ * of the Common Development and Distribution License Version 1.0
+ * (CDDL) only, as it comes in the "COPYING.CDDL" file of the
+ * VirtualBox OSE distribution, in which case the provisions of the
+ * CDDL are applicable instead of those of the GPL.
+ *
+ * You may elect to license modified versions of this file under the
+ * terms and conditions of either the GPL or the CDDL or both.
+ */
+
+
+/*********************************************************************************************************************************
+* Header Files *
+*********************************************************************************************************************************/
+#include "internal/iprt.h"
+#include <iprt/crypto/store.h>
+
+#include <iprt/assert.h>
+#include <iprt/crypto/pem.h>
+#include <iprt/dir.h>
+#include <iprt/err.h>
+#include <iprt/file.h>
+#include <iprt/mem.h>
+#include <iprt/path.h>
+#include <iprt/sha.h>
+#include <iprt/string.h>
+
+#include "x509-internal.h"
+
+
+/*********************************************************************************************************************************
+* Global Variables *
+*********************************************************************************************************************************/
+/** BEGIN CERTIFICATE / END CERTIFICATE. */
+static RTCRPEMMARKERWORD const g_aWords_Certificate[] =
+{
+ { RT_STR_TUPLE("CERTIFICATE") }
+};
+
+/** BEGIN TRUSTED CERTIFICATE / END TRUSTED CERTIFICATE. */
+static RTCRPEMMARKERWORD const g_aWords_TrustedCertificate[] =
+{
+ { RT_STR_TUPLE("TRUSTED") },
+ { RT_STR_TUPLE("CERTIFICATE") }
+};
+
+/** BEGIN X509 CERTIFICATE / END X509 CERTIFICATE. (old) */
+static RTCRPEMMARKERWORD const g_aWords_X509Certificate[] =
+{
+ { RT_STR_TUPLE("X509") },
+ { RT_STR_TUPLE("CERTIFICATE") }
+};
+
+/**
+ * X509 Certificate markers.
+ *
+ * @remark See crypto/pem/pem.h in OpenSSL for a matching list.
+ */
+static RTCRPEMMARKER const g_aX509CertificateMarkers[3] =
+{
+ { g_aWords_Certificate, RT_ELEMENTS(g_aWords_Certificate) },
+ { g_aWords_TrustedCertificate, RT_ELEMENTS(g_aWords_TrustedCertificate) },
+ { g_aWords_X509Certificate, RT_ELEMENTS(g_aWords_X509Certificate) }
+};
+
+
+
+/**
+ * Checks if we've found all the certificates already.
+ *
+ * @returns true if all found, false if not.
+ * @param afFound Indicator array.
+ * @param cWanted Number of wanted certificates.
+ */
+DECLINLINE(bool) rtCrStoreAllDone(bool const *afFound, size_t cWanted)
+{
+ while (cWanted-- > 0)
+ if (!afFound[cWanted])
+ return false;
+ return true;
+}
+
+
+/**
+ * Checks if the given certificate specs matches the given wanted poster.
+ *
+ * @returns true if match, false if not.
+ * @param pWanted The certificate wanted poster.
+ * @param cbEncoded The candidate certificate encoded size.
+ * @param paSha1 The candidate certificate SHA-1 fingerprint.
+ * @param paSha512 The candidate certificate SHA-512 fingerprint.
+ * @param pCert The decoded candidate certificate, optional. If not
+ * given the result will be uncertain.
+ */
+DECLINLINE(bool) rtCrStoreIsCertEqualToWanted(PCRTCRCERTWANTED pWanted,
+ size_t cbEncoded,
+ uint8_t const pabSha1[RTSHA1_HASH_SIZE],
+ uint8_t const pabSha512[RTSHA512_HASH_SIZE],
+ PCRTCRX509CERTIFICATE pCert)
+{
+ if ( pWanted->cbEncoded != cbEncoded
+ && pWanted->cbEncoded != 0)
+ return false;
+
+ if ( pWanted->fSha1Fingerprint
+ && memcmp(pWanted->abSha1, pabSha1, RTSHA1_HASH_SIZE) != 0)
+ return false;
+
+ if ( pWanted->fSha512Fingerprint
+ && memcmp(pWanted->abSha512, pabSha512, RTSHA512_HASH_SIZE) != 0)
+ return false;
+
+ if ( pWanted->pszSubject
+ && pCert
+ && !RTCrX509Name_MatchWithString(&pCert->TbsCertificate.Subject, pWanted->pszSubject))
+ return false;
+
+ return true;
+}
+
+
+/**
+ * Checks if a certificate is wanted.
+ *
+ * @returns true if match, false if not.
+ * @param paWanted The certificate wanted posters.
+ * @param cWanted The number of wanted posters.
+ * @param apfFound Found initicators running paralell to @a paWanted.
+ * @param cbEncoded The candidate certificate encoded size.
+ * @param paSha1 The candidate certificate SHA-1 fingerprint.
+ * @param paSha512 The candidate certificate SHA-512 fingerprint.
+ * @param pCert The decoded candidate certificate, optional. If not
+ * given the result will be uncertain.
+ */
+DECLINLINE(bool) rtCrStoreIsCertWanted(PCRTCRCERTWANTED paWanted, size_t cWanted, bool const *pafFound, size_t cbEncoded,
+ uint8_t const pabSha1[RTSHA1_HASH_SIZE], uint8_t const pabSha512[RTSHA512_HASH_SIZE],
+ PCRTCRX509CERTIFICATE pCert)
+{
+ for (size_t iCert = 0; iCert < cWanted; iCert++)
+ if (!pafFound[iCert])
+ if (rtCrStoreIsCertEqualToWanted(&paWanted[iCert], cbEncoded, pabSha1, pabSha512, pCert))
+ return true;
+ return false;
+}
+
+
+/**
+ * Marks a certificate as found after it has been added to the store.
+ *
+ * May actually mark several certificates as found if there are duplicates or
+ * ambiguities in the wanted list.
+ *
+ * @returns true if all have been found, false if more to search for.
+ *
+ * @param apfFound Found initicators running paralell to @a paWanted.
+ * This is what this function updates.
+ * @param paWanted The certificate wanted posters.
+ * @param cWanted The number of wanted posters.
+ * @param cbEncoded The candidate certificate encoded size.
+ * @param paSha1 The candidate certificate SHA-1 fingerprint.
+ * @param paSha512 The candidate certificate SHA-512 fingerprint.
+ * @param pCert The decoded candidate certificate, optional. If not
+ * given the result will be uncertain.
+ */
+static bool rtCrStoreMarkCertFound(bool *pafFound, PCRTCRCERTWANTED paWanted, size_t cWanted, size_t cbEncoded,
+ uint8_t const pabSha1[RTSHA1_HASH_SIZE], uint8_t const pabSha512[RTSHA512_HASH_SIZE],
+ PCRTCRX509CERTIFICATE pCert)
+{
+ size_t cFound = 0;
+ for (size_t iCert = 0; iCert < cWanted; iCert++)
+ if (pafFound[iCert])
+ cFound++;
+ else if (rtCrStoreIsCertEqualToWanted(&paWanted[iCert], cbEncoded, pabSha1, pabSha512, pCert))
+ {
+ pafFound[iCert] = true;
+ cFound++;
+ }
+ return cFound == cWanted;
+}
+
+
+RTDECL(int) RTCrStoreCertAddFromStore(RTCRSTORE hStore, uint32_t fFlags, RTCRSTORE hStoreSrc)
+{
+ /*
+ * Validate input.
+ */
+ AssertReturn(!(fFlags & ~(RTCRCERTCTX_F_ADD_IF_NOT_FOUND | RTCRCERTCTX_F_ADD_CONTINUE_ON_ERROR)), VERR_INVALID_FLAGS);
+
+ /*
+ * Enumerate all the certificates in the source store, adding them to the destination.
+ */
+ RTCRSTORECERTSEARCH Search;
+ int rc = RTCrStoreCertFindAll(hStoreSrc, &Search);
+ if (RT_SUCCESS(rc))
+ {
+ PCRTCRCERTCTX pCertCtx;
+ while ((pCertCtx = RTCrStoreCertSearchNext(hStoreSrc, &Search)) != NULL)
+ {
+ int rc2 = RTCrStoreCertAddEncoded(hStore, pCertCtx->fFlags | (fFlags & RTCRCERTCTX_F_ADD_IF_NOT_FOUND),
+ pCertCtx->pabEncoded, pCertCtx->cbEncoded, NULL);
+ if (RT_FAILURE(rc2))
+ {
+ rc = rc2;
+ if (!(fFlags & RTCRCERTCTX_F_ADD_CONTINUE_ON_ERROR))
+ break;
+ }
+ RTCrCertCtxRelease(pCertCtx);
+ }
+
+ int rc2 = RTCrStoreCertSearchDestroy(hStoreSrc, &Search); AssertRC(rc2);
+ }
+ return rc;
+}
+RT_EXPORT_SYMBOL(RTCrStoreCertAddFromStore);
+
+
+RTDECL(int) RTCrStoreCertAddWantedFromStore(RTCRSTORE hStore, uint32_t fFlags, RTCRSTORE hSrcStore,
+ PCRTCRCERTWANTED paWanted, size_t cWanted, bool *pafFound)
+{
+ /*
+ * Validate input a little.
+ */
+ AssertReturn(!(fFlags & ~(RTCRCERTCTX_F_ADD_IF_NOT_FOUND | RTCRCERTCTX_F_ADD_CONTINUE_ON_ERROR)), VERR_INVALID_FLAGS);
+ fFlags |= RTCRCERTCTX_F_ADD_IF_NOT_FOUND; /* forced */
+
+ AssertReturn(cWanted, VERR_NOT_FOUND);
+ for (uint32_t i = 0; i < cWanted; i++)
+ {
+ AssertReturn(!paWanted[i].pszSubject || *paWanted[i].pszSubject, VERR_INVALID_PARAMETER);
+ AssertReturn( paWanted[i].pszSubject
+ || paWanted[i].fSha1Fingerprint
+ || paWanted[i].fSha512Fingerprint,
+ VERR_INVALID_PARAMETER);
+ }
+
+ /*
+ * Make sure we've got a result array.
+ */
+ bool *pafFoundFree = NULL;
+ if (!pafFound)
+ {
+ pafFound = pafFoundFree = (bool *)RTMemTmpAllocZ(sizeof(bool) * cWanted);
+ AssertReturn(pafFound, VERR_NO_TMP_MEMORY);
+ }
+
+ /*
+ * Enumerate the store entries.
+ */
+ RTCRSTORECERTSEARCH Search;
+ int rc = RTCrStoreCertFindAll(hSrcStore, &Search);
+ if (RT_SUCCESS(rc))
+ {
+ rc = VWRN_NOT_FOUND;
+ PCRTCRCERTCTX pCertCtx;
+ while ((pCertCtx = RTCrStoreCertSearchNext(hSrcStore, &Search)) != NULL)
+ {
+ if ( (pCertCtx->fFlags & RTCRCERTCTX_F_ENC_MASK) == RTCRCERTCTX_F_ENC_X509_DER
+ && pCertCtx->cbEncoded > 0
+ && pCertCtx->pCert)
+ {
+ /*
+ * If the certificate is wanted, try add it to the store.
+ */
+ uint8_t abSha1[RTSHA1_HASH_SIZE];
+ RTSha1(pCertCtx->pabEncoded, pCertCtx->cbEncoded, abSha1);
+ uint8_t abSha512[RTSHA512_HASH_SIZE];
+ RTSha512(pCertCtx->pabEncoded, pCertCtx->cbEncoded, abSha512);
+ if (rtCrStoreIsCertWanted(paWanted, cWanted, pafFound, pCertCtx->cbEncoded, abSha1, abSha512, pCertCtx->pCert))
+ {
+ int rc2 = RTCrStoreCertAddEncoded(hStore,
+ RTCRCERTCTX_F_ENC_X509_DER | (fFlags & RTCRCERTCTX_F_ADD_IF_NOT_FOUND),
+ pCertCtx->pabEncoded, pCertCtx->cbEncoded, NULL /*pErrInfo*/);
+ if (RT_SUCCESS(rc2))
+ {
+ /*
+ * Mark it as found, stop if we've found all.
+ */
+ if (rtCrStoreMarkCertFound(pafFound, paWanted, cWanted,
+ pCertCtx->cbEncoded, abSha1, abSha512, pCertCtx->pCert))
+ {
+ if (RT_SUCCESS(rc))
+ rc = VINF_SUCCESS;
+ RTCrCertCtxRelease(pCertCtx);
+ break;
+ }
+ }
+ else
+ {
+ /*
+ * Some error adding the certificate. Since it cannot be anything with
+ * the encoding, it must be something with the store or resources, so
+ * always return the error status.
+ */
+ rc = rc2;
+ if (!(fFlags & RTCRCERTCTX_F_ADD_CONTINUE_ON_ERROR))
+ {
+ RTCrCertCtxRelease(pCertCtx);
+ break;
+ }
+ }
+ }
+ }
+ RTCrCertCtxRelease(pCertCtx);
+ }
+ int rc2 = RTCrStoreCertSearchDestroy(hSrcStore, &Search);
+ AssertRC(rc2);
+ }
+
+ if (pafFoundFree)
+ RTMemTmpFree(pafFoundFree);
+ return rc;
+}
+RT_EXPORT_SYMBOL(RTCrStoreCertAddWantedFromStore);
+
+
+RTDECL(int) RTCrStoreCertCheckWanted(RTCRSTORE hStore, PCRTCRCERTWANTED paWanted, size_t cWanted, bool *pafFound)
+{
+ /*
+ * Validate input a little.
+ */
+ AssertReturn(cWanted, VERR_NOT_FOUND);
+ for (uint32_t i = 0; i < cWanted; i++)
+ {
+ AssertReturn(!paWanted[i].pszSubject || *paWanted[i].pszSubject, VERR_INVALID_PARAMETER);
+ AssertReturn( paWanted[i].pszSubject
+ || paWanted[i].fSha1Fingerprint
+ || paWanted[i].fSha512Fingerprint,
+ VERR_INVALID_PARAMETER);
+ }
+ AssertPtrReturn(pafFound, VERR_INVALID_POINTER);
+
+ /*
+ * Clear the found array.
+ */
+ for (uint32_t iCert = 0; iCert < cWanted; iCert++)
+ pafFound[iCert] = false;
+
+ /*
+ * Enumerate the store entries.
+ */
+ RTCRSTORECERTSEARCH Search;
+ int rc = RTCrStoreCertFindAll(hStore, &Search);
+ if (RT_SUCCESS(rc))
+ {
+ rc = VWRN_NOT_FOUND;
+ PCRTCRCERTCTX pCertCtx;
+ while ((pCertCtx = RTCrStoreCertSearchNext(hStore, &Search)) != NULL)
+ {
+ if ( (pCertCtx->fFlags & RTCRCERTCTX_F_ENC_MASK) == RTCRCERTCTX_F_ENC_X509_DER
+ && pCertCtx->cbEncoded > 0
+ && pCertCtx->pCert)
+ {
+ /*
+ * Hash it and check if it's wanted. Stop when we've found all.
+ */
+ uint8_t abSha1[RTSHA1_HASH_SIZE];
+ RTSha1(pCertCtx->pabEncoded, pCertCtx->cbEncoded, abSha1);
+ uint8_t abSha512[RTSHA512_HASH_SIZE];
+ RTSha512(pCertCtx->pabEncoded, pCertCtx->cbEncoded, abSha512);
+ if (rtCrStoreMarkCertFound(pafFound, paWanted, cWanted, pCertCtx->cbEncoded, abSha1, abSha512, pCertCtx->pCert))
+ {
+ rc = VINF_SUCCESS;
+ RTCrCertCtxRelease(pCertCtx);
+ break;
+ }
+ }
+ RTCrCertCtxRelease(pCertCtx);
+ }
+ int rc2 = RTCrStoreCertSearchDestroy(hStore, &Search);
+ AssertRC(rc2);
+ }
+
+ return rc;
+}
+RT_EXPORT_SYMBOL(RTCrStoreCertAddWantedFromStore);
+
+
+RTDECL(int) RTCrStoreCertAddFromFile(RTCRSTORE hStore, uint32_t fFlags, const char *pszFilename, PRTERRINFO pErrInfo)
+{
+ AssertReturn(!(fFlags & ~(RTCRCERTCTX_F_ADD_IF_NOT_FOUND | RTCRCERTCTX_F_ADD_CONTINUE_ON_ERROR)), VERR_INVALID_FLAGS);
+
+ size_t cbContent;
+ void *pvContent;
+ int rc = RTFileReadAllEx(pszFilename, 0, 64U*_1M, RTFILE_RDALL_O_DENY_WRITE, &pvContent, &cbContent);
+ if (RT_SUCCESS(rc))
+ {
+ /*
+ * Is it a java key store file?
+ */
+ if ( cbContent > 32
+ && ((uint32_t const *)pvContent)[0] == RT_H2BE_U32_C(UINT32_C(0xfeedfeed)) /* magic */
+ && ((uint32_t const *)pvContent)[1] == RT_H2BE_U32_C(UINT32_C(0x00000002)) /* version */ )
+ rc = RTCrStoreCertAddFromJavaKeyStoreInMem(hStore, fFlags, pvContent, cbContent, pszFilename, pErrInfo);
+ /*
+ * No assume PEM or DER encoded binary certificate.
+ */
+ else
+ {
+ PCRTCRPEMSECTION pSectionHead;
+ rc = RTCrPemParseContent(pvContent, cbContent,
+ (fFlags & RTCRCERTCTX_F_ADD_CONTINUE_ON_ERROR)
+ ? RTCRPEMREADFILE_F_CONTINUE_ON_ENCODING_ERROR : 0,
+ g_aX509CertificateMarkers, RT_ELEMENTS(g_aX509CertificateMarkers),
+ &pSectionHead, pErrInfo);
+ if (RT_SUCCESS(rc))
+ {
+ PCRTCRPEMSECTION pCurSec = pSectionHead;
+ while (pCurSec)
+ {
+ int rc2 = RTCrStoreCertAddEncoded(hStore,
+ RTCRCERTCTX_F_ENC_X509_DER | (fFlags & RTCRCERTCTX_F_ADD_IF_NOT_FOUND),
+ pCurSec->pbData, pCurSec->cbData,
+ !RTErrInfoIsSet(pErrInfo) ? pErrInfo : NULL);
+ if (RT_FAILURE(rc2) && RT_SUCCESS(rc))
+ {
+ rc = rc2;
+ if (!(fFlags & RTCRCERTCTX_F_ADD_CONTINUE_ON_ERROR))
+ break;
+ }
+ pCurSec = pCurSec->pNext;
+ }
+
+ RTCrPemFreeSections(pSectionHead);
+ }
+ }
+ RTFileReadAllFree(pvContent, cbContent);
+ }
+ else
+ rc = RTErrInfoSetF(pErrInfo, rc, "RTFileReadAllEx failed with %Rrc on '%s'", rc, pszFilename);
+ return rc;
+}
+RT_EXPORT_SYMBOL(RTCrStoreCertAddFromFile);
+
+
+RTDECL(int) RTCrStoreCertAddWantedFromFile(RTCRSTORE hStore, uint32_t fFlags, const char *pszFilename,
+ PCRTCRCERTWANTED paWanted, size_t cWanted, bool *pafFound, PRTERRINFO pErrInfo)
+{
+ /*
+ * Validate input a little.
+ */
+ AssertReturn(!(fFlags & ~(RTCRCERTCTX_F_ADD_IF_NOT_FOUND | RTCRCERTCTX_F_ADD_CONTINUE_ON_ERROR)), VERR_INVALID_FLAGS);
+ fFlags |= RTCRCERTCTX_F_ADD_IF_NOT_FOUND; /* forced */
+
+ AssertReturn(cWanted, VERR_NOT_FOUND);
+ for (uint32_t i = 0; i < cWanted; i++)
+ {
+ AssertReturn(!paWanted[i].pszSubject || *paWanted[i].pszSubject, VERR_INVALID_PARAMETER);
+ AssertReturn( paWanted[i].pszSubject
+ || paWanted[i].fSha1Fingerprint
+ || paWanted[i].fSha512Fingerprint,
+ VERR_INVALID_PARAMETER);
+ }
+
+ /*
+ * Make sure we've got a result array.
+ */
+ bool *pafFoundFree = NULL;
+ if (!pafFound)
+ {
+ pafFound = pafFoundFree = (bool *)RTMemTmpAllocZ(sizeof(bool) * cWanted);
+ AssertReturn(pafFound, VERR_NO_TMP_MEMORY);
+ }
+
+ size_t cbContent;
+ void *pvContent;
+ int rc = RTFileReadAllEx(pszFilename, 0, 64U*_1M, RTFILE_RDALL_O_DENY_WRITE, &pvContent, &cbContent);
+ if (RT_SUCCESS(rc))
+ {
+ /*
+ * Is it a java key store file? If so, load it into a tmp store
+ * which we can search. Don't want to duplicate the JKS reader code.
+ */
+ if ( cbContent > 32
+ && ((uint32_t const *)pvContent)[0] == RT_H2BE_U32_C(UINT32_C(0xfeedfeed)) /* magic */
+ && ((uint32_t const *)pvContent)[1] == RT_H2BE_U32_C(UINT32_C(0x00000002)) /* version */ )
+ {
+ RTCRSTORE hTmpStore;
+ rc = RTCrStoreCreateInMem(&hTmpStore, 64);
+ if (RT_SUCCESS(rc))
+ {
+ rc = RTCrStoreCertAddFromJavaKeyStoreInMem(hStore, fFlags, pvContent, cbContent, pszFilename, pErrInfo);
+ if (RT_SUCCESS(rc))
+ rc = RTCrStoreCertAddWantedFromStore(hStore, fFlags, hTmpStore, paWanted, cWanted, pafFound);
+ RTCrStoreRelease(hTmpStore);
+ }
+ else
+ rc = RTErrInfoSet(pErrInfo, rc, "Error creating temporary crypto store");
+ }
+ /*
+ * No assume PEM or DER encoded binary certificate. Inspect them one by one.
+ */
+ else
+ {
+ PCRTCRPEMSECTION pSectionHead;
+ rc = RTCrPemParseContent(pvContent, cbContent,
+ (fFlags & RTCRCERTCTX_F_ADD_CONTINUE_ON_ERROR)
+ ? RTCRPEMREADFILE_F_CONTINUE_ON_ENCODING_ERROR : 0,
+ g_aX509CertificateMarkers, RT_ELEMENTS(g_aX509CertificateMarkers),
+ &pSectionHead, pErrInfo);
+ if (RT_SUCCESS(rc))
+ {
+ rc = VWRN_NOT_FOUND;
+ for (PCRTCRPEMSECTION pCurSec = pSectionHead; pCurSec; pCurSec = pCurSec->pNext)
+ {
+ if (!pCurSec->cbData)
+ continue;
+
+ /*
+ * See if this is a binary blob we might be interested in.
+ */
+ uint8_t abSha1[RTSHA1_HASH_SIZE];
+ RTSha1(pCurSec->pbData, pCurSec->cbData, abSha1);
+ uint8_t abSha512[RTSHA512_HASH_SIZE];
+ RTSha512(pCurSec->pbData, pCurSec->cbData, abSha512);
+ if (!rtCrStoreIsCertWanted(paWanted, cWanted, pafFound, pCurSec->cbData, abSha1, abSha512, NULL))
+ continue;
+
+ /*
+ * Decode the certificate so we can match the subject string.
+ */
+ RTASN1CURSORPRIMARY Cursor;
+ RTAsn1CursorInitPrimary(&Cursor, pCurSec->pbData, (uint32_t)pCurSec->cbData,
+ !RTErrInfoIsSet(pErrInfo) ? pErrInfo : NULL,
+ &g_RTAsn1DefaultAllocator, RTASN1CURSOR_FLAGS_DER, "InMem");
+ RTCRX509CERTIFICATE X509Cert;
+ int rc2 = RTCrX509Certificate_DecodeAsn1(&Cursor.Cursor, 0, &X509Cert, "Cert");
+ if (RT_SUCCESS(rc2))
+ {
+ rc2 = RTCrX509Certificate_CheckSanity(&X509Cert, 0, !RTErrInfoIsSet(pErrInfo) ? pErrInfo : NULL, "Cert");
+ if (RT_SUCCESS(rc2))
+ {
+ if (rtCrStoreIsCertWanted(paWanted, cWanted, pafFound, pCurSec->cbData, abSha1, abSha512, &X509Cert))
+ {
+ /*
+ * The certificate is wanted, now add it to the store.
+ */
+ rc2 = RTCrStoreCertAddEncoded(hStore,
+ RTCRCERTCTX_F_ENC_X509_DER
+ | (fFlags & RTCRCERTCTX_F_ADD_IF_NOT_FOUND),
+ pCurSec->pbData, pCurSec->cbData,
+ !RTErrInfoIsSet(pErrInfo) ? pErrInfo : NULL);
+ if (RT_SUCCESS(rc2))
+ {
+ /*
+ * Mark it as found, stop if we've found all.
+ */
+ if (rtCrStoreMarkCertFound(pafFound, paWanted, cWanted,
+ pCurSec->cbData, abSha1, abSha512, &X509Cert))
+ {
+ RTAsn1VtDelete(&X509Cert.SeqCore.Asn1Core);
+ rc = VINF_SUCCESS;
+ break;
+ }
+ }
+ }
+ }
+ else
+ Assert(!pErrInfo || RTErrInfoIsSet(pErrInfo));
+ RTAsn1VtDelete(&X509Cert.SeqCore.Asn1Core);
+ }
+ else if (!RTErrInfoIsSet(pErrInfo))
+ RTErrInfoSetF(pErrInfo, rc2, "RTCrX509Certificate_DecodeAsn1 failed");
+
+ /*
+ * Stop on error, if requested. Otherwise, let pErrInfo keep it.
+ */
+ if (RT_FAILURE(rc2) && !(fFlags & RTCRCERTCTX_F_ADD_CONTINUE_ON_ERROR))
+ {
+ rc = rc2;
+ break;
+ }
+ } /* For each PEM section. */
+
+ RTCrPemFreeSections(pSectionHead);
+ }
+ }
+ RTFileReadAllFree(pvContent, cbContent);
+ }
+ else
+ rc = RTErrInfoSetF(pErrInfo, rc, "RTFileReadAllEx failed with %Rrc on '%s'", rc, pszFilename);
+
+ if (pafFoundFree)
+ RTMemTmpFree(pafFoundFree);
+ return rc;
+}
+RT_EXPORT_SYMBOL(RTCrStoreCertAddWantedFromFile);
+
+
+/**
+ * Checks if the directory entry matches the specified suffixes.
+ *
+ * @returns true on match, false on mismatch.
+ * @param pDirEntry The directory to check.
+ * @param paSuffixes The array of suffixes to match against.
+ * @param cSuffixes The number of suffixes in the array.
+ */
+DECLINLINE(bool) rtCrStoreIsSuffixMatch(PCRTDIRENTRY pDirEntry, PCRTSTRTUPLE paSuffixes, size_t cSuffixes)
+{
+ if (cSuffixes == 0)
+ return true;
+
+ size_t const cchName = pDirEntry->cbName;
+ size_t i = cSuffixes;
+ while (i-- > 0)
+ if ( cchName > paSuffixes[i].cch
+ && memcmp(&pDirEntry->szName[cchName - paSuffixes[i].cch], paSuffixes[i].psz, paSuffixes[i].cch) == 0)
+ return true;
+
+ return false;
+}
+
+
+RTDECL(int) RTCrStoreCertAddFromDir(RTCRSTORE hStore, uint32_t fFlags, const char *pszDir,
+ PCRTSTRTUPLE paSuffixes, size_t cSuffixes, PRTERRINFO pErrInfo)
+{
+ /*
+ * Validate input.
+ */
+ AssertReturn(!(fFlags & ~(RTCRCERTCTX_F_ADD_IF_NOT_FOUND | RTCRCERTCTX_F_ADD_CONTINUE_ON_ERROR)), VERR_INVALID_FLAGS);
+ size_t i = cSuffixes;
+ while (i-- > 0)
+ {
+ Assert(paSuffixes[i].cch > 0);
+ Assert(strlen(paSuffixes[i].psz) == paSuffixes[i].cch);
+ }
+
+ /*
+ * Prepare for constructing path to the files in the directory, so that we
+ * can open them.
+ */
+ char szPath[RTPATH_MAX];
+ int rc = RTStrCopy(szPath, sizeof(szPath), pszDir);
+ if (RT_SUCCESS(rc))
+ {
+ size_t cchPath = RTPathEnsureTrailingSeparator(szPath, sizeof(szPath));
+ if (cchPath > 0)
+ {
+ size_t const cbMaxFilename = sizeof(szPath) - cchPath;
+
+ /*
+ * Enumerate the directory.
+ */
+ PRTDIR hDir;
+ rc = RTDirOpen(&hDir, pszDir);
+ if (RT_SUCCESS(rc))
+ {
+ for (;;)
+ {
+ /* Read the next entry. */
+ union
+ {
+ RTDIRENTRY DirEntry;
+ uint8_t abPadding[RTPATH_MAX + sizeof(RTDIRENTRY)];
+ } u;
+ size_t cbBuf = sizeof(u);
+ int rc2 = RTDirRead(hDir, &u.DirEntry, &cbBuf);
+ if (RT_SUCCESS(rc2))
+ {
+ if ( ( u.DirEntry.enmType == RTDIRENTRYTYPE_FILE
+ || u.DirEntry.enmType == RTDIRENTRYTYPE_SYMLINK
+ || ( u.DirEntry.enmType == RTDIRENTRYTYPE_UNKNOWN
+ && !RTDirEntryIsStdDotLink(&u.DirEntry)) )
+ && rtCrStoreIsSuffixMatch(&u.DirEntry, paSuffixes, cSuffixes) )
+ {
+ if (u.DirEntry.cbName < cbMaxFilename)
+ {
+ memcpy(&szPath[cchPath], u.DirEntry.szName, u.DirEntry.cbName + 1);
+ rc2 = RTDirQueryUnknownType(szPath, true /*fFollowSymlinks*/, &u.DirEntry.enmType);
+ if ( RT_SUCCESS(rc2)
+ && u.DirEntry.enmType == RTDIRENTRYTYPE_FILE)
+ {
+ /*
+ * Add it.
+ */
+ rc2 = RTCrStoreCertAddFromFile(hStore, fFlags, szPath, pErrInfo);
+ if (RT_FAILURE(rc2))
+ {
+ rc = rc2;
+ if (!(fFlags & RTCRCERTCTX_F_ADD_CONTINUE_ON_ERROR))
+ break;
+ }
+ }
+ }
+ else
+ {
+ rc = RTErrInfoAddF(pErrInfo, VERR_FILENAME_TOO_LONG,
+ " Too long filename (%u bytes)", u.DirEntry.cbName);
+ if (!(fFlags & RTCRCERTCTX_F_ADD_CONTINUE_ON_ERROR))
+ break;
+ }
+ }
+ }
+ else
+ {
+ if (rc2 != VERR_NO_MORE_FILES)
+ rc = RTErrInfoAddF(pErrInfo, rc2, " RTDirRead failed: %Rrc", rc2);
+ break;
+ }
+ }
+
+ RTDirClose(hDir);
+ }
+ else
+ rc = RTErrInfoAddF(pErrInfo, rc, " RTDirOpen('%s'): %Rrc", pszDir, rc);
+ }
+ else
+ rc = VERR_FILENAME_TOO_LONG;
+ }
+ return rc;
+}
+RT_EXPORT_SYMBOL(RTCrStoreCertAddFromDir);
+
+
+RTDECL(int) RTCrStoreCertAddWantedFromDir(RTCRSTORE hStore, uint32_t fFlags,
+ const char *pszDir, PCRTSTRTUPLE paSuffixes, size_t cSuffixes,
+ PCRTCRCERTWANTED paWanted, size_t cWanted, bool *pafFound, PRTERRINFO pErrInfo)
+{
+ /*
+ * Validate input a little.
+ */
+ AssertReturn(*pszDir, VERR_PATH_ZERO_LENGTH);
+ AssertReturn(!(fFlags & ~(RTCRCERTCTX_F_ADD_IF_NOT_FOUND | RTCRCERTCTX_F_ADD_CONTINUE_ON_ERROR)), VERR_INVALID_FLAGS);
+ fFlags |= RTCRCERTCTX_F_ADD_IF_NOT_FOUND; /* forced */
+
+ AssertReturn(cWanted, VERR_NOT_FOUND);
+ for (uint32_t i = 0; i < cWanted; i++)
+ {
+ AssertReturn(!paWanted[i].pszSubject || *paWanted[i].pszSubject, VERR_INVALID_PARAMETER);
+ AssertReturn( paWanted[i].pszSubject
+ || paWanted[i].fSha1Fingerprint
+ || paWanted[i].fSha512Fingerprint,
+ VERR_INVALID_PARAMETER);
+ }
+
+ /*
+ * Prepare for constructing path to the files in the directory, so that we
+ * can open them.
+ */
+ char szPath[RTPATH_MAX];
+ int rc = RTStrCopy(szPath, sizeof(szPath), pszDir);
+ if (RT_SUCCESS(rc))
+ {
+ size_t cchPath = RTPathEnsureTrailingSeparator(szPath, sizeof(szPath));
+ if (cchPath > 0)
+ {
+ size_t const cbMaxFilename = sizeof(szPath) - cchPath;
+
+ /*
+ * Enumerate the directory.
+ */
+ PRTDIR hDir;
+ rc = RTDirOpen(&hDir, pszDir);
+ if (RT_SUCCESS(rc))
+ {
+ rc = VWRN_NOT_FOUND;
+ for (;;)
+ {
+ /* Read the next entry. */
+ union
+ {
+ RTDIRENTRY DirEntry;
+ uint8_t abPadding[RTPATH_MAX + sizeof(RTDIRENTRY)];
+ } u;
+ size_t cbEntry = sizeof(u);
+ int rc2 = RTDirRead(hDir, &u.DirEntry, &cbEntry);
+ if (RT_SUCCESS(rc2))
+ {
+ if ( ( u.DirEntry.enmType == RTDIRENTRYTYPE_FILE
+ || u.DirEntry.enmType == RTDIRENTRYTYPE_SYMLINK
+ || ( u.DirEntry.enmType == RTDIRENTRYTYPE_UNKNOWN
+ && !RTDirEntryIsStdDotLink(&u.DirEntry)) )
+ && rtCrStoreIsSuffixMatch(&u.DirEntry, paSuffixes, cSuffixes) )
+ {
+ if (u.DirEntry.cbName < cbMaxFilename)
+ {
+ memcpy(&szPath[cchPath], u.DirEntry.szName, u.DirEntry.cbName);
+ szPath[cchPath + u.DirEntry.cbName] = '\0';
+ if (u.DirEntry.enmType != RTDIRENTRYTYPE_FILE)
+ RTDirQueryUnknownType(szPath, true /*fFollowSymlinks*/, &u.DirEntry.enmType);
+ if (u.DirEntry.enmType == RTDIRENTRYTYPE_FILE)
+ {
+ rc2 = RTCrStoreCertAddWantedFromFile(hStore, fFlags, szPath,
+ paWanted, cWanted, pafFound, pErrInfo);
+ if (rc2 == VINF_SUCCESS)
+ {
+ Assert(rtCrStoreAllDone(pafFound, cWanted));
+ if (RT_SUCCESS(rc))
+ rc = VINF_SUCCESS;
+ break;
+ }
+ if (RT_FAILURE(rc2) && !(fFlags & RTCRCERTCTX_F_ADD_CONTINUE_ON_ERROR))
+ {
+ rc = rc2;
+ break;
+ }
+ }
+ }
+ else
+ {
+ /*
+ * pErrInfo keeps the status code unless it's fatal.
+ */
+ RTErrInfoAddF(pErrInfo, VERR_FILENAME_TOO_LONG,
+ " Too long filename (%u bytes)", u.DirEntry.cbName);
+ if (!(fFlags & RTCRCERTCTX_F_ADD_CONTINUE_ON_ERROR))
+ {
+ rc = VERR_FILENAME_TOO_LONG;
+ break;
+ }
+ }
+ }
+ }
+ else
+ {
+ if (rc2 != VERR_NO_MORE_FILES)
+ {
+ RTErrInfoAddF(pErrInfo, rc2, "RTDirRead failed: %Rrc", rc2);
+ if (!(fFlags & RTCRCERTCTX_F_ADD_CONTINUE_ON_ERROR))
+ rc = rc2;
+ }
+ break;
+ }
+ }
+ RTDirClose(hDir);
+ }
+ }
+ else
+ rc = VERR_FILENAME_TOO_LONG;
+ }
+ return rc;
+}
+RT_EXPORT_SYMBOL(RTCrStoreCertAddWantedFromDir);
+
diff --git a/src/VBox/Runtime/common/crypto/store-inmem.cpp b/src/VBox/Runtime/common/crypto/store-inmem.cpp
index 673c904..0f10f5c 100644
--- a/src/VBox/Runtime/common/crypto/store-inmem.cpp
+++ b/src/VBox/Runtime/common/crypto/store-inmem.cpp
@@ -25,9 +25,9 @@
*/
-/*******************************************************************************
-* Header Files *
-*******************************************************************************/
+/*********************************************************************************************************************************
+* Header Files *
+*********************************************************************************************************************************/
#include "internal/iprt.h"
#include <iprt/crypto/store.h>
@@ -39,9 +39,9 @@
#include "store-internal.h"
-/*******************************************************************************
-* Structures and Typedefs *
-*******************************************************************************/
+/*********************************************************************************************************************************
+* Structures and Typedefs *
+*********************************************************************************************************************************/
/**
* A certificate entry in the in-memory store.
*/
@@ -281,18 +281,40 @@ static DECLCALLBACK(int) rtCrStoreInMem_CertAddEncoded(void *pvProvider, uint32_
PRTCRSTOREINMEM pThis = (PRTCRSTOREINMEM)pvProvider;
int rc;
- AssertMsgReturn( fFlags == RTCRCERTCTX_F_ENC_X509_DER
- || fFlags == RTCRCERTCTX_F_ENC_TAF_DER
+ AssertMsgReturn( (fFlags & RTCRCERTCTX_F_ENC_MASK) == RTCRCERTCTX_F_ENC_X509_DER
+ || (fFlags & RTCRCERTCTX_F_ENC_MASK) == RTCRCERTCTX_F_ENC_TAF_DER
, ("Only X.509 and TAF DER are supported: %#x\n", fFlags), VERR_INVALID_FLAGS);
- if (pThis->cCerts + 1 > pThis->cCertsAlloc)
+ /*
+ * Check for duplicates if specified.
+ */
+ if (fFlags & RTCRCERTCTX_F_ADD_IF_NOT_FOUND)
+ {
+ uint32_t iCert = pThis->cCerts;
+ while (iCert-- > 0)
+ {
+ PRTCRSTOREINMEMCERT pCert = pThis->papCerts[iCert];
+ if ( pCert->Core.Public.cbEncoded == cbEncoded
+ && pCert->Core.Public.fFlags == (fFlags & RTCRCERTCTX_F_ENC_MASK)
+ && memcmp(pCert->Core.Public.pabEncoded, pbEncoded, cbEncoded) == 0)
+ return VWRN_ALREADY_EXISTS;
+ }
+ }
+
+ /*
+ * Add it.
+ */
+ if (pThis->cCerts + 1 <= pThis->cCertsAlloc)
+ { /* likely */ }
+ else
{
rc = rtCrStoreInMemGrow(pThis, pThis->cCerts + 1);
if (RT_FAILURE(rc))
return rc;
}
- rc = rtCrStoreInMemCreateCertEntry(pThis, fFlags, pbEncoded, cbEncoded, pErrInfo, &pThis->papCerts[pThis->cCerts]);
+ rc = rtCrStoreInMemCreateCertEntry(pThis, fFlags & RTCRCERTCTX_F_ENC_MASK, pbEncoded, cbEncoded,
+ pErrInfo, &pThis->papCerts[pThis->cCerts]);
if (RT_SUCCESS(rc))
{
pThis->cCerts++;
@@ -359,4 +381,5 @@ RTDECL(int) RTCrStoreCreateInMem(PRTCRSTORE phStore, uint32_t cSizeHint)
}
return rc;
}
+RT_EXPORT_SYMBOL(RTCrStoreCreateInMem);
diff --git a/src/VBox/Runtime/common/crypto/store-internal.h b/src/VBox/Runtime/common/crypto/store-internal.h
index a24f0c0..89abf65 100644
--- a/src/VBox/Runtime/common/crypto/store-internal.h
+++ b/src/VBox/Runtime/common/crypto/store-internal.h
@@ -124,6 +124,9 @@ typedef struct RTCRSTOREPROVIDER
/**
* Adds a certificate to the store.
*
+ * @returns IPRT status.
+ * @retval VWRN_ALREADY_EXISTS if the certificate is already present and
+ * RTCRCERTCTX_F_ADD_IF_NOT_FOUND was specified.
* @param pvProvider The provider specific data.
* @param fFlags RTCRCERTCTX_F_XXX.
* @param pbEncoded The encoded certificate bytes.
diff --git a/src/VBox/Runtime/common/crypto/store.cpp b/src/VBox/Runtime/common/crypto/store.cpp
index aa4da82..04dd18d 100644
--- a/src/VBox/Runtime/common/crypto/store.cpp
+++ b/src/VBox/Runtime/common/crypto/store.cpp
@@ -25,9 +25,9 @@
*/
-/*******************************************************************************
-* Header Files *
-*******************************************************************************/
+/*********************************************************************************************************************************
+* Header Files *
+*********************************************************************************************************************************/
#include "internal/iprt.h"
#include <iprt/crypto/store.h>
@@ -45,9 +45,9 @@
#include "store-internal.h"
-/*******************************************************************************
-* Structures and Typedefs *
-*******************************************************************************/
+/*********************************************************************************************************************************
+* Structures and Typedefs *
+*********************************************************************************************************************************/
/**
* Internal representation of a (certificate,++) store.
*/
@@ -173,8 +173,9 @@ RTDECL(int) RTCrStoreCertAddEncoded(RTCRSTORE hStore, uint32_t fFlags, void cons
AssertReturn(pThis->u32Magic == RTCRSTOREINT_MAGIC, VERR_INVALID_HANDLE);
AssertPtrReturn(pvSrc, VERR_INVALID_POINTER);
AssertReturn(cbSrc > 16 && cbSrc < _1M, VERR_OUT_OF_RANGE);
- AssertMsgReturn( fFlags == RTCRCERTCTX_F_ENC_X509_DER
- || fFlags == RTCRCERTCTX_F_ENC_TAF_DER
+ AssertReturn(!(fFlags & ~(RTCRCERTCTX_F_ADD_IF_NOT_FOUND | RTCRCERTCTX_F_ENC_MASK)), VERR_INVALID_FLAGS);
+ AssertMsgReturn( (fFlags & RTCRCERTCTX_F_ENC_MASK) == RTCRCERTCTX_F_ENC_X509_DER
+ || (fFlags & RTCRCERTCTX_F_ENC_MASK) == RTCRCERTCTX_F_ENC_TAF_DER
, ("Only X.509 and TAF DER supported: %#x\n", fFlags), VERR_INVALID_FLAGS);
int rc;
@@ -286,6 +287,29 @@ RTDECL(int) RTCrStoreCertSearchDestroy(RTCRSTORE hStore, PRTCRSTORECERTSEARCH pS
+RTDECL(uint32_t) RTCrStoreCertCount(RTCRSTORE hStore)
+{
+ PRTCRSTOREINT pThis = (PRTCRSTOREINT)hStore;
+ AssertPtrReturn(pThis, UINT32_MAX);
+ AssertReturn(pThis->u32Magic == RTCRSTOREINT_MAGIC, UINT32_MAX);
+
+ RTCRSTORECERTSEARCH Search;
+ int rc = pThis->pProvider->pfnCertFindAll(pThis->pvProvider, &Search);
+ AssertRCReturn(rc, UINT32_MAX);
+
+
+ uint32_t cCerts = 0;
+ PCRTCRCERTCTX pCur;
+ while ((pCur = pThis->pProvider->pfnCertSearchNext(pThis->pvProvider, &Search)) != NULL)
+ {
+ RTCrCertCtxRelease(pCur);
+ cCerts++;
+ }
+
+ return cCerts;
+}
+
+
#ifdef IPRT_WITH_OPENSSL
/*
* OpenSSL helper.
diff --git a/src/VBox/Runtime/common/crypto/taf-asn1-decoder.cpp b/src/VBox/Runtime/common/crypto/taf-asn1-decoder.cpp
index 3819525..2c0edf9 100644
--- a/src/VBox/Runtime/common/crypto/taf-asn1-decoder.cpp
+++ b/src/VBox/Runtime/common/crypto/taf-asn1-decoder.cpp
@@ -25,9 +25,9 @@
*/
-/*******************************************************************************
-* Header Files *
-*******************************************************************************/
+/*********************************************************************************************************************************
+* Header Files *
+*********************************************************************************************************************************/
#include "internal/iprt.h"
#include <iprt/crypto/taf.h>
diff --git a/src/VBox/Runtime/common/crypto/taf-core.cpp b/src/VBox/Runtime/common/crypto/taf-core.cpp
index f372ade..2836a2e 100644
--- a/src/VBox/Runtime/common/crypto/taf-core.cpp
+++ b/src/VBox/Runtime/common/crypto/taf-core.cpp
@@ -25,9 +25,9 @@
*/
-/*******************************************************************************
-* Header Files *
-*******************************************************************************/
+/*********************************************************************************************************************************
+* Header Files *
+*********************************************************************************************************************************/
#include "internal/iprt.h"
#include <iprt/crypto/taf.h>
diff --git a/src/VBox/Runtime/common/crypto/taf-init.cpp b/src/VBox/Runtime/common/crypto/taf-init.cpp
index 70febec..c7ac08a 100644
--- a/src/VBox/Runtime/common/crypto/taf-init.cpp
+++ b/src/VBox/Runtime/common/crypto/taf-init.cpp
@@ -25,9 +25,9 @@
*/
-/*******************************************************************************
-* Header Files *
-*******************************************************************************/
+/*********************************************************************************************************************************
+* Header Files *
+*********************************************************************************************************************************/
#include "internal/iprt.h"
#include <iprt/crypto/taf.h>
diff --git a/src/VBox/Runtime/common/crypto/taf-sanity.cpp b/src/VBox/Runtime/common/crypto/taf-sanity.cpp
index 5aace79..bb97796 100644
--- a/src/VBox/Runtime/common/crypto/taf-sanity.cpp
+++ b/src/VBox/Runtime/common/crypto/taf-sanity.cpp
@@ -25,9 +25,9 @@
*/
-/*******************************************************************************
-* Header Files *
-*******************************************************************************/
+/*********************************************************************************************************************************
+* Header Files *
+*********************************************************************************************************************************/
#include "internal/iprt.h"
#include <iprt/crypto/taf.h>
diff --git a/src/VBox/Runtime/common/crypto/tsp-asn1-decoder.cpp b/src/VBox/Runtime/common/crypto/tsp-asn1-decoder.cpp
index 78bdb71..eacd1e1 100644
--- a/src/VBox/Runtime/common/crypto/tsp-asn1-decoder.cpp
+++ b/src/VBox/Runtime/common/crypto/tsp-asn1-decoder.cpp
@@ -25,9 +25,9 @@
*/
-/*******************************************************************************
-* Header Files *
-*******************************************************************************/
+/*********************************************************************************************************************************
+* Header Files *
+*********************************************************************************************************************************/
#include "internal/iprt.h"
#include <iprt/crypto/tsp.h>
diff --git a/src/VBox/Runtime/common/crypto/tsp-core.cpp b/src/VBox/Runtime/common/crypto/tsp-core.cpp
index 5571fef..b759c93 100644
--- a/src/VBox/Runtime/common/crypto/tsp-core.cpp
+++ b/src/VBox/Runtime/common/crypto/tsp-core.cpp
@@ -25,9 +25,9 @@
*/
-/*******************************************************************************
-* Header Files *
-*******************************************************************************/
+/*********************************************************************************************************************************
+* Header Files *
+*********************************************************************************************************************************/
#include "internal/iprt.h"
#include <iprt/crypto/tsp.h>
diff --git a/src/VBox/Runtime/common/crypto/tsp-init.cpp b/src/VBox/Runtime/common/crypto/tsp-init.cpp
index 7eb1ac3..eb2b721 100644
--- a/src/VBox/Runtime/common/crypto/tsp-init.cpp
+++ b/src/VBox/Runtime/common/crypto/tsp-init.cpp
@@ -25,9 +25,9 @@
*/
-/*******************************************************************************
-* Header Files *
-*******************************************************************************/
+/*********************************************************************************************************************************
+* Header Files *
+*********************************************************************************************************************************/
#include "internal/iprt.h"
#include <iprt/crypto/tsp.h>
diff --git a/src/VBox/Runtime/common/crypto/tsp-sanity.cpp b/src/VBox/Runtime/common/crypto/tsp-sanity.cpp
index 957a018..61b819a 100644
--- a/src/VBox/Runtime/common/crypto/tsp-sanity.cpp
+++ b/src/VBox/Runtime/common/crypto/tsp-sanity.cpp
@@ -25,9 +25,9 @@
*/
-/*******************************************************************************
-* Header Files *
-*******************************************************************************/
+/*********************************************************************************************************************************
+* Header Files *
+*********************************************************************************************************************************/
#include "internal/iprt.h"
#include <iprt/crypto/tsp.h>
diff --git a/src/VBox/Runtime/common/crypto/x509-asn1-decoder.cpp b/src/VBox/Runtime/common/crypto/x509-asn1-decoder.cpp
index d4353d8..c5bca6e 100644
--- a/src/VBox/Runtime/common/crypto/x509-asn1-decoder.cpp
+++ b/src/VBox/Runtime/common/crypto/x509-asn1-decoder.cpp
@@ -25,9 +25,9 @@
*/
-/*******************************************************************************
-* Header Files *
-*******************************************************************************/
+/*********************************************************************************************************************************
+* Header Files *
+*********************************************************************************************************************************/
#include "internal/iprt.h"
#include <iprt/crypto/x509.h>
diff --git a/src/VBox/Runtime/common/crypto/x509-certpaths.cpp b/src/VBox/Runtime/common/crypto/x509-certpaths.cpp
index 467b034..2c0e0f8 100644
--- a/src/VBox/Runtime/common/crypto/x509-certpaths.cpp
+++ b/src/VBox/Runtime/common/crypto/x509-certpaths.cpp
@@ -25,9 +25,9 @@
*/
-/*******************************************************************************
-* Header Files *
-*******************************************************************************/
+/*********************************************************************************************************************************
+* Header Files *
+*********************************************************************************************************************************/
#include "internal/iprt.h"
#include <iprt/crypto/x509.h>
@@ -44,9 +44,9 @@
#include "x509-internal.h"
-/*******************************************************************************
-* Structures and Typedefs *
-*******************************************************************************/
+/*********************************************************************************************************************************
+* Structures and Typedefs *
+*********************************************************************************************************************************/
/**
* X.509 certificate path node.
*/
@@ -289,9 +289,9 @@ typedef RTCRX509CERTPATHSINT *PRTCRX509CERTPATHSINT;
/** @} */
-/*******************************************************************************
-* Internal Functions *
-*******************************************************************************/
+/*********************************************************************************************************************************
+* Internal Functions *
+*********************************************************************************************************************************/
static void rtCrX509CertPathsDestroyTree(PRTCRX509CERTPATHSINT pThis);
static void rtCrX509CpvCleanup(PRTCRX509CERTPATHSINT pThis);
diff --git a/src/VBox/Runtime/common/crypto/x509-core.cpp b/src/VBox/Runtime/common/crypto/x509-core.cpp
index efd955e..1c0569f 100644
--- a/src/VBox/Runtime/common/crypto/x509-core.cpp
+++ b/src/VBox/Runtime/common/crypto/x509-core.cpp
@@ -25,9 +25,9 @@
*/
-/*******************************************************************************
-* Header Files *
-*******************************************************************************/
+/*********************************************************************************************************************************
+* Header Files *
+*********************************************************************************************************************************/
#include "internal/iprt.h"
#include <iprt/crypto/x509.h>
@@ -1250,7 +1250,8 @@ RTDECL(bool) RTCrX509GeneralSubtree_ConstraintMatch(PCRTCRX509GENERALSUBTREE pCo
static void rtCrx509TbsCertificate_AddKeyUsageFlags(PRTCRX509TBSCERTIFICATE pThis, PCRTCRX509EXTENSION pExtension)
{
AssertReturnVoid(pExtension->enmValue == RTCRX509EXTENSIONVALUE_BIT_STRING);
- AssertReturnVoid(pExtension->ExtnValue.pEncapsulated->cb <= 2);
+ /* 3 = 1 byte for unused bit count, followed by one or two bytes containing actual bits. RFC-5280 defines bits 0 thru 8. */
+ AssertReturnVoid(pExtension->ExtnValue.pEncapsulated->cb <= 3);
pThis->T3.fKeyUsage |= (uint32_t)RTAsn1BitString_GetAsUInt64((PCRTASN1BITSTRING)pExtension->ExtnValue.pEncapsulated);
}
diff --git a/src/VBox/Runtime/common/crypto/x509-file.cpp b/src/VBox/Runtime/common/crypto/x509-file.cpp
index 1824ebb..86938d5 100644
--- a/src/VBox/Runtime/common/crypto/x509-file.cpp
+++ b/src/VBox/Runtime/common/crypto/x509-file.cpp
@@ -25,9 +25,9 @@
*/
-/*******************************************************************************
-* Header Files *
-*******************************************************************************/
+/*********************************************************************************************************************************
+* Header Files *
+*********************************************************************************************************************************/
#include "internal/iprt.h"
#include <iprt/crypto/x509.h>
@@ -37,9 +37,9 @@
#include <iprt/crypto/pem.h>
-/*******************************************************************************
-* Global Variables *
-*******************************************************************************/
+/*********************************************************************************************************************************
+* Global Variables *
+*********************************************************************************************************************************/
static RTCRPEMMARKERWORD const g_aWords_Certificate[] = { { RT_STR_TUPLE("CERTIFICATE") } };
/** X509 Certificate markers. */
static RTCRPEMMARKER const g_aCertificateMarkers[] = { { g_aWords_Certificate, RT_ELEMENTS(g_aWords_Certificate) } };
diff --git a/src/VBox/Runtime/common/crypto/x509-init.cpp b/src/VBox/Runtime/common/crypto/x509-init.cpp
index 5dc3e7a..491092e 100644
--- a/src/VBox/Runtime/common/crypto/x509-init.cpp
+++ b/src/VBox/Runtime/common/crypto/x509-init.cpp
@@ -25,9 +25,9 @@
*/
-/*******************************************************************************
-* Header Files *
-*******************************************************************************/
+/*********************************************************************************************************************************
+* Header Files *
+*********************************************************************************************************************************/
#include "internal/iprt.h"
#include <iprt/crypto/x509.h>
diff --git a/src/VBox/Runtime/common/crypto/x509-sanity.cpp b/src/VBox/Runtime/common/crypto/x509-sanity.cpp
index 4d3583d..4f1b37e 100644
--- a/src/VBox/Runtime/common/crypto/x509-sanity.cpp
+++ b/src/VBox/Runtime/common/crypto/x509-sanity.cpp
@@ -25,9 +25,9 @@
*/
-/*******************************************************************************
-* Header Files *
-*******************************************************************************/
+/*********************************************************************************************************************************
+* Header Files *
+*********************************************************************************************************************************/
#include "internal/iprt.h"
#include <iprt/crypto/x509.h>
diff --git a/src/VBox/Runtime/common/crypto/x509-verify.cpp b/src/VBox/Runtime/common/crypto/x509-verify.cpp
index ed4f4a4..e702e2b 100644
--- a/src/VBox/Runtime/common/crypto/x509-verify.cpp
+++ b/src/VBox/Runtime/common/crypto/x509-verify.cpp
@@ -25,9 +25,9 @@
*/
-/*******************************************************************************
-* Header Files *
-*******************************************************************************/
+/*********************************************************************************************************************************
+* Header Files *
+*********************************************************************************************************************************/
#include "internal/iprt.h"
#include <iprt/crypto/x509.h>
#include <iprt/crypto/pkix.h>
diff --git a/src/VBox/Runtime/common/dbg/dbg.cpp b/src/VBox/Runtime/common/dbg/dbg.cpp
index 4d7d9ee..6cdaf69 100644
--- a/src/VBox/Runtime/common/dbg/dbg.cpp
+++ b/src/VBox/Runtime/common/dbg/dbg.cpp
@@ -24,9 +24,10 @@
* terms and conditions of either the GPL or the CDDL or both.
*/
-/*******************************************************************************
-* Header Files *
-*******************************************************************************/
+
+/*********************************************************************************************************************************
+* Header Files *
+*********************************************************************************************************************************/
#include <iprt/dbg.h>
#include "internal/iprt.h"
diff --git a/src/VBox/Runtime/common/dbg/dbgas.cpp b/src/VBox/Runtime/common/dbg/dbgas.cpp
index bcb5336..78d3af1 100644
--- a/src/VBox/Runtime/common/dbg/dbgas.cpp
+++ b/src/VBox/Runtime/common/dbg/dbgas.cpp
@@ -25,9 +25,9 @@
*/
-/*******************************************************************************
-* Header Files *
-*******************************************************************************/
+/*********************************************************************************************************************************
+* Header Files *
+*********************************************************************************************************************************/
#include <iprt/dbg.h>
#include "internal/iprt.h"
@@ -42,9 +42,9 @@
#include "internal/magics.h"
-/*******************************************************************************
-* Structures and Typedefs *
-*******************************************************************************/
+/*********************************************************************************************************************************
+* Structures and Typedefs *
+*********************************************************************************************************************************/
/** Pointer to a module table entry. */
typedef struct RTDBGASMOD *PRTDBGASMOD;
/** Pointer to an address space mapping node. */
@@ -127,9 +127,9 @@ typedef struct RTDBGASINT
typedef RTDBGASINT *PRTDBGASINT;
-/*******************************************************************************
-* Defined Constants And Macros *
-*******************************************************************************/
+/*********************************************************************************************************************************
+* Defined Constants And Macros *
+*********************************************************************************************************************************/
/** Validates an address space handle and returns rc if not valid. */
#define RTDBGAS_VALID_RETURN_RC(pDbgAs, rc) \
do { \
@@ -167,9 +167,9 @@ typedef RTDBGASINT *PRTDBGASINT;
} while (0)
-/*******************************************************************************
-* Internal Functions *
-*******************************************************************************/
+/*********************************************************************************************************************************
+* Internal Functions *
+*********************************************************************************************************************************/
static void rtDbgAsModuleUnlinkMod(PRTDBGASINT pDbgAs, PRTDBGASMOD pMod);
static void rtDbgAsModuleUnlinkByMap(PRTDBGASINT pDbgAs, PRTDBGASMAP pMap);
diff --git a/src/VBox/Runtime/common/dbg/dbgcfg.cpp b/src/VBox/Runtime/common/dbg/dbgcfg.cpp
index ba940ee..b3211a1 100644
--- a/src/VBox/Runtime/common/dbg/dbgcfg.cpp
+++ b/src/VBox/Runtime/common/dbg/dbgcfg.cpp
@@ -25,9 +25,9 @@
*/
-/*******************************************************************************
-* Header Files *
-*******************************************************************************/
+/*********************************************************************************************************************************
+* Header Files *
+*********************************************************************************************************************************/
#define LOG_GROUP RTLOGGROUP_DBG
#include <iprt/dbg.h>
#include "internal/iprt.h"
@@ -55,9 +55,9 @@
#include "internal/magics.h"
-/*******************************************************************************
-* Structures and Typedefs *
-*******************************************************************************/
+/*********************************************************************************************************************************
+* Structures and Typedefs *
+*********************************************************************************************************************************/
/**
* String list entry.
*/
@@ -151,9 +151,9 @@ typedef RTDBGCFGU64MNEMONIC const *PCRTDBGCFGU64MNEMONIC;
/** @} */
-/*******************************************************************************
-* Defined Constants And Macros *
-*******************************************************************************/
+/*********************************************************************************************************************************
+* Defined Constants And Macros *
+*********************************************************************************************************************************/
/** Validates a debug module handle and returns rc if not valid. */
#define RTDBGCFG_VALID_RETURN_RC(pThis, rc) \
do { \
@@ -163,9 +163,9 @@ typedef RTDBGCFGU64MNEMONIC const *PCRTDBGCFGU64MNEMONIC;
} while (0)
-/*******************************************************************************
-* Global Variables *
-*******************************************************************************/
+/*********************************************************************************************************************************
+* Global Variables *
+*********************************************************************************************************************************/
/** Mnemonics map for RTDBGCFGPROP_FLAGS. */
static const RTDBGCFGU64MNEMONIC g_aDbgCfgFlags[] =
{
diff --git a/src/VBox/Runtime/common/dbg/dbgmod.cpp b/src/VBox/Runtime/common/dbg/dbgmod.cpp
index 85f9b80..2705ee5 100644
--- a/src/VBox/Runtime/common/dbg/dbgmod.cpp
+++ b/src/VBox/Runtime/common/dbg/dbgmod.cpp
@@ -25,9 +25,9 @@
*/
-/*******************************************************************************
-* Header Files *
-*******************************************************************************/
+/*********************************************************************************************************************************
+* Header Files *
+*********************************************************************************************************************************/
#define LOG_GROUP RTLOGGROUP_DBG
#include <iprt/dbg.h>
#include "internal/iprt.h"
@@ -51,9 +51,9 @@
#include "internal/magics.h"
-/*******************************************************************************
-* Structures and Typedefs *
-*******************************************************************************/
+/*********************************************************************************************************************************
+* Structures and Typedefs *
+*********************************************************************************************************************************/
/** Debug info interpreter registration record. */
typedef struct RTDBGMODREGDBG
{
@@ -79,9 +79,9 @@ typedef struct RTDBGMODREGIMG
typedef RTDBGMODREGIMG *PRTDBGMODREGIMG;
-/*******************************************************************************
-* Defined Constants And Macros *
-*******************************************************************************/
+/*********************************************************************************************************************************
+* Defined Constants And Macros *
+*********************************************************************************************************************************/
/** Validates a debug module handle and returns rc if not valid. */
#define RTDBGMOD_VALID_RETURN_RC(pDbgMod, rc) \
do { \
@@ -105,9 +105,9 @@ typedef RTDBGMODREGIMG *PRTDBGMODREGIMG;
} while (0)
-/*******************************************************************************
-* Global Variables *
-*******************************************************************************/
+/*********************************************************************************************************************************
+* Global Variables *
+*********************************************************************************************************************************/
/** Init once object for lazy registration of the built-in image and debug
* info interpreters. */
static RTONCE g_rtDbgModOnce = RTONCE_INITIALIZER;
diff --git a/src/VBox/Runtime/common/dbg/dbgmodcodeview.cpp b/src/VBox/Runtime/common/dbg/dbgmodcodeview.cpp
index 6751ac3..334e77e 100644
--- a/src/VBox/Runtime/common/dbg/dbgmodcodeview.cpp
+++ b/src/VBox/Runtime/common/dbg/dbgmodcodeview.cpp
@@ -40,9 +40,9 @@
*/
-/*******************************************************************************
-* Header Files *
-*******************************************************************************/
+/*********************************************************************************************************************************
+* Header Files *
+*********************************************************************************************************************************/
#define LOG_GROUP RTLOGGROUP_DBG
#include <iprt/dbg.h>
#include "internal/iprt.h"
@@ -63,9 +63,9 @@
#include "internal/magics.h"
-/*******************************************************************************
-* Structures and Typedefs *
-*******************************************************************************/
+/*********************************************************************************************************************************
+* Structures and Typedefs *
+*********************************************************************************************************************************/
/**
* CodeView Header. There are two of this, base header at the start of the debug
* information and a trailing header at the end.
@@ -576,9 +576,9 @@ typedef FNDBGMODCVSUBSECTCALLBACK *PFNDBGMODCVSUBSECTCALLBACK;
-/*******************************************************************************
-* Defined Constants And Macros *
-*******************************************************************************/
+/*********************************************************************************************************************************
+* Defined Constants And Macros *
+*********************************************************************************************************************************/
/** Light weight assert + return w/ fixed status code. */
#define RTDBGMODCV_CHECK_RET_BF(a_Expr, a_LogArgs) \
do { \
diff --git a/src/VBox/Runtime/common/dbg/dbgmodcontainer.cpp b/src/VBox/Runtime/common/dbg/dbgmodcontainer.cpp
index 6753ecb..7f18094 100644
--- a/src/VBox/Runtime/common/dbg/dbgmodcontainer.cpp
+++ b/src/VBox/Runtime/common/dbg/dbgmodcontainer.cpp
@@ -25,9 +25,9 @@
*/
-/*******************************************************************************
-* Header Files *
-*******************************************************************************/
+/*********************************************************************************************************************************
+* Header Files *
+*********************************************************************************************************************************/
#include <iprt/dbg.h>
#include "internal/iprt.h"
@@ -43,9 +43,9 @@
#include "internal/dbgmod.h"
-/*******************************************************************************
-* Structures and Typedefs *
-*******************************************************************************/
+/*********************************************************************************************************************************
+* Structures and Typedefs *
+*********************************************************************************************************************************/
/**
* Symbol entry.
*/
diff --git a/src/VBox/Runtime/common/dbg/dbgmoddbghelp.cpp b/src/VBox/Runtime/common/dbg/dbgmoddbghelp.cpp
index 3a34406..ef00638 100644
--- a/src/VBox/Runtime/common/dbg/dbgmoddbghelp.cpp
+++ b/src/VBox/Runtime/common/dbg/dbgmoddbghelp.cpp
@@ -25,9 +25,9 @@
*/
-/*******************************************************************************
-* Header Files *
-*******************************************************************************/
+/*********************************************************************************************************************************
+* Header Files *
+*********************************************************************************************************************************/
#define LOG_GROUP RTLOGGROUP_DBG
#include <iprt/dbg.h>
#include "internal/iprt.h"
@@ -47,9 +47,9 @@
#include <iprt/win/lazy-dbghelp.h>
-/*******************************************************************************
-* Structures and Typedefs *
-*******************************************************************************/
+/*********************************************************************************************************************************
+* Structures and Typedefs *
+*********************************************************************************************************************************/
/** For passing arguments to DbgHelp.dll callback. */
typedef struct RTDBGMODBGHELPARGS
{
diff --git a/src/VBox/Runtime/common/dbg/dbgmoddeferred.cpp b/src/VBox/Runtime/common/dbg/dbgmoddeferred.cpp
index b5d50b9..d396739 100644
--- a/src/VBox/Runtime/common/dbg/dbgmoddeferred.cpp
+++ b/src/VBox/Runtime/common/dbg/dbgmoddeferred.cpp
@@ -25,9 +25,9 @@
*/
-/*******************************************************************************
-* Header Files *
-*******************************************************************************/
+/*********************************************************************************************************************************
+* Header Files *
+*********************************************************************************************************************************/
#include <iprt/dbg.h>
#include "internal/iprt.h"
diff --git a/src/VBox/Runtime/common/dbg/dbgmoddwarf.cpp b/src/VBox/Runtime/common/dbg/dbgmoddwarf.cpp
index 1685f61..9d7070f 100644
--- a/src/VBox/Runtime/common/dbg/dbgmoddwarf.cpp
+++ b/src/VBox/Runtime/common/dbg/dbgmoddwarf.cpp
@@ -25,9 +25,9 @@
*/
-/*******************************************************************************
-* Header Files *
-*******************************************************************************/
+/*********************************************************************************************************************************
+* Header Files *
+*********************************************************************************************************************************/
#define LOG_GROUP RTLOGGROUP_DBG_DWARF
#include <iprt/dbg.h>
#include "internal/iprt.h"
@@ -48,9 +48,9 @@
#include "internal/dbgmod.h"
-/*******************************************************************************
-* Defined Constants And Macros *
-*******************************************************************************/
+/*********************************************************************************************************************************
+* Defined Constants And Macros *
+*********************************************************************************************************************************/
/** @name Standard DWARF Line Number Opcodes
* @{ */
#define DW_LNS_extended UINT8_C(0x00)
@@ -350,9 +350,9 @@
/** @} */
-/*******************************************************************************
-* Structures and Typedefs *
-*******************************************************************************/
+/*********************************************************************************************************************************
+* Structures and Typedefs *
+*********************************************************************************************************************************/
/** Pointer to a DWARF section reader. */
typedef struct RTDWARFCURSOR *PRTDWARFCURSOR;
/** Pointer to an attribute descriptor. */
@@ -748,9 +748,9 @@ typedef RTDWARFLOCST *PRTDWARFLOCST;
-/*******************************************************************************
-* Internal Functions *
-*******************************************************************************/
+/*********************************************************************************************************************************
+* Internal Functions *
+*********************************************************************************************************************************/
static FNRTDWARFATTRDECODER rtDwarfDecode_Address;
static FNRTDWARFATTRDECODER rtDwarfDecode_Bool;
static FNRTDWARFATTRDECODER rtDwarfDecode_LowHighPc;
@@ -762,9 +762,9 @@ static FNRTDWARFATTRDECODER rtDwarfDecode_UnsignedInt;
static FNRTDWARFATTRDECODER rtDwarfDecode_SegmentLoc;
-/*******************************************************************************
-* Global Variables *
-*******************************************************************************/
+/*********************************************************************************************************************************
+* Global Variables *
+*********************************************************************************************************************************/
/** RTDWARFDIE description. */
static const RTDWARFDIEDESC g_CoreDieDesc = { sizeof(RTDWARFDIE), 0, NULL };
@@ -1020,9 +1020,9 @@ static const struct RTDWARFTAGDESC
};
-/*******************************************************************************
-* Internal Functions *
-*******************************************************************************/
+/*********************************************************************************************************************************
+* Internal Functions *
+*********************************************************************************************************************************/
static int rtDwarfInfo_ParseDie(PRTDBGMODDWARF pThis, PRTDWARFDIE pDie, PCRTDWARFDIEDESC pDieDesc,
PRTDWARFCURSOR pCursor, PCRTDWARFABBREV pAbbrev, bool fInitDie);
diff --git a/src/VBox/Runtime/common/dbg/dbgmodexports.cpp b/src/VBox/Runtime/common/dbg/dbgmodexports.cpp
index 81288e5..d5c99de 100644
--- a/src/VBox/Runtime/common/dbg/dbgmodexports.cpp
+++ b/src/VBox/Runtime/common/dbg/dbgmodexports.cpp
@@ -25,9 +25,9 @@
*/
-/*******************************************************************************
-* Header Files *
-*******************************************************************************/
+/*********************************************************************************************************************************
+* Header Files *
+*********************************************************************************************************************************/
#define LOG_GROUP RTLOGGROUP_DBG
#include <iprt/dbg.h>
#include "internal/iprt.h"
@@ -40,9 +40,9 @@
#include "internal/dbgmod.h"
-/*******************************************************************************
-* Structures and Typedefs *
-*******************************************************************************/
+/*********************************************************************************************************************************
+* Structures and Typedefs *
+*********************************************************************************************************************************/
typedef struct RTDBGMODEXPORTARGS
{
PRTDBGMODINT pDbgMod;
diff --git a/src/VBox/Runtime/common/dbg/dbgmodldr.cpp b/src/VBox/Runtime/common/dbg/dbgmodldr.cpp
index 8df4638..26dd540 100644
--- a/src/VBox/Runtime/common/dbg/dbgmodldr.cpp
+++ b/src/VBox/Runtime/common/dbg/dbgmodldr.cpp
@@ -25,9 +25,9 @@
*/
-/*******************************************************************************
-* Header Files *
-*******************************************************************************/
+/*********************************************************************************************************************************
+* Header Files *
+*********************************************************************************************************************************/
#include <iprt/dbg.h>
#include "internal/iprt.h"
@@ -44,9 +44,9 @@
#include "internal/magics.h"
-/*******************************************************************************
-* Structures and Typedefs *
-*******************************************************************************/
+/*********************************************************************************************************************************
+* Structures and Typedefs *
+*********************************************************************************************************************************/
/**
* The instance data of the RTLdr based image reader.
*/
diff --git a/src/VBox/Runtime/common/dbg/dbgmodnm.cpp b/src/VBox/Runtime/common/dbg/dbgmodnm.cpp
index 070de30..61015b0 100644
--- a/src/VBox/Runtime/common/dbg/dbgmodnm.cpp
+++ b/src/VBox/Runtime/common/dbg/dbgmodnm.cpp
@@ -25,9 +25,9 @@
*/
-/*******************************************************************************
-* Header Files *
-*******************************************************************************/
+/*********************************************************************************************************************************
+* Header Files *
+*********************************************************************************************************************************/
#include <iprt/dbg.h>
#include "internal/iprt.h"
@@ -39,9 +39,9 @@
#include "internal/dbgmod.h"
-/*******************************************************************************
-* Structures and Typedefs *
-*******************************************************************************/
+/*********************************************************************************************************************************
+* Structures and Typedefs *
+*********************************************************************************************************************************/
/**
* Instance data.
*/
diff --git a/src/VBox/Runtime/common/dvm/dvm.cpp b/src/VBox/Runtime/common/dvm/dvm.cpp
index 4dcba96..2d21d3d 100644
--- a/src/VBox/Runtime/common/dvm/dvm.cpp
+++ b/src/VBox/Runtime/common/dvm/dvm.cpp
@@ -25,9 +25,9 @@
*/
-/*******************************************************************************
-* Header Files *
-*******************************************************************************/
+/*********************************************************************************************************************************
+* Header Files *
+*********************************************************************************************************************************/
#include <iprt/types.h>
#include <iprt/assert.h>
#include <iprt/mem.h>
@@ -38,9 +38,10 @@
#include <iprt/list.h>
#include "internal/dvm.h"
-/*******************************************************************************
-* Structures and Typedefs *
-*******************************************************************************/
+
+/*********************************************************************************************************************************
+* Structures and Typedefs *
+*********************************************************************************************************************************/
/**
* The internal volume manager structure.
@@ -88,9 +89,10 @@ typedef struct RTDVMVOLUMEINTERNAL
/** Pointer to an internal volume. */
typedef RTDVMVOLUMEINTERNAL *PRTDVMVOLUMEINTERNAL;
-/*******************************************************************************
-* Global variables *
-*******************************************************************************/
+
+/*********************************************************************************************************************************
+* Global variables *
+*********************************************************************************************************************************/
extern RTDVMFMTOPS g_rtDvmFmtMbr;
extern RTDVMFMTOPS g_rtDvmFmtGpt;
extern RTDVMFMTOPS g_rtDvmFmtBsdLbl;
diff --git a/src/VBox/Runtime/common/dvm/dvmbsdlabel.cpp b/src/VBox/Runtime/common/dvm/dvmbsdlabel.cpp
index 3b15bb4..d0e9769 100644
--- a/src/VBox/Runtime/common/dvm/dvmbsdlabel.cpp
+++ b/src/VBox/Runtime/common/dvm/dvmbsdlabel.cpp
@@ -32,9 +32,10 @@
#include <iprt/asm.h>
#include "internal/dvm.h"
-/*******************************************************************************
-* Structures and Typedefs *
-*******************************************************************************/
+
+/*********************************************************************************************************************************
+* Structures and Typedefs *
+*********************************************************************************************************************************/
/*
* Below are the on disk structures of a bsd disklabel as found in
@@ -273,7 +274,7 @@ static bool rtDvmFmtBsdLblDiskLabelDecode(PBsdLabel pBsdLabel)
return true;
}
-DECLCALLBACK(int) rtDvmFmtBsdLblProbe(PCRTDVMDISK pDisk, uint32_t *puScore)
+static DECLCALLBACK(int) rtDvmFmtBsdLblProbe(PCRTDVMDISK pDisk, uint32_t *puScore)
{
BsdLabel DiskLabel;
int rc = VINF_SUCCESS;
@@ -291,7 +292,7 @@ DECLCALLBACK(int) rtDvmFmtBsdLblProbe(PCRTDVMDISK pDisk, uint32_t *puScore)
return rc;
}
-DECLCALLBACK(int) rtDvmFmtBsdLblOpen(PCRTDVMDISK pDisk, PRTDVMFMT phVolMgrFmt)
+static DECLCALLBACK(int) rtDvmFmtBsdLblOpen(PCRTDVMDISK pDisk, PRTDVMFMT phVolMgrFmt)
{
int rc = VINF_SUCCESS;
PRTDVMFMTINTERNAL pThis = NULL;
@@ -326,13 +327,13 @@ DECLCALLBACK(int) rtDvmFmtBsdLblOpen(PCRTDVMDISK pDisk, PRTDVMFMT phVolMgrFmt)
return rc;
}
-DECLCALLBACK(int) rtDvmFmtBsdLblInitialize(PCRTDVMDISK pDisk, PRTDVMFMT phVolMgrFmt)
+static DECLCALLBACK(int) rtDvmFmtBsdLblInitialize(PCRTDVMDISK pDisk, PRTDVMFMT phVolMgrFmt)
{
NOREF(pDisk); NOREF(phVolMgrFmt);
return VERR_NOT_IMPLEMENTED;
}
-DECLCALLBACK(void) rtDvmFmtBsdLblClose(RTDVMFMT hVolMgrFmt)
+static DECLCALLBACK(void) rtDvmFmtBsdLblClose(RTDVMFMT hVolMgrFmt)
{
PRTDVMFMTINTERNAL pThis = hVolMgrFmt;
@@ -358,13 +359,13 @@ static DECLCALLBACK(int) rtDvmFmtBsdLblQueryRangeUse(RTDVMFMT hVolMgrFmt,
return VINF_SUCCESS;
}
-DECLCALLBACK(uint32_t) rtDvmFmtBsdLblGetValidVolumes(RTDVMFMT hVolMgrFmt)
+static DECLCALLBACK(uint32_t) rtDvmFmtBsdLblGetValidVolumes(RTDVMFMT hVolMgrFmt)
{
PRTDVMFMTINTERNAL pThis = hVolMgrFmt;
return pThis->cPartitions;
}
-DECLCALLBACK(uint32_t) rtDvmFmtBsdLblGetMaxVolumes(RTDVMFMT hVolMgrFmt)
+static DECLCALLBACK(uint32_t) rtDvmFmtBsdLblGetMaxVolumes(RTDVMFMT hVolMgrFmt)
{
PRTDVMFMTINTERNAL pThis = hVolMgrFmt;
return pThis->DiskLabel.cPartitions;
@@ -401,7 +402,7 @@ static int rtDvmFmtBsdLblVolumeCreate(PRTDVMFMTINTERNAL pThis, PBsdLabelPartitio
return rc;
}
-DECLCALLBACK(int) rtDvmFmtBsdLblQueryFirstVolume(RTDVMFMT hVolMgrFmt, PRTDVMVOLUMEFMT phVolFmt)
+static DECLCALLBACK(int) rtDvmFmtBsdLblQueryFirstVolume(RTDVMFMT hVolMgrFmt, PRTDVMVOLUMEFMT phVolFmt)
{
int rc = VINF_SUCCESS;
PRTDVMFMTINTERNAL pThis = hVolMgrFmt;
@@ -425,7 +426,7 @@ DECLCALLBACK(int) rtDvmFmtBsdLblQueryFirstVolume(RTDVMFMT hVolMgrFmt, PRTDVMVOLU
return rc;
}
-DECLCALLBACK(int) rtDvmFmtBsdLblQueryNextVolume(RTDVMFMT hVolMgrFmt, RTDVMVOLUMEFMT hVolFmt, PRTDVMVOLUMEFMT phVolFmtNext)
+static DECLCALLBACK(int) rtDvmFmtBsdLblQueryNextVolume(RTDVMFMT hVolMgrFmt, RTDVMVOLUMEFMT hVolFmt, PRTDVMVOLUMEFMT phVolFmtNext)
{
int rc = VERR_DVM_MAP_NO_VOLUME;
PRTDVMFMTINTERNAL pThis = hVolMgrFmt;
@@ -445,7 +446,7 @@ DECLCALLBACK(int) rtDvmFmtBsdLblQueryNextVolume(RTDVMFMT hVolMgrFmt, RTDVMVOLUME
return rc;
}
-DECLCALLBACK(void) rtDvmFmtBsdLblVolumeClose(RTDVMVOLUMEFMT hVolFmt)
+static DECLCALLBACK(void) rtDvmFmtBsdLblVolumeClose(RTDVMVOLUMEFMT hVolFmt)
{
PRTDVMVOLUMEFMTINTERNAL pVol = hVolFmt;
@@ -457,35 +458,35 @@ DECLCALLBACK(void) rtDvmFmtBsdLblVolumeClose(RTDVMVOLUMEFMT hVolFmt)
RTMemFree(pVol);
}
-DECLCALLBACK(uint64_t) rtDvmFmtBsdLblVolumeGetSize(RTDVMVOLUMEFMT hVolFmt)
+static DECLCALLBACK(uint64_t) rtDvmFmtBsdLblVolumeGetSize(RTDVMVOLUMEFMT hVolFmt)
{
PRTDVMVOLUMEFMTINTERNAL pVol = hVolFmt;
return pVol->cbVolume;
}
-DECLCALLBACK(int) rtDvmFmtBsdLblVolumeQueryName(RTDVMVOLUMEFMT hVolFmt, char **ppszVolName)
+static DECLCALLBACK(int) rtDvmFmtBsdLblVolumeQueryName(RTDVMVOLUMEFMT hVolFmt, char **ppszVolName)
{
NOREF(hVolFmt); NOREF(ppszVolName);
return VERR_NOT_SUPPORTED;
}
-DECLCALLBACK(RTDVMVOLTYPE) rtDvmFmtBsdLblVolumeGetType(RTDVMVOLUMEFMT hVolFmt)
+static DECLCALLBACK(RTDVMVOLTYPE) rtDvmFmtBsdLblVolumeGetType(RTDVMVOLUMEFMT hVolFmt)
{
NOREF(hVolFmt);
return RTDVMVOLTYPE_UNKNOWN;
}
-DECLCALLBACK(uint64_t) rtDvmFmtBsdLblVolumeGetFlags(RTDVMVOLUMEFMT hVolFmt)
+static DECLCALLBACK(uint64_t) rtDvmFmtBsdLblVolumeGetFlags(RTDVMVOLUMEFMT hVolFmt)
{
NOREF(hVolFmt);
return 0;
}
-DECLCALLBACK(bool) rtDvmFmtBsdLblVolumeIsRangeIntersecting(RTDVMVOLUMEFMT hVolFmt,
- uint64_t offStart, size_t cbRange,
- uint64_t *poffVol,
- uint64_t *pcbIntersect)
+static DECLCALLBACK(bool) rtDvmFmtBsdLblVolumeIsRangeIntersecting(RTDVMVOLUMEFMT hVolFmt,
+ uint64_t offStart, size_t cbRange,
+ uint64_t *poffVol,
+ uint64_t *pcbIntersect)
{
bool fIntersect = false;
PRTDVMVOLUMEFMTINTERNAL pVol = hVolFmt;
@@ -500,7 +501,7 @@ DECLCALLBACK(bool) rtDvmFmtBsdLblVolumeIsRangeIntersecting(RTDVMVOLUMEFMT hVolFm
return fIntersect;
}
-DECLCALLBACK(int) rtDvmFmtBsdLblVolumeRead(RTDVMVOLUMEFMT hVolFmt, uint64_t off, void *pvBuf, size_t cbRead)
+static DECLCALLBACK(int) rtDvmFmtBsdLblVolumeRead(RTDVMVOLUMEFMT hVolFmt, uint64_t off, void *pvBuf, size_t cbRead)
{
PRTDVMVOLUMEFMTINTERNAL pVol = hVolFmt;
AssertReturn(off + cbRead <= pVol->cbVolume, VERR_INVALID_PARAMETER);
@@ -508,7 +509,7 @@ DECLCALLBACK(int) rtDvmFmtBsdLblVolumeRead(RTDVMVOLUMEFMT hVolFmt, uint64_t off,
return rtDvmDiskRead(pVol->pVolMgr->pDisk, pVol->offStart + off, pvBuf, cbRead);
}
-DECLCALLBACK(int) rtDvmFmtBsdLblVolumeWrite(RTDVMVOLUMEFMT hVolFmt, uint64_t off, const void *pvBuf, size_t cbWrite)
+static DECLCALLBACK(int) rtDvmFmtBsdLblVolumeWrite(RTDVMVOLUMEFMT hVolFmt, uint64_t off, const void *pvBuf, size_t cbWrite)
{
PRTDVMVOLUMEFMTINTERNAL pVol = hVolFmt;
AssertReturn(off + cbWrite <= pVol->cbVolume, VERR_INVALID_PARAMETER);
diff --git a/src/VBox/Runtime/common/dvm/dvmgpt.cpp b/src/VBox/Runtime/common/dvm/dvmgpt.cpp
index 733d4c5..e00f6a1 100644
--- a/src/VBox/Runtime/common/dvm/dvmgpt.cpp
+++ b/src/VBox/Runtime/common/dvm/dvmgpt.cpp
@@ -25,9 +25,9 @@
*/
-/*******************************************************************************
-* Header Files *
-*******************************************************************************/
+/*********************************************************************************************************************************
+* Header Files *
+*********************************************************************************************************************************/
#include <iprt/types.h>
#include <iprt/assert.h>
#include <iprt/mem.h>
@@ -38,9 +38,9 @@
#include "internal/dvm.h"
-/*******************************************************************************
-* Structures and Typedefs *
-*******************************************************************************/
+/*********************************************************************************************************************************
+* Structures and Typedefs *
+*********************************************************************************************************************************/
/** The GPT signature. */
#define RTDVM_GPT_SIGNATURE "EFI PART"
@@ -187,9 +187,9 @@ typedef RTDVMGPTPARTTYPE2VOLTYPE *PRTDVMGPTPARTTYPE2VOLTYPE;
#define RTDVM_GPT_BYTE2LBA(lba, disk) ((lba) / (disk)->cbSector)
-/*******************************************************************************
-* Global Variables *
-*******************************************************************************/
+/*********************************************************************************************************************************
+* Global Variables *
+*********************************************************************************************************************************/
/**
* Mapping of partition types to DVM volume types.
*
@@ -500,10 +500,10 @@ static DECLCALLBACK(uint64_t) rtDvmFmtGptVolumeGetFlags(RTDVMVOLUMEFMT hVolFmt)
return 0;
}
-DECLCALLBACK(bool) rtDvmFmtGptVolumeIsRangeIntersecting(RTDVMVOLUMEFMT hVolFmt,
- uint64_t offStart, size_t cbRange,
- uint64_t *poffVol,
- uint64_t *pcbIntersect)
+static DECLCALLBACK(bool) rtDvmFmtGptVolumeIsRangeIntersecting(RTDVMVOLUMEFMT hVolFmt,
+ uint64_t offStart, size_t cbRange,
+ uint64_t *poffVol,
+ uint64_t *pcbIntersect)
{
bool fIntersect = false;
PRTDVMVOLUMEFMTINTERNAL pVol = hVolFmt;
diff --git a/src/VBox/Runtime/common/dvm/dvmmbr.cpp b/src/VBox/Runtime/common/dvm/dvmmbr.cpp
index f74e8ff..dd585ff 100644
--- a/src/VBox/Runtime/common/dvm/dvmmbr.cpp
+++ b/src/VBox/Runtime/common/dvm/dvmmbr.cpp
@@ -25,9 +25,9 @@
*/
-/*******************************************************************************
-* Header Files *
-*******************************************************************************/
+/*********************************************************************************************************************************
+* Header Files *
+*********************************************************************************************************************************/
#include <iprt/types.h>
#include <iprt/assert.h>
#include <iprt/mem.h>
@@ -36,9 +36,9 @@
#include "internal/dvm.h"
-/*******************************************************************************
-* Structures and Typedefs *
-*******************************************************************************/
+/*********************************************************************************************************************************
+* Structures and Typedefs *
+*********************************************************************************************************************************/
/**
* MBR volume manager data.
@@ -89,9 +89,9 @@ typedef struct RTDVMMBRFS2VOLTYPE
typedef RTDVMMBRFS2VOLTYPE *PRTDVMMBRFS2VOLTYPE;
-/*******************************************************************************
-* Global Variables *
-*******************************************************************************/
+/*********************************************************************************************************************************
+* Global Variables *
+*********************************************************************************************************************************/
/**
* Mapping of FS types to DVM volume types.
*
@@ -369,10 +369,10 @@ static DECLCALLBACK(uint64_t) rtDvmFmtMbrVolumeGetFlags(RTDVMVOLUMEFMT hVolFmt)
return fFlags;
}
-DECLCALLBACK(bool) rtDvmFmtMbrVolumeIsRangeIntersecting(RTDVMVOLUMEFMT hVolFmt,
- uint64_t offStart, size_t cbRange,
- uint64_t *poffVol,
- uint64_t *pcbIntersect)
+static DECLCALLBACK(bool) rtDvmFmtMbrVolumeIsRangeIntersecting(RTDVMVOLUMEFMT hVolFmt,
+ uint64_t offStart, size_t cbRange,
+ uint64_t *poffVol,
+ uint64_t *pcbIntersect)
{
bool fIntersect = false;
PRTDVMVOLUMEFMTINTERNAL pVol = hVolFmt;
diff --git a/src/VBox/Runtime/common/dvm/dvmvfs.cpp b/src/VBox/Runtime/common/dvm/dvmvfs.cpp
index 421f73a..897f7ac 100644
--- a/src/VBox/Runtime/common/dvm/dvmvfs.cpp
+++ b/src/VBox/Runtime/common/dvm/dvmvfs.cpp
@@ -25,9 +25,9 @@
*/
-/*******************************************************************************
-* Header Files *
-*******************************************************************************/
+/*********************************************************************************************************************************
+* Header Files *
+*********************************************************************************************************************************/
#include <iprt/types.h>
#include <iprt/assert.h>
#include <iprt/mem.h>
@@ -41,9 +41,10 @@
#include <iprt/poll.h>
#include "internal/dvm.h"
-/*******************************************************************************
-* Structures and Typedefs *
-*******************************************************************************/
+
+/*********************************************************************************************************************************
+* Structures and Typedefs *
+*********************************************************************************************************************************/
/**
* The internal data of a DVM volume I/O stream.
diff --git a/src/VBox/Runtime/common/err/RTErrConvertFromErrno.cpp b/src/VBox/Runtime/common/err/RTErrConvertFromErrno.cpp
index 80c3b6d..fb07816 100644
--- a/src/VBox/Runtime/common/err/RTErrConvertFromErrno.cpp
+++ b/src/VBox/Runtime/common/err/RTErrConvertFromErrno.cpp
@@ -25,9 +25,9 @@
*/
-/*******************************************************************************
-* Header Files *
-*******************************************************************************/
+/*********************************************************************************************************************************
+* Header Files *
+*********************************************************************************************************************************/
#include <iprt/err.h>
#include "internal/iprt.h"
diff --git a/src/VBox/Runtime/common/err/RTErrConvertToErrno.cpp b/src/VBox/Runtime/common/err/RTErrConvertToErrno.cpp
index 85a4ddd..a9d1430 100644
--- a/src/VBox/Runtime/common/err/RTErrConvertToErrno.cpp
+++ b/src/VBox/Runtime/common/err/RTErrConvertToErrno.cpp
@@ -25,9 +25,9 @@
*/
-/*******************************************************************************
-* Header Files *
-*******************************************************************************/
+/*********************************************************************************************************************************
+* Header Files *
+*********************************************************************************************************************************/
#include <iprt/err.h>
#include "internal/iprt.h"
diff --git a/src/VBox/Runtime/common/err/errinfo-alloc.cpp b/src/VBox/Runtime/common/err/errinfo-alloc.cpp
index 654f4c0..c3518bb 100644
--- a/src/VBox/Runtime/common/err/errinfo-alloc.cpp
+++ b/src/VBox/Runtime/common/err/errinfo-alloc.cpp
@@ -25,9 +25,9 @@
*/
-/*******************************************************************************
-* Header Files *
-*******************************************************************************/
+/*********************************************************************************************************************************
+* Header Files *
+*********************************************************************************************************************************/
#include "internal/iprt.h"
#include <iprt/err.h>
diff --git a/src/VBox/Runtime/common/err/errinfo.cpp b/src/VBox/Runtime/common/err/errinfo.cpp
index d5e09dd..7400ce0 100644
--- a/src/VBox/Runtime/common/err/errinfo.cpp
+++ b/src/VBox/Runtime/common/err/errinfo.cpp
@@ -25,9 +25,9 @@
*/
-/*******************************************************************************
-* Header Files *
-*******************************************************************************/
+/*********************************************************************************************************************************
+* Header Files *
+*********************************************************************************************************************************/
#include "internal/iprt.h"
#include <iprt/err.h>
diff --git a/src/VBox/Runtime/common/err/errmsg.cpp b/src/VBox/Runtime/common/err/errmsg.cpp
index ec95523..d7288c7 100644
--- a/src/VBox/Runtime/common/err/errmsg.cpp
+++ b/src/VBox/Runtime/common/err/errmsg.cpp
@@ -25,9 +25,9 @@
*/
-/*******************************************************************************
-* Header Files *
-*******************************************************************************/
+/*********************************************************************************************************************************
+* Header Files *
+*********************************************************************************************************************************/
#include <iprt/err.h>
#include "internal/iprt.h"
@@ -37,9 +37,9 @@
#include <VBox/err.h>
-/*******************************************************************************
-* Global Variables *
-*******************************************************************************/
+/*********************************************************************************************************************************
+* Global Variables *
+*********************************************************************************************************************************/
/** Array of messages.
* The data is generated by a sed script.
*/
diff --git a/src/VBox/Runtime/common/err/errmsgxpcom.cpp b/src/VBox/Runtime/common/err/errmsgxpcom.cpp
index eb2694d..7b156a2 100644
--- a/src/VBox/Runtime/common/err/errmsgxpcom.cpp
+++ b/src/VBox/Runtime/common/err/errmsgxpcom.cpp
@@ -24,9 +24,10 @@
* terms and conditions of either the GPL or the CDDL or both.
*/
-/*******************************************************************************
-* Header Files *
-*******************************************************************************/
+
+/*********************************************************************************************************************************
+* Header Files *
+*********************************************************************************************************************************/
#include <iprt/err.h>
#include "internal/iprt.h"
@@ -35,9 +36,9 @@
#include <iprt/err.h>
-/*******************************************************************************
-* Global Variables *
-*******************************************************************************/
+/*********************************************************************************************************************************
+* Global Variables *
+*********************************************************************************************************************************/
/** Array of messages.
* The data is generated by a sed script.
*/
diff --git a/src/VBox/Runtime/common/filesystem/filesystem.cpp b/src/VBox/Runtime/common/filesystem/filesystem.cpp
index 30940bc..ce42f2f 100644
--- a/src/VBox/Runtime/common/filesystem/filesystem.cpp
+++ b/src/VBox/Runtime/common/filesystem/filesystem.cpp
@@ -25,9 +25,9 @@
*/
-/*******************************************************************************
-* Header Files *
-*******************************************************************************/
+/*********************************************************************************************************************************
+* Header Files *
+*********************************************************************************************************************************/
#define LOG_GROUP LOG_GROUP_DEFAULT
#include <iprt/types.h>
#include <iprt/assert.h>
@@ -39,9 +39,10 @@
#include <iprt/list.h>
#include "internal/filesystem.h"
-/*******************************************************************************
-* Global variables *
-*******************************************************************************/
+
+/*********************************************************************************************************************************
+* Global variables *
+*********************************************************************************************************************************/
/**
* Supported volume formats.
diff --git a/src/VBox/Runtime/common/filesystem/filesystemext.cpp b/src/VBox/Runtime/common/filesystem/filesystemext.cpp
index cdd97a9..6f96cba 100644
--- a/src/VBox/Runtime/common/filesystem/filesystemext.cpp
+++ b/src/VBox/Runtime/common/filesystem/filesystemext.cpp
@@ -25,9 +25,9 @@
*/
-/*******************************************************************************
-* Header Files *
-*******************************************************************************/
+/*********************************************************************************************************************************
+* Header Files *
+*********************************************************************************************************************************/
#define LOG_GROUP LOG_GROUP_DEFAULT
#include <iprt/types.h>
#include <iprt/assert.h>
@@ -38,9 +38,9 @@
#include "internal/filesystem.h"
-/*******************************************************************************
-* Structures and Typedefs *
-*******************************************************************************/
+/*********************************************************************************************************************************
+* Structures and Typedefs *
+*********************************************************************************************************************************/
/*
* The filesystem structures are from http://wiki.osdev.org/Ext2 and
@@ -185,9 +185,10 @@ typedef struct RTFILESYSTEMEXT
/** Pointer to the ext filesystem data. */
typedef RTFILESYSTEMEXT *PRTFILESYSTEMEXT;
-/*******************************************************************************
-* Methods *
-*******************************************************************************/
+
+/*********************************************************************************************************************************
+* Methods *
+*********************************************************************************************************************************/
/**
* Loads the block descriptor of the given block group from the medium.
diff --git a/src/VBox/Runtime/common/ldr/ldr.cpp b/src/VBox/Runtime/common/ldr/ldr.cpp
index a1d5919..3aae875 100644
--- a/src/VBox/Runtime/common/ldr/ldr.cpp
+++ b/src/VBox/Runtime/common/ldr/ldr.cpp
@@ -25,9 +25,9 @@
*/
-/*******************************************************************************
-* Header Files *
-*******************************************************************************/
+/*********************************************************************************************************************************
+* Header Files *
+*********************************************************************************************************************************/
#define LOG_GROUP RTLOGGROUP_LDR
#include <iprt/ldr.h>
#include "internal/iprt.h"
diff --git a/src/VBox/Runtime/common/ldr/ldrELF.cpp b/src/VBox/Runtime/common/ldr/ldrELF.cpp
index ecc6465..812f255 100644
--- a/src/VBox/Runtime/common/ldr/ldrELF.cpp
+++ b/src/VBox/Runtime/common/ldr/ldrELF.cpp
@@ -25,9 +25,9 @@
*/
-/*******************************************************************************
-* Header Files *
-*******************************************************************************/
+/*********************************************************************************************************************************
+* Header Files *
+*********************************************************************************************************************************/
#define LOG_GROUP RTLOGGROUP_LDR
#include <iprt/ldr.h>
#include "internal/iprt.h"
@@ -45,9 +45,9 @@
-/*******************************************************************************
-* Defined Constants And Macros *
-*******************************************************************************/
+/*********************************************************************************************************************************
+* Defined Constants And Macros *
+*********************************************************************************************************************************/
/** Finds an ELF symbol table string. */
#define ELF_STR(pHdrs, iStr) ((pHdrs)->pStr + (iStr))
/** Finds an ELF section header string. */
@@ -55,9 +55,9 @@
-/*******************************************************************************
-* Internal Functions *
-*******************************************************************************/
+/*********************************************************************************************************************************
+* Internal Functions *
+*********************************************************************************************************************************/
#ifdef LOG_ENABLED
static const char *rtldrElfGetShdrType(uint32_t iType);
#endif
diff --git a/src/VBox/Runtime/common/ldr/ldrEx.cpp b/src/VBox/Runtime/common/ldr/ldrEx.cpp
index 408a70f..d85a42b 100644
--- a/src/VBox/Runtime/common/ldr/ldrEx.cpp
+++ b/src/VBox/Runtime/common/ldr/ldrEx.cpp
@@ -25,9 +25,9 @@
*/
-/*******************************************************************************
-* Header Files *
-*******************************************************************************/
+/*********************************************************************************************************************************
+* Header Files *
+*********************************************************************************************************************************/
#define LOG_GROUP RTLOGGROUP_LDR
#include <iprt/ldr.h>
#include "internal/iprt.h"
diff --git a/src/VBox/Runtime/common/ldr/ldrFile.cpp b/src/VBox/Runtime/common/ldr/ldrFile.cpp
index 7807ce2..c2ddf4b 100644
--- a/src/VBox/Runtime/common/ldr/ldrFile.cpp
+++ b/src/VBox/Runtime/common/ldr/ldrFile.cpp
@@ -25,9 +25,9 @@
*/
-/*******************************************************************************
-* Header Files *
-*******************************************************************************/
+/*********************************************************************************************************************************
+* Header Files *
+*********************************************************************************************************************************/
#define LOG_GROUP RTLOGGROUP_LDR
#include <iprt/ldr.h>
#include "internal/iprt.h"
@@ -42,9 +42,9 @@
#include "internal/ldrMZ.h"
-/*******************************************************************************
-* Structures and Typedefs *
-*******************************************************************************/
+/*********************************************************************************************************************************
+* Structures and Typedefs *
+*********************************************************************************************************************************/
/**
* File Reader instance.
* This provides raw image bits from a file.
diff --git a/src/VBox/Runtime/common/ldr/ldrMemory.cpp b/src/VBox/Runtime/common/ldr/ldrMemory.cpp
index 9d6f639..350baa9 100644
--- a/src/VBox/Runtime/common/ldr/ldrMemory.cpp
+++ b/src/VBox/Runtime/common/ldr/ldrMemory.cpp
@@ -26,9 +26,9 @@
*/
-/*******************************************************************************
-* Header Files *
-*******************************************************************************/
+/*********************************************************************************************************************************
+* Header Files *
+*********************************************************************************************************************************/
#define LOG_GROUP RTLOGGROUP_LDR
#include <iprt/ldr.h>
#include "internal/iprt.h"
@@ -41,9 +41,9 @@
#include "internal/ldr.h"
-/*******************************************************************************
-* Structures and Typedefs *
-*******************************************************************************/
+/*********************************************************************************************************************************
+* Structures and Typedefs *
+*********************************************************************************************************************************/
/**
* Memory reader (for debuggers) instance.
*/
diff --git a/src/VBox/Runtime/common/ldr/ldrNative.cpp b/src/VBox/Runtime/common/ldr/ldrNative.cpp
index 5ffbf59..cccd176 100644
--- a/src/VBox/Runtime/common/ldr/ldrNative.cpp
+++ b/src/VBox/Runtime/common/ldr/ldrNative.cpp
@@ -25,9 +25,9 @@
*/
-/*******************************************************************************
-* Header Files *
-*******************************************************************************/
+/*********************************************************************************************************************************
+* Header Files *
+*********************************************************************************************************************************/
#define LOG_GROUP RTLOGGROUP_LDR
#include <iprt/ldr.h>
#include "internal/iprt.h"
diff --git a/src/VBox/Runtime/common/ldr/ldrPE.cpp b/src/VBox/Runtime/common/ldr/ldrPE.cpp
index 13ad4c4..55edd4d 100644
--- a/src/VBox/Runtime/common/ldr/ldrPE.cpp
+++ b/src/VBox/Runtime/common/ldr/ldrPE.cpp
@@ -25,9 +25,9 @@
*/
-/*******************************************************************************
-* Header Files *
-*******************************************************************************/
+/*********************************************************************************************************************************
+* Header Files *
+*********************************************************************************************************************************/
#define LOG_GROUP RTLOGGROUP_LDR
#include <iprt/ldr.h>
#include "internal/iprt.h"
@@ -52,9 +52,9 @@
#include "internal/ldr.h"
-/*******************************************************************************
-* Defined Constants And Macros *
-*******************************************************************************/
+/*********************************************************************************************************************************
+* Defined Constants And Macros *
+*********************************************************************************************************************************/
/** Converts rva to a type.
* @param pvBits Pointer to base of image bits.
* @param rva Relative virtual address.
@@ -70,9 +70,9 @@
#endif
-/*******************************************************************************
-* Structures and Typedefs *
-*******************************************************************************/
+/*********************************************************************************************************************************
+* Structures and Typedefs *
+*********************************************************************************************************************************/
/**
* The PE loader structure.
*/
@@ -237,9 +237,9 @@ typedef RTLDRPESIGNATURE *PRTLDRPESIGNATURE;
#endif
-/*******************************************************************************
-* Internal Functions *
-*******************************************************************************/
+/*********************************************************************************************************************************
+* Internal Functions *
+*********************************************************************************************************************************/
static void rtldrPEConvert32BitOptionalHeaderTo64Bit(PIMAGE_OPTIONAL_HEADER64 pOptHdr);
static void rtldrPEConvert32BitLoadConfigTo64Bit(PIMAGE_LOAD_CONFIG_DIRECTORY64 pLoadCfg);
static int rtldrPEApplyFixups(PRTLDRMODPE pModPe, const void *pvBitsR, void *pvBitsW, RTUINTPTR BaseAddress, RTUINTPTR OldBaseAddress);
diff --git a/src/VBox/Runtime/common/ldr/ldrkStuff.cpp b/src/VBox/Runtime/common/ldr/ldrkStuff.cpp
index 00b1595..80cb474 100644
--- a/src/VBox/Runtime/common/ldr/ldrkStuff.cpp
+++ b/src/VBox/Runtime/common/ldr/ldrkStuff.cpp
@@ -25,9 +25,9 @@
*/
-/*******************************************************************************
-* Header Files *
-*******************************************************************************/
+/*********************************************************************************************************************************
+* Header Files *
+*********************************************************************************************************************************/
#define LOG_GROUP RTLOGGROUP_LDR
#include <iprt/ldr.h>
#include "internal/iprt.h"
@@ -51,9 +51,9 @@
#include <k/kMagics.h>
-/*******************************************************************************
-* Structures and Typedefs *
-*******************************************************************************/
+/*********************************************************************************************************************************
+* Structures and Typedefs *
+*********************************************************************************************************************************/
/**
* kLdr file provider.
*/
diff --git a/src/VBox/Runtime/common/log/log.cpp b/src/VBox/Runtime/common/log/log.cpp
index 5539350..3247806 100644
--- a/src/VBox/Runtime/common/log/log.cpp
+++ b/src/VBox/Runtime/common/log/log.cpp
@@ -25,9 +25,9 @@
*/
-/*******************************************************************************
-* Header Files *
-*******************************************************************************/
+/*********************************************************************************************************************************
+* Header Files *
+*********************************************************************************************************************************/
#include <iprt/log.h>
#include "internal/iprt.h"
@@ -62,9 +62,9 @@
#endif
-/*******************************************************************************
-* Defined Constants And Macros *
-*******************************************************************************/
+/*********************************************************************************************************************************
+* Defined Constants And Macros *
+*********************************************************************************************************************************/
/** @def RTLOG_RINGBUF_DEFAULT_SIZE
* The default ring buffer size. */
/** @def RTLOG_RINGBUF_MAX_SIZE
@@ -89,9 +89,9 @@ AssertCompile(sizeof(RTLOG_RINGBUF_EYE_CATCHER) == 16);
AssertCompile(sizeof(RTLOG_RINGBUF_EYE_CATCHER_END) == 16);
-/*******************************************************************************
-* Structures and Typedefs *
-*******************************************************************************/
+/*********************************************************************************************************************************
+* Structures and Typedefs *
+*********************************************************************************************************************************/
/**
* Arguments passed to the output function.
*/
@@ -216,9 +216,9 @@ AssertCompileMemberAlignment(RTLOGGERINTERNAL, cbRingBufUnflushed, sizeof(uint64
#endif /* !IN_RC */
-/*******************************************************************************
-* Internal Functions *
-*******************************************************************************/
+/*********************************************************************************************************************************
+* Internal Functions *
+*********************************************************************************************************************************/
#ifndef IN_RC
static unsigned rtlogGroupFlags(const char *psz);
#endif
@@ -242,9 +242,9 @@ static void rtlogLoggerExFLocked(PRTLOGGER pLogger, unsigned fFlags, unsigned iG
#endif
-/*******************************************************************************
-* Global Variables *
-*******************************************************************************/
+/*********************************************************************************************************************************
+* Global Variables *
+*********************************************************************************************************************************/
#ifdef IN_RC
/** Default logger instance. Make it weak because our RC module loader does not
* necessarily resolve this symbol and the compiler _must_ check if this is
diff --git a/src/VBox/Runtime/common/log/logcom.cpp b/src/VBox/Runtime/common/log/logcom.cpp
index 8ddcf34..0f67da7 100644
--- a/src/VBox/Runtime/common/log/logcom.cpp
+++ b/src/VBox/Runtime/common/log/logcom.cpp
@@ -25,9 +25,9 @@
*/
-/*******************************************************************************
-* Defined Constants And Macros *
-*******************************************************************************/
+/*********************************************************************************************************************************
+* Defined Constants And Macros *
+*********************************************************************************************************************************/
#ifndef IPRT_UART_BASE
/** The port address of the COM port to log to.
*
@@ -41,9 +41,9 @@
#endif
-/*******************************************************************************
-* Header Files *
-*******************************************************************************/
+/*********************************************************************************************************************************
+* Header Files *
+*********************************************************************************************************************************/
#include <iprt/log.h>
#include "internal/iprt.h"
@@ -55,9 +55,9 @@
#include <iprt/string.h>
-/*******************************************************************************
-* Internal Functions *
-*******************************************************************************/
+/*********************************************************************************************************************************
+* Internal Functions *
+*********************************************************************************************************************************/
static DECLCALLBACK(size_t) rtLogComOutput(void *pv, const char *pachChars, size_t cbChars);
diff --git a/src/VBox/Runtime/common/log/logellipsis.cpp b/src/VBox/Runtime/common/log/logellipsis.cpp
index e831e33..5ef052b 100644
--- a/src/VBox/Runtime/common/log/logellipsis.cpp
+++ b/src/VBox/Runtime/common/log/logellipsis.cpp
@@ -25,9 +25,9 @@
*/
-/*******************************************************************************
-* Header Files *
-*******************************************************************************/
+/*********************************************************************************************************************************
+* Header Files *
+*********************************************************************************************************************************/
#include <iprt/log.h>
#include "internal/iprt.h"
diff --git a/src/VBox/Runtime/common/log/logformat.cpp b/src/VBox/Runtime/common/log/logformat.cpp
index 1161fd8..8c4dd9f 100644
--- a/src/VBox/Runtime/common/log/logformat.cpp
+++ b/src/VBox/Runtime/common/log/logformat.cpp
@@ -25,9 +25,9 @@
*/
-/*******************************************************************************
-* Header Files *
-*******************************************************************************/
+/*********************************************************************************************************************************
+* Header Files *
+*********************************************************************************************************************************/
#include <iprt/log.h>
#include "internal/iprt.h"
@@ -42,9 +42,9 @@
#include <iprt/string.h>
-/*******************************************************************************
-* Internal Functions *
-*******************************************************************************/
+/*********************************************************************************************************************************
+* Internal Functions *
+*********************************************************************************************************************************/
static DECLCALLBACK(size_t) rtlogFormatStr(void *pvArg, PFNRTSTROUTPUT pfnOutput,
void *pvArgOutput, const char **ppszFormat,
va_list *pArgs, int cchWidth, int cchPrecision,
diff --git a/src/VBox/Runtime/common/log/logrel.cpp b/src/VBox/Runtime/common/log/logrel.cpp
index 34df280..873ae84 100644
--- a/src/VBox/Runtime/common/log/logrel.cpp
+++ b/src/VBox/Runtime/common/log/logrel.cpp
@@ -25,9 +25,9 @@
*/
-/*******************************************************************************
-* Header Files *
-*******************************************************************************/
+/*********************************************************************************************************************************
+* Header Files *
+*********************************************************************************************************************************/
#include <iprt/log.h>
#include "internal/iprt.h"
@@ -57,9 +57,9 @@
#endif
-/*******************************************************************************
-* Global Variables *
-*******************************************************************************/
+/*********************************************************************************************************************************
+* Global Variables *
+*********************************************************************************************************************************/
#ifdef IN_RC
/** Default release logger instance. */
extern "C" DECLIMPORT(RTLOGGERRC) g_RelLogger;
diff --git a/src/VBox/Runtime/common/log/logrelellipsis.cpp b/src/VBox/Runtime/common/log/logrelellipsis.cpp
index 43631f7..e1f78dd 100644
--- a/src/VBox/Runtime/common/log/logrelellipsis.cpp
+++ b/src/VBox/Runtime/common/log/logrelellipsis.cpp
@@ -25,9 +25,9 @@
*/
-/*******************************************************************************
-* Header Files *
-*******************************************************************************/
+/*********************************************************************************************************************************
+* Header Files *
+*********************************************************************************************************************************/
#include <iprt/log.h>
#include "internal/iprt.h"
diff --git a/src/VBox/Runtime/common/log/tracebuf.cpp b/src/VBox/Runtime/common/log/tracebuf.cpp
index a664e4e..037a29b 100644
--- a/src/VBox/Runtime/common/log/tracebuf.cpp
+++ b/src/VBox/Runtime/common/log/tracebuf.cpp
@@ -25,9 +25,9 @@
*/
-/*******************************************************************************
-* Header Files *
-*******************************************************************************/
+/*********************************************************************************************************************************
+* Header Files *
+*********************************************************************************************************************************/
#include "internal/iprt.h"
#include <iprt/trace.h>
@@ -51,9 +51,9 @@
#include "internal/magics.h"
-/*******************************************************************************
-* Structures and Typedefs *
-*******************************************************************************/
+/*********************************************************************************************************************************
+* Structures and Typedefs *
+*********************************************************************************************************************************/
/** Alignment used to place the trace buffer members, this should be a multiple
* of the cache line size if possible. (We should dynamically determine it.) */
#define RTTRACEBUF_ALIGNMENT 64
@@ -134,9 +134,9 @@ typedef struct RTTRACEBUFINT
typedef RTTRACEBUFINT const *PCRTTRACEBUFINT;
-/*******************************************************************************
-* Defined Constants And Macros *
-*******************************************************************************/
+/*********************************************************************************************************************************
+* Defined Constants And Macros *
+*********************************************************************************************************************************/
/**
* Get the current CPU Id.
*/
diff --git a/src/VBox/Runtime/common/log/tracedefault.cpp b/src/VBox/Runtime/common/log/tracedefault.cpp
index 801137d..140eab3 100644
--- a/src/VBox/Runtime/common/log/tracedefault.cpp
+++ b/src/VBox/Runtime/common/log/tracedefault.cpp
@@ -25,9 +25,9 @@
*/
-/*******************************************************************************
-* Header Files *
-*******************************************************************************/
+/*********************************************************************************************************************************
+* Header Files *
+*********************************************************************************************************************************/
#include "internal/iprt.h"
#include <iprt/trace.h>
@@ -36,9 +36,9 @@
#include <iprt/thread.h>
-/*******************************************************************************
-* Global Variables *
-*******************************************************************************/
+/*********************************************************************************************************************************
+* Global Variables *
+*********************************************************************************************************************************/
/** The default trace buffer handle. */
static RTTRACEBUF g_hDefaultTraceBuf = NIL_RTTRACEBUF;
diff --git a/src/VBox/Runtime/common/math/bignum.cpp b/src/VBox/Runtime/common/math/bignum.cpp
index 72bee1d..309d541 100644
--- a/src/VBox/Runtime/common/math/bignum.cpp
+++ b/src/VBox/Runtime/common/math/bignum.cpp
@@ -25,9 +25,9 @@
*/
-/*******************************************************************************
-* Header Files *
-*******************************************************************************/
+/*********************************************************************************************************************************
+* Header Files *
+*********************************************************************************************************************************/
/*#ifdef IN_RING3
# define RTMEM_WRAP_TO_EF_APIS
#endif*/
@@ -45,9 +45,9 @@
#endif
-/*******************************************************************************
-* Defined Constants And Macros *
-*******************************************************************************/
+/*********************************************************************************************************************************
+* Defined Constants And Macros *
+*********************************************************************************************************************************/
/** Allocation alignment in elements. */
#ifndef RTMEM_WRAP_TO_EF_APIS
# define RTBIGNUM_ALIGNMENT 4U
@@ -98,9 +98,9 @@
#define RTBIGNUMELEMENT_HI_HALF(a_uElement) ( (a_uElement) >> (RTBIGNUM_ELEMENT_BITS / 2) )
-/*******************************************************************************
-* Structures and Typedefs *
-*******************************************************************************/
+/*********************************************************************************************************************************
+* Structures and Typedefs *
+*********************************************************************************************************************************/
/** Type the size of two elements. */
#if RTBIGNUM_ELEMENT_BITS == 64
typedef RTUINT128U RTBIGNUMELEMENT2X;
@@ -109,9 +109,9 @@ typedef RTUINT64U RTBIGNUMELEMENT2X;
#endif
-/*******************************************************************************
-* Internal Functions *
-*******************************************************************************/
+/*********************************************************************************************************************************
+* Internal Functions *
+*********************************************************************************************************************************/
DECLINLINE(int) rtBigNumSetUsed(PRTBIGNUM pBigNum, uint32_t cNewUsed);
#ifdef IPRT_BIGINT_WITH_ASM
diff --git a/src/VBox/Runtime/common/misc/RTAssertMsg1Weak.cpp b/src/VBox/Runtime/common/misc/RTAssertMsg1Weak.cpp
index 9d4f54b..fbbc95c 100644
--- a/src/VBox/Runtime/common/misc/RTAssertMsg1Weak.cpp
+++ b/src/VBox/Runtime/common/misc/RTAssertMsg1Weak.cpp
@@ -25,9 +25,9 @@
*/
-/*******************************************************************************
-* Header Files *
-*******************************************************************************/
+/*********************************************************************************************************************************
+* Header Files *
+*********************************************************************************************************************************/
#include <iprt/assert.h>
#include "internal/iprt.h"
diff --git a/src/VBox/Runtime/common/misc/RTAssertMsg2.cpp b/src/VBox/Runtime/common/misc/RTAssertMsg2.cpp
index 9247f5b..291fcea 100644
--- a/src/VBox/Runtime/common/misc/RTAssertMsg2.cpp
+++ b/src/VBox/Runtime/common/misc/RTAssertMsg2.cpp
@@ -25,9 +25,9 @@
*/
-/*******************************************************************************
-* Header Files *
-*******************************************************************************/
+/*********************************************************************************************************************************
+* Header Files *
+*********************************************************************************************************************************/
#include <iprt/assert.h>
#include "internal/iprt.h"
diff --git a/src/VBox/Runtime/common/misc/RTAssertMsg2Add.cpp b/src/VBox/Runtime/common/misc/RTAssertMsg2Add.cpp
index 72c7aaf..946268e 100644
--- a/src/VBox/Runtime/common/misc/RTAssertMsg2Add.cpp
+++ b/src/VBox/Runtime/common/misc/RTAssertMsg2Add.cpp
@@ -25,9 +25,9 @@
*/
-/*******************************************************************************
-* Header Files *
-*******************************************************************************/
+/*********************************************************************************************************************************
+* Header Files *
+*********************************************************************************************************************************/
#include <iprt/assert.h>
#include "internal/iprt.h"
diff --git a/src/VBox/Runtime/common/misc/RTAssertMsg2AddWeak.cpp b/src/VBox/Runtime/common/misc/RTAssertMsg2AddWeak.cpp
index 68a1f14..4c68515 100644
--- a/src/VBox/Runtime/common/misc/RTAssertMsg2AddWeak.cpp
+++ b/src/VBox/Runtime/common/misc/RTAssertMsg2AddWeak.cpp
@@ -25,9 +25,9 @@
*/
-/*******************************************************************************
-* Header Files *
-*******************************************************************************/
+/*********************************************************************************************************************************
+* Header Files *
+*********************************************************************************************************************************/
#include <iprt/assert.h>
#include "internal/iprt.h"
diff --git a/src/VBox/Runtime/common/misc/RTAssertMsg2AddWeakV.cpp b/src/VBox/Runtime/common/misc/RTAssertMsg2AddWeakV.cpp
index 6a3a34b..fae8a35 100644
--- a/src/VBox/Runtime/common/misc/RTAssertMsg2AddWeakV.cpp
+++ b/src/VBox/Runtime/common/misc/RTAssertMsg2AddWeakV.cpp
@@ -25,9 +25,9 @@
*/
-/*******************************************************************************
-* Header Files *
-*******************************************************************************/
+/*********************************************************************************************************************************
+* Header Files *
+*********************************************************************************************************************************/
#include <iprt/assert.h>
#include "internal/iprt.h"
diff --git a/src/VBox/Runtime/common/misc/RTAssertMsg2Weak.cpp b/src/VBox/Runtime/common/misc/RTAssertMsg2Weak.cpp
index 08ada4d..439b79b 100644
--- a/src/VBox/Runtime/common/misc/RTAssertMsg2Weak.cpp
+++ b/src/VBox/Runtime/common/misc/RTAssertMsg2Weak.cpp
@@ -25,9 +25,9 @@
*/
-/*******************************************************************************
-* Header Files *
-*******************************************************************************/
+/*********************************************************************************************************************************
+* Header Files *
+*********************************************************************************************************************************/
#include <iprt/assert.h>
#include "internal/iprt.h"
diff --git a/src/VBox/Runtime/common/misc/RTAssertMsg2WeakV.cpp b/src/VBox/Runtime/common/misc/RTAssertMsg2WeakV.cpp
index e0e17c3..8a7c820 100644
--- a/src/VBox/Runtime/common/misc/RTAssertMsg2WeakV.cpp
+++ b/src/VBox/Runtime/common/misc/RTAssertMsg2WeakV.cpp
@@ -25,9 +25,9 @@
*/
-/*******************************************************************************
-* Header Files *
-*******************************************************************************/
+/*********************************************************************************************************************************
+* Header Files *
+*********************************************************************************************************************************/
#include <iprt/assert.h>
#include "internal/iprt.h"
diff --git a/src/VBox/Runtime/common/misc/RTFileModeToFlags.cpp b/src/VBox/Runtime/common/misc/RTFileModeToFlags.cpp
index bdd85ad..bbeb209 100644
--- a/src/VBox/Runtime/common/misc/RTFileModeToFlags.cpp
+++ b/src/VBox/Runtime/common/misc/RTFileModeToFlags.cpp
@@ -25,9 +25,9 @@
*/
-/*******************************************************************************
-* Header Files *
-*******************************************************************************/
+/*********************************************************************************************************************************
+* Header Files *
+*********************************************************************************************************************************/
#include <iprt/assert.h>
#include <iprt/err.h>
#include <iprt/file.h>
diff --git a/src/VBox/Runtime/common/misc/RTFileOpenF.cpp b/src/VBox/Runtime/common/misc/RTFileOpenF.cpp
index 51dd093..75e841e 100644
--- a/src/VBox/Runtime/common/misc/RTFileOpenF.cpp
+++ b/src/VBox/Runtime/common/misc/RTFileOpenF.cpp
@@ -25,9 +25,9 @@
*/
-/*******************************************************************************
-* Header Files *
-*******************************************************************************/
+/*********************************************************************************************************************************
+* Header Files *
+*********************************************************************************************************************************/
#include <iprt/file.h>
#include "internal/iprt.h"
diff --git a/src/VBox/Runtime/common/misc/RTFileOpenV.cpp b/src/VBox/Runtime/common/misc/RTFileOpenV.cpp
index 259722d..0d4976f 100644
--- a/src/VBox/Runtime/common/misc/RTFileOpenV.cpp
+++ b/src/VBox/Runtime/common/misc/RTFileOpenV.cpp
@@ -25,9 +25,9 @@
*/
-/*******************************************************************************
-* Header Files *
-*******************************************************************************/
+/*********************************************************************************************************************************
+* Header Files *
+*********************************************************************************************************************************/
#include <iprt/file.h>
#include "internal/iprt.h"
diff --git a/src/VBox/Runtime/common/misc/RTMemWipeThoroughly.cpp b/src/VBox/Runtime/common/misc/RTMemWipeThoroughly.cpp
index fa566ca..eeddbbb 100644
--- a/src/VBox/Runtime/common/misc/RTMemWipeThoroughly.cpp
+++ b/src/VBox/Runtime/common/misc/RTMemWipeThoroughly.cpp
@@ -25,9 +25,9 @@
*/
-/*******************************************************************************
-* Header Files *
-*******************************************************************************/
+/*********************************************************************************************************************************
+* Header Files *
+*********************************************************************************************************************************/
#include <iprt/mem.h>
#include "internal/iprt.h"
@@ -36,7 +36,7 @@
#include <iprt/string.h>
-RTDECL(void) RTMemWipeThoroughly(void *pv, size_t cb, size_t cMinPasses) RT_NO_THROW
+RTDECL(void) RTMemWipeThoroughly(void *pv, size_t cb, size_t cMinPasses) RT_NO_THROW_DEF
{
size_t cPasses = RT_MIN(cMinPasses, 6);
diff --git a/src/VBox/Runtime/common/misc/RTSystemIsInsideVM-amd64-x86.cpp b/src/VBox/Runtime/common/misc/RTSystemIsInsideVM-amd64-x86.cpp
index fbc6bf0..2d0aaf1 100644
--- a/src/VBox/Runtime/common/misc/RTSystemIsInsideVM-amd64-x86.cpp
+++ b/src/VBox/Runtime/common/misc/RTSystemIsInsideVM-amd64-x86.cpp
@@ -24,9 +24,10 @@
* terms and conditions of either the GPL or the CDDL or both.
*/
-/*******************************************************************************
-* Header Files *
-*******************************************************************************/
+
+/*********************************************************************************************************************************
+* Header Files *
+*********************************************************************************************************************************/
#include "internal/iprt.h"
#include <iprt/system.h>
diff --git a/src/VBox/Runtime/common/misc/aiomgr.cpp b/src/VBox/Runtime/common/misc/aiomgr.cpp
index c7cfb34..0175655 100644
--- a/src/VBox/Runtime/common/misc/aiomgr.cpp
+++ b/src/VBox/Runtime/common/misc/aiomgr.cpp
@@ -24,9 +24,10 @@
* terms and conditions of either the GPL or the CDDL or both.
*/
-/*******************************************************************************
-* Header Files *
-*******************************************************************************/
+
+/*********************************************************************************************************************************
+* Header Files *
+*********************************************************************************************************************************/
#include <iprt/aiomgr.h>
#include <iprt/err.h>
@@ -44,9 +45,10 @@
#include "internal/magics.h"
-/*******************************************************************************
-* Structures and Typedefs *
-*******************************************************************************/
+
+/*********************************************************************************************************************************
+* Structures and Typedefs *
+*********************************************************************************************************************************/
/** Pointer to an internal async I/O file instance. */
typedef struct RTAIOMGRFILEINT *PRTAIOMGRFILEINT;
@@ -206,9 +208,10 @@ typedef RTAIOMGRREQ *PRTAIOMGRREQ;
/** Flag whether the request was prepared already. */
#define RTAIOMGRREQ_FLAGS_PREPARED RT_BIT_32(0)
-/*******************************************************************************
-* Defined Constants And Macros *
-*******************************************************************************/
+
+/*********************************************************************************************************************************
+* Defined Constants And Macros *
+*********************************************************************************************************************************/
/** Validates a handle and returns VERR_INVALID_HANDLE if not valid. */
#define RTAIOMGR_VALID_RETURN_RC(a_hAioMgr, a_rc) \
@@ -227,9 +230,10 @@ typedef RTAIOMGRREQ *PRTAIOMGRREQ;
AssertReturnVoid((a_hAioMgr)->u32Magic == RTAIOMGR_MAGIC); \
} while (0)
-/*******************************************************************************
-* Internal Functions *
-*******************************************************************************/
+
+/*********************************************************************************************************************************
+* Internal Functions *
+*********************************************************************************************************************************/
static int rtAioMgrReqsEnqueue(PRTAIOMGRINT pThis, PRTAIOMGRFILEINT pFile,
PRTFILEAIOREQ pahReqs, unsigned cReqs);
diff --git a/src/VBox/Runtime/common/misc/assert.cpp b/src/VBox/Runtime/common/misc/assert.cpp
index 76b9324..bc2fa60 100644
--- a/src/VBox/Runtime/common/misc/assert.cpp
+++ b/src/VBox/Runtime/common/misc/assert.cpp
@@ -25,9 +25,9 @@
*/
-/*******************************************************************************
-* Header Files *
-*******************************************************************************/
+/*********************************************************************************************************************************
+* Header Files *
+*********************************************************************************************************************************/
#include <iprt/assert.h>
#include "internal/iprt.h"
@@ -42,9 +42,9 @@
#include "internal/assert.h"
-/*******************************************************************************
-* Global Variables *
-*******************************************************************************/
+/*********************************************************************************************************************************
+* Global Variables *
+*********************************************************************************************************************************/
/** The last assert message, 1st part. */
RTDATADECL(char) g_szRTAssertMsg1[1024];
RT_EXPORT_SYMBOL(g_szRTAssertMsg1);
diff --git a/src/VBox/Runtime/common/misc/buildconfig.cpp b/src/VBox/Runtime/common/misc/buildconfig.cpp
index 807d50e..8856dbc 100644
--- a/src/VBox/Runtime/common/misc/buildconfig.cpp
+++ b/src/VBox/Runtime/common/misc/buildconfig.cpp
@@ -25,9 +25,9 @@
*/
-/*******************************************************************************
-* Header Files *
-*******************************************************************************/
+/*********************************************************************************************************************************
+* Header Files *
+*********************************************************************************************************************************/
#include "internal/iprt.h"
#include <iprt/buildconfig.h>
diff --git a/src/VBox/Runtime/common/misc/cidr.cpp b/src/VBox/Runtime/common/misc/cidr.cpp
index a964586..07afb7f 100644
--- a/src/VBox/Runtime/common/misc/cidr.cpp
+++ b/src/VBox/Runtime/common/misc/cidr.cpp
@@ -25,9 +25,9 @@
*/
-/*******************************************************************************
-* Header Files *
-*******************************************************************************/
+/*********************************************************************************************************************************
+* Header Files *
+*********************************************************************************************************************************/
#include <iprt/cidr.h>
#include "internal/iprt.h"
diff --git a/src/VBox/Runtime/common/misc/circbuf.cpp b/src/VBox/Runtime/common/misc/circbuf.cpp
index 37a72f8..863f523 100644
--- a/src/VBox/Runtime/common/misc/circbuf.cpp
+++ b/src/VBox/Runtime/common/misc/circbuf.cpp
@@ -25,9 +25,9 @@
*/
-/*******************************************************************************
-* Header Files *
-*******************************************************************************/
+/*********************************************************************************************************************************
+* Header Files *
+*********************************************************************************************************************************/
#include <iprt/circbuf.h>
#include <iprt/mem.h>
#include <iprt/assert.h>
@@ -35,9 +35,9 @@
#include <iprt/err.h>
-/*******************************************************************************
-* Structures and Typedefs *
-*******************************************************************************/
+/*********************************************************************************************************************************
+* Structures and Typedefs *
+*********************************************************************************************************************************/
/** @todo r=bird: this is missing docs and magic. */
typedef struct RTCIRCBUF
{
diff --git a/src/VBox/Runtime/common/misc/getopt.cpp b/src/VBox/Runtime/common/misc/getopt.cpp
index ac58209..f549e49 100644
--- a/src/VBox/Runtime/common/misc/getopt.cpp
+++ b/src/VBox/Runtime/common/misc/getopt.cpp
@@ -24,9 +24,10 @@
* terms and conditions of either the GPL or the CDDL or both.
*/
-/*******************************************************************************
-* Header Files *
-*******************************************************************************/
+
+/*********************************************************************************************************************************
+* Header Files *
+*********************************************************************************************************************************/
#include <iprt/cidr.h>
#include <iprt/net.h> /* must come before getopt.h */
#include <iprt/getopt.h>
@@ -40,9 +41,9 @@
#include <iprt/uuid.h>
-/*******************************************************************************
-* Global Variables *
-*******************************************************************************/
+/*********************************************************************************************************************************
+* Global Variables *
+*********************************************************************************************************************************/
/**
* Standard options that gets included unless RTGETOPTINIT_FLAGS_NO_STD_OPTS is
* set.
diff --git a/src/VBox/Runtime/common/misc/getoptargv.cpp b/src/VBox/Runtime/common/misc/getoptargv.cpp
index b071e3a..2a1b7da 100644
--- a/src/VBox/Runtime/common/misc/getoptargv.cpp
+++ b/src/VBox/Runtime/common/misc/getoptargv.cpp
@@ -24,9 +24,10 @@
* terms and conditions of either the GPL or the CDDL or both.
*/
-/*******************************************************************************
-* Header Files *
-*******************************************************************************/
+
+/*********************************************************************************************************************************
+* Header Files *
+*********************************************************************************************************************************/
#include <iprt/getopt.h>
#include "internal/iprt.h"
@@ -37,9 +38,9 @@
#include <iprt/string.h>
-/*******************************************************************************
-* Header Files *
-*******************************************************************************/
+/*********************************************************************************************************************************
+* Header Files *
+*********************************************************************************************************************************/
/**
* Array indexed by the quoting type and 7-bit ASCII character.
*
diff --git a/src/VBox/Runtime/common/misc/handle.cpp b/src/VBox/Runtime/common/misc/handle.cpp
index ef591a5..e6ad272 100644
--- a/src/VBox/Runtime/common/misc/handle.cpp
+++ b/src/VBox/Runtime/common/misc/handle.cpp
@@ -25,9 +25,9 @@
*/
-/*******************************************************************************
-* Header Files *
-*******************************************************************************/
+/*********************************************************************************************************************************
+* Header Files *
+*********************************************************************************************************************************/
#include <iprt/handle.h>
#include "internal/iprt.h"
diff --git a/src/VBox/Runtime/common/misc/handletable.cpp b/src/VBox/Runtime/common/misc/handletable.cpp
index 6c8a50b..6ba583a 100644
--- a/src/VBox/Runtime/common/misc/handletable.cpp
+++ b/src/VBox/Runtime/common/misc/handletable.cpp
@@ -25,9 +25,9 @@
*/
-/*******************************************************************************
-* Header Files *
-*******************************************************************************/
+/*********************************************************************************************************************************
+* Header Files *
+*********************************************************************************************************************************/
#include <iprt/handletable.h>
#include "internal/iprt.h"
diff --git a/src/VBox/Runtime/common/misc/handletablectx.cpp b/src/VBox/Runtime/common/misc/handletablectx.cpp
index af13f37..5ae1efc 100644
--- a/src/VBox/Runtime/common/misc/handletablectx.cpp
+++ b/src/VBox/Runtime/common/misc/handletablectx.cpp
@@ -25,9 +25,9 @@
*/
-/*******************************************************************************
-* Header Files *
-*******************************************************************************/
+/*********************************************************************************************************************************
+* Header Files *
+*********************************************************************************************************************************/
#include <iprt/handletable.h>
#include "internal/iprt.h"
diff --git a/src/VBox/Runtime/common/misc/handletablesimple.cpp b/src/VBox/Runtime/common/misc/handletablesimple.cpp
index 350cf34..0d9346f 100644
--- a/src/VBox/Runtime/common/misc/handletablesimple.cpp
+++ b/src/VBox/Runtime/common/misc/handletablesimple.cpp
@@ -25,9 +25,9 @@
*/
-/*******************************************************************************
-* Header Files *
-*******************************************************************************/
+/*********************************************************************************************************************************
+* Header Files *
+*********************************************************************************************************************************/
#include <iprt/handletable.h>
#include "internal/iprt.h"
diff --git a/src/VBox/Runtime/common/misc/http.cpp b/src/VBox/Runtime/common/misc/http.cpp
index 6bc1303..13db91a 100644
--- a/src/VBox/Runtime/common/misc/http.cpp
+++ b/src/VBox/Runtime/common/misc/http.cpp
@@ -25,58 +25,98 @@
*/
-/*******************************************************************************
-* Header Files *
-*******************************************************************************/
+/*********************************************************************************************************************************
+* Header Files *
+*********************************************************************************************************************************/
#include <iprt/http.h>
#include "internal/iprt.h"
+#include <iprt/asm.h>
#include <iprt/assert.h>
+#include <iprt/crypto/store.h>
#include <iprt/env.h>
#include <iprt/err.h>
-#include <iprt/mem.h>
-#include <iprt/string.h>
#include <iprt/file.h>
+#include <iprt/mem.h>
+#include <iprt/path.h>
#include <iprt/stream.h>
+#include <iprt/string.h>
-#include <curl/curl.h>
-#include <openssl/ssl.h>
#include "internal/magics.h"
+#include <curl/curl.h>
+
-/*******************************************************************************
-* Structures and Typedefs *
-*******************************************************************************/
+/*********************************************************************************************************************************
+* Structures and Typedefs *
+*********************************************************************************************************************************/
+/**
+ * Internal HTTP client instance.
+ */
typedef struct RTHTTPINTERNAL
{
/** Magic value. */
uint32_t u32Magic;
/** cURL handle. */
- CURL *pCurl;
+ CURL *pCurl;
/** The last response code. */
long lLastResp;
- /** custom headers */
- struct curl_slist *pHeaders;
- /** CA certificate for HTTPS authentication check. */
- char *pcszCAFile;
+ /** Custom headers/ */
+ struct curl_slist *pHeaders;
+ /** CA certificate file for HTTPS authentication. */
+ char *pszCaFile;
+ /** Whether to delete the CA on destruction. */
+ bool fDeleteCaFile;
/** Abort the current HTTP request if true. */
- bool fAbort;
+ bool volatile fAbort;
+ /** Set if someone is preforming an HTTP operation. */
+ bool volatile fBusy;
/** The location field for 301 responses. */
- char *pszRedirLocation;
+ char *pszRedirLocation;
+
+ /** Output callback data. */
+ union
+ {
+ /** For file destination. */
+ RTFILE hFile;
+ /** For memory destination. */
+ struct
+ {
+ /** The current size (sans terminator char). */
+ size_t cb;
+ /** The currently allocated size. */
+ size_t cbAllocated;
+ /** Pointer to the buffer. */
+ uint8_t *pb;
+ } Mem;
+ } Output;
+ /** Output callback status. */
+ int rcOutput;
+ /** Download size hint set by the progress callback. */
+ uint64_t cbDownloadHint;
} RTHTTPINTERNAL;
+/** Pointer to an internal HTTP client instance. */
typedef RTHTTPINTERNAL *PRTHTTPINTERNAL;
-typedef struct RTHTTPMEMCHUNK
-{
- uint8_t *pu8Mem;
- size_t cb;
-} RTHTTPMEMCHUNK;
-typedef RTHTTPMEMCHUNK *PRTHTTPMEMCHUNK;
-/*******************************************************************************
-* Defined Constants And Macros *
-*******************************************************************************/
-#define CURL_FAILED(rcCurl) (RT_UNLIKELY(rcCurl != CURLE_OK))
+/*********************************************************************************************************************************
+* Defined Constants And Macros *
+*********************************************************************************************************************************/
+/** @def RTHTTP_MAX_MEM_DOWNLOAD
+ * The max size we are allowed to download to a memory buffer.
+ *
+ * @remarks The minus 1 is for the trailing zero terminator we always add.
+ */
+#if ARCH_BITS == 64
+# define RTHTTP_MAX_MEM_DOWNLOAD_SIZE (UINT32_C(64)*_1M - 1)
+#else
+# define RTHTTP_MAX_MEM_DOWNLOAD_SIZE (UINT32_C(32)*_1M - 1)
+#endif
+
+/** Checks whether a cURL return code indicates success. */
+#define CURL_SUCCESS(rcCurl) RT_LIKELY(rcCurl == CURLE_OK)
+/** Checks whether a cURL return code indicates failure. */
+#define CURL_FAILURE(rcCurl) RT_UNLIKELY(rcCurl != CURLE_OK)
/** Validates a handle and returns VERR_INVALID_HANDLE if not valid. */
#define RTHTTP_VALID_RETURN_RC(hHttp, rcCurl) \
@@ -96,106 +136,103 @@ typedef RTHTTPMEMCHUNK *PRTHTTPMEMCHUNK;
} while (0)
+/*********************************************************************************************************************************
+* Internal Functions *
+*********************************************************************************************************************************/
+static void rtHttpUnsetCaFile(PRTHTTPINTERNAL pThis);
+
+
RTR3DECL(int) RTHttpCreate(PRTHTTP phHttp)
{
AssertPtrReturn(phHttp, VERR_INVALID_PARAMETER);
+ /** @todo r=bird: rainy day: curl_global_init is not thread safe, only a
+ * problem if multiple threads get here at the same time. */
+ int rc = VERR_HTTP_INIT_FAILED;
CURLcode rcCurl = curl_global_init(CURL_GLOBAL_ALL);
- if (CURL_FAILED(rcCurl))
- return VERR_HTTP_INIT_FAILED;
-
- CURL *pCurl = curl_easy_init();
- if (!pCurl)
- return VERR_HTTP_INIT_FAILED;
-
- PRTHTTPINTERNAL pHttpInt = (PRTHTTPINTERNAL)RTMemAllocZ(sizeof(RTHTTPINTERNAL));
- if (!pHttpInt)
- return VERR_NO_MEMORY;
-
- pHttpInt->u32Magic = RTHTTP_MAGIC;
- pHttpInt->pCurl = pCurl;
+ if (!CURL_FAILURE(rcCurl))
+ {
+ CURL *pCurl = curl_easy_init();
+ if (pCurl)
+ {
+ PRTHTTPINTERNAL pThis = (PRTHTTPINTERNAL)RTMemAllocZ(sizeof(RTHTTPINTERNAL));
+ if (pThis)
+ {
+ pThis->u32Magic = RTHTTP_MAGIC;
+ pThis->pCurl = pCurl;
- *phHttp = (RTHTTP)pHttpInt;
+ *phHttp = (RTHTTP)pThis;
- return VINF_SUCCESS;
+ return VINF_SUCCESS;
+ }
+ rc = VERR_NO_MEMORY;
+ }
+ else
+ rc = VERR_HTTP_INIT_FAILED;
+ }
+ curl_global_cleanup();
+ return rc;
}
+
RTR3DECL(void) RTHttpDestroy(RTHTTP hHttp)
{
- if (!hHttp)
+ if (hHttp == NIL_RTHTTP)
return;
- PRTHTTPINTERNAL pHttpInt = hHttp;
- RTHTTP_VALID_RETURN_VOID(pHttpInt);
-
- pHttpInt->u32Magic = RTHTTP_MAGIC_DEAD;
+ PRTHTTPINTERNAL pThis = hHttp;
+ RTHTTP_VALID_RETURN_VOID(pThis);
- curl_easy_cleanup(pHttpInt->pCurl);
+ Assert(!pThis->fBusy);
- if (pHttpInt->pHeaders)
- curl_slist_free_all(pHttpInt->pHeaders);
+ pThis->u32Magic = RTHTTP_MAGIC_DEAD;
- if (pHttpInt->pcszCAFile)
- RTStrFree(pHttpInt->pcszCAFile);
+ curl_easy_cleanup(pThis->pCurl);
+ pThis->pCurl = NULL;
- if (pHttpInt->pszRedirLocation)
- RTStrFree(pHttpInt->pszRedirLocation);
+ if (pThis->pHeaders)
+ curl_slist_free_all(pThis->pHeaders);
- RTMemFree(pHttpInt);
+ rtHttpUnsetCaFile(pThis);
+ Assert(!pThis->pszCaFile);
- curl_global_cleanup();
-}
+ if (pThis->pszRedirLocation)
+ RTStrFree(pThis->pszRedirLocation);
-static DECLCALLBACK(size_t) rtHttpWriteData(void *pvBuf, size_t cb, size_t n, void *pvUser)
-{
- PRTHTTPMEMCHUNK pMem = (PRTHTTPMEMCHUNK)pvUser;
- size_t cbAll = cb * n;
+ RTMemFree(pThis);
- pMem->pu8Mem = (uint8_t*)RTMemRealloc(pMem->pu8Mem, pMem->cb + cbAll + 1);
- if (pMem->pu8Mem)
- {
- memcpy(&pMem->pu8Mem[pMem->cb], pvBuf, cbAll);
- pMem->cb += cbAll;
- pMem->pu8Mem[pMem->cb] = '\0';
- }
- return cbAll;
+ curl_global_cleanup();
}
-static DECLCALLBACK(int) rtHttpProgress(void *pData, double DlTotal, double DlNow,
- double UlTotal, double UlNow)
-{
- PRTHTTPINTERNAL pHttpInt = (PRTHTTPINTERNAL)pData;
- AssertReturn(pHttpInt->u32Magic == RTHTTP_MAGIC, 1);
-
- return pHttpInt->fAbort ? 1 : 0;
-}
RTR3DECL(int) RTHttpAbort(RTHTTP hHttp)
{
- PRTHTTPINTERNAL pHttpInt = hHttp;
- RTHTTP_VALID_RETURN(pHttpInt);
+ PRTHTTPINTERNAL pThis = hHttp;
+ RTHTTP_VALID_RETURN(pThis);
- pHttpInt->fAbort = true;
+ pThis->fAbort = true;
return VINF_SUCCESS;
}
+
RTR3DECL(int) RTHttpGetRedirLocation(RTHTTP hHttp, char **ppszRedirLocation)
{
- PRTHTTPINTERNAL pHttpInt = hHttp;
- RTHTTP_VALID_RETURN(pHttpInt);
+ PRTHTTPINTERNAL pThis = hHttp;
+ RTHTTP_VALID_RETURN(pThis);
+ Assert(!pThis->fBusy);
- if (!pHttpInt->pszRedirLocation)
+ if (!pThis->pszRedirLocation)
return VERR_HTTP_NOT_FOUND;
- *ppszRedirLocation = RTStrDup(pHttpInt->pszRedirLocation);
- return VINF_SUCCESS;
+ return RTStrDupEx(ppszRedirLocation, pThis->pszRedirLocation);
}
+
RTR3DECL(int) RTHttpUseSystemProxySettings(RTHTTP hHttp)
{
- PRTHTTPINTERNAL pHttpInt = hHttp;
- RTHTTP_VALID_RETURN(pHttpInt);
+ PRTHTTPINTERNAL pThis = hHttp;
+ RTHTTP_VALID_RETURN(pThis);
/*
* Very limited right now, just enought to make it work for ourselves.
@@ -207,17 +244,17 @@ RTR3DECL(int) RTHttpUseSystemProxySettings(RTHTTP hHttp)
int rcCurl;
if (!strncmp(szProxy, RT_STR_TUPLE("http://")))
{
- rcCurl = curl_easy_setopt(pHttpInt->pCurl, CURLOPT_PROXY, &szProxy[sizeof("http://") - 1]);
- if (CURL_FAILED(rcCurl))
+ rcCurl = curl_easy_setopt(pThis->pCurl, CURLOPT_PROXY, &szProxy[sizeof("http://") - 1]);
+ if (CURL_FAILURE(rcCurl))
return VERR_INVALID_PARAMETER;
- rcCurl = curl_easy_setopt(pHttpInt->pCurl, CURLOPT_PROXYPORT, 80);
- if (CURL_FAILED(rcCurl))
+ rcCurl = curl_easy_setopt(pThis->pCurl, CURLOPT_PROXYPORT, 80);
+ if (CURL_FAILURE(rcCurl))
return VERR_INVALID_PARAMETER;
}
else
{
- rcCurl = curl_easy_setopt(pHttpInt->pCurl, CURLOPT_PROXY, &szProxy[sizeof("http://") - 1]);
- if (CURL_FAILED(rcCurl))
+ rcCurl = curl_easy_setopt(pThis->pCurl, CURLOPT_PROXY, &szProxy[sizeof("http://") - 1]);
+ if (CURL_FAILURE(rcCurl))
return VERR_INVALID_PARAMETER;
}
}
@@ -227,48 +264,50 @@ RTR3DECL(int) RTHttpUseSystemProxySettings(RTHTTP hHttp)
return rc;
}
+
RTR3DECL(int) RTHttpSetProxy(RTHTTP hHttp, const char *pcszProxy, uint32_t uPort,
const char *pcszProxyUser, const char *pcszProxyPwd)
{
- PRTHTTPINTERNAL pHttpInt = hHttp;
- RTHTTP_VALID_RETURN(pHttpInt);
+ PRTHTTPINTERNAL pThis = hHttp;
+ RTHTTP_VALID_RETURN(pThis);
AssertPtrReturn(pcszProxy, VERR_INVALID_PARAMETER);
- int rcCurl = curl_easy_setopt(pHttpInt->pCurl, CURLOPT_PROXY, pcszProxy);
- if (CURL_FAILED(rcCurl))
+ int rcCurl = curl_easy_setopt(pThis->pCurl, CURLOPT_PROXY, pcszProxy);
+ if (CURL_FAILURE(rcCurl))
return VERR_INVALID_PARAMETER;
if (uPort != 0)
{
- rcCurl = curl_easy_setopt(pHttpInt->pCurl, CURLOPT_PROXYPORT, (long)uPort);
- if (CURL_FAILED(rcCurl))
+ rcCurl = curl_easy_setopt(pThis->pCurl, CURLOPT_PROXYPORT, (long)uPort);
+ if (CURL_FAILURE(rcCurl))
return VERR_INVALID_PARAMETER;
}
if (pcszProxyUser && pcszProxyPwd)
{
- rcCurl = curl_easy_setopt(pHttpInt->pCurl, CURLOPT_PROXYUSERNAME, pcszProxyUser);
- if (CURL_FAILED(rcCurl))
+ rcCurl = curl_easy_setopt(pThis->pCurl, CURLOPT_PROXYUSERNAME, pcszProxyUser);
+ if (CURL_FAILURE(rcCurl))
return VERR_INVALID_PARAMETER;
- rcCurl = curl_easy_setopt(pHttpInt->pCurl, CURLOPT_PROXYPASSWORD, pcszProxyPwd);
- if (CURL_FAILED(rcCurl))
+ rcCurl = curl_easy_setopt(pThis->pCurl, CURLOPT_PROXYPASSWORD, pcszProxyPwd);
+ if (CURL_FAILURE(rcCurl))
return VERR_INVALID_PARAMETER;
}
return VINF_SUCCESS;
}
+
RTR3DECL(int) RTHttpSetHeaders(RTHTTP hHttp, size_t cHeaders, const char * const *papszHeaders)
{
- PRTHTTPINTERNAL pHttpInt = hHttp;
- RTHTTP_VALID_RETURN(pHttpInt);
+ PRTHTTPINTERNAL pThis = hHttp;
+ RTHTTP_VALID_RETURN(pThis);
if (!cHeaders)
{
- if (pHttpInt->pHeaders)
- curl_slist_free_all(pHttpInt->pHeaders);
- pHttpInt->pHeaders = 0;
+ if (pThis->pHeaders)
+ curl_slist_free_all(pThis->pHeaders);
+ pThis->pHeaders = 0;
return VINF_SUCCESS;
}
@@ -276,108 +315,188 @@ RTR3DECL(int) RTHttpSetHeaders(RTHTTP hHttp, size_t cHeaders, const char * const
for (size_t i = 0; i < cHeaders; i++)
pHeaders = curl_slist_append(pHeaders, papszHeaders[i]);
- pHttpInt->pHeaders = pHeaders;
- int rcCurl = curl_easy_setopt(pHttpInt->pCurl, CURLOPT_HTTPHEADER, pHeaders);
- if (CURL_FAILED(rcCurl))
+ pThis->pHeaders = pHeaders;
+ int rcCurl = curl_easy_setopt(pThis->pCurl, CURLOPT_HTTPHEADER, pHeaders);
+ if (CURL_FAILURE(rcCurl))
return VERR_INVALID_PARAMETER;
return VINF_SUCCESS;
}
-RTR3DECL(int) RTHttpCertDigest(RTHTTP hHttp, char *pcszCert, size_t cbCert,
- uint8_t **pabSha1, size_t *pcbSha1,
- uint8_t **pabSha512, size_t *pcbSha512)
-{
- int rc = VINF_SUCCESS;
- BIO *cert = BIO_new_mem_buf(pcszCert, (int)cbCert);
- if (cert)
+/**
+ * Set the CA file to NULL, deleting any temporary file if necessary.
+ *
+ * @param pThis The HTTP/HTTPS client instance.
+ */
+static void rtHttpUnsetCaFile(PRTHTTPINTERNAL pThis)
+{
+ if (pThis->pszCaFile)
{
- X509 *crt = NULL;
- if (PEM_read_bio_X509(cert, &crt, NULL, NULL))
+ if (pThis->fDeleteCaFile)
{
- unsigned cb;
- unsigned char md[EVP_MAX_MD_SIZE];
+ int rc2 = RTFileDelete(pThis->pszCaFile);
+ AssertMsg(RT_SUCCESS(rc2) || !RTFileExists(pThis->pszCaFile), ("rc=%Rrc '%s'\n", rc2, pThis->pszCaFile));
+ }
+ RTStrFree(pThis->pszCaFile);
+ pThis->pszCaFile = NULL;
+ }
+}
- int rc1 = X509_digest(crt, EVP_sha1(), md, &cb);
- if (rc1 > 0)
+
+RTR3DECL(int) RTHttpSetCAFile(RTHTTP hHttp, const char *pszCaFile)
+{
+ PRTHTTPINTERNAL pThis = hHttp;
+ RTHTTP_VALID_RETURN(pThis);
+
+ rtHttpUnsetCaFile(pThis);
+
+ pThis->fDeleteCaFile = false;
+ if (pszCaFile)
+ return RTStrDupEx(&pThis->pszCaFile, pszCaFile);
+ return VINF_SUCCESS;
+}
+
+
+RTR3DECL(int) RTHttpUseTemporaryCaFile(RTHTTP hHttp, PRTERRINFO pErrInfo)
+{
+ PRTHTTPINTERNAL pThis = hHttp;
+ RTHTTP_VALID_RETURN(pThis);
+
+ /*
+ * Create a temporary file.
+ */
+ int rc = VERR_NO_STR_MEMORY;
+ char *pszCaFile = RTStrAlloc(RTPATH_MAX);
+ if (pszCaFile)
+ {
+ RTFILE hFile;
+ rc = RTFileOpenTemp(&hFile, pszCaFile, RTPATH_MAX,
+ RTFILE_O_CREATE | RTFILE_O_WRITE | RTFILE_O_DENY_NONE | (0600 << RTFILE_O_CREATE_MODE_SHIFT));
+ if (RT_SUCCESS(rc))
+ {
+ /*
+ * Gather certificates into a temporary store and export them to the temporary file.
+ */
+ RTCRSTORE hStore;
+ rc = RTCrStoreCreateInMem(&hStore, 256);
+ if (RT_SUCCESS(rc))
{
- *pabSha1 = (uint8_t*)RTMemAlloc(cb);
- if (*pabSha1)
- {
- memcpy(*pabSha1, md, cb);
- *pcbSha1 = cb;
-
- rc1 = X509_digest(crt, EVP_sha512(), md, &cb);
- if (rc1 > 0)
- {
- *pabSha512 = (uint8_t*)RTMemAlloc(cb);
- if (*pabSha512)
- {
- memcpy(*pabSha512, md, cb);
- *pcbSha512 = cb;
- }
- else
- rc = VERR_NO_MEMORY;
- }
- else
- rc = VERR_HTTP_CACERT_WRONG_FORMAT;
-
- if (RT_FAILURE(rc))
- RTMemFree(*pabSha1);
- }
- else
- rc = VERR_NO_MEMORY;
+ rc = RTHttpGatherCaCertsInStore(hStore, 0 /*fFlags*/, pErrInfo);
+ if (RT_SUCCESS(rc))
+ /** @todo Consider adding an API for exporting to a RTFILE... */
+ rc = RTCrStoreCertExportAsPem(hStore, 0 /*fFlags*/, pszCaFile);
+ RTCrStoreRelease(hStore);
}
- else
- rc = VERR_HTTP_CACERT_WRONG_FORMAT;
- X509_free(crt);
+ RTFileClose(hFile);
+ if (RT_SUCCESS(rc))
+ {
+ /*
+ * Set the CA file for the instance.
+ */
+ rtHttpUnsetCaFile(pThis);
+
+ pThis->fDeleteCaFile = true;
+ pThis->pszCaFile = pszCaFile;
+ return VINF_SUCCESS;
+ }
+
+ int rc2 = RTFileDelete(pszCaFile);
+ AssertRC(rc2);
}
else
- rc = VERR_HTTP_CACERT_WRONG_FORMAT;
- BIO_free(cert);
- }
- else
- rc = VERR_INTERNAL_ERROR;
+ RTErrInfoAddF(pErrInfo, rc, "Error creating temorary file: %Rrc", rc);
+ RTStrFree(pszCaFile);
+ }
return rc;
}
-RTR3DECL(int) RTHttpSetCAFile(RTHTTP hHttp, const char *pcszCAFile)
+
+RTR3DECL(int) RTHttpGatherCaCertsInStore(RTCRSTORE hStore, uint32_t fFlags, PRTERRINFO pErrInfo)
{
- PRTHTTPINTERNAL pHttpInt = hHttp;
- RTHTTP_VALID_RETURN(pHttpInt);
+ uint32_t const cBefore = RTCrStoreCertCount(hStore);
+ AssertReturn(cBefore != UINT32_MAX, VERR_INVALID_HANDLE);
+
+ /*
+ * Add the user store, quitely ignoring any errors.
+ */
+ RTCRSTORE hSrcStore;
+ int rcUser = RTCrStoreCreateSnapshotById(&hSrcStore, RTCRSTOREID_USER_TRUSTED_CAS_AND_CERTIFICATES, pErrInfo);
+ if (RT_SUCCESS(rcUser))
+ {
+ rcUser = RTCrStoreCertAddFromStore(hStore, RTCRCERTCTX_F_ADD_IF_NOT_FOUND | RTCRCERTCTX_F_ADD_CONTINUE_ON_ERROR,
+ hSrcStore);
+ RTCrStoreRelease(hSrcStore);
+ }
- if (pHttpInt->pcszCAFile)
- RTStrFree(pHttpInt->pcszCAFile);
- pHttpInt->pcszCAFile = RTStrDup(pcszCAFile);
- if (!pHttpInt->pcszCAFile)
- return VERR_NO_MEMORY;
+ /*
+ * Ditto for the system store.
+ */
+ int rcSystem = RTCrStoreCreateSnapshotById(&hSrcStore, RTCRSTOREID_SYSTEM_TRUSTED_CAS_AND_CERTIFICATES, pErrInfo);
+ if (RT_SUCCESS(rcSystem))
+ {
+ rcSystem = RTCrStoreCertAddFromStore(hStore, RTCRCERTCTX_F_ADD_IF_NOT_FOUND | RTCRCERTCTX_F_ADD_CONTINUE_ON_ERROR,
+ hSrcStore);
+ RTCrStoreRelease(hSrcStore);
+ }
- return VINF_SUCCESS;
+ /*
+ * If the number of certificates increased, we consider it a success.
+ */
+ if (RTCrStoreCertCount(hStore) > cBefore)
+ {
+ if (RT_FAILURE(rcSystem))
+ return -rcSystem;
+ if (RT_FAILURE(rcUser))
+ return -rcUser;
+ return rcSystem != VINF_SUCCESS ? rcSystem : rcUser;
+ }
+
+ if (RT_FAILURE(rcSystem))
+ return rcSystem;
+ if (RT_FAILURE(rcUser))
+ return rcUser;
+ return VERR_NOT_FOUND;
+}
+
+
+RTR3DECL(int) RTHttpGatherCaCertsInFile(const char *pszCaFile, uint32_t fFlags, PRTERRINFO pErrInfo)
+{
+ RTCRSTORE hStore;
+ int rc = RTCrStoreCreateInMem(&hStore, 256);
+ if (RT_SUCCESS(rc))
+ {
+ rc = RTHttpGatherCaCertsInStore(hStore, fFlags, pErrInfo);
+ if (RT_SUCCESS(rc))
+ rc = RTCrStoreCertExportAsPem(hStore, 0 /*fFlags*/, pszCaFile);
+ RTCrStoreRelease(hStore);
+ }
+ return rc;
}
+
/**
* Figures out the IPRT status code for a GET.
*
* @returns IPRT status code.
- * @param pHttpInt HTTP instance.
- * @param rcCurl What curl returned.
+ * @param pThis The HTTP/HTTPS client instance.
+ * @param rcCurl What curl returned.
*/
-static int rtHttpGetCalcStatus(PRTHTTPINTERNAL pHttpInt, int rcCurl)
+static int rtHttpGetCalcStatus(PRTHTTPINTERNAL pThis, int rcCurl)
{
int rc = VERR_INTERNAL_ERROR;
- if (pHttpInt->pszRedirLocation)
+ if (pThis->pszRedirLocation)
{
- RTStrFree(pHttpInt->pszRedirLocation);
- pHttpInt->pszRedirLocation = NULL;
+ RTStrFree(pThis->pszRedirLocation);
+ pThis->pszRedirLocation = NULL;
}
if (rcCurl == CURLE_OK)
{
- curl_easy_getinfo(pHttpInt->pCurl, CURLINFO_RESPONSE_CODE, &pHttpInt->lLastResp);
- switch (pHttpInt->lLastResp)
+ curl_easy_getinfo(pThis->pCurl, CURLINFO_RESPONSE_CODE, &pThis->lLastResp);
+ switch (pThis->lLastResp)
{
case 200:
/* OK, request was fulfilled */
@@ -388,10 +507,10 @@ static int rtHttpGetCalcStatus(PRTHTTPINTERNAL pHttpInt, int rcCurl)
case 301:
{
const char *pszRedirect;
- curl_easy_getinfo(pHttpInt->pCurl, CURLINFO_REDIRECT_URL, &pszRedirect);
+ curl_easy_getinfo(pThis->pCurl, CURLINFO_REDIRECT_URL, &pszRedirect);
size_t cb = strlen(pszRedirect);
if (cb > 0 && cb < 2048)
- pHttpInt->pszRedirLocation = RTStrDup(pszRedirect);
+ pThis->pszRedirLocation = RTStrDup(pszRedirect);
rc = VERR_HTTP_REDIRECTED;
break;
}
@@ -436,6 +555,14 @@ static int rtHttpGetCalcStatus(PRTHTTPINTERNAL pHttpInt, int rcCurl)
/* forcefully aborted */
rc = VERR_HTTP_ABORTED;
break;
+ case CURLE_COULDNT_RESOLVE_PROXY:
+ rc = VERR_HTTP_PROXY_NOT_FOUND;
+ break;
+ case CURLE_WRITE_ERROR:
+ rc = RT_FAILURE_NP(pThis->rcOutput) ? pThis->rcOutput : VERR_WRITE_ERROR;
+ break;
+ //case CURLE_READ_ERROR
+
default:
break;
}
@@ -444,158 +571,328 @@ static int rtHttpGetCalcStatus(PRTHTTPINTERNAL pHttpInt, int rcCurl)
return rc;
}
-RTR3DECL(int) rtHttpGet(RTHTTP hHttp, const char *pcszUrl, uint8_t **ppvResponse, size_t *pcb)
+
+/**
+ * cURL callback for reporting progress, we use it for checking for abort.
+ */
+static int rtHttpProgress(void *pData, double rdTotalDownload, double rdDownloaded, double rdTotalUpload, double rdUploaded)
{
- PRTHTTPINTERNAL pHttpInt = hHttp;
- RTHTTP_VALID_RETURN(pHttpInt);
+ PRTHTTPINTERNAL pThis = (PRTHTTPINTERNAL)pData;
+ AssertReturn(pThis->u32Magic == RTHTTP_MAGIC, 1);
+
+ pThis->cbDownloadHint = (uint64_t)rdTotalDownload;
- pHttpInt->fAbort = false;
+ return pThis->fAbort ? 1 : 0;
+}
- int rcCurl = curl_easy_setopt(pHttpInt->pCurl, CURLOPT_URL, pcszUrl);
- if (CURL_FAILED(rcCurl))
+
+/**
+ * Whether we're likely to need SSL to handle the give URL.
+ *
+ * @returns true if we need, false if we probably don't.
+ * @param pszUrl The URL.
+ */
+static bool rtHttpNeedSsl(const char *pszUrl)
+{
+ return RTStrNICmp(pszUrl, RT_STR_TUPLE("https:")) == 0;
+}
+
+
+/**
+ * Applies recoded settings to the cURL instance before doing work.
+ *
+ * @returns IPRT status code.
+ * @param pThis The HTTP/HTTPS client instance.
+ * @param pszUrl The URL.
+ */
+static int rtHttpApplySettings(PRTHTTPINTERNAL pThis, const char *pszUrl)
+{
+ /*
+ * The URL.
+ */
+ int rcCurl = curl_easy_setopt(pThis->pCurl, CURLOPT_URL, pszUrl);
+ if (CURL_FAILURE(rcCurl))
return VERR_INVALID_PARAMETER;
-#if 0
- rcCurl = curl_easy_setopt(pHttpInt->pCurl, CURLOPT_VERBOSE, 1);
- if (CURL_FAILED(rcCurl))
+ /*
+ * Setup SSL. Can be a bit of work.
+ */
+ rcCurl = curl_easy_setopt(pThis->pCurl, CURLOPT_SSLVERSION, (long)CURL_SSLVERSION_TLSv1);
+ if (CURL_FAILURE(rcCurl))
return VERR_INVALID_PARAMETER;
-#endif
- const char *pcszCAFile = "/etc/ssl/certs/ca-certificates.crt";
- if (pHttpInt->pcszCAFile)
- pcszCAFile = pHttpInt->pcszCAFile;
- if (RTFileExists(pcszCAFile))
+ const char *pszCaFile = pThis->pszCaFile;
+ if ( !pszCaFile
+ && rtHttpNeedSsl(pszUrl))
+ {
+ int rc = RTHttpUseTemporaryCaFile(pThis, NULL);
+ if (RT_SUCCESS(rc))
+ pszCaFile = pThis->pszCaFile;
+ else
+ return rc; /* Non-portable alternative: pszCaFile = "/etc/ssl/certs/ca-certificates.crt"; */
+ }
+ if (pszCaFile)
{
- rcCurl = curl_easy_setopt(pHttpInt->pCurl, CURLOPT_CAINFO, pcszCAFile);
- if (CURL_FAILED(rcCurl))
+ rcCurl = curl_easy_setopt(pThis->pCurl, CURLOPT_CAINFO, pszCaFile);
+ if (CURL_FAILURE(rcCurl))
return VERR_INTERNAL_ERROR;
}
- RTHTTPMEMCHUNK chunk = { NULL, 0 };
- rcCurl = curl_easy_setopt(pHttpInt->pCurl, CURLOPT_WRITEFUNCTION, &rtHttpWriteData);
- if (CURL_FAILED(rcCurl))
- return VERR_INTERNAL_ERROR;
- rcCurl = curl_easy_setopt(pHttpInt->pCurl, CURLOPT_WRITEDATA, (void*)&chunk);
- if (CURL_FAILED(rcCurl))
- return VERR_INTERNAL_ERROR;
- rcCurl = curl_easy_setopt(pHttpInt->pCurl, CURLOPT_PROGRESSFUNCTION, &rtHttpProgress);
- if (CURL_FAILED(rcCurl))
+ /*
+ * Progress/abort.
+ */
+ rcCurl = curl_easy_setopt(pThis->pCurl, CURLOPT_PROGRESSFUNCTION, &rtHttpProgress);
+ if (CURL_FAILURE(rcCurl))
return VERR_INTERNAL_ERROR;
- rcCurl = curl_easy_setopt(pHttpInt->pCurl, CURLOPT_PROGRESSDATA, (void*)pHttpInt);
- if (CURL_FAILED(rcCurl))
+ rcCurl = curl_easy_setopt(pThis->pCurl, CURLOPT_PROGRESSDATA, (void *)pThis);
+ if (CURL_FAILURE(rcCurl))
return VERR_INTERNAL_ERROR;
- rcCurl = curl_easy_setopt(pHttpInt->pCurl, CURLOPT_NOPROGRESS, (long)0);
- if (CURL_FAILED(rcCurl))
+ rcCurl = curl_easy_setopt(pThis->pCurl, CURLOPT_NOPROGRESS, (long)0);
+ if (CURL_FAILURE(rcCurl))
return VERR_INTERNAL_ERROR;
- rcCurl = curl_easy_setopt(pHttpInt->pCurl, CURLOPT_SSLVERSION, (long)CURL_SSLVERSION_TLSv1);
- if (CURL_FAILED(rcCurl))
- return VERR_INVALID_PARAMETER;
- rcCurl = curl_easy_perform(pHttpInt->pCurl);
- int rc = rtHttpGetCalcStatus(pHttpInt, rcCurl);
- *ppvResponse = chunk.pu8Mem;
- *pcb = chunk.cb;
+ return VINF_SUCCESS;
+}
+
+
+/**
+ * cURL callback for writing data.
+ */
+static size_t rtHttpWriteData(void *pvBuf, size_t cbUnit, size_t cUnits, void *pvUser)
+{
+ PRTHTTPINTERNAL pThis = (PRTHTTPINTERNAL)pvUser;
+
+ /*
+ * Do max size and overflow checks.
+ */
+ size_t const cbToAppend = cbUnit * cUnits;
+ size_t const cbCurSize = pThis->Output.Mem.cb;
+ size_t const cbNewSize = cbCurSize + cbToAppend;
+ if ( cbToAppend < RTHTTP_MAX_MEM_DOWNLOAD_SIZE
+ && cbNewSize < RTHTTP_MAX_MEM_DOWNLOAD_SIZE)
+ {
+ if (cbNewSize + 1 <= pThis->Output.Mem.cbAllocated)
+ {
+ memcpy(&pThis->Output.Mem.pb[cbCurSize], pvBuf, cbToAppend);
+ pThis->Output.Mem.cb = cbNewSize;
+ pThis->Output.Mem.pb[cbNewSize] = '\0';
+ return cbToAppend;
+ }
+
+ /*
+ * We need to reallocate the output buffer.
+ */
+ /** @todo this could do with a better strategy wrt growth. */
+ size_t cbAlloc = RT_ALIGN_Z(cbNewSize + 1, 64);
+ if ( cbAlloc <= pThis->cbDownloadHint
+ && pThis->cbDownloadHint < RTHTTP_MAX_MEM_DOWNLOAD_SIZE)
+ cbAlloc = RT_ALIGN_Z(pThis->cbDownloadHint + 1, 64);
+
+ uint8_t *pbNew = (uint8_t *)RTMemRealloc(pThis->Output.Mem.pb, cbAlloc);
+ if (pbNew)
+ {
+ memcpy(&pbNew[cbCurSize], pvBuf, cbToAppend);
+ pbNew[cbNewSize] = '\0';
+
+ pThis->Output.Mem.cbAllocated = cbAlloc;
+ pThis->Output.Mem.pb = pbNew;
+ pThis->Output.Mem.cb = cbNewSize;
+ return cbToAppend;
+ }
+
+ pThis->rcOutput = VERR_NO_MEMORY;
+ }
+ else
+ pThis->rcOutput = VERR_TOO_MUCH_DATA;
+
+ /*
+ * Failure - abort.
+ */
+ RTMemFree(pThis->Output.Mem.pb);
+ pThis->Output.Mem.pb = NULL;
+ pThis->Output.Mem.cb = RTHTTP_MAX_MEM_DOWNLOAD_SIZE;
+ pThis->fAbort = true;
+ return 0;
+}
+
+/**
+ * Internal worker that performs a HTTP GET.
+ *
+ * @returns IPRT status code.
+ * @param hHttp The HTTP/HTTPS client instance.
+ * @param pszUrl The URL.
+ * @param ppvResponse Where to return the pointer to the allocated
+ * response data (RTMemFree). There will always be
+ * an zero terminator char after the response, that
+ * is not part of the size returned via @a pcb.
+ * @param pcb The size of the response data.
+ *
+ * @remarks We ASSUME the API user doesn't do concurrent GETs in different
+ * threads, because that will probably blow up!
+ */
+static int rtHttpGetToMem(RTHTTP hHttp, const char *pszUrl, uint8_t **ppvResponse, size_t *pcb)
+{
+ PRTHTTPINTERNAL pThis = hHttp;
+ RTHTTP_VALID_RETURN(pThis);
+
+ /*
+ * Reset the return values in case of more "GUI programming" on the client
+ * side (i.e. a programming style not bothering checking return codes).
+ */
+ *ppvResponse = NULL;
+ *pcb = 0;
+
+ /*
+ * Set the busy flag (paranoia).
+ */
+ bool fBusy = ASMAtomicXchgBool(&pThis->fBusy, true);
+ AssertReturn(!fBusy, VERR_WRONG_ORDER);
+
+ /*
+ * Reset the state and apply settings.
+ */
+ pThis->fAbort = false;
+ pThis->rcOutput = VINF_SUCCESS;
+ pThis->cbDownloadHint = 0;
+
+ int rc = rtHttpApplySettings(hHttp, pszUrl);
+ if (RT_SUCCESS(rc))
+ {
+ RT_ZERO(pThis->Output.Mem);
+ int rcCurl = curl_easy_setopt(pThis->pCurl, CURLOPT_WRITEFUNCTION, &rtHttpWriteData);
+ if (!CURL_FAILURE(rcCurl))
+ rcCurl = curl_easy_setopt(pThis->pCurl, CURLOPT_WRITEDATA, (void *)pThis);
+ if (!CURL_FAILURE(rcCurl))
+ {
+ /*
+ * Perform the HTTP operation.
+ */
+ rcCurl = curl_easy_perform(pThis->pCurl);
+ rc = rtHttpGetCalcStatus(pThis, rcCurl);
+ if (RT_SUCCESS(rc))
+ rc = pThis->rcOutput;
+ if (RT_SUCCESS(rc))
+ {
+ *ppvResponse = pThis->Output.Mem.pb;
+ *pcb = pThis->Output.Mem.cb;
+ }
+ else if (pThis->Output.Mem.pb)
+ RTMemFree(pThis->Output.Mem.pb);
+ RT_ZERO(pThis->Output.Mem);
+ }
+ else
+ rc = VERR_INTERNAL_ERROR_3;
+ }
+
+ ASMAtomicWriteBool(&pThis->fBusy, false);
return rc;
}
-RTR3DECL(int) RTHttpGetText(RTHTTP hHttp, const char *pcszUrl, char **ppszResponse)
+RTR3DECL(int) RTHttpGetText(RTHTTP hHttp, const char *pszUrl, char **ppszNotUtf8)
{
uint8_t *pv;
- size_t cb;
- int rc = rtHttpGet(hHttp, pcszUrl, &pv, &cb);
- *ppszResponse = (char*)pv;
+ size_t cb;
+ int rc = rtHttpGetToMem(hHttp, pszUrl, &pv, &cb);
+ if (RT_SUCCESS(rc))
+ {
+ if (pv) /* paranoia */
+ *ppszNotUtf8 = (char *)pv;
+ else
+ *ppszNotUtf8 = (char *)RTMemDup("", 1);
+ }
+ else
+ *ppszNotUtf8 = NULL;
return rc;
}
-RTR3DECL(int) RTHttpGetBinary(RTHTTP hHttp, const char *pcszUrl, void **ppvResponse, size_t *pcb)
+RTR3DECL(void) RTHttpFreeResponseText(char *pszNotUtf8)
{
- return rtHttpGet(hHttp, pcszUrl, (uint8_t**)ppvResponse, pcb);
+ RTMemFree(pszNotUtf8);
}
-static size_t rtHttpWriteDataToFile(void *pvBuf, size_t cb, size_t n, void *pvUser)
+RTR3DECL(int) RTHttpGetBinary(RTHTTP hHttp, const char *pszUrl, void **ppvResponse, size_t *pcb)
{
- size_t cbAll = cb * n;
- RTFILE hFile = (RTFILE)(intptr_t)pvUser;
+ return rtHttpGetToMem(hHttp, pszUrl, (uint8_t **)ppvResponse, pcb);
+}
+
+RTR3DECL(void) RTHttpFreeResponse(void *pvResponse)
+{
+ RTMemFree(pvResponse);
+}
+
+
+/**
+ * cURL callback for writing data to a file.
+ */
+static size_t rtHttpWriteDataToFile(void *pvBuf, size_t cbUnit, size_t cUnits, void *pvUser)
+{
+ PRTHTTPINTERNAL pThis = (PRTHTTPINTERNAL)pvUser;
size_t cbWritten = 0;
- int rc = RTFileWrite(hFile, pvBuf, cbAll, &cbWritten);
+ int rc = RTFileWrite(pThis->Output.hFile, pvBuf, cbUnit * cUnits, &cbWritten);
if (RT_SUCCESS(rc))
return cbWritten;
+ pThis->rcOutput = rc;
return 0;
}
RTR3DECL(int) RTHttpGetFile(RTHTTP hHttp, const char *pszUrl, const char *pszDstFile)
{
- PRTHTTPINTERNAL pHttpInt = hHttp;
- RTHTTP_VALID_RETURN(pHttpInt);
+ PRTHTTPINTERNAL pThis = hHttp;
+ RTHTTP_VALID_RETURN(pThis);
/*
- * Set up the request.
+ * Set the busy flag (paranoia).
*/
- pHttpInt->fAbort = false;
-
- int rcCurl = curl_easy_setopt(pHttpInt->pCurl, CURLOPT_URL, pszUrl);
- if (CURL_FAILED(rcCurl))
- return VERR_INVALID_PARAMETER;
-
-#if 0
- rcCurl = curl_easy_setopt(pHttpInt->pCurl, CURLOPT_VERBOSE, 1);
- if (CURL_FAILED(rcCurl))
- return VERR_INVALID_PARAMETER;
-#endif
-
- const char *pcszCAFile = "/etc/ssl/certs/ca-certificates.crt";
- if (pHttpInt->pcszCAFile)
- pcszCAFile = pHttpInt->pcszCAFile;
- if (RTFileExists(pcszCAFile))
- {
- rcCurl = curl_easy_setopt(pHttpInt->pCurl, CURLOPT_CAINFO, pcszCAFile);
- if (CURL_FAILED(rcCurl))
- return VERR_INTERNAL_ERROR;
- }
-
- rcCurl = curl_easy_setopt(pHttpInt->pCurl, CURLOPT_WRITEFUNCTION, &rtHttpWriteDataToFile);
- if (CURL_FAILED(rcCurl))
- return VERR_INTERNAL_ERROR;
- rcCurl = curl_easy_setopt(pHttpInt->pCurl, CURLOPT_PROGRESSFUNCTION, &rtHttpProgress);
- if (CURL_FAILED(rcCurl))
- return VERR_INTERNAL_ERROR;
- rcCurl = curl_easy_setopt(pHttpInt->pCurl, CURLOPT_PROGRESSDATA, (void*)pHttpInt);
- if (CURL_FAILED(rcCurl))
- return VERR_INTERNAL_ERROR;
- rcCurl = curl_easy_setopt(pHttpInt->pCurl, CURLOPT_NOPROGRESS, (long)0);
- if (CURL_FAILED(rcCurl))
- return VERR_INTERNAL_ERROR;
+ bool fBusy = ASMAtomicXchgBool(&pThis->fBusy, true);
+ AssertReturn(!fBusy, VERR_WRONG_ORDER);
/*
- * Open the output file.
+ * Reset the state and apply settings.
*/
- RTFILE hFile;
- int rc = RTFileOpen(&hFile, pszDstFile, RTFILE_O_WRITE | RTFILE_O_CREATE_REPLACE | RTFILE_O_DENY_READWRITE);
+ pThis->fAbort = false;
+ pThis->rcOutput = VINF_SUCCESS;
+ pThis->cbDownloadHint = 0;
+
+ int rc = rtHttpApplySettings(hHttp, pszUrl);
if (RT_SUCCESS(rc))
{
- rcCurl = curl_easy_setopt(pHttpInt->pCurl, CURLOPT_WRITEDATA, (void *)(uintptr_t)hFile);
- if (!CURL_FAILED(rcCurl))
+ pThis->Output.hFile = NIL_RTFILE;
+ int rcCurl = curl_easy_setopt(pThis->pCurl, CURLOPT_WRITEFUNCTION, &rtHttpWriteDataToFile);
+ if (!CURL_FAILURE(rcCurl))
+ rcCurl = curl_easy_setopt(pThis->pCurl, CURLOPT_WRITEDATA, (void *)pThis);
+ if (!CURL_FAILURE(rcCurl))
{
/*
- * Perform the request.
+ * Open the output file.
*/
- rcCurl = curl_easy_perform(pHttpInt->pCurl);
- rc = rtHttpGetCalcStatus(pHttpInt, rcCurl);
+ rc = RTFileOpen(&pThis->Output.hFile, pszDstFile, RTFILE_O_CREATE_REPLACE | RTFILE_O_WRITE | RTFILE_O_DENY_READWRITE);
+ if (RT_SUCCESS(rc))
+ {
+ /*
+ * Perform the HTTP operation.
+ */
+ rcCurl = curl_easy_perform(pThis->pCurl);
+ rc = rtHttpGetCalcStatus(pThis, rcCurl);
+ if (RT_SUCCESS(rc))
+ rc = pThis->rcOutput;
+
+ int rc2 = RTFileClose(pThis->Output.hFile);
+ if (RT_FAILURE(rc2) && RT_SUCCESS(rc))
+ rc = rc2;
+ }
+ pThis->Output.hFile = NIL_RTFILE;
}
else
- rc = VERR_INTERNAL_ERROR;
-
- int rc2 = RTFileClose(hFile);
- if (RT_FAILURE(rc2) && RT_SUCCESS(rc))
- rc = rc2;
+ rc = VERR_INTERNAL_ERROR_3;
}
+ ASMAtomicWriteBool(&pThis->fBusy, false);
return rc;
}
diff --git a/src/VBox/Runtime/common/misc/lockvalidator.cpp b/src/VBox/Runtime/common/misc/lockvalidator.cpp
index 4ddc88f..8c36cba 100644
--- a/src/VBox/Runtime/common/misc/lockvalidator.cpp
+++ b/src/VBox/Runtime/common/misc/lockvalidator.cpp
@@ -24,9 +24,10 @@
* terms and conditions of either the GPL or the CDDL or both.
*/
-/*******************************************************************************
-* Header Files *
-*******************************************************************************/
+
+/*********************************************************************************************************************************
+* Header Files *
+*********************************************************************************************************************************/
#include <iprt/lockvalidator.h>
#include "internal/iprt.h"
@@ -46,9 +47,9 @@
#include "internal/thread.h"
-/*******************************************************************************
-* Defined Constants And Macros *
-*******************************************************************************/
+/*********************************************************************************************************************************
+* Defined Constants And Macros *
+*********************************************************************************************************************************/
/** Macro that asserts that a pointer is aligned correctly.
* Only used when fighting bugs. */
#if 1
@@ -93,9 +94,9 @@
#endif
-/*******************************************************************************
-* Structures and Typedefs *
-*******************************************************************************/
+/*********************************************************************************************************************************
+* Structures and Typedefs *
+*********************************************************************************************************************************/
/**
* Deadlock detection stack entry.
*/
@@ -225,9 +226,9 @@ AssertCompileSize(AVLLU32NODECORE, ARCH_BITS == 32 ? 20 : 32);
AssertCompileMemberOffset(RTLOCKVALCLASSINT, PriorLocks, 64);
-/*******************************************************************************
-* Global Variables *
-*******************************************************************************/
+/*********************************************************************************************************************************
+* Global Variables *
+*********************************************************************************************************************************/
/** Serializing object destruction and deadlock detection.
*
* This makes sure that none of the memory examined by the deadlock detection
@@ -264,9 +265,9 @@ static bool volatile g_fLockValidatorMayPanic = false;
static bool volatile g_fLockValSoftWrongOrder = false;
-/*******************************************************************************
-* Internal Functions *
-*******************************************************************************/
+/*********************************************************************************************************************************
+* Internal Functions *
+*********************************************************************************************************************************/
static void rtLockValidatorClassDestroy(RTLOCKVALCLASSINT *pClass);
static uint32_t rtLockValidatorStackDepth(PRTTHREADINT pThread);
diff --git a/src/VBox/Runtime/common/misc/message.cpp b/src/VBox/Runtime/common/misc/message.cpp
index 0b5fb93..4b821dc 100644
--- a/src/VBox/Runtime/common/misc/message.cpp
+++ b/src/VBox/Runtime/common/misc/message.cpp
@@ -24,9 +24,10 @@
* terms and conditions of either the GPL or the CDDL or both.
*/
-/*******************************************************************************
-* Header Files *
-*******************************************************************************/
+
+/*********************************************************************************************************************************
+* Header Files *
+*********************************************************************************************************************************/
#include "internal/iprt.h"
#include <iprt/message.h>
@@ -36,9 +37,9 @@
#include "internal/process.h"
-/*******************************************************************************
-* Global Variables *
-*******************************************************************************/
+/*********************************************************************************************************************************
+* Global Variables *
+*********************************************************************************************************************************/
/** The program name we're using. */
static const char * volatile g_pszProgName = NULL;
/** Custom program name set via RTMsgSetProgName. */
diff --git a/src/VBox/Runtime/common/misc/once.cpp b/src/VBox/Runtime/common/misc/once.cpp
index cb7d3c9..59f0c84 100644
--- a/src/VBox/Runtime/common/misc/once.cpp
+++ b/src/VBox/Runtime/common/misc/once.cpp
@@ -25,9 +25,9 @@
*/
-/*******************************************************************************
-* Header Files *
-*******************************************************************************/
+/*********************************************************************************************************************************
+* Header Files *
+*********************************************************************************************************************************/
#include <iprt/once.h>
#include "internal/iprt.h"
@@ -48,9 +48,9 @@
#include <iprt/thread.h>
-/*******************************************************************************
-* Global Variables *
-*******************************************************************************/
+/*********************************************************************************************************************************
+* Global Variables *
+*********************************************************************************************************************************/
#ifndef RTONCE_NO_TERM
/** For initializing the clean-up list code. */
static RTONCE g_OnceCleanUp = RTONCE_INITIALIZER;
diff --git a/src/VBox/Runtime/common/misc/req.cpp b/src/VBox/Runtime/common/misc/req.cpp
index 8ed4c45..bc33372 100644
--- a/src/VBox/Runtime/common/misc/req.cpp
+++ b/src/VBox/Runtime/common/misc/req.cpp
@@ -25,9 +25,9 @@
*/
-/*******************************************************************************
-* Header Files *
-*******************************************************************************/
+/*********************************************************************************************************************************
+* Header Files *
+*********************************************************************************************************************************/
#include <iprt/req.h>
#include "internal/iprt.h"
@@ -44,9 +44,9 @@
#include "internal/magics.h"
-/*******************************************************************************
-* Internal Functions *
-*******************************************************************************/
+/*********************************************************************************************************************************
+* Internal Functions *
+*********************************************************************************************************************************/
/**
diff --git a/src/VBox/Runtime/common/misc/reqpool.cpp b/src/VBox/Runtime/common/misc/reqpool.cpp
index 80a0d84..e72e797 100644
--- a/src/VBox/Runtime/common/misc/reqpool.cpp
+++ b/src/VBox/Runtime/common/misc/reqpool.cpp
@@ -25,9 +25,9 @@
*/
-/*******************************************************************************
-* Header Files *
-*******************************************************************************/
+/*********************************************************************************************************************************
+* Header Files *
+*********************************************************************************************************************************/
#include <iprt/req.h>
#include "internal/iprt.h"
@@ -46,9 +46,9 @@
#include "internal/magics.h"
-/*******************************************************************************
-* Defined Constants And Macros *
-*******************************************************************************/
+/*********************************************************************************************************************************
+* Defined Constants And Macros *
+*********************************************************************************************************************************/
/** The max number of worker threads. */
#define RTREQPOOL_MAX_THREADS UINT32_C(16384)
/** The max number of milliseconds to push back. */
@@ -57,9 +57,9 @@
#define RTREQPOOL_MAX_FREE_REQUESTS (RTREQPOOL_MAX_THREADS * 2U)
-/*******************************************************************************
-* Structures and Typedefs *
-*******************************************************************************/
+/*********************************************************************************************************************************
+* Structures and Typedefs *
+*********************************************************************************************************************************/
typedef struct RTREQPOOLTHREAD
{
/** Node in the RTREQPOOLINT::IdleThreads list. */
diff --git a/src/VBox/Runtime/common/misc/reqqueue.cpp b/src/VBox/Runtime/common/misc/reqqueue.cpp
index 05846e3..d553151 100644
--- a/src/VBox/Runtime/common/misc/reqqueue.cpp
+++ b/src/VBox/Runtime/common/misc/reqqueue.cpp
@@ -25,9 +25,9 @@
*/
-/*******************************************************************************
-* Header Files *
-*******************************************************************************/
+/*********************************************************************************************************************************
+* Header Files *
+*********************************************************************************************************************************/
#include <iprt/req.h>
#include "internal/iprt.h"
diff --git a/src/VBox/Runtime/common/misc/s3.cpp b/src/VBox/Runtime/common/misc/s3.cpp
index 52d60cd..32b93a0 100644
--- a/src/VBox/Runtime/common/misc/s3.cpp
+++ b/src/VBox/Runtime/common/misc/s3.cpp
@@ -25,9 +25,9 @@
*/
-/*******************************************************************************
-* Header Files *
-*******************************************************************************/
+/*********************************************************************************************************************************
+* Header Files *
+*********************************************************************************************************************************/
#include <iprt/s3.h>
#include "internal/iprt.h"
@@ -45,9 +45,9 @@
#include "internal/magics.h"
-/*******************************************************************************
-* Structures and Typedefs *
-*******************************************************************************/
+/*********************************************************************************************************************************
+* Structures and Typedefs *
+*********************************************************************************************************************************/
typedef struct RTS3INTERNAL
{
uint32_t u32Magic;
@@ -72,9 +72,9 @@ typedef struct RTS3TMPMEMCHUNK
typedef RTS3TMPMEMCHUNK *PRTS3TMPMEMCHUNK;
-/*******************************************************************************
-* Defined Constants And Macros *
-*******************************************************************************/
+/*********************************************************************************************************************************
+* Defined Constants And Macros *
+*********************************************************************************************************************************/
/** Validates a handle and returns VERR_INVALID_HANDLE if not valid. */
#define RTS3_VALID_RETURN_RC(hS3, rc) \
@@ -94,9 +94,9 @@ typedef RTS3TMPMEMCHUNK *PRTS3TMPMEMCHUNK;
} while (0)
-/*******************************************************************************
-* Private RTS3 helper *
-*******************************************************************************/
+/*********************************************************************************************************************************
+* Private RTS3 helper *
+*********************************************************************************************************************************/
static char* rtS3Host(const char* pszBucket, const char* pszKey, const char* pszBaseUrl)
{
@@ -365,9 +365,10 @@ static void rtS3ReinitCurl(PRTS3INTERNAL pS3Int)
}
}
-/*******************************************************************************
-* Private XML helper *
-*******************************************************************************/
+
+/*********************************************************************************************************************************
+* Private XML helper *
+*********************************************************************************************************************************/
static xmlNodePtr rtS3FindNode(xmlNodePtr pNode, const char *pszName)
{
@@ -496,9 +497,10 @@ static void rtS3ExtractAllKeys(xmlDocPtr pDoc, xmlNodePtr pNode, PCRTS3KEYENTRY
}
}
-/*******************************************************************************
-* Public RTS3 interface *
-*******************************************************************************/
+
+/*********************************************************************************************************************************
+* Public RTS3 interface *
+*********************************************************************************************************************************/
RTR3DECL(int) RTS3Create(PRTS3 ppS3, const char* pszAccessKey, const char* pszSecretKey, const char* pszBaseUrl, const char* pszUserAgent /* = NULL */)
{
diff --git a/src/VBox/Runtime/common/misc/semspingpong.cpp b/src/VBox/Runtime/common/misc/semspingpong.cpp
index bd5e04c..c065809 100644
--- a/src/VBox/Runtime/common/misc/semspingpong.cpp
+++ b/src/VBox/Runtime/common/misc/semspingpong.cpp
@@ -25,9 +25,9 @@
*/
-/*******************************************************************************
-* Header Files *
-*******************************************************************************/
+/*********************************************************************************************************************************
+* Header Files *
+*********************************************************************************************************************************/
#include <iprt/semaphore.h>
#include "internal/iprt.h"
@@ -37,9 +37,9 @@
#include <iprt/err.h>
-/*******************************************************************************
-* Defined Constants And Macros *
-*******************************************************************************/
+/*********************************************************************************************************************************
+* Defined Constants And Macros *
+*********************************************************************************************************************************/
/**
* Validation macro returns if invalid parameter.
*
diff --git a/src/VBox/Runtime/common/misc/sg.cpp b/src/VBox/Runtime/common/misc/sg.cpp
index 6344114..a257459 100644
--- a/src/VBox/Runtime/common/misc/sg.cpp
+++ b/src/VBox/Runtime/common/misc/sg.cpp
@@ -25,9 +25,9 @@
*/
-/*******************************************************************************
-* Header Files *
-*******************************************************************************/
+/*********************************************************************************************************************************
+* Header Files *
+*********************************************************************************************************************************/
#include <iprt/sg.h>
#include <iprt/string.h>
#include <iprt/assert.h>
diff --git a/src/VBox/Runtime/common/misc/term.cpp b/src/VBox/Runtime/common/misc/term.cpp
index 7964425..a9281fa 100644
--- a/src/VBox/Runtime/common/misc/term.cpp
+++ b/src/VBox/Runtime/common/misc/term.cpp
@@ -24,9 +24,10 @@
* terms and conditions of either the GPL or the CDDL or both.
*/
-/*******************************************************************************
-* Header Files *
-*******************************************************************************/
+
+/*********************************************************************************************************************************
+* Header Files *
+*********************************************************************************************************************************/
#include <iprt/initterm.h>
#include "internal/iprt.h"
@@ -39,9 +40,9 @@
#include <iprt/thread.h>
-/*******************************************************************************
-* Structures and Typedefs *
-*******************************************************************************/
+/*********************************************************************************************************************************
+* Structures and Typedefs *
+*********************************************************************************************************************************/
/** Pointer to a termination callback record. */
typedef struct RTTERMCALLBACKREC *PRTTERMCALLBACKREC;
/**
@@ -58,9 +59,9 @@ typedef struct RTTERMCALLBACKREC
} RTTERMCALLBACKREC;
-/*******************************************************************************
-* Global Variables *
-*******************************************************************************/
+/*********************************************************************************************************************************
+* Global Variables *
+*********************************************************************************************************************************/
/** Execute once construct protecting lazy callback initialization. */
static RTONCE g_InitTermCallbacksOnce = RTONCE_INITIALIZER;
/** Mutex protecting the callback globals. */
diff --git a/src/VBox/Runtime/common/misc/thread.cpp b/src/VBox/Runtime/common/misc/thread.cpp
index df331f8..0e8a212 100644
--- a/src/VBox/Runtime/common/misc/thread.cpp
+++ b/src/VBox/Runtime/common/misc/thread.cpp
@@ -25,9 +25,9 @@
*/
-/*******************************************************************************
-* Header Files *
-*******************************************************************************/
+/*********************************************************************************************************************************
+* Header Files *
+*********************************************************************************************************************************/
#define LOG_GROUP RTLOGGROUP_THREAD
#include <iprt/thread.h>
#include "internal/iprt.h"
@@ -53,9 +53,9 @@
#endif
-/*******************************************************************************
-* Defined Constants And Macros *
-*******************************************************************************/
+/*********************************************************************************************************************************
+* Defined Constants And Macros *
+*********************************************************************************************************************************/
#ifdef IN_RING0
# define RT_THREAD_LOCK_RW() RTSpinlockAcquire(g_ThreadSpinlock)
# define RT_THREAD_UNLOCK_RW() RTSpinlockRelease(g_ThreadSpinlock)
@@ -69,9 +69,9 @@
#endif
-/*******************************************************************************
-* Global Variables *
-*******************************************************************************/
+/*********************************************************************************************************************************
+* Global Variables *
+*********************************************************************************************************************************/
/** The AVL thread containing the threads. */
static PAVLPVNODECORE g_ThreadTree;
/** The number of threads in the tree (for ring-0 termination kludge). */
@@ -87,9 +87,9 @@ static RTSPINLOCK g_ThreadSpinlock = NIL_RTSPINLOCK;
static bool g_frtThreadInitialized;
-/*******************************************************************************
-* Internal Functions *
-*******************************************************************************/
+/*********************************************************************************************************************************
+* Internal Functions *
+*********************************************************************************************************************************/
static void rtThreadDestroy(PRTTHREADINT pThread);
#ifdef IN_RING3
static int rtThreadAdopt(RTTHREADTYPE enmType, unsigned fFlags, uint32_t fIntFlags, const char *pszName);
diff --git a/src/VBox/Runtime/common/misc/uri.cpp b/src/VBox/Runtime/common/misc/uri.cpp
index 43b1097..6bc8b05 100644
--- a/src/VBox/Runtime/common/misc/uri.cpp
+++ b/src/VBox/Runtime/common/misc/uri.cpp
@@ -25,9 +25,9 @@
*/
-/*******************************************************************************
-* Header Files *
-*******************************************************************************/
+/*********************************************************************************************************************************
+* Header Files *
+*********************************************************************************************************************************/
#include <iprt/uri.h>
#include <iprt/string.h>
@@ -47,9 +47,9 @@
*/
-/*******************************************************************************
-* Private RTUri helper *
-*******************************************************************************/
+/*********************************************************************************************************************************
+* Private RTUri helper *
+*********************************************************************************************************************************/
/* The following defines characters which have to be % escaped:
control = 00-1F
@@ -290,13 +290,15 @@ static bool rtUriCheckFragmentStart(const char *pszUri, size_t iStart, size_t cb
return false;
}
-/*******************************************************************************
-* Public RTUri interface *
-*******************************************************************************/
-/*******************************************************************************
-* Generic Uri methods *
-*******************************************************************************/
+/*********************************************************************************************************************************
+* Public RTUri interface *
+*********************************************************************************************************************************/
+
+
+/*********************************************************************************************************************************
+* Generic Uri methods *
+*********************************************************************************************************************************/
RTR3DECL(char *) RTUriCreate(const char *pszScheme, const char *pszAuthority, const char *pszPath, const char *pszQuery, const char *pszFragment)
{
@@ -577,9 +579,10 @@ RTR3DECL(char *) RTUriFragment(const char *pszUri)
return NULL;
}
-/*******************************************************************************
-* File Uri methods *
-*******************************************************************************/
+
+/*********************************************************************************************************************************
+* File Uri methods *
+*********************************************************************************************************************************/
RTR3DECL(char *) RTUriFileCreate(const char *pszPath)
{
diff --git a/src/VBox/Runtime/common/net/macstr.cpp b/src/VBox/Runtime/common/net/macstr.cpp
index 34e506d..3447db2 100644
--- a/src/VBox/Runtime/common/net/macstr.cpp
+++ b/src/VBox/Runtime/common/net/macstr.cpp
@@ -24,9 +24,10 @@
* terms and conditions of either the GPL or the CDDL or both.
*/
-/*******************************************************************************
-* Header Files *
-*******************************************************************************/
+
+/*********************************************************************************************************************************
+* Header Files *
+*********************************************************************************************************************************/
#include <iprt/cidr.h>
#include <iprt/net.h> /* must come before getopt.h */
#include "internal/iprt.h"
diff --git a/src/VBox/Runtime/common/net/netaddrstr.cpp b/src/VBox/Runtime/common/net/netaddrstr.cpp
index 8b7f195..3b13518 100644
--- a/src/VBox/Runtime/common/net/netaddrstr.cpp
+++ b/src/VBox/Runtime/common/net/netaddrstr.cpp
@@ -31,9 +31,9 @@
*/
-/*******************************************************************************
-* Header Files *
-*******************************************************************************/
+/*********************************************************************************************************************************
+* Header Files *
+*********************************************************************************************************************************/
#include "internal/iprt.h"
#include <iprt/net.h>
diff --git a/src/VBox/Runtime/common/net/netaddrstr2.cpp b/src/VBox/Runtime/common/net/netaddrstr2.cpp
index 1259b7d..9aa6aa7 100644
--- a/src/VBox/Runtime/common/net/netaddrstr2.cpp
+++ b/src/VBox/Runtime/common/net/netaddrstr2.cpp
@@ -24,9 +24,10 @@
* terms and conditions of either the GPL or the CDDL or both.
*/
-/*******************************************************************************
-* Header Files *
-*******************************************************************************/
+
+/*********************************************************************************************************************************
+* Header Files *
+*********************************************************************************************************************************/
#include "internal/iprt.h"
#include <iprt/net.h>
diff --git a/src/VBox/Runtime/common/path/RTPathAbsDup.cpp b/src/VBox/Runtime/common/path/RTPathAbsDup.cpp
index 9ad768d6..70a0581 100644
--- a/src/VBox/Runtime/common/path/RTPathAbsDup.cpp
+++ b/src/VBox/Runtime/common/path/RTPathAbsDup.cpp
@@ -25,9 +25,9 @@
*/
-/*******************************************************************************
-* Header Files *
-*******************************************************************************/
+/*********************************************************************************************************************************
+* Header Files *
+*********************************************************************************************************************************/
#include "internal/iprt.h"
#include <iprt/path.h>
#include <iprt/err.h>
diff --git a/src/VBox/Runtime/common/path/RTPathAbsEx.cpp b/src/VBox/Runtime/common/path/RTPathAbsEx.cpp
index 8ed1730..0f51c98 100644
--- a/src/VBox/Runtime/common/path/RTPathAbsEx.cpp
+++ b/src/VBox/Runtime/common/path/RTPathAbsEx.cpp
@@ -25,9 +25,9 @@
*/
-/*******************************************************************************
-* Header Files *
-*******************************************************************************/
+/*********************************************************************************************************************************
+* Header Files *
+*********************************************************************************************************************************/
#include "internal/iprt.h"
#include <iprt/path.h>
#include <iprt/err.h>
diff --git a/src/VBox/Runtime/common/path/RTPathAbsExDup.cpp b/src/VBox/Runtime/common/path/RTPathAbsExDup.cpp
index e0df52b..d4d9deb 100644
--- a/src/VBox/Runtime/common/path/RTPathAbsExDup.cpp
+++ b/src/VBox/Runtime/common/path/RTPathAbsExDup.cpp
@@ -25,9 +25,9 @@
*/
-/*******************************************************************************
-* Header Files *
-*******************************************************************************/
+/*********************************************************************************************************************************
+* Header Files *
+*********************************************************************************************************************************/
#include "internal/iprt.h"
#include <iprt/path.h>
#include <iprt/err.h>
diff --git a/src/VBox/Runtime/common/path/RTPathAppend.cpp b/src/VBox/Runtime/common/path/RTPathAppend.cpp
index c717571..182a624 100644
--- a/src/VBox/Runtime/common/path/RTPathAppend.cpp
+++ b/src/VBox/Runtime/common/path/RTPathAppend.cpp
@@ -25,9 +25,9 @@
*/
-/*******************************************************************************
-* Header Files *
-*******************************************************************************/
+/*********************************************************************************************************************************
+* Header Files *
+*********************************************************************************************************************************/
#include "internal/iprt.h"
#include <iprt/path.h>
diff --git a/src/VBox/Runtime/common/path/RTPathAppendEx.cpp b/src/VBox/Runtime/common/path/RTPathAppendEx.cpp
index 199c4f4..f4a4f64 100644
--- a/src/VBox/Runtime/common/path/RTPathAppendEx.cpp
+++ b/src/VBox/Runtime/common/path/RTPathAppendEx.cpp
@@ -25,9 +25,9 @@
*/
-/*******************************************************************************
-* Header Files *
-*******************************************************************************/
+/*********************************************************************************************************************************
+* Header Files *
+*********************************************************************************************************************************/
#include "internal/iprt.h"
#include <iprt/path.h>
diff --git a/src/VBox/Runtime/common/path/RTPathCalcRelative.cpp b/src/VBox/Runtime/common/path/RTPathCalcRelative.cpp
index 60088c0..fcd2956 100644
--- a/src/VBox/Runtime/common/path/RTPathCalcRelative.cpp
+++ b/src/VBox/Runtime/common/path/RTPathCalcRelative.cpp
@@ -25,9 +25,9 @@
*/
-/*******************************************************************************
-* Header Files *
-*******************************************************************************/
+/*********************************************************************************************************************************
+* Header Files *
+*********************************************************************************************************************************/
#include "internal/iprt.h"
#include <iprt/path.h>
#include <iprt/assert.h>
diff --git a/src/VBox/Runtime/common/path/RTPathChangeToDosSlashes.cpp b/src/VBox/Runtime/common/path/RTPathChangeToDosSlashes.cpp
index 6260953..4746557 100644
--- a/src/VBox/Runtime/common/path/RTPathChangeToDosSlashes.cpp
+++ b/src/VBox/Runtime/common/path/RTPathChangeToDosSlashes.cpp
@@ -25,9 +25,9 @@
*/
-/*******************************************************************************
-* Header Files *
-*******************************************************************************/
+/*********************************************************************************************************************************
+* Header Files *
+*********************************************************************************************************************************/
#include "internal/iprt.h"
#include <iprt/path.h>
diff --git a/src/VBox/Runtime/common/path/RTPathChangeToUnixSlashes.cpp b/src/VBox/Runtime/common/path/RTPathChangeToUnixSlashes.cpp
index 931b4ca..da08377 100644
--- a/src/VBox/Runtime/common/path/RTPathChangeToUnixSlashes.cpp
+++ b/src/VBox/Runtime/common/path/RTPathChangeToUnixSlashes.cpp
@@ -25,9 +25,9 @@
*/
-/*******************************************************************************
-* Header Files *
-*******************************************************************************/
+/*********************************************************************************************************************************
+* Header Files *
+*********************************************************************************************************************************/
#include "internal/iprt.h"
#include <iprt/path.h>
diff --git a/src/VBox/Runtime/common/path/RTPathCopyComponents.cpp b/src/VBox/Runtime/common/path/RTPathCopyComponents.cpp
index 9599fc7..a4090f7 100644
--- a/src/VBox/Runtime/common/path/RTPathCopyComponents.cpp
+++ b/src/VBox/Runtime/common/path/RTPathCopyComponents.cpp
@@ -25,9 +25,9 @@
*/
-/*******************************************************************************
-* Header Files *
-*******************************************************************************/
+/*********************************************************************************************************************************
+* Header Files *
+*********************************************************************************************************************************/
#include "internal/iprt.h"
#include <iprt/path.h>
diff --git a/src/VBox/Runtime/common/path/RTPathCountComponents.cpp b/src/VBox/Runtime/common/path/RTPathCountComponents.cpp
index 2d4f22f..a48378d 100644
--- a/src/VBox/Runtime/common/path/RTPathCountComponents.cpp
+++ b/src/VBox/Runtime/common/path/RTPathCountComponents.cpp
@@ -25,9 +25,9 @@
*/
-/*******************************************************************************
-* Header Files *
-*******************************************************************************/
+/*********************************************************************************************************************************
+* Header Files *
+*********************************************************************************************************************************/
#include "internal/iprt.h"
#include <iprt/path.h>
diff --git a/src/VBox/Runtime/common/path/RTPathStripTrailingSlash.cpp b/src/VBox/Runtime/common/path/RTPathEnsureTrailingSeparator.cpp
similarity index 61%
copy from src/VBox/Runtime/common/path/RTPathStripTrailingSlash.cpp
copy to src/VBox/Runtime/common/path/RTPathEnsureTrailingSeparator.cpp
index 8a560be..901afb4 100644
--- a/src/VBox/Runtime/common/path/RTPathStripTrailingSlash.cpp
+++ b/src/VBox/Runtime/common/path/RTPathEnsureTrailingSeparator.cpp
@@ -1,6 +1,6 @@
-/* $Id: RTPathStripTrailingSlash.cpp $ */
+/* $Id: RTPathEnsureTrailingSeparator.cpp $ */
/** @file
- * IPRT - RTPathSTripTrailingSlash
+ * IPRT - RTPathEnsureTrailingSeparator
*/
/*
@@ -25,9 +25,9 @@
*/
-/*******************************************************************************
-* Header Files *
-*******************************************************************************/
+/*********************************************************************************************************************************
+* Header Files *
+*********************************************************************************************************************************/
#include "internal/iprt.h"
#include <iprt/path.h>
#include <iprt/string.h>
@@ -35,30 +35,30 @@
-RTDECL(size_t) RTPathStripTrailingSlash(char *pszPath)
+RTDECL(size_t) RTPathEnsureTrailingSeparator(char *pszPath, size_t cbPath)
{
size_t off = strlen(pszPath);
- while (off > 1)
+ if (off > 0)
{
- off--;
- switch (pszPath[off])
+ char ch = pszPath[off - 1];
+ if (RTPATH_IS_SLASH(ch) || RTPATH_IS_VOLSEP(ch))
+ return off;
+ if (off + 2 <= cbPath)
{
- case '/':
-#if defined(RT_OS_WINDOWS) || defined(RT_OS_OS2)
- case '\\':
- if ( off == 2
- && pszPath[1] == ':'
- && RT_C_IS_ALPHA(pszPath[0]))
- return off + 1;
-#endif
- pszPath[off] = '\0';
- break;
-
- default:
- return off + 1;
+ pszPath[off++] = RTPATH_SLASH;
+ pszPath[off] = '\0';
+ return off;
}
}
+ else if (off + 3 <= cbPath)
+ {
+ pszPath[off++] = '.';
+ pszPath[off++] = RTPATH_SLASH;
+ pszPath[off] = '\0';
+ return off;
+ }
- return 1;
+ return 0;
}
+RT_EXPORT_SYMBOL(RTPathEnsureTrailingSeparator);
diff --git a/src/VBox/Runtime/common/path/RTPathExt.cpp b/src/VBox/Runtime/common/path/RTPathExt.cpp
index 5da48dd..8a51552 100644
--- a/src/VBox/Runtime/common/path/RTPathExt.cpp
+++ b/src/VBox/Runtime/common/path/RTPathExt.cpp
@@ -25,9 +25,9 @@
*/
-/*******************************************************************************
-* Header Files *
-*******************************************************************************/
+/*********************************************************************************************************************************
+* Header Files *
+*********************************************************************************************************************************/
#include "internal/iprt.h"
#include <iprt/path.h>
diff --git a/src/VBox/Runtime/common/path/RTPathFilename.cpp b/src/VBox/Runtime/common/path/RTPathFilename.cpp
index 3ef0450..c325800 100644
--- a/src/VBox/Runtime/common/path/RTPathFilename.cpp
+++ b/src/VBox/Runtime/common/path/RTPathFilename.cpp
@@ -25,9 +25,9 @@
*/
-/*******************************************************************************
-* Header Files *
-*******************************************************************************/
+/*********************************************************************************************************************************
+* Header Files *
+*********************************************************************************************************************************/
#include "internal/iprt.h"
#include <iprt/path.h>
diff --git a/src/VBox/Runtime/common/path/RTPathGlob.cpp b/src/VBox/Runtime/common/path/RTPathGlob.cpp
new file mode 100644
index 0000000..8e26b9f
--- /dev/null
+++ b/src/VBox/Runtime/common/path/RTPathGlob.cpp
@@ -0,0 +1,2140 @@
+/* $Id: RTPathGlob.cpp $ */
+/** @file
+ * IPRT - RTPathGlob
+ */
+
+/*
+ * Copyright (C) 2006-2015 Oracle Corporation
+ *
+ * This file is part of VirtualBox Open Source Edition (OSE), as
+ * available from http://www.virtualbox.org. This file is free software;
+ * you can redistribute it and/or modify it under the terms of the GNU
+ * General Public License (GPL) as published by the Free Software
+ * Foundation, in version 2 as it comes in the "COPYING" file of the
+ * VirtualBox OSE distribution. VirtualBox OSE is distributed in the
+ * hope that it will be useful, but WITHOUT ANY WARRANTY of any kind.
+ *
+ * The contents of this file may alternatively be used under the terms
+ * of the Common Development and Distribution License Version 1.0
+ * (CDDL) only, as it comes in the "COPYING.CDDL" file of the
+ * VirtualBox OSE distribution, in which case the provisions of the
+ * CDDL are applicable instead of those of the GPL.
+ *
+ * You may elect to license modified versions of this file under the
+ * terms and conditions of either the GPL or the CDDL or both.
+ */
+
+
+/*********************************************************************************************************************************
+* Header Files *
+*********************************************************************************************************************************/
+#include "internal/iprt.h"
+#include <iprt/path.h>
+
+#include <iprt/asm.h>
+#include <iprt/assert.h>
+#include <iprt/buildconfig.h>
+#include <iprt/ctype.h>
+#include <iprt/dir.h>
+#include <iprt/env.h>
+#include <iprt/err.h>
+#include <iprt/mem.h>
+#include <iprt/string.h>
+#include <iprt/uni.h>
+
+#if defined(RT_OS_WINDOWS)
+# include <Windows.h>
+
+#elif defined(RT_OS_OS2)
+# define INCL_BASE
+# include <os2.h>
+# undef RT_MAX /* collision */
+
+#endif
+
+
+/*********************************************************************************************************************************
+* Defined Constants And Macros *
+*********************************************************************************************************************************/
+/** Maximum number of results. */
+#define RTPATHGLOB_MAX_RESULTS _32K
+/** Maximum number of zero-or-more wildcards in a pattern.
+ * This limits stack usage and recursion depth, as well as execution time. */
+#define RTPATHMATCH_MAX_ZERO_OR_MORE 24
+/** Maximum number of variable items. */
+#define RTPATHMATCH_MAX_VAR_ITEMS _4K
+
+
+
+/*********************************************************************************************************************************
+* Structures and Typedefs *
+*********************************************************************************************************************************/
+/**
+ * Matching operation.
+ */
+typedef enum RTPATHMATCHOP
+{
+ RTPATHMATCHOP_INVALID = 0,
+ /** EOS: Returns a match if at end of string. */
+ RTPATHMATCHOP_RETURN_MATCH_IF_AT_END,
+ /** Asterisk: Returns a match (trailing asterisk). */
+ RTPATHMATCHOP_RETURN_MATCH,
+ /** Asterisk: Returns a match (just asterisk), unless it's '.' or '..'. */
+ RTPATHMATCHOP_RETURN_MATCH_EXCEPT_DOT_AND_DOTDOT,
+ /** Plain text: Case sensitive string compare. */
+ RTPATHMATCHOP_STRCMP,
+ /** Plain text: Case insensitive string compare. */
+ RTPATHMATCHOP_STRICMP,
+ /** Question marks: Skips exactly one code point. */
+ RTPATHMATCHOP_SKIP_ONE_CODEPOINT,
+ /** Question marks: Skips exactly RTPATHMATCHCORE::cch code points. */
+ RTPATHMATCHOP_SKIP_MULTIPLE_CODEPOINTS,
+ /** Char set: Requires the next codepoint to be in the ASCII-7 set defined by
+ * RTPATHMATCHCORE::pch & RTPATHMATCHCORE::cch. No ranges. */
+ RTPATHMATCHOP_CODEPOINT_IN_SET_ASCII7,
+ /** Char set: Requires the next codepoint to not be in the ASCII-7 set defined
+ * by RTPATHMATCHCORE::pch & RTPATHMATCHCORE::cch. No ranges. */
+ RTPATHMATCHOP_CODEPOINT_NOT_IN_SET_ASCII7,
+ /** Char set: Requires the next codepoint to be in the extended set defined by
+ * RTPATHMATCHCORE::pch & RTPATHMATCHCORE::cch. Ranges, UTF-8. */
+ RTPATHMATCHOP_CODEPOINT_IN_SET_EXTENDED,
+ /** Char set: Requires the next codepoint to not be in the extended set defined
+ * by RTPATHMATCHCORE::pch & RTPATHMATCHCORE::cch. Ranges, UTF-8. */
+ RTPATHMATCHOP_CODEPOINT_NOT_IN_SET_EXTENDED,
+ /** Variable: Case sensitive variable value compare, RTPATHMATCHCORE::uOp2 is
+ * the variable table index. */
+ RTPATHMATCHOP_VARIABLE_VALUE_CMP,
+ /** Variable: Case insensitive variable value compare, RTPATHMATCHCORE::uOp2 is
+ * the variable table index. */
+ RTPATHMATCHOP_VARIABLE_VALUE_ICMP,
+ /** Asterisk: Match zero or more code points, there must be at least
+ * RTPATHMATCHCORE::cch code points after it. */
+ RTPATHMATCHOP_ZERO_OR_MORE,
+ /** Asterisk: Match zero or more code points, there must be at least
+ * RTPATHMATCHCORE::cch code points after it, unless it's '.' or '..'. */
+ RTPATHMATCHOP_ZERO_OR_MORE_EXCEPT_DOT_AND_DOTDOT,
+ /** End of valid operations. */
+ RTPATHMATCHOP_END
+} RTPATHMATCHOP;
+
+/**
+ * Matching instruction.
+ */
+typedef struct RTPATHMATCHCORE
+{
+ /** The action to take. */
+ RTPATHMATCHOP enmOpCode;
+ /** Generic value operand. */
+ uint16_t uOp2;
+ /** Generic length operand. */
+ uint16_t cch;
+ /** Generic string pointer operand. */
+ const char *pch;
+} RTPATHMATCHCORE;
+/** Pointer to a matching instruction. */
+typedef RTPATHMATCHCORE *PRTPATHMATCHCORE;
+/** Pointer to a const matching instruction. */
+typedef RTPATHMATCHCORE const *PCRTPATHMATCHCORE;
+
+/**
+ * Path matching instruction allocator.
+ */
+typedef struct RTPATHMATCHALLOC
+{
+ /** Allocated array of instructions. */
+ PRTPATHMATCHCORE paInstructions;
+ /** Index of the next free entry in paScratch. */
+ uint32_t iNext;
+ /** Number of instructions allocated. */
+ uint32_t cAllocated;
+} RTPATHMATCHALLOC;
+/** Pointer to a matching instruction allocator. */
+typedef RTPATHMATCHALLOC *PRTPATHMATCHALLOC;
+
+/**
+ * Path matching cache, mainly intended for variables like the PATH.
+ */
+typedef struct RTPATHMATCHCACHE
+{
+ /** @todo optimize later. */
+ uint32_t iNothingYet;
+} RTPATHMATCHCACHE;
+/** Pointer to a path matching cache. */
+typedef RTPATHMATCHCACHE *PRTPATHMATCHCACHE;
+
+
+
+/** Parsed path entry.*/
+typedef struct RTPATHGLOBPPE
+{
+ /** Normal: Index into RTPATHGLOB::MatchInstrAlloc.paInstructions. */
+ uint32_t iMatchProg : 16;
+ /** Set if this is a normal entry which is matched using iMatchProg. */
+ uint32_t fNormal : 1;
+ /** !fNormal: Plain name that can be dealt with using without
+ * enumerating the whole directory, unless of course the file system is case
+ * sensitive and the globbing isn't (that needs figuring out on a per
+ * directory basis). */
+ uint32_t fPlain : 1;
+ /** !fNormal: Match zero or more subdirectories. */
+ uint32_t fStarStar : 1;
+ /** !fNormal: The whole component is a variable expansion. */
+ uint32_t fExpVariable : 1;
+
+ /** Filter: Set if it only matches directories. */
+ uint32_t fDir : 1;
+ /** Set if it's the final component. */
+ uint32_t fFinal : 1;
+
+ /** Unused bits. */
+ uint32_t fReserved : 2+8;
+} RTPATHGLOBPPE;
+
+
+typedef struct RTPATHGLOB
+{
+ /** Path buffer. */
+ char szPath[RTPATH_MAX];
+ /** Temporary buffers. */
+ union
+ {
+ /** File system object info structure. */
+ RTFSOBJINFO ObjInfo;
+ /** Directory entry buffer. */
+ RTDIRENTRY DirEntry;
+ /** Padding the buffer to an unreasonably large size. */
+ uint8_t abPadding[RTPATH_MAX + sizeof(RTDIRENTRY)];
+ } u;
+
+
+ /** Where to insert the next one.*/
+ PRTPATHGLOBENTRY *ppNext;
+ /** The head pointer. */
+ PRTPATHGLOBENTRY pHead;
+ /** Result count. */
+ uint32_t cResults;
+ /** Counts path overflows. */
+ uint32_t cPathOverflows;
+ /** The input flags. */
+ uint32_t fFlags;
+ /** Matching instruction allocator. */
+ RTPATHMATCHALLOC MatchInstrAlloc;
+ /** Matching state. */
+ RTPATHMATCHCACHE MatchCache;
+
+ /** The pattern string. */
+ const char *pszPattern;
+ /** The parsed path. */
+ PRTPATHPARSED pParsed;
+ /** The component to start with. */
+ uint16_t iFirstComp;
+ /** The corresponding path offset (previous components already present). */
+ uint16_t offFirstPath;
+ /** Path component information we need. */
+ RTPATHGLOBPPE aComps[1];
+} RTPATHGLOB;
+typedef RTPATHGLOB *PRTPATHGLOB;
+
+
+/*********************************************************************************************************************************
+* Internal Functions *
+*********************************************************************************************************************************/
+static int rtPathGlobExecRecursiveStarStar(PRTPATHGLOB pGlob, size_t offPath, uint32_t iStarStarComp, size_t offStarStarPath);
+static int rtPathGlobExecRecursiveVarExp(PRTPATHGLOB pGlob, size_t offPath, uint32_t iComp);
+static int rtPathGlobExecRecursivePlainText(PRTPATHGLOB pGlob, size_t offPath, uint32_t iComp);
+static int rtPathGlobExecRecursiveGeneric(PRTPATHGLOB pGlob, size_t offPath, uint32_t iComp);
+
+
+/**
+ * Implements the two variable access functions for a simple one value variable.
+ */
+#define RTPATHMATCHVAR_SIMPLE(a_Name, a_GetStrExpr) \
+ static DECLCALLBACK(int) RT_CONCAT(rtPathVarQuery_,a_Name)(uint32_t iItem, char *pszBuf, size_t cbBuf, size_t *pcchValue, \
+ PRTPATHMATCHCACHE pCache) \
+ { \
+ if (iItem == 0) \
+ { \
+ const char *pszValue = a_GetStrExpr; \
+ size_t cchValue = strlen(pszValue); \
+ if (cchValue + 1 <= cbBuf) \
+ { \
+ memcpy(pszBuf, pszValue, cchValue + 1); \
+ *pcchValue = cchValue; \
+ return VINF_EOF; \
+ } \
+ return VERR_BUFFER_OVERFLOW; \
+ } \
+ NOREF(pCache);\
+ return VERR_EOF; \
+ } \
+ static DECLCALLBACK(int) RT_CONCAT(rtPathVarMatch_,a_Name)(const char *pchMatch, size_t cchMatch, bool fIgnoreCase, \
+ size_t *pcchMatched) \
+ { \
+ const char *pszValue = a_GetStrExpr; \
+ size_t cchValue = strlen(pszValue); \
+ if ( cchValue >= cchMatch \
+ && ( !fIgnoreCase \
+ ? memcmp(pszValue, pchMatch, cchValue) == 0 \
+ : RTStrNICmp(pszValue, pchMatch, cchValue) == 0) ) \
+ { \
+ *pcchMatched = cchValue; \
+ return VINF_SUCCESS; \
+ } \
+ return VERR_MISMATCH; \
+ } \
+ typedef int RT_CONCAT(DummyColonType_,a_Name)
+
+/**
+ * Implements mapping a glob variable to an environment variable.
+ */
+#define RTPATHMATCHVAR_SIMPLE_ENVVAR(a_Name, a_pszEnvVar, a_cbMaxValue) \
+ static DECLCALLBACK(int) RT_CONCAT(rtPathVarQuery_,a_Name)(uint32_t iItem, char *pszBuf, size_t cbBuf, size_t *pcchValue, \
+ PRTPATHMATCHCACHE pCache) \
+ { \
+ if (iItem == 0) \
+ { \
+ int rc = RTEnvGetEx(RTENV_DEFAULT, a_pszEnvVar, pszBuf, cbBuf, pcchValue); \
+ if (RT_SUCCESS(rc)) \
+ return VINF_EOF; \
+ if (rc != VERR_ENV_VAR_NOT_FOUND) \
+ return rc; \
+ } \
+ NOREF(pCache);\
+ return VERR_EOF; \
+ } \
+ static DECLCALLBACK(int) RT_CONCAT(rtPathVarMatch_,a_Name)(const char *pchMatch, size_t cchMatch, bool fIgnoreCase, \
+ size_t *pcchMatched) \
+ { \
+ char szValue[a_cbMaxValue]; \
+ size_t cchValue; \
+ int rc = RTEnvGetEx(RTENV_DEFAULT, a_pszEnvVar, szValue, sizeof(szValue), &cchValue); \
+ if ( RT_SUCCESS(rc) \
+ && cchValue >= cchMatch \
+ && ( !fIgnoreCase \
+ ? memcmp(szValue, pchMatch, cchValue) == 0 \
+ : RTStrNICmp(szValue, pchMatch, cchValue) == 0) ) \
+ { \
+ *pcchMatched = cchValue; \
+ return VINF_SUCCESS; \
+ } \
+ return VERR_MISMATCH; \
+ } \
+ typedef int RT_CONCAT(DummyColonType_,a_Name)
+
+/**
+ * Implements mapping a glob variable to multiple environment variable values.
+ * @param a_apszVarNames Assumes to be a global variable that RT_ELEMENTS
+ * works correctly on.
+ */
+#define RTPATHMATCHVAR_MULTIPLE_ENVVARS(a_Name, a_apszVarNames, a_cbMaxValue) \
+ static DECLCALLBACK(int) RT_CONCAT(rtPathVarQuery_,a_Name)(uint32_t iItem, char *pszBuf, size_t cbBuf, size_t *pcchValue, \
+ PRTPATHMATCHCACHE pCache) \
+ { \
+ if (iItem < RT_ELEMENTS(a_apszVarNames)) \
+ { \
+ int rc = RTEnvGetEx(RTENV_DEFAULT, a_apszVarNames[iItem], pszBuf, cbBuf, pcchValue); \
+ if (RT_SUCCESS(rc)) \
+ return iItem + 1 == RT_ELEMENTS(a_apszVarNames) ? VINF_EOF : VINF_SUCCESS; \
+ if (rc == VERR_ENV_VAR_NOT_FOUND) \
+ rc = VERR_TRY_AGAIN; \
+ return rc; \
+ } \
+ NOREF(pCache);\
+ return VERR_EOF; \
+ } \
+ static DECLCALLBACK(int) RT_CONCAT(rtPathVarMatch_,a_Name)(const char *pchMatch, size_t cchMatch, bool fIgnoreCase, \
+ size_t *pcchMatched) \
+ { \
+ for (uint32_t iItem = 0; iItem < RT_ELEMENTS(a_apszVarNames); iItem++) \
+ { \
+ char szValue[a_cbMaxValue]; \
+ size_t cchValue; \
+ int rc = RTEnvGetEx(RTENV_DEFAULT, a_apszVarNames[iItem], szValue, sizeof(szValue), &cchValue);\
+ if ( RT_SUCCESS(rc) \
+ && cchValue >= cchMatch \
+ && ( !fIgnoreCase \
+ ? memcmp(szValue, pchMatch, cchValue) == 0 \
+ : RTStrNICmp(szValue, pchMatch, cchValue) == 0) ) \
+ { \
+ *pcchMatched = cchValue; \
+ return VINF_SUCCESS; \
+ } \
+ } \
+ return VERR_MISMATCH; \
+ } \
+ typedef int RT_CONCAT(DummyColonType_,a_Name)
+
+
+RTPATHMATCHVAR_SIMPLE(Arch, RTBldCfgTargetArch());
+RTPATHMATCHVAR_SIMPLE(Bits, RT_XSTR(ARCH_BITS));
+#ifdef RT_OS_WINDOWS
+RTPATHMATCHVAR_SIMPLE_ENVVAR(WinAppData, "AppData", RTPATH_MAX);
+RTPATHMATCHVAR_SIMPLE_ENVVAR(WinProgramData, "ProgramData", RTPATH_MAX);
+RTPATHMATCHVAR_SIMPLE_ENVVAR(WinProgramFiles, "ProgramFiles", RTPATH_MAX);
+RTPATHMATCHVAR_SIMPLE_ENVVAR(WinCommonProgramFiles, "CommonProgramFiles", RTPATH_MAX);
+# if defined(RT_ARCH_AMD64) || defined(RT_ARCH_X86)
+RTPATHMATCHVAR_SIMPLE_ENVVAR(WinOtherProgramFiles, "ProgramFiles(x86)", RTPATH_MAX);
+RTPATHMATCHVAR_SIMPLE_ENVVAR(WinOtherCommonProgramFiles, "CommonProgramFiles(x86)", RTPATH_MAX);
+# else
+# error "Port ME!"
+# endif
+static const char * const a_apszWinProgramFilesVars[] =
+{
+ "ProgramFiles",
+# ifdef RT_ARCH_AMD64
+ "ProgramFiles(x86)",
+# endif
+};
+RTPATHMATCHVAR_MULTIPLE_ENVVARS(WinAllProgramFiles, a_apszWinProgramFilesVars, RTPATH_MAX);
+static const char * const a_apszWinCommonProgramFilesVars[] =
+{
+ "CommonProgramFiles",
+# ifdef RT_ARCH_AMD64
+ "CommonProgramFiles(x86)",
+# endif
+};
+RTPATHMATCHVAR_MULTIPLE_ENVVARS(WinAllCommonProgramFiles, a_apszWinCommonProgramFilesVars, RTPATH_MAX);
+#endif
+
+
+/**
+ * @interface_method_impl{RTPATHMATCHVAR::pfnQuery, Enumerates the PATH}.
+ */
+static DECLCALLBACK(int) rtPathVarQuery_Path(uint32_t iItem, char *pszBuf, size_t cbBuf, size_t *pcchValue,
+ PRTPATHMATCHCACHE pCache)
+{
+ /*
+ * Query the PATH value.
+ */
+/** @todo cache this in pCache with iItem and offset. */
+ char *pszPathFree = NULL;
+ char *pszPath = pszBuf;
+ size_t cchActual;
+ const char *pszVarNm = "PATH";
+ int rc = RTEnvGetEx(RTENV_DEFAULT, pszVarNm, pszPath, cbBuf, &cchActual);
+#ifdef RT_OS_WINDOWS
+ if (rc == VERR_ENV_VAR_NOT_FOUND)
+ rc = RTEnvGetEx(RTENV_DEFAULT, pszVarNm = "Path", pszPath, cbBuf, &cchActual);
+#endif
+ if (rc == VERR_BUFFER_OVERFLOW)
+ {
+ for (uint32_t iTry = 0; iTry < 10; iTry++)
+ {
+ size_t cbPathBuf = RT_ALIGN_Z(cchActual + 1 + 64 * iTry, 64);
+ pszPathFree = (char *)RTMemTmpAlloc(cbPathBuf);
+ rc = RTEnvGetEx(RTENV_DEFAULT, pszVarNm, pszPathFree, cbPathBuf, &cchActual);
+ if (RT_SUCCESS(rc))
+ break;
+ RTMemTmpFree(pszPathFree);
+ AssertReturn(cchActual >= cbPathBuf, VERR_INTERNAL_ERROR_3);
+ }
+ pszPath = pszPathFree;
+ }
+
+ /*
+ * Spool forward to the given PATH item.
+ */
+ rc = VERR_EOF;
+#if defined(RT_OS_WINDOWS) || defined(RT_OS_OS2)
+ const char chSep = ';';
+#else
+ const char chSep = ':';
+#endif
+ while (*pszPath != '\0')
+ {
+ char *pchSep = strchr(pszPath, chSep);
+
+ /* We ignore empty strings, which is probably not entirely correct,
+ but works better on DOS based system with many entries added
+ without checking whether there is a trailing separator or not.
+ Thus, the current directory is only searched if a '.' is present
+ in the PATH. */
+ if (pchSep == pszPath)
+ pszPath++;
+ else if (iItem > 0)
+ {
+ /* If we didn't find a separator, the item doesn't exists. Quit. */
+ if (!pchSep)
+ break;
+
+ pszPath = pchSep + 1;
+ iItem--;
+ }
+ else
+ {
+ /* We've reached the item we wanted. */
+ size_t cchComp = pchSep ? pchSep - pszPath : strlen(pszPath);
+ if (cchComp < cbBuf)
+ {
+ if (pszBuf != pszPath)
+ memmove(pszBuf, pszPath, cchComp);
+ pszBuf[cchComp] = '\0';
+ rc = pchSep ? VINF_SUCCESS : VINF_EOF;
+ }
+ else
+ rc = VERR_BUFFER_OVERFLOW;
+ *pcchValue = cchComp;
+ break;
+ }
+ }
+
+ if (pszPathFree)
+ RTMemTmpFree(pszPathFree);
+ return rc;
+}
+
+
+#if defined(RT_OS_WINDOWS) || defined(RT_OS_OS2)
+/**
+ * @interface_method_impl{RTPATHMATCHVAR::pfnQuery,
+ * The system drive letter + colon.}.
+ */
+static DECLCALLBACK(int) rtPathVarQuery_DosSystemDrive(uint32_t iItem, char *pszBuf, size_t cbBuf, size_t *pcchValue,
+ PRTPATHMATCHCACHE pCache)
+{
+ if (iItem == 0)
+ {
+ AssertReturn(cbBuf >= 3, VERR_BUFFER_OVERFLOW);
+
+# ifdef RT_OS_WINDOWS
+ /* Since this is used at the start of a pattern, we assume
+ we've got more than enough buffer space. */
+ PRTUTF16 pwszTmp = (PRTUTF16)pszBuf;
+ UINT cch = GetSystemWindowsDirectoryW(pwszTmp, (UINT)(cbBuf / sizeof(WCHAR)));
+ if (cch >= 2)
+ {
+ RTUTF16 wcDrive = pwszTmp[0];
+ if ( RT_C_IS_ALPHA(wcDrive)
+ && pwszTmp[1] == ':')
+ {
+ pszBuf[0] = wcDrive;
+ pszBuf[1] = ':';
+ pszBuf[2] = '\0';
+ *pcchValue = 2;
+ return VINF_EOF;
+ }
+ }
+# else
+ ULONG ulDrive = ~(ULONG)0;
+ APIRET rc = DosQuerySysInfo(QSV_BOOT_DRIVE, QSV_BOOT_DRIVE, &ulDrive, sizeof(ulDrive));
+ ulDrive--; /* 1 = 'A' */
+ if ( rc == NO_ERROR
+ && ulDrive <= (ULONG)'Z')
+ {
+ pszBuf[0] = (char)ulDrive + 'A';
+ pszBuf[1] = ':';
+ pszBuf[2] = '\0';
+ *pcchValue = 2;
+ return VINF_EOF;
+ }
+# endif
+ return VERR_INTERNAL_ERROR_4;
+ }
+ return VERR_EOF;
+}
+#endif
+
+
+#ifdef RT_OS_WINDOWS
+/**
+ * @interface_method_impl{RTPATHMATCHVAR::pfnQuery,
+ * The system root directory (C:\Windows).}.
+ */
+static DECLCALLBACK(int) rtPathVarQuery_WinSystemRoot(uint32_t iItem, char *pszBuf, size_t cbBuf, size_t *pcchValue,
+ PRTPATHMATCHCACHE pCache)
+{
+ if (iItem == 0)
+ {
+ Assert(pszBuf); Assert(cbBuf);
+ RTUTF16 wszSystemRoot[MAX_PATH];
+ UINT cchSystemRoot = GetSystemWindowsDirectoryW(wszSystemRoot, MAX_PATH);
+ if (cchSystemRoot > 0)
+ return RTUtf16ToUtf8Ex(wszSystemRoot, cchSystemRoot, &pszBuf, cbBuf, pcchValue);
+ return RTErrConvertFromWin32(GetLastError());
+ }
+ return VERR_EOF;
+}
+#endif
+
+#undef RTPATHMATCHVAR_SIMPLE
+#undef RTPATHMATCHVAR_SIMPLE_ENVVAR
+#undef RTPATHMATCHVAR_DOUBLE_ENVVAR
+
+/**
+ * Matching variable lookup table.
+ * Currently so small we don't bother sorting it and doing binary lookups.
+ */
+static struct RTPATHMATCHVAR
+{
+ /** The variable name. */
+ const char *pszName;
+ /** The variable name length. */
+ uint16_t cchName;
+ /** Only available as the verify first component. */
+ bool fFirstOnly;
+
+ /**
+ * Queries a given variable value.
+ *
+ * @returns IPRT status code.
+ * @retval VERR_BUFFER_OVERFLOW
+ * @retval VERR_TRY_AGAIN if the caller should skip this value item and try the
+ * next one instead (e.g. env var not present).
+ * @retval VINF_EOF when retrieving the last one, if possible.
+ * @retval VERR_EOF when @a iItem is past the item space.
+ *
+ * @param iItem The variable value item to retrieve. (A variable may
+ * have more than one value, e.g. 'BothProgramFile' on a
+ * 64-bit system or 'Path'.)
+ * @param pszBuf Where to return the value.
+ * @param cbBuf The buffer size.
+ * @param pcchValue Where to return the length of the return string.
+ * @param pCache Pointer to the path matching cache. May speed up
+ * enumerating PATH items and similar.
+ */
+ DECLCALLBACKMEMBER(int, pfnQuery)(uint32_t iItem, char *pszBuf, size_t cbBuf, size_t *pcchValue, PRTPATHMATCHCACHE pCache);
+
+ /**
+ * Matching method, optional.
+ *
+ * @returns IPRT status code.
+ * @retval VINF_SUCCESS on match.
+ * @retval VERR_MISMATCH on mismatch.
+ *
+ * @param pszMatch String to match with (not terminated).
+ * @param cchMatch The length of what we match with.
+ * @param fIgnoreCase Whether to ignore case or not when comparing.
+ * @param pcchMatched Where to return the length of the match (value length).
+ */
+ DECLCALLBACKMEMBER(int, pfnMatch)(const char *pchMatch, size_t cchMatch, bool fIgnoreCase, size_t *pcchMatched);
+
+} const g_aVariables[] =
+{
+ { RT_STR_TUPLE("Arch"), false, rtPathVarQuery_Arch, rtPathVarMatch_Arch },
+ { RT_STR_TUPLE("Bits"), false, rtPathVarQuery_Bits, rtPathVarMatch_Bits },
+ { RT_STR_TUPLE("Path"), true, rtPathVarQuery_Path, NULL },
+#if defined(RT_OS_WINDOWS) || defined(RT_OS_OS2)
+ { RT_STR_TUPLE("SystemDrive"), true, rtPathVarQuery_DosSystemDrive, NULL },
+#endif
+#ifdef RT_OS_WINDOWS
+ { RT_STR_TUPLE("SystemRoot"), true, rtPathVarQuery_WinSystemRoot, NULL },
+ { RT_STR_TUPLE("AppData"), true, rtPathVarQuery_WinAppData, NULL },
+ { RT_STR_TUPLE("ProgramData"), true, rtPathVarQuery_WinProgramData, NULL },
+ { RT_STR_TUPLE("ProgramFiles"), true, rtPathVarQuery_WinProgramFiles, NULL },
+ { RT_STR_TUPLE("OtherProgramFiles"), true, rtPathVarQuery_WinOtherProgramFiles, NULL },
+ { RT_STR_TUPLE("AllProgramFiles"), true, rtPathVarQuery_WinAllProgramFiles, NULL },
+ { RT_STR_TUPLE("CommonProgramFiles"), true, rtPathVarQuery_WinCommonProgramFiles, NULL },
+ { RT_STR_TUPLE("OtherCommonProgramFiles"), true, rtPathVarQuery_WinOtherCommonProgramFiles, NULL },
+ { RT_STR_TUPLE("AllCommonProgramFiles"), true, rtPathVarQuery_WinAllCommonProgramFiles, NULL },
+#endif
+};
+
+
+
+/**
+ * Handles a complicated set.
+ *
+ * A complicated set is either using ranges, character classes or code points
+ * outside the ASCII-7 range.
+ *
+ * @returns VINF_SUCCESS or VERR_MISMATCH. May also return UTF-8 decoding
+ * errors as well as VERR_PATH_MATCH_FEATURE_NOT_IMPLEMENTED.
+ *
+ * @param ucInput The input code point to match with.
+ * @param pchSet The start of the set specification (after caret).
+ * @param cchSet The length of the set specification.
+ */
+static int rtPathMatchExecExtendedSet(RTUNICP ucInput, const char *pchSet, size_t cchSet)
+{
+ while (cchSet > 0)
+ {
+ RTUNICP ucSet;
+ int rc = RTStrGetCpNEx(&pchSet, &cchSet, &ucSet);
+ AssertRCReturn(rc, rc);
+
+ /*
+ * Check for character class, collating symbol and equvalence class.
+ */
+ if (ucSet == '[' && cchSet > 0)
+ {
+ char chNext = *pchSet;
+ if (chNext == ':')
+ {
+#define CHECK_CHAR_CLASS(a_szClassNm, a_BoolTestExpr) \
+ if ( cchSet >= sizeof(a_szClassNm) \
+ && memcmp(pchSet, a_szClassNm "]", sizeof(a_szClassNm)) == 0) \
+ { \
+ if (a_BoolTestExpr) \
+ return VINF_SUCCESS; \
+ pchSet += sizeof(a_szClassNm); \
+ cchSet -= sizeof(a_szClassNm); \
+ continue; \
+ } do { } while (0)
+
+ CHECK_CHAR_CLASS(":alpha:", RTUniCpIsAlphabetic(ucInput));
+ CHECK_CHAR_CLASS(":alnum:", RTUniCpIsAlphabetic(ucInput) || RTUniCpIsDecDigit(ucInput)); /** @todo figure what's correct here and fix uni.h */
+ CHECK_CHAR_CLASS(":blank:", ucInput == ' ' || ucInput == '\t');
+ CHECK_CHAR_CLASS(":cntrl:", ucInput < 31 || ucInput == 127);
+ CHECK_CHAR_CLASS(":digit:", RTUniCpIsDecDigit(ucInput));
+ CHECK_CHAR_CLASS(":lower:", RTUniCpIsLower(ucInput));
+ CHECK_CHAR_CLASS(":print:", RTUniCpIsAlphabetic(ucInput) || (RT_C_IS_PRINT(ucInput) && ucInput < 127)); /** @todo fixme*/
+ CHECK_CHAR_CLASS(":punct:", RT_C_IS_PRINT(ucInput) && ucInput < 127); /** @todo fixme*/
+ CHECK_CHAR_CLASS(":space:", RTUniCpIsSpace(ucInput));
+ CHECK_CHAR_CLASS(":upper:", RTUniCpIsUpper(ucInput));
+ CHECK_CHAR_CLASS(":xdigit:", RTUniCpIsHexDigit(ucInput));
+ AssertMsgFailedReturn(("Unknown or malformed char class: '%.*s'\n", cchSet + 1, pchSet - 1),
+ VERR_PATH_GLOB_UNKNOWN_CHAR_CLASS);
+#undef CHECK_CHAR_CLASS
+ }
+ /** @todo implement collating symbol and equvalence class. */
+ else if (chNext == '=' || chNext == '.')
+ AssertFailedReturn(VERR_PATH_MATCH_FEATURE_NOT_IMPLEMENTED);
+ }
+
+ /*
+ * Check for range (leading or final dash does not constitute a range).
+ */
+ if (cchSet > 1 && *pchSet == '-')
+ {
+ pchSet++; /* skip dash */
+ cchSet--;
+
+ RTUNICP ucSet2;
+ rc = RTStrGetCpNEx(&pchSet, &cchSet, &ucSet2);
+ AssertRCReturn(rc, rc);
+ Assert(ucSet < ucSet2);
+ if (ucInput >= ucSet && ucInput <= ucSet2)
+ return VINF_SUCCESS;
+ }
+ /*
+ * Single char comparison.
+ */
+ else if (ucInput == ucSet)
+ return VINF_SUCCESS;
+ }
+ return VERR_MISMATCH;
+}
+
+
+/**
+ * Variable matching fallback using the query function.
+ *
+ * This must not be inlined as it consuming a lot of stack! Which is why it's
+ * placed a couple of functions away from the recursive rtPathExecMatch.
+ *
+ * @returns VINF_SUCCESS or VERR_MISMATCH.
+ * @param pchInput The current input position.
+ * @param cchInput The amount of input left..
+ * @param idxVar The variable table index.
+ * @param fIgnoreCase Whether to ignore case when comparing.
+ * @param pcchMatched Where to return how much we actually matched up.
+ * @param pCache Pointer to the path matching cache.
+ */
+DECL_NO_INLINE(static, int) rtPathMatchExecVariableFallback(const char *pchInput, size_t cchInput, uint16_t idxVar,
+ bool fIgnoreCase, size_t *pcchMatched, PRTPATHMATCHCACHE pCache)
+{
+ for (uint32_t iItem = 0; iItem < RTPATHMATCH_MAX_VAR_ITEMS; iItem++)
+ {
+ char szValue[RTPATH_MAX];
+ size_t cchValue;
+ int rc = g_aVariables[idxVar].pfnQuery(iItem, szValue, sizeof(szValue), &cchValue, pCache);
+ if (RT_SUCCESS(rc))
+ {
+ if (cchValue <= cchInput)
+ {
+ if ( !fIgnoreCase
+ ? memcmp(pchInput, szValue, cchValue) == 0
+ : RTStrNICmp(pchInput, szValue, cchValue) == 0)
+ {
+ *pcchMatched = cchValue;
+ return VINF_SUCCESS;
+ }
+ }
+ if (rc == VINF_EOF)
+ return VERR_MISMATCH;
+ }
+ else if (rc == VERR_EOF)
+ return VERR_MISMATCH;
+ else
+ Assert(rc == VERR_BUFFER_OVERFLOW || rc == VERR_TRY_AGAIN);
+ }
+ AssertFailed();
+ return VERR_MISMATCH;
+}
+
+
+/**
+ * Variable matching worker.
+ *
+ * @returns VINF_SUCCESS or VERR_MISMATCH.
+ * @param pchInput The current input position.
+ * @param cchInput The amount of input left..
+ * @param idxVar The variable table index.
+ * @param fIgnoreCase Whether to ignore case when comparing.
+ * @param pcchMatched Where to return how much we actually matched up.
+ * @param pCache Pointer to the path matching cache.
+ */
+static int rtPathMatchExecVariable(const char *pchInput, size_t cchInput, uint16_t idxVar,
+ bool fIgnoreCase, size_t *pcchMatched, PRTPATHMATCHCACHE pCache)
+{
+ Assert(idxVar < RT_ELEMENTS(g_aVariables));
+ if (g_aVariables[idxVar].pfnMatch)
+ return g_aVariables[idxVar].pfnMatch(pchInput, cchInput, fIgnoreCase, pcchMatched);
+ return rtPathMatchExecVariableFallback(pchInput, cchInput, idxVar, fIgnoreCase, pcchMatched, pCache);
+}
+
+
+/**
+ * Variable matching worker.
+ *
+ * @returns VINF_SUCCESS or VERR_MISMATCH.
+ * @param pchInput The current input position.
+ * @param cchInput The amount of input left..
+ * @param pProg The first matching program instruction.
+ * @param pCache Pointer to the path matching cache.
+ */
+static int rtPathMatchExec(const char *pchInput, size_t cchInput, PCRTPATHMATCHCORE pProg, PRTPATHMATCHCACHE pCache)
+{
+ for (;;)
+ {
+ switch (pProg->enmOpCode)
+ {
+ case RTPATHMATCHOP_RETURN_MATCH_IF_AT_END:
+ return cchInput == 0 ? VINF_SUCCESS : VERR_MISMATCH;
+
+ case RTPATHMATCHOP_RETURN_MATCH:
+ return VINF_SUCCESS;
+
+ case RTPATHMATCHOP_RETURN_MATCH_EXCEPT_DOT_AND_DOTDOT:
+ if ( cchInput > 2
+ || cchInput < 1
+ || pchInput[0] != '.'
+ || (cchInput == 2 && pchInput[1] != '.') )
+ return VINF_SUCCESS;
+ return VERR_MISMATCH;
+
+ case RTPATHMATCHOP_STRCMP:
+ if (pProg->cch > cchInput)
+ return VERR_MISMATCH;
+ if (memcmp(pchInput, pProg->pch, pProg->cch) != 0)
+ return VERR_MISMATCH;
+ cchInput -= pProg->cch;
+ pchInput += pProg->cch;
+ break;
+
+ case RTPATHMATCHOP_STRICMP:
+ if (pProg->cch > cchInput)
+ return VERR_MISMATCH;
+ if (RTStrNICmp(pchInput, pProg->pch, pProg->cch) != 0)
+ return VERR_MISMATCH;
+ cchInput -= pProg->cch;
+ pchInput += pProg->cch;
+ break;
+
+ case RTPATHMATCHOP_SKIP_ONE_CODEPOINT:
+ {
+ if (cchInput == 0)
+ return VERR_MISMATCH;
+ RTUNICP ucInputIgnore;
+ int rc = RTStrGetCpNEx(&pchInput, &cchInput, &ucInputIgnore);
+ AssertRCReturn(rc, rc);
+ break;
+ }
+
+ case RTPATHMATCHOP_SKIP_MULTIPLE_CODEPOINTS:
+ {
+ uint16_t cCpsLeft = pProg->cch;
+ Assert(cCpsLeft > 1);
+ if (cCpsLeft > cchInput)
+ return VERR_MISMATCH;
+ while (cCpsLeft-- > 0)
+ {
+ RTUNICP ucInputIgnore;
+ int rc = RTStrGetCpNEx(&pchInput, &cchInput, &ucInputIgnore);
+ if (RT_FAILURE(rc))
+ return rc == VERR_END_OF_STRING ? VERR_MISMATCH : rc;
+ }
+ break;
+ }
+
+ case RTPATHMATCHOP_CODEPOINT_IN_SET_ASCII7:
+ {
+ if (cchInput == 0)
+ return VERR_MISMATCH;
+ RTUNICP ucInput;
+ int rc = RTStrGetCpNEx(&pchInput, &cchInput, &ucInput);
+ AssertRCReturn(rc, rc);
+ if (ucInput >= 0x80)
+ return VERR_MISMATCH;
+ if (memchr(pProg->pch, (char)ucInput, pProg->cch) == NULL)
+ return VERR_MISMATCH;
+ break;
+ }
+
+ case RTPATHMATCHOP_CODEPOINT_NOT_IN_SET_ASCII7:
+ {
+ if (cchInput == 0)
+ return VERR_MISMATCH;
+ RTUNICP ucInput;
+ int rc = RTStrGetCpNEx(&pchInput, &cchInput, &ucInput);
+ AssertRCReturn(rc, rc);
+ if (ucInput >= 0x80)
+ break;
+ if (memchr(pProg->pch, (char)ucInput, pProg->cch) != NULL)
+ return VERR_MISMATCH;
+ break;
+ }
+
+ case RTPATHMATCHOP_CODEPOINT_IN_SET_EXTENDED:
+ {
+ if (cchInput == 0)
+ return VERR_MISMATCH;
+ RTUNICP ucInput;
+ int rc = RTStrGetCpNEx(&pchInput, &cchInput, &ucInput);
+ AssertRCReturn(rc, rc);
+ rc = rtPathMatchExecExtendedSet(ucInput, pProg->pch, pProg->cch);
+ if (rc == VINF_SUCCESS)
+ break;
+ return rc;
+ }
+
+ case RTPATHMATCHOP_CODEPOINT_NOT_IN_SET_EXTENDED:
+ {
+ if (cchInput == 0)
+ return VERR_MISMATCH;
+ RTUNICP ucInput;
+ int rc = RTStrGetCpNEx(&pchInput, &cchInput, &ucInput);
+ AssertRCReturn(rc, rc);
+ rc = rtPathMatchExecExtendedSet(ucInput, pProg->pch, pProg->cch);
+ if (rc == VERR_MISMATCH)
+ break;
+ if (rc == VINF_SUCCESS)
+ rc = VERR_MISMATCH;
+ return rc;
+ }
+
+ case RTPATHMATCHOP_VARIABLE_VALUE_CMP:
+ case RTPATHMATCHOP_VARIABLE_VALUE_ICMP:
+ {
+ size_t cchMatched = 0;
+ int rc = rtPathMatchExecVariable(pchInput, cchInput, pProg->uOp2,
+ pProg->enmOpCode == RTPATHMATCHOP_VARIABLE_VALUE_ICMP, &cchMatched, pCache);
+ if (rc == VINF_SUCCESS)
+ {
+ pchInput += cchMatched;
+ cchInput -= cchMatched;
+ break;
+ }
+ return rc;
+ }
+
+ /*
+ * This is the expensive one. It always completes the program.
+ */
+ case RTPATHMATCHOP_ZERO_OR_MORE:
+ {
+ if (cchInput < pProg->cch)
+ return VERR_MISMATCH;
+ size_t cchMatched = cchInput - pProg->cch;
+ do
+ {
+ int rc = rtPathMatchExec(&pchInput[cchMatched], cchInput - cchMatched, pProg + 1, pCache);
+ if (RT_SUCCESS(rc))
+ return rc;
+ } while (cchMatched-- > 0);
+ return VERR_MISMATCH;
+ }
+
+ /*
+ * Variant of the above that doesn't match '.' and '..' entries.
+ */
+ case RTPATHMATCHOP_ZERO_OR_MORE_EXCEPT_DOT_AND_DOTDOT:
+ {
+ if (cchInput < pProg->cch)
+ return VERR_MISMATCH;
+ if ( cchInput <= 2
+ && cchInput > 0
+ && pchInput[0] == '.'
+ && (cchInput == 1 || pchInput[1] == '.') )
+ return VERR_MISMATCH;
+ size_t cchMatched = cchInput - pProg->cch;
+ do
+ {
+ int rc = rtPathMatchExec(&pchInput[cchMatched], cchInput - cchMatched, pProg + 1, pCache);
+ if (RT_SUCCESS(rc))
+ return rc;
+ } while (cchMatched-- > 0);
+ return VERR_MISMATCH;
+ }
+
+ default:
+ AssertMsgFailedReturn(("enmOpCode=%d\n", pProg->enmOpCode), VERR_INTERNAL_ERROR_3);
+ }
+
+ pProg++;
+ }
+}
+
+
+
+
+/**
+ * Compiles a path matching program.
+ *
+ * @returns IPRT status code.
+ * @param pchPattern The pattern to compile.
+ * @param cchPattern The length of the pattern.
+ * @param pAllocator Pointer to the instruction allocator & result
+ * array. The compiled "program" starts at
+ * PRTPATHMATCHALLOC::paInstructions[PRTPATHMATCHALLOC::iNext]
+ * (input iNext value).
+ *
+ * @todo Expose this matching code and also use it for RTDirOpenFiltered
+ */
+static int rtPathMatchCompile(const char *pchPattern, size_t cchPattern, bool fIgnoreCase, PRTPATHMATCHALLOC pAllocator)
+{
+ /** @todo PORTME: big endian. */
+ static const uint8_t s_bmMetaChars[256/8] =
+ {
+ 0x00, 0x00, 0x00, 0x00, /* 0 thru 31 */
+ 0x10, 0x04, 0x00, 0x80, /* 32 thru 63 */
+ 0x00, 0x00, 0x00, 0x08, /* 64 thru 95 */
+ 0x00, 0x00, 0x00, 0x00, /* 96 thru 127 */
+ /* UTF-8 multibyte: */
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ };
+ Assert(ASMBitTest(s_bmMetaChars, '$')); AssertCompile('$' == 0x24 /*36*/);
+ Assert(ASMBitTest(s_bmMetaChars, '*')); AssertCompile('*' == 0x2a /*42*/);
+ Assert(ASMBitTest(s_bmMetaChars, '?')); AssertCompile('?' == 0x3f /*63*/);
+ Assert(ASMBitTest(s_bmMetaChars, '[')); AssertCompile('[' == 0x5b /*91*/);
+
+ /*
+ * For checking for the first instruction.
+ */
+ uint16_t const iFirst = pAllocator->iNext;
+
+ /*
+ * This is for tracking zero-or-more instructions and for calculating
+ * the minimum amount of input required for it to be considered.
+ */
+ uint16_t aiZeroOrMore[RTPATHMATCH_MAX_ZERO_OR_MORE];
+ uint8_t cZeroOrMore = 0;
+ size_t offInput = 0;
+
+ /*
+ * Loop thru the pattern and translate it into string matching instructions.
+ */
+ for (;;)
+ {
+ /*
+ * Allocate the next instruction.
+ */
+ if (pAllocator->iNext >= pAllocator->cAllocated)
+ {
+ uint32_t cNew = pAllocator->cAllocated ? pAllocator->cAllocated * 2 : 2;
+ void *pvNew = RTMemRealloc(pAllocator->paInstructions, cNew * sizeof(pAllocator->paInstructions[0]));
+ AssertReturn(pvNew, VERR_NO_MEMORY);
+ pAllocator->paInstructions = (PRTPATHMATCHCORE)pvNew;
+ pAllocator->cAllocated = cNew;
+ }
+ PRTPATHMATCHCORE pInstr = &pAllocator->paInstructions[pAllocator->iNext++];
+ pInstr->pch = pchPattern;
+ pInstr->cch = 0;
+ pInstr->uOp2 = 0;
+
+ /*
+ * Special case: End of pattern.
+ */
+ if (!cchPattern)
+ {
+ pInstr->enmOpCode = RTPATHMATCHOP_RETURN_MATCH_IF_AT_END;
+ break;
+ }
+
+ /*
+ * Parse the next bit of the pattern.
+ */
+ char ch = *pchPattern;
+ if (ASMBitTest(s_bmMetaChars, (uint8_t)ch))
+ {
+ /*
+ * Zero or more characters wildcard.
+ */
+ if (ch == '*')
+ {
+ /* Skip extra asterisks. */
+ do
+ {
+ cchPattern--;
+ pchPattern++;
+ } while (cchPattern > 0 && *pchPattern == '*');
+
+ /* There is a special optimization for trailing '*'. */
+ pInstr->cch = 1;
+ if (cchPattern == 0)
+ {
+ pInstr->enmOpCode = iFirst + 1U == pAllocator->iNext
+ ? RTPATHMATCHOP_RETURN_MATCH_EXCEPT_DOT_AND_DOTDOT : RTPATHMATCHOP_RETURN_MATCH;
+ break;
+ }
+
+ pInstr->enmOpCode = iFirst + 1U == pAllocator->iNext
+ ? RTPATHMATCHOP_ZERO_OR_MORE_EXCEPT_DOT_AND_DOTDOT : RTPATHMATCHOP_ZERO_OR_MORE;
+ pInstr->uOp2 = (uint16_t)offInput;
+ AssertReturn(cZeroOrMore < RT_ELEMENTS(aiZeroOrMore), VERR_OUT_OF_RANGE);
+ aiZeroOrMore[cZeroOrMore] = (uint16_t)(pInstr - pAllocator->paInstructions);
+
+ /* cchInput unchanged, zero-or-more matches. */
+ continue;
+ }
+
+ /*
+ * Single character wildcard.
+ */
+ if (ch == '?')
+ {
+ /* Count them if more. */
+ uint16_t cchQms = 1;
+ while (cchQms < cchPattern && pchPattern[cchQms] == '?')
+ cchQms++;
+
+ pInstr->cch = cchQms;
+ pInstr->enmOpCode = cchQms == 1 ? RTPATHMATCHOP_SKIP_ONE_CODEPOINT : RTPATHMATCHOP_SKIP_MULTIPLE_CODEPOINTS;
+
+ cchPattern -= cchQms;
+ pchPattern += cchQms;
+ offInput += cchQms;
+ continue;
+ }
+
+ /*
+ * Character in set.
+ *
+ * Note that we skip the first char in the set as that is the only place
+ * ']' can be placed if one desires to explicitly include it in the set.
+ * To make life a bit more interesting, [:class:] is allowed inside the
+ * set, so we have to do the counting game to find the end.
+ */
+ if (ch == '[')
+ {
+ if ( cchPattern > 2
+ && (const char *)memchr(pchPattern + 2, ']', cchPattern) != NULL)
+ {
+
+ /* Check for not-in. */
+ bool fInverted = false;
+ size_t offStart = 1;
+ if (pchPattern[offStart] == '^')
+ {
+ fInverted = true;
+ offStart++;
+ }
+
+ /* Special case for ']' as the first char, it doesn't indicate closing then. */
+ size_t off = offStart;
+ if (pchPattern[off] == ']')
+ off++;
+
+ bool fExtended = false;
+ while (off < cchPattern)
+ {
+ ch = pchPattern[off++];
+ if (ch == '[')
+ {
+ if (off < cchPattern)
+ {
+ char chOpen = pchPattern[off];
+ if ( chOpen == ':'
+ || chOpen == '='
+ || chOpen == '.')
+ {
+ off++;
+ const char *pchFound = (const char *)memchr(&pchPattern[off], ']', cchPattern - off);
+ if ( pchFound
+ && pchFound[-1] == chOpen)
+ {
+ fExtended = true;
+ off = pchFound - pchPattern + 1;
+ }
+ else
+ AssertFailed();
+ }
+ }
+ }
+ /* Check for closing. */
+ else if (ch == ']')
+ break;
+ /* Check for range expression, promote to extended if this happens. */
+ else if ( ch == '-'
+ && off != offStart + 1
+ && off < cchPattern
+ && pchPattern[off] != ']')
+ fExtended = true;
+ /* UTF-8 multibyte chars forces us to use the extended version too. */
+ else if ((uint8_t)ch >= 0x80)
+ fExtended = true;
+ }
+
+ if (ch == ']')
+ {
+ pInstr->pch = &pchPattern[offStart];
+ pInstr->cch = (uint16_t)(off - offStart - 1);
+ if (!fExtended)
+ pInstr->enmOpCode = !fInverted
+ ? RTPATHMATCHOP_CODEPOINT_IN_SET_ASCII7 : RTPATHMATCHOP_CODEPOINT_NOT_IN_SET_ASCII7;
+ else
+ pInstr->enmOpCode = !fInverted
+ ? RTPATHMATCHOP_CODEPOINT_IN_SET_EXTENDED
+ : RTPATHMATCHOP_CODEPOINT_NOT_IN_SET_EXTENDED;
+ pchPattern += off;
+ cchPattern -= off;
+ offInput += 1;
+ continue;
+ }
+
+ /* else: invalid, treat it as */
+ AssertFailed();
+ }
+ }
+ /*
+ * Variable matching.
+ */
+ else if (ch == '$')
+ {
+ const char *pchFound;
+ if ( cchPattern > 3
+ && pchPattern[1] == '{'
+ && (pchFound = (const char *)memchr(pchPattern + 2, '}', cchPattern)) != NULL
+ && pchFound != &pchPattern[2])
+ {
+ /* skip to the variable name. */
+ pchPattern += 2;
+ cchPattern -= 2;
+ size_t cchVarNm = pchFound - pchPattern;
+
+ /* Look it up. */
+ uint32_t iVar;
+ for (iVar = 0; iVar < RT_ELEMENTS(g_aVariables); iVar++)
+ if ( g_aVariables[iVar].cchName == cchVarNm
+ && memcmp(g_aVariables[iVar].pszName, pchPattern, cchVarNm) == 0)
+ break;
+ if (iVar < RT_ELEMENTS(g_aVariables))
+ {
+ pInstr->uOp2 = (uint16_t)iVar;
+ pInstr->enmOpCode = !fIgnoreCase ? RTPATHMATCHOP_VARIABLE_VALUE_CMP : RTPATHMATCHOP_VARIABLE_VALUE_ICMP;
+ pInstr->pch = pchPattern; /* not necessary */
+ pInstr->cch = (uint16_t)cchPattern; /* ditto */
+ pchPattern += cchVarNm + 1;
+ cchPattern -= cchVarNm + 1;
+ AssertMsgReturn(!g_aVariables[iVar].fFirstOnly || iFirst + 1U == pAllocator->iNext,
+ ("Glob variable '%s' should be first\n", g_aVariables[iVar].pszName),
+ VERR_PATH_MATCH_VARIABLE_MUST_BE_FIRST);
+ /* cchInput unchanged, value can be empty. */
+ continue;
+ }
+ AssertMsgFailedReturn(("Unknown path matching variable '%.*s'\n", cchVarNm, pchPattern),
+ VERR_PATH_MATCH_UNKNOWN_VARIABLE);
+ }
+ }
+ else
+ AssertFailedReturn(VERR_INTERNAL_ERROR_2); /* broken bitmap / compiler codeset */
+ }
+
+ /*
+ * Plain text. Look for the next meta char.
+ */
+ uint32_t cchPlain = 1;
+ while (cchPlain < cchPattern)
+ {
+ ch = pchPattern[cchPlain];
+ if (!ASMBitTest(s_bmMetaChars, (uint8_t)ch))
+ { /* probable */ }
+ else if ( ch == '?'
+ || ch == '*')
+ break;
+ else if (ch == '$')
+ {
+ const char *pchFound;
+ if ( cchPattern > cchPlain + 3
+ && pchPattern[cchPlain + 1] == '{'
+ && (pchFound = (const char *)memchr(&pchPattern[cchPlain + 2], '}', cchPattern - cchPlain - 2)) != NULL
+ && pchFound != &pchPattern[cchPlain + 2])
+ break;
+ }
+ else if (ch == '[')
+ {
+ /* We don't put a lot of effort into getting this 100% right here,
+ no point it complicating things for malformed expressions. */
+ if ( cchPattern > cchPlain + 2
+ && memchr(&pchPattern[cchPlain + 2], ']', cchPattern - cchPlain - 1) != NULL)
+ break;
+ }
+ else
+ AssertFailedReturn(VERR_INTERNAL_ERROR_2); /* broken bitmap / compiler codeset */
+ cchPlain++;
+ }
+ pInstr->enmOpCode = !fIgnoreCase ? RTPATHMATCHOP_STRCMP : RTPATHMATCHOP_STRICMP;
+ pInstr->cch = cchPlain;
+ Assert(pInstr->pch == pchPattern);
+ Assert(pInstr->uOp2 == 0);
+ pchPattern += cchPlain;
+ cchPattern -= cchPlain;
+ offInput += cchPlain;
+ }
+
+ /*
+ * Optimize zero-or-more matching.
+ */
+ while (cZeroOrMore-- > 0)
+ {
+ PRTPATHMATCHCORE pInstr = &pAllocator->paInstructions[aiZeroOrMore[cZeroOrMore]];
+ pInstr->uOp2 = (uint16_t)(offInput - pInstr->uOp2);
+ }
+
+ /** @todo It's possible to use offInput to inject a instruction for checking
+ * minimum input length at the start of the program. Not sure it's
+ * worth it though, unless it's long a complicated expression... */
+ return VINF_SUCCESS;
+}
+
+
+/**
+ * Parses the glob pattern.
+ *
+ * This compiles filename matching programs for each component and determins the
+ * optimal search strategy for them.
+ *
+ * @returns IPRT status code.
+ * @param pGlob The glob instance data.
+ * @param pszPattern The pattern to parse.
+ * @param pParsed The RTPathParse output for the pattern.
+ * @param fFlags The glob flags (same as pGlob->fFlags).
+ */
+static int rtPathGlobParse(PRTPATHGLOB pGlob, const char *pszPattern, PRTPATHPARSED pParsed, uint32_t fFlags)
+{
+ AssertReturn(pParsed->cComps > 0, VERR_INVALID_PARAMETER); /* shouldn't happen */
+ uint32_t iComp = 0;
+
+ /*
+ * If we've got a rootspec, mark it as plain. On platforms with
+ * drive letter and/or UNC we don't allow wildcards or such in
+ * the drive letter spec or UNC server name. (At least not yet.)
+ */
+ if (RTPATH_PROP_HAS_ROOT_SPEC(pParsed->fProps))
+ {
+ AssertReturn(pParsed->aComps[0].cch < sizeof(pGlob->szPath) - 1, VERR_FILENAME_TOO_LONG);
+ memcpy(pGlob->szPath, &pszPattern[pParsed->aComps[0].off], pParsed->aComps[0].cch);
+ pGlob->offFirstPath = pParsed->aComps[0].off;
+ pGlob->iFirstComp = iComp = 1;
+ }
+ else
+ {
+ const char * const pszComp = &pszPattern[pParsed->aComps[0].off];
+
+ /*
+ * The tilde is only applicable to the first component, expand it
+ * immediately.
+ */
+ if ( *pszComp == '~'
+ && !(fFlags & RTPATHGLOB_F_NO_TILDE))
+ {
+ if (pParsed->aComps[0].cch == 1)
+ {
+ int rc = RTPathUserHome(pGlob->szPath, sizeof(pGlob->szPath) - 1);
+ AssertRCReturn(rc, rc);
+ }
+ else
+ AssertMsgFailedReturn(("'%.*s' is not supported yet\n", pszComp, pParsed->aComps[0].cch),
+ VERR_PATH_MATCH_FEATURE_NOT_IMPLEMENTED);
+ pGlob->offFirstPath = (uint32_t)RTPathEnsureTrailingSeparator(pGlob->szPath, sizeof(pGlob->szPath));
+ pGlob->iFirstComp = iComp = 1;
+ }
+ }
+
+ /*
+ * Process the other components.
+ */
+ bool fStarStar = false;
+ for (; iComp < pParsed->cComps; iComp++)
+ {
+ const char *pszComp = &pszPattern[pParsed->aComps[iComp].off];
+ uint16_t cchComp = pParsed->aComps[iComp].cch;
+ Assert(pGlob->aComps[iComp].fNormal == false);
+
+ pGlob->aComps[iComp].fDir = iComp + 1 < pParsed->cComps || (fFlags & RTPATHGLOB_F_ONLY_DIRS);
+ if ( cchComp != 2
+ || pszComp[0] != '*'
+ || pszComp[1] != '*'
+ || (fFlags & RTPATHGLOB_F_NO_STARSTAR) )
+ {
+ /* Compile the pattern. */
+ uint16_t const iMatchProg = pGlob->MatchInstrAlloc.iNext;
+ pGlob->aComps[iComp].iMatchProg = iMatchProg;
+ int rc = rtPathMatchCompile(pszComp, cchComp, RT_BOOL(fFlags & RTPATHGLOB_F_IGNORE_CASE),
+ &pGlob->MatchInstrAlloc);
+ if (RT_FAILURE(rc))
+ return rc;
+
+ /* Check for plain text as well as full variable matching (not applicable after '**'). */
+ uint16_t const cInstructions = pGlob->MatchInstrAlloc.iNext - iMatchProg;
+ if ( cInstructions == 2
+ && !fStarStar
+ && pGlob->MatchInstrAlloc.paInstructions[iMatchProg + 1].enmOpCode == RTPATHMATCHOP_RETURN_MATCH_IF_AT_END)
+ {
+ if ( pGlob->MatchInstrAlloc.paInstructions[iMatchProg].enmOpCode == RTPATHMATCHOP_STRCMP
+ || pGlob->MatchInstrAlloc.paInstructions[iMatchProg].enmOpCode == RTPATHMATCHOP_STRICMP)
+ pGlob->aComps[iComp].fPlain = true;
+ else if ( pGlob->MatchInstrAlloc.paInstructions[iMatchProg].enmOpCode == RTPATHMATCHOP_VARIABLE_VALUE_CMP
+ || pGlob->MatchInstrAlloc.paInstructions[iMatchProg].enmOpCode == RTPATHMATCHOP_VARIABLE_VALUE_ICMP)
+ {
+ pGlob->aComps[iComp].fExpVariable = true;
+ AssertMsgReturn( iComp == 0
+ || !g_aVariables[pGlob->MatchInstrAlloc.paInstructions[iMatchProg].uOp2].fFirstOnly,
+ ("Glob variable '%.*s' can only be used as the path component.\n", cchComp, pszComp),
+ VERR_PATH_MATCH_VARIABLE_MUST_BE_FIRST);
+ }
+ else
+ pGlob->aComps[iComp].fNormal = true;
+ }
+ else
+ pGlob->aComps[iComp].fNormal = true;
+ }
+ else
+ {
+ /* Recursive "**" matching. */
+ pGlob->aComps[iComp].fNormal = false;
+ pGlob->aComps[iComp].fStarStar = true;
+ AssertReturn(!fStarStar, VERR_PATH_MATCH_FEATURE_NOT_IMPLEMENTED); /** @todo implement multiple '**' sequences in a pattern. */
+ fStarStar = true;
+ }
+ }
+ pGlob->aComps[pParsed->cComps - 1].fFinal = true;
+
+ return VINF_SUCCESS;
+}
+
+
+/**
+ * This is for skipping overly long directories entries.
+ *
+ * Since our directory entry buffer can hold filenames of RTPATH_MAX bytes, we
+ * can safely skip filenames that are longer. There are very few file systems
+ * that can actually store filenames longer than 255 bytes at time of coding
+ * (2015-09), and extremely few which can exceed 4096 (RTPATH_MAX) bytes.
+ *
+ * @returns IPRT status code.
+ * @param hDir The directory handle.
+ * @param cbNeeded The required entry size.
+ */
+DECL_NO_INLINE(static, int) rtPathGlobSkipDirEntry(PRTDIR hDir, size_t cbNeeded)
+{
+ int rc = VERR_BUFFER_OVERFLOW;
+ cbNeeded = RT_ALIGN_Z(cbNeeded, 16);
+ PRTDIRENTRY pDirEntry = (PRTDIRENTRY)RTMemTmpAlloc(cbNeeded);
+ if (pDirEntry)
+ {
+ rc = RTDirRead(hDir, pDirEntry, &cbNeeded);
+ RTMemTmpFree(pDirEntry);
+ }
+ return rc;
+}
+
+
+/**
+ * Adds a result.
+ *
+ * @returns IPRT status code.
+ * @retval VINF_CALLBACK_RETURN if we can stop searching.
+ *
+ * @param pGlob The glob instance data.
+ * @param cchPath The number of bytes to add from pGlob->szPath.
+ * @param uType The RTDIRENTRYTYPE value.
+ */
+DECL_NO_INLINE(static, int) rtPathGlobAddResult(PRTPATHGLOB pGlob, size_t cchPath, uint8_t uType)
+{
+ if (pGlob->cResults < RTPATHGLOB_MAX_RESULTS)
+ {
+ PRTPATHGLOBENTRY pEntry = (PRTPATHGLOBENTRY)RTMemAlloc(RT_OFFSETOF(RTPATHGLOBENTRY, szPath[cchPath + 1]));
+ if (pEntry)
+ {
+ pEntry->uType = uType;
+ pEntry->cchPath = (uint16_t)cchPath;
+ memcpy(pEntry->szPath, pGlob->szPath, cchPath);
+ pEntry->szPath[cchPath] = '\0';
+
+ pEntry->pNext = NULL;
+ *pGlob->ppNext = pEntry;
+ pGlob->ppNext = &pEntry->pNext;
+ pGlob->cResults++;
+
+ if (!(pGlob->fFlags & RTPATHGLOB_F_FIRST_ONLY))
+ return VINF_SUCCESS;
+ return VINF_CALLBACK_RETURN;
+ }
+ return VERR_NO_MEMORY;
+ }
+ return VERR_TOO_MUCH_DATA;
+}
+
+
+/**
+ * Adds a result, constructing the path from two string.
+ *
+ * @returns IPRT status code.
+ * @retval VINF_CALLBACK_RETURN if we can stop searching.
+ *
+ * @param pGlob The glob instance data.
+ * @param cchPath The number of bytes to add from pGlob->szPath.
+ * @param pchName The string (usual filename) to append to the szPath.
+ * @param cchName The length of the string to append.
+ * @param uType The RTDIRENTRYTYPE value.
+ */
+DECL_NO_INLINE(static, int) rtPathGlobAddResult2(PRTPATHGLOB pGlob, size_t cchPath, const char *pchName, size_t cchName,
+ uint8_t uType)
+{
+ if (pGlob->cResults < RTPATHGLOB_MAX_RESULTS)
+ {
+ PRTPATHGLOBENTRY pEntry = (PRTPATHGLOBENTRY)RTMemAlloc(RT_OFFSETOF(RTPATHGLOBENTRY, szPath[cchPath + cchName + 1]));
+ if (pEntry)
+ {
+ pEntry->uType = uType;
+ pEntry->cchPath = (uint16_t)(cchPath + cchName);
+ memcpy(pEntry->szPath, pGlob->szPath, cchPath);
+ memcpy(&pEntry->szPath[cchPath], pchName, cchName);
+ pEntry->szPath[cchPath + cchName] = '\0';
+
+ pEntry->pNext = NULL;
+ *pGlob->ppNext = pEntry;
+ pGlob->ppNext = &pEntry->pNext;
+ pGlob->cResults++;
+
+ if (!(pGlob->fFlags & RTPATHGLOB_F_FIRST_ONLY))
+ return VINF_SUCCESS;
+ return VINF_CALLBACK_RETURN;
+ }
+ return VERR_NO_MEMORY;
+ }
+ return VERR_TOO_MUCH_DATA;
+}
+
+
+/**
+ * Prepares a result, constructing the path from two string.
+ *
+ * The caller must call either rtPathGlobCommitResult or
+ * rtPathGlobRollbackResult to complete the operation.
+ *
+ * @returns IPRT status code.
+ * @retval VINF_CALLBACK_RETURN if we can stop searching.
+ *
+ * @param pGlob The glob instance data.
+ * @param cchPath The number of bytes to add from pGlob->szPath.
+ * @param pchName The string (usual filename) to append to the szPath.
+ * @param cchName The length of the string to append.
+ * @param uType The RTDIRENTRYTYPE value.
+ */
+DECL_NO_INLINE(static, int) rtPathGlobAlmostAddResult(PRTPATHGLOB pGlob, size_t cchPath, const char *pchName, size_t cchName,
+ uint8_t uType)
+{
+ if (pGlob->cResults < RTPATHGLOB_MAX_RESULTS)
+ {
+ PRTPATHGLOBENTRY pEntry = (PRTPATHGLOBENTRY)RTMemAlloc(RT_OFFSETOF(RTPATHGLOBENTRY, szPath[cchPath + cchName + 1]));
+ if (pEntry)
+ {
+ pEntry->uType = uType;
+ pEntry->cchPath = (uint16_t)(cchPath + cchName);
+ memcpy(pEntry->szPath, pGlob->szPath, cchPath);
+ memcpy(&pEntry->szPath[cchPath], pchName, cchName);
+ pEntry->szPath[cchPath + cchName] = '\0';
+
+ pEntry->pNext = NULL;
+ *pGlob->ppNext = pEntry;
+ /* Note! We don't update ppNext here, that is done in rtPathGlobCommitResult. */
+
+ if (!(pGlob->fFlags & RTPATHGLOB_F_FIRST_ONLY))
+ return VINF_SUCCESS;
+ return VINF_CALLBACK_RETURN;
+ }
+ return VERR_NO_MEMORY;
+ }
+ return VERR_TOO_MUCH_DATA;
+}
+
+
+/**
+ * Commits a pending result from rtPathGlobAlmostAddResult.
+ *
+ * @param pGlob The glob instance data.
+ * @param uType The RTDIRENTRYTYPE value.
+ */
+static void rtPathGlobCommitResult(PRTPATHGLOB pGlob, uint8_t uType)
+{
+ PRTPATHGLOBENTRY pEntry = *pGlob->ppNext;
+ AssertPtr(pEntry);
+ pEntry->uType = uType;
+ pGlob->ppNext = &pEntry->pNext;
+ pGlob->cResults++;
+}
+
+
+/**
+ * Rolls back a pending result from rtPathGlobAlmostAddResult.
+ *
+ * @param pGlob The glob instance data.
+ */
+static void rtPathGlobRollbackResult(PRTPATHGLOB pGlob)
+{
+ PRTPATHGLOBENTRY pEntry = *pGlob->ppNext;
+ AssertPtr(pEntry);
+ RTMemFree(pEntry);
+ *pGlob->ppNext = NULL;
+}
+
+
+
+/**
+ * Whether to call rtPathGlobExecRecursiveVarExp for the next component.
+ *
+ * @returns true / false.
+ * @param pGlob The glob instance data.
+ * @param offPath The next path offset/length.
+ * @param iComp The next component.
+ */
+DECLINLINE(bool) rtPathGlobExecIsExpVar(PRTPATHGLOB pGlob, size_t offPath, uint32_t iComp)
+{
+ return pGlob->aComps[iComp].fExpVariable
+ && ( !(pGlob->fFlags & RTPATHGLOB_F_IGNORE_CASE)
+ || (offPath ? !RTFsIsCaseSensitive(pGlob->szPath) : !RTFsIsCaseSensitive(".")) );
+}
+
+/**
+ * Whether to call rtPathGlobExecRecursivePlainText for the next component.
+ *
+ * @returns true / false.
+ * @param pGlob The glob instance data.
+ * @param offPath The next path offset/length.
+ * @param iComp The next component.
+ */
+DECLINLINE(bool) rtPathGlobExecIsPlainText(PRTPATHGLOB pGlob, size_t offPath, uint32_t iComp)
+{
+ return pGlob->aComps[iComp].fPlain
+ && ( !(pGlob->fFlags & RTPATHGLOB_F_IGNORE_CASE)
+ || (offPath ? !RTFsIsCaseSensitive(pGlob->szPath) : !RTFsIsCaseSensitive(".")) );
+}
+
+
+/**
+ * Helper for rtPathGlobExecRecursiveVarExp and rtPathGlobExecRecursivePlainText
+ * that compares a file mode mask with dir/no-dir wishes of the caller.
+ *
+ * @returns true if match, false if not.
+ * @param pGlob The glob instance data.
+ * @param fMode The file mode (only the type is used).
+ */
+DECLINLINE(bool) rtPathGlobExecIsMatchFinalWithFileMode(PRTPATHGLOB pGlob, RTFMODE fMode)
+{
+ if (!(pGlob->fFlags & (RTPATHGLOB_F_NO_DIRS | RTPATHGLOB_F_ONLY_DIRS)))
+ return true;
+ return RT_BOOL(pGlob->fFlags & RTPATHGLOB_F_ONLY_DIRS) == RTFS_IS_DIRECTORY(pGlob->u.ObjInfo.Attr.fMode);
+}
+
+
+/**
+ * Recursive globbing - star-star mode.
+ *
+ * @returns IPRT status code.
+ * @retval VINF_CALLBACK_RETURN is used to implement RTPATHGLOB_F_FIRST_ONLY.
+ *
+ * @param pGlob The glob instance data.
+ * @param offPath The current path offset/length.
+ * @param iComp The current component.
+ */
+DECL_NO_INLINE(static, int) rtPathGlobExecRecursiveStarStar(PRTPATHGLOB pGlob, size_t offPath, uint32_t iStarStarComp,
+ size_t offStarStarPath)
+{
+ /** @todo implement multi subdir matching. */
+ return VERR_PATH_MATCH_FEATURE_NOT_IMPLEMENTED;
+}
+
+
+
+/**
+ * Recursive globbing - variable expansion optimization.
+ *
+ * @returns IPRT status code.
+ * @retval VINF_CALLBACK_RETURN is used to implement RTPATHGLOB_F_FIRST_ONLY.
+ *
+ * @param pGlob The glob instance data.
+ * @param offPath The current path offset/length.
+ * @param iComp The current component.
+ */
+DECL_NO_INLINE(static, int) rtPathGlobExecRecursiveVarExp(PRTPATHGLOB pGlob, size_t offPath, uint32_t iComp)
+{
+ Assert(iComp < pGlob->pParsed->cComps);
+ Assert(pGlob->szPath[offPath] == '\0');
+ Assert(pGlob->aComps[iComp].fExpVariable);
+ Assert(!pGlob->aComps[iComp].fPlain);
+ Assert(!pGlob->aComps[iComp].fStarStar);
+ Assert(rtPathGlobExecIsExpVar(pGlob, offPath, iComp));
+
+ /*
+ * Fish the variable index out of the first matching instruction.
+ */
+ Assert( pGlob->MatchInstrAlloc.paInstructions[pGlob->aComps[iComp].iMatchProg].enmOpCode
+ == RTPATHMATCHOP_VARIABLE_VALUE_CMP
+ || pGlob->MatchInstrAlloc.paInstructions[pGlob->aComps[iComp].iMatchProg].enmOpCode
+ == RTPATHMATCHOP_VARIABLE_VALUE_ICMP);
+ uint16_t const iVar = pGlob->MatchInstrAlloc.paInstructions[pGlob->aComps[iComp].iMatchProg].uOp2;
+
+ /*
+ * Enumerate all the variable, giving them the plain text treatment.
+ */
+ for (uint32_t iItem = 0; iItem < RTPATHMATCH_MAX_VAR_ITEMS; iItem++)
+ {
+ size_t cch;
+ int rcVar = g_aVariables[iVar].pfnQuery(iItem, &pGlob->szPath[offPath], sizeof(pGlob->szPath) - offPath, &cch,
+ &pGlob->MatchCache);
+ if (RT_SUCCESS(rcVar))
+ {
+ Assert(pGlob->szPath[offPath + cch] == '\0');
+
+ int rc = RTPathQueryInfoEx(pGlob->szPath, &pGlob->u.ObjInfo, RTFSOBJATTRADD_NOTHING, RTPATH_F_ON_LINK);
+ if (RT_SUCCESS(rc))
+ {
+ if (pGlob->aComps[iComp].fFinal)
+ {
+ if (rtPathGlobExecIsMatchFinalWithFileMode(pGlob, pGlob->u.ObjInfo.Attr.fMode))
+ {
+ rc = rtPathGlobAddResult(pGlob, cch,
+ (pGlob->u.ObjInfo.Attr.fMode & RTFS_TYPE_MASK)
+ >> RTFS_TYPE_DIRENTRYTYPE_SHIFT);
+ if (rc != VINF_SUCCESS)
+ return rc;
+ }
+ }
+ else if (RTFS_IS_DIRECTORY(pGlob->u.ObjInfo.Attr.fMode))
+ {
+ Assert(pGlob->aComps[iComp].fDir);
+ cch = RTPathEnsureTrailingSeparator(pGlob->szPath, sizeof(pGlob->szPath));
+ if (cch > 0)
+ {
+ if (rtPathGlobExecIsExpVar(pGlob, cch, iComp + 1))
+ rc = rtPathGlobExecRecursiveVarExp(pGlob, cch, iComp + 1);
+ else if (rtPathGlobExecIsPlainText(pGlob, cch, iComp + 1))
+ rc = rtPathGlobExecRecursivePlainText(pGlob, cch, iComp + 1);
+ else if (pGlob->aComps[pGlob->iFirstComp].fStarStar)
+ rc = rtPathGlobExecRecursiveStarStar(pGlob, cch, iComp + 1, cch);
+ else
+ rc = rtPathGlobExecRecursiveGeneric(pGlob, cch, iComp + 1);
+ if (rc != VINF_SUCCESS)
+ return rc;
+ }
+ else
+ pGlob->cPathOverflows++;
+ }
+ }
+ /* else: file doesn't exist or something else is wrong, ignore this. */
+ if (rcVar == VINF_EOF)
+ return VINF_SUCCESS;
+ }
+ else if (rcVar == VERR_EOF)
+ return VINF_SUCCESS;
+ else if (rcVar != VERR_TRY_AGAIN)
+ {
+ Assert(rcVar == VERR_BUFFER_OVERFLOW);
+ pGlob->cPathOverflows++;
+ }
+ }
+ AssertFailedReturn(VINF_SUCCESS); /* Too many items returned, probably buggy query method. */
+}
+
+
+/**
+ * Recursive globbing - plain text optimization.
+ *
+ * @returns IPRT status code.
+ * @retval VINF_CALLBACK_RETURN is used to implement RTPATHGLOB_F_FIRST_ONLY.
+ *
+ * @param pGlob The glob instance data.
+ * @param offPath The current path offset/length.
+ * @param iComp The current component.
+ */
+DECL_NO_INLINE(static, int) rtPathGlobExecRecursivePlainText(PRTPATHGLOB pGlob, size_t offPath, uint32_t iComp)
+{
+ /*
+ * Instead of recursing, we loop thru adjacent plain text components.
+ */
+ for (;;)
+ {
+ /*
+ * Preconditions.
+ */
+ Assert(iComp < pGlob->pParsed->cComps);
+ Assert(pGlob->szPath[offPath] == '\0');
+ Assert(pGlob->aComps[iComp].fPlain);
+ Assert(!pGlob->aComps[iComp].fExpVariable);
+ Assert(!pGlob->aComps[iComp].fStarStar);
+ Assert(rtPathGlobExecIsPlainText(pGlob, offPath, iComp));
+ Assert(pGlob->MatchInstrAlloc.paInstructions[pGlob->aComps[iComp].iMatchProg].enmOpCode
+ == RTPATHMATCHOP_STRCMP
+ || pGlob->MatchInstrAlloc.paInstructions[pGlob->aComps[iComp].iMatchProg].enmOpCode
+ == RTPATHMATCHOP_STRICMP);
+
+ /*
+ * Add the plain text component to the path.
+ */
+ size_t const cch = pGlob->pParsed->aComps[iComp].cch;
+ if (cch + pGlob->aComps[iComp].fDir < sizeof(pGlob->szPath) - offPath)
+ {
+ memcpy(&pGlob->szPath[offPath], &pGlob->pszPattern[pGlob->pParsed->aComps[iComp].off], cch);
+ offPath += cch;
+ pGlob->szPath[offPath] = '\0';
+
+ /*
+ * Check if it exists.
+ */
+ int rc = RTPathQueryInfoEx(pGlob->szPath, &pGlob->u.ObjInfo, RTFSOBJATTRADD_NOTHING, RTPATH_F_ON_LINK);
+ if (RT_SUCCESS(rc))
+ {
+ if (pGlob->aComps[iComp].fFinal)
+ {
+ if (rtPathGlobExecIsMatchFinalWithFileMode(pGlob, pGlob->u.ObjInfo.Attr.fMode))
+ return rtPathGlobAddResult(pGlob, offPath,
+ (pGlob->u.ObjInfo.Attr.fMode & RTFS_TYPE_MASK)
+ >> RTFS_TYPE_DIRENTRYTYPE_SHIFT);
+ break;
+ }
+
+ if (RTFS_IS_DIRECTORY(pGlob->u.ObjInfo.Attr.fMode))
+ {
+ Assert(pGlob->aComps[iComp].fDir);
+ pGlob->szPath[offPath++] = RTPATH_SLASH;
+ pGlob->szPath[offPath] = '\0';
+
+ iComp++;
+ if (rtPathGlobExecIsExpVar(pGlob, offPath, iComp))
+ return rtPathGlobExecRecursiveVarExp(pGlob, offPath, iComp);
+ if (!rtPathGlobExecIsPlainText(pGlob, offPath, iComp))
+ return rtPathGlobExecRecursiveGeneric(pGlob, offPath, iComp);
+ if (pGlob->aComps[pGlob->iFirstComp].fStarStar)
+ return rtPathGlobExecRecursiveStarStar(pGlob, offPath, iComp, offPath);
+
+ /* Continue with the next plain text component. */
+ continue;
+ }
+ }
+ /* else: file doesn't exist or something else is wrong, ignore this. */
+ }
+ else
+ pGlob->cPathOverflows++;
+ break;
+ }
+ return VINF_SUCCESS;
+}
+
+
+/**
+ * Recursive globbing - generic.
+ *
+ * @returns IPRT status code.
+ * @retval VINF_CALLBACK_RETURN is used to implement RTPATHGLOB_F_FIRST_ONLY.
+ *
+ * @param pGlob The glob instance data.
+ * @param offPath The current path offset/length.
+ * @param iComp The current component.
+ */
+DECL_NO_INLINE(static, int) rtPathGlobExecRecursiveGeneric(PRTPATHGLOB pGlob, size_t offPath, uint32_t iComp)
+{
+ /*
+ * Enumerate entire directory and match each entry.
+ */
+ PRTDIR hDir;
+ int rc = RTDirOpen(&hDir, offPath ? pGlob->szPath : ".");
+ if (RT_SUCCESS(rc))
+ {
+ for (;;)
+ {
+ size_t cch = sizeof(pGlob->u);
+ rc = RTDirRead(hDir, &pGlob->u.DirEntry, &cch);
+ if (RT_SUCCESS(rc))
+ {
+ if (pGlob->aComps[iComp].fFinal)
+ {
+ /*
+ * Final component: Check if it matches the current pattern.
+ */
+ if ( !(pGlob->fFlags & (RTPATHGLOB_F_NO_DIRS | RTPATHGLOB_F_ONLY_DIRS))
+ || RT_BOOL(pGlob->fFlags & RTPATHGLOB_F_ONLY_DIRS)
+ == (pGlob->u.DirEntry.enmType == RTDIRENTRYTYPE_DIRECTORY)
+ || pGlob->u.DirEntry.enmType == RTDIRENTRYTYPE_UNKNOWN)
+ {
+ rc = rtPathMatchExec(pGlob->u.DirEntry.szName, pGlob->u.DirEntry.cbName,
+ &pGlob->MatchInstrAlloc.paInstructions[pGlob->aComps[iComp].iMatchProg],
+ &pGlob->MatchCache);
+ if (RT_SUCCESS(rc))
+ {
+ /* Construct the result. */
+ if ( pGlob->u.DirEntry.enmType != RTDIRENTRYTYPE_UNKNOWN
+ || !(pGlob->fFlags & (RTPATHGLOB_F_NO_DIRS | RTPATHGLOB_F_ONLY_DIRS)) )
+ rc = rtPathGlobAddResult2(pGlob, offPath, pGlob->u.DirEntry.szName, pGlob->u.DirEntry.cbName,
+ (uint8_t)pGlob->u.DirEntry.enmType);
+ else
+ {
+ rc = rtPathGlobAlmostAddResult(pGlob, offPath,
+ pGlob->u.DirEntry.szName, pGlob->u.DirEntry.cbName,
+ (uint8_t)RTDIRENTRYTYPE_UNKNOWN);
+ if (RT_SUCCESS(rc))
+ {
+ RTDirQueryUnknownType((*pGlob->ppNext)->szPath, false /*fFollowSymlinks*/,
+ &pGlob->u.DirEntry.enmType);
+ if ( RT_BOOL(pGlob->fFlags & RTPATHGLOB_F_ONLY_DIRS)
+ == (pGlob->u.DirEntry.enmType == RTDIRENTRYTYPE_DIRECTORY))
+ rtPathGlobCommitResult(pGlob, (uint8_t)pGlob->u.DirEntry.enmType);
+ else
+ rtPathGlobRollbackResult(pGlob);
+ }
+ }
+ if (rc != VINF_SUCCESS)
+ break;
+ }
+ else
+ {
+ AssertMsgBreak(rc == VERR_MISMATCH, ("%Rrc\n", rc));
+ rc = VINF_SUCCESS;
+ }
+ }
+ }
+ /*
+ * Intermediate component: Directories only.
+ */
+ else if ( pGlob->u.DirEntry.enmType == RTDIRENTRYTYPE_DIRECTORY
+ || pGlob->u.DirEntry.enmType == RTDIRENTRYTYPE_UNKNOWN)
+ {
+ rc = rtPathMatchExec(pGlob->u.DirEntry.szName, pGlob->u.DirEntry.cbName,
+ &pGlob->MatchInstrAlloc.paInstructions[pGlob->aComps[iComp].iMatchProg],
+ &pGlob->MatchCache);
+ if (RT_SUCCESS(rc))
+ {
+ /* Recurse down into the alleged directory. */
+ cch = offPath + pGlob->u.DirEntry.cbName;
+ if (cch + 1 < sizeof(pGlob->szPath))
+ {
+ memcpy(&pGlob->szPath[offPath], pGlob->u.DirEntry.szName, pGlob->u.DirEntry.cbName);
+ pGlob->szPath[cch++] = RTPATH_SLASH;
+ pGlob->szPath[cch] = '\0';
+
+ if (rtPathGlobExecIsExpVar(pGlob, cch, iComp + 1))
+ rc = rtPathGlobExecRecursiveVarExp(pGlob, cch, iComp + 1);
+ else if (rtPathGlobExecIsPlainText(pGlob, cch, iComp + 1))
+ rc = rtPathGlobExecRecursivePlainText(pGlob, cch, iComp + 1);
+ else if (pGlob->aComps[pGlob->iFirstComp].fStarStar)
+ rc = rtPathGlobExecRecursiveStarStar(pGlob, cch, iComp + 1, cch);
+ else
+ rc = rtPathGlobExecRecursiveGeneric(pGlob, cch, iComp + 1);
+ if (rc != VINF_SUCCESS)
+ return rc;
+ }
+ else
+ pGlob->cPathOverflows++;
+ }
+ else
+ {
+ AssertMsgBreak(rc == VERR_MISMATCH, ("%Rrc\n", rc));
+ rc = VINF_SUCCESS;
+ }
+ }
+ }
+ /*
+ * RTDirRead failure.
+ */
+ else
+ {
+ /* The end? */
+ if (rc == VERR_NO_MORE_FILES)
+ rc = VINF_SUCCESS;
+ /* Try skip the entry if we end up with an overflow (szPath can't hold it either then). */
+ else if (rc == VERR_BUFFER_OVERFLOW)
+ {
+ pGlob->cPathOverflows++;
+ rc = rtPathGlobSkipDirEntry(hDir, cch);
+ if (RT_SUCCESS(rc))
+ continue;
+ }
+ /* else: Any other error is unexpected and should be reported. */
+ break;
+ }
+ }
+
+ RTDirClose(hDir);
+ }
+ /* Directory doesn't exist or something else is wrong, ignore this. */
+ else
+ rc = VINF_SUCCESS;
+ return rc;
+}
+
+
+/**
+ * Executes a glob search.
+ *
+ * @returns IPRT status code.
+ * @param pGlob The glob instance data.
+ */
+static int rtPathGlobExec(PRTPATHGLOB pGlob)
+{
+ Assert(pGlob->offFirstPath < sizeof(pGlob->szPath));
+ Assert(pGlob->szPath[pGlob->offFirstPath] == '\0');
+
+ int rc;
+ if (RT_LIKELY(pGlob->iFirstComp < pGlob->pParsed->cComps))
+ {
+ /*
+ * Call the appropriate function.
+ */
+ if (rtPathGlobExecIsExpVar(pGlob, pGlob->offFirstPath, pGlob->iFirstComp))
+ rc = rtPathGlobExecRecursiveVarExp(pGlob, pGlob->offFirstPath, pGlob->iFirstComp);
+ else if (rtPathGlobExecIsPlainText(pGlob, pGlob->offFirstPath, pGlob->iFirstComp))
+ rc = rtPathGlobExecRecursivePlainText(pGlob, pGlob->offFirstPath, pGlob->iFirstComp);
+ else if (pGlob->aComps[pGlob->iFirstComp].fStarStar)
+ rc = rtPathGlobExecRecursiveStarStar(pGlob, pGlob->offFirstPath, pGlob->iFirstComp, pGlob->offFirstPath);
+ else
+ rc = rtPathGlobExecRecursiveGeneric(pGlob, pGlob->offFirstPath, pGlob->iFirstComp);
+ }
+ else
+ {
+ /*
+ * Special case where we only have a root component or tilde expansion.
+ */
+ Assert(pGlob->offFirstPath > 0);
+ rc = RTPathQueryInfoEx(pGlob->szPath, &pGlob->u.ObjInfo, RTFSOBJATTRADD_NOTHING, RTPATH_F_ON_LINK);
+ if ( RT_SUCCESS(rc)
+ && rtPathGlobExecIsMatchFinalWithFileMode(pGlob, pGlob->u.ObjInfo.Attr.fMode))
+ rc = rtPathGlobAddResult(pGlob, pGlob->offFirstPath,
+ (pGlob->u.ObjInfo.Attr.fMode & RTFS_TYPE_MASK) >> RTFS_TYPE_DIRENTRYTYPE_SHIFT);
+ else
+ rc = VINF_SUCCESS;
+ }
+
+ /*
+ * Adjust the status code. Check for results, hide RTPATHGLOB_F_FIRST_ONLY
+ * status code, and add warning if necessary.
+ */
+ if (pGlob->cResults > 0)
+ {
+ if (rc == VINF_CALLBACK_RETURN)
+ rc = VINF_SUCCESS;
+ if (rc == VINF_SUCCESS)
+ {
+ if (pGlob->cPathOverflows > 0)
+ rc = VINF_BUFFER_OVERFLOW;
+ }
+ }
+ else
+ rc = VERR_FILE_NOT_FOUND;
+
+ return rc;
+}
+
+
+RTDECL(int) RTPathGlob(const char *pszPattern, uint32_t fFlags, PPCRTPATHGLOBENTRY ppHead, uint32_t *pcResults)
+{
+ /*
+ * Input validation.
+ */
+ AssertPtrReturn(ppHead, VERR_INVALID_POINTER);
+ *ppHead = NULL;
+ if (pcResults)
+ {
+ AssertPtrReturn(pcResults, VERR_INVALID_POINTER);
+ *pcResults = 0;
+ }
+ AssertPtrReturn(pszPattern, VERR_INVALID_POINTER);
+ AssertReturn(!(fFlags & ~RTPATHGLOB_F_MASK), VERR_INVALID_FLAGS);
+ AssertReturn((fFlags & (RTPATHGLOB_F_NO_DIRS | RTPATHGLOB_F_ONLY_DIRS)) != (RTPATHGLOB_F_NO_DIRS | RTPATHGLOB_F_ONLY_DIRS),
+ VERR_INVALID_FLAGS);
+
+ /*
+ * Parse the path.
+ */
+ size_t cbParsed = RT_OFFSETOF(RTPATHPARSED, aComps[1]); /** @todo 16 after testing */
+ PRTPATHPARSED pParsed = (PRTPATHPARSED)RTMemTmpAlloc(cbParsed);
+ AssertReturn(pParsed, VERR_NO_MEMORY);
+ int rc = RTPathParse(pszPattern, pParsed, cbParsed, RTPATH_STR_F_STYLE_HOST);
+ if (rc == VERR_BUFFER_OVERFLOW)
+ {
+ RTMemTmpFree(pParsed);
+ cbParsed = RT_OFFSETOF(RTPATHPARSED, aComps[pParsed->cComps + 1]);
+ pParsed = (PRTPATHPARSED)RTMemTmpAlloc(cbParsed);
+ AssertReturn(pParsed, VERR_NO_MEMORY);
+
+ rc = RTPathParse(pszPattern, pParsed, cbParsed, RTPATH_STR_F_STYLE_HOST);
+ }
+ if (RT_SUCCESS(rc))
+ {
+ /*
+ * Check dir slash vs. only/not dir flag.
+ */
+ if ( !(fFlags & RTPATHGLOB_F_NO_DIRS)
+ || ( !(pParsed->fProps & RTPATH_PROP_DIR_SLASH)
+ && ( !(pParsed->fProps & (RTPATH_PROP_ROOT_SLASH | RTPATH_PROP_UNC))
+ || pParsed->cComps > 1) ) )
+ {
+ if (pParsed->fProps & RTPATH_PROP_DIR_SLASH)
+ fFlags |= RTPATHGLOB_F_ONLY_DIRS;
+
+ /*
+ * Allocate and initialize the glob state data structure.
+ */
+ size_t cbGlob = RT_OFFSETOF(RTPATHGLOB, aComps[pParsed->cComps + 1]);
+ PRTPATHGLOB pGlob = (PRTPATHGLOB)RTMemTmpAllocZ(cbGlob);
+ if (pGlob)
+ {
+ pGlob->pszPattern = pszPattern;
+ pGlob->fFlags = fFlags;
+ pGlob->pParsed = pParsed;
+ pGlob->ppNext = &pGlob->pHead;
+ rc = rtPathGlobParse(pGlob, pszPattern, pParsed, fFlags);
+ if (RT_SUCCESS(rc))
+ {
+ /*
+ * Execute the search.
+ */
+ rc = rtPathGlobExec(pGlob);
+ if (RT_SUCCESS(rc))
+ {
+ *ppHead = pGlob->pHead;
+ if (pcResults)
+ *pcResults = pGlob->cResults;
+ }
+ else
+ RTPathGlobFree(pGlob->pHead);
+ }
+
+ RTMemTmpFree(pGlob->MatchInstrAlloc.paInstructions);
+ RTMemTmpFree(pGlob);
+ }
+ else
+ rc = VERR_NO_MEMORY;
+ }
+ else
+ rc = VERR_NOT_FOUND;
+ }
+ RTMemTmpFree(pParsed);
+ return rc;
+
+
+}
+
+
+RTDECL(void) RTPathGlobFree(PCRTPATHGLOBENTRY pHead)
+{
+ PRTPATHGLOBENTRY pCur = (PRTPATHGLOBENTRY)pHead;
+ while (pCur)
+ {
+ PRTPATHGLOBENTRY pNext = pCur->pNext;
+ pCur->pNext = NULL;
+ RTMemFree(pCur);
+ pCur = pNext;
+ }
+}
+
diff --git a/src/VBox/Runtime/common/path/RTPathHasExt.cpp b/src/VBox/Runtime/common/path/RTPathHasExt.cpp
index abe419a..f45a363 100644
--- a/src/VBox/Runtime/common/path/RTPathHasExt.cpp
+++ b/src/VBox/Runtime/common/path/RTPathHasExt.cpp
@@ -25,9 +25,9 @@
*/
-/*******************************************************************************
-* Header Files *
-*******************************************************************************/
+/*********************************************************************************************************************************
+* Header Files *
+*********************************************************************************************************************************/
#include "internal/iprt.h"
#include <iprt/path.h>
diff --git a/src/VBox/Runtime/common/path/RTPathHasPath.cpp b/src/VBox/Runtime/common/path/RTPathHasPath.cpp
index 4352e5e..7573713 100644
--- a/src/VBox/Runtime/common/path/RTPathHasPath.cpp
+++ b/src/VBox/Runtime/common/path/RTPathHasPath.cpp
@@ -25,9 +25,9 @@
*/
-/*******************************************************************************
-* Header Files *
-*******************************************************************************/
+/*********************************************************************************************************************************
+* Header Files *
+*********************************************************************************************************************************/
#include "internal/iprt.h"
#include <iprt/path.h>
#include <iprt/string.h>
diff --git a/src/VBox/Runtime/common/path/RTPathJoin.cpp b/src/VBox/Runtime/common/path/RTPathJoin.cpp
index d9b9d0e..42445d9 100644
--- a/src/VBox/Runtime/common/path/RTPathJoin.cpp
+++ b/src/VBox/Runtime/common/path/RTPathJoin.cpp
@@ -25,9 +25,9 @@
*/
-/*******************************************************************************
-* Header Files *
-*******************************************************************************/
+/*********************************************************************************************************************************
+* Header Files *
+*********************************************************************************************************************************/
#include "internal/iprt.h"
#include <iprt/path.h>
#include <iprt/assert.h>
diff --git a/src/VBox/Runtime/common/path/RTPathJoinA.cpp b/src/VBox/Runtime/common/path/RTPathJoinA.cpp
index 0be4fcf..0ef390b 100644
--- a/src/VBox/Runtime/common/path/RTPathJoinA.cpp
+++ b/src/VBox/Runtime/common/path/RTPathJoinA.cpp
@@ -25,9 +25,9 @@
*/
-/*******************************************************************************
-* Header Files *
-*******************************************************************************/
+/*********************************************************************************************************************************
+* Header Files *
+*********************************************************************************************************************************/
#include "internal/iprt.h"
#include <iprt/path.h>
#include <iprt/assert.h>
diff --git a/src/VBox/Runtime/common/path/RTPathJoinEx.cpp b/src/VBox/Runtime/common/path/RTPathJoinEx.cpp
index 3822642..58be05c 100644
--- a/src/VBox/Runtime/common/path/RTPathJoinEx.cpp
+++ b/src/VBox/Runtime/common/path/RTPathJoinEx.cpp
@@ -25,9 +25,9 @@
*/
-/*******************************************************************************
-* Header Files *
-*******************************************************************************/
+/*********************************************************************************************************************************
+* Header Files *
+*********************************************************************************************************************************/
#include "internal/iprt.h"
#include <iprt/path.h>
#include <iprt/assert.h>
diff --git a/src/VBox/Runtime/common/path/RTPathParse.cpp b/src/VBox/Runtime/common/path/RTPathParse.cpp
index cb8dae6..2e9d497 100644
--- a/src/VBox/Runtime/common/path/RTPathParse.cpp
+++ b/src/VBox/Runtime/common/path/RTPathParse.cpp
@@ -25,9 +25,9 @@
*/
-/*******************************************************************************
-* Header Files *
-*******************************************************************************/
+/*********************************************************************************************************************************
+* Header Files *
+*********************************************************************************************************************************/
#include "internal/iprt.h"
#include <iprt/path.h>
diff --git a/src/VBox/Runtime/common/path/RTPathParseSimple.cpp b/src/VBox/Runtime/common/path/RTPathParseSimple.cpp
index 060096c..d897ca7 100644
--- a/src/VBox/Runtime/common/path/RTPathParseSimple.cpp
+++ b/src/VBox/Runtime/common/path/RTPathParseSimple.cpp
@@ -25,9 +25,9 @@
*/
-/*******************************************************************************
-* Header Files *
-*******************************************************************************/
+/*********************************************************************************************************************************
+* Header Files *
+*********************************************************************************************************************************/
#include "internal/iprt.h"
#include <iprt/path.h>
diff --git a/src/VBox/Runtime/common/path/RTPathParsedReassemble.cpp b/src/VBox/Runtime/common/path/RTPathParsedReassemble.cpp
index bdc8cce..7d4bebb 100644
--- a/src/VBox/Runtime/common/path/RTPathParsedReassemble.cpp
+++ b/src/VBox/Runtime/common/path/RTPathParsedReassemble.cpp
@@ -25,9 +25,9 @@
*/
-/*******************************************************************************
-* Header Files *
-*******************************************************************************/
+/*********************************************************************************************************************************
+* Header Files *
+*********************************************************************************************************************************/
#include "internal/iprt.h"
#include <iprt/path.h>
diff --git a/src/VBox/Runtime/common/path/RTPathRealDup.cpp b/src/VBox/Runtime/common/path/RTPathRealDup.cpp
index e87ed44..b7a93eb 100644
--- a/src/VBox/Runtime/common/path/RTPathRealDup.cpp
+++ b/src/VBox/Runtime/common/path/RTPathRealDup.cpp
@@ -25,9 +25,9 @@
*/
-/*******************************************************************************
-* Header Files *
-*******************************************************************************/
+/*********************************************************************************************************************************
+* Header Files *
+*********************************************************************************************************************************/
#include "internal/iprt.h"
#include <iprt/path.h>
#include <iprt/err.h>
diff --git a/src/VBox/Runtime/common/path/RTPathRmCmd.cpp b/src/VBox/Runtime/common/path/RTPathRmCmd.cpp
index 3203f56..96980ab 100644
--- a/src/VBox/Runtime/common/path/RTPathRmCmd.cpp
+++ b/src/VBox/Runtime/common/path/RTPathRmCmd.cpp
@@ -25,9 +25,9 @@
*/
-/*******************************************************************************
-* Header Files *
-*******************************************************************************/
+/*********************************************************************************************************************************
+* Header Files *
+*********************************************************************************************************************************/
#include <iprt/path.h>
#include <iprt/buildconfig.h>
@@ -42,9 +42,9 @@
#include <iprt/symlink.h>
-/*******************************************************************************
-* Defined Constants And Macros *
-*******************************************************************************/
+/*********************************************************************************************************************************
+* Defined Constants And Macros *
+*********************************************************************************************************************************/
#define RTPATHRMCMD_OPT_INTERACTIVE 1000
#define RTPATHRMCMD_OPT_ONE_FILE_SYSTEM 1001
#define RTPATHRMCMD_OPT_PRESERVE_ROOT 1002
@@ -55,9 +55,9 @@
#define RTPATHRM_DIR_MAX_ENTRY_SIZE (sizeof(RTDIRENTRYEX) + 4096)
-/*******************************************************************************
-* Structures and Typedefs *
-*******************************************************************************/
+/*********************************************************************************************************************************
+* Structures and Typedefs *
+*********************************************************************************************************************************/
/** Interactive option. */
typedef enum
{
@@ -97,9 +97,9 @@ typedef struct RTPATHRMCMDOPTS
typedef RTPATHRMCMDOPTS *PRTPATHRMCMDOPTS;
-/*******************************************************************************
-* Global Variables *
-*******************************************************************************/
+/*********************************************************************************************************************************
+* Global Variables *
+*********************************************************************************************************************************/
/** A bunch of zeros. */
static uint8_t const g_abZeros[16384] = { 0 };
/** A bunch of 0xFF bytes. (lazy init) */
diff --git a/src/VBox/Runtime/common/path/RTPathSplit.cpp b/src/VBox/Runtime/common/path/RTPathSplit.cpp
index bf0428e..df1ecb9 100644
--- a/src/VBox/Runtime/common/path/RTPathSplit.cpp
+++ b/src/VBox/Runtime/common/path/RTPathSplit.cpp
@@ -25,9 +25,9 @@
*/
-/*******************************************************************************
-* Header Files *
-*******************************************************************************/
+/*********************************************************************************************************************************
+* Header Files *
+*********************************************************************************************************************************/
#include "internal/iprt.h"
#include <iprt/path.h>
diff --git a/src/VBox/Runtime/common/path/RTPathSplitA.cpp b/src/VBox/Runtime/common/path/RTPathSplitA.cpp
index f53af0f..7c14eda 100644
--- a/src/VBox/Runtime/common/path/RTPathSplitA.cpp
+++ b/src/VBox/Runtime/common/path/RTPathSplitA.cpp
@@ -25,9 +25,9 @@
*/
-/*******************************************************************************
-* Header Files *
-*******************************************************************************/
+/*********************************************************************************************************************************
+* Header Files *
+*********************************************************************************************************************************/
#include "internal/iprt.h"
#include <iprt/path.h>
diff --git a/src/VBox/Runtime/common/path/RTPathSplitReassemble.cpp b/src/VBox/Runtime/common/path/RTPathSplitReassemble.cpp
index a6d164e..24343a3 100644
--- a/src/VBox/Runtime/common/path/RTPathSplitReassemble.cpp
+++ b/src/VBox/Runtime/common/path/RTPathSplitReassemble.cpp
@@ -25,9 +25,9 @@
*/
-/*******************************************************************************
-* Header Files *
-*******************************************************************************/
+/*********************************************************************************************************************************
+* Header Files *
+*********************************************************************************************************************************/
#include "internal/iprt.h"
#include <iprt/path.h>
diff --git a/src/VBox/Runtime/common/path/RTPathStartsWithRoot.cpp b/src/VBox/Runtime/common/path/RTPathStartsWithRoot.cpp
index 6d44fa1..f89f12c 100644
--- a/src/VBox/Runtime/common/path/RTPathStartsWithRoot.cpp
+++ b/src/VBox/Runtime/common/path/RTPathStartsWithRoot.cpp
@@ -25,9 +25,9 @@
*/
-/*******************************************************************************
-* Header Files *
-*******************************************************************************/
+/*********************************************************************************************************************************
+* Header Files *
+*********************************************************************************************************************************/
#include "internal/iprt.h"
#include <iprt/path.h>
diff --git a/src/VBox/Runtime/common/path/RTPathStripExt.cpp b/src/VBox/Runtime/common/path/RTPathStripExt.cpp
index f0b32b0..ee2f7cc 100644
--- a/src/VBox/Runtime/common/path/RTPathStripExt.cpp
+++ b/src/VBox/Runtime/common/path/RTPathStripExt.cpp
@@ -25,9 +25,9 @@
*/
-/*******************************************************************************
-* Header Files *
-*******************************************************************************/
+/*********************************************************************************************************************************
+* Header Files *
+*********************************************************************************************************************************/
#include "internal/iprt.h"
#include <iprt/path.h>
#include <iprt/string.h>
diff --git a/src/VBox/Runtime/common/path/RTPathStripFilename.cpp b/src/VBox/Runtime/common/path/RTPathStripFilename.cpp
index adf0c20..66cf98c 100644
--- a/src/VBox/Runtime/common/path/RTPathStripFilename.cpp
+++ b/src/VBox/Runtime/common/path/RTPathStripFilename.cpp
@@ -25,9 +25,9 @@
*/
-/*******************************************************************************
-* Header Files *
-*******************************************************************************/
+/*********************************************************************************************************************************
+* Header Files *
+*********************************************************************************************************************************/
#include "internal/iprt.h"
#include <iprt/path.h>
#include <iprt/ctype.h>
diff --git a/src/VBox/Runtime/common/path/RTPathStripTrailingSlash.cpp b/src/VBox/Runtime/common/path/RTPathStripTrailingSlash.cpp
index 8a560be..bde6d10 100644
--- a/src/VBox/Runtime/common/path/RTPathStripTrailingSlash.cpp
+++ b/src/VBox/Runtime/common/path/RTPathStripTrailingSlash.cpp
@@ -25,9 +25,9 @@
*/
-/*******************************************************************************
-* Header Files *
-*******************************************************************************/
+/*********************************************************************************************************************************
+* Header Files *
+*********************************************************************************************************************************/
#include "internal/iprt.h"
#include <iprt/path.h>
#include <iprt/string.h>
diff --git a/src/VBox/Runtime/common/path/RTPathTraverseList.cpp b/src/VBox/Runtime/common/path/RTPathTraverseList.cpp
index 0913fe5..aff30c3 100644
--- a/src/VBox/Runtime/common/path/RTPathTraverseList.cpp
+++ b/src/VBox/Runtime/common/path/RTPathTraverseList.cpp
@@ -25,9 +25,9 @@
*/
-/*******************************************************************************
-* Header Files *
-*******************************************************************************/
+/*********************************************************************************************************************************
+* Header Files *
+*********************************************************************************************************************************/
#include "internal/iprt.h"
#include <iprt/path.h>
diff --git a/src/VBox/Runtime/common/path/comparepaths.cpp b/src/VBox/Runtime/common/path/comparepaths.cpp
index cda6c9b..cb9b273 100644
--- a/src/VBox/Runtime/common/path/comparepaths.cpp
+++ b/src/VBox/Runtime/common/path/comparepaths.cpp
@@ -25,9 +25,9 @@
*/
-/*******************************************************************************
-* Header Files *
-*******************************************************************************/
+/*********************************************************************************************************************************
+* Header Files *
+*********************************************************************************************************************************/
#include "internal/iprt.h"
#include <iprt/path.h>
#include <iprt/err.h>
diff --git a/src/VBox/Runtime/common/path/rtPathRootSpecLen.cpp b/src/VBox/Runtime/common/path/rtPathRootSpecLen.cpp
index ec94ead..383b6ab 100644
--- a/src/VBox/Runtime/common/path/rtPathRootSpecLen.cpp
+++ b/src/VBox/Runtime/common/path/rtPathRootSpecLen.cpp
@@ -25,9 +25,9 @@
*/
-/*******************************************************************************
-* Header Files *
-*******************************************************************************/
+/*********************************************************************************************************************************
+* Header Files *
+*********************************************************************************************************************************/
#include "internal/iprt.h"
#include <iprt/path.h>
diff --git a/src/VBox/Runtime/common/path/rtPathVolumeSpecLen.cpp b/src/VBox/Runtime/common/path/rtPathVolumeSpecLen.cpp
index 7101cf5..aa101fe 100644
--- a/src/VBox/Runtime/common/path/rtPathVolumeSpecLen.cpp
+++ b/src/VBox/Runtime/common/path/rtPathVolumeSpecLen.cpp
@@ -25,9 +25,9 @@
*/
-/*******************************************************************************
-* Header Files *
-*******************************************************************************/
+/*********************************************************************************************************************************
+* Header Files *
+*********************************************************************************************************************************/
#include "internal/iprt.h"
#include <iprt/string.h>
#include <iprt/ctype.h>
diff --git a/src/VBox/Runtime/common/rand/rand.cpp b/src/VBox/Runtime/common/rand/rand.cpp
index 081abeb..471ab54 100644
--- a/src/VBox/Runtime/common/rand/rand.cpp
+++ b/src/VBox/Runtime/common/rand/rand.cpp
@@ -25,9 +25,9 @@
*/
-/*******************************************************************************
-* Header Files *
-*******************************************************************************/
+/*********************************************************************************************************************************
+* Header Files *
+*********************************************************************************************************************************/
#include <iprt/rand.h>
#include "internal/iprt.h"
@@ -42,9 +42,9 @@
#include "internal/rand.h"
-/*******************************************************************************
-* Global Variables *
-*******************************************************************************/
+/*********************************************************************************************************************************
+* Global Variables *
+*********************************************************************************************************************************/
/** For lazily initializing of the random generator. */
static RTONCE g_rtRandOnce = RTONCE_INITIALIZER;
/** The default random generator. */
@@ -103,7 +103,7 @@ static DECLCALLBACK(void) rtRandTermOnce(void *pvUser, bool fLazyCleanUpOk)
}
-RTDECL(void) RTRandBytes(void *pv, size_t cb) RT_NO_THROW
+RTDECL(void) RTRandBytes(void *pv, size_t cb) RT_NO_THROW_DEF
{
RTOnceEx(&g_rtRandOnce, rtRandInitOnce, rtRandTermOnce, NULL);
RTRandAdvBytes(g_hRand, pv, cb);
@@ -111,7 +111,7 @@ RTDECL(void) RTRandBytes(void *pv, size_t cb) RT_NO_THROW
RT_EXPORT_SYMBOL(RTRandBytes);
-RTDECL(uint32_t) RTRandU32Ex(uint32_t u32First, uint32_t u32Last) RT_NO_THROW
+RTDECL(uint32_t) RTRandU32Ex(uint32_t u32First, uint32_t u32Last) RT_NO_THROW_DEF
{
RTOnceEx(&g_rtRandOnce, rtRandInitOnce, rtRandTermOnce, NULL);
return RTRandAdvU32Ex(g_hRand, u32First, u32Last);
@@ -119,7 +119,7 @@ RTDECL(uint32_t) RTRandU32Ex(uint32_t u32First, uint32_t u32Last) RT_NO_THROW
RT_EXPORT_SYMBOL(RTRandU32Ex);
-RTDECL(uint32_t) RTRandU32(void) RT_NO_THROW
+RTDECL(uint32_t) RTRandU32(void) RT_NO_THROW_DEF
{
RTOnceEx(&g_rtRandOnce, rtRandInitOnce, rtRandTermOnce, NULL);
return RTRandAdvU32(g_hRand);
@@ -127,7 +127,7 @@ RTDECL(uint32_t) RTRandU32(void) RT_NO_THROW
RT_EXPORT_SYMBOL(RTRandU32);
-RTDECL(int32_t) RTRandS32Ex(int32_t i32First, int32_t i32Last) RT_NO_THROW
+RTDECL(int32_t) RTRandS32Ex(int32_t i32First, int32_t i32Last) RT_NO_THROW_DEF
{
RTOnceEx(&g_rtRandOnce, rtRandInitOnce, rtRandTermOnce, NULL);
return RTRandAdvS32Ex(g_hRand, i32First, i32Last);
@@ -135,7 +135,7 @@ RTDECL(int32_t) RTRandS32Ex(int32_t i32First, int32_t i32Last) RT_NO_THROW
RT_EXPORT_SYMBOL(RTRandS32Ex);
-RTDECL(int32_t) RTRandS32(void) RT_NO_THROW
+RTDECL(int32_t) RTRandS32(void) RT_NO_THROW_DEF
{
RTOnceEx(&g_rtRandOnce, rtRandInitOnce, rtRandTermOnce, NULL);
return RTRandAdvS32(g_hRand);
@@ -143,7 +143,7 @@ RTDECL(int32_t) RTRandS32(void) RT_NO_THROW
RT_EXPORT_SYMBOL(RTRandS32);
-RTDECL(uint64_t) RTRandU64Ex(uint64_t u64First, uint64_t u64Last) RT_NO_THROW
+RTDECL(uint64_t) RTRandU64Ex(uint64_t u64First, uint64_t u64Last) RT_NO_THROW_DEF
{
RTOnceEx(&g_rtRandOnce, rtRandInitOnce, rtRandTermOnce, NULL);
return RTRandAdvU64Ex(g_hRand, u64First, u64Last);
@@ -151,7 +151,7 @@ RTDECL(uint64_t) RTRandU64Ex(uint64_t u64First, uint64_t u64Last) RT_NO_THROW
RT_EXPORT_SYMBOL(RTRandU64Ex);
-RTDECL(uint64_t) RTRandU64(void) RT_NO_THROW
+RTDECL(uint64_t) RTRandU64(void) RT_NO_THROW_DEF
{
RTOnceEx(&g_rtRandOnce, rtRandInitOnce, rtRandTermOnce, NULL);
return RTRandAdvU64(g_hRand);
@@ -159,7 +159,7 @@ RTDECL(uint64_t) RTRandU64(void) RT_NO_THROW
RT_EXPORT_SYMBOL(RTRandU64);
-RTDECL(int64_t) RTRandS64Ex(int64_t i64First, int64_t i64Last) RT_NO_THROW
+RTDECL(int64_t) RTRandS64Ex(int64_t i64First, int64_t i64Last) RT_NO_THROW_DEF
{
RTOnceEx(&g_rtRandOnce, rtRandInitOnce, rtRandTermOnce, NULL);
return RTRandAdvS64Ex(g_hRand, i64First, i64Last);
@@ -167,7 +167,7 @@ RTDECL(int64_t) RTRandS64Ex(int64_t i64First, int64_t i64Last) RT_NO_THROW
RT_EXPORT_SYMBOL(RTRandS64Ex);
-RTDECL(int64_t) RTRandS64(void) RT_NO_THROW
+RTDECL(int64_t) RTRandS64(void) RT_NO_THROW_DEF
{
RTOnceEx(&g_rtRandOnce, rtRandInitOnce, rtRandTermOnce, NULL);
return RTRandAdvS32(g_hRand);
diff --git a/src/VBox/Runtime/common/rand/randadv.cpp b/src/VBox/Runtime/common/rand/randadv.cpp
index 8bbac46..081c1bd 100644
--- a/src/VBox/Runtime/common/rand/randadv.cpp
+++ b/src/VBox/Runtime/common/rand/randadv.cpp
@@ -25,9 +25,9 @@
*/
-/*******************************************************************************
-* Header Files *
-*******************************************************************************/
+/*********************************************************************************************************************************
+* Header Files *
+*********************************************************************************************************************************/
#include <iprt/rand.h>
#include "internal/iprt.h"
@@ -38,7 +38,7 @@
#include "internal/rand.h"
-RTDECL(int) RTRandAdvDestroy(RTRAND hRand) RT_NO_THROW
+RTDECL(int) RTRandAdvDestroy(RTRAND hRand) RT_NO_THROW_DEF
{
/* Validate. */
if (hRand == NIL_RTRAND)
@@ -53,7 +53,7 @@ RTDECL(int) RTRandAdvDestroy(RTRAND hRand) RT_NO_THROW
RT_EXPORT_SYMBOL(RTRandAdvDestroy);
-RTDECL(int) RTRandAdvSeed(RTRAND hRand, uint64_t u64Seed) RT_NO_THROW
+RTDECL(int) RTRandAdvSeed(RTRAND hRand, uint64_t u64Seed) RT_NO_THROW_DEF
{
/* Validate. */
PRTRANDINT pThis = hRand;
@@ -66,7 +66,7 @@ RTDECL(int) RTRandAdvSeed(RTRAND hRand, uint64_t u64Seed) RT_NO_THROW
RT_EXPORT_SYMBOL(RTRandAdvSeed);
-RTDECL(int) RTRandAdvSaveState(RTRAND hRand, char *pszState, size_t *pcbState) RT_NO_THROW
+RTDECL(int) RTRandAdvSaveState(RTRAND hRand, char *pszState, size_t *pcbState) RT_NO_THROW_DEF
{
/* Validate. */
PRTRANDINT pThis = hRand;
@@ -81,7 +81,7 @@ RTDECL(int) RTRandAdvSaveState(RTRAND hRand, char *pszState, size_t *pcbState) R
RT_EXPORT_SYMBOL(RTRandAdvSaveState);
-RTDECL(int) RTRandAdvRestoreState(RTRAND hRand, char const *pszState) RT_NO_THROW
+RTDECL(int) RTRandAdvRestoreState(RTRAND hRand, char const *pszState) RT_NO_THROW_DEF
{
/* Validate. */
PRTRANDINT pThis = hRand;
@@ -95,7 +95,7 @@ RTDECL(int) RTRandAdvRestoreState(RTRAND hRand, char const *pszState) RT_NO_THRO
RT_EXPORT_SYMBOL(RTRandAdvRestoreState);
-RTDECL(void) RTRandAdvBytes(RTRAND hRand, void *pv, size_t cb) RT_NO_THROW
+RTDECL(void) RTRandAdvBytes(RTRAND hRand, void *pv, size_t cb) RT_NO_THROW_DEF
{
/* Validate. */
PRTRANDINT pThis = hRand;
@@ -109,7 +109,7 @@ RTDECL(void) RTRandAdvBytes(RTRAND hRand, void *pv, size_t cb) RT_NO_THROW
RT_EXPORT_SYMBOL(RTRandAdvBytes);
-RTDECL(int32_t) RTRandAdvS32Ex(RTRAND hRand, int32_t i32First, int32_t i32Last) RT_NO_THROW
+RTDECL(int32_t) RTRandAdvS32Ex(RTRAND hRand, int32_t i32First, int32_t i32Last) RT_NO_THROW_DEF
{
/* Validate. */
PRTRANDINT pThis = hRand;
@@ -122,7 +122,7 @@ RTDECL(int32_t) RTRandAdvS32Ex(RTRAND hRand, int32_t i32First, int32_t i32Last)
RT_EXPORT_SYMBOL(RTRandAdvS32Ex);
-RTDECL(int32_t) RTRandAdvS32(RTRAND hRand) RT_NO_THROW
+RTDECL(int32_t) RTRandAdvS32(RTRAND hRand) RT_NO_THROW_DEF
{
/* Validate. */
PRTRANDINT pThis = hRand;
@@ -135,7 +135,7 @@ RTDECL(int32_t) RTRandAdvS32(RTRAND hRand) RT_NO_THROW
RT_EXPORT_SYMBOL(RTRandAdvS32);
-RTDECL(uint32_t) RTRandAdvU32Ex(RTRAND hRand, uint32_t u32First, uint32_t u32Last) RT_NO_THROW
+RTDECL(uint32_t) RTRandAdvU32Ex(RTRAND hRand, uint32_t u32First, uint32_t u32Last) RT_NO_THROW_DEF
{
/* Validate. */
PRTRANDINT pThis = hRand;
@@ -148,7 +148,7 @@ RTDECL(uint32_t) RTRandAdvU32Ex(RTRAND hRand, uint32_t u32First, uint32_t u32Las
RT_EXPORT_SYMBOL(RTRandAdvU32Ex);
-RTDECL(uint32_t) RTRandAdvU32(RTRAND hRand) RT_NO_THROW
+RTDECL(uint32_t) RTRandAdvU32(RTRAND hRand) RT_NO_THROW_DEF
{
/* Validate. */
PRTRANDINT pThis = hRand;
@@ -161,7 +161,7 @@ RTDECL(uint32_t) RTRandAdvU32(RTRAND hRand) RT_NO_THROW
RT_EXPORT_SYMBOL(RTRandAdvU32);
-RTDECL(int64_t) RTRandAdvS64Ex(RTRAND hRand, int64_t i64First, int64_t i64Last) RT_NO_THROW
+RTDECL(int64_t) RTRandAdvS64Ex(RTRAND hRand, int64_t i64First, int64_t i64Last) RT_NO_THROW_DEF
{
/* Validate. */
PRTRANDINT pThis = hRand;
@@ -174,7 +174,7 @@ RTDECL(int64_t) RTRandAdvS64Ex(RTRAND hRand, int64_t i64First, int64_t i64Last)
RT_EXPORT_SYMBOL(RTRandAdvS64Ex);
-RTDECL(int64_t) RTRandAdvS64(RTRAND hRand) RT_NO_THROW
+RTDECL(int64_t) RTRandAdvS64(RTRAND hRand) RT_NO_THROW_DEF
{
/* Validate. */
PRTRANDINT pThis = hRand;
@@ -187,7 +187,7 @@ RTDECL(int64_t) RTRandAdvS64(RTRAND hRand) RT_NO_THROW
RT_EXPORT_SYMBOL(RTRandAdvS64);
-RTDECL(uint64_t) RTRandAdvU64Ex(RTRAND hRand, uint64_t u64First, uint64_t u64Last) RT_NO_THROW
+RTDECL(uint64_t) RTRandAdvU64Ex(RTRAND hRand, uint64_t u64First, uint64_t u64Last) RT_NO_THROW_DEF
{
/* Validate. */
PRTRANDINT pThis = hRand;
@@ -200,7 +200,7 @@ RTDECL(uint64_t) RTRandAdvU64Ex(RTRAND hRand, uint64_t u64First, uint64_t u64Las
RT_EXPORT_SYMBOL(RTRandAdvU64Ex);
-RTDECL(uint64_t) RTRandAdvU64(RTRAND hRand) RT_NO_THROW
+RTDECL(uint64_t) RTRandAdvU64(RTRAND hRand) RT_NO_THROW_DEF
{
/* Validate. */
PRTRANDINT pThis = hRand;
diff --git a/src/VBox/Runtime/common/rand/randparkmiller.cpp b/src/VBox/Runtime/common/rand/randparkmiller.cpp
index 16d5cd1..bebb84b 100644
--- a/src/VBox/Runtime/common/rand/randparkmiller.cpp
+++ b/src/VBox/Runtime/common/rand/randparkmiller.cpp
@@ -24,9 +24,10 @@
* terms and conditions of either the GPL or the CDDL or both.
*/
-/*******************************************************************************
-* Header Files *
-*******************************************************************************/
+
+/*********************************************************************************************************************************
+* Header Files *
+*********************************************************************************************************************************/
#include <iprt/rand.h>
#include "internal/iprt.h"
@@ -186,7 +187,7 @@ static DECLCALLBACK(int) rtRandParkMillerRestoreState(PRTRANDINT pThis, char con
}
-RTDECL(int) RTRandAdvCreateParkMiller(PRTRAND phRand) RT_NO_THROW
+RTDECL(int) RTRandAdvCreateParkMiller(PRTRAND phRand) RT_NO_THROW_DEF
{
PRTRANDINT pThis = (PRTRANDINT)RTMemAlloc(sizeof(*pThis));
if (!pThis)
diff --git a/src/VBox/Runtime/common/sort/RTSortApvIsSorted.cpp b/src/VBox/Runtime/common/sort/RTSortApvIsSorted.cpp
index 7591949..c270958 100644
--- a/src/VBox/Runtime/common/sort/RTSortApvIsSorted.cpp
+++ b/src/VBox/Runtime/common/sort/RTSortApvIsSorted.cpp
@@ -25,9 +25,9 @@
*/
-/*******************************************************************************
-* Header Files *
-*******************************************************************************/
+/*********************************************************************************************************************************
+* Header Files *
+*********************************************************************************************************************************/
#include <iprt/sort.h>
#include "internal/iprt.h"
diff --git a/src/VBox/Runtime/common/sort/RTSortIsSorted.cpp b/src/VBox/Runtime/common/sort/RTSortIsSorted.cpp
index 9bcc4c8..bbd0fd6 100644
--- a/src/VBox/Runtime/common/sort/RTSortIsSorted.cpp
+++ b/src/VBox/Runtime/common/sort/RTSortIsSorted.cpp
@@ -25,9 +25,9 @@
*/
-/*******************************************************************************
-* Header Files *
-*******************************************************************************/
+/*********************************************************************************************************************************
+* Header Files *
+*********************************************************************************************************************************/
#include <iprt/sort.h>
#include "internal/iprt.h"
diff --git a/src/VBox/Runtime/common/sort/shellsort.cpp b/src/VBox/Runtime/common/sort/shellsort.cpp
index d2719b3..1e672f4 100644
--- a/src/VBox/Runtime/common/sort/shellsort.cpp
+++ b/src/VBox/Runtime/common/sort/shellsort.cpp
@@ -25,9 +25,9 @@
*/
-/*******************************************************************************
-* Header Files *
-*******************************************************************************/
+/*********************************************************************************************************************************
+* Header Files *
+*********************************************************************************************************************************/
#include "internal/iprt.h"
#include <iprt/sort.h>
diff --git a/src/VBox/Runtime/common/string/RTStrCat.cpp b/src/VBox/Runtime/common/string/RTStrCat.cpp
index 024ef8f..204daed 100644
--- a/src/VBox/Runtime/common/string/RTStrCat.cpp
+++ b/src/VBox/Runtime/common/string/RTStrCat.cpp
@@ -25,9 +25,9 @@
*/
-/*******************************************************************************
-* Header Files *
-*******************************************************************************/
+/*********************************************************************************************************************************
+* Header Files *
+*********************************************************************************************************************************/
#include <iprt/string.h>
#include "internal/iprt.h"
diff --git a/src/VBox/Runtime/common/string/RTStrCatEx.cpp b/src/VBox/Runtime/common/string/RTStrCatEx.cpp
index d3a17be..acee7bf 100644
--- a/src/VBox/Runtime/common/string/RTStrCatEx.cpp
+++ b/src/VBox/Runtime/common/string/RTStrCatEx.cpp
@@ -25,9 +25,9 @@
*/
-/*******************************************************************************
-* Header Files *
-*******************************************************************************/
+/*********************************************************************************************************************************
+* Header Files *
+*********************************************************************************************************************************/
#include <iprt/string.h>
#include "internal/iprt.h"
diff --git a/src/VBox/Runtime/common/string/RTStrCatP.cpp b/src/VBox/Runtime/common/string/RTStrCatP.cpp
index f3349a5..6bdbc24 100644
--- a/src/VBox/Runtime/common/string/RTStrCatP.cpp
+++ b/src/VBox/Runtime/common/string/RTStrCatP.cpp
@@ -25,9 +25,9 @@
*/
-/*******************************************************************************
-* Header Files *
-*******************************************************************************/
+/*********************************************************************************************************************************
+* Header Files *
+*********************************************************************************************************************************/
#include <iprt/string.h>
#include "internal/iprt.h"
diff --git a/src/VBox/Runtime/common/string/RTStrCatPEx.cpp b/src/VBox/Runtime/common/string/RTStrCatPEx.cpp
index cff13b8..61ce65e 100644
--- a/src/VBox/Runtime/common/string/RTStrCatPEx.cpp
+++ b/src/VBox/Runtime/common/string/RTStrCatPEx.cpp
@@ -25,9 +25,9 @@
*/
-/*******************************************************************************
-* Header Files *
-*******************************************************************************/
+/*********************************************************************************************************************************
+* Header Files *
+*********************************************************************************************************************************/
#include <iprt/string.h>
#include "internal/iprt.h"
diff --git a/src/VBox/Runtime/common/string/RTStrCmp.cpp b/src/VBox/Runtime/common/string/RTStrCmp.cpp
index 71da42a..f4ba2a5 100644
--- a/src/VBox/Runtime/common/string/RTStrCmp.cpp
+++ b/src/VBox/Runtime/common/string/RTStrCmp.cpp
@@ -25,9 +25,9 @@
*/
-/*******************************************************************************
-* Header Files *
-*******************************************************************************/
+/*********************************************************************************************************************************
+* Header Files *
+*********************************************************************************************************************************/
#include <iprt/string.h>
#include "internal/iprt.h"
diff --git a/src/VBox/Runtime/common/string/RTStrCopy.cpp b/src/VBox/Runtime/common/string/RTStrCopy.cpp
index 6257877..6384664 100644
--- a/src/VBox/Runtime/common/string/RTStrCopy.cpp
+++ b/src/VBox/Runtime/common/string/RTStrCopy.cpp
@@ -25,9 +25,9 @@
*/
-/*******************************************************************************
-* Header Files *
-*******************************************************************************/
+/*********************************************************************************************************************************
+* Header Files *
+*********************************************************************************************************************************/
#include <iprt/string.h>
#include "internal/iprt.h"
diff --git a/src/VBox/Runtime/common/string/RTStrCopyEx.cpp b/src/VBox/Runtime/common/string/RTStrCopyEx.cpp
index ee53f76..90ee4ec 100644
--- a/src/VBox/Runtime/common/string/RTStrCopyEx.cpp
+++ b/src/VBox/Runtime/common/string/RTStrCopyEx.cpp
@@ -25,9 +25,9 @@
*/
-/*******************************************************************************
-* Header Files *
-*******************************************************************************/
+/*********************************************************************************************************************************
+* Header Files *
+*********************************************************************************************************************************/
#include <iprt/string.h>
#include "internal/iprt.h"
diff --git a/src/VBox/Runtime/common/string/RTStrCopyP.cpp b/src/VBox/Runtime/common/string/RTStrCopyP.cpp
index 8b6a260..b642b32 100644
--- a/src/VBox/Runtime/common/string/RTStrCopyP.cpp
+++ b/src/VBox/Runtime/common/string/RTStrCopyP.cpp
@@ -25,9 +25,9 @@
*/
-/*******************************************************************************
-* Header Files *
-*******************************************************************************/
+/*********************************************************************************************************************************
+* Header Files *
+*********************************************************************************************************************************/
#include <iprt/string.h>
#include "internal/iprt.h"
diff --git a/src/VBox/Runtime/common/string/RTStrCopyPEx.cpp b/src/VBox/Runtime/common/string/RTStrCopyPEx.cpp
index 4fca2ba..faa47e3 100644
--- a/src/VBox/Runtime/common/string/RTStrCopyPEx.cpp
+++ b/src/VBox/Runtime/common/string/RTStrCopyPEx.cpp
@@ -25,9 +25,9 @@
*/
-/*******************************************************************************
-* Header Files *
-*******************************************************************************/
+/*********************************************************************************************************************************
+* Header Files *
+*********************************************************************************************************************************/
#include <iprt/string.h>
#include "internal/iprt.h"
diff --git a/src/VBox/Runtime/common/string/RTStrNCmp.cpp b/src/VBox/Runtime/common/string/RTStrNCmp.cpp
index f7a31fb..61953b4 100644
--- a/src/VBox/Runtime/common/string/RTStrNCmp.cpp
+++ b/src/VBox/Runtime/common/string/RTStrNCmp.cpp
@@ -25,9 +25,9 @@
*/
-/*******************************************************************************
-* Header Files *
-*******************************************************************************/
+/*********************************************************************************************************************************
+* Header Files *
+*********************************************************************************************************************************/
#include <iprt/string.h>
#include "internal/iprt.h"
diff --git a/src/VBox/Runtime/common/string/RTStrNLen.cpp b/src/VBox/Runtime/common/string/RTStrNLen.cpp
index faf2020..82f830d 100644
--- a/src/VBox/Runtime/common/string/RTStrNLen.cpp
+++ b/src/VBox/Runtime/common/string/RTStrNLen.cpp
@@ -25,9 +25,9 @@
*/
-/*******************************************************************************
-* Header Files *
-*******************************************************************************/
+/*********************************************************************************************************************************
+* Header Files *
+*********************************************************************************************************************************/
#include <iprt/string.h>
#include "internal/iprt.h"
diff --git a/src/VBox/Runtime/common/string/RTStrNLenEx.cpp b/src/VBox/Runtime/common/string/RTStrNLenEx.cpp
index 26d649f..6a86a33 100644
--- a/src/VBox/Runtime/common/string/RTStrNLenEx.cpp
+++ b/src/VBox/Runtime/common/string/RTStrNLenEx.cpp
@@ -24,9 +24,10 @@
* terms and conditions of either the GPL or the CDDL or both.
*/
-/*******************************************************************************
-* Header Files *
-*******************************************************************************/
+
+/*********************************************************************************************************************************
+* Header Files *
+*********************************************************************************************************************************/
#include <iprt/string.h>
#include "internal/iprt.h"
diff --git a/src/VBox/Runtime/common/string/RTStrPrintHexBytes.cpp b/src/VBox/Runtime/common/string/RTStrPrintHexBytes.cpp
index 07ffd45..31ab028 100644
--- a/src/VBox/Runtime/common/string/RTStrPrintHexBytes.cpp
+++ b/src/VBox/Runtime/common/string/RTStrPrintHexBytes.cpp
@@ -25,9 +25,9 @@
*/
-/*******************************************************************************
-* Header Files *
-*******************************************************************************/
+/*********************************************************************************************************************************
+* Header Files *
+*********************************************************************************************************************************/
#include "internal/iprt.h"
#include <iprt/string.h>
diff --git a/src/VBox/Runtime/common/string/RTStrStr.cpp b/src/VBox/Runtime/common/string/RTStrStr.cpp
index 020208f..7b3c43e 100644
--- a/src/VBox/Runtime/common/string/RTStrStr.cpp
+++ b/src/VBox/Runtime/common/string/RTStrStr.cpp
@@ -25,9 +25,9 @@
*/
-/*******************************************************************************
-* Header Files *
-*******************************************************************************/
+/*********************************************************************************************************************************
+* Header Files *
+*********************************************************************************************************************************/
#include <iprt/string.h>
#include "internal/iprt.h"
diff --git a/src/VBox/Runtime/common/string/RTUtf16Cat.cpp b/src/VBox/Runtime/common/string/RTUtf16Cat.cpp
index b30a023..f98783d 100644
--- a/src/VBox/Runtime/common/string/RTUtf16Cat.cpp
+++ b/src/VBox/Runtime/common/string/RTUtf16Cat.cpp
@@ -25,9 +25,9 @@
*/
-/*******************************************************************************
-* Header Files *
-*******************************************************************************/
+/*********************************************************************************************************************************
+* Header Files *
+*********************************************************************************************************************************/
#include <iprt/string.h>
#include "internal/iprt.h"
diff --git a/src/VBox/Runtime/common/string/RTUtf16CatAscii.cpp b/src/VBox/Runtime/common/string/RTUtf16CatAscii.cpp
index 1e61139..97e6a3c 100644
--- a/src/VBox/Runtime/common/string/RTUtf16CatAscii.cpp
+++ b/src/VBox/Runtime/common/string/RTUtf16CatAscii.cpp
@@ -25,9 +25,9 @@
*/
-/*******************************************************************************
-* Header Files *
-*******************************************************************************/
+/*********************************************************************************************************************************
+* Header Files *
+*********************************************************************************************************************************/
#include <iprt/string.h>
#include "internal/iprt.h"
diff --git a/src/VBox/Runtime/common/string/RTUtf16CmpAscii.cpp b/src/VBox/Runtime/common/string/RTUtf16CmpAscii.cpp
index ee34a82..2ef0842 100644
--- a/src/VBox/Runtime/common/string/RTUtf16CmpAscii.cpp
+++ b/src/VBox/Runtime/common/string/RTUtf16CmpAscii.cpp
@@ -25,9 +25,9 @@
*/
-/*******************************************************************************
-* Header Files *
-*******************************************************************************/
+/*********************************************************************************************************************************
+* Header Files *
+*********************************************************************************************************************************/
#include <iprt/string.h>
#include "internal/iprt.h"
diff --git a/src/VBox/Runtime/common/string/RTUtf16Copy.cpp b/src/VBox/Runtime/common/string/RTUtf16Copy.cpp
index 3e1be00..0e91fdd 100644
--- a/src/VBox/Runtime/common/string/RTUtf16Copy.cpp
+++ b/src/VBox/Runtime/common/string/RTUtf16Copy.cpp
@@ -25,9 +25,9 @@
*/
-/*******************************************************************************
-* Header Files *
-*******************************************************************************/
+/*********************************************************************************************************************************
+* Header Files *
+*********************************************************************************************************************************/
#include <iprt/string.h>
#include "internal/iprt.h"
diff --git a/src/VBox/Runtime/common/string/RTUtf16CopyAscii.cpp b/src/VBox/Runtime/common/string/RTUtf16CopyAscii.cpp
index 5519321..5a7046f 100644
--- a/src/VBox/Runtime/common/string/RTUtf16CopyAscii.cpp
+++ b/src/VBox/Runtime/common/string/RTUtf16CopyAscii.cpp
@@ -25,9 +25,9 @@
*/
-/*******************************************************************************
-* Header Files *
-*******************************************************************************/
+/*********************************************************************************************************************************
+* Header Files *
+*********************************************************************************************************************************/
#include <iprt/string.h>
#include "internal/iprt.h"
diff --git a/src/VBox/Runtime/common/string/RTUtf16End.cpp b/src/VBox/Runtime/common/string/RTUtf16End.cpp
index 873ab03..ba256d6 100644
--- a/src/VBox/Runtime/common/string/RTUtf16End.cpp
+++ b/src/VBox/Runtime/common/string/RTUtf16End.cpp
@@ -25,9 +25,9 @@
*/
-/*******************************************************************************
-* Header Files *
-*******************************************************************************/
+/*********************************************************************************************************************************
+* Header Files *
+*********************************************************************************************************************************/
#include <iprt/string.h>
#include "internal/iprt.h"
diff --git a/src/VBox/Runtime/common/string/RTUtf16ICmpAscii.cpp b/src/VBox/Runtime/common/string/RTUtf16ICmpAscii.cpp
index f87778e..67c0c7c 100644
--- a/src/VBox/Runtime/common/string/RTUtf16ICmpAscii.cpp
+++ b/src/VBox/Runtime/common/string/RTUtf16ICmpAscii.cpp
@@ -25,9 +25,9 @@
*/
-/*******************************************************************************
-* Header Files *
-*******************************************************************************/
+/*********************************************************************************************************************************
+* Header Files *
+*********************************************************************************************************************************/
#include <iprt/string.h>
#include "internal/iprt.h"
diff --git a/src/VBox/Runtime/common/string/RTUtf16NLen.cpp b/src/VBox/Runtime/common/string/RTUtf16NLen.cpp
index 9cea302..3f0bd5f 100644
--- a/src/VBox/Runtime/common/string/RTUtf16NLen.cpp
+++ b/src/VBox/Runtime/common/string/RTUtf16NLen.cpp
@@ -25,9 +25,9 @@
*/
-/*******************************************************************************
-* Header Files *
-*******************************************************************************/
+/*********************************************************************************************************************************
+* Header Files *
+*********************************************************************************************************************************/
#include <iprt/string.h>
#include "internal/iprt.h"
diff --git a/src/VBox/Runtime/common/string/RTUtf16NLenEx.cpp b/src/VBox/Runtime/common/string/RTUtf16NLenEx.cpp
index c261c82..7bb6f4c 100644
--- a/src/VBox/Runtime/common/string/RTUtf16NLenEx.cpp
+++ b/src/VBox/Runtime/common/string/RTUtf16NLenEx.cpp
@@ -24,9 +24,10 @@
* terms and conditions of either the GPL or the CDDL or both.
*/
-/*******************************************************************************
-* Header Files *
-*******************************************************************************/
+
+/*********************************************************************************************************************************
+* Header Files *
+*********************************************************************************************************************************/
#include <iprt/string.h>
#include "internal/iprt.h"
diff --git a/src/VBox/Runtime/common/string/RTUtf16PrintHexBytes.cpp b/src/VBox/Runtime/common/string/RTUtf16PrintHexBytes.cpp
index a116b9c..54ab9b2 100644
--- a/src/VBox/Runtime/common/string/RTUtf16PrintHexBytes.cpp
+++ b/src/VBox/Runtime/common/string/RTUtf16PrintHexBytes.cpp
@@ -25,9 +25,9 @@
*/
-/*******************************************************************************
-* Header Files *
-*******************************************************************************/
+/*********************************************************************************************************************************
+* Header Files *
+*********************************************************************************************************************************/
#include "internal/iprt.h"
#include <iprt/string.h>
diff --git a/src/VBox/Runtime/common/string/base64.cpp b/src/VBox/Runtime/common/string/base64.cpp
index afdb3c3..41943f6 100644
--- a/src/VBox/Runtime/common/string/base64.cpp
+++ b/src/VBox/Runtime/common/string/base64.cpp
@@ -25,9 +25,9 @@
*/
-/*******************************************************************************
-* Header Files *
-*******************************************************************************/
+/*********************************************************************************************************************************
+* Header Files *
+*********************************************************************************************************************************/
#include <iprt/base64.h>
#include "internal/iprt.h"
@@ -40,9 +40,9 @@
#endif
-/*******************************************************************************
-* Defined Constants And Macros *
-*******************************************************************************/
+/*********************************************************************************************************************************
+* Defined Constants And Macros *
+*********************************************************************************************************************************/
/** The line length used for encoding. */
#define RTBASE64_LINE_LEN 64
@@ -54,9 +54,9 @@
/** @} */
-/*******************************************************************************
-* Global Variables *
-*******************************************************************************/
+/*********************************************************************************************************************************
+* Global Variables *
+*********************************************************************************************************************************/
/** Base64 character to value. (RFC 2045)
* ASSUMES ASCII / UTF-8. */
static const uint8_t g_au8CharToVal[256] =
diff --git a/src/VBox/Runtime/common/string/memchr.cpp b/src/VBox/Runtime/common/string/memchr.cpp
index 5235b15..88dd744 100644
--- a/src/VBox/Runtime/common/string/memchr.cpp
+++ b/src/VBox/Runtime/common/string/memchr.cpp
@@ -25,9 +25,9 @@
*/
-/*******************************************************************************
-* Header Files *
-*******************************************************************************/
+/*********************************************************************************************************************************
+* Header Files *
+*********************************************************************************************************************************/
#include <iprt/string.h>
diff --git a/src/VBox/Runtime/common/string/memchr_alias.c b/src/VBox/Runtime/common/string/memchr_alias.c
index 545d469..dba9c1b 100644
--- a/src/VBox/Runtime/common/string/memchr_alias.c
+++ b/src/VBox/Runtime/common/string/memchr_alias.c
@@ -25,9 +25,9 @@
*/
-/*******************************************************************************
-* Header Files *
-*******************************************************************************/
+/*********************************************************************************************************************************
+* Header Files *
+*********************************************************************************************************************************/
#include <iprt/nocrt/string.h>
#undef memchr
diff --git a/src/VBox/Runtime/common/string/memcmp.cpp b/src/VBox/Runtime/common/string/memcmp.cpp
index 7af29bf..623cb97 100644
--- a/src/VBox/Runtime/common/string/memcmp.cpp
+++ b/src/VBox/Runtime/common/string/memcmp.cpp
@@ -25,9 +25,9 @@
*/
-/*******************************************************************************
-* Header Files *
-*******************************************************************************/
+/*********************************************************************************************************************************
+* Header Files *
+*********************************************************************************************************************************/
#include <iprt/string.h>
#include <iprt/types.h>
diff --git a/src/VBox/Runtime/common/string/memcmp_alias.c b/src/VBox/Runtime/common/string/memcmp_alias.c
index 8dd10f3..c11eabc 100644
--- a/src/VBox/Runtime/common/string/memcmp_alias.c
+++ b/src/VBox/Runtime/common/string/memcmp_alias.c
@@ -25,9 +25,9 @@
*/
-/*******************************************************************************
-* Header Files *
-*******************************************************************************/
+/*********************************************************************************************************************************
+* Header Files *
+*********************************************************************************************************************************/
#include <iprt/nocrt/string.h>
#undef memcmp
diff --git a/src/VBox/Runtime/common/string/memcpy.cpp b/src/VBox/Runtime/common/string/memcpy.cpp
index dcd0a72..20d3050 100644
--- a/src/VBox/Runtime/common/string/memcpy.cpp
+++ b/src/VBox/Runtime/common/string/memcpy.cpp
@@ -25,9 +25,9 @@
*/
-/*******************************************************************************
-* Header Files *
-*******************************************************************************/
+/*********************************************************************************************************************************
+* Header Files *
+*********************************************************************************************************************************/
#include <iprt/string.h>
diff --git a/src/VBox/Runtime/common/string/memcpy_alias.c b/src/VBox/Runtime/common/string/memcpy_alias.c
index 4862af7..5b106e7 100644
--- a/src/VBox/Runtime/common/string/memcpy_alias.c
+++ b/src/VBox/Runtime/common/string/memcpy_alias.c
@@ -25,9 +25,9 @@
*/
-/*******************************************************************************
-* Header Files *
-*******************************************************************************/
+/*********************************************************************************************************************************
+* Header Files *
+*********************************************************************************************************************************/
#include <iprt/nocrt/string.h>
#undef memcpy
diff --git a/src/VBox/Runtime/common/string/memmove_alias.c b/src/VBox/Runtime/common/string/memmove_alias.c
index 29556f6..c1584dd 100644
--- a/src/VBox/Runtime/common/string/memmove_alias.c
+++ b/src/VBox/Runtime/common/string/memmove_alias.c
@@ -25,9 +25,9 @@
*/
-/*******************************************************************************
-* Header Files *
-*******************************************************************************/
+/*********************************************************************************************************************************
+* Header Files *
+*********************************************************************************************************************************/
#include <iprt/nocrt/string.h>
#undef memmove
diff --git a/src/VBox/Runtime/common/string/memset.cpp b/src/VBox/Runtime/common/string/memset.cpp
index 89ceb8f..0df2a90 100644
--- a/src/VBox/Runtime/common/string/memset.cpp
+++ b/src/VBox/Runtime/common/string/memset.cpp
@@ -25,9 +25,9 @@
*/
-/*******************************************************************************
-* Header Files *
-*******************************************************************************/
+/*********************************************************************************************************************************
+* Header Files *
+*********************************************************************************************************************************/
#include <iprt/string.h>
diff --git a/src/VBox/Runtime/common/string/memset_alias.c b/src/VBox/Runtime/common/string/memset_alias.c
index 250644e..cffad97 100644
--- a/src/VBox/Runtime/common/string/memset_alias.c
+++ b/src/VBox/Runtime/common/string/memset_alias.c
@@ -25,9 +25,9 @@
*/
-/*******************************************************************************
-* Header Files *
-*******************************************************************************/
+/*********************************************************************************************************************************
+* Header Files *
+*********************************************************************************************************************************/
#include <iprt/nocrt/string.h>
#undef memset
diff --git a/src/VBox/Runtime/common/string/ministring.cpp b/src/VBox/Runtime/common/string/ministring.cpp
index 07d22e3..8f6e57e 100644
--- a/src/VBox/Runtime/common/string/ministring.cpp
+++ b/src/VBox/Runtime/common/string/ministring.cpp
@@ -28,21 +28,21 @@
*/
-/*******************************************************************************
-* Header Files *
-*******************************************************************************/
+/*********************************************************************************************************************************
+* Header Files *
+*********************************************************************************************************************************/
#include <iprt/cpp/ministring.h>
-/*******************************************************************************
-* Global Variables *
-*******************************************************************************/
+/*********************************************************************************************************************************
+* Global Variables *
+*********************************************************************************************************************************/
const size_t RTCString::npos = ~(size_t)0;
-/*******************************************************************************
-* Defined Constants And Macros *
-*******************************************************************************/
+/*********************************************************************************************************************************
+* Defined Constants And Macros *
+*********************************************************************************************************************************/
/** Allocation block alignment used when appending bytes to a string. */
#define IPRT_MINISTRING_APPEND_ALIGNMENT 64
diff --git a/src/VBox/Runtime/common/string/simplepattern.cpp b/src/VBox/Runtime/common/string/simplepattern.cpp
index fb67721..38e4479 100644
--- a/src/VBox/Runtime/common/string/simplepattern.cpp
+++ b/src/VBox/Runtime/common/string/simplepattern.cpp
@@ -25,9 +25,9 @@
*/
-/*******************************************************************************
-* Header Files *
-*******************************************************************************/
+/*********************************************************************************************************************************
+* Header Files *
+*********************************************************************************************************************************/
#include <iprt/string.h>
#include "internal/iprt.h"
diff --git a/src/VBox/Runtime/common/string/straprintf.cpp b/src/VBox/Runtime/common/string/straprintf.cpp
index 8b6194e..0035281 100644
--- a/src/VBox/Runtime/common/string/straprintf.cpp
+++ b/src/VBox/Runtime/common/string/straprintf.cpp
@@ -25,9 +25,9 @@
*/
-/*******************************************************************************
-* Header Files *
-*******************************************************************************/
+/*********************************************************************************************************************************
+* Header Files *
+*********************************************************************************************************************************/
#include <iprt/string.h>
#include "internal/iprt.h"
@@ -35,9 +35,9 @@
#include <iprt/alloc.h>
-/*******************************************************************************
-* Structures and Typedefs *
-*******************************************************************************/
+/*********************************************************************************************************************************
+* Structures and Typedefs *
+*********************************************************************************************************************************/
/** strallocoutput() argument structure. */
typedef struct STRALLOCARG
{
@@ -59,9 +59,9 @@ typedef struct STRALLOCARG
typedef STRALLOCARG *PSTRALLOCARG;
-/*******************************************************************************
-* Internal Functions *
-*******************************************************************************/
+/*********************************************************************************************************************************
+* Internal Functions *
+*********************************************************************************************************************************/
static DECLCALLBACK(size_t) strallocoutput(void *pvArg, const char *pachChars, size_t cbChars);
diff --git a/src/VBox/Runtime/common/string/strcache.cpp b/src/VBox/Runtime/common/string/strcache.cpp
index ae4cc66..c3317c4 100644
--- a/src/VBox/Runtime/common/string/strcache.cpp
+++ b/src/VBox/Runtime/common/string/strcache.cpp
@@ -25,9 +25,9 @@
*/
-/*******************************************************************************
-* Header Files *
-*******************************************************************************/
+/*********************************************************************************************************************************
+* Header Files *
+*********************************************************************************************************************************/
#include <iprt/strcache.h>
#include "internal/iprt.h"
@@ -46,9 +46,9 @@
#include "internal/magics.h"
-/*******************************************************************************
-* Defined Constants And Macros *
-*******************************************************************************/
+/*********************************************************************************************************************************
+* Defined Constants And Macros *
+*********************************************************************************************************************************/
/** Special NIL pointer for the hash table. It differs from NULL in that it is
* a valid hash table entry when doing a lookup. */
#define PRTSTRCACHEENTRY_NIL ((PRTSTRCACHEENTRY)~(uintptr_t)1)
@@ -120,9 +120,9 @@
-/*******************************************************************************
-* Structures and Typedefs *
-*******************************************************************************/
+/*********************************************************************************************************************************
+* Structures and Typedefs *
+*********************************************************************************************************************************/
/**
* String cache entry.
*/
@@ -297,9 +297,9 @@ typedef RTSTRCACHEINT *PRTSTRCACHEINT;
-/*******************************************************************************
-* Global Variables *
-*******************************************************************************/
+/*********************************************************************************************************************************
+* Global Variables *
+*********************************************************************************************************************************/
/** The entry sizes of the fixed lists (RTSTRCACHEINT::apFreeLists). */
static const uint32_t g_acbFixedLists[RTSTRCACHE_NUM_OF_FIXED_SIZES] =
{
diff --git a/src/VBox/Runtime/common/string/strchr_alias.c b/src/VBox/Runtime/common/string/strchr_alias.c
index 606e707..1162cb5 100644
--- a/src/VBox/Runtime/common/string/strchr_alias.c
+++ b/src/VBox/Runtime/common/string/strchr_alias.c
@@ -25,9 +25,9 @@
*/
-/*******************************************************************************
-* Header Files *
-*******************************************************************************/
+/*********************************************************************************************************************************
+* Header Files *
+*********************************************************************************************************************************/
#include <iprt/nocrt/string.h>
#undef strchr
diff --git a/src/VBox/Runtime/common/string/strcmp_alias.c b/src/VBox/Runtime/common/string/strcmp_alias.c
index 35c5080..4abd2f2 100644
--- a/src/VBox/Runtime/common/string/strcmp_alias.c
+++ b/src/VBox/Runtime/common/string/strcmp_alias.c
@@ -25,9 +25,9 @@
*/
-/*******************************************************************************
-* Header Files *
-*******************************************************************************/
+/*********************************************************************************************************************************
+* Header Files *
+*********************************************************************************************************************************/
#include <iprt/nocrt/string.h>
#undef strcmp
diff --git a/src/VBox/Runtime/common/string/strcpy.cpp b/src/VBox/Runtime/common/string/strcpy.cpp
index 517fcf5..f5291b9 100644
--- a/src/VBox/Runtime/common/string/strcpy.cpp
+++ b/src/VBox/Runtime/common/string/strcpy.cpp
@@ -25,9 +25,9 @@
*/
-/*******************************************************************************
-* Header Files *
-*******************************************************************************/
+/*********************************************************************************************************************************
+* Header Files *
+*********************************************************************************************************************************/
#include <iprt/string.h>
diff --git a/src/VBox/Runtime/common/string/strcpy_alias.c b/src/VBox/Runtime/common/string/strcpy_alias.c
index e77a288..cceea23 100644
--- a/src/VBox/Runtime/common/string/strcpy_alias.c
+++ b/src/VBox/Runtime/common/string/strcpy_alias.c
@@ -25,9 +25,9 @@
*/
-/*******************************************************************************
-* Header Files *
-*******************************************************************************/
+/*********************************************************************************************************************************
+* Header Files *
+*********************************************************************************************************************************/
#include <iprt/nocrt/string.h>
#undef strcpy
diff --git a/src/VBox/Runtime/common/string/strformat.cpp b/src/VBox/Runtime/common/string/strformat.cpp
index 64fb1de..bb51874 100644
--- a/src/VBox/Runtime/common/string/strformat.cpp
+++ b/src/VBox/Runtime/common/string/strformat.cpp
@@ -25,17 +25,17 @@
*/
-/*******************************************************************************
-* Defined Constants *
-*******************************************************************************/
+/*********************************************************************************************************************************
+* Defined Constants *
+*********************************************************************************************************************************/
#define ISDIGIT(c) ((c) >= '0' && (c) <= '9')
/*#define MAX(a, b) ((a) >= (b) ? (a) : (b))
#define MIN(a, b) ((a) < (b) ? (a) : (b)) */
-/*******************************************************************************
-* Header Files *
-*******************************************************************************/
+/*********************************************************************************************************************************
+* Header Files *
+*********************************************************************************************************************************/
#define LOG_GROUP RTLOGGROUP_STRING
#include <iprt/string.h>
#include "internal/iprt.h"
@@ -63,9 +63,9 @@ typedef struct
} KSIZE64;
-/*******************************************************************************
-* Internal Functions *
-*******************************************************************************/
+/*********************************************************************************************************************************
+* Internal Functions *
+*********************************************************************************************************************************/
static unsigned _strnlen(const char *psz, unsigned cchMax);
static unsigned _strnlenUtf16(PCRTUTF16 pwsz, unsigned cchMax);
static int rtStrFormatNumber(char *psz, KSIZE64 ullValue, unsigned int uiBase, signed int cchWidth, signed int cchPrecision, unsigned int fFlags);
diff --git a/src/VBox/Runtime/common/string/strformatnum.cpp b/src/VBox/Runtime/common/string/strformatnum.cpp
index eb93113..08186a8 100644
--- a/src/VBox/Runtime/common/string/strformatnum.cpp
+++ b/src/VBox/Runtime/common/string/strformatnum.cpp
@@ -25,9 +25,9 @@
*/
-/*******************************************************************************
-* Header Files *
-*******************************************************************************/
+/*********************************************************************************************************************************
+* Header Files *
+*********************************************************************************************************************************/
#define LOG_GROUP RTLOGGROUP_STRING
#include <iprt/string.h>
#include "internal/iprt.h"
diff --git a/src/VBox/Runtime/common/string/strformatrt.cpp b/src/VBox/Runtime/common/string/strformatrt.cpp
index 7b4dd93..034f084 100644
--- a/src/VBox/Runtime/common/string/strformatrt.cpp
+++ b/src/VBox/Runtime/common/string/strformatrt.cpp
@@ -25,9 +25,9 @@
*/
-/*******************************************************************************
-* Header Files *
-*******************************************************************************/
+/*********************************************************************************************************************************
+* Header Files *
+*********************************************************************************************************************************/
#define LOG_GROUP RTLOGGROUP_STRING
#include <iprt/string.h>
#ifndef RT_NO_EXPORT_SYMBOL
@@ -55,9 +55,10 @@
#endif
#include "internal/string.h"
-/*******************************************************************************
-* Global Variables *
-*******************************************************************************/
+
+/*********************************************************************************************************************************
+* Global Variables *
+*********************************************************************************************************************************/
static char g_szHexDigits[17] = "0123456789abcdef";
diff --git a/src/VBox/Runtime/common/string/strformattype.cpp b/src/VBox/Runtime/common/string/strformattype.cpp
index 502b89f..a7332ef 100644
--- a/src/VBox/Runtime/common/string/strformattype.cpp
+++ b/src/VBox/Runtime/common/string/strformattype.cpp
@@ -25,9 +25,9 @@
*/
-/*******************************************************************************
-* Global Variables *
-*******************************************************************************/
+/*********************************************************************************************************************************
+* Global Variables *
+*********************************************************************************************************************************/
#define LOG_GROUP RTLOGGROUP_STRING
#include <iprt/string.h>
#include "internal/iprt.h"
@@ -38,9 +38,9 @@
#include "internal/string.h"
-/*******************************************************************************
-* Defined Constants And Macros *
-*******************************************************************************/
+/*********************************************************************************************************************************
+* Defined Constants And Macros *
+*********************************************************************************************************************************/
#ifdef RT_STRICT
# define RTSTRFORMATTYPE_WITH_LOCKING
#endif
@@ -49,9 +49,9 @@
#endif
-/*******************************************************************************
-* Structures and Typedefs *
-*******************************************************************************/
+/*********************************************************************************************************************************
+* Structures and Typedefs *
+*********************************************************************************************************************************/
/**
* Description of a registered formatting type.
*
@@ -85,9 +85,9 @@ typedef RTSTRDYNFMT *PRTSTRDYNFMT;
typedef RTSTRDYNFMT const *PCRTSTRDYNFMT;
-/*******************************************************************************
-* Global Variables *
-*******************************************************************************/
+/*********************************************************************************************************************************
+* Global Variables *
+*********************************************************************************************************************************/
/** The registered types, sorted for binary lookup.
* We use a static array here because it avoids RTMemAlloc dependencies+leaks. */
static RTSTRDYNFMT g_aTypes[64];
diff --git a/src/VBox/Runtime/common/string/strhash1.cpp b/src/VBox/Runtime/common/string/strhash1.cpp
index 589f93e..8515246 100644
--- a/src/VBox/Runtime/common/string/strhash1.cpp
+++ b/src/VBox/Runtime/common/string/strhash1.cpp
@@ -25,9 +25,9 @@
*/
-/*******************************************************************************
-* Header Files *
-*******************************************************************************/
+/*********************************************************************************************************************************
+* Header Files *
+*********************************************************************************************************************************/
#include "internal/iprt.h"
#include <iprt/string.h>
diff --git a/src/VBox/Runtime/common/string/stringalloc.cpp b/src/VBox/Runtime/common/string/stringalloc.cpp
index 14f4811..715b26c 100644
--- a/src/VBox/Runtime/common/string/stringalloc.cpp
+++ b/src/VBox/Runtime/common/string/stringalloc.cpp
@@ -25,9 +25,9 @@
*/
-/*******************************************************************************
-* Header Files *
-*******************************************************************************/
+/*********************************************************************************************************************************
+* Header Files *
+*********************************************************************************************************************************/
#include <iprt/string.h>
#include "internal/iprt.h"
diff --git a/src/VBox/Runtime/common/string/strlen.cpp b/src/VBox/Runtime/common/string/strlen.cpp
index 61b61da..4ad1fcb 100644
--- a/src/VBox/Runtime/common/string/strlen.cpp
+++ b/src/VBox/Runtime/common/string/strlen.cpp
@@ -25,9 +25,9 @@
*/
-/*******************************************************************************
-* Header Files *
-*******************************************************************************/
+/*********************************************************************************************************************************
+* Header Files *
+*********************************************************************************************************************************/
#include <iprt/string.h>
diff --git a/src/VBox/Runtime/common/string/strlen_alias.c b/src/VBox/Runtime/common/string/strlen_alias.c
index c861adf..dd73dec 100644
--- a/src/VBox/Runtime/common/string/strlen_alias.c
+++ b/src/VBox/Runtime/common/string/strlen_alias.c
@@ -25,9 +25,9 @@
*/
-/*******************************************************************************
-* Header Files *
-*******************************************************************************/
+/*********************************************************************************************************************************
+* Header Files *
+*********************************************************************************************************************************/
#include <iprt/nocrt/string.h>
#undef strlen
diff --git a/src/VBox/Runtime/common/string/strpbrk.cpp b/src/VBox/Runtime/common/string/strpbrk.cpp
index 57f1c23..7bf218a 100644
--- a/src/VBox/Runtime/common/string/strpbrk.cpp
+++ b/src/VBox/Runtime/common/string/strpbrk.cpp
@@ -25,9 +25,9 @@
*/
-/*******************************************************************************
-* Header Files *
-*******************************************************************************/
+/*********************************************************************************************************************************
+* Header Files *
+*********************************************************************************************************************************/
#include <iprt/string.h>
diff --git a/src/VBox/Runtime/common/string/strprintf.cpp b/src/VBox/Runtime/common/string/strprintf.cpp
index fa749e3..26475e3 100644
--- a/src/VBox/Runtime/common/string/strprintf.cpp
+++ b/src/VBox/Runtime/common/string/strprintf.cpp
@@ -25,18 +25,18 @@
*/
-/*******************************************************************************
-* Header Files *
-*******************************************************************************/
+/*********************************************************************************************************************************
+* Header Files *
+*********************************************************************************************************************************/
#include <iprt/string.h>
#include "internal/iprt.h"
#include <iprt/assert.h>
-/*******************************************************************************
-* Structures and Typedefs *
-*******************************************************************************/
+/*********************************************************************************************************************************
+* Structures and Typedefs *
+*********************************************************************************************************************************/
/** strbufoutput() argument structure. */
typedef struct STRBUFARG
{
@@ -49,9 +49,9 @@ typedef struct STRBUFARG
typedef STRBUFARG *PSTRBUFARG;
-/*******************************************************************************
-* Internal Functions *
-*******************************************************************************/
+/*********************************************************************************************************************************
+* Internal Functions *
+*********************************************************************************************************************************/
static DECLCALLBACK(size_t) strbufoutput(void *pvArg, const char *pachChars, size_t cbChars);
diff --git a/src/VBox/Runtime/common/string/strspace.cpp b/src/VBox/Runtime/common/string/strspace.cpp
index 5e8274b..52d6e4d 100644
--- a/src/VBox/Runtime/common/string/strspace.cpp
+++ b/src/VBox/Runtime/common/string/strspace.cpp
@@ -25,9 +25,9 @@
*/
-/*******************************************************************************
-* Header Files *
-*******************************************************************************/
+/*********************************************************************************************************************************
+* Header Files *
+*********************************************************************************************************************************/
#include <iprt/string.h>
#include "internal/iprt.h"
@@ -35,9 +35,9 @@
#include "internal/strhash.h"
-/*******************************************************************************
-* Defined Constants And Macros *
-*******************************************************************************/
+/*********************************************************************************************************************************
+* Defined Constants And Macros *
+*********************************************************************************************************************************/
/*
* AVL configuration.
*/
diff --git a/src/VBox/Runtime/common/string/strstrip.cpp b/src/VBox/Runtime/common/string/strstrip.cpp
index 8a52fdf..cd6c1bd 100644
--- a/src/VBox/Runtime/common/string/strstrip.cpp
+++ b/src/VBox/Runtime/common/string/strstrip.cpp
@@ -25,9 +25,9 @@
*/
-/*******************************************************************************
-* Header Files *
-*******************************************************************************/
+/*********************************************************************************************************************************
+* Header Files *
+*********************************************************************************************************************************/
#include <iprt/string.h>
#include "internal/iprt.h"
diff --git a/src/VBox/Runtime/common/string/strtonum.cpp b/src/VBox/Runtime/common/string/strtonum.cpp
index af6ba5c..400520a 100644
--- a/src/VBox/Runtime/common/string/strtonum.cpp
+++ b/src/VBox/Runtime/common/string/strtonum.cpp
@@ -25,9 +25,9 @@
*/
-/*******************************************************************************
-* Header Files *
-*******************************************************************************/
+/*********************************************************************************************************************************
+* Header Files *
+*********************************************************************************************************************************/
#include <iprt/string.h>
#include "internal/iprt.h"
@@ -36,9 +36,9 @@
#include <iprt/err.h>
-/*******************************************************************************
-* Global Variables *
-*******************************************************************************/
+/*********************************************************************************************************************************
+* Global Variables *
+*********************************************************************************************************************************/
/** 8-bit char -> digit. */
static const unsigned char g_auchDigits[256] =
{
diff --git a/src/VBox/Runtime/common/string/strversion.cpp b/src/VBox/Runtime/common/string/strversion.cpp
index 30b4b00..b3be2d6 100644
--- a/src/VBox/Runtime/common/string/strversion.cpp
+++ b/src/VBox/Runtime/common/string/strversion.cpp
@@ -25,9 +25,9 @@
*/
-/*******************************************************************************
-* Header Files *
-*******************************************************************************/
+/*********************************************************************************************************************************
+* Header Files *
+*********************************************************************************************************************************/
#include <iprt/string.h>
#include "internal/iprt.h"
@@ -36,9 +36,9 @@
#include <iprt/err.h>
-/*******************************************************************************
-* Defined Constants And Macros *
-*******************************************************************************/
+/*********************************************************************************************************************************
+* Defined Constants And Macros *
+*********************************************************************************************************************************/
#define RTSTRVER_IS_PUNCTUACTION(ch) \
( (ch) == '_' || (ch) == '-' || (ch) == '+' || RT_C_IS_PUNCT(ch) )
diff --git a/src/VBox/Runtime/common/string/uni.cpp b/src/VBox/Runtime/common/string/uni.cpp
index 672490f..ced67d2 100644
--- a/src/VBox/Runtime/common/string/uni.cpp
+++ b/src/VBox/Runtime/common/string/uni.cpp
@@ -25,9 +25,9 @@
*/
-/*******************************************************************************
-* Header Files *
-*******************************************************************************/
+/*********************************************************************************************************************************
+* Header Files *
+*********************************************************************************************************************************/
#include <iprt/uni.h>
#include "internal/iprt.h"
diff --git a/src/VBox/Runtime/common/string/uniread.cpp b/src/VBox/Runtime/common/string/uniread.cpp
index abf30ed..15e7998 100644
--- a/src/VBox/Runtime/common/string/uniread.cpp
+++ b/src/VBox/Runtime/common/string/uniread.cpp
@@ -24,9 +24,10 @@
* terms and conditions of either the GPL or the CDDL or both.
*/
-/*******************************************************************************
-* Header Files *
-*******************************************************************************/
+
+/*********************************************************************************************************************************
+* Header Files *
+*********************************************************************************************************************************/
#include <iprt/types.h>
#include <iprt/stdarg.h>
#include <iprt/ctype.h>
@@ -41,9 +42,9 @@
#endif
-/*******************************************************************************
-* Global Variables *
-*******************************************************************************/
+/*********************************************************************************************************************************
+* Global Variables *
+*********************************************************************************************************************************/
/** The file we're currently parsing. */
static const char *g_pszCurFile;
/** The current line number. */
diff --git a/src/VBox/Runtime/common/string/utf-16-case.cpp b/src/VBox/Runtime/common/string/utf-16-case.cpp
index ceea8ce..69511f4 100644
--- a/src/VBox/Runtime/common/string/utf-16-case.cpp
+++ b/src/VBox/Runtime/common/string/utf-16-case.cpp
@@ -25,9 +25,9 @@
*/
-/*******************************************************************************
-* Header Files *
-*******************************************************************************/
+/*********************************************************************************************************************************
+* Header Files *
+*********************************************************************************************************************************/
#include <iprt/string.h>
#include "internal/iprt.h"
diff --git a/src/VBox/Runtime/common/string/utf-16-latin-1.cpp b/src/VBox/Runtime/common/string/utf-16-latin-1.cpp
index 68d7b0e..17103f1 100644
--- a/src/VBox/Runtime/common/string/utf-16-latin-1.cpp
+++ b/src/VBox/Runtime/common/string/utf-16-latin-1.cpp
@@ -25,9 +25,9 @@
*/
-/*******************************************************************************
-* Header Files *
-*******************************************************************************/
+/*********************************************************************************************************************************
+* Header Files *
+*********************************************************************************************************************************/
#include <iprt/string.h>
#include "internal/iprt.h"
diff --git a/src/VBox/Runtime/common/string/utf-16.cpp b/src/VBox/Runtime/common/string/utf-16.cpp
index e3a92c9..bb67f8b 100644
--- a/src/VBox/Runtime/common/string/utf-16.cpp
+++ b/src/VBox/Runtime/common/string/utf-16.cpp
@@ -25,9 +25,9 @@
*/
-/*******************************************************************************
-* Header Files *
-*******************************************************************************/
+/*********************************************************************************************************************************
+* Header Files *
+*********************************************************************************************************************************/
#include <iprt/string.h>
#include "internal/iprt.h"
diff --git a/src/VBox/Runtime/common/string/utf-8-case.cpp b/src/VBox/Runtime/common/string/utf-8-case.cpp
index 1f51efc..9969d4c 100644
--- a/src/VBox/Runtime/common/string/utf-8-case.cpp
+++ b/src/VBox/Runtime/common/string/utf-8-case.cpp
@@ -25,9 +25,9 @@
*/
-/*******************************************************************************
-* Header Files *
-*******************************************************************************/
+/*********************************************************************************************************************************
+* Header Files *
+*********************************************************************************************************************************/
#include <iprt/string.h>
#include "internal/iprt.h"
diff --git a/src/VBox/Runtime/common/string/utf-8-case2.cpp b/src/VBox/Runtime/common/string/utf-8-case2.cpp
index 94a1713..d1d5636 100644
--- a/src/VBox/Runtime/common/string/utf-8-case2.cpp
+++ b/src/VBox/Runtime/common/string/utf-8-case2.cpp
@@ -25,9 +25,9 @@
*/
-/*******************************************************************************
-* Header Files *
-*******************************************************************************/
+/*********************************************************************************************************************************
+* Header Files *
+*********************************************************************************************************************************/
#include <iprt/string.h>
#include "internal/iprt.h"
diff --git a/src/VBox/Runtime/common/string/utf-8.cpp b/src/VBox/Runtime/common/string/utf-8.cpp
index b69f31e..142ec1b 100644
--- a/src/VBox/Runtime/common/string/utf-8.cpp
+++ b/src/VBox/Runtime/common/string/utf-8.cpp
@@ -25,9 +25,9 @@
*/
-/*******************************************************************************
-* Header Files *
-*******************************************************************************/
+/*********************************************************************************************************************************
+* Header Files *
+*********************************************************************************************************************************/
#include <iprt/string.h>
#include "internal/iprt.h"
diff --git a/src/VBox/Runtime/common/table/avlgcphys.cpp b/src/VBox/Runtime/common/table/avlgcphys.cpp
index 3ab3f97..04eec90 100644
--- a/src/VBox/Runtime/common/table/avlgcphys.cpp
+++ b/src/VBox/Runtime/common/table/avlgcphys.cpp
@@ -28,9 +28,10 @@
static const char szFileId[] = "Id: kAVLULInt.c,v 1.4 2003/02/13 02:02:38 bird Exp $";
#endif
-/*******************************************************************************
-* Defined Constants And Macros *
-*******************************************************************************/
+
+/*********************************************************************************************************************************
+* Defined Constants And Macros *
+*********************************************************************************************************************************/
/*
* AVL configuration.
*/
@@ -55,9 +56,9 @@ static const char szFileId[] = "Id: kAVLULInt.c,v 1.4 2003/02/13 02:02:38 bird E
#define KAVL_NE(key1, key2) ( (key1) != (key2) )
-/*******************************************************************************
-* Header Files *
-*******************************************************************************/
+/*********************************************************************************************************************************
+* Header Files *
+*********************************************************************************************************************************/
#include <iprt/avl.h>
#include <iprt/assert.h>
#include <iprt/err.h>
diff --git a/src/VBox/Runtime/common/table/avlgcptr.cpp b/src/VBox/Runtime/common/table/avlgcptr.cpp
index 8eb2b94..7ca154e 100644
--- a/src/VBox/Runtime/common/table/avlgcptr.cpp
+++ b/src/VBox/Runtime/common/table/avlgcptr.cpp
@@ -28,9 +28,10 @@
static const char szFileId[] = "Id: kAVLPVInt.c,v 1.5 2003/02/13 02:02:35 bird Exp $";
#endif
-/*******************************************************************************
-* Defined Constants And Macros *
-*******************************************************************************/
+
+/*********************************************************************************************************************************
+* Defined Constants And Macros *
+*********************************************************************************************************************************/
/*
* AVL configuration.
*/
@@ -55,9 +56,9 @@ static const char szFileId[] = "Id: kAVLPVInt.c,v 1.5 2003/02/13 02:02:35 bird E
#define KAVL_NE(key1, key2) ( (RTGCUINTPTR)(key1) != (RTGCUINTPTR)(key2) )
-/*******************************************************************************
-* Header Files *
-*******************************************************************************/
+/*********************************************************************************************************************************
+* Header Files *
+*********************************************************************************************************************************/
#include <iprt/avl.h>
#include <iprt/assert.h>
#include <iprt/err.h>
diff --git a/src/VBox/Runtime/common/table/avlhcphys.cpp b/src/VBox/Runtime/common/table/avlhcphys.cpp
index 229dc63..c1d0215 100644
--- a/src/VBox/Runtime/common/table/avlhcphys.cpp
+++ b/src/VBox/Runtime/common/table/avlhcphys.cpp
@@ -28,9 +28,10 @@
static const char szFileId[] = "Id: kAVLULInt.c,v 1.4 2003/02/13 02:02:38 bird Exp $";
#endif
-/*******************************************************************************
-* Defined Constants And Macros *
-*******************************************************************************/
+
+/*********************************************************************************************************************************
+* Defined Constants And Macros *
+*********************************************************************************************************************************/
/*
* AVL configuration.
*/
@@ -55,9 +56,9 @@ static const char szFileId[] = "Id: kAVLULInt.c,v 1.4 2003/02/13 02:02:38 bird E
#define KAVL_NE(key1, key2) ( (key1) != (key2) )
-/*******************************************************************************
-* Header Files *
-*******************************************************************************/
+/*********************************************************************************************************************************
+* Header Files *
+*********************************************************************************************************************************/
#include <iprt/avl.h>
#include <iprt/assert.h>
#include <iprt/err.h>
diff --git a/src/VBox/Runtime/common/table/avllu32.cpp b/src/VBox/Runtime/common/table/avllu32.cpp
index f6ec3bc..1952b3c 100644
--- a/src/VBox/Runtime/common/table/avllu32.cpp
+++ b/src/VBox/Runtime/common/table/avllu32.cpp
@@ -28,9 +28,10 @@
static const char szFileId[] = "Id: kAVLULInt.c,v 1.4 2003/02/13 02:02:38 bird Exp $";
#endif
-/*******************************************************************************
-* Defined Constants And Macros *
-*******************************************************************************/
+
+/*********************************************************************************************************************************
+* Defined Constants And Macros *
+*********************************************************************************************************************************/
/*
* AVL configuration.
*/
@@ -55,9 +56,9 @@ static const char szFileId[] = "Id: kAVLULInt.c,v 1.4 2003/02/13 02:02:38 bird E
#define KAVL_NE(key1, key2) ( (key1) != (key2) )
-/*******************************************************************************
-* Header Files *
-*******************************************************************************/
+/*********************************************************************************************************************************
+* Header Files *
+*********************************************************************************************************************************/
#include <iprt/avl.h>
#include <iprt/assert.h>
#include <iprt/err.h>
diff --git a/src/VBox/Runtime/common/table/avlogcphys.cpp b/src/VBox/Runtime/common/table/avlogcphys.cpp
index 0d4ddef..aae3e7c 100644
--- a/src/VBox/Runtime/common/table/avlogcphys.cpp
+++ b/src/VBox/Runtime/common/table/avlogcphys.cpp
@@ -28,9 +28,10 @@
static const char szFileId[] = "Id: kAVLULInt.c,v 1.4 2003/02/13 02:02:38 bird Exp $";
#endif
-/*******************************************************************************
-* Defined Constants And Macros *
-*******************************************************************************/
+
+/*********************************************************************************************************************************
+* Defined Constants And Macros *
+*********************************************************************************************************************************/
/*
* AVL configuration.
*/
@@ -56,9 +57,9 @@ static const char szFileId[] = "Id: kAVLULInt.c,v 1.4 2003/02/13 02:02:38 bird E
#define KAVL_NE(key1, key2) ( (key1) != (key2) )
-/*******************************************************************************
-* Header Files *
-*******************************************************************************/
+/*********************************************************************************************************************************
+* Header Files *
+*********************************************************************************************************************************/
#include <iprt/avl.h>
#include <iprt/assert.h>
#include <iprt/err.h>
diff --git a/src/VBox/Runtime/common/table/avlogcptr.cpp b/src/VBox/Runtime/common/table/avlogcptr.cpp
index f25536b..441273f 100644
--- a/src/VBox/Runtime/common/table/avlogcptr.cpp
+++ b/src/VBox/Runtime/common/table/avlogcptr.cpp
@@ -28,9 +28,10 @@
static const char szFileId[] = "Id: kAVLULInt.c,v 1.4 2003/02/13 02:02:38 bird Exp $";
#endif
-/*******************************************************************************
-* Defined Constants And Macros *
-*******************************************************************************/
+
+/*********************************************************************************************************************************
+* Defined Constants And Macros *
+*********************************************************************************************************************************/
/*
* AVL configuration.
*/
@@ -57,9 +58,9 @@ static const char szFileId[] = "Id: kAVLULInt.c,v 1.4 2003/02/13 02:02:38 bird E
-/*******************************************************************************
-* Header Files *
-*******************************************************************************/
+/*********************************************************************************************************************************
+* Header Files *
+*********************************************************************************************************************************/
#include <iprt/avl.h>
#include <iprt/assert.h>
#include <iprt/err.h>
diff --git a/src/VBox/Runtime/common/table/avlohcphys.cpp b/src/VBox/Runtime/common/table/avlohcphys.cpp
index 39f64c1..81402a9 100644
--- a/src/VBox/Runtime/common/table/avlohcphys.cpp
+++ b/src/VBox/Runtime/common/table/avlohcphys.cpp
@@ -28,9 +28,10 @@
static const char szFileId[] = "Id: kAVLULInt.c,v 1.4 2003/02/13 02:02:38 bird Exp $";
#endif
-/*******************************************************************************
-* Defined Constants And Macros *
-*******************************************************************************/
+
+/*********************************************************************************************************************************
+* Defined Constants And Macros *
+*********************************************************************************************************************************/
/*
* AVL configuration.
*/
@@ -56,9 +57,9 @@ static const char szFileId[] = "Id: kAVLULInt.c,v 1.4 2003/02/13 02:02:38 bird E
#define KAVL_NE(key1, key2) ( (key1) != (key2) )
-/*******************************************************************************
-* Header Files *
-*******************************************************************************/
+/*********************************************************************************************************************************
+* Header Files *
+*********************************************************************************************************************************/
#include <iprt/avl.h>
#include <iprt/assert.h>
#include <iprt/err.h>
diff --git a/src/VBox/Runtime/common/table/avloioport.cpp b/src/VBox/Runtime/common/table/avloioport.cpp
index e1f5f91..cd0a282 100644
--- a/src/VBox/Runtime/common/table/avloioport.cpp
+++ b/src/VBox/Runtime/common/table/avloioport.cpp
@@ -28,9 +28,10 @@
static const char szFileId[] = "Id: kAVLULInt.c,v 1.4 2003/02/13 02:02:38 bird Exp $";
#endif
-/*******************************************************************************
-* Defined Constants And Macros *
-*******************************************************************************/
+
+/*********************************************************************************************************************************
+* Defined Constants And Macros *
+*********************************************************************************************************************************/
/*
* AVL configuration.
*/
@@ -56,9 +57,9 @@ static const char szFileId[] = "Id: kAVLULInt.c,v 1.4 2003/02/13 02:02:38 bird E
#define KAVL_NE(key1, key2) ( (key1) != (key2) )
-/*******************************************************************************
-* Header Files *
-*******************************************************************************/
+/*********************************************************************************************************************************
+* Header Files *
+*********************************************************************************************************************************/
#include <iprt/avl.h>
#include <iprt/assert.h>
#include <iprt/err.h>
diff --git a/src/VBox/Runtime/common/table/avlou32.cpp b/src/VBox/Runtime/common/table/avlou32.cpp
index 0ae06da..f86bedd 100644
--- a/src/VBox/Runtime/common/table/avlou32.cpp
+++ b/src/VBox/Runtime/common/table/avlou32.cpp
@@ -28,9 +28,10 @@
static const char szFileId[] = "Id: kAVLULInt.c,v 1.4 2003/02/13 02:02:38 bird Exp $";
#endif
-/*******************************************************************************
-* Defined Constants And Macros *
-*******************************************************************************/
+
+/*********************************************************************************************************************************
+* Defined Constants And Macros *
+*********************************************************************************************************************************/
/*
* AVL configuration.
*/
@@ -57,9 +58,9 @@ static const char szFileId[] = "Id: kAVLULInt.c,v 1.4 2003/02/13 02:02:38 bird E
-/*******************************************************************************
-* Header Files *
-*******************************************************************************/
+/*********************************************************************************************************************************
+* Header Files *
+*********************************************************************************************************************************/
#include <iprt/avl.h>
#include <iprt/assert.h>
#include <iprt/err.h>
diff --git a/src/VBox/Runtime/common/table/avlpv.cpp b/src/VBox/Runtime/common/table/avlpv.cpp
index ee090ad..612617f 100644
--- a/src/VBox/Runtime/common/table/avlpv.cpp
+++ b/src/VBox/Runtime/common/table/avlpv.cpp
@@ -28,9 +28,10 @@
static const char szFileId[] = "Id: kAVLPVInt.c,v 1.5 2003/02/13 02:02:35 bird Exp $";
#endif
-/*******************************************************************************
-* Defined Constants And Macros *
-*******************************************************************************/
+
+/*********************************************************************************************************************************
+* Defined Constants And Macros *
+*********************************************************************************************************************************/
/*
* AVL configuration.
*/
@@ -55,9 +56,9 @@ static const char szFileId[] = "Id: kAVLPVInt.c,v 1.5 2003/02/13 02:02:35 bird E
#define KAVL_NE(key1, key2) ( (const char*)(key1) != (const char*)(key2) )
-/*******************************************************************************
-* Header Files *
-*******************************************************************************/
+/*********************************************************************************************************************************
+* Header Files *
+*********************************************************************************************************************************/
#include <iprt/avl.h>
#include <iprt/assert.h>
#include <iprt/err.h>
diff --git a/src/VBox/Runtime/common/table/avlrfoff.cpp b/src/VBox/Runtime/common/table/avlrfoff.cpp
index 268482b..d941a37 100644
--- a/src/VBox/Runtime/common/table/avlrfoff.cpp
+++ b/src/VBox/Runtime/common/table/avlrfoff.cpp
@@ -28,9 +28,10 @@
static const char szFileId[] = "Id: kAVLULInt.c,v 1.4 2003/02/13 02:02:38 bird Exp $";
#endif
-/*******************************************************************************
-* Defined Constants And Macros *
-*******************************************************************************/
+
+/*********************************************************************************************************************************
+* Defined Constants And Macros *
+*********************************************************************************************************************************/
/*
* AVL configuration.
*/
@@ -60,9 +61,9 @@ static const char szFileId[] = "Id: kAVLULInt.c,v 1.4 2003/02/13 02:02:38 bird E
-/*******************************************************************************
-* Header Files *
-*******************************************************************************/
+/*********************************************************************************************************************************
+* Header Files *
+*********************************************************************************************************************************/
#include <iprt/avl.h>
#include <iprt/assert.h>
#include <iprt/err.h>
diff --git a/src/VBox/Runtime/common/table/avlrgcptr.cpp b/src/VBox/Runtime/common/table/avlrgcptr.cpp
index c83ae93..9b3eb0d 100644
--- a/src/VBox/Runtime/common/table/avlrgcptr.cpp
+++ b/src/VBox/Runtime/common/table/avlrgcptr.cpp
@@ -28,9 +28,10 @@
static const char szFileId[] = "Id: kAVLULInt.c,v 1.4 2003/02/13 02:02:38 bird Exp $";
#endif
-/*******************************************************************************
-* Defined Constants And Macros *
-*******************************************************************************/
+
+/*********************************************************************************************************************************
+* Defined Constants And Macros *
+*********************************************************************************************************************************/
/*
* AVL configuration.
*/
@@ -60,9 +61,9 @@ static const char szFileId[] = "Id: kAVLULInt.c,v 1.4 2003/02/13 02:02:38 bird E
-/*******************************************************************************
-* Header Files *
-*******************************************************************************/
+/*********************************************************************************************************************************
+* Header Files *
+*********************************************************************************************************************************/
#include <iprt/avl.h>
#include <iprt/assert.h>
#include <iprt/err.h>
diff --git a/src/VBox/Runtime/common/table/avlrogcphys.cpp b/src/VBox/Runtime/common/table/avlrogcphys.cpp
index c7496e9..c4e1c6e 100644
--- a/src/VBox/Runtime/common/table/avlrogcphys.cpp
+++ b/src/VBox/Runtime/common/table/avlrogcphys.cpp
@@ -28,9 +28,10 @@
static const char szFileId[] = "Id: kAVLULInt.c,v 1.4 2003/02/13 02:02:38 bird Exp $";
#endif
-/*******************************************************************************
-* Defined Constants And Macros *
-*******************************************************************************/
+
+/*********************************************************************************************************************************
+* Defined Constants And Macros *
+*********************************************************************************************************************************/
/*
* AVL configuration.
*/
@@ -61,9 +62,9 @@ static const char szFileId[] = "Id: kAVLULInt.c,v 1.4 2003/02/13 02:02:38 bird E
-/*******************************************************************************
-* Header Files *
-*******************************************************************************/
+/*********************************************************************************************************************************
+* Header Files *
+*********************************************************************************************************************************/
#include <iprt/avl.h>
#include <iprt/assert.h>
#include <iprt/err.h>
diff --git a/src/VBox/Runtime/common/table/avlrogcptr.cpp b/src/VBox/Runtime/common/table/avlrogcptr.cpp
index ab167f2..c5a6443 100644
--- a/src/VBox/Runtime/common/table/avlrogcptr.cpp
+++ b/src/VBox/Runtime/common/table/avlrogcptr.cpp
@@ -28,9 +28,10 @@
static const char szFileId[] = "Id: kAVLULInt.c,v 1.4 2003/02/13 02:02:38 bird Exp $";
#endif
-/*******************************************************************************
-* Defined Constants And Macros *
-*******************************************************************************/
+
+/*********************************************************************************************************************************
+* Defined Constants And Macros *
+*********************************************************************************************************************************/
/*
* AVL configuration.
*/
@@ -61,9 +62,9 @@ static const char szFileId[] = "Id: kAVLULInt.c,v 1.4 2003/02/13 02:02:38 bird E
-/*******************************************************************************
-* Header Files *
-*******************************************************************************/
+/*********************************************************************************************************************************
+* Header Files *
+*********************************************************************************************************************************/
#include <iprt/avl.h>
#include <iprt/assert.h>
#include <iprt/err.h>
diff --git a/src/VBox/Runtime/common/table/avlroioport.cpp b/src/VBox/Runtime/common/table/avlroioport.cpp
index 9534c29..d7a2b3b 100644
--- a/src/VBox/Runtime/common/table/avlroioport.cpp
+++ b/src/VBox/Runtime/common/table/avlroioport.cpp
@@ -28,9 +28,10 @@
static const char szFileId[] = "Id: kAVLULInt.c,v 1.4 2003/02/13 02:02:38 bird Exp $";
#endif
-/*******************************************************************************
-* Defined Constants And Macros *
-*******************************************************************************/
+
+/*********************************************************************************************************************************
+* Defined Constants And Macros *
+*********************************************************************************************************************************/
/*
* AVL configuration.
*/
@@ -61,9 +62,9 @@ static const char szFileId[] = "Id: kAVLULInt.c,v 1.4 2003/02/13 02:02:38 bird E
-/*******************************************************************************
-* Header Files *
-*******************************************************************************/
+/*********************************************************************************************************************************
+* Header Files *
+*********************************************************************************************************************************/
#include <iprt/avl.h>
#include <iprt/assert.h>
#include <iprt/err.h>
diff --git a/src/VBox/Runtime/common/table/avlroogcptr.cpp b/src/VBox/Runtime/common/table/avlroogcptr.cpp
index 5d45aaf..c90781c 100644
--- a/src/VBox/Runtime/common/table/avlroogcptr.cpp
+++ b/src/VBox/Runtime/common/table/avlroogcptr.cpp
@@ -28,9 +28,10 @@
static const char szFileId[] = "Id: kAVLULInt.c,v 1.4 2003/02/13 02:02:38 bird Exp $";
#endif
-/*******************************************************************************
-* Defined Constants And Macros *
-*******************************************************************************/
+
+/*********************************************************************************************************************************
+* Defined Constants And Macros *
+*********************************************************************************************************************************/
/*
* AVL configuration.
*/
@@ -57,9 +58,9 @@ static const char szFileId[] = "Id: kAVLULInt.c,v 1.4 2003/02/13 02:02:38 bird E
-/*******************************************************************************
-* Header Files *
-*******************************************************************************/
+/*********************************************************************************************************************************
+* Header Files *
+*********************************************************************************************************************************/
#include <iprt/avl.h>
#include <iprt/assert.h>
#include <iprt/err.h>
diff --git a/src/VBox/Runtime/common/table/avlrpv.cpp b/src/VBox/Runtime/common/table/avlrpv.cpp
index 40d865f..a0e24a2 100644
--- a/src/VBox/Runtime/common/table/avlrpv.cpp
+++ b/src/VBox/Runtime/common/table/avlrpv.cpp
@@ -28,9 +28,10 @@
static const char szFileId[] = "Id: kAVLPVInt.c,v 1.5 2003/02/13 02:02:35 bird Exp $";
#endif
-/*******************************************************************************
-* Defined Constants And Macros *
-*******************************************************************************/
+
+/*********************************************************************************************************************************
+* Defined Constants And Macros *
+*********************************************************************************************************************************/
/*
* AVL configuration.
*/
@@ -59,9 +60,9 @@ static const char szFileId[] = "Id: kAVLPVInt.c,v 1.5 2003/02/13 02:02:35 bird E
#define KAVL_R_IS_IN_RANGE(key1B, key1E, key2) KAVL_R_IS_INTERSECTING(key1B, key2, key1E, key2)
-/*******************************************************************************
-* Header Files *
-*******************************************************************************/
+/*********************************************************************************************************************************
+* Header Files *
+*********************************************************************************************************************************/
#include <iprt/avl.h>
#include <iprt/assert.h>
#include <iprt/err.h>
diff --git a/src/VBox/Runtime/common/table/avlru64.cpp b/src/VBox/Runtime/common/table/avlru64.cpp
index 6b575b7..7a19de9 100644
--- a/src/VBox/Runtime/common/table/avlru64.cpp
+++ b/src/VBox/Runtime/common/table/avlru64.cpp
@@ -28,9 +28,10 @@
static const char szFileId[] = "Id: kAVLULInt.c,v 1.5 2003/02/13 02:02:35 bird Exp $";
#endif
-/*******************************************************************************
-* Defined Constants And Macros *
-*******************************************************************************/
+
+/*********************************************************************************************************************************
+* Defined Constants And Macros *
+*********************************************************************************************************************************/
/*
* AVL configuration.
*/
@@ -59,9 +60,9 @@ static const char szFileId[] = "Id: kAVLULInt.c,v 1.5 2003/02/13 02:02:35 bird E
#define KAVL_R_IS_IN_RANGE(key1B, key1E, key2) KAVL_R_IS_INTERSECTING(key1B, key2, key1E, key2)
-/*******************************************************************************
-* Header Files *
-*******************************************************************************/
+/*********************************************************************************************************************************
+* Header Files *
+*********************************************************************************************************************************/
#include <iprt/avl.h>
#include <iprt/assert.h>
#include <iprt/err.h>
diff --git a/src/VBox/Runtime/common/table/avlruintptr.cpp b/src/VBox/Runtime/common/table/avlruintptr.cpp
index 5fc868b..8e99d59 100644
--- a/src/VBox/Runtime/common/table/avlruintptr.cpp
+++ b/src/VBox/Runtime/common/table/avlruintptr.cpp
@@ -28,9 +28,10 @@
static const char szFileId[] = "Id: kAVLULInt.c,v 1.4 2003/02/13 02:02:38 bird Exp $";
#endif
-/*******************************************************************************
-* Defined Constants And Macros *
-*******************************************************************************/
+
+/*********************************************************************************************************************************
+* Defined Constants And Macros *
+*********************************************************************************************************************************/
/*
* AVL configuration.
*/
@@ -60,9 +61,9 @@ static const char szFileId[] = "Id: kAVLULInt.c,v 1.4 2003/02/13 02:02:38 bird E
-/*******************************************************************************
-* Header Files *
-*******************************************************************************/
+/*********************************************************************************************************************************
+* Header Files *
+*********************************************************************************************************************************/
#include <iprt/avl.h>
#include <iprt/assert.h>
#include <iprt/err.h>
diff --git a/src/VBox/Runtime/common/table/avlu32.cpp b/src/VBox/Runtime/common/table/avlu32.cpp
index 41de76f..2a223d0 100644
--- a/src/VBox/Runtime/common/table/avlu32.cpp
+++ b/src/VBox/Runtime/common/table/avlu32.cpp
@@ -28,9 +28,10 @@
static const char szFileId[] = "Id: kAVLULInt.c,v 1.4 2003/02/13 02:02:38 bird Exp $";
#endif
-/*******************************************************************************
-* Defined Constants And Macros *
-*******************************************************************************/
+
+/*********************************************************************************************************************************
+* Defined Constants And Macros *
+*********************************************************************************************************************************/
/*
* AVL configuration.
*/
@@ -55,9 +56,9 @@ static const char szFileId[] = "Id: kAVLULInt.c,v 1.4 2003/02/13 02:02:38 bird E
#define KAVL_NE(key1, key2) ( (key1) != (key2) )
-/*******************************************************************************
-* Header Files *
-*******************************************************************************/
+/*********************************************************************************************************************************
+* Header Files *
+*********************************************************************************************************************************/
#include <iprt/avl.h>
#include <iprt/assert.h>
#include <iprt/err.h>
diff --git a/src/VBox/Runtime/common/table/avluintptr.cpp b/src/VBox/Runtime/common/table/avluintptr.cpp
index 94834f8..82ca9e6 100644
--- a/src/VBox/Runtime/common/table/avluintptr.cpp
+++ b/src/VBox/Runtime/common/table/avluintptr.cpp
@@ -28,9 +28,10 @@
static const char szFileId[] = "Id: kAVLULInt.c,v 1.4 2003/02/13 02:02:38 bird Exp $";
#endif
-/*******************************************************************************
-* Defined Constants And Macros *
-*******************************************************************************/
+
+/*********************************************************************************************************************************
+* Defined Constants And Macros *
+*********************************************************************************************************************************/
/*
* AVL configuration.
*/
@@ -55,9 +56,9 @@ static const char szFileId[] = "Id: kAVLULInt.c,v 1.4 2003/02/13 02:02:38 bird E
#define KAVL_NE(key1, key2) ( (RTGCUINTPTR)(key1) != (RTGCUINTPTR)(key2) )
-/*******************************************************************************
-* Header Files *
-*******************************************************************************/
+/*********************************************************************************************************************************
+* Header Files *
+*********************************************************************************************************************************/
#include <iprt/avl.h>
#include <iprt/assert.h>
#include <iprt/err.h>
diff --git a/src/VBox/Runtime/common/table/avlul.cpp b/src/VBox/Runtime/common/table/avlul.cpp
index 62858dc..fc0b43a 100644
--- a/src/VBox/Runtime/common/table/avlul.cpp
+++ b/src/VBox/Runtime/common/table/avlul.cpp
@@ -28,9 +28,10 @@
static const char szFileId[] = "Id: kAVLULInt.c,v 1.4 2003/02/13 02:02:38 bird Exp $";
#endif
-/*******************************************************************************
-* Defined Constants And Macros *
-*******************************************************************************/
+
+/*********************************************************************************************************************************
+* Defined Constants And Macros *
+*********************************************************************************************************************************/
/*
* AVL configuration.
*/
@@ -55,9 +56,9 @@ static const char szFileId[] = "Id: kAVLULInt.c,v 1.4 2003/02/13 02:02:38 bird E
#define KAVL_NE(key1, key2) (key1 != key2)
-/*******************************************************************************
-* Header Files *
-*******************************************************************************/
+/*********************************************************************************************************************************
+* Header Files *
+*********************************************************************************************************************************/
#include <iprt/avl.h>
#include <iprt/assert.h>
#include <iprt/err.h>
diff --git a/src/VBox/Runtime/common/table/table.cpp b/src/VBox/Runtime/common/table/table.cpp
index 6c0a9a2..af1b52a 100644
--- a/src/VBox/Runtime/common/table/table.cpp
+++ b/src/VBox/Runtime/common/table/table.cpp
@@ -28,8 +28,9 @@
static const char szFileId[] = "Id: kAVLULInt.c,v 1.4 2003/02/13 02:02:38 bird Exp $";
#endif
-/*******************************************************************************
-* Header Files *
-*******************************************************************************/
+
+/*********************************************************************************************************************************
+* Header Files *
+*********************************************************************************************************************************/
#include <iprt/table.h>
diff --git a/src/VBox/Runtime/common/time/time.cpp b/src/VBox/Runtime/common/time/time.cpp
index 68e2b84..2f0ccff 100644
--- a/src/VBox/Runtime/common/time/time.cpp
+++ b/src/VBox/Runtime/common/time/time.cpp
@@ -25,9 +25,9 @@
*/
-/*******************************************************************************
-* Header Files *
-*******************************************************************************/
+/*********************************************************************************************************************************
+* Header Files *
+*********************************************************************************************************************************/
#define LOG_GROUP RTLOGGROUP_TIME
#include <iprt/time.h>
#include "internal/iprt.h"
@@ -38,9 +38,9 @@
#include "internal/time.h"
-/*******************************************************************************
-* Defined Constants And Macros *
-*******************************************************************************/
+/*********************************************************************************************************************************
+* Defined Constants And Macros *
+*********************************************************************************************************************************/
/** The max year we possibly could implode. */
#define RTTIME_MAX_YEAR (292 + 1970)
/** The min year we possibly could implode. */
@@ -57,9 +57,9 @@
#define RTTIME_MIN_DAY_NANO ( INT64_C(1000000000) * (00*3600 + 12*60 + 43) + 145224192 )
-/*******************************************************************************
-* Global Variables *
-*******************************************************************************/
+/*********************************************************************************************************************************
+* Global Variables *
+*********************************************************************************************************************************/
/**
* Days per month in a common year.
*/
diff --git a/src/VBox/Runtime/common/time/timeprog.cpp b/src/VBox/Runtime/common/time/timeprog.cpp
index 358747c..146481d 100644
--- a/src/VBox/Runtime/common/time/timeprog.cpp
+++ b/src/VBox/Runtime/common/time/timeprog.cpp
@@ -25,9 +25,9 @@
*/
-/*******************************************************************************
-* Header Files *
-*******************************************************************************/
+/*********************************************************************************************************************************
+* Header Files *
+*********************************************************************************************************************************/
#include <iprt/time.h>
#include "internal/iprt.h"
diff --git a/src/VBox/Runtime/common/time/timesup.cpp b/src/VBox/Runtime/common/time/timesup.cpp
index c518b03..a5d6e61 100644
--- a/src/VBox/Runtime/common/time/timesup.cpp
+++ b/src/VBox/Runtime/common/time/timesup.cpp
@@ -25,9 +25,9 @@
*/
-/*******************************************************************************
-* Header Files *
-*******************************************************************************/
+/*********************************************************************************************************************************
+* Header Files *
+*********************************************************************************************************************************/
#define LOG_GROUP RTLOGGROUP_TIME
#include <iprt/time.h>
#include "internal/iprt.h"
@@ -44,9 +44,9 @@
#include "internal/time.h"
-/*******************************************************************************
-* Internal Functions *
-*******************************************************************************/
+/*********************************************************************************************************************************
+* Internal Functions *
+*********************************************************************************************************************************/
#if !defined(IN_GUEST) && !defined(RT_NO_GIP)
static DECLCALLBACK(void) rtTimeNanoTSInternalBitch(PRTTIMENANOTSDATA pData, uint64_t u64NanoTS, uint64_t u64DeltaPrev, uint64_t u64PrevNanoTS);
static DECLCALLBACK(uint64_t) rtTimeNanoTSInternalFallback(PRTTIMENANOTSDATA pData);
@@ -55,9 +55,9 @@ static DECLCALLBACK(uint64_t) rtTimeNanoTSInternalBadCpuIndex(PRTTIMENANOTSDATA
#endif
-/*******************************************************************************
-* Global Variables *
-*******************************************************************************/
+/*********************************************************************************************************************************
+* Global Variables *
+*********************************************************************************************************************************/
#if !defined(IN_GUEST) && !defined(RT_NO_GIP)
/** The previous timestamp value returned by RTTimeNanoTS. */
static uint64_t g_TimeNanoTSPrev = 0;
diff --git a/src/VBox/Runtime/common/time/timesupref.cpp b/src/VBox/Runtime/common/time/timesupref.cpp
index b7717ba..256b735 100644
--- a/src/VBox/Runtime/common/time/timesupref.cpp
+++ b/src/VBox/Runtime/common/time/timesupref.cpp
@@ -26,9 +26,10 @@
#if !defined(IN_GUEST) && !defined(RT_NO_GIP)
-/*******************************************************************************
-* Header Files *
-*******************************************************************************/
+
+/*********************************************************************************************************************************
+* Header Files *
+*********************************************************************************************************************************/
#include <iprt/time.h>
#include "internal/iprt.h"
diff --git a/src/VBox/Runtime/common/time/timesysalias.cpp b/src/VBox/Runtime/common/time/timesysalias.cpp
index 37ea7d6..434a57a 100644
--- a/src/VBox/Runtime/common/time/timesysalias.cpp
+++ b/src/VBox/Runtime/common/time/timesysalias.cpp
@@ -25,9 +25,9 @@
*/
-/*******************************************************************************
-* Header Files *
-*******************************************************************************/
+/*********************************************************************************************************************************
+* Header Files *
+*********************************************************************************************************************************/
#include <iprt/time.h>
#include "internal/iprt.h"
diff --git a/src/VBox/Runtime/common/vfs/vfsbase.cpp b/src/VBox/Runtime/common/vfs/vfsbase.cpp
index dbcf4d5..faa55f3 100644
--- a/src/VBox/Runtime/common/vfs/vfsbase.cpp
+++ b/src/VBox/Runtime/common/vfs/vfsbase.cpp
@@ -25,9 +25,9 @@
*/
-/*******************************************************************************
-* Header Files *
-*******************************************************************************/
+/*********************************************************************************************************************************
+* Header Files *
+*********************************************************************************************************************************/
#include <iprt/vfs.h>
#include <iprt/vfslowlevel.h>
@@ -46,9 +46,9 @@
//#include "internal/vfs.h"
-/*******************************************************************************
-* Defined Constants And Macros *
-*******************************************************************************/
+/*********************************************************************************************************************************
+* Defined Constants And Macros *
+*********************************************************************************************************************************/
/** The instance data alignment. */
#define RTVFS_INST_ALIGNMENT 16U
@@ -121,9 +121,9 @@
} while (0)
-/*******************************************************************************
-* Structures and Typedefs *
-*******************************************************************************/
+/*********************************************************************************************************************************
+* Structures and Typedefs *
+*********************************************************************************************************************************/
/** @todo Move all this stuff to internal/vfs.h */
diff --git a/src/VBox/Runtime/common/vfs/vfschain.cpp b/src/VBox/Runtime/common/vfs/vfschain.cpp
index 55953b0..e4387d7 100644
--- a/src/VBox/Runtime/common/vfs/vfschain.cpp
+++ b/src/VBox/Runtime/common/vfs/vfschain.cpp
@@ -25,9 +25,9 @@
*/
-/*******************************************************************************
-* Header Files *
-*******************************************************************************/
+/*********************************************************************************************************************************
+* Header Files *
+*********************************************************************************************************************************/
#include <iprt/vfs.h>
#include <iprt/vfslowlevel.h>
@@ -48,9 +48,9 @@
-/*******************************************************************************
-* Global Variables *
-*******************************************************************************/
+/*********************************************************************************************************************************
+* Global Variables *
+*********************************************************************************************************************************/
/** Init the critical section once. */
static RTONCE g_rtVfsChainElementInitOnce;
/** Critical section protecting g_rtVfsChainElementProviderList. */
diff --git a/src/VBox/Runtime/common/vfs/vfsiosmisc.cpp b/src/VBox/Runtime/common/vfs/vfsiosmisc.cpp
index c2ce507..6052e60 100644
--- a/src/VBox/Runtime/common/vfs/vfsiosmisc.cpp
+++ b/src/VBox/Runtime/common/vfs/vfsiosmisc.cpp
@@ -25,9 +25,9 @@
*/
-/*******************************************************************************
-* Header Files *
-*******************************************************************************/
+/*********************************************************************************************************************************
+* Header Files *
+*********************************************************************************************************************************/
#include <iprt/vfs.h>
#include <iprt/vfslowlevel.h>
diff --git a/src/VBox/Runtime/common/vfs/vfsmemory.cpp b/src/VBox/Runtime/common/vfs/vfsmemory.cpp
index 1ca3113..90c4da2 100644
--- a/src/VBox/Runtime/common/vfs/vfsmemory.cpp
+++ b/src/VBox/Runtime/common/vfs/vfsmemory.cpp
@@ -25,9 +25,9 @@
*/
-/*******************************************************************************
-* Header Files *
-*******************************************************************************/
+/*********************************************************************************************************************************
+* Header Files *
+*********************************************************************************************************************************/
#include "internal/iprt.h"
#include <iprt/vfs.h>
@@ -42,9 +42,9 @@
-/*******************************************************************************
-* Header Files *
-*******************************************************************************/
+/*********************************************************************************************************************************
+* Header Files *
+*********************************************************************************************************************************/
#include "internal/iprt.h"
#include <iprt/vfs.h>
@@ -52,16 +52,16 @@
#include <iprt/mem.h>
-/*******************************************************************************
-* Defined Constants And Macros *
-*******************************************************************************/
+/*********************************************************************************************************************************
+* Defined Constants And Macros *
+*********************************************************************************************************************************/
/** The max extent size. */
#define RTVFSMEM_MAX_EXTENT_SIZE _2M
-/*******************************************************************************
-* Structures and Typedefs *
-*******************************************************************************/
+/*********************************************************************************************************************************
+* Structures and Typedefs *
+*********************************************************************************************************************************/
/**
* Memory base object info.
diff --git a/src/VBox/Runtime/common/vfs/vfsmisc.cpp b/src/VBox/Runtime/common/vfs/vfsmisc.cpp
index 714e730..cb9be11 100644
--- a/src/VBox/Runtime/common/vfs/vfsmisc.cpp
+++ b/src/VBox/Runtime/common/vfs/vfsmisc.cpp
@@ -25,9 +25,9 @@
*/
-/*******************************************************************************
-* Header Files *
-*******************************************************************************/
+/*********************************************************************************************************************************
+* Header Files *
+*********************************************************************************************************************************/
#include "internal/iprt.h"
#include <iprt/vfs.h>
diff --git a/src/VBox/Runtime/common/vfs/vfsstdfile.cpp b/src/VBox/Runtime/common/vfs/vfsstdfile.cpp
index af8fb66..4b752d8 100644
--- a/src/VBox/Runtime/common/vfs/vfsstdfile.cpp
+++ b/src/VBox/Runtime/common/vfs/vfsstdfile.cpp
@@ -25,9 +25,9 @@
*/
-/*******************************************************************************
-* Header Files *
-*******************************************************************************/
+/*********************************************************************************************************************************
+* Header Files *
+*********************************************************************************************************************************/
#include <iprt/vfs.h>
#include <iprt/vfslowlevel.h>
@@ -37,9 +37,9 @@
#include <iprt/thread.h>
-/*******************************************************************************
-* Structures and Typedefs *
-*******************************************************************************/
+/*********************************************************************************************************************************
+* Structures and Typedefs *
+*********************************************************************************************************************************/
/**
* Private data of a standard file.
*/
@@ -488,7 +488,10 @@ RTDECL(int) RTVfsIoStrmFromRTFile(RTFILE hFile, uint64_t fOpen, bool fLeaveOpen,
RTVFSFILE hVfsFile;
int rc = RTVfsFileFromRTFile(hFile, fOpen, fLeaveOpen, &hVfsFile);
if (RT_SUCCESS(rc))
+ {
*phVfsIos = RTVfsFileToIoStream(hVfsFile);
+ RTVfsFileRelease(hVfsFile);
+ }
return rc;
}
diff --git a/src/VBox/Runtime/common/zip/gzipvfs.cpp b/src/VBox/Runtime/common/zip/gzipvfs.cpp
index 7582d8e..3098437 100644
--- a/src/VBox/Runtime/common/zip/gzipvfs.cpp
+++ b/src/VBox/Runtime/common/zip/gzipvfs.cpp
@@ -25,9 +25,9 @@
*/
-/*******************************************************************************
-* Defined Constants And Macros *
-*******************************************************************************/
+/*********************************************************************************************************************************
+* Defined Constants And Macros *
+*********************************************************************************************************************************/
#include "internal/iprt.h"
#include <iprt/zip.h>
@@ -57,9 +57,9 @@ PFNRT g_apfnRTZlibDeps[] =
#endif /* RT_OS_OS2 || RT_OS_SOLARIS || RT_OS_WINDOWS */
-/*******************************************************************************
-* Structures and Typedefs *
-*******************************************************************************/
+/*********************************************************************************************************************************
+* Structures and Typedefs *
+*********************************************************************************************************************************/
#pragma pack(1)
typedef struct RTZIPGZIPHDR
{
@@ -168,9 +168,9 @@ typedef struct RTZIPGZIPSTREAM
typedef RTZIPGZIPSTREAM *PRTZIPGZIPSTREAM;
-/*******************************************************************************
-* Internal Functions *
-*******************************************************************************/
+/*********************************************************************************************************************************
+* Internal Functions *
+*********************************************************************************************************************************/
static int rtZipGzip_FlushIt(PRTZIPGZIPSTREAM pThis, uint8_t fFlushType);
diff --git a/src/VBox/Runtime/common/zip/pkzip.cpp b/src/VBox/Runtime/common/zip/pkzip.cpp
index d45a22e..320ea72 100644
--- a/src/VBox/Runtime/common/zip/pkzip.cpp
+++ b/src/VBox/Runtime/common/zip/pkzip.cpp
@@ -25,9 +25,9 @@
*/
-/******************************************************************************
- * Header Files *
- ******************************************************************************/
+/*********************************************************************************************************************************
+* Header Files *
+*********************************************************************************************************************************/
#include <iprt/zip.h>
#include <iprt/file.h>
#include <iprt/fs.h>
@@ -37,9 +37,9 @@
#include <iprt/vfslowlevel.h>
-/*******************************************************************************
-* Structures and Typedefs *
-*******************************************************************************/
+/*********************************************************************************************************************************
+* Structures and Typedefs *
+*********************************************************************************************************************************/
/**
* Memory stream private data.
*/
diff --git a/src/VBox/Runtime/common/zip/pkzipvfs.cpp b/src/VBox/Runtime/common/zip/pkzipvfs.cpp
index 99edc5e..b8c702e 100644
--- a/src/VBox/Runtime/common/zip/pkzipvfs.cpp
+++ b/src/VBox/Runtime/common/zip/pkzipvfs.cpp
@@ -25,9 +25,9 @@
*/
-/******************************************************************************
- * Header Files *
- ******************************************************************************/
+/*********************************************************************************************************************************
+* Header Files *
+*********************************************************************************************************************************/
#include <iprt/zip.h>
#include <iprt/assert.h>
#include <iprt/err.h>
@@ -40,9 +40,9 @@
#include <iprt/stream.h>
-/*******************************************************************************
-* Structures and Typedefs *
-*******************************************************************************/
+/*********************************************************************************************************************************
+* Structures and Typedefs *
+*********************************************************************************************************************************/
/* See http://www.pkware.com/documents/casestudies/APPNOTE.TXT */
/**
diff --git a/src/VBox/Runtime/common/zip/tar.cpp b/src/VBox/Runtime/common/zip/tar.cpp
index 1b6edeb..4c8eee2 100644
--- a/src/VBox/Runtime/common/zip/tar.cpp
+++ b/src/VBox/Runtime/common/zip/tar.cpp
@@ -25,9 +25,9 @@
*/
-/*******************************************************************************
-* Header Files *
-*******************************************************************************/
+/*********************************************************************************************************************************
+* Header Files *
+*********************************************************************************************************************************/
#include "internal/iprt.h"
#include <iprt/tar.h>
@@ -46,9 +46,9 @@
#include "tar.h"
-/*******************************************************************************
-* Structures and Typedefs *
-*******************************************************************************/
+/*********************************************************************************************************************************
+* Structures and Typedefs *
+*********************************************************************************************************************************/
/** @name RTTARRECORD::h::linkflag
* @{ */
#define LF_OLDNORMAL '\0' /**< Normal disk file, Unix compatible */
@@ -148,9 +148,9 @@ typedef RTTARFILEINTERNAL *PRTTARFILEINTERNAL;
-/*******************************************************************************
-* Defined Constants And Macros *
-*******************************************************************************/
+/*********************************************************************************************************************************
+* Defined Constants And Macros *
+*********************************************************************************************************************************/
/** Validates a handle and returns VERR_INVALID_HANDLE if not valid. */
/* RTTAR */
diff --git a/src/VBox/Runtime/common/zip/tarcmd.cpp b/src/VBox/Runtime/common/zip/tarcmd.cpp
index 353fc71..719c72c 100644
--- a/src/VBox/Runtime/common/zip/tarcmd.cpp
+++ b/src/VBox/Runtime/common/zip/tarcmd.cpp
@@ -25,9 +25,9 @@
*/
-/*******************************************************************************
-* Header Files *
-*******************************************************************************/
+/*********************************************************************************************************************************
+* Header Files *
+*********************************************************************************************************************************/
#include <iprt/zip.h>
#include <iprt/asm.h>
@@ -47,9 +47,9 @@
#include <iprt/vfs.h>
-/*******************************************************************************
-* Defined Constants And Macros *
-*******************************************************************************/
+/*********************************************************************************************************************************
+* Defined Constants And Macros *
+*********************************************************************************************************************************/
#define RTZIPTARCMD_OPT_DELETE 1000
#define RTZIPTARCMD_OPT_OWNER 1001
#define RTZIPTARCMD_OPT_GROUP 1002
@@ -74,9 +74,9 @@ typedef enum RTZIPTARFORMAT
} RTZIPTARFORMAT;
-/*******************************************************************************
-* Structures and Typedefs *
-*******************************************************************************/
+/*********************************************************************************************************************************
+* Structures and Typedefs *
+*********************************************************************************************************************************/
/**
* IPRT TAR option structure.
*/
diff --git a/src/VBox/Runtime/common/zip/tarvfs.cpp b/src/VBox/Runtime/common/zip/tarvfs.cpp
index af86217..b485312 100644
--- a/src/VBox/Runtime/common/zip/tarvfs.cpp
+++ b/src/VBox/Runtime/common/zip/tarvfs.cpp
@@ -25,9 +25,9 @@
*/
-/******************************************************************************
- * Header Files *
- ******************************************************************************/
+/*********************************************************************************************************************************
+* Header Files *
+*********************************************************************************************************************************/
#include "internal/iprt.h"
#include <iprt/zip.h>
@@ -44,9 +44,9 @@
#include "tar.h"
-/*******************************************************************************
-* Structures and Typedefs *
-*******************************************************************************/
+/*********************************************************************************************************************************
+* Structures and Typedefs *
+*********************************************************************************************************************************/
/**
* TAR reader state machine states.
*/
diff --git a/src/VBox/Runtime/common/zip/unzipcmd.cpp b/src/VBox/Runtime/common/zip/unzipcmd.cpp
index c18ffc4..aad799f 100644
--- a/src/VBox/Runtime/common/zip/unzipcmd.cpp
+++ b/src/VBox/Runtime/common/zip/unzipcmd.cpp
@@ -25,9 +25,9 @@
*/
-/*******************************************************************************
-* Header Files *
-*******************************************************************************/
+/*********************************************************************************************************************************
+* Header Files *
+*********************************************************************************************************************************/
#include <iprt/zip.h>
#include <iprt/asm.h>
#include <iprt/getopt.h>
@@ -40,14 +40,14 @@
#include <iprt/stream.h>
-/*******************************************************************************
-* Defined Constants And Macros *
-*******************************************************************************/
+/*********************************************************************************************************************************
+* Defined Constants And Macros *
+*********************************************************************************************************************************/
-/*******************************************************************************
-* Structures and Typedefs *
-*******************************************************************************/
+/*********************************************************************************************************************************
+* Structures and Typedefs *
+*********************************************************************************************************************************/
/**
* IPRT UNZIP option structure.
diff --git a/src/VBox/Runtime/common/zip/xarvfs.cpp b/src/VBox/Runtime/common/zip/xarvfs.cpp
index df75ba6..a03868e 100644
--- a/src/VBox/Runtime/common/zip/xarvfs.cpp
+++ b/src/VBox/Runtime/common/zip/xarvfs.cpp
@@ -25,9 +25,9 @@
*/
-/******************************************************************************
- * Header Files *
- ******************************************************************************/
+/*********************************************************************************************************************************
+* Header Files *
+*********************************************************************************************************************************/
#include "internal/iprt.h"
#include <iprt/zip.h>
@@ -46,9 +46,9 @@
#include <iprt/cpp/xml.h>
-/*******************************************************************************
-* Defined Constants And Macros *
-*******************************************************************************/
+/*********************************************************************************************************************************
+* Defined Constants And Macros *
+*********************************************************************************************************************************/
/** @name Hash state
* @{ */
#define RTZIPXAR_HASH_PENDING 0
@@ -58,9 +58,9 @@
/** @} */
-/*******************************************************************************
-* Structures and Typedefs *
-*******************************************************************************/
+/*********************************************************************************************************************************
+* Structures and Typedefs *
+*********************************************************************************************************************************/
/**
* Hash digest value union for the supported XAR hash functions.
* @todo This could be generalized in iprt/checksum.h or somewhere.
diff --git a/src/VBox/Runtime/common/zip/zip.cpp b/src/VBox/Runtime/common/zip/zip.cpp
index 19b5e45..291cbf3 100644
--- a/src/VBox/Runtime/common/zip/zip.cpp
+++ b/src/VBox/Runtime/common/zip/zip.cpp
@@ -25,9 +25,9 @@
*/
-/*******************************************************************************
-* Defined Constants And Macros *
-*******************************************************************************/
+/*********************************************************************************************************************************
+* Defined Constants And Macros *
+*********************************************************************************************************************************/
#define RTZIP_USE_STORE 1
#define RTZIP_USE_ZLIB 1
//#define RTZIP_USE_BZLIB 1
@@ -39,9 +39,9 @@
/** @todo FastLZ? QuickLZ? Others? */
-/*******************************************************************************
-* Header Files *
-*******************************************************************************/
+/*********************************************************************************************************************************
+* Header Files *
+*********************************************************************************************************************************/
#ifdef RTZIP_USE_BZLIB
# include <bzlib.h>
#endif
@@ -72,9 +72,9 @@
#include <errno.h>
-/*******************************************************************************
-* Structures and Typedefs *
-*******************************************************************************/
+/*********************************************************************************************************************************
+* Structures and Typedefs *
+*********************************************************************************************************************************/
#ifdef RTZIP_USE_LZF
@@ -1717,7 +1717,7 @@ RT_EXPORT_SYMBOL(RTZipDecompDestroy);
RTDECL(int) RTZipBlockCompress(RTZIPTYPE enmType, RTZIPLEVEL enmLevel, uint32_t fFlags,
void const *pvSrc, size_t cbSrc,
- void *pvDst, size_t cbDst, size_t *pcbDstActual) RT_NO_THROW
+ void *pvDst, size_t cbDst, size_t *pcbDstActual) RT_NO_THROW_DEF
{
/* input validation - the crash and burn approach as speed is essential here. */
Assert(enmLevel <= RTZIPLEVEL_MAX && enmLevel >= RTZIPLEVEL_STORE);
@@ -1833,7 +1833,7 @@ RT_EXPORT_SYMBOL(RTZipBlockCompress);
RTDECL(int) RTZipBlockDecompress(RTZIPTYPE enmType, uint32_t fFlags,
void const *pvSrc, size_t cbSrc, size_t *pcbSrcActual,
- void *pvDst, size_t cbDst, size_t *pcbDstActual) RT_NO_THROW
+ void *pvDst, size_t cbDst, size_t *pcbDstActual) RT_NO_THROW_DEF
{
/* input validation - the crash and burn approach as speed is essential here. */
Assert(!fFlags);
diff --git a/src/VBox/Runtime/darwin/RTErrConvertFromDarwin.cpp b/src/VBox/Runtime/darwin/RTErrConvertFromDarwin.cpp
index a9cb394..5c228cc 100644
--- a/src/VBox/Runtime/darwin/RTErrConvertFromDarwin.cpp
+++ b/src/VBox/Runtime/darwin/RTErrConvertFromDarwin.cpp
@@ -24,9 +24,10 @@
* terms and conditions of either the GPL or the CDDL or both.
*/
-/*******************************************************************************
-* Header Files *
-*******************************************************************************/
+
+/*********************************************************************************************************************************
+* Header Files *
+*********************************************************************************************************************************/
#include <mach/kern_return.h>
#include <IOKit/IOReturn.h>
diff --git a/src/VBox/Runtime/darwin/RTErrConvertFromDarwinCOM.cpp b/src/VBox/Runtime/darwin/RTErrConvertFromDarwinCOM.cpp
index ff558c5..16387b8 100644
--- a/src/VBox/Runtime/darwin/RTErrConvertFromDarwinCOM.cpp
+++ b/src/VBox/Runtime/darwin/RTErrConvertFromDarwinCOM.cpp
@@ -24,9 +24,10 @@
* terms and conditions of either the GPL or the CDDL or both.
*/
-/*******************************************************************************
-* Header Files *
-*******************************************************************************/
+
+/*********************************************************************************************************************************
+* Header Files *
+*********************************************************************************************************************************/
#include <IOKit/IOCFPlugIn.h>
#include <iprt/err.h>
diff --git a/src/VBox/Runtime/darwin/RTErrConvertFromDarwinIO.cpp b/src/VBox/Runtime/darwin/RTErrConvertFromDarwinIO.cpp
index 3f2e37a..93dc1ce 100644
--- a/src/VBox/Runtime/darwin/RTErrConvertFromDarwinIO.cpp
+++ b/src/VBox/Runtime/darwin/RTErrConvertFromDarwinIO.cpp
@@ -24,9 +24,10 @@
* terms and conditions of either the GPL or the CDDL or both.
*/
-/*******************************************************************************
-* Header Files *
-*******************************************************************************/
+
+/*********************************************************************************************************************************
+* Header Files *
+*********************************************************************************************************************************/
#include <IOKit/IOReturn.h>
#include <iprt/err.h>
diff --git a/src/VBox/Runtime/darwin/RTErrConvertFromDarwinKern.cpp b/src/VBox/Runtime/darwin/RTErrConvertFromDarwinKern.cpp
index 822f549..8389272 100644
--- a/src/VBox/Runtime/darwin/RTErrConvertFromDarwinKern.cpp
+++ b/src/VBox/Runtime/darwin/RTErrConvertFromDarwinKern.cpp
@@ -24,9 +24,10 @@
* terms and conditions of either the GPL or the CDDL or both.
*/
-/*******************************************************************************
-* Header Files *
-*******************************************************************************/
+
+/*********************************************************************************************************************************
+* Header Files *
+*********************************************************************************************************************************/
#include <mach/kern_return.h>
#include <iprt/err.h>
diff --git a/src/VBox/Runtime/gc/initterm-gc.cpp b/src/VBox/Runtime/gc/initterm-gc.cpp
index f9dafa2..e5d9a2f 100644
--- a/src/VBox/Runtime/gc/initterm-gc.cpp
+++ b/src/VBox/Runtime/gc/initterm-gc.cpp
@@ -26,9 +26,9 @@
-/*******************************************************************************
-* Header Files *
-*******************************************************************************/
+/*********************************************************************************************************************************
+* Header Files *
+*********************************************************************************************************************************/
#define LOG_GROUP RTLOGGROUP_DEFAULT
#include <iprt/initterm.h>
@@ -39,9 +39,9 @@
#include "internal/time.h"
-/*******************************************************************************
-* Global Variables *
-*******************************************************************************/
+/*********************************************************************************************************************************
+* Global Variables *
+*********************************************************************************************************************************/
/**
* Program start nanosecond TS.
*/
diff --git a/src/VBox/Runtime/generic/RTAssertShouldPanic-generic.cpp b/src/VBox/Runtime/generic/RTAssertShouldPanic-generic.cpp
index 032fb38..a079261 100644
--- a/src/VBox/Runtime/generic/RTAssertShouldPanic-generic.cpp
+++ b/src/VBox/Runtime/generic/RTAssertShouldPanic-generic.cpp
@@ -25,9 +25,9 @@
*/
-/*******************************************************************************
-* Header Files *
-*******************************************************************************/
+/*********************************************************************************************************************************
+* Header Files *
+*********************************************************************************************************************************/
#include <iprt/assert.h>
#include "internal/iprt.h"
diff --git a/src/VBox/Runtime/generic/RTCrStoreCreateSnapshotById-generic.cpp b/src/VBox/Runtime/generic/RTCrStoreCreateSnapshotById-generic.cpp
new file mode 100644
index 0000000..b6341dc
--- /dev/null
+++ b/src/VBox/Runtime/generic/RTCrStoreCreateSnapshotById-generic.cpp
@@ -0,0 +1,152 @@
+/* $Id: RTCrStoreCreateSnapshotById-generic.cpp $ */
+/** @file
+ * IPRT - Generic RTCrStoreCreateSnapshotById implementation.
+ */
+
+/*
+ * Copyright (C) 2006-2015 Oracle Corporation
+ *
+ * This file is part of VirtualBox Open Source Edition (OSE), as
+ * available from http://www.virtualbox.org. This file is free software;
+ * you can redistribute it and/or modify it under the terms of the GNU
+ * General Public License (GPL) as published by the Free Software
+ * Foundation, in version 2 as it comes in the "COPYING" file of the
+ * VirtualBox OSE distribution. VirtualBox OSE is distributed in the
+ * hope that it will be useful, but WITHOUT ANY WARRANTY of any kind.
+ *
+ * The contents of this file may alternatively be used under the terms
+ * of the Common Development and Distribution License Version 1.0
+ * (CDDL) only, as it comes in the "COPYING.CDDL" file of the
+ * VirtualBox OSE distribution, in which case the provisions of the
+ * CDDL are applicable instead of those of the GPL.
+ *
+ * You may elect to license modified versions of this file under the
+ * terms and conditions of either the GPL or the CDDL or both.
+ */
+
+
+/*********************************************************************************************************************************
+* Header Files *
+*********************************************************************************************************************************/
+#include <iprt/crypto/store.h>
+#include "internal/iprt.h"
+
+#include <iprt/assert.h>
+#include <iprt/err.h>
+#include <iprt/file.h>
+#include <iprt/dir.h>
+
+
+/*********************************************************************************************************************************
+* Defined Constants And Macros *
+*********************************************************************************************************************************/
+/** Unix root prefix. */
+#ifdef RT_OS_OS2
+# define UNIX_ROOT "/@unixroot@"
+#elif defined(RT_OS_WINDOWS)
+# define UNIX_ROOT "C:/cygwin"
+#else
+# define UNIX_ROOT
+#endif
+
+
+/*********************************************************************************************************************************
+* Global Variables *
+*********************************************************************************************************************************/
+/** System PEM files worth looking at.
+ * @remarks Several of these could be symlinks to one of the others.
+ */
+static const char *g_apszSystemPemFiles[] =
+{
+ UNIX_ROOT "/etc/ssl/certs/ca-certificates.crt",
+ UNIX_ROOT "/etc/ssl/cert.pem",
+ UNIX_ROOT "/etc/ca-certificates/extracted/tls-ca-bundle.pem",
+ UNIX_ROOT "/etc/ca-certificates/extracted/email-ca-bundle.pem",
+ UNIX_ROOT "/etc/ca-certificates/extracted/objsign-ca-bundle.pem",
+ UNIX_ROOT "/etc/ca-certificates/extracted/ca-bundle.trust.crt",
+ UNIX_ROOT "/etc/ca-certificates/extracted/ca-bundle.trust.crt",
+ UNIX_ROOT "/etc/curl/curlCA",
+#if 0 /* Just for reference. */
+ UNIX_ROOT"/usr/share/ca-certificates/trust-source/mozilla.trust.crt",
+ UNIX_ROOT"/usr/share/ca-certificates/trust-source/mozilla.neutral-trust.crt",
+# if defined(RT_OS_SOLARIS) /* the only one on tindersol2... */
+ UNIX_ROOT"/usr/share/doc/mutt/samples/ca-bundle.crt",
+ VeriSign topic: Provide interface for reading: /usr/jdk/latest/jre/lib/security/cacerts ?
+# endif
+#endif
+};
+
+/**
+ * System directories containing lots of pem/crt files.
+ */
+static const char *g_apszSystemPemDirs[] =
+{
+ UNIX_ROOT "/etc/openssl/certs/",
+ UNIX_ROOT "/etc/ssl/certs/",
+ UNIX_ROOT "/etc/ca-certificates/extracted/cadir/",
+};
+
+
+RTDECL(int) RTCrStoreCreateSnapshotById(PRTCRSTORE phStore, RTCRSTOREID enmStoreId, PRTERRINFO pErrInfo)
+{
+ AssertReturn(enmStoreId > RTCRSTOREID_INVALID && enmStoreId < RTCRSTOREID_END, VERR_INVALID_PARAMETER);
+
+ /*
+ * Create an empty in-memory store.
+ */
+ RTCRSTORE hStore;
+ uint32_t cExpected = enmStoreId == RTCRSTOREID_SYSTEM_TRUSTED_CAS_AND_CERTIFICATES ? 256 : 0;
+ int rc = RTCrStoreCreateInMem(&hStore, cExpected);
+ if (RT_SUCCESS(rc))
+ {
+ *phStore = hStore;
+
+ /*
+ * Add system certificates if part of the given store ID.
+ */
+ bool fFound = false;
+ rc = VINF_SUCCESS;
+ if (enmStoreId == RTCRSTOREID_SYSTEM_TRUSTED_CAS_AND_CERTIFICATES)
+ {
+ for (uint32_t i = 0; i < RT_ELEMENTS(g_apszSystemPemFiles); i++)
+ if (RTFileExists(g_apszSystemPemFiles[i]))
+ {
+ fFound = true;
+ int rc2 = RTCrStoreCertAddFromFile(hStore,
+ RTCRCERTCTX_F_ADD_IF_NOT_FOUND | RTCRCERTCTX_F_ADD_CONTINUE_ON_ERROR,
+ g_apszSystemPemFiles[i], pErrInfo);
+ if (RT_FAILURE(rc2))
+ rc = -rc2;
+ }
+
+ /*
+ * If we didn't find any of the certificate collection files, go hunting
+ * for directories containing PEM/CRT files with single certificates.
+ */
+ if (!fFound)
+ for (uint32_t i = 0; i < RT_ELEMENTS(g_apszSystemPemDirs); i++)
+ if (RTDirExists(g_apszSystemPemDirs[i]))
+ {
+ static RTSTRTUPLE const s_aSuffixes[] =
+ {
+ { RT_STR_TUPLE(".crt") },
+ { RT_STR_TUPLE(".pem") },
+ { RT_STR_TUPLE(".PEM") },
+ { RT_STR_TUPLE(".CRT") },
+ };
+ fFound = true;
+ int rc2 = RTCrStoreCertAddFromDir(hStore,
+ RTCRCERTCTX_F_ADD_IF_NOT_FOUND | RTCRCERTCTX_F_ADD_CONTINUE_ON_ERROR,
+ g_apszSystemPemDirs[i], &s_aSuffixes[0], RT_ELEMENTS(s_aSuffixes),
+ pErrInfo);
+ if (RT_FAILURE(rc2))
+ rc = -rc2;
+ }
+ }
+ }
+ else
+ RTErrInfoAdd(pErrInfo, rc, " RTCrStoreCreateInMem failed");
+ return rc;
+}
+RT_EXPORT_SYMBOL(RTCrStoreCreateSnapshotById);
+
diff --git a/src/VBox/Runtime/generic/RTDirCreateUniqueNumbered-generic.cpp b/src/VBox/Runtime/generic/RTDirCreateUniqueNumbered-generic.cpp
index 9e2eb70..727331d 100644
--- a/src/VBox/Runtime/generic/RTDirCreateUniqueNumbered-generic.cpp
+++ b/src/VBox/Runtime/generic/RTDirCreateUniqueNumbered-generic.cpp
@@ -25,9 +25,9 @@
*/
-/*******************************************************************************
-* Header Files *
-*******************************************************************************/
+/*********************************************************************************************************************************
+* Header Files *
+*********************************************************************************************************************************/
#include <iprt/dir.h>
#include "internal/iprt.h"
diff --git a/src/VBox/Runtime/generic/RTDirExists-generic.cpp b/src/VBox/Runtime/generic/RTDirExists-generic.cpp
index c07de4c..5a5c626 100644
--- a/src/VBox/Runtime/generic/RTDirExists-generic.cpp
+++ b/src/VBox/Runtime/generic/RTDirExists-generic.cpp
@@ -25,9 +25,9 @@
*/
-/*******************************************************************************
-* Header Files *
-*******************************************************************************/
+/*********************************************************************************************************************************
+* Header Files *
+*********************************************************************************************************************************/
#define LOG_GROUP RTLOGGROUP_DIR
#include "internal/iprt.h"
diff --git a/src/VBox/Runtime/generic/RTDirQueryInfo-generic.cpp b/src/VBox/Runtime/generic/RTDirQueryInfo-generic.cpp
index b2c365b..82c951a 100644
--- a/src/VBox/Runtime/generic/RTDirQueryInfo-generic.cpp
+++ b/src/VBox/Runtime/generic/RTDirQueryInfo-generic.cpp
@@ -25,9 +25,9 @@
*/
-/*******************************************************************************
-* Header Files *
-*******************************************************************************/
+/*********************************************************************************************************************************
+* Header Files *
+*********************************************************************************************************************************/
#define LOG_GROUP RTLOGGROUP_DIR
#ifdef RT_OS_WINDOWS /* dir.h has host specific stuff */
# include <Windows.h>
diff --git a/src/VBox/Runtime/generic/RTDirSetTimes-generic.cpp b/src/VBox/Runtime/generic/RTDirSetTimes-generic.cpp
index ab67575..3abe54c 100644
--- a/src/VBox/Runtime/generic/RTDirSetTimes-generic.cpp
+++ b/src/VBox/Runtime/generic/RTDirSetTimes-generic.cpp
@@ -25,9 +25,9 @@
*/
-/*******************************************************************************
-* Header Files *
-*******************************************************************************/
+/*********************************************************************************************************************************
+* Header Files *
+*********************************************************************************************************************************/
#define LOG_GROUP RTLOGGROUP_DIR
#ifdef RT_OS_WINDOWS /* dir.h has host specific stuff */
# include <Windows.h>
diff --git a/src/VBox/Runtime/generic/RTEnvDupEx-generic.cpp b/src/VBox/Runtime/generic/RTEnvDupEx-generic.cpp
index 403801d..2c55000 100644
--- a/src/VBox/Runtime/generic/RTEnvDupEx-generic.cpp
+++ b/src/VBox/Runtime/generic/RTEnvDupEx-generic.cpp
@@ -25,9 +25,9 @@
*/
-/*******************************************************************************
-* Header Files *
-*******************************************************************************/
+/*********************************************************************************************************************************
+* Header Files *
+*********************************************************************************************************************************/
#include <iprt/env.h>
#include "internal/iprt.h"
diff --git a/src/VBox/Runtime/generic/RTFileCopy-generic.cpp b/src/VBox/Runtime/generic/RTFileCopy-generic.cpp
index e8fa971..90a7546 100644
--- a/src/VBox/Runtime/generic/RTFileCopy-generic.cpp
+++ b/src/VBox/Runtime/generic/RTFileCopy-generic.cpp
@@ -25,9 +25,9 @@
*/
-/*******************************************************************************
-* Header Files *
-*******************************************************************************/
+/*********************************************************************************************************************************
+* Header Files *
+*********************************************************************************************************************************/
#include <iprt/file.h>
#include "internal/iprt.h"
diff --git a/src/VBox/Runtime/generic/RTFileExists-generic.cpp b/src/VBox/Runtime/generic/RTFileExists-generic.cpp
index 2574107..b99c85a 100644
--- a/src/VBox/Runtime/generic/RTFileExists-generic.cpp
+++ b/src/VBox/Runtime/generic/RTFileExists-generic.cpp
@@ -25,9 +25,9 @@
*/
-/*******************************************************************************
-* Header Files *
-*******************************************************************************/
+/*********************************************************************************************************************************
+* Header Files *
+*********************************************************************************************************************************/
#define LOG_GROUP RTLOGGROUP_FILE
#include "internal/iprt.h"
diff --git a/src/VBox/Runtime/generic/RTFileMove-generic.cpp b/src/VBox/Runtime/generic/RTFileMove-generic.cpp
index ca78f27..0d16397 100644
--- a/src/VBox/Runtime/generic/RTFileMove-generic.cpp
+++ b/src/VBox/Runtime/generic/RTFileMove-generic.cpp
@@ -25,9 +25,9 @@
*/
-/*******************************************************************************
-* Header Files *
-*******************************************************************************/
+/*********************************************************************************************************************************
+* Header Files *
+*********************************************************************************************************************************/
#define LOG_GROUP RTLOGGROUP_FILE
#include <iprt/file.h>
#include "internal/iprt.h"
diff --git a/src/VBox/Runtime/generic/RTFileQuerySize-generic.cpp b/src/VBox/Runtime/generic/RTFileQuerySize-generic.cpp
index edfb974..d283b51 100644
--- a/src/VBox/Runtime/generic/RTFileQuerySize-generic.cpp
+++ b/src/VBox/Runtime/generic/RTFileQuerySize-generic.cpp
@@ -25,9 +25,9 @@
*/
-/*******************************************************************************
-* Header Files *
-*******************************************************************************/
+/*********************************************************************************************************************************
+* Header Files *
+*********************************************************************************************************************************/
#define LOG_GROUP RTLOGGROUP_FILE
#include "internal/iprt.h"
diff --git a/src/VBox/Runtime/generic/RTFileReadAll-generic.cpp b/src/VBox/Runtime/generic/RTFileReadAll-generic.cpp
index 713da96..502eb54 100644
--- a/src/VBox/Runtime/generic/RTFileReadAll-generic.cpp
+++ b/src/VBox/Runtime/generic/RTFileReadAll-generic.cpp
@@ -25,9 +25,9 @@
*/
-/*******************************************************************************
-* Header Files *
-*******************************************************************************/
+/*********************************************************************************************************************************
+* Header Files *
+*********************************************************************************************************************************/
#include <iprt/file.h>
#include "internal/iprt.h"
diff --git a/src/VBox/Runtime/generic/RTFileReadAllByHandle-generic.cpp b/src/VBox/Runtime/generic/RTFileReadAllByHandle-generic.cpp
index f9a3574..3a7d0df 100644
--- a/src/VBox/Runtime/generic/RTFileReadAllByHandle-generic.cpp
+++ b/src/VBox/Runtime/generic/RTFileReadAllByHandle-generic.cpp
@@ -25,9 +25,9 @@
*/
-/*******************************************************************************
-* Header Files *
-*******************************************************************************/
+/*********************************************************************************************************************************
+* Header Files *
+*********************************************************************************************************************************/
#include <iprt/file.h>
#include "internal/iprt.h"
diff --git a/src/VBox/Runtime/generic/RTFileReadAllByHandleEx-generic.cpp b/src/VBox/Runtime/generic/RTFileReadAllByHandleEx-generic.cpp
index 64289ac..75922a0 100644
--- a/src/VBox/Runtime/generic/RTFileReadAllByHandleEx-generic.cpp
+++ b/src/VBox/Runtime/generic/RTFileReadAllByHandleEx-generic.cpp
@@ -25,9 +25,9 @@
*/
-/*******************************************************************************
-* Header Files *
-*******************************************************************************/
+/*********************************************************************************************************************************
+* Header Files *
+*********************************************************************************************************************************/
#include <iprt/file.h>
#include "internal/iprt.h"
diff --git a/src/VBox/Runtime/generic/RTFileReadAllEx-generic.cpp b/src/VBox/Runtime/generic/RTFileReadAllEx-generic.cpp
index f42369e..4931e19 100644
--- a/src/VBox/Runtime/generic/RTFileReadAllEx-generic.cpp
+++ b/src/VBox/Runtime/generic/RTFileReadAllEx-generic.cpp
@@ -25,9 +25,9 @@
*/
-/*******************************************************************************
-* Header Files *
-*******************************************************************************/
+/*********************************************************************************************************************************
+* Header Files *
+*********************************************************************************************************************************/
#include <iprt/file.h>
#include "internal/iprt.h"
diff --git a/src/VBox/Runtime/generic/RTFileReadAllFree-generic.cpp b/src/VBox/Runtime/generic/RTFileReadAllFree-generic.cpp
index dddc300..d0e1f2c 100644
--- a/src/VBox/Runtime/generic/RTFileReadAllFree-generic.cpp
+++ b/src/VBox/Runtime/generic/RTFileReadAllFree-generic.cpp
@@ -25,9 +25,9 @@
*/
-/*******************************************************************************
-* Header Files *
-*******************************************************************************/
+/*********************************************************************************************************************************
+* Header Files *
+*********************************************************************************************************************************/
#include <iprt/file.h>
#include "internal/iprt.h"
diff --git a/src/VBox/Runtime/generic/RTLogDefaultInit-generic.cpp b/src/VBox/Runtime/generic/RTLogDefaultInit-generic.cpp
index e4fb534..a17f047 100644
--- a/src/VBox/Runtime/generic/RTLogDefaultInit-generic.cpp
+++ b/src/VBox/Runtime/generic/RTLogDefaultInit-generic.cpp
@@ -25,9 +25,9 @@
*/
-/*******************************************************************************
-* Header Files *
-*******************************************************************************/
+/*********************************************************************************************************************************
+* Header Files *
+*********************************************************************************************************************************/
#include <iprt/log.h>
diff --git a/src/VBox/Runtime/generic/RTLogWriteDebugger-generic.cpp b/src/VBox/Runtime/generic/RTLogWriteDebugger-generic.cpp
index ce48e90..3567d8e 100644
--- a/src/VBox/Runtime/generic/RTLogWriteDebugger-generic.cpp
+++ b/src/VBox/Runtime/generic/RTLogWriteDebugger-generic.cpp
@@ -25,9 +25,9 @@
*/
-/*******************************************************************************
-* Header Files *
-*******************************************************************************/
+/*********************************************************************************************************************************
+* Header Files *
+*********************************************************************************************************************************/
#include <iprt/log.h>
#include "internal/iprt.h"
diff --git a/src/VBox/Runtime/generic/RTLogWriteStdErr-generic.cpp b/src/VBox/Runtime/generic/RTLogWriteStdErr-generic.cpp
index 6460db7..66f5afc 100644
--- a/src/VBox/Runtime/generic/RTLogWriteStdErr-generic.cpp
+++ b/src/VBox/Runtime/generic/RTLogWriteStdErr-generic.cpp
@@ -25,9 +25,9 @@
*/
-/*******************************************************************************
-* Header Files *
-*******************************************************************************/
+/*********************************************************************************************************************************
+* Header Files *
+*********************************************************************************************************************************/
#include <iprt/log.h>
#include "internal/iprt.h"
#include <stdio.h>
diff --git a/src/VBox/Runtime/generic/RTLogWriteStdErr-stub-generic.cpp b/src/VBox/Runtime/generic/RTLogWriteStdErr-stub-generic.cpp
index 969307f..c9040e2 100644
--- a/src/VBox/Runtime/generic/RTLogWriteStdErr-stub-generic.cpp
+++ b/src/VBox/Runtime/generic/RTLogWriteStdErr-stub-generic.cpp
@@ -25,9 +25,9 @@
*/
-/*******************************************************************************
-* Header Files *
-*******************************************************************************/
+/*********************************************************************************************************************************
+* Header Files *
+*********************************************************************************************************************************/
#include <iprt/log.h>
#include "internal/iprt.h"
diff --git a/src/VBox/Runtime/generic/RTLogWriteStdOut-generic.cpp b/src/VBox/Runtime/generic/RTLogWriteStdOut-generic.cpp
index d7a2925..cb2acbe 100644
--- a/src/VBox/Runtime/generic/RTLogWriteStdOut-generic.cpp
+++ b/src/VBox/Runtime/generic/RTLogWriteStdOut-generic.cpp
@@ -25,9 +25,9 @@
*/
-/*******************************************************************************
-* Header Files *
-*******************************************************************************/
+/*********************************************************************************************************************************
+* Header Files *
+*********************************************************************************************************************************/
#include <iprt/log.h>
#include "internal/iprt.h"
#include <stdio.h>
diff --git a/src/VBox/Runtime/generic/RTLogWriteStdOut-stub-generic.cpp b/src/VBox/Runtime/generic/RTLogWriteStdOut-stub-generic.cpp
index c195d5a..92406c7 100644
--- a/src/VBox/Runtime/generic/RTLogWriteStdOut-stub-generic.cpp
+++ b/src/VBox/Runtime/generic/RTLogWriteStdOut-stub-generic.cpp
@@ -25,9 +25,9 @@
*/
-/*******************************************************************************
-* Header Files *
-*******************************************************************************/
+/*********************************************************************************************************************************
+* Header Files *
+*********************************************************************************************************************************/
#include <iprt/log.h>
#include "internal/iprt.h"
diff --git a/src/VBox/Runtime/generic/RTLogWriteUser-generic.cpp b/src/VBox/Runtime/generic/RTLogWriteUser-generic.cpp
index dfbbb37..22c8a5a 100644
--- a/src/VBox/Runtime/generic/RTLogWriteUser-generic.cpp
+++ b/src/VBox/Runtime/generic/RTLogWriteUser-generic.cpp
@@ -25,9 +25,9 @@
*/
-/*******************************************************************************
-* Header Files *
-*******************************************************************************/
+/*********************************************************************************************************************************
+* Header Files *
+*********************************************************************************************************************************/
#include <iprt/log.h>
#include "internal/iprt.h"
diff --git a/src/VBox/Runtime/generic/RTMpCpuId-generic.cpp b/src/VBox/Runtime/generic/RTMpCpuId-generic.cpp
index a03608a..a464d46 100644
--- a/src/VBox/Runtime/generic/RTMpCpuId-generic.cpp
+++ b/src/VBox/Runtime/generic/RTMpCpuId-generic.cpp
@@ -25,9 +25,9 @@
*/
-/*******************************************************************************
-* Header Files *
-*******************************************************************************/
+/*********************************************************************************************************************************
+* Header Files *
+*********************************************************************************************************************************/
#include <iprt/mp.h>
#include "internal/iprt.h"
diff --git a/src/VBox/Runtime/generic/RTMpCpuIdFromSetIndex-generic.cpp b/src/VBox/Runtime/generic/RTMpCpuIdFromSetIndex-generic.cpp
index 20d9985..597418f 100644
--- a/src/VBox/Runtime/generic/RTMpCpuIdFromSetIndex-generic.cpp
+++ b/src/VBox/Runtime/generic/RTMpCpuIdFromSetIndex-generic.cpp
@@ -25,9 +25,9 @@
*/
-/*******************************************************************************
-* Header Files *
-*******************************************************************************/
+/*********************************************************************************************************************************
+* Header Files *
+*********************************************************************************************************************************/
#include <iprt/mp.h>
#include "internal/iprt.h"
diff --git a/src/VBox/Runtime/generic/RTMpCpuIdToSetIndex-generic.cpp b/src/VBox/Runtime/generic/RTMpCpuIdToSetIndex-generic.cpp
index 5f17374..bf71c86 100644
--- a/src/VBox/Runtime/generic/RTMpCpuIdToSetIndex-generic.cpp
+++ b/src/VBox/Runtime/generic/RTMpCpuIdToSetIndex-generic.cpp
@@ -25,9 +25,9 @@
*/
-/*******************************************************************************
-* Header Files *
-*******************************************************************************/
+/*********************************************************************************************************************************
+* Header Files *
+*********************************************************************************************************************************/
#include <iprt/mp.h>
#include "internal/iprt.h"
diff --git a/src/VBox/Runtime/generic/RTMpGetArraySize-generic.cpp b/src/VBox/Runtime/generic/RTMpGetArraySize-generic.cpp
index 5c83acd..6bd0787 100644
--- a/src/VBox/Runtime/generic/RTMpGetArraySize-generic.cpp
+++ b/src/VBox/Runtime/generic/RTMpGetArraySize-generic.cpp
@@ -25,9 +25,9 @@
*/
-/*******************************************************************************
-* Header Files *
-*******************************************************************************/
+/*********************************************************************************************************************************
+* Header Files *
+*********************************************************************************************************************************/
#include <iprt/mp.h>
#include "internal/iprt.h"
diff --git a/src/VBox/Runtime/generic/RTMpGetCoreCount-generic.cpp b/src/VBox/Runtime/generic/RTMpGetCoreCount-generic.cpp
index 76fc90f..8ead6e8 100644
--- a/src/VBox/Runtime/generic/RTMpGetCoreCount-generic.cpp
+++ b/src/VBox/Runtime/generic/RTMpGetCoreCount-generic.cpp
@@ -25,9 +25,9 @@
*/
-/*******************************************************************************
-* Header Files *
-*******************************************************************************/
+/*********************************************************************************************************************************
+* Header Files *
+*********************************************************************************************************************************/
#include <iprt/mp.h>
#include "internal/iprt.h"
diff --git a/src/VBox/Runtime/generic/RTMpGetCount-generic.cpp b/src/VBox/Runtime/generic/RTMpGetCount-generic.cpp
index 3056192..06f3ff5 100644
--- a/src/VBox/Runtime/generic/RTMpGetCount-generic.cpp
+++ b/src/VBox/Runtime/generic/RTMpGetCount-generic.cpp
@@ -25,9 +25,9 @@
*/
-/*******************************************************************************
-* Header Files *
-*******************************************************************************/
+/*********************************************************************************************************************************
+* Header Files *
+*********************************************************************************************************************************/
#include <iprt/mp.h>
#include "internal/iprt.h"
diff --git a/src/VBox/Runtime/generic/RTMpGetCurFrequency-generic.cpp b/src/VBox/Runtime/generic/RTMpGetCurFrequency-generic.cpp
index e61e28c..1f2654f 100644
--- a/src/VBox/Runtime/generic/RTMpGetCurFrequency-generic.cpp
+++ b/src/VBox/Runtime/generic/RTMpGetCurFrequency-generic.cpp
@@ -25,9 +25,9 @@
*/
-/*******************************************************************************
-* Header Files *
-*******************************************************************************/
+/*********************************************************************************************************************************
+* Header Files *
+*********************************************************************************************************************************/
#include <iprt/mp.h>
#include "internal/iprt.h"
diff --git a/src/VBox/Runtime/generic/RTMpGetDescription-generic-stub.cpp b/src/VBox/Runtime/generic/RTMpGetDescription-generic-stub.cpp
index 5313072..1e0f1ee 100644
--- a/src/VBox/Runtime/generic/RTMpGetDescription-generic-stub.cpp
+++ b/src/VBox/Runtime/generic/RTMpGetDescription-generic-stub.cpp
@@ -25,9 +25,9 @@
*/
-/*******************************************************************************
-* Header Files *
-*******************************************************************************/
+/*********************************************************************************************************************************
+* Header Files *
+*********************************************************************************************************************************/
#include <iprt/mp.h>
#include "internal/iprt.h"
#include <iprt/string.h>
diff --git a/src/VBox/Runtime/generic/RTMpGetDescription-generic.cpp b/src/VBox/Runtime/generic/RTMpGetDescription-generic.cpp
index b7568e1..e0823fa 100644
--- a/src/VBox/Runtime/generic/RTMpGetDescription-generic.cpp
+++ b/src/VBox/Runtime/generic/RTMpGetDescription-generic.cpp
@@ -25,9 +25,9 @@
*/
-/*******************************************************************************
-* Header Files *
-*******************************************************************************/
+/*********************************************************************************************************************************
+* Header Files *
+*********************************************************************************************************************************/
#include <iprt/mp.h>
#include "internal/iprt.h"
#if defined(RT_ARCH_AMD64) || defined(RT_ARCH_X86)
diff --git a/src/VBox/Runtime/generic/RTMpGetMaxCpuId-generic.cpp b/src/VBox/Runtime/generic/RTMpGetMaxCpuId-generic.cpp
index 8041366..03bfb29 100644
--- a/src/VBox/Runtime/generic/RTMpGetMaxCpuId-generic.cpp
+++ b/src/VBox/Runtime/generic/RTMpGetMaxCpuId-generic.cpp
@@ -25,9 +25,9 @@
*/
-/*******************************************************************************
-* Header Files *
-*******************************************************************************/
+/*********************************************************************************************************************************
+* Header Files *
+*********************************************************************************************************************************/
#include <iprt/mp.h>
#include "internal/iprt.h"
diff --git a/src/VBox/Runtime/generic/RTMpGetMaxFrequency-generic.cpp b/src/VBox/Runtime/generic/RTMpGetMaxFrequency-generic.cpp
index 449cd94..0b75b85 100644
--- a/src/VBox/Runtime/generic/RTMpGetMaxFrequency-generic.cpp
+++ b/src/VBox/Runtime/generic/RTMpGetMaxFrequency-generic.cpp
@@ -25,9 +25,9 @@
*/
-/*******************************************************************************
-* Header Files *
-*******************************************************************************/
+/*********************************************************************************************************************************
+* Header Files *
+*********************************************************************************************************************************/
#include <iprt/mp.h>
#include "internal/iprt.h"
diff --git a/src/VBox/Runtime/generic/RTMpGetOnlineCoreCount-generic.cpp b/src/VBox/Runtime/generic/RTMpGetOnlineCoreCount-generic.cpp
index fe5064b..4370c70 100644
--- a/src/VBox/Runtime/generic/RTMpGetOnlineCoreCount-generic.cpp
+++ b/src/VBox/Runtime/generic/RTMpGetOnlineCoreCount-generic.cpp
@@ -25,9 +25,9 @@
*/
-/*******************************************************************************
-* Header Files *
-*******************************************************************************/
+/*********************************************************************************************************************************
+* Header Files *
+*********************************************************************************************************************************/
#include <iprt/mp.h>
#include "internal/iprt.h"
diff --git a/src/VBox/Runtime/generic/RTMpGetOnlineCount-generic.cpp b/src/VBox/Runtime/generic/RTMpGetOnlineCount-generic.cpp
index 97140c4..4f2b88a 100644
--- a/src/VBox/Runtime/generic/RTMpGetOnlineCount-generic.cpp
+++ b/src/VBox/Runtime/generic/RTMpGetOnlineCount-generic.cpp
@@ -25,9 +25,9 @@
*/
-/*******************************************************************************
-* Header Files *
-*******************************************************************************/
+/*********************************************************************************************************************************
+* Header Files *
+*********************************************************************************************************************************/
#include <iprt/mp.h>
#include "internal/iprt.h"
diff --git a/src/VBox/Runtime/generic/RTMpGetOnlineSet-generic.cpp b/src/VBox/Runtime/generic/RTMpGetOnlineSet-generic.cpp
index a1f585e..cf3017e 100644
--- a/src/VBox/Runtime/generic/RTMpGetOnlineSet-generic.cpp
+++ b/src/VBox/Runtime/generic/RTMpGetOnlineSet-generic.cpp
@@ -25,9 +25,9 @@
*/
-/*******************************************************************************
-* Header Files *
-*******************************************************************************/
+/*********************************************************************************************************************************
+* Header Files *
+*********************************************************************************************************************************/
#include <iprt/mp.h>
#include "internal/iprt.h"
diff --git a/src/VBox/Runtime/generic/RTMpGetSet-generic.cpp b/src/VBox/Runtime/generic/RTMpGetSet-generic.cpp
index 123b407..56b6690 100644
--- a/src/VBox/Runtime/generic/RTMpGetSet-generic.cpp
+++ b/src/VBox/Runtime/generic/RTMpGetSet-generic.cpp
@@ -25,9 +25,9 @@
*/
-/*******************************************************************************
-* Header Files *
-*******************************************************************************/
+/*********************************************************************************************************************************
+* Header Files *
+*********************************************************************************************************************************/
#include <iprt/mp.h>
#include "internal/iprt.h"
diff --git a/src/VBox/Runtime/generic/RTMpIsCpuOnline-generic.cpp b/src/VBox/Runtime/generic/RTMpIsCpuOnline-generic.cpp
index 9f181a0..24e7743 100644
--- a/src/VBox/Runtime/generic/RTMpIsCpuOnline-generic.cpp
+++ b/src/VBox/Runtime/generic/RTMpIsCpuOnline-generic.cpp
@@ -25,9 +25,9 @@
*/
-/*******************************************************************************
-* Header Files *
-*******************************************************************************/
+/*********************************************************************************************************************************
+* Header Files *
+*********************************************************************************************************************************/
#include <iprt/mp.h>
#include "internal/iprt.h"
diff --git a/src/VBox/Runtime/generic/RTMpIsCpuPossible-generic.cpp b/src/VBox/Runtime/generic/RTMpIsCpuPossible-generic.cpp
index 9f0c8fd..77436ad 100644
--- a/src/VBox/Runtime/generic/RTMpIsCpuPossible-generic.cpp
+++ b/src/VBox/Runtime/generic/RTMpIsCpuPossible-generic.cpp
@@ -25,9 +25,9 @@
*/
-/*******************************************************************************
-* Header Files *
-*******************************************************************************/
+/*********************************************************************************************************************************
+* Header Files *
+*********************************************************************************************************************************/
#include <iprt/mp.h>
#include "internal/iprt.h"
diff --git a/src/VBox/Runtime/generic/RTMpOnPair-generic.cpp b/src/VBox/Runtime/generic/RTMpOnPair-generic.cpp
index c948e34..d507fc3 100644
--- a/src/VBox/Runtime/generic/RTMpOnPair-generic.cpp
+++ b/src/VBox/Runtime/generic/RTMpOnPair-generic.cpp
@@ -25,9 +25,9 @@
*/
-/*******************************************************************************
-* Header Files *
-*******************************************************************************/
+/*********************************************************************************************************************************
+* Header Files *
+*********************************************************************************************************************************/
#include "internal/iprt.h"
#include <iprt/mp.h>
@@ -36,9 +36,9 @@
#include <iprt/err.h>
-/*******************************************************************************
-* Structures and Typedefs *
-*******************************************************************************/
+/*********************************************************************************************************************************
+* Structures and Typedefs *
+*********************************************************************************************************************************/
/**
* Argument package for the generic RTMpOnPair implemenetation.
*/
diff --git a/src/VBox/Runtime/generic/RTPathAbs-generic.cpp b/src/VBox/Runtime/generic/RTPathAbs-generic.cpp
index e4f8219..9a921ae 100644
--- a/src/VBox/Runtime/generic/RTPathAbs-generic.cpp
+++ b/src/VBox/Runtime/generic/RTPathAbs-generic.cpp
@@ -25,9 +25,9 @@
*/
-/*******************************************************************************
-* Header Files *
-*******************************************************************************/
+/*********************************************************************************************************************************
+* Header Files *
+*********************************************************************************************************************************/
#define LOG_GROUP RTLOGGROUP_PATH
#include <iprt/path.h>
diff --git a/src/VBox/Runtime/generic/RTPathGetCurrentDrive-generic.cpp b/src/VBox/Runtime/generic/RTPathGetCurrentDrive-generic.cpp
index 98ebe8b..0016a73 100644
--- a/src/VBox/Runtime/generic/RTPathGetCurrentDrive-generic.cpp
+++ b/src/VBox/Runtime/generic/RTPathGetCurrentDrive-generic.cpp
@@ -25,9 +25,9 @@
*/
-/*******************************************************************************
-* Header Files *
-*******************************************************************************/
+/*********************************************************************************************************************************
+* Header Files *
+*********************************************************************************************************************************/
#define LOG_GROUP RTLOGGROUP_PATH
#include <iprt/path.h>
#include "internal/iprt.h"
diff --git a/src/VBox/Runtime/generic/RTPathGetCurrentOnDrive-generic.cpp b/src/VBox/Runtime/generic/RTPathGetCurrentOnDrive-generic.cpp
index a26b0bf..fd7d21e 100644
--- a/src/VBox/Runtime/generic/RTPathGetCurrentOnDrive-generic.cpp
+++ b/src/VBox/Runtime/generic/RTPathGetCurrentOnDrive-generic.cpp
@@ -25,9 +25,9 @@
*/
-/*******************************************************************************
-* Header Files *
-*******************************************************************************/
+/*********************************************************************************************************************************
+* Header Files *
+*********************************************************************************************************************************/
#define LOG_GROUP RTLOGGROUP_PATH
#include <iprt/path.h>
#include "internal/iprt.h"
diff --git a/src/VBox/Runtime/generic/RTPathIsSame-generic.cpp b/src/VBox/Runtime/generic/RTPathIsSame-generic.cpp
index b8d7dd8..a4e514f 100644
--- a/src/VBox/Runtime/generic/RTPathIsSame-generic.cpp
+++ b/src/VBox/Runtime/generic/RTPathIsSame-generic.cpp
@@ -25,9 +25,9 @@
*/
-/*******************************************************************************
-* Header Files *
-*******************************************************************************/
+/*********************************************************************************************************************************
+* Header Files *
+*********************************************************************************************************************************/
#include <iprt/path.h>
#include "internal/iprt.h"
diff --git a/src/VBox/Runtime/generic/RTProcDaemonize-generic.cpp b/src/VBox/Runtime/generic/RTProcDaemonize-generic.cpp
index 1eef917..78b391d 100644
--- a/src/VBox/Runtime/generic/RTProcDaemonize-generic.cpp
+++ b/src/VBox/Runtime/generic/RTProcDaemonize-generic.cpp
@@ -25,9 +25,9 @@
*/
-/*******************************************************************************
-* Header Files *
-*******************************************************************************/
+/*********************************************************************************************************************************
+* Header Files *
+*********************************************************************************************************************************/
#define LOG_GROUP RTLOGGROUP_PROCESS
#include <iprt/process.h>
#include "internal/iprt.h"
diff --git a/src/VBox/Runtime/generic/RTProcIsRunningByName-generic.cpp b/src/VBox/Runtime/generic/RTProcIsRunningByName-generic.cpp
index cc1899a..47b9b65 100644
--- a/src/VBox/Runtime/generic/RTProcIsRunningByName-generic.cpp
+++ b/src/VBox/Runtime/generic/RTProcIsRunningByName-generic.cpp
@@ -25,9 +25,9 @@
*/
-/*******************************************************************************
-* Header Files *
-*******************************************************************************/
+/*********************************************************************************************************************************
+* Header Files *
+*********************************************************************************************************************************/
#include <iprt/process.h>
#include "internal/iprt.h"
diff --git a/src/VBox/Runtime/generic/RTProcessQueryUsernameA-generic.cpp b/src/VBox/Runtime/generic/RTProcessQueryUsernameA-generic.cpp
index f79547f..1c3903a 100644
--- a/src/VBox/Runtime/generic/RTProcessQueryUsernameA-generic.cpp
+++ b/src/VBox/Runtime/generic/RTProcessQueryUsernameA-generic.cpp
@@ -25,9 +25,9 @@
*/
-/*******************************************************************************
-* Header Files *
-*******************************************************************************/
+/*********************************************************************************************************************************
+* Header Files *
+*********************************************************************************************************************************/
#include <iprt/system.h>
#include "internal/iprt.h"
diff --git a/src/VBox/Runtime/generic/RTRandAdvCreateSystemFaster-generic.cpp b/src/VBox/Runtime/generic/RTRandAdvCreateSystemFaster-generic.cpp
index a7168c6..0813ef2 100644
--- a/src/VBox/Runtime/generic/RTRandAdvCreateSystemFaster-generic.cpp
+++ b/src/VBox/Runtime/generic/RTRandAdvCreateSystemFaster-generic.cpp
@@ -25,16 +25,16 @@
*/
-/*******************************************************************************
-* Header Files *
-*******************************************************************************/
+/*********************************************************************************************************************************
+* Header Files *
+*********************************************************************************************************************************/
#include <iprt/rand.h>
#include "internal/iprt.h"
#include <iprt/err.h>
-RTDECL(int) RTRandAdvCreateSystemFaster(PRTRAND phRand) RT_NO_THROW
+RTDECL(int) RTRandAdvCreateSystemFaster(PRTRAND phRand) RT_NO_THROW_DEF
{
NOREF(phRand);
return VERR_NOT_SUPPORTED;
diff --git a/src/VBox/Runtime/generic/RTRandAdvCreateSystemTruer-generic.cpp b/src/VBox/Runtime/generic/RTRandAdvCreateSystemTruer-generic.cpp
index 67ec96e..4110fd3 100644
--- a/src/VBox/Runtime/generic/RTRandAdvCreateSystemTruer-generic.cpp
+++ b/src/VBox/Runtime/generic/RTRandAdvCreateSystemTruer-generic.cpp
@@ -25,16 +25,16 @@
*/
-/*******************************************************************************
-* Header Files *
-*******************************************************************************/
+/*********************************************************************************************************************************
+* Header Files *
+*********************************************************************************************************************************/
#include <iprt/rand.h>
#include "internal/iprt.h"
#include <iprt/err.h>
-RTDECL(int) RTRandAdvCreateSystemTruer(PRTRAND phRand) RT_NO_THROW
+RTDECL(int) RTRandAdvCreateSystemTruer(PRTRAND phRand) RT_NO_THROW_DEF
{
NOREF(phRand);
return VERR_NOT_SUPPORTED;
diff --git a/src/VBox/Runtime/generic/RTSemEventMultiWait-2-ex-generic.cpp b/src/VBox/Runtime/generic/RTSemEventMultiWait-2-ex-generic.cpp
index 731a9ca..bfeb1af 100644
--- a/src/VBox/Runtime/generic/RTSemEventMultiWait-2-ex-generic.cpp
+++ b/src/VBox/Runtime/generic/RTSemEventMultiWait-2-ex-generic.cpp
@@ -25,9 +25,9 @@
*/
-/*******************************************************************************
-* Header Files *
-*******************************************************************************/
+/*********************************************************************************************************************************
+* Header Files *
+*********************************************************************************************************************************/
#define LOG_GROUP RTLOGGROUP_SEM
#define RTSEMEVENTMULTI_WITHOUT_REMAPPING
#include <iprt/semaphore.h>
diff --git a/src/VBox/Runtime/generic/RTSemEventMultiWait-generic.cpp b/src/VBox/Runtime/generic/RTSemEventMultiWait-generic.cpp
index 9f6d82c..af1cd27 100644
--- a/src/VBox/Runtime/generic/RTSemEventMultiWait-generic.cpp
+++ b/src/VBox/Runtime/generic/RTSemEventMultiWait-generic.cpp
@@ -25,9 +25,9 @@
*/
-/*******************************************************************************
-* Header Files *
-*******************************************************************************/
+/*********************************************************************************************************************************
+* Header Files *
+*********************************************************************************************************************************/
#define LOG_GROUP RTLOGGROUP_SEM
#define RTSEMEVENTMULTI_WITHOUT_REMAPPING
#include <iprt/semaphore.h>
diff --git a/src/VBox/Runtime/generic/RTSemEventMultiWaitNoResume-2-ex-generic.cpp b/src/VBox/Runtime/generic/RTSemEventMultiWaitNoResume-2-ex-generic.cpp
index 0bcf973..2c0dcc4 100644
--- a/src/VBox/Runtime/generic/RTSemEventMultiWaitNoResume-2-ex-generic.cpp
+++ b/src/VBox/Runtime/generic/RTSemEventMultiWaitNoResume-2-ex-generic.cpp
@@ -26,9 +26,9 @@
*/
-/*******************************************************************************
-* Header Files *
-*******************************************************************************/
+/*********************************************************************************************************************************
+* Header Files *
+*********************************************************************************************************************************/
#define LOG_GROUP RTLOGGROUP_SEM
#define RTSEMEVENTMULTI_WITHOUT_REMAPPING
#include <iprt/semaphore.h>
diff --git a/src/VBox/Runtime/generic/RTSemEventWait-2-ex-generic.cpp b/src/VBox/Runtime/generic/RTSemEventWait-2-ex-generic.cpp
index 6450034..a196c21 100644
--- a/src/VBox/Runtime/generic/RTSemEventWait-2-ex-generic.cpp
+++ b/src/VBox/Runtime/generic/RTSemEventWait-2-ex-generic.cpp
@@ -25,9 +25,9 @@
*/
-/*******************************************************************************
-* Header Files *
-*******************************************************************************/
+/*********************************************************************************************************************************
+* Header Files *
+*********************************************************************************************************************************/
#define LOG_GROUP RTLOGGROUP_SEM
#define RTSEMEVENT_WITHOUT_REMAPPING
#include <iprt/semaphore.h>
diff --git a/src/VBox/Runtime/generic/RTSemEventWait-generic.cpp b/src/VBox/Runtime/generic/RTSemEventWait-generic.cpp
index 380d29d..6de259f 100644
--- a/src/VBox/Runtime/generic/RTSemEventWait-generic.cpp
+++ b/src/VBox/Runtime/generic/RTSemEventWait-generic.cpp
@@ -25,9 +25,9 @@
*/
-/*******************************************************************************
-* Header Files *
-*******************************************************************************/
+/*********************************************************************************************************************************
+* Header Files *
+*********************************************************************************************************************************/
#define LOG_GROUP RTLOGGROUP_SEM
#define RTSEMEVENT_WITHOUT_REMAPPING
#include <iprt/semaphore.h>
diff --git a/src/VBox/Runtime/generic/RTSemEventWaitNoResume-2-ex-generic.cpp b/src/VBox/Runtime/generic/RTSemEventWaitNoResume-2-ex-generic.cpp
index 703e782..804e83c 100644
--- a/src/VBox/Runtime/generic/RTSemEventWaitNoResume-2-ex-generic.cpp
+++ b/src/VBox/Runtime/generic/RTSemEventWaitNoResume-2-ex-generic.cpp
@@ -26,9 +26,9 @@
*/
-/*******************************************************************************
-* Header Files *
-*******************************************************************************/
+/*********************************************************************************************************************************
+* Header Files *
+*********************************************************************************************************************************/
#define LOG_GROUP RTLOGGROUP_SEM
#define RTSEMEVENT_WITHOUT_REMAPPING
#include <iprt/semaphore.h>
diff --git a/src/VBox/Runtime/generic/RTSemMutexRequest-generic.cpp b/src/VBox/Runtime/generic/RTSemMutexRequest-generic.cpp
index 2d4f91b..46873ee 100644
--- a/src/VBox/Runtime/generic/RTSemMutexRequest-generic.cpp
+++ b/src/VBox/Runtime/generic/RTSemMutexRequest-generic.cpp
@@ -25,9 +25,9 @@
*/
-/*******************************************************************************
-* Header Files *
-*******************************************************************************/
+/*********************************************************************************************************************************
+* Header Files *
+*********************************************************************************************************************************/
#define RTSEMMUTEX_WITHOUT_REMAPPING
#define LOG_GROUP RTLOGGROUP_SEM
#include <iprt/semaphore.h>
diff --git a/src/VBox/Runtime/generic/RTSemMutexRequestDebug-generic.cpp b/src/VBox/Runtime/generic/RTSemMutexRequestDebug-generic.cpp
index 1b895a9..886ab63 100644
--- a/src/VBox/Runtime/generic/RTSemMutexRequestDebug-generic.cpp
+++ b/src/VBox/Runtime/generic/RTSemMutexRequestDebug-generic.cpp
@@ -25,9 +25,9 @@
*/
-/*******************************************************************************
-* Header Files *
-*******************************************************************************/
+/*********************************************************************************************************************************
+* Header Files *
+*********************************************************************************************************************************/
#define LOG_GROUP RTLOGGROUP_SEM
#include <iprt/semaphore.h>
#include "internal/iprt.h"
diff --git a/src/VBox/Runtime/generic/RTSystemQueryDmiString-generic.cpp b/src/VBox/Runtime/generic/RTSystemQueryDmiString-generic.cpp
index ec169d8..48c440f 100644
--- a/src/VBox/Runtime/generic/RTSystemQueryDmiString-generic.cpp
+++ b/src/VBox/Runtime/generic/RTSystemQueryDmiString-generic.cpp
@@ -25,9 +25,9 @@
*/
-/*******************************************************************************
-* Header Files *
-*******************************************************************************/
+/*********************************************************************************************************************************
+* Header Files *
+*********************************************************************************************************************************/
#include <iprt/system.h>
#include "internal/iprt.h"
diff --git a/src/VBox/Runtime/generic/RTSystemQueryOSInfo-generic.cpp b/src/VBox/Runtime/generic/RTSystemQueryOSInfo-generic.cpp
index 05316be..5fcd0de 100644
--- a/src/VBox/Runtime/generic/RTSystemQueryOSInfo-generic.cpp
+++ b/src/VBox/Runtime/generic/RTSystemQueryOSInfo-generic.cpp
@@ -25,9 +25,9 @@
*/
-/*******************************************************************************
-* Header Files *
-*******************************************************************************/
+/*********************************************************************************************************************************
+* Header Files *
+*********************************************************************************************************************************/
#include <iprt/system.h>
#include "internal/iprt.h"
diff --git a/src/VBox/Runtime/generic/RTSystemShutdown-generic.cpp b/src/VBox/Runtime/generic/RTSystemShutdown-generic.cpp
index ad81204..f91fbf2 100644
--- a/src/VBox/Runtime/generic/RTSystemShutdown-generic.cpp
+++ b/src/VBox/Runtime/generic/RTSystemShutdown-generic.cpp
@@ -25,9 +25,9 @@
*/
-/*******************************************************************************
-* Header Files *
-*******************************************************************************/
+/*********************************************************************************************************************************
+* Header Files *
+*********************************************************************************************************************************/
#include <iprt/system.h>
#include "internal/iprt.h"
diff --git a/src/VBox/Runtime/generic/RTThreadGetAffinity-stub-generic.cpp b/src/VBox/Runtime/generic/RTThreadGetAffinity-stub-generic.cpp
index 3f08503..5db4d37 100644
--- a/src/VBox/Runtime/generic/RTThreadGetAffinity-stub-generic.cpp
+++ b/src/VBox/Runtime/generic/RTThreadGetAffinity-stub-generic.cpp
@@ -25,9 +25,9 @@
*/
-/*******************************************************************************
-* Header Files *
-*******************************************************************************/
+/*********************************************************************************************************************************
+* Header Files *
+*********************************************************************************************************************************/
#include <iprt/thread.h>
#include "internal/iprt.h"
diff --git a/src/VBox/Runtime/generic/RTThreadGetNativeState-generic.cpp b/src/VBox/Runtime/generic/RTThreadGetNativeState-generic.cpp
index 95e360c..24747d4 100644
--- a/src/VBox/Runtime/generic/RTThreadGetNativeState-generic.cpp
+++ b/src/VBox/Runtime/generic/RTThreadGetNativeState-generic.cpp
@@ -25,9 +25,9 @@
*/
-/*******************************************************************************
-* Header Files *
-*******************************************************************************/
+/*********************************************************************************************************************************
+* Header Files *
+*********************************************************************************************************************************/
#define LOG_GROUP RTLOGGROUP_PROCESS
#include <iprt/thread.h>
#include "internal/iprt.h"
diff --git a/src/VBox/Runtime/generic/RTThreadSetAffinity-stub-generic.cpp b/src/VBox/Runtime/generic/RTThreadSetAffinity-stub-generic.cpp
index 4f55b41..d40a4e2 100644
--- a/src/VBox/Runtime/generic/RTThreadSetAffinity-stub-generic.cpp
+++ b/src/VBox/Runtime/generic/RTThreadSetAffinity-stub-generic.cpp
@@ -25,9 +25,9 @@
*/
-/*******************************************************************************
-* Header Files *
-*******************************************************************************/
+/*********************************************************************************************************************************
+* Header Files *
+*********************************************************************************************************************************/
#include <iprt/thread.h>
#include "internal/iprt.h"
diff --git a/src/VBox/Runtime/generic/RTThreadSetAffinityToCpu-generic.cpp b/src/VBox/Runtime/generic/RTThreadSetAffinityToCpu-generic.cpp
index 2efdfb1..af02471 100644
--- a/src/VBox/Runtime/generic/RTThreadSetAffinityToCpu-generic.cpp
+++ b/src/VBox/Runtime/generic/RTThreadSetAffinityToCpu-generic.cpp
@@ -25,9 +25,9 @@
*/
-/*******************************************************************************
-* Header Files *
-*******************************************************************************/
+/*********************************************************************************************************************************
+* Header Files *
+*********************************************************************************************************************************/
#include <iprt/thread.h>
#include "internal/iprt.h"
diff --git a/src/VBox/Runtime/generic/RTTimeLocalDeltaNano-generic.cpp b/src/VBox/Runtime/generic/RTTimeLocalDeltaNano-generic.cpp
index 4dc4c45..52d2d3d 100644
--- a/src/VBox/Runtime/generic/RTTimeLocalDeltaNano-generic.cpp
+++ b/src/VBox/Runtime/generic/RTTimeLocalDeltaNano-generic.cpp
@@ -25,9 +25,9 @@
*/
-/*******************************************************************************
-* Header Files *
-*******************************************************************************/
+/*********************************************************************************************************************************
+* Header Files *
+*********************************************************************************************************************************/
#include <iprt/time.h>
#include "internal/iprt.h"
diff --git a/src/VBox/Runtime/generic/RTTimeLocalExplode-generic.cpp b/src/VBox/Runtime/generic/RTTimeLocalExplode-generic.cpp
index 164afc5..2cc02e5 100644
--- a/src/VBox/Runtime/generic/RTTimeLocalExplode-generic.cpp
+++ b/src/VBox/Runtime/generic/RTTimeLocalExplode-generic.cpp
@@ -25,9 +25,9 @@
*/
-/*******************************************************************************
-* Header Files *
-*******************************************************************************/
+/*********************************************************************************************************************************
+* Header Files *
+*********************************************************************************************************************************/
#include <iprt/time.h>
#include "internal/iprt.h"
diff --git a/src/VBox/Runtime/generic/RTTimeLocalNow-generic.cpp b/src/VBox/Runtime/generic/RTTimeLocalNow-generic.cpp
index 526cd9e..319f7c6 100644
--- a/src/VBox/Runtime/generic/RTTimeLocalNow-generic.cpp
+++ b/src/VBox/Runtime/generic/RTTimeLocalNow-generic.cpp
@@ -25,9 +25,9 @@
*/
-/*******************************************************************************
-* Header Files *
-*******************************************************************************/
+/*********************************************************************************************************************************
+* Header Files *
+*********************************************************************************************************************************/
#include <iprt/time.h>
#include "internal/iprt.h"
diff --git a/src/VBox/Runtime/generic/RTTimerCreate-generic.cpp b/src/VBox/Runtime/generic/RTTimerCreate-generic.cpp
index 28a068a..bcb279b 100644
--- a/src/VBox/Runtime/generic/RTTimerCreate-generic.cpp
+++ b/src/VBox/Runtime/generic/RTTimerCreate-generic.cpp
@@ -25,9 +25,9 @@
*/
-/*******************************************************************************
-* Header Files *
-*******************************************************************************/
+/*********************************************************************************************************************************
+* Header Files *
+*********************************************************************************************************************************/
#include <iprt/timer.h>
#include "internal/iprt.h"
diff --git a/src/VBox/Runtime/generic/RTTimerLRCreate-generic.cpp b/src/VBox/Runtime/generic/RTTimerLRCreate-generic.cpp
index ba57455..577276e 100644
--- a/src/VBox/Runtime/generic/RTTimerLRCreate-generic.cpp
+++ b/src/VBox/Runtime/generic/RTTimerLRCreate-generic.cpp
@@ -25,9 +25,9 @@
*/
-/*******************************************************************************
-* Header Files *
-*******************************************************************************/
+/*********************************************************************************************************************************
+* Header Files *
+*********************************************************************************************************************************/
#include <iprt/timer.h>
#include "internal/iprt.h"
diff --git a/src/VBox/Runtime/generic/RTUuidCreate-generic.cpp b/src/VBox/Runtime/generic/RTUuidCreate-generic.cpp
index f5424ef..59ca330 100644
--- a/src/VBox/Runtime/generic/RTUuidCreate-generic.cpp
+++ b/src/VBox/Runtime/generic/RTUuidCreate-generic.cpp
@@ -25,9 +25,9 @@
*/
-/*******************************************************************************
-* Header Files *
-*******************************************************************************/
+/*********************************************************************************************************************************
+* Header Files *
+*********************************************************************************************************************************/
#include <iprt/uuid.h>
#include "internal/iprt.h"
diff --git a/src/VBox/Runtime/generic/cdrom-generic.cpp b/src/VBox/Runtime/generic/cdrom-generic.cpp
index dfabc41..f629fdf 100644
--- a/src/VBox/Runtime/generic/cdrom-generic.cpp
+++ b/src/VBox/Runtime/generic/cdrom-generic.cpp
@@ -25,9 +25,9 @@
*/
-/*******************************************************************************
-* Header Files *
-*******************************************************************************/
+/*********************************************************************************************************************************
+* Header Files *
+*********************************************************************************************************************************/
#include <iprt/cdrom.h>
#include "internal/iprt.h"
diff --git a/src/VBox/Runtime/generic/createtemp-generic.cpp b/src/VBox/Runtime/generic/createtemp-generic.cpp
index 4d3b1cc..ae063e9 100644
--- a/src/VBox/Runtime/generic/createtemp-generic.cpp
+++ b/src/VBox/Runtime/generic/createtemp-generic.cpp
@@ -25,9 +25,9 @@
*/
-/*******************************************************************************
-* Header Files *
-*******************************************************************************/
+/*********************************************************************************************************************************
+* Header Files *
+*********************************************************************************************************************************/
#include <iprt/dir.h>
#include "internal/iprt.h"
@@ -234,3 +234,49 @@ RTDECL(int) RTFileCreateTempSecure(char *pszTemplate)
}
}
RT_EXPORT_SYMBOL(RTFileCreateTempSecure);
+
+
+RTDECL(int) RTFileOpenTemp(PRTFILE phFile, char *pszFilename, size_t cbFilename, uint64_t fOpen)
+{
+ AssertReturn((fOpen & RTFILE_O_ACTION_MASK) == RTFILE_O_CREATE, VERR_INVALID_FLAGS);
+ AssertReturn(fOpen & RTFILE_O_WRITE, VERR_INVALID_FLAGS);
+
+ /*
+ * Start by obtaining the path to the temporary directory.
+ */
+ int rc = RTPathTemp(pszFilename, cbFilename);
+ if (RT_SUCCESS(rc))
+ {
+ /*
+ * Add a filename pattern.
+ */
+ static char const s_szTemplate[] = "IPRT-XXXXXXXXXXXX.tmp";
+ rc = RTPathAppend(pszFilename, cbFilename, s_szTemplate);
+ if (RT_SUCCESS(rc))
+ {
+ char * const pszX = RTStrEnd(pszFilename, cbFilename) - (sizeof(s_szTemplate) - 1) + 5;
+ unsigned cXes = sizeof(s_szTemplate) - 1 - 4 - 5;
+ Assert(pszX[0] == 'X'); Assert(pszX[-1] == '-'); Assert(pszX[cXes] == '.');
+
+ /*
+ * Try 10000 times with random names.
+ */
+ unsigned cTriesLeft = 10000;
+ while (cTriesLeft-- > 0)
+ {
+ rtCreateTempFillTemplate(pszX, cXes);
+ rc = RTFileOpen(phFile, pszFilename, fOpen);
+ if (RT_SUCCESS(rc))
+ return rc;
+ }
+ }
+ }
+
+ if (cbFilename)
+ *pszFilename = '\0';
+ *phFile = NIL_RTFILE;
+ return rc;
+}
+RT_EXPORT_SYMBOL(RTFileOpenTemp);
+
+
diff --git a/src/VBox/Runtime/generic/critsect-generic.cpp b/src/VBox/Runtime/generic/critsect-generic.cpp
index 694a511..31d2fe4 100644
--- a/src/VBox/Runtime/generic/critsect-generic.cpp
+++ b/src/VBox/Runtime/generic/critsect-generic.cpp
@@ -25,9 +25,9 @@
*/
-/*******************************************************************************
-* Header Files *
-*******************************************************************************/
+/*********************************************************************************************************************************
+* Header Files *
+*********************************************************************************************************************************/
#define RTCRITSECT_WITHOUT_REMAPPING
#include <iprt/critsect.h>
#include "internal/iprt.h"
diff --git a/src/VBox/Runtime/generic/critsectrw-generic.cpp b/src/VBox/Runtime/generic/critsectrw-generic.cpp
index abe678a..54c3ac6 100644
--- a/src/VBox/Runtime/generic/critsectrw-generic.cpp
+++ b/src/VBox/Runtime/generic/critsectrw-generic.cpp
@@ -25,9 +25,9 @@
*/
-/*******************************************************************************
-* Header Files *
-*******************************************************************************/
+/*********************************************************************************************************************************
+* Header Files *
+*********************************************************************************************************************************/
#define RTCRITSECTRW_WITHOUT_REMAPPING
#define RTASSERT_QUIET
#include <iprt/critsect.h>
diff --git a/src/VBox/Runtime/generic/env-generic.cpp b/src/VBox/Runtime/generic/env-generic.cpp
index 9030597..b0ee3ca 100644
--- a/src/VBox/Runtime/generic/env-generic.cpp
+++ b/src/VBox/Runtime/generic/env-generic.cpp
@@ -25,9 +25,9 @@
*/
-/*******************************************************************************
-* Header Files *
-*******************************************************************************/
+/*********************************************************************************************************************************
+* Header Files *
+*********************************************************************************************************************************/
#include <iprt/env.h>
#include "internal/iprt.h"
@@ -53,9 +53,9 @@ RT_C_DECLS_END
#endif
-/*******************************************************************************
-* Defined Constants And Macros *
-*******************************************************************************/
+/*********************************************************************************************************************************
+* Defined Constants And Macros *
+*********************************************************************************************************************************/
/** The allocation granularity of the RTENVINTERNAL::papszEnv memory. */
#define RTENV_GROW_SIZE 16
@@ -78,9 +78,9 @@ RT_C_DECLS_END
#endif
-/*******************************************************************************
-* Structures and Typedefs *
-*******************************************************************************/
+/*********************************************************************************************************************************
+* Structures and Typedefs *
+*********************************************************************************************************************************/
/**
* The internal representation of a (non-default) environment.
*/
diff --git a/src/VBox/Runtime/generic/errvars-generic.cpp b/src/VBox/Runtime/generic/errvars-generic.cpp
index 9b73886..c9a67d9 100644
--- a/src/VBox/Runtime/generic/errvars-generic.cpp
+++ b/src/VBox/Runtime/generic/errvars-generic.cpp
@@ -25,9 +25,9 @@
*/
-/*******************************************************************************
-* Header Files *
-*******************************************************************************/
+/*********************************************************************************************************************************
+* Header Files *
+*********************************************************************************************************************************/
#include <iprt/err.h>
#include "internal/iprt.h"
diff --git a/src/VBox/Runtime/generic/fs-stubs-generic.cpp b/src/VBox/Runtime/generic/fs-stubs-generic.cpp
index b8d28d4..6af8d33 100644
--- a/src/VBox/Runtime/generic/fs-stubs-generic.cpp
+++ b/src/VBox/Runtime/generic/fs-stubs-generic.cpp
@@ -25,9 +25,9 @@
*/
-/*******************************************************************************
-* Header Files *
-*******************************************************************************/
+/*********************************************************************************************************************************
+* Header Files *
+*********************************************************************************************************************************/
#define LOG_GROUP RTLOGGROUP_FS
#include <iprt/fs.h>
#include "internal/iprt.h"
@@ -67,7 +67,11 @@ RTR3DECL(int) RTFsQuerySerial(const char *pszFsPath, uint32_t *pu32Serial)
RTR3DECL(int) RTFsQueryProperties(const char *pszFsPath, PRTFSPROPERTIES pProperties)
{
pProperties->cbMaxComponent = 255;
+#if defined(RT_OS_OS2) || defined(RT_OS_WINDOWS) || defined(RT_OS_DARWIN)
+ pProperties->fCaseSensitive = false;
+#else
pProperties->fCaseSensitive = true;
+#endif
pProperties->fCompressed = false;
pProperties->fFileCompression = false;
pProperties->fReadOnly = false;
@@ -77,3 +81,13 @@ RTR3DECL(int) RTFsQueryProperties(const char *pszFsPath, PRTFSPROPERTIES pProper
return VINF_SUCCESS;
}
+
+RTR3DECL(bool) RTFsIsCaseSensitive(const char *pszFsPath)
+{
+#if defined(RT_OS_OS2) || defined(RT_OS_WINDOWS) || defined(RT_OS_DARWIN)
+ return false;
+#else
+ return true;
+#endif
+}
+
diff --git a/src/VBox/Runtime/generic/mempool-generic.cpp b/src/VBox/Runtime/generic/mempool-generic.cpp
index dcf0f1d..0380b57 100644
--- a/src/VBox/Runtime/generic/mempool-generic.cpp
+++ b/src/VBox/Runtime/generic/mempool-generic.cpp
@@ -25,9 +25,9 @@
*/
-/*******************************************************************************
-* Header Files *
-*******************************************************************************/
+/*********************************************************************************************************************************
+* Header Files *
+*********************************************************************************************************************************/
#include <iprt/mempool.h>
#include "internal/iprt.h"
@@ -41,9 +41,9 @@
#include "internal/magics.h"
-/*******************************************************************************
-* Structures and Typedefs *
-*******************************************************************************/
+/*********************************************************************************************************************************
+* Structures and Typedefs *
+*********************************************************************************************************************************/
/** Pointer to a memory pool instance. */
typedef struct RTMEMPOOLINT *PRTMEMPOOLINT;
/** Pointer to a memory pool entry. */
@@ -85,9 +85,9 @@ typedef struct RTMEMPOOLINT
} RTMEMPOOLINT;
-/*******************************************************************************
-* Defined Constants And Macros *
-*******************************************************************************/
+/*********************************************************************************************************************************
+* Defined Constants And Macros *
+*********************************************************************************************************************************/
/** Validates a memory pool handle, translating RTMEMPOOL_DEFAULT when found,
* and returns rc if not valid. */
#define RTMEMPOOL_VALID_RETURN_RC(pMemPool, rc) \
@@ -111,9 +111,9 @@ typedef struct RTMEMPOOLINT
} while (0)
-/*******************************************************************************
-* Global Variables *
-*******************************************************************************/
+/*********************************************************************************************************************************
+* Global Variables *
+*********************************************************************************************************************************/
/** The */
static RTMEMPOOLINT g_rtMemPoolDefault =
{
@@ -243,7 +243,7 @@ DECLINLINE(void) rtMemPoolUnlink(PRTMEMPOOLENTRY pEntry)
}
-RTDECL(void *) RTMemPoolAlloc(RTMEMPOOL hMemPool, size_t cb) RT_NO_THROW
+RTDECL(void *) RTMemPoolAlloc(RTMEMPOOL hMemPool, size_t cb) RT_NO_THROW_DEF
{
PRTMEMPOOLINT pMemPool = hMemPool;
RTMEMPOOL_VALID_RETURN_RC(pMemPool, NULL);
@@ -258,7 +258,7 @@ RTDECL(void *) RTMemPoolAlloc(RTMEMPOOL hMemPool, size_t cb) RT_NO_THROW
RT_EXPORT_SYMBOL(RTMemPoolAlloc);
-RTDECL(void *) RTMemPoolAllocZ(RTMEMPOOL hMemPool, size_t cb) RT_NO_THROW
+RTDECL(void *) RTMemPoolAllocZ(RTMEMPOOL hMemPool, size_t cb) RT_NO_THROW_DEF
{
PRTMEMPOOLINT pMemPool = hMemPool;
RTMEMPOOL_VALID_RETURN_RC(pMemPool, NULL);
@@ -273,7 +273,7 @@ RTDECL(void *) RTMemPoolAllocZ(RTMEMPOOL hMemPool, size_t cb) RT_NO_THROW
RT_EXPORT_SYMBOL(RTMemPoolAllocZ);
-RTDECL(void *) RTMemPoolDup(RTMEMPOOL hMemPool, const void *pvSrc, size_t cb) RT_NO_THROW
+RTDECL(void *) RTMemPoolDup(RTMEMPOOL hMemPool, const void *pvSrc, size_t cb) RT_NO_THROW_DEF
{
PRTMEMPOOLINT pMemPool = hMemPool;
RTMEMPOOL_VALID_RETURN_RC(pMemPool, NULL);
@@ -289,7 +289,7 @@ RTDECL(void *) RTMemPoolDup(RTMEMPOOL hMemPool, const void *pvSrc, size_t cb) RT
RT_EXPORT_SYMBOL(RTMemPoolDup);
-RTDECL(void *) RTMemPoolDupEx(RTMEMPOOL hMemPool, const void *pvSrc, size_t cbSrc, size_t cbExtra) RT_NO_THROW
+RTDECL(void *) RTMemPoolDupEx(RTMEMPOOL hMemPool, const void *pvSrc, size_t cbSrc, size_t cbExtra) RT_NO_THROW_DEF
{
PRTMEMPOOLINT pMemPool = hMemPool;
RTMEMPOOL_VALID_RETURN_RC(pMemPool, NULL);
@@ -307,7 +307,7 @@ RT_EXPORT_SYMBOL(RTMemPoolDupEx);
-RTDECL(void *) RTMemPoolRealloc(RTMEMPOOL hMemPool, void *pvOld, size_t cbNew) RT_NO_THROW
+RTDECL(void *) RTMemPoolRealloc(RTMEMPOOL hMemPool, void *pvOld, size_t cbNew) RT_NO_THROW_DEF
{
/*
* Fend off the odd cases.
@@ -350,14 +350,14 @@ RTDECL(void *) RTMemPoolRealloc(RTMEMPOOL hMemPool, void *pvOld, size_t cbNew) R
RT_EXPORT_SYMBOL(RTMemPoolRealloc);
-RTDECL(void) RTMemPoolFree(RTMEMPOOL hMemPool, void *pv) RT_NO_THROW
+RTDECL(void) RTMemPoolFree(RTMEMPOOL hMemPool, void *pv) RT_NO_THROW_DEF
{
RTMemPoolRelease(hMemPool, pv);
}
RT_EXPORT_SYMBOL(RTMemPoolFree);
-RTDECL(uint32_t) RTMemPoolRetain(void *pv) RT_NO_THROW
+RTDECL(uint32_t) RTMemPoolRetain(void *pv) RT_NO_THROW_DEF
{
PRTMEMPOOLENTRY pEntry = (PRTMEMPOOLENTRY)pv - 1;
RTMEMPOOL_VALID_ENTRY_RETURN_RC(pEntry, UINT32_MAX);
@@ -370,7 +370,7 @@ RTDECL(uint32_t) RTMemPoolRetain(void *pv) RT_NO_THROW
RT_EXPORT_SYMBOL(RTMemPoolRetain);
-RTDECL(uint32_t) RTMemPoolRelease(RTMEMPOOL hMemPool, void *pv) RT_NO_THROW
+RTDECL(uint32_t) RTMemPoolRelease(RTMEMPOOL hMemPool, void *pv) RT_NO_THROW_DEF
{
if (!pv)
return 0;
@@ -396,7 +396,7 @@ RTDECL(uint32_t) RTMemPoolRelease(RTMEMPOOL hMemPool, void *pv) RT_NO_THROW
RT_EXPORT_SYMBOL(RTMemPoolRelease);
-RTDECL(uint32_t) RTMemPoolRefCount(void *pv) RT_NO_THROW
+RTDECL(uint32_t) RTMemPoolRefCount(void *pv) RT_NO_THROW_DEF
{
PRTMEMPOOLENTRY pEntry = (PRTMEMPOOLENTRY)pv - 1;
RTMEMPOOL_VALID_ENTRY_RETURN_RC(pEntry, UINT32_MAX);
diff --git a/src/VBox/Runtime/generic/memsafer-generic.cpp b/src/VBox/Runtime/generic/memsafer-generic.cpp
index 7341b66..156d6de 100644
--- a/src/VBox/Runtime/generic/memsafer-generic.cpp
+++ b/src/VBox/Runtime/generic/memsafer-generic.cpp
@@ -25,9 +25,9 @@
*/
-/*******************************************************************************
-* Header Files *
-*******************************************************************************/
+/*********************************************************************************************************************************
+* Header Files *
+*********************************************************************************************************************************/
#include "internal/iprt.h"
#include <iprt/memsafer.h>
@@ -35,9 +35,9 @@
#include <iprt/string.h>
-/*******************************************************************************
-* Defined Constants And Macros *
-*******************************************************************************/
+/*********************************************************************************************************************************
+* Defined Constants And Macros *
+*********************************************************************************************************************************/
/** Allocation size alignment. */
#define RTMEMSAFER_ALIGN 16
/** Padding after the block to avoid small overruns. */
@@ -46,9 +46,9 @@
#define RTMEMSAFER_PAD_AFTER 32
-/*******************************************************************************
-* Global Variables *
-*******************************************************************************/
+/*********************************************************************************************************************************
+* Global Variables *
+*********************************************************************************************************************************/
/** XOR scrabler value.
* @todo determine this at runtime */
#if ARCH_BITS == 32
@@ -102,7 +102,7 @@ RTDECL(int) RTMemSaferUnscramble(void *pv, size_t cb)
RT_EXPORT_SYMBOL(RTMemSaferUnscramble);
-RTDECL(int) RTMemSaferAllocZExTag(void **ppvNew, size_t cb, uint32_t fFlags, const char *pszTag) RT_NO_THROW
+RTDECL(int) RTMemSaferAllocZExTag(void **ppvNew, size_t cb, uint32_t fFlags, const char *pszTag) RT_NO_THROW_DEF
{
AssertPtrReturn(ppvNew, VERR_INVALID_PARAMETER);
*ppvNew = NULL;
@@ -143,7 +143,7 @@ RTDECL(int) RTMemSaferAllocZExTag(void **ppvNew, size_t cb, uint32_t fFlags, con
RT_EXPORT_SYMBOL(RTMemSaferAllocZExTag);
-RTDECL(void) RTMemSaferFree(void *pv, size_t cb) RT_NO_THROW
+RTDECL(void) RTMemSaferFree(void *pv, size_t cb) RT_NO_THROW_DEF
{
if (pv)
{
@@ -159,7 +159,7 @@ RTDECL(void) RTMemSaferFree(void *pv, size_t cb) RT_NO_THROW
RT_EXPORT_SYMBOL(RTMemSaferFree);
-RTDECL(int) RTMemSaferReallocZExTag(size_t cbOld, void *pvOld, size_t cbNew, void **ppvNew, uint32_t fFlags, const char *pszTag) RT_NO_THROW
+RTDECL(int) RTMemSaferReallocZExTag(size_t cbOld, void *pvOld, size_t cbNew, void **ppvNew, uint32_t fFlags, const char *pszTag) RT_NO_THROW_DEF
{
/*
* We cannot let the heap move us around because we will be failing in our
@@ -203,7 +203,7 @@ RTDECL(int) RTMemSaferReallocZExTag(size_t cbOld, void *pvOld, size_t cbNew, voi
RT_EXPORT_SYMBOL(RTMemSaferReallocZExTag);
-RTDECL(void *) RTMemSaferAllocZTag(size_t cb, const char *pszTag) RT_NO_THROW
+RTDECL(void *) RTMemSaferAllocZTag(size_t cb, const char *pszTag) RT_NO_THROW_DEF
{
void *pvNew = NULL;
int rc = RTMemSaferAllocZExTag(&pvNew, cb, 0 /*fFlags*/, pszTag);
@@ -214,7 +214,7 @@ RTDECL(void *) RTMemSaferAllocZTag(size_t cb, const char *pszTag) RT_NO_THROW
RT_EXPORT_SYMBOL(RTMemSaferAllocZTag);
-RTDECL(void *) RTMemSaferReallocZTag(size_t cbOld, void *pvOld, size_t cbNew, const char *pszTag) RT_NO_THROW
+RTDECL(void *) RTMemSaferReallocZTag(size_t cbOld, void *pvOld, size_t cbNew, const char *pszTag) RT_NO_THROW_DEF
{
void *pvNew = NULL;
int rc = RTMemSaferReallocZExTag(cbOld, pvOld, cbNew, &pvNew, 0 /*fFlags*/, pszTag);
diff --git a/src/VBox/Runtime/generic/mppresent-generic.cpp b/src/VBox/Runtime/generic/mppresent-generic.cpp
index 1809939..ea988e0 100644
--- a/src/VBox/Runtime/generic/mppresent-generic.cpp
+++ b/src/VBox/Runtime/generic/mppresent-generic.cpp
@@ -25,9 +25,9 @@
*/
-/*******************************************************************************
-* Header Files *
-*******************************************************************************/
+/*********************************************************************************************************************************
+* Header Files *
+*********************************************************************************************************************************/
#include <iprt/mp.h>
#include "internal/iprt.h"
diff --git a/src/VBox/Runtime/generic/pathhost-generic.cpp b/src/VBox/Runtime/generic/pathhost-generic.cpp
index 480d07d..11c442b 100644
--- a/src/VBox/Runtime/generic/pathhost-generic.cpp
+++ b/src/VBox/Runtime/generic/pathhost-generic.cpp
@@ -25,9 +25,9 @@
*/
-/*******************************************************************************
-* Header Files *
-*******************************************************************************/
+/*********************************************************************************************************************************
+* Header Files *
+*********************************************************************************************************************************/
#define LOG_GROUP RTLOGGROUP_PATH
#include "internal/iprt.h"
#include "internal/path.h"
diff --git a/src/VBox/Runtime/generic/sched-generic.cpp b/src/VBox/Runtime/generic/sched-generic.cpp
index d5ef2de..b0f51c8 100644
--- a/src/VBox/Runtime/generic/sched-generic.cpp
+++ b/src/VBox/Runtime/generic/sched-generic.cpp
@@ -25,9 +25,9 @@
*/
-/*******************************************************************************
-* Header Files *
-*******************************************************************************/
+/*********************************************************************************************************************************
+* Header Files *
+*********************************************************************************************************************************/
#define LOG_GROUP RTLOGGROUP_THREAD
#include <iprt/thread.h>
#include "internal/iprt.h"
diff --git a/src/VBox/Runtime/generic/semfastmutex-generic.cpp b/src/VBox/Runtime/generic/semfastmutex-generic.cpp
index bf35aa3..8f070b2 100644
--- a/src/VBox/Runtime/generic/semfastmutex-generic.cpp
+++ b/src/VBox/Runtime/generic/semfastmutex-generic.cpp
@@ -25,9 +25,9 @@
*/
-/*******************************************************************************
-* Header Files *
-*******************************************************************************/
+/*********************************************************************************************************************************
+* Header Files *
+*********************************************************************************************************************************/
#include <iprt/semaphore.h>
#include "internal/iprt.h"
diff --git a/src/VBox/Runtime/generic/semrw-generic.cpp b/src/VBox/Runtime/generic/semrw-generic.cpp
index d236065..f72f60c 100644
--- a/src/VBox/Runtime/generic/semrw-generic.cpp
+++ b/src/VBox/Runtime/generic/semrw-generic.cpp
@@ -28,9 +28,9 @@
*/
-/*******************************************************************************
-* Header Files *
-*******************************************************************************/
+/*********************************************************************************************************************************
+* Header Files *
+*********************************************************************************************************************************/
#define RTSEMRW_WITHOUT_REMAPPING
#include <iprt/semaphore.h>
#include "internal/iprt.h"
@@ -48,9 +48,9 @@
#include "internal/strict.h"
-/*******************************************************************************
-* Structures and Typedefs *
-*******************************************************************************/
+/*********************************************************************************************************************************
+* Structures and Typedefs *
+*********************************************************************************************************************************/
/** Internal representation of a Read-Write semaphore for the
* Generic implementation. */
diff --git a/src/VBox/Runtime/generic/semrw-lockless-generic.cpp b/src/VBox/Runtime/generic/semrw-lockless-generic.cpp
index abcb7ff..1aa4200 100644
--- a/src/VBox/Runtime/generic/semrw-lockless-generic.cpp
+++ b/src/VBox/Runtime/generic/semrw-lockless-generic.cpp
@@ -25,9 +25,9 @@
*/
-/*******************************************************************************
-* Header Files *
-*******************************************************************************/
+/*********************************************************************************************************************************
+* Header Files *
+*********************************************************************************************************************************/
#define RTSEMRW_WITHOUT_REMAPPING
#define RTASSERT_QUIET
#include <iprt/semaphore.h>
@@ -44,9 +44,9 @@
#include "internal/strict.h"
-/*******************************************************************************
-* Structures and Typedefs *
-*******************************************************************************/
+/*********************************************************************************************************************************
+* Structures and Typedefs *
+*********************************************************************************************************************************/
typedef struct RTSEMRWINTERNAL
{
/** Magic value (RTSEMRW_MAGIC). */
@@ -89,9 +89,9 @@ typedef struct RTSEMRWINTERNAL
} RTSEMRWINTERNAL;
-/*******************************************************************************
-* Defined Constants And Macros *
-*******************************************************************************/
+/*********************************************************************************************************************************
+* Defined Constants And Macros *
+*********************************************************************************************************************************/
#define RTSEMRW_CNT_BITS 15
#define RTSEMRW_CNT_MASK UINT64_C(0x00007fff)
diff --git a/src/VBox/Runtime/generic/semxroads-generic.cpp b/src/VBox/Runtime/generic/semxroads-generic.cpp
index 5ca82d0..c2f084e 100644
--- a/src/VBox/Runtime/generic/semxroads-generic.cpp
+++ b/src/VBox/Runtime/generic/semxroads-generic.cpp
@@ -25,9 +25,9 @@
*/
-/*******************************************************************************
-* Header Files *
-*******************************************************************************/
+/*********************************************************************************************************************************
+* Header Files *
+*********************************************************************************************************************************/
#define RTASSERT_QUIET
#include <iprt/semaphore.h>
#include "internal/iprt.h"
@@ -41,9 +41,9 @@
#include "internal/magics.h"
-/*******************************************************************************
-* Structures and Typedefs *
-*******************************************************************************/
+/*********************************************************************************************************************************
+* Structures and Typedefs *
+*********************************************************************************************************************************/
typedef struct RTSEMXROADSINTERNAL
{
/** Magic value (RTSEMXROADS_MAGIC). */
@@ -73,9 +73,9 @@ typedef struct RTSEMXROADSINTERNAL
} RTSEMXROADSINTERNAL;
-/*******************************************************************************
-* Defined Constants And Macros *
-*******************************************************************************/
+/*********************************************************************************************************************************
+* Defined Constants And Macros *
+*********************************************************************************************************************************/
#define RTSEMXROADS_CNT_BITS 15
#define RTSEMXROADS_CNT_MASK UINT64_C(0x00007fff)
diff --git a/src/VBox/Runtime/generic/spinlock-generic.cpp b/src/VBox/Runtime/generic/spinlock-generic.cpp
index d42410d..5d0bd5b 100644
--- a/src/VBox/Runtime/generic/spinlock-generic.cpp
+++ b/src/VBox/Runtime/generic/spinlock-generic.cpp
@@ -25,18 +25,18 @@
*/
-/*******************************************************************************
-* Defined Constants And Macros *
-*******************************************************************************/
+/*********************************************************************************************************************************
+* Defined Constants And Macros *
+*********************************************************************************************************************************/
/** @def RT_CFG_SPINLOCK_GENERIC_DO_SLEEP
* Force cpu yields after spinning the number of times indicated by the define.
* If 0 we will spin forever. */
#define RT_CFG_SPINLOCK_GENERIC_DO_SLEEP 100000
-/*******************************************************************************
-* Header Files *
-*******************************************************************************/
+/*********************************************************************************************************************************
+* Header Files *
+*********************************************************************************************************************************/
#include <iprt/spinlock.h>
#include "internal/iprt.h"
@@ -54,9 +54,9 @@
#include "internal/magics.h"
-/*******************************************************************************
-* Structures and Typedefs *
-*******************************************************************************/
+/*********************************************************************************************************************************
+* Structures and Typedefs *
+*********************************************************************************************************************************/
/**
* Generic spinlock structure.
*/
diff --git a/src/VBox/Runtime/generic/strcache-stubs-generic.cpp b/src/VBox/Runtime/generic/strcache-stubs-generic.cpp
index 950e7c0..7498c9a 100644
--- a/src/VBox/Runtime/generic/strcache-stubs-generic.cpp
+++ b/src/VBox/Runtime/generic/strcache-stubs-generic.cpp
@@ -25,9 +25,9 @@
*/
-/*******************************************************************************
-* Header Files *
-*******************************************************************************/
+/*********************************************************************************************************************************
+* Header Files *
+*********************************************************************************************************************************/
#include <iprt/strcache.h>
#include "internal/iprt.h"
diff --git a/src/VBox/Runtime/generic/timer-generic.cpp b/src/VBox/Runtime/generic/timer-generic.cpp
index 3659213..e5932ec 100644
--- a/src/VBox/Runtime/generic/timer-generic.cpp
+++ b/src/VBox/Runtime/generic/timer-generic.cpp
@@ -25,9 +25,9 @@
*/
-/*******************************************************************************
-* Header Files *
-*******************************************************************************/
+/*********************************************************************************************************************************
+* Header Files *
+*********************************************************************************************************************************/
#include <iprt/timer.h>
#include "internal/iprt.h"
@@ -43,9 +43,9 @@
-/*******************************************************************************
-* Structures and Typedefs *
-*******************************************************************************/
+/*********************************************************************************************************************************
+* Structures and Typedefs *
+*********************************************************************************************************************************/
/**
* The internal representation of a timer handle.
*/
@@ -80,9 +80,9 @@ typedef struct RTTIMER
} RTTIMER;
-/*******************************************************************************
-* Internal Functions *
-*******************************************************************************/
+/*********************************************************************************************************************************
+* Internal Functions *
+*********************************************************************************************************************************/
static DECLCALLBACK(int) rtTimerThread(RTTHREAD Thread, void *pvUser);
diff --git a/src/VBox/Runtime/generic/timerlr-generic.cpp b/src/VBox/Runtime/generic/timerlr-generic.cpp
index c0191f7..bd42008 100644
--- a/src/VBox/Runtime/generic/timerlr-generic.cpp
+++ b/src/VBox/Runtime/generic/timerlr-generic.cpp
@@ -28,9 +28,9 @@
*/
-/*******************************************************************************
-* Header Files *
-*******************************************************************************/
+/*********************************************************************************************************************************
+* Header Files *
+*********************************************************************************************************************************/
#include <iprt/timer.h>
#include "internal/iprt.h"
@@ -45,9 +45,9 @@
#include "internal/magics.h"
-/*******************************************************************************
-* Structures and Typedefs *
-*******************************************************************************/
+/*********************************************************************************************************************************
+* Structures and Typedefs *
+*********************************************************************************************************************************/
/**
* The internal representation of a timer handle.
*/
@@ -83,9 +83,9 @@ typedef struct RTTIMERLRINT
typedef RTTIMERLRINT *PRTTIMERLRINT;
-/*******************************************************************************
-* Internal Functions *
-*******************************************************************************/
+/*********************************************************************************************************************************
+* Internal Functions *
+*********************************************************************************************************************************/
static DECLCALLBACK(int) rtTimerLRThread(RTTHREAD hThread, void *pvUser);
diff --git a/src/VBox/Runtime/generic/tls-generic.cpp b/src/VBox/Runtime/generic/tls-generic.cpp
index 3a55c9e..fbbb191 100644
--- a/src/VBox/Runtime/generic/tls-generic.cpp
+++ b/src/VBox/Runtime/generic/tls-generic.cpp
@@ -25,9 +25,9 @@
*/
-/*******************************************************************************
-* Header Files *
-*******************************************************************************/
+/*********************************************************************************************************************************
+* Header Files *
+*********************************************************************************************************************************/
#define LOG_GROUP RTLOGGROUP_THREAD
#include <iprt/thread.h>
#include "internal/iprt.h"
@@ -39,9 +39,9 @@
#include "internal/thread.h"
-/*******************************************************************************
-* Global Variables *
-*******************************************************************************/
+/*********************************************************************************************************************************
+* Global Variables *
+*********************************************************************************************************************************/
/** Allocation bitmap. Set bits indicates allocated entries. */
static uint32_t volatile g_au32AllocatedBitmap[(RTTHREAD_TLS_ENTRIES + 31) / 32];
/** Destructors for each of the TLS entries. */
diff --git a/src/VBox/Runtime/generic/utf16locale-generic.cpp b/src/VBox/Runtime/generic/utf16locale-generic.cpp
index ce37df3..551b588 100644
--- a/src/VBox/Runtime/generic/utf16locale-generic.cpp
+++ b/src/VBox/Runtime/generic/utf16locale-generic.cpp
@@ -25,9 +25,9 @@
*/
-/*******************************************************************************
-* Header Files *
-*******************************************************************************/
+/*********************************************************************************************************************************
+* Header Files *
+*********************************************************************************************************************************/
#define LOG_GROUP RTLOGGROUP_UTF16
#include <iprt/string.h>
#include "internal/iprt.h"
diff --git a/src/VBox/Runtime/generic/uuid-generic.cpp b/src/VBox/Runtime/generic/uuid-generic.cpp
index 642d1c5..bf04a25 100644
--- a/src/VBox/Runtime/generic/uuid-generic.cpp
+++ b/src/VBox/Runtime/generic/uuid-generic.cpp
@@ -25,9 +25,9 @@
*/
-/*******************************************************************************
-* Header Files *
-*******************************************************************************/
+/*********************************************************************************************************************************
+* Header Files *
+*********************************************************************************************************************************/
#include <iprt/uuid.h>
#include "internal/iprt.h"
@@ -36,9 +36,9 @@
#include <iprt/asm.h>
-/*******************************************************************************
-* Global Variables *
-*******************************************************************************/
+/*********************************************************************************************************************************
+* Global Variables *
+*********************************************************************************************************************************/
/** Conversion table used by the conversion functions.
* 0xff if not a hex number, otherwise the value. */
static const uint8_t g_au8Digits[256] =
diff --git a/src/VBox/Runtime/nt/NtProcessStartup-stub.cpp b/src/VBox/Runtime/nt/NtProcessStartup-stub.cpp
index 0d5c22d..e1ce1fd 100644
--- a/src/VBox/Runtime/nt/NtProcessStartup-stub.cpp
+++ b/src/VBox/Runtime/nt/NtProcessStartup-stub.cpp
@@ -24,9 +24,10 @@
* terms and conditions of either the GPL or the CDDL or both.
*/
-/*******************************************************************************
-* Header Files *
-*******************************************************************************/
+
+/*********************************************************************************************************************************
+* Header Files *
+*********************************************************************************************************************************/
#include <iprt/asm.h>
diff --git a/src/VBox/Runtime/nt/RTErrConvertFromNtStatus.cpp b/src/VBox/Runtime/nt/RTErrConvertFromNtStatus.cpp
index 296f99b..535ce52 100644
--- a/src/VBox/Runtime/nt/RTErrConvertFromNtStatus.cpp
+++ b/src/VBox/Runtime/nt/RTErrConvertFromNtStatus.cpp
@@ -25,9 +25,9 @@
*/
-/*******************************************************************************
-* Header Files *
-*******************************************************************************/
+/*********************************************************************************************************************************
+* Header Files *
+*********************************************************************************************************************************/
#include <ntstatus.h>
typedef long NTSTATUS; /** @todo figure out which headers to include to get this one typedef... */
diff --git a/src/VBox/Runtime/os2/RTErrConvertFromOS2.cpp b/src/VBox/Runtime/os2/RTErrConvertFromOS2.cpp
index 062015a..0aa3c0d 100644
--- a/src/VBox/Runtime/os2/RTErrConvertFromOS2.cpp
+++ b/src/VBox/Runtime/os2/RTErrConvertFromOS2.cpp
@@ -24,9 +24,10 @@
* terms and conditions of either the GPL or the CDDL or both.
*/
-/*******************************************************************************
-* Header Files *
-*******************************************************************************/
+
+/*********************************************************************************************************************************
+* Header Files *
+*********************************************************************************************************************************/
#define INCL_ERRORS
#define INCL_DOSERRORS
#include <os2.h>
diff --git a/src/VBox/Runtime/os2/rtSemWaitOs2ConvertTimeout.cpp b/src/VBox/Runtime/os2/rtSemWaitOs2ConvertTimeout.cpp
index 91e34bd..36db98c 100644
--- a/src/VBox/Runtime/os2/rtSemWaitOs2ConvertTimeout.cpp
+++ b/src/VBox/Runtime/os2/rtSemWaitOs2ConvertTimeout.cpp
@@ -25,17 +25,17 @@
*/
-/*******************************************************************************
-* Header Files *
-*******************************************************************************/
+/*********************************************************************************************************************************
+* Header Files *
+*********************************************************************************************************************************/
#include "internal/iprt.h"
#include <iprt/semaphore.h>
#include <iprt/time.h>
-/*******************************************************************************
-* Defined Constants And Macros *
-*******************************************************************************/
+/*********************************************************************************************************************************
+* Defined Constants And Macros *
+*********************************************************************************************************************************/
/** Too lazy to include the right OS/2 header, duplicating the define we
* need here. */
#define MY_SEM_INDEFINITE_WAIT UINT32_MAX
diff --git a/src/VBox/Runtime/r0drv/alloc-r0drv.cpp b/src/VBox/Runtime/r0drv/alloc-r0drv.cpp
index 0955256..d6b9cf2 100644
--- a/src/VBox/Runtime/r0drv/alloc-r0drv.cpp
+++ b/src/VBox/Runtime/r0drv/alloc-r0drv.cpp
@@ -25,9 +25,9 @@
*/
-/*******************************************************************************
-* Header Files *
-*******************************************************************************/
+/*********************************************************************************************************************************
+* Header Files *
+*********************************************************************************************************************************/
#define RTMEM_NO_WRAP_TO_EF_APIS
#include <iprt/mem.h>
#include "internal/iprt.h"
@@ -45,9 +45,9 @@
#include "r0drv/alloc-r0drv.h"
-/*******************************************************************************
-* Defined Constants And Macros *
-*******************************************************************************/
+/*********************************************************************************************************************************
+* Defined Constants And Macros *
+*********************************************************************************************************************************/
#ifdef RT_STRICT
# define RTR0MEM_STRICT
#endif
@@ -59,9 +59,9 @@
#endif
-/*******************************************************************************
-* Global Variables *
-*******************************************************************************/
+/*********************************************************************************************************************************
+* Global Variables *
+*********************************************************************************************************************************/
#ifdef RTR0MEM_STRICT
/** Fence data. */
static uint8_t const g_abFence[RTR0MEM_FENCE_EXTRA] =
@@ -89,21 +89,21 @@ DECLINLINE(PRTMEMHDR) rtR0MemAlloc(size_t cb, uint32_t fFlags)
}
-RTDECL(void *) RTMemTmpAllocTag(size_t cb, const char *pszTag) RT_NO_THROW
+RTDECL(void *) RTMemTmpAllocTag(size_t cb, const char *pszTag) RT_NO_THROW_DEF
{
return RTMemAllocTag(cb, pszTag);
}
RT_EXPORT_SYMBOL(RTMemTmpAllocTag);
-RTDECL(void *) RTMemTmpAllocZTag(size_t cb, const char *pszTag) RT_NO_THROW
+RTDECL(void *) RTMemTmpAllocZTag(size_t cb, const char *pszTag) RT_NO_THROW_DEF
{
return RTMemAllocZTag(cb, pszTag);
}
RT_EXPORT_SYMBOL(RTMemTmpAllocZTag);
-RTDECL(void) RTMemTmpFree(void *pv) RT_NO_THROW
+RTDECL(void) RTMemTmpFree(void *pv) RT_NO_THROW_DEF
{
return RTMemFree(pv);
}
@@ -113,7 +113,7 @@ RT_EXPORT_SYMBOL(RTMemTmpFree);
-RTDECL(void *) RTMemAllocTag(size_t cb, const char *pszTag) RT_NO_THROW
+RTDECL(void *) RTMemAllocTag(size_t cb, const char *pszTag) RT_NO_THROW_DEF
{
PRTMEMHDR pHdr;
RT_ASSERT_INTS_ON();
@@ -132,7 +132,7 @@ RTDECL(void *) RTMemAllocTag(size_t cb, const char *pszTag) RT_NO_THROW
RT_EXPORT_SYMBOL(RTMemAllocTag);
-RTDECL(void *) RTMemAllocZTag(size_t cb, const char *pszTag) RT_NO_THROW
+RTDECL(void *) RTMemAllocZTag(size_t cb, const char *pszTag) RT_NO_THROW_DEF
{
PRTMEMHDR pHdr;
RT_ASSERT_INTS_ON();
@@ -177,7 +177,7 @@ RTDECL(void *) RTMemAllocZVarTag(size_t cbUnaligned, const char *pszTag)
RT_EXPORT_SYMBOL(RTMemAllocZVarTag);
-RTDECL(void *) RTMemReallocTag(void *pvOld, size_t cbNew, const char *pszTag) RT_NO_THROW
+RTDECL(void *) RTMemReallocTag(void *pvOld, size_t cbNew, const char *pszTag) RT_NO_THROW_DEF
{
PRTMEMHDR pHdrOld;
@@ -243,7 +243,7 @@ RTDECL(void *) RTMemReallocTag(void *pvOld, size_t cbNew, const char *pszTag) RT
RT_EXPORT_SYMBOL(RTMemReallocTag);
-RTDECL(void) RTMemFree(void *pv) RT_NO_THROW
+RTDECL(void) RTMemFree(void *pv) RT_NO_THROW_DEF
{
PRTMEMHDR pHdr;
RT_ASSERT_INTS_ON();
@@ -276,7 +276,7 @@ RT_EXPORT_SYMBOL(RTMemFree);
-RTDECL(void *) RTMemExecAllocTag(size_t cb, const char *pszTag) RT_NO_THROW
+RTDECL(void *) RTMemExecAllocTag(size_t cb, const char *pszTag) RT_NO_THROW_DEF
{
PRTMEMHDR pHdr;
#ifdef RT_OS_SOLARIS /** @todo figure out why */
@@ -299,7 +299,7 @@ RTDECL(void *) RTMemExecAllocTag(size_t cb, const char *pszTag) RT_NO_THROW
RT_EXPORT_SYMBOL(RTMemExecAllocTag);
-RTDECL(void) RTMemExecFree(void *pv, size_t cb) RT_NO_THROW
+RTDECL(void) RTMemExecFree(void *pv, size_t cb) RT_NO_THROW_DEF
{
PRTMEMHDR pHdr;
RT_ASSERT_INTS_ON();
@@ -329,7 +329,7 @@ RT_EXPORT_SYMBOL(RTMemExecFree);
-RTDECL(int) RTMemAllocExTag(size_t cb, size_t cbAlignment, uint32_t fFlags, const char *pszTag, void **ppv) RT_NO_THROW
+RTDECL(int) RTMemAllocExTag(size_t cb, size_t cbAlignment, uint32_t fFlags, const char *pszTag, void **ppv) RT_NO_THROW_DEF
{
uint32_t fHdrFlags = RTMEMHDR_FLAG_ALLOC_EX;
PRTMEMHDR pHdr;
@@ -393,7 +393,7 @@ RTDECL(int) RTMemAllocExTag(size_t cb, size_t cbAlignment, uint32_t fFlags, cons
RT_EXPORT_SYMBOL(RTMemAllocExTag);
-RTDECL(void) RTMemFreeEx(void *pv, size_t cb) RT_NO_THROW
+RTDECL(void) RTMemFreeEx(void *pv, size_t cb) RT_NO_THROW_DEF
{
PRTMEMHDR pHdr;
diff --git a/src/VBox/Runtime/r0drv/darwin/RTLogWriteDebugger-r0drv-darwin.cpp b/src/VBox/Runtime/r0drv/darwin/RTLogWriteDebugger-r0drv-darwin.cpp
index f15e5ec..656eda2 100644
--- a/src/VBox/Runtime/r0drv/darwin/RTLogWriteDebugger-r0drv-darwin.cpp
+++ b/src/VBox/Runtime/r0drv/darwin/RTLogWriteDebugger-r0drv-darwin.cpp
@@ -25,9 +25,9 @@
*/
-/*******************************************************************************
-* Header Files *
-*******************************************************************************/
+/*********************************************************************************************************************************
+* Header Files *
+*********************************************************************************************************************************/
#include "the-darwin-kernel.h"
#include "internal/iprt.h"
#include <iprt/log.h>
diff --git a/src/VBox/Runtime/r0drv/darwin/RTLogWriteStdOut-r0drv-darwin.cpp b/src/VBox/Runtime/r0drv/darwin/RTLogWriteStdOut-r0drv-darwin.cpp
index f3e4335..3040da2 100644
--- a/src/VBox/Runtime/r0drv/darwin/RTLogWriteStdOut-r0drv-darwin.cpp
+++ b/src/VBox/Runtime/r0drv/darwin/RTLogWriteStdOut-r0drv-darwin.cpp
@@ -25,9 +25,9 @@
*/
-/*******************************************************************************
-* Header Files *
-*******************************************************************************/
+/*********************************************************************************************************************************
+* Header Files *
+*********************************************************************************************************************************/
#include "the-darwin-kernel.h"
#include "internal/iprt.h"
#include <iprt/log.h>
diff --git a/src/VBox/Runtime/r0drv/darwin/alloc-r0drv-darwin.cpp b/src/VBox/Runtime/r0drv/darwin/alloc-r0drv-darwin.cpp
index 09cfb2f..2b22ef8 100644
--- a/src/VBox/Runtime/r0drv/darwin/alloc-r0drv-darwin.cpp
+++ b/src/VBox/Runtime/r0drv/darwin/alloc-r0drv-darwin.cpp
@@ -25,9 +25,9 @@
*/
-/*******************************************************************************
-* Header Files *
-*******************************************************************************/
+/*********************************************************************************************************************************
+* Header Files *
+*********************************************************************************************************************************/
#include "the-darwin-kernel.h"
#include "internal/iprt.h"
#include <iprt/mem.h>
@@ -39,9 +39,9 @@
#include "r0drv/alloc-r0drv.h"
-/*******************************************************************************
-* Structures and Typedefs *
-*******************************************************************************/
+/*********************************************************************************************************************************
+* Structures and Typedefs *
+*********************************************************************************************************************************/
/**
* Extended header used for headers marked with RTMEMHDR_FLAG_EXEC.
*
diff --git a/src/VBox/Runtime/r0drv/darwin/assert-r0drv-darwin.cpp b/src/VBox/Runtime/r0drv/darwin/assert-r0drv-darwin.cpp
index 0cfbd16..d3dcb9b 100644
--- a/src/VBox/Runtime/r0drv/darwin/assert-r0drv-darwin.cpp
+++ b/src/VBox/Runtime/r0drv/darwin/assert-r0drv-darwin.cpp
@@ -25,9 +25,9 @@
*/
-/*******************************************************************************
-* Header Files *
-*******************************************************************************/
+/*********************************************************************************************************************************
+* Header Files *
+*********************************************************************************************************************************/
#include "the-darwin-kernel.h"
#include "internal/iprt.h"
#include <iprt/assert.h>
diff --git a/src/VBox/Runtime/r0drv/darwin/dbgkrnlinfo-r0drv-darwin.cpp b/src/VBox/Runtime/r0drv/darwin/dbgkrnlinfo-r0drv-darwin.cpp
index 3767994..26036be 100644
--- a/src/VBox/Runtime/r0drv/darwin/dbgkrnlinfo-r0drv-darwin.cpp
+++ b/src/VBox/Runtime/r0drv/darwin/dbgkrnlinfo-r0drv-darwin.cpp
@@ -25,9 +25,9 @@
*/
-/*******************************************************************************
-* Header Files *
-*******************************************************************************/
+/*********************************************************************************************************************************
+* Header Files *
+*********************************************************************************************************************************/
#ifdef IN_RING0
# include "the-darwin-kernel.h"
# include <sys/kauth.h>
@@ -116,9 +116,9 @@ RT_C_DECLS_END
#define VERR_LDR_UNEXPECTED (-641)
-/*******************************************************************************
-* Structures and Typedefs *
-*******************************************************************************/
+/*********************************************************************************************************************************
+* Structures and Typedefs *
+*********************************************************************************************************************************/
/**
* Our internal representation of the mach_kernel after loading it's symbols
* and successfully resolving their addresses.
@@ -173,9 +173,9 @@ typedef struct RTDBGKRNLINFOINT
} RTDBGKRNLINFOINT;
-/*******************************************************************************
-* Structures and Typedefs *
-*******************************************************************************/
+/*********************************************************************************************************************************
+* Structures and Typedefs *
+*********************************************************************************************************************************/
#ifdef DEBUG
static bool g_fBreakpointOnError = false;
#endif
diff --git a/src/VBox/Runtime/r0drv/darwin/initterm-r0drv-darwin.cpp b/src/VBox/Runtime/r0drv/darwin/initterm-r0drv-darwin.cpp
index 8a19149..83dab0d 100644
--- a/src/VBox/Runtime/r0drv/darwin/initterm-r0drv-darwin.cpp
+++ b/src/VBox/Runtime/r0drv/darwin/initterm-r0drv-darwin.cpp
@@ -25,9 +25,9 @@
*/
-/*******************************************************************************
-* Header Files *
-*******************************************************************************/
+/*********************************************************************************************************************************
+* Header Files *
+*********************************************************************************************************************************/
#include "the-darwin-kernel.h"
#include "internal/iprt.h"
@@ -38,9 +38,9 @@
-/*******************************************************************************
-* Global Variables *
-*******************************************************************************/
+/*********************************************************************************************************************************
+* Global Variables *
+*********************************************************************************************************************************/
/** Pointer to the lock group used by IPRT. */
lck_grp_t *g_pDarwinLockGroup = NULL;
/** Pointer to the ast_pending function, if found. */
diff --git a/src/VBox/Runtime/r0drv/darwin/memobj-r0drv-darwin.cpp b/src/VBox/Runtime/r0drv/darwin/memobj-r0drv-darwin.cpp
index 72b34e3..f4c27f7 100644
--- a/src/VBox/Runtime/r0drv/darwin/memobj-r0drv-darwin.cpp
+++ b/src/VBox/Runtime/r0drv/darwin/memobj-r0drv-darwin.cpp
@@ -25,9 +25,9 @@
*/
-/*******************************************************************************
-* Header Files *
-*******************************************************************************/
+/*********************************************************************************************************************************
+* Header Files *
+*********************************************************************************************************************************/
#include "the-darwin-kernel.h"
#include "internal/iprt.h"
#include <iprt/memobj.h>
@@ -49,9 +49,9 @@
/*#define USE_VM_MAP_WIRE - may re-enable later when non-mapped allocations are added. */
-/*******************************************************************************
-* Structures and Typedefs *
-*******************************************************************************/
+/*********************************************************************************************************************************
+* Structures and Typedefs *
+*********************************************************************************************************************************/
/**
* The Darwin version of the memory object structure.
*/
diff --git a/src/VBox/Runtime/r0drv/darwin/memuserkernel-r0drv-darwin.cpp b/src/VBox/Runtime/r0drv/darwin/memuserkernel-r0drv-darwin.cpp
index 47c9b97..a401fe5 100644
--- a/src/VBox/Runtime/r0drv/darwin/memuserkernel-r0drv-darwin.cpp
+++ b/src/VBox/Runtime/r0drv/darwin/memuserkernel-r0drv-darwin.cpp
@@ -25,9 +25,9 @@
*/
-/*******************************************************************************
-* Header Files *
-*******************************************************************************/
+/*********************************************************************************************************************************
+* Header Files *
+*********************************************************************************************************************************/
#include "the-darwin-kernel.h"
#include "internal/iprt.h"
#include <iprt/mem.h>
diff --git a/src/VBox/Runtime/r0drv/darwin/mp-r0drv-darwin.cpp b/src/VBox/Runtime/r0drv/darwin/mp-r0drv-darwin.cpp
index d1ec1fd..b6935f6 100644
--- a/src/VBox/Runtime/r0drv/darwin/mp-r0drv-darwin.cpp
+++ b/src/VBox/Runtime/r0drv/darwin/mp-r0drv-darwin.cpp
@@ -25,9 +25,9 @@
*/
-/*******************************************************************************
-* Header Files *
-*******************************************************************************/
+/*********************************************************************************************************************************
+* Header Files *
+*********************************************************************************************************************************/
#include "the-darwin-kernel.h"
#include "internal/iprt.h"
#include <iprt/mp.h>
@@ -40,9 +40,9 @@
#include "r0drv/mp-r0drv.h"
-/*******************************************************************************
-* Global Variables *
-*******************************************************************************/
+/*********************************************************************************************************************************
+* Global Variables *
+*********************************************************************************************************************************/
static int32_t volatile g_cMaxCpus = -1;
diff --git a/src/VBox/Runtime/r0drv/darwin/process-r0drv-darwin.cpp b/src/VBox/Runtime/r0drv/darwin/process-r0drv-darwin.cpp
index ea677a5..59c7fe0 100644
--- a/src/VBox/Runtime/r0drv/darwin/process-r0drv-darwin.cpp
+++ b/src/VBox/Runtime/r0drv/darwin/process-r0drv-darwin.cpp
@@ -25,9 +25,9 @@
*/
-/*******************************************************************************
-* Header Files *
-*******************************************************************************/
+/*********************************************************************************************************************************
+* Header Files *
+*********************************************************************************************************************************/
#include "the-darwin-kernel.h"
#include "internal/iprt.h"
#include <iprt/process.h>
diff --git a/src/VBox/Runtime/r0drv/darwin/semevent-r0drv-darwin.cpp b/src/VBox/Runtime/r0drv/darwin/semevent-r0drv-darwin.cpp
index 1e6cb6b..88569ea 100644
--- a/src/VBox/Runtime/r0drv/darwin/semevent-r0drv-darwin.cpp
+++ b/src/VBox/Runtime/r0drv/darwin/semevent-r0drv-darwin.cpp
@@ -25,9 +25,9 @@
*/
-/*******************************************************************************
-* Header Files *
-*******************************************************************************/
+/*********************************************************************************************************************************
+* Header Files *
+*********************************************************************************************************************************/
#define RTSEMEVENT_WITHOUT_REMAPPING
#include "the-darwin-kernel.h"
#include "internal/iprt.h"
@@ -49,9 +49,9 @@
#include "internal/magics.h"
-/*******************************************************************************
-* Structures and Typedefs *
-*******************************************************************************/
+/*********************************************************************************************************************************
+* Structures and Typedefs *
+*********************************************************************************************************************************/
/**
* Waiter entry. Lives on the stack.
*/
diff --git a/src/VBox/Runtime/r0drv/darwin/semeventmulti-r0drv-darwin.cpp b/src/VBox/Runtime/r0drv/darwin/semeventmulti-r0drv-darwin.cpp
index c677bdd..35810b6 100644
--- a/src/VBox/Runtime/r0drv/darwin/semeventmulti-r0drv-darwin.cpp
+++ b/src/VBox/Runtime/r0drv/darwin/semeventmulti-r0drv-darwin.cpp
@@ -25,9 +25,9 @@
*/
-/*******************************************************************************
-* Header Files *
-*******************************************************************************/
+/*********************************************************************************************************************************
+* Header Files *
+*********************************************************************************************************************************/
#define RTSEMEVENTMULTI_WITHOUT_REMAPPING
#include "the-darwin-kernel.h"
#include "internal/iprt.h"
@@ -48,9 +48,9 @@
#include "internal/magics.h"
-/*******************************************************************************
-* Defined Constants And Macros *
-*******************************************************************************/
+/*********************************************************************************************************************************
+* Defined Constants And Macros *
+*********************************************************************************************************************************/
/** @name fStateAndGen values
* @{ */
/** The state bit number. */
@@ -66,9 +66,9 @@
/** @} */
-/*******************************************************************************
-* Structures and Typedefs *
-*******************************************************************************/
+/*********************************************************************************************************************************
+* Structures and Typedefs *
+*********************************************************************************************************************************/
/**
* Darwin multiple release event semaphore.
*/
diff --git a/src/VBox/Runtime/r0drv/darwin/semfastmutex-r0drv-darwin.cpp b/src/VBox/Runtime/r0drv/darwin/semfastmutex-r0drv-darwin.cpp
index 6885f4b..a0a7a27 100644
--- a/src/VBox/Runtime/r0drv/darwin/semfastmutex-r0drv-darwin.cpp
+++ b/src/VBox/Runtime/r0drv/darwin/semfastmutex-r0drv-darwin.cpp
@@ -25,9 +25,9 @@
*/
-/*******************************************************************************
-* Header Files *
-*******************************************************************************/
+/*********************************************************************************************************************************
+* Header Files *
+*********************************************************************************************************************************/
#include "the-darwin-kernel.h"
#include "internal/iprt.h"
#include <iprt/semaphore.h>
@@ -45,9 +45,9 @@
#include "internal/magics.h"
-/*******************************************************************************
-* Structures and Typedefs *
-*******************************************************************************/
+/*********************************************************************************************************************************
+* Structures and Typedefs *
+*********************************************************************************************************************************/
/**
* Wrapper for the darwin semaphore structure.
*/
diff --git a/src/VBox/Runtime/r0drv/darwin/semmutex-r0drv-darwin.cpp b/src/VBox/Runtime/r0drv/darwin/semmutex-r0drv-darwin.cpp
index b9dffe7..c353577 100644
--- a/src/VBox/Runtime/r0drv/darwin/semmutex-r0drv-darwin.cpp
+++ b/src/VBox/Runtime/r0drv/darwin/semmutex-r0drv-darwin.cpp
@@ -25,9 +25,9 @@
*/
-/*******************************************************************************
-* Header Files *
-*******************************************************************************/
+/*********************************************************************************************************************************
+* Header Files *
+*********************************************************************************************************************************/
#define RTSEMMUTEX_WITHOUT_REMAPPING
#include "the-darwin-kernel.h"
#include "internal/iprt.h"
@@ -45,9 +45,9 @@
#include "internal/magics.h"
-/*******************************************************************************
-* Structures and Typedefs *
-*******************************************************************************/
+/*********************************************************************************************************************************
+* Structures and Typedefs *
+*********************************************************************************************************************************/
/**
* Darwin mutex semaphore.
*/
diff --git a/src/VBox/Runtime/r0drv/darwin/spinlock-r0drv-darwin.cpp b/src/VBox/Runtime/r0drv/darwin/spinlock-r0drv-darwin.cpp
index 1851f90..46f79de 100644
--- a/src/VBox/Runtime/r0drv/darwin/spinlock-r0drv-darwin.cpp
+++ b/src/VBox/Runtime/r0drv/darwin/spinlock-r0drv-darwin.cpp
@@ -25,9 +25,9 @@
*/
-/*******************************************************************************
-* Header Files *
-*******************************************************************************/
+/*********************************************************************************************************************************
+* Header Files *
+*********************************************************************************************************************************/
#include "the-darwin-kernel.h"
#include "internal/iprt.h"
#include <iprt/spinlock.h>
@@ -44,9 +44,9 @@
#include "internal/magics.h"
-/*******************************************************************************
-* Structures and Typedefs *
-*******************************************************************************/
+/*********************************************************************************************************************************
+* Structures and Typedefs *
+*********************************************************************************************************************************/
/**
* Wrapper for the KSPIN_LOCK type.
*/
diff --git a/src/VBox/Runtime/r0drv/darwin/thread-r0drv-darwin.cpp b/src/VBox/Runtime/r0drv/darwin/thread-r0drv-darwin.cpp
index 32ecb8e..8cbab20 100644
--- a/src/VBox/Runtime/r0drv/darwin/thread-r0drv-darwin.cpp
+++ b/src/VBox/Runtime/r0drv/darwin/thread-r0drv-darwin.cpp
@@ -25,9 +25,9 @@
*/
-/*******************************************************************************
-* Header Files *
-*******************************************************************************/
+/*********************************************************************************************************************************
+* Header Files *
+*********************************************************************************************************************************/
#include "the-darwin-kernel.h"
#include "internal/iprt.h"
#include <iprt/thread.h>
diff --git a/src/VBox/Runtime/r0drv/darwin/thread2-r0drv-darwin.cpp b/src/VBox/Runtime/r0drv/darwin/thread2-r0drv-darwin.cpp
index 8e8fe4b..ac5ce58 100644
--- a/src/VBox/Runtime/r0drv/darwin/thread2-r0drv-darwin.cpp
+++ b/src/VBox/Runtime/r0drv/darwin/thread2-r0drv-darwin.cpp
@@ -25,9 +25,9 @@
*/
-/*******************************************************************************
-* Header Files *
-*******************************************************************************/
+/*********************************************************************************************************************************
+* Header Files *
+*********************************************************************************************************************************/
#include "the-darwin-kernel.h"
#include "internal/iprt.h"
#include <iprt/thread.h>
diff --git a/src/VBox/Runtime/r0drv/darwin/threadpreempt-r0drv-darwin.cpp b/src/VBox/Runtime/r0drv/darwin/threadpreempt-r0drv-darwin.cpp
index aaadf7e..1c593b1 100644
--- a/src/VBox/Runtime/r0drv/darwin/threadpreempt-r0drv-darwin.cpp
+++ b/src/VBox/Runtime/r0drv/darwin/threadpreempt-r0drv-darwin.cpp
@@ -25,9 +25,9 @@
*/
-/*******************************************************************************
-* Header Files *
-*******************************************************************************/
+/*********************************************************************************************************************************
+* Header Files *
+*********************************************************************************************************************************/
#include "the-darwin-kernel.h"
#include "internal/iprt.h"
#include <iprt/thread.h>
@@ -41,9 +41,9 @@
#include <iprt/mp.h>
-/*******************************************************************************
-* Structures and Typedefs *
-*******************************************************************************/
+/*********************************************************************************************************************************
+* Structures and Typedefs *
+*********************************************************************************************************************************/
typedef struct RTDARWINPREEMPTHACK
{
/** The spinlock we exploit for disabling preemption. */
@@ -54,9 +54,9 @@ typedef struct RTDARWINPREEMPTHACK
typedef RTDARWINPREEMPTHACK *PRTDARWINPREEMPTHACK;
-/*******************************************************************************
-* Global Variables *
-*******************************************************************************/
+/*********************************************************************************************************************************
+* Global Variables *
+*********************************************************************************************************************************/
static RTDARWINPREEMPTHACK g_aPreemptHacks[RTCPUSET_MAX_CPUS];
diff --git a/src/VBox/Runtime/r0drv/darwin/time-r0drv-darwin.cpp b/src/VBox/Runtime/r0drv/darwin/time-r0drv-darwin.cpp
index bb09ba9..eb2527b 100644
--- a/src/VBox/Runtime/r0drv/darwin/time-r0drv-darwin.cpp
+++ b/src/VBox/Runtime/r0drv/darwin/time-r0drv-darwin.cpp
@@ -25,9 +25,9 @@
*/
-/*******************************************************************************
-* Header Files *
-*******************************************************************************/
+/*********************************************************************************************************************************
+* Header Files *
+*********************************************************************************************************************************/
#define LOG_GROUP RTLOGGROUP_TIME
#include "the-darwin-kernel.h"
#include "internal/iprt.h"
diff --git a/src/VBox/Runtime/r0drv/freebsd/alloc-r0drv-freebsd.c b/src/VBox/Runtime/r0drv/freebsd/alloc-r0drv-freebsd.c
index b6c3d23..60294ed 100644
--- a/src/VBox/Runtime/r0drv/freebsd/alloc-r0drv-freebsd.c
+++ b/src/VBox/Runtime/r0drv/freebsd/alloc-r0drv-freebsd.c
@@ -28,9 +28,10 @@
* OTHER DEALINGS IN THE SOFTWARE.
*/
-/*******************************************************************************
-* Header Files *
-*******************************************************************************/
+
+/*********************************************************************************************************************************
+* Header Files *
+*********************************************************************************************************************************/
#include "the-freebsd-kernel.h"
#include "internal/iprt.h"
#include <iprt/mem.h>
@@ -42,9 +43,9 @@
#include "r0drv/alloc-r0drv.h"
-/*******************************************************************************
-* Global Variables *
-*******************************************************************************/
+/*********************************************************************************************************************************
+* Global Variables *
+*********************************************************************************************************************************/
/* These two statements will define two globals and add initializers
and destructors that will be called at load/unload time (I think). */
MALLOC_DEFINE(M_IPRTHEAP, "iprtheap", "IPRT - heap");
diff --git a/src/VBox/Runtime/r0drv/freebsd/assert-r0drv-freebsd.c b/src/VBox/Runtime/r0drv/freebsd/assert-r0drv-freebsd.c
index e0e307e..b92198c 100644
--- a/src/VBox/Runtime/r0drv/freebsd/assert-r0drv-freebsd.c
+++ b/src/VBox/Runtime/r0drv/freebsd/assert-r0drv-freebsd.c
@@ -28,9 +28,10 @@
* OTHER DEALINGS IN THE SOFTWARE.
*/
-/*******************************************************************************
-* Header Files *
-*******************************************************************************/
+
+/*********************************************************************************************************************************
+* Header Files *
+*********************************************************************************************************************************/
#include "the-freebsd-kernel.h"
#include <iprt/assert.h>
diff --git a/src/VBox/Runtime/r0drv/freebsd/initterm-r0drv-freebsd.c b/src/VBox/Runtime/r0drv/freebsd/initterm-r0drv-freebsd.c
index 0992c47..9371459 100644
--- a/src/VBox/Runtime/r0drv/freebsd/initterm-r0drv-freebsd.c
+++ b/src/VBox/Runtime/r0drv/freebsd/initterm-r0drv-freebsd.c
@@ -28,9 +28,10 @@
* OTHER DEALINGS IN THE SOFTWARE.
*/
-/*******************************************************************************
-* Header Files *
-*******************************************************************************/
+
+/*********************************************************************************************************************************
+* Header Files *
+*********************************************************************************************************************************/
#include "the-freebsd-kernel.h"
#include <iprt/err.h>
diff --git a/src/VBox/Runtime/r0drv/freebsd/memobj-r0drv-freebsd.c b/src/VBox/Runtime/r0drv/freebsd/memobj-r0drv-freebsd.c
index 3fc3b9e..fc63e34 100644
--- a/src/VBox/Runtime/r0drv/freebsd/memobj-r0drv-freebsd.c
+++ b/src/VBox/Runtime/r0drv/freebsd/memobj-r0drv-freebsd.c
@@ -30,9 +30,9 @@
*/
-/*******************************************************************************
-* Header Files *
-*******************************************************************************/
+/*********************************************************************************************************************************
+* Header Files *
+*********************************************************************************************************************************/
#include "the-freebsd-kernel.h"
#include <iprt/memobj.h>
@@ -45,9 +45,9 @@
#include "internal/memobj.h"
-/*******************************************************************************
-* Structures and Typedefs *
-*******************************************************************************/
+/*********************************************************************************************************************************
+* Structures and Typedefs *
+*********************************************************************************************************************************/
/**
* The FreeBSD version of the memory object structure.
*/
diff --git a/src/VBox/Runtime/r0drv/freebsd/memuserkernel-r0drv-freebsd.c b/src/VBox/Runtime/r0drv/freebsd/memuserkernel-r0drv-freebsd.c
index 14fdba2..c0c8f84 100644
--- a/src/VBox/Runtime/r0drv/freebsd/memuserkernel-r0drv-freebsd.c
+++ b/src/VBox/Runtime/r0drv/freebsd/memuserkernel-r0drv-freebsd.c
@@ -25,9 +25,9 @@
*/
-/*******************************************************************************
-* Header Files *
-*******************************************************************************/
+/*********************************************************************************************************************************
+* Header Files *
+*********************************************************************************************************************************/
#include "the-freebsd-kernel.h"
#include <iprt/mem.h>
diff --git a/src/VBox/Runtime/r0drv/freebsd/mp-r0drv-freebsd.c b/src/VBox/Runtime/r0drv/freebsd/mp-r0drv-freebsd.c
index 2c02060..702e27e 100644
--- a/src/VBox/Runtime/r0drv/freebsd/mp-r0drv-freebsd.c
+++ b/src/VBox/Runtime/r0drv/freebsd/mp-r0drv-freebsd.c
@@ -25,9 +25,9 @@
*/
-/*******************************************************************************
-* Header Files *
-*******************************************************************************/
+/*********************************************************************************************************************************
+* Header Files *
+*********************************************************************************************************************************/
#include "the-freebsd-kernel.h"
#include <iprt/mp.h>
diff --git a/src/VBox/Runtime/r0drv/freebsd/process-r0drv-freebsd.c b/src/VBox/Runtime/r0drv/freebsd/process-r0drv-freebsd.c
index 96af287..02ecf25 100644
--- a/src/VBox/Runtime/r0drv/freebsd/process-r0drv-freebsd.c
+++ b/src/VBox/Runtime/r0drv/freebsd/process-r0drv-freebsd.c
@@ -28,9 +28,10 @@
* OTHER DEALINGS IN THE SOFTWARE.
*/
-/*******************************************************************************
-* Header Files *
-*******************************************************************************/
+
+/*********************************************************************************************************************************
+* Header Files *
+*********************************************************************************************************************************/
#include "the-freebsd-kernel.h"
#include <iprt/process.h>
diff --git a/src/VBox/Runtime/r0drv/freebsd/semevent-r0drv-freebsd.c b/src/VBox/Runtime/r0drv/freebsd/semevent-r0drv-freebsd.c
index b2a9a5c..f3635f9 100644
--- a/src/VBox/Runtime/r0drv/freebsd/semevent-r0drv-freebsd.c
+++ b/src/VBox/Runtime/r0drv/freebsd/semevent-r0drv-freebsd.c
@@ -28,9 +28,10 @@
* OTHER DEALINGS IN THE SOFTWARE.
*/
-/*******************************************************************************
-* Header Files *
-*******************************************************************************/
+
+/*********************************************************************************************************************************
+* Header Files *
+*********************************************************************************************************************************/
#define RTSEMEVENT_WITHOUT_REMAPPING
#include "the-freebsd-kernel.h"
#include "internal/iprt.h"
@@ -46,9 +47,9 @@
#include "internal/magics.h"
-/*******************************************************************************
-* Structures and Typedefs *
-*******************************************************************************/
+/*********************************************************************************************************************************
+* Structures and Typedefs *
+*********************************************************************************************************************************/
/**
* FreeBSD event semaphore.
*/
diff --git a/src/VBox/Runtime/r0drv/freebsd/semeventmulti-r0drv-freebsd.c b/src/VBox/Runtime/r0drv/freebsd/semeventmulti-r0drv-freebsd.c
index 253a5b0..1560904 100644
--- a/src/VBox/Runtime/r0drv/freebsd/semeventmulti-r0drv-freebsd.c
+++ b/src/VBox/Runtime/r0drv/freebsd/semeventmulti-r0drv-freebsd.c
@@ -28,9 +28,10 @@
* OTHER DEALINGS IN THE SOFTWARE.
*/
-/*******************************************************************************
-* Header Files *
-*******************************************************************************/
+
+/*********************************************************************************************************************************
+* Header Files *
+*********************************************************************************************************************************/
#define RTSEMEVENTMULTI_WITHOUT_REMAPPING
#include "the-freebsd-kernel.h"
#include "internal/iprt.h"
@@ -46,9 +47,9 @@
#include "internal/magics.h"
-/*******************************************************************************
-* Defined Constants And Macros *
-*******************************************************************************/
+/*********************************************************************************************************************************
+* Defined Constants And Macros *
+*********************************************************************************************************************************/
/** @name fStateAndGen values
* @{ */
/** The state bit number. */
@@ -63,9 +64,10 @@
#define RTSEMEVENTMULTIBSD_STATE_GEN_INIT UINT32_C(0xfffffffc)
/** @} */
-/*******************************************************************************
-* Structures and Typedefs *
-*******************************************************************************/
+
+/*********************************************************************************************************************************
+* Structures and Typedefs *
+*********************************************************************************************************************************/
/**
* FreeBSD multiple release event semaphore.
*/
diff --git a/src/VBox/Runtime/r0drv/freebsd/semfastmutex-r0drv-freebsd.c b/src/VBox/Runtime/r0drv/freebsd/semfastmutex-r0drv-freebsd.c
index 23d509a..d733950 100644
--- a/src/VBox/Runtime/r0drv/freebsd/semfastmutex-r0drv-freebsd.c
+++ b/src/VBox/Runtime/r0drv/freebsd/semfastmutex-r0drv-freebsd.c
@@ -28,9 +28,10 @@
* OTHER DEALINGS IN THE SOFTWARE.
*/
-/*******************************************************************************
-* Header Files *
-*******************************************************************************/
+
+/*********************************************************************************************************************************
+* Header Files *
+*********************************************************************************************************************************/
#include "the-freebsd-kernel.h"
#include <iprt/semaphore.h>
@@ -42,9 +43,9 @@
#include "internal/magics.h"
-/*******************************************************************************
-* Structures and Typedefs *
-*******************************************************************************/
+/*********************************************************************************************************************************
+* Structures and Typedefs *
+*********************************************************************************************************************************/
/**
* Wrapper for the FreeBSD (sleep) mutex.
*/
diff --git a/src/VBox/Runtime/r0drv/freebsd/semmutex-r0drv-freebsd.c b/src/VBox/Runtime/r0drv/freebsd/semmutex-r0drv-freebsd.c
index 014af73..c7432e3 100644
--- a/src/VBox/Runtime/r0drv/freebsd/semmutex-r0drv-freebsd.c
+++ b/src/VBox/Runtime/r0drv/freebsd/semmutex-r0drv-freebsd.c
@@ -25,9 +25,9 @@
*/
-/*******************************************************************************
-* Header Files *
-*******************************************************************************/
+/*********************************************************************************************************************************
+* Header Files *
+*********************************************************************************************************************************/
#define RTSEMMUTEX_WITHOUT_REMAPPING
#include "the-freebsd-kernel.h"
#include "internal/iprt.h"
@@ -43,9 +43,9 @@
#include "internal/magics.h"
-/*******************************************************************************
-* Structures and Typedefs *
-*******************************************************************************/
+/*********************************************************************************************************************************
+* Structures and Typedefs *
+*********************************************************************************************************************************/
/**
* Wrapper for the FreeBSD (sleep) mutex.
*/
diff --git a/src/VBox/Runtime/r0drv/freebsd/spinlock-r0drv-freebsd.c b/src/VBox/Runtime/r0drv/freebsd/spinlock-r0drv-freebsd.c
index d4d46d6..6e1e2c2 100644
--- a/src/VBox/Runtime/r0drv/freebsd/spinlock-r0drv-freebsd.c
+++ b/src/VBox/Runtime/r0drv/freebsd/spinlock-r0drv-freebsd.c
@@ -28,9 +28,10 @@
* OTHER DEALINGS IN THE SOFTWARE.
*/
-/*******************************************************************************
-* Header Files *
-*******************************************************************************/
+
+/*********************************************************************************************************************************
+* Header Files *
+*********************************************************************************************************************************/
#include "the-freebsd-kernel.h"
#include "internal/iprt.h"
@@ -46,9 +47,9 @@
#include "internal/magics.h"
-/*******************************************************************************
-* Structures and Typedefs *
-*******************************************************************************/
+/*********************************************************************************************************************************
+* Structures and Typedefs *
+*********************************************************************************************************************************/
/**
* Wrapper for the struct mtx type.
*/
diff --git a/src/VBox/Runtime/r0drv/freebsd/thread-r0drv-freebsd.c b/src/VBox/Runtime/r0drv/freebsd/thread-r0drv-freebsd.c
index bd0bfb7..aac0392 100644
--- a/src/VBox/Runtime/r0drv/freebsd/thread-r0drv-freebsd.c
+++ b/src/VBox/Runtime/r0drv/freebsd/thread-r0drv-freebsd.c
@@ -24,9 +24,10 @@
* terms and conditions of either the GPL or the CDDL or both.
*/
-/*******************************************************************************
-* Header Files *
-*******************************************************************************/
+
+/*********************************************************************************************************************************
+* Header Files *
+*********************************************************************************************************************************/
#include "the-freebsd-kernel.h"
#include "internal/iprt.h"
#include <iprt/thread.h>
diff --git a/src/VBox/Runtime/r0drv/freebsd/thread2-r0drv-freebsd.c b/src/VBox/Runtime/r0drv/freebsd/thread2-r0drv-freebsd.c
index 0515f02..669b584 100644
--- a/src/VBox/Runtime/r0drv/freebsd/thread2-r0drv-freebsd.c
+++ b/src/VBox/Runtime/r0drv/freebsd/thread2-r0drv-freebsd.c
@@ -28,9 +28,10 @@
* OTHER DEALINGS IN THE SOFTWARE.
*/
-/*******************************************************************************
-* Header Files *
-*******************************************************************************/
+
+/*********************************************************************************************************************************
+* Header Files *
+*********************************************************************************************************************************/
#include "the-freebsd-kernel.h"
#include <iprt/thread.h>
diff --git a/src/VBox/Runtime/r0drv/freebsd/time-r0drv-freebsd.c b/src/VBox/Runtime/r0drv/freebsd/time-r0drv-freebsd.c
index 5e6c8ae..2072044 100644
--- a/src/VBox/Runtime/r0drv/freebsd/time-r0drv-freebsd.c
+++ b/src/VBox/Runtime/r0drv/freebsd/time-r0drv-freebsd.c
@@ -29,9 +29,9 @@
*/
-/*******************************************************************************
-* Header Files *
-*******************************************************************************/
+/*********************************************************************************************************************************
+* Header Files *
+*********************************************************************************************************************************/
#include "the-freebsd-kernel.h"
#define RTTIME_INCL_TIMESPEC
diff --git a/src/VBox/Runtime/r0drv/freebsd/timer-r0drv-freebsd.c b/src/VBox/Runtime/r0drv/freebsd/timer-r0drv-freebsd.c
index 220a2d2..e104016 100644
--- a/src/VBox/Runtime/r0drv/freebsd/timer-r0drv-freebsd.c
+++ b/src/VBox/Runtime/r0drv/freebsd/timer-r0drv-freebsd.c
@@ -29,9 +29,9 @@
*/
-/*******************************************************************************
-* Header Files *
-*******************************************************************************/
+/*********************************************************************************************************************************
+* Header Files *
+*********************************************************************************************************************************/
#include "the-freebsd-kernel.h"
#include <iprt/timer.h>
@@ -45,9 +45,9 @@
#include "internal/magics.h"
-/*******************************************************************************
-* Structures and Typedefs *
-*******************************************************************************/
+/*********************************************************************************************************************************
+* Structures and Typedefs *
+*********************************************************************************************************************************/
/**
* The internal representation of an FreeBSD timer handle.
*/
@@ -82,9 +82,9 @@ typedef struct RTTIMER
} RTTIMER;
-/*******************************************************************************
-* Internal Functions *
-*******************************************************************************/
+/*********************************************************************************************************************************
+* Internal Functions *
+*********************************************************************************************************************************/
static void rtTimerFreeBSDCallback(void *pvTimer);
diff --git a/src/VBox/Runtime/r0drv/generic/RTMpIsCpuWorkPending-r0drv-generic.cpp b/src/VBox/Runtime/r0drv/generic/RTMpIsCpuWorkPending-r0drv-generic.cpp
index ac60340..49363f9 100644
--- a/src/VBox/Runtime/r0drv/generic/RTMpIsCpuWorkPending-r0drv-generic.cpp
+++ b/src/VBox/Runtime/r0drv/generic/RTMpIsCpuWorkPending-r0drv-generic.cpp
@@ -25,9 +25,9 @@
*/
-/*******************************************************************************
-* Header Files *
-*******************************************************************************/
+/*********************************************************************************************************************************
+* Header Files *
+*********************************************************************************************************************************/
#include <iprt/mp.h>
#include "internal/iprt.h"
diff --git a/src/VBox/Runtime/r0drv/generic/RTMpOn-r0drv-generic.cpp b/src/VBox/Runtime/r0drv/generic/RTMpOn-r0drv-generic.cpp
index 3df4d92..8170294 100644
--- a/src/VBox/Runtime/r0drv/generic/RTMpOn-r0drv-generic.cpp
+++ b/src/VBox/Runtime/r0drv/generic/RTMpOn-r0drv-generic.cpp
@@ -25,9 +25,9 @@
*/
-/*******************************************************************************
-* Header Files *
-*******************************************************************************/
+/*********************************************************************************************************************************
+* Header Files *
+*********************************************************************************************************************************/
#include <iprt/mp.h>
#include "internal/iprt.h"
diff --git a/src/VBox/Runtime/r0drv/generic/RTMpPokeCpu-r0drv-generic.cpp b/src/VBox/Runtime/r0drv/generic/RTMpPokeCpu-r0drv-generic.cpp
index d154c02..10c7532 100644
--- a/src/VBox/Runtime/r0drv/generic/RTMpPokeCpu-r0drv-generic.cpp
+++ b/src/VBox/Runtime/r0drv/generic/RTMpPokeCpu-r0drv-generic.cpp
@@ -25,9 +25,9 @@
*/
-/*******************************************************************************
-* Header Files *
-*******************************************************************************/
+/*********************************************************************************************************************************
+* Header Files *
+*********************************************************************************************************************************/
#include <iprt/mp.h>
#include "internal/iprt.h"
diff --git a/src/VBox/Runtime/r0drv/generic/RTThreadPreemptDisable-r0drv-generic.cpp b/src/VBox/Runtime/r0drv/generic/RTThreadPreemptDisable-r0drv-generic.cpp
index 9453a30..02f5509 100644
--- a/src/VBox/Runtime/r0drv/generic/RTThreadPreemptDisable-r0drv-generic.cpp
+++ b/src/VBox/Runtime/r0drv/generic/RTThreadPreemptDisable-r0drv-generic.cpp
@@ -25,9 +25,9 @@
*/
-/*******************************************************************************
-* Header Files *
-*******************************************************************************/
+/*********************************************************************************************************************************
+* Header Files *
+*********************************************************************************************************************************/
#include <iprt/thread.h>
#include "internal/iprt.h"
diff --git a/src/VBox/Runtime/r0drv/generic/RTThreadPreemptIsEnabled-r0drv-generic.cpp b/src/VBox/Runtime/r0drv/generic/RTThreadPreemptIsEnabled-r0drv-generic.cpp
index ab739f7..cdf3054 100644
--- a/src/VBox/Runtime/r0drv/generic/RTThreadPreemptIsEnabled-r0drv-generic.cpp
+++ b/src/VBox/Runtime/r0drv/generic/RTThreadPreemptIsEnabled-r0drv-generic.cpp
@@ -25,9 +25,9 @@
*/
-/*******************************************************************************
-* Header Files *
-*******************************************************************************/
+/*********************************************************************************************************************************
+* Header Files *
+*********************************************************************************************************************************/
#include <iprt/thread.h>
#include "internal/iprt.h"
diff --git a/src/VBox/Runtime/r0drv/generic/RTThreadPreemptIsPending-r0drv-generic.cpp b/src/VBox/Runtime/r0drv/generic/RTThreadPreemptIsPending-r0drv-generic.cpp
index 99ed223..75cff45 100644
--- a/src/VBox/Runtime/r0drv/generic/RTThreadPreemptIsPending-r0drv-generic.cpp
+++ b/src/VBox/Runtime/r0drv/generic/RTThreadPreemptIsPending-r0drv-generic.cpp
@@ -25,9 +25,9 @@
*/
-/*******************************************************************************
-* Header Files *
-*******************************************************************************/
+/*********************************************************************************************************************************
+* Header Files *
+*********************************************************************************************************************************/
#include <iprt/thread.h>
#include "internal/iprt.h"
diff --git a/src/VBox/Runtime/r0drv/generic/RTThreadPreemptIsPendingTrusty-r0drv-generic.cpp b/src/VBox/Runtime/r0drv/generic/RTThreadPreemptIsPendingTrusty-r0drv-generic.cpp
index cf7f3e2..43ad6c6 100644
--- a/src/VBox/Runtime/r0drv/generic/RTThreadPreemptIsPendingTrusty-r0drv-generic.cpp
+++ b/src/VBox/Runtime/r0drv/generic/RTThreadPreemptIsPendingTrusty-r0drv-generic.cpp
@@ -25,9 +25,9 @@
*/
-/*******************************************************************************
-* Header Files *
-*******************************************************************************/
+/*********************************************************************************************************************************
+* Header Files *
+*********************************************************************************************************************************/
#include <iprt/thread.h>
#include "internal/iprt.h"
diff --git a/src/VBox/Runtime/r0drv/generic/RTThreadPreemptRestore-r0drv-generic.cpp b/src/VBox/Runtime/r0drv/generic/RTThreadPreemptRestore-r0drv-generic.cpp
index 6d989b9..e3df2f3 100644
--- a/src/VBox/Runtime/r0drv/generic/RTThreadPreemptRestore-r0drv-generic.cpp
+++ b/src/VBox/Runtime/r0drv/generic/RTThreadPreemptRestore-r0drv-generic.cpp
@@ -25,9 +25,9 @@
*/
-/*******************************************************************************
-* Header Files *
-*******************************************************************************/
+/*********************************************************************************************************************************
+* Header Files *
+*********************************************************************************************************************************/
#include <iprt/thread.h>
#include "internal/iprt.h"
diff --git a/src/VBox/Runtime/r0drv/generic/mpnotification-r0drv-generic.cpp b/src/VBox/Runtime/r0drv/generic/mpnotification-r0drv-generic.cpp
index 5cc4126..118a30c 100644
--- a/src/VBox/Runtime/r0drv/generic/mpnotification-r0drv-generic.cpp
+++ b/src/VBox/Runtime/r0drv/generic/mpnotification-r0drv-generic.cpp
@@ -25,9 +25,9 @@
*/
-/*******************************************************************************
-* Header Files *
-*******************************************************************************/
+/*********************************************************************************************************************************
+* Header Files *
+*********************************************************************************************************************************/
#include <iprt/mp.h>
#include "internal/iprt.h"
diff --git a/src/VBox/Runtime/r0drv/generic/semspinmutex-r0drv-generic.c b/src/VBox/Runtime/r0drv/generic/semspinmutex-r0drv-generic.c
index f97a192..395fdcd 100644
--- a/src/VBox/Runtime/r0drv/generic/semspinmutex-r0drv-generic.c
+++ b/src/VBox/Runtime/r0drv/generic/semspinmutex-r0drv-generic.c
@@ -25,9 +25,9 @@
*/
-/*******************************************************************************
-* Header Files *
-*******************************************************************************/
+/*********************************************************************************************************************************
+* Header Files *
+*********************************************************************************************************************************/
#ifdef RT_OS_WINDOWS
# include "../nt/the-nt-kernel.h"
#endif
@@ -43,9 +43,9 @@
#include "internal/magics.h"
-/*******************************************************************************
-* Structures and Typedefs *
-*******************************************************************************/
+/*********************************************************************************************************************************
+* Structures and Typedefs *
+*********************************************************************************************************************************/
/**
* Saved state information.
*/
@@ -85,9 +85,9 @@ typedef struct RTSEMSPINMUTEXINTERNAL
} RTSEMSPINMUTEXINTERNAL;
-/*******************************************************************************
-* Defined Constants And Macros *
-*******************************************************************************/
+/*********************************************************************************************************************************
+* Defined Constants And Macros *
+*********************************************************************************************************************************/
/*#define RTSEMSPINMUTEX_INT_FLAGS_MUST*/
/** Validates the handle, returning if invalid. */
diff --git a/src/VBox/Runtime/r0drv/generic/threadctxhooks-r0drv-generic.cpp b/src/VBox/Runtime/r0drv/generic/threadctxhooks-r0drv-generic.cpp
index 4e625b5..61ffe5a 100644
--- a/src/VBox/Runtime/r0drv/generic/threadctxhooks-r0drv-generic.cpp
+++ b/src/VBox/Runtime/r0drv/generic/threadctxhooks-r0drv-generic.cpp
@@ -25,9 +25,9 @@
*/
-/*******************************************************************************
-* Header Files *
-*******************************************************************************/
+/*********************************************************************************************************************************
+* Header Files *
+*********************************************************************************************************************************/
#include <iprt/thread.h>
#include <iprt/err.h>
diff --git a/src/VBox/Runtime/r0drv/haiku/RTLogWriteDebugger-r0drv-haiku.c b/src/VBox/Runtime/r0drv/haiku/RTLogWriteDebugger-r0drv-haiku.c
index 0c0a98b..937f784 100644
--- a/src/VBox/Runtime/r0drv/haiku/RTLogWriteDebugger-r0drv-haiku.c
+++ b/src/VBox/Runtime/r0drv/haiku/RTLogWriteDebugger-r0drv-haiku.c
@@ -25,9 +25,9 @@
*/
-/*******************************************************************************
-* Header Files *
-*******************************************************************************/
+/*********************************************************************************************************************************
+* Header Files *
+*********************************************************************************************************************************/
#include "the-haiku-kernel.h"
#include "internal/iprt.h"
#include <iprt/log.h>
diff --git a/src/VBox/Runtime/r0drv/haiku/RTLogWriteStdOut-r0drv-haiku.c b/src/VBox/Runtime/r0drv/haiku/RTLogWriteStdOut-r0drv-haiku.c
index 0217865..0da9d89 100644
--- a/src/VBox/Runtime/r0drv/haiku/RTLogWriteStdOut-r0drv-haiku.c
+++ b/src/VBox/Runtime/r0drv/haiku/RTLogWriteStdOut-r0drv-haiku.c
@@ -25,9 +25,9 @@
*/
-/*******************************************************************************
-* Header Files *
-*******************************************************************************/
+/*********************************************************************************************************************************
+* Header Files *
+*********************************************************************************************************************************/
#include "the-haiku-kernel.h"
#include "internal/iprt.h"
#include <iprt/log.h>
diff --git a/src/VBox/Runtime/r0drv/haiku/alloc-r0drv-haiku.c b/src/VBox/Runtime/r0drv/haiku/alloc-r0drv-haiku.c
index 5eb8cca..344c1db 100644
--- a/src/VBox/Runtime/r0drv/haiku/alloc-r0drv-haiku.c
+++ b/src/VBox/Runtime/r0drv/haiku/alloc-r0drv-haiku.c
@@ -25,9 +25,9 @@
*/
-/*******************************************************************************
-* Header Files *
-*******************************************************************************/
+/*********************************************************************************************************************************
+* Header Files *
+*********************************************************************************************************************************/
#include "the-haiku-kernel.h"
#include "internal/iprt.h"
#include <iprt/mem.h>
@@ -73,7 +73,7 @@ void rtR0MemFree(PRTMEMHDR pHdr)
}
-RTR0DECL(void *) RTMemContAlloc(PRTCCPHYS pPhys, size_t cb) RT_NO_THROW
+RTR0DECL(void *) RTMemContAlloc(PRTCCPHYS pPhys, size_t cb) RT_NO_THROW_DEF
{
/*
* Validate input.
@@ -107,7 +107,7 @@ RTR0DECL(void *) RTMemContAlloc(PRTCCPHYS pPhys, size_t cb) RT_NO_THROW
}
-RTR0DECL(void) RTMemContFree(void *pv, size_t cb) RT_NO_THROW
+RTR0DECL(void) RTMemContFree(void *pv, size_t cb) RT_NO_THROW_DEF
{
RT_ASSERT_PREEMPTIBLE();
if (pv)
diff --git a/src/VBox/Runtime/r0drv/haiku/assert-r0drv-haiku.c b/src/VBox/Runtime/r0drv/haiku/assert-r0drv-haiku.c
index 0e0f2d3..4b05960 100644
--- a/src/VBox/Runtime/r0drv/haiku/assert-r0drv-haiku.c
+++ b/src/VBox/Runtime/r0drv/haiku/assert-r0drv-haiku.c
@@ -25,9 +25,9 @@
*/
-/*******************************************************************************
-* Header Files *
-*******************************************************************************/
+/*********************************************************************************************************************************
+* Header Files *
+*********************************************************************************************************************************/
#include "the-haiku-kernel.h"
#include "internal/iprt.h"
#include <iprt/assert.h>
diff --git a/src/VBox/Runtime/r0drv/haiku/initterm-r0drv-haiku.c b/src/VBox/Runtime/r0drv/haiku/initterm-r0drv-haiku.c
index d11e29c..83369c1 100644
--- a/src/VBox/Runtime/r0drv/haiku/initterm-r0drv-haiku.c
+++ b/src/VBox/Runtime/r0drv/haiku/initterm-r0drv-haiku.c
@@ -25,9 +25,9 @@
*/
-/*******************************************************************************
-* Header Files *
-*******************************************************************************/
+/*********************************************************************************************************************************
+* Header Files *
+*********************************************************************************************************************************/
#include "the-haiku-kernel.h"
#include "internal/iprt.h"
diff --git a/src/VBox/Runtime/r0drv/haiku/memobj-r0drv-haiku.c b/src/VBox/Runtime/r0drv/haiku/memobj-r0drv-haiku.c
index 5c3a358..9c56eae 100644
--- a/src/VBox/Runtime/r0drv/haiku/memobj-r0drv-haiku.c
+++ b/src/VBox/Runtime/r0drv/haiku/memobj-r0drv-haiku.c
@@ -25,9 +25,9 @@
*/
-/*******************************************************************************
-* Header Files *
-*******************************************************************************/
+/*********************************************************************************************************************************
+* Header Files *
+*********************************************************************************************************************************/
#include "the-haiku-kernel.h"
#include <iprt/memobj.h>
@@ -39,9 +39,10 @@
#include <iprt/process.h>
#include "internal/memobj.h"
-/*******************************************************************************
-* Structures and Typedefs *
-*******************************************************************************/
+
+/*********************************************************************************************************************************
+* Structures and Typedefs *
+*********************************************************************************************************************************/
/**
* The Haiku version of the memory object structure.
*/
diff --git a/src/VBox/Runtime/r0drv/haiku/mp-r0drv-haiku.c b/src/VBox/Runtime/r0drv/haiku/mp-r0drv-haiku.c
index 81930b0..cbdf1f1 100644
--- a/src/VBox/Runtime/r0drv/haiku/mp-r0drv-haiku.c
+++ b/src/VBox/Runtime/r0drv/haiku/mp-r0drv-haiku.c
@@ -25,9 +25,9 @@
*/
-/*******************************************************************************
-* Header Files *
-*******************************************************************************/
+/*********************************************************************************************************************************
+* Header Files *
+*********************************************************************************************************************************/
#include "the-haiku-kernel.h"
#include <iprt/mp.h>
diff --git a/src/VBox/Runtime/r0drv/haiku/process-r0drv-haiku.c b/src/VBox/Runtime/r0drv/haiku/process-r0drv-haiku.c
index 02c2a05..fc64f25 100644
--- a/src/VBox/Runtime/r0drv/haiku/process-r0drv-haiku.c
+++ b/src/VBox/Runtime/r0drv/haiku/process-r0drv-haiku.c
@@ -25,9 +25,9 @@
*/
-/*******************************************************************************
-* Header Files *
-*******************************************************************************/
+/*********************************************************************************************************************************
+* Header Files *
+*********************************************************************************************************************************/
#include "the-haiku-kernel.h"
#include "internal/iprt.h"
#include <iprt/process.h>
diff --git a/src/VBox/Runtime/r0drv/haiku/semevent-r0drv-haiku.c b/src/VBox/Runtime/r0drv/haiku/semevent-r0drv-haiku.c
index 4e964fa..f125d8f 100644
--- a/src/VBox/Runtime/r0drv/haiku/semevent-r0drv-haiku.c
+++ b/src/VBox/Runtime/r0drv/haiku/semevent-r0drv-haiku.c
@@ -25,9 +25,9 @@
*/
-/*******************************************************************************
-* Header Files *
-*******************************************************************************/
+/*********************************************************************************************************************************
+* Header Files *
+*********************************************************************************************************************************/
#include "the-haiku-kernel.h"
#include "internal/iprt.h"
#include <iprt/semaphore.h>
@@ -41,9 +41,9 @@
#include "internal/magics.h"
-/*******************************************************************************
-* Structures and Typedefs *
-*******************************************************************************/
+/*********************************************************************************************************************************
+* Structures and Typedefs *
+*********************************************************************************************************************************/
/**
* Haiku event semaphore.
*/
diff --git a/src/VBox/Runtime/r0drv/haiku/semeventmulti-r0drv-haiku.c b/src/VBox/Runtime/r0drv/haiku/semeventmulti-r0drv-haiku.c
index 543109c..fa99877 100644
--- a/src/VBox/Runtime/r0drv/haiku/semeventmulti-r0drv-haiku.c
+++ b/src/VBox/Runtime/r0drv/haiku/semeventmulti-r0drv-haiku.c
@@ -24,9 +24,10 @@
* terms and conditions of either the GPL or the CDDL or both.
*/
-/*******************************************************************************
-* Header Files *
-*******************************************************************************/
+
+/*********************************************************************************************************************************
+* Header Files *
+*********************************************************************************************************************************/
#include "the-haiku-kernel.h"
#include "internal/iprt.h"
#include <iprt/semaphore.h>
@@ -40,9 +41,9 @@
#include "internal/magics.h"
-/*******************************************************************************
-* Structures and Typedefs *
-*******************************************************************************/
+/*********************************************************************************************************************************
+* Structures and Typedefs *
+*********************************************************************************************************************************/
/**
* Haiku multiple release event semaphore.
*/
diff --git a/src/VBox/Runtime/r0drv/haiku/semfastmutex-r0drv-haiku.c b/src/VBox/Runtime/r0drv/haiku/semfastmutex-r0drv-haiku.c
index 06192e8..b7682ef 100644
--- a/src/VBox/Runtime/r0drv/haiku/semfastmutex-r0drv-haiku.c
+++ b/src/VBox/Runtime/r0drv/haiku/semfastmutex-r0drv-haiku.c
@@ -25,9 +25,9 @@
*/
-/*******************************************************************************
-* Header Files *
-*******************************************************************************/
+/*********************************************************************************************************************************
+* Header Files *
+*********************************************************************************************************************************/
#include "the-haiku-kernel.h"
#include <iprt/semaphore.h>
@@ -39,9 +39,9 @@
#include "internal/magics.h"
-/*******************************************************************************
-* Structures and Typedefs *
-*******************************************************************************/
+/*********************************************************************************************************************************
+* Structures and Typedefs *
+*********************************************************************************************************************************/
/**
* Wrapper for the Haiku (sleep) mutex.
*/
diff --git a/src/VBox/Runtime/r0drv/haiku/semmutex-r0drv-haiku.c b/src/VBox/Runtime/r0drv/haiku/semmutex-r0drv-haiku.c
index f11d189..8e75bca 100644
--- a/src/VBox/Runtime/r0drv/haiku/semmutex-r0drv-haiku.c
+++ b/src/VBox/Runtime/r0drv/haiku/semmutex-r0drv-haiku.c
@@ -25,9 +25,9 @@
*/
-/*******************************************************************************
-* Header Files *
-*******************************************************************************/
+/*********************************************************************************************************************************
+* Header Files *
+*********************************************************************************************************************************/
#include "the-haiku-kernel.h"
#include "internal/iprt.h"
#include <iprt/semaphore.h>
@@ -42,9 +42,9 @@
#include "internal/magics.h"
-/*******************************************************************************
-* Structures and Typedefs *
-*******************************************************************************/
+/*********************************************************************************************************************************
+* Structures and Typedefs *
+*********************************************************************************************************************************/
/**
* Wrapper for the Haiku (sleep) mutex.
*/
diff --git a/src/VBox/Runtime/r0drv/haiku/spinlock-r0drv-haiku.c b/src/VBox/Runtime/r0drv/haiku/spinlock-r0drv-haiku.c
index f2fa7c3..589b3b5 100644
--- a/src/VBox/Runtime/r0drv/haiku/spinlock-r0drv-haiku.c
+++ b/src/VBox/Runtime/r0drv/haiku/spinlock-r0drv-haiku.c
@@ -25,9 +25,9 @@
*/
-/*******************************************************************************
-* Header Files *
-*******************************************************************************/
+/*********************************************************************************************************************************
+* Header Files *
+*********************************************************************************************************************************/
#include "the-haiku-kernel.h"
#include "internal/iprt.h"
#include <iprt/spinlock.h>
@@ -44,9 +44,9 @@
#include "internal/magics.h"
-/*******************************************************************************
-* Structures and Typedefs *
-*******************************************************************************/
+/*********************************************************************************************************************************
+* Structures and Typedefs *
+*********************************************************************************************************************************/
/**
* Wrapper for the KSPIN_LOCK type.
*/
diff --git a/src/VBox/Runtime/r0drv/haiku/thread-r0drv-haiku.c b/src/VBox/Runtime/r0drv/haiku/thread-r0drv-haiku.c
index 7f1fe5a..a164241 100644
--- a/src/VBox/Runtime/r0drv/haiku/thread-r0drv-haiku.c
+++ b/src/VBox/Runtime/r0drv/haiku/thread-r0drv-haiku.c
@@ -25,9 +25,9 @@
*/
-/*******************************************************************************
-* Header Files *
-*******************************************************************************/
+/*********************************************************************************************************************************
+* Header Files *
+*********************************************************************************************************************************/
#include "the-haiku-kernel.h"
#include "internal/iprt.h"
#include <iprt/thread.h>
diff --git a/src/VBox/Runtime/r0drv/haiku/thread2-r0drv-haiku.c b/src/VBox/Runtime/r0drv/haiku/thread2-r0drv-haiku.c
index 7a7bad3..092f245 100644
--- a/src/VBox/Runtime/r0drv/haiku/thread2-r0drv-haiku.c
+++ b/src/VBox/Runtime/r0drv/haiku/thread2-r0drv-haiku.c
@@ -25,9 +25,9 @@
*/
-/*******************************************************************************
-* Header Files *
-*******************************************************************************/
+/*********************************************************************************************************************************
+* Header Files *
+*********************************************************************************************************************************/
#include "the-haiku-kernel.h"
#include "internal/iprt.h"
#include <iprt/thread.h>
diff --git a/src/VBox/Runtime/r0drv/haiku/time-r0drv-haiku.c b/src/VBox/Runtime/r0drv/haiku/time-r0drv-haiku.c
index 64418c3..6c68386 100644
--- a/src/VBox/Runtime/r0drv/haiku/time-r0drv-haiku.c
+++ b/src/VBox/Runtime/r0drv/haiku/time-r0drv-haiku.c
@@ -25,9 +25,9 @@
*/
-/*******************************************************************************
-* Header Files *
-*******************************************************************************/
+/*********************************************************************************************************************************
+* Header Files *
+*********************************************************************************************************************************/
#define LOG_GROUP RTLOGGROUP_TIME
#include "the-haiku-kernel.h"
#include "internal/iprt.h"
diff --git a/src/VBox/Runtime/r0drv/initterm-r0drv.cpp b/src/VBox/Runtime/r0drv/initterm-r0drv.cpp
index 8fd1102..f01d980 100644
--- a/src/VBox/Runtime/r0drv/initterm-r0drv.cpp
+++ b/src/VBox/Runtime/r0drv/initterm-r0drv.cpp
@@ -25,9 +25,9 @@
*/
-/*******************************************************************************
-* Header Files *
-*******************************************************************************/
+/*********************************************************************************************************************************
+* Header Files *
+*********************************************************************************************************************************/
#include <iprt/initterm.h>
#include "internal/iprt.h"
@@ -45,9 +45,9 @@
#include "internal/thread.h"
-/*******************************************************************************
-* Global Variables *
-*******************************************************************************/
+/*********************************************************************************************************************************
+* Global Variables *
+*********************************************************************************************************************************/
/** Count of current IPRT users.
* In ring-0 several drivers / kmods / kexts / wossnames may share the
* same runtime code. So, we need to keep count in order not to terminate
diff --git a/src/VBox/Runtime/r0drv/linux/RTLogWriteDebugger-r0drv-linux.c b/src/VBox/Runtime/r0drv/linux/RTLogWriteDebugger-r0drv-linux.c
index 27e1f08..79aa6ab 100644
--- a/src/VBox/Runtime/r0drv/linux/RTLogWriteDebugger-r0drv-linux.c
+++ b/src/VBox/Runtime/r0drv/linux/RTLogWriteDebugger-r0drv-linux.c
@@ -25,9 +25,9 @@
*/
-/*******************************************************************************
-* Header Files *
-*******************************************************************************/
+/*********************************************************************************************************************************
+* Header Files *
+*********************************************************************************************************************************/
#include "the-linux-kernel.h"
#include "internal/iprt.h"
#include <iprt/log.h>
diff --git a/src/VBox/Runtime/r0drv/linux/alloc-r0drv-linux.c b/src/VBox/Runtime/r0drv/linux/alloc-r0drv-linux.c
index c03e2ca..0451e7b 100644
--- a/src/VBox/Runtime/r0drv/linux/alloc-r0drv-linux.c
+++ b/src/VBox/Runtime/r0drv/linux/alloc-r0drv-linux.c
@@ -25,9 +25,9 @@
*/
-/*******************************************************************************
-* Header Files *
-*******************************************************************************/
+/*********************************************************************************************************************************
+* Header Files *
+*********************************************************************************************************************************/
#include "the-linux-kernel.h"
#include "internal/iprt.h"
#include <iprt/mem.h>
@@ -63,9 +63,9 @@
#endif
-/*******************************************************************************
-* Structures and Typedefs *
-*******************************************************************************/
+/*********************************************************************************************************************************
+* Structures and Typedefs *
+*********************************************************************************************************************************/
#ifdef RTMEMALLOC_EXEC_VM_AREA
/**
* Extended header used for headers marked with RTMEMHDR_FLAG_EXEC_VM_AREA.
@@ -87,9 +87,9 @@ typedef RTMEMLNXHDREX *PRTMEMLNXHDREX;
#endif
-/*******************************************************************************
-* Global Variables *
-*******************************************************************************/
+/*********************************************************************************************************************************
+* Global Variables *
+*********************************************************************************************************************************/
#ifdef RTMEMALLOC_EXEC_HEAP
/** The heap. */
static RTHEAPSIMPLE g_HeapExec = NIL_RTHEAPSIMPLE;
diff --git a/src/VBox/Runtime/r0drv/linux/assert-r0drv-linux.c b/src/VBox/Runtime/r0drv/linux/assert-r0drv-linux.c
index 593a1ba..84be7e5 100644
--- a/src/VBox/Runtime/r0drv/linux/assert-r0drv-linux.c
+++ b/src/VBox/Runtime/r0drv/linux/assert-r0drv-linux.c
@@ -25,9 +25,9 @@
*/
-/*******************************************************************************
-* Header Files *
-*******************************************************************************/
+/*********************************************************************************************************************************
+* Header Files *
+*********************************************************************************************************************************/
#include "the-linux-kernel.h"
#include "internal/iprt.h"
diff --git a/src/VBox/Runtime/r0drv/linux/initterm-r0drv-linux.c b/src/VBox/Runtime/r0drv/linux/initterm-r0drv-linux.c
index 9153b87..ef3627b 100644
--- a/src/VBox/Runtime/r0drv/linux/initterm-r0drv-linux.c
+++ b/src/VBox/Runtime/r0drv/linux/initterm-r0drv-linux.c
@@ -25,9 +25,9 @@
*/
-/*******************************************************************************
-* Header Files *
-*******************************************************************************/
+/*********************************************************************************************************************************
+* Header Files *
+*********************************************************************************************************************************/
#include "the-linux-kernel.h"
#include "internal/iprt.h"
#include <iprt/err.h>
@@ -35,9 +35,9 @@
#include "internal/initterm.h"
-/*******************************************************************************
-* Global Variables *
-*******************************************************************************/
+/*********************************************************************************************************************************
+* Global Variables *
+*********************************************************************************************************************************/
/** The IPRT work queue. */
#if LINUX_VERSION_CODE >= KERNEL_VERSION(2, 5, 41)
static struct workqueue_struct *g_prtR0LnxWorkQueue;
@@ -46,9 +46,9 @@ static DECLARE_TASK_QUEUE(g_rtR0LnxWorkQueue);
#endif
-/*******************************************************************************
-* Internal Functions *
-*******************************************************************************/
+/*********************************************************************************************************************************
+* Internal Functions *
+*********************************************************************************************************************************/
/* in alloc-r0drv0-linux.c */
DECLHIDDEN(void) rtR0MemExecCleanup(void);
diff --git a/src/VBox/Runtime/r0drv/linux/memobj-r0drv-linux.c b/src/VBox/Runtime/r0drv/linux/memobj-r0drv-linux.c
index f4de91a..5be48dc 100644
--- a/src/VBox/Runtime/r0drv/linux/memobj-r0drv-linux.c
+++ b/src/VBox/Runtime/r0drv/linux/memobj-r0drv-linux.c
@@ -25,9 +25,9 @@
*/
-/*******************************************************************************
-* Header Files *
-*******************************************************************************/
+/*********************************************************************************************************************************
+* Header Files *
+*********************************************************************************************************************************/
#include "the-linux-kernel.h"
#include <iprt/memobj.h>
@@ -39,9 +39,9 @@
#include "internal/memobj.h"
-/*******************************************************************************
-* Defined Constants And Macros *
-*******************************************************************************/
+/*********************************************************************************************************************************
+* Defined Constants And Macros *
+*********************************************************************************************************************************/
/* early 2.6 kernels */
#ifndef PAGE_SHARED_EXEC
# define PAGE_SHARED_EXEC PAGE_SHARED
@@ -66,9 +66,9 @@
#endif
-/*******************************************************************************
-* Structures and Typedefs *
-*******************************************************************************/
+/*********************************************************************************************************************************
+* Structures and Typedefs *
+*********************************************************************************************************************************/
/**
* The Darwin version of the memory object structure.
*/
diff --git a/src/VBox/Runtime/r0drv/linux/memuserkernel-r0drv-linux.c b/src/VBox/Runtime/r0drv/linux/memuserkernel-r0drv-linux.c
index 2c3214c..3532724 100644
--- a/src/VBox/Runtime/r0drv/linux/memuserkernel-r0drv-linux.c
+++ b/src/VBox/Runtime/r0drv/linux/memuserkernel-r0drv-linux.c
@@ -25,9 +25,9 @@
*/
-/*******************************************************************************
-* Header Files *
-*******************************************************************************/
+/*********************************************************************************************************************************
+* Header Files *
+*********************************************************************************************************************************/
#include "the-linux-kernel.h"
#include "internal/iprt.h"
diff --git a/src/VBox/Runtime/r0drv/linux/mp-r0drv-linux.c b/src/VBox/Runtime/r0drv/linux/mp-r0drv-linux.c
index 117dd05..8bd8b1a 100644
--- a/src/VBox/Runtime/r0drv/linux/mp-r0drv-linux.c
+++ b/src/VBox/Runtime/r0drv/linux/mp-r0drv-linux.c
@@ -25,9 +25,9 @@
*/
-/*******************************************************************************
-* Header Files *
-*******************************************************************************/
+/*********************************************************************************************************************************
+* Header Files *
+*********************************************************************************************************************************/
#include "the-linux-kernel.h"
#include "internal/iprt.h"
diff --git a/src/VBox/Runtime/r0drv/linux/mpnotification-r0drv-linux.c b/src/VBox/Runtime/r0drv/linux/mpnotification-r0drv-linux.c
index daaad7d..4b2eb21 100644
--- a/src/VBox/Runtime/r0drv/linux/mpnotification-r0drv-linux.c
+++ b/src/VBox/Runtime/r0drv/linux/mpnotification-r0drv-linux.c
@@ -25,9 +25,9 @@
*/
-/*******************************************************************************
-* Header Files *
-*******************************************************************************/
+/*********************************************************************************************************************************
+* Header Files *
+*********************************************************************************************************************************/
#include "the-linux-kernel.h"
#include "internal/iprt.h"
@@ -40,15 +40,16 @@
#if LINUX_VERSION_CODE >= KERNEL_VERSION(2, 5, 71) && defined(CONFIG_SMP)
-/*******************************************************************************
-* Internal Functions *
-*******************************************************************************/
+
+/*********************************************************************************************************************************
+* Internal Functions *
+*********************************************************************************************************************************/
static int rtMpNotificationLinuxCallback(struct notifier_block *pNotifierBlock, unsigned long ulNativeEvent, void *pvCpu);
-/*******************************************************************************
-* Global Variables *
-*******************************************************************************/
+/*********************************************************************************************************************************
+* Global Variables *
+*********************************************************************************************************************************/
/**
* The notifier block we use for registering the callback.
*/
diff --git a/src/VBox/Runtime/r0drv/linux/process-r0drv-linux.c b/src/VBox/Runtime/r0drv/linux/process-r0drv-linux.c
index 44d3d7f..b04ac1a 100644
--- a/src/VBox/Runtime/r0drv/linux/process-r0drv-linux.c
+++ b/src/VBox/Runtime/r0drv/linux/process-r0drv-linux.c
@@ -25,9 +25,9 @@
*/
-/*******************************************************************************
-* Header Files *
-*******************************************************************************/
+/*********************************************************************************************************************************
+* Header Files *
+*********************************************************************************************************************************/
#include "the-linux-kernel.h"
#include "internal/iprt.h"
diff --git a/src/VBox/Runtime/r0drv/linux/semevent-r0drv-linux.c b/src/VBox/Runtime/r0drv/linux/semevent-r0drv-linux.c
index e3b4447..ab27087 100644
--- a/src/VBox/Runtime/r0drv/linux/semevent-r0drv-linux.c
+++ b/src/VBox/Runtime/r0drv/linux/semevent-r0drv-linux.c
@@ -25,9 +25,9 @@
*/
-/*******************************************************************************
-* Header Files *
-*******************************************************************************/
+/*********************************************************************************************************************************
+* Header Files *
+*********************************************************************************************************************************/
#define RTSEMEVENT_WITHOUT_REMAPPING
#include "the-linux-kernel.h"
#include "internal/iprt.h"
@@ -43,9 +43,9 @@
#include "internal/magics.h"
-/*******************************************************************************
-* Structures and Typedefs *
-*******************************************************************************/
+/*********************************************************************************************************************************
+* Structures and Typedefs *
+*********************************************************************************************************************************/
/**
* Linux event semaphore.
*/
diff --git a/src/VBox/Runtime/r0drv/linux/semeventmulti-r0drv-linux.c b/src/VBox/Runtime/r0drv/linux/semeventmulti-r0drv-linux.c
index a0b290a..d46ded0 100644
--- a/src/VBox/Runtime/r0drv/linux/semeventmulti-r0drv-linux.c
+++ b/src/VBox/Runtime/r0drv/linux/semeventmulti-r0drv-linux.c
@@ -25,9 +25,9 @@
*/
-/*******************************************************************************
-* Header Files *
-*******************************************************************************/
+/*********************************************************************************************************************************
+* Header Files *
+*********************************************************************************************************************************/
#define RTSEMEVENTMULTI_WITHOUT_REMAPPING
#include "the-linux-kernel.h"
#include "internal/iprt.h"
@@ -43,9 +43,9 @@
#include "internal/magics.h"
-/*******************************************************************************
-* Defined Constants And Macros *
-*******************************************************************************/
+/*********************************************************************************************************************************
+* Defined Constants And Macros *
+*********************************************************************************************************************************/
/** @name fStateAndGen values
* @{ */
/** The state bit number. */
@@ -61,9 +61,9 @@
/** @} */
-/*******************************************************************************
-* Structures and Typedefs *
-*******************************************************************************/
+/*********************************************************************************************************************************
+* Structures and Typedefs *
+*********************************************************************************************************************************/
/**
* Linux event semaphore.
*/
diff --git a/src/VBox/Runtime/r0drv/linux/semfastmutex-r0drv-linux.c b/src/VBox/Runtime/r0drv/linux/semfastmutex-r0drv-linux.c
index a94f6d9..b437151 100644
--- a/src/VBox/Runtime/r0drv/linux/semfastmutex-r0drv-linux.c
+++ b/src/VBox/Runtime/r0drv/linux/semfastmutex-r0drv-linux.c
@@ -25,9 +25,9 @@
*/
-/*******************************************************************************
-* Header Files *
-*******************************************************************************/
+/*********************************************************************************************************************************
+* Header Files *
+*********************************************************************************************************************************/
#include "the-linux-kernel.h"
#include "internal/iprt.h"
#include <iprt/semaphore.h>
@@ -42,9 +42,9 @@
#include "internal/magics.h"
-/*******************************************************************************
-* Structures and Typedefs *
-*******************************************************************************/
+/*********************************************************************************************************************************
+* Structures and Typedefs *
+*********************************************************************************************************************************/
/**
* Wrapper for the linux semaphore structure.
*/
diff --git a/src/VBox/Runtime/r0drv/linux/semmutex-r0drv-linux.c b/src/VBox/Runtime/r0drv/linux/semmutex-r0drv-linux.c
index 1e66988..135f45c 100644
--- a/src/VBox/Runtime/r0drv/linux/semmutex-r0drv-linux.c
+++ b/src/VBox/Runtime/r0drv/linux/semmutex-r0drv-linux.c
@@ -25,9 +25,9 @@
*/
-/*******************************************************************************
-* Header Files *
-*******************************************************************************/
+/*********************************************************************************************************************************
+* Header Files *
+*********************************************************************************************************************************/
#define RTSEMMUTEX_WITHOUT_REMAPPING
#include "the-linux-kernel.h"
#include "internal/iprt.h"
@@ -42,9 +42,9 @@
#include "internal/magics.h"
-/*******************************************************************************
-* Structures and Typedefs *
-*******************************************************************************/
+/*********************************************************************************************************************************
+* Structures and Typedefs *
+*********************************************************************************************************************************/
typedef struct RTSEMMUTEXLNXWAITER
{
/** The list entry. */
diff --git a/src/VBox/Runtime/r0drv/linux/spinlock-r0drv-linux.c b/src/VBox/Runtime/r0drv/linux/spinlock-r0drv-linux.c
index c81c33f..b6ae5d4 100644
--- a/src/VBox/Runtime/r0drv/linux/spinlock-r0drv-linux.c
+++ b/src/VBox/Runtime/r0drv/linux/spinlock-r0drv-linux.c
@@ -25,9 +25,9 @@
*/
-/*******************************************************************************
-* Header Files *
-*******************************************************************************/
+/*********************************************************************************************************************************
+* Header Files *
+*********************************************************************************************************************************/
#include "the-linux-kernel.h"
#include "internal/iprt.h"
#include <iprt/spinlock.h>
@@ -44,9 +44,9 @@
#include "internal/magics.h"
-/*******************************************************************************
-* Structures and Typedefs *
-*******************************************************************************/
+/*********************************************************************************************************************************
+* Structures and Typedefs *
+*********************************************************************************************************************************/
/**
* Wrapper for the spinlock_t structure.
*/
diff --git a/src/VBox/Runtime/r0drv/linux/thread-r0drv-linux.c b/src/VBox/Runtime/r0drv/linux/thread-r0drv-linux.c
index b5c6bba..b55541d 100644
--- a/src/VBox/Runtime/r0drv/linux/thread-r0drv-linux.c
+++ b/src/VBox/Runtime/r0drv/linux/thread-r0drv-linux.c
@@ -25,9 +25,9 @@
*/
-/*******************************************************************************
-* Header Files *
-*******************************************************************************/
+/*********************************************************************************************************************************
+* Header Files *
+*********************************************************************************************************************************/
#include "the-linux-kernel.h"
#include "internal/iprt.h"
#include <iprt/thread.h>
@@ -41,9 +41,9 @@
#include <iprt/mp.h>
-/*******************************************************************************
-* Global Variables *
-*******************************************************************************/
+/*********************************************************************************************************************************
+* Global Variables *
+*********************************************************************************************************************************/
#ifndef CONFIG_PREEMPT
/** Per-cpu preemption counters. */
static int32_t volatile g_acPreemptDisabled[NR_CPUS];
diff --git a/src/VBox/Runtime/r0drv/linux/thread2-r0drv-linux.c b/src/VBox/Runtime/r0drv/linux/thread2-r0drv-linux.c
index c40c3aa..ed5dfa6 100644
--- a/src/VBox/Runtime/r0drv/linux/thread2-r0drv-linux.c
+++ b/src/VBox/Runtime/r0drv/linux/thread2-r0drv-linux.c
@@ -25,9 +25,9 @@
*/
-/*******************************************************************************
-* Header Files *
-*******************************************************************************/
+/*********************************************************************************************************************************
+* Header Files *
+*********************************************************************************************************************************/
#include "the-linux-kernel.h"
#include "internal/iprt.h"
diff --git a/src/VBox/Runtime/r0drv/linux/threadctxhooks-r0drv-linux.c b/src/VBox/Runtime/r0drv/linux/threadctxhooks-r0drv-linux.c
index 073fe1c..61a84bb 100644
--- a/src/VBox/Runtime/r0drv/linux/threadctxhooks-r0drv-linux.c
+++ b/src/VBox/Runtime/r0drv/linux/threadctxhooks-r0drv-linux.c
@@ -25,9 +25,9 @@
*/
-/*******************************************************************************
-* Header Files *
-*******************************************************************************/
+/*********************************************************************************************************************************
+* Header Files *
+*********************************************************************************************************************************/
#include "the-linux-kernel.h"
#include "internal/iprt.h"
@@ -48,9 +48,10 @@
*/
#if LINUX_VERSION_CODE >= KERNEL_VERSION(2, 6, 18) && defined(CONFIG_PREEMPT_NOTIFIERS)
-/*******************************************************************************
-* Structures and Typedefs *
-*******************************************************************************/
+
+/*********************************************************************************************************************************
+* Structures and Typedefs *
+*********************************************************************************************************************************/
/**
* The internal hook object for linux.
*/
diff --git a/src/VBox/Runtime/r0drv/linux/time-r0drv-linux.c b/src/VBox/Runtime/r0drv/linux/time-r0drv-linux.c
index 9e8fccc..18b5a3d 100644
--- a/src/VBox/Runtime/r0drv/linux/time-r0drv-linux.c
+++ b/src/VBox/Runtime/r0drv/linux/time-r0drv-linux.c
@@ -25,9 +25,9 @@
*/
-/*******************************************************************************
-* Header Files *
-*******************************************************************************/
+/*********************************************************************************************************************************
+* Header Files *
+*********************************************************************************************************************************/
#define LOG_GROUP RTLOGGROUP_TIME
#include "the-linux-kernel.h"
#include "internal/iprt.h"
diff --git a/src/VBox/Runtime/r0drv/linux/timer-r0drv-linux.c b/src/VBox/Runtime/r0drv/linux/timer-r0drv-linux.c
index cb44fa5..a26d146 100644
--- a/src/VBox/Runtime/r0drv/linux/timer-r0drv-linux.c
+++ b/src/VBox/Runtime/r0drv/linux/timer-r0drv-linux.c
@@ -25,9 +25,9 @@
*/
-/*******************************************************************************
-* Header Files *
-*******************************************************************************/
+/*********************************************************************************************************************************
+* Header Files *
+*********************************************************************************************************************************/
#include "the-linux-kernel.h"
#include "internal/iprt.h"
@@ -56,9 +56,9 @@
#endif
-/*******************************************************************************
-* Structures and Typedefs *
-*******************************************************************************/
+/*********************************************************************************************************************************
+* Structures and Typedefs *
+*********************************************************************************************************************************/
/**
* Timer state machine.
*
@@ -198,9 +198,9 @@ typedef struct RTTIMERLINUXSTARTONCPUARGS
typedef RTTIMERLINUXSTARTONCPUARGS *PRTTIMERLINUXSTARTONCPUARGS;
-/*******************************************************************************
-* Internal Functions *
-*******************************************************************************/
+/*********************************************************************************************************************************
+* Internal Functions *
+*********************************************************************************************************************************/
#ifdef CONFIG_SMP
static DECLCALLBACK(void) rtTimerLinuxMpEvent(RTMPEVENT enmEvent, RTCPUID idCpu, void *pvUser);
#endif
diff --git a/src/VBox/Runtime/r0drv/memobj-r0drv.cpp b/src/VBox/Runtime/r0drv/memobj-r0drv.cpp
index 49669dc..687ac2c 100644
--- a/src/VBox/Runtime/r0drv/memobj-r0drv.cpp
+++ b/src/VBox/Runtime/r0drv/memobj-r0drv.cpp
@@ -25,9 +25,9 @@
*/
-/*******************************************************************************
-* Header Files *
-*******************************************************************************/
+/*********************************************************************************************************************************
+* Header Files *
+*********************************************************************************************************************************/
#define LOG_GROUP RTLOGGROUP_DEFAULT ///@todo RTLOGGROUP_MEM
#include <iprt/memobj.h>
#include "internal/iprt.h"
diff --git a/src/VBox/Runtime/r0drv/mpnotification-r0drv.c b/src/VBox/Runtime/r0drv/mpnotification-r0drv.c
index 9cf523a..023397d 100644
--- a/src/VBox/Runtime/r0drv/mpnotification-r0drv.c
+++ b/src/VBox/Runtime/r0drv/mpnotification-r0drv.c
@@ -25,9 +25,9 @@
*/
-/*******************************************************************************
-* Header Files *
-*******************************************************************************/
+/*********************************************************************************************************************************
+* Header Files *
+*********************************************************************************************************************************/
#include <iprt/mp.h>
#include "internal/iprt.h"
@@ -44,9 +44,9 @@
#include "r0drv/mp-r0drv.h"
-/*******************************************************************************
-* Structures and Typedefs *
-*******************************************************************************/
+/*********************************************************************************************************************************
+* Structures and Typedefs *
+*********************************************************************************************************************************/
/**
* Notification registration record tracking
* RTMpRegisterNotification() calls.
@@ -66,9 +66,9 @@ typedef struct RTMPNOTIFYREG
typedef RTMPNOTIFYREG *PRTMPNOTIFYREG;
-/*******************************************************************************
-* Global Variables *
-*******************************************************************************/
+/*********************************************************************************************************************************
+* Global Variables *
+*********************************************************************************************************************************/
/** The spinlock protecting the list. */
static RTSPINLOCK volatile g_hRTMpNotifySpinLock = NIL_RTSPINLOCK;
/** List of callbacks, in registration order. */
diff --git a/src/VBox/Runtime/r0drv/nt/RTTimerGetSystemGranularity-r0drv-nt.cpp b/src/VBox/Runtime/r0drv/nt/RTTimerGetSystemGranularity-r0drv-nt.cpp
index d6cebea..d63d153 100644
--- a/src/VBox/Runtime/r0drv/nt/RTTimerGetSystemGranularity-r0drv-nt.cpp
+++ b/src/VBox/Runtime/r0drv/nt/RTTimerGetSystemGranularity-r0drv-nt.cpp
@@ -24,9 +24,10 @@
* terms and conditions of either the GPL or the CDDL or both.
*/
-/*******************************************************************************
-* Header Files *
-*******************************************************************************/
+
+/*********************************************************************************************************************************
+* Header Files *
+*********************************************************************************************************************************/
#include "the-nt-kernel.h"
#include <iprt/timer.h>
diff --git a/src/VBox/Runtime/r0drv/nt/alloc-r0drv-nt.cpp b/src/VBox/Runtime/r0drv/nt/alloc-r0drv-nt.cpp
index 4280c25..90ed667 100644
--- a/src/VBox/Runtime/r0drv/nt/alloc-r0drv-nt.cpp
+++ b/src/VBox/Runtime/r0drv/nt/alloc-r0drv-nt.cpp
@@ -25,9 +25,9 @@
*/
-/*******************************************************************************
-* Header Files *
-*******************************************************************************/
+/*********************************************************************************************************************************
+* Header Files *
+*********************************************************************************************************************************/
#include "the-nt-kernel.h"
#include "internal/iprt.h"
#include <iprt/mem.h>
diff --git a/src/VBox/Runtime/r0drv/nt/assert-r0drv-nt.cpp b/src/VBox/Runtime/r0drv/nt/assert-r0drv-nt.cpp
index 3326689..71e36e3 100644
--- a/src/VBox/Runtime/r0drv/nt/assert-r0drv-nt.cpp
+++ b/src/VBox/Runtime/r0drv/nt/assert-r0drv-nt.cpp
@@ -24,9 +24,10 @@
* terms and conditions of either the GPL or the CDDL or both.
*/
-/*******************************************************************************
-* Header Files *
-*******************************************************************************/
+
+/*********************************************************************************************************************************
+* Header Files *
+*********************************************************************************************************************************/
#include "the-nt-kernel.h"
#include <iprt/assert.h>
diff --git a/src/VBox/Runtime/r0drv/nt/initterm-r0drv-nt.cpp b/src/VBox/Runtime/r0drv/nt/initterm-r0drv-nt.cpp
index b02bd6a..5798f53 100644
--- a/src/VBox/Runtime/r0drv/nt/initterm-r0drv-nt.cpp
+++ b/src/VBox/Runtime/r0drv/nt/initterm-r0drv-nt.cpp
@@ -24,9 +24,10 @@
* terms and conditions of either the GPL or the CDDL or both.
*/
-/*******************************************************************************
-* Header Files *
-*******************************************************************************/
+
+/*********************************************************************************************************************************
+* Header Files *
+*********************************************************************************************************************************/
#include "the-nt-kernel.h"
#include <iprt/asm-amd64-x86.h>
#include <iprt/assert.h>
@@ -39,9 +40,9 @@
#include "symdbdata.h"
-/*******************************************************************************
-* Global Variables *
-*******************************************************************************/
+/*********************************************************************************************************************************
+* Global Variables *
+*********************************************************************************************************************************/
/** The NT CPU set.
* KeQueryActiveProcssors() cannot be called at all IRQLs and therefore we'll
* have to cache it. Fortunately, Nt doesn't really support taking CPUs offline
diff --git a/src/VBox/Runtime/r0drv/nt/memobj-r0drv-nt.cpp b/src/VBox/Runtime/r0drv/nt/memobj-r0drv-nt.cpp
index 8318907..2998fc6 100644
--- a/src/VBox/Runtime/r0drv/nt/memobj-r0drv-nt.cpp
+++ b/src/VBox/Runtime/r0drv/nt/memobj-r0drv-nt.cpp
@@ -25,9 +25,9 @@
*/
-/*******************************************************************************
-* Header Files *
-*******************************************************************************/
+/*********************************************************************************************************************************
+* Header Files *
+*********************************************************************************************************************************/
#include "the-nt-kernel.h"
#include <iprt/memobj.h>
@@ -40,9 +40,9 @@
#include "internal/memobj.h"
-/*******************************************************************************
-* Defined Constants And Macros *
-*******************************************************************************/
+/*********************************************************************************************************************************
+* Defined Constants And Macros *
+*********************************************************************************************************************************/
/** Maximum number of bytes we try to lock down in one go.
* This is supposed to have a limit right below 256MB, but this appears
* to actually be much lower. The values here have been determined experimentally.
@@ -55,9 +55,9 @@
#endif
-/*******************************************************************************
-* Structures and Typedefs *
-*******************************************************************************/
+/*********************************************************************************************************************************
+* Structures and Typedefs *
+*********************************************************************************************************************************/
/**
* The NT version of the memory object structure.
*/
diff --git a/src/VBox/Runtime/r0drv/nt/memuserkernel-r0drv-nt.cpp b/src/VBox/Runtime/r0drv/nt/memuserkernel-r0drv-nt.cpp
index 6b3f087..73ff8f0 100644
--- a/src/VBox/Runtime/r0drv/nt/memuserkernel-r0drv-nt.cpp
+++ b/src/VBox/Runtime/r0drv/nt/memuserkernel-r0drv-nt.cpp
@@ -25,9 +25,9 @@
*/
-/*******************************************************************************
-* Header Files *
-*******************************************************************************/
+/*********************************************************************************************************************************
+* Header Files *
+*********************************************************************************************************************************/
#include "the-nt-kernel.h"
#include <iprt/mem.h>
diff --git a/src/VBox/Runtime/r0drv/nt/mp-r0drv-nt.cpp b/src/VBox/Runtime/r0drv/nt/mp-r0drv-nt.cpp
index 145561f..d299ca1 100644
--- a/src/VBox/Runtime/r0drv/nt/mp-r0drv-nt.cpp
+++ b/src/VBox/Runtime/r0drv/nt/mp-r0drv-nt.cpp
@@ -25,9 +25,9 @@
*/
-/*******************************************************************************
-* Header Files *
-*******************************************************************************/
+/*********************************************************************************************************************************
+* Header Files *
+*********************************************************************************************************************************/
#include "the-nt-kernel.h"
#include <iprt/mp.h>
@@ -40,9 +40,9 @@
#include "internal-r0drv-nt.h"
-/*******************************************************************************
-* Structures and Typedefs *
-*******************************************************************************/
+/*********************************************************************************************************************************
+* Structures and Typedefs *
+*********************************************************************************************************************************/
typedef enum
{
RT_NT_CPUID_SPECIFIC,
diff --git a/src/VBox/Runtime/r0drv/nt/mpnotification-r0drv-nt.cpp b/src/VBox/Runtime/r0drv/nt/mpnotification-r0drv-nt.cpp
index 53e6e32..113d3c6 100644
--- a/src/VBox/Runtime/r0drv/nt/mpnotification-r0drv-nt.cpp
+++ b/src/VBox/Runtime/r0drv/nt/mpnotification-r0drv-nt.cpp
@@ -24,9 +24,10 @@
* terms and conditions of either the GPL or the CDDL or both.
*/
-/*******************************************************************************
-* Header Files *
-*******************************************************************************/
+
+/*********************************************************************************************************************************
+* Header Files *
+*********************************************************************************************************************************/
#include "the-nt-kernel.h"
#include <iprt/mp.h>
@@ -63,18 +64,18 @@ typedef VOID (__stdcall *PPROCESSOR_CALLBACK_FUNCTION)(PVOID, PKE_PROCESSOR_CHAN
-/*******************************************************************************
-* Structures and Typedefs *
-*******************************************************************************/
+/*********************************************************************************************************************************
+* Structures and Typedefs *
+*********************************************************************************************************************************/
/** Typedef of KeRegisterProcessorChangeCallback. */
typedef PVOID (__stdcall *PFNMYKEREGISTERPROCESSORCHANGECALLBACK)(PPROCESSOR_CALLBACK_FUNCTION, PVOID, ULONG);
/** Typedef of KeDeregisterProcessorChangeCallback. */
typedef VOID (__stdcall *PFNMYKEDEREGISTERPROCESSORCHANGECALLBACK)(PVOID);
-/*******************************************************************************
-* Global Variables *
-*******************************************************************************/
+/*********************************************************************************************************************************
+* Global Variables *
+*********************************************************************************************************************************/
/** The pointer to KeRegisterProcessorChangeCallback if found. */
static PFNMYKEREGISTERPROCESSORCHANGECALLBACK g_pfnKeRegisterProcessorChangeCallback = NULL;
/** The pointer to KeDeregisterProcessorChangeCallback if found. */
diff --git a/src/VBox/Runtime/r0drv/nt/ntBldSymDb.cpp b/src/VBox/Runtime/r0drv/nt/ntBldSymDb.cpp
index 7d22211..60c06a9 100644
--- a/src/VBox/Runtime/r0drv/nt/ntBldSymDb.cpp
+++ b/src/VBox/Runtime/r0drv/nt/ntBldSymDb.cpp
@@ -25,9 +25,9 @@
*/
-/*******************************************************************************
-* Header Files *
-*******************************************************************************/
+/*********************************************************************************************************************************
+* Header Files *
+*********************************************************************************************************************************/
#include <Windows.h>
#include <Dbghelp.h>
@@ -47,9 +47,9 @@
#include "r0drv/nt/symdb.h"
-/*******************************************************************************
-* Structures and Typedefs *
-*******************************************************************************/
+/*********************************************************************************************************************************
+* Structures and Typedefs *
+*********************************************************************************************************************************/
/** A structure member we're interested in. */
typedef struct MYMEMBER
{
@@ -108,9 +108,9 @@ typedef struct MYSET
typedef MYSET *PMYSET;
-/*******************************************************************************
-* Global Variables *
-*******************************************************************************/
+/*********************************************************************************************************************************
+* Global Variables *
+*********************************************************************************************************************************/
/** Verbosity level (-v, --verbose). */
static uint32_t g_iOptVerbose = 1;
/** Set if we should force ahead despite errors. */
@@ -1147,7 +1147,7 @@ int main(int argc, char **argv)
break;
case 'V':
- RTPrintf("$Revision: 101858 $");
+ RTPrintf("$Revision: 102121 $");
break;
case 'h':
diff --git a/src/VBox/Runtime/r0drv/nt/process-r0drv-nt.cpp b/src/VBox/Runtime/r0drv/nt/process-r0drv-nt.cpp
index 85f4808..6d38e0a 100644
--- a/src/VBox/Runtime/r0drv/nt/process-r0drv-nt.cpp
+++ b/src/VBox/Runtime/r0drv/nt/process-r0drv-nt.cpp
@@ -24,9 +24,10 @@
* terms and conditions of either the GPL or the CDDL or both.
*/
-/*******************************************************************************
-* Header Files *
-*******************************************************************************/
+
+/*********************************************************************************************************************************
+* Header Files *
+*********************************************************************************************************************************/
#include "the-nt-kernel.h"
#include <iprt/process.h>
diff --git a/src/VBox/Runtime/r0drv/nt/semevent-r0drv-nt.cpp b/src/VBox/Runtime/r0drv/nt/semevent-r0drv-nt.cpp
index 7d4f7ca..49cd603 100644
--- a/src/VBox/Runtime/r0drv/nt/semevent-r0drv-nt.cpp
+++ b/src/VBox/Runtime/r0drv/nt/semevent-r0drv-nt.cpp
@@ -25,9 +25,9 @@
*/
-/*******************************************************************************
-* Header Files *
-*******************************************************************************/
+/*********************************************************************************************************************************
+* Header Files *
+*********************************************************************************************************************************/
#define RTSEMEVENT_WITHOUT_REMAPPING
#include "the-nt-kernel.h"
#include <iprt/semaphore.h>
@@ -43,9 +43,9 @@
#include "internal/magics.h"
-/*******************************************************************************
-* Structures and Typedefs *
-*******************************************************************************/
+/*********************************************************************************************************************************
+* Structures and Typedefs *
+*********************************************************************************************************************************/
/**
* NT event semaphore.
*/
diff --git a/src/VBox/Runtime/r0drv/nt/semeventmulti-r0drv-nt.cpp b/src/VBox/Runtime/r0drv/nt/semeventmulti-r0drv-nt.cpp
index 6fa394d..2a16d15 100644
--- a/src/VBox/Runtime/r0drv/nt/semeventmulti-r0drv-nt.cpp
+++ b/src/VBox/Runtime/r0drv/nt/semeventmulti-r0drv-nt.cpp
@@ -25,9 +25,9 @@
*/
-/*******************************************************************************
-* Header Files *
-*******************************************************************************/
+/*********************************************************************************************************************************
+* Header Files *
+*********************************************************************************************************************************/
#define RTSEMEVENTMULTI_WITHOUT_REMAPPING
#include "the-nt-kernel.h"
#include <iprt/semaphore.h>
@@ -43,9 +43,9 @@
#include "internal/magics.h"
-/*******************************************************************************
-* Structures and Typedefs *
-*******************************************************************************/
+/*********************************************************************************************************************************
+* Structures and Typedefs *
+*********************************************************************************************************************************/
/**
* NT event semaphore.
*/
diff --git a/src/VBox/Runtime/r0drv/nt/semfastmutex-r0drv-nt.cpp b/src/VBox/Runtime/r0drv/nt/semfastmutex-r0drv-nt.cpp
index 8ee81cc..cc1c7af 100644
--- a/src/VBox/Runtime/r0drv/nt/semfastmutex-r0drv-nt.cpp
+++ b/src/VBox/Runtime/r0drv/nt/semfastmutex-r0drv-nt.cpp
@@ -26,9 +26,9 @@
-/*******************************************************************************
-* Header Files *
-*******************************************************************************/
+/*********************************************************************************************************************************
+* Header Files *
+*********************************************************************************************************************************/
#include "the-nt-kernel.h"
#include <iprt/semaphore.h>
#include <iprt/alloc.h>
@@ -39,9 +39,9 @@
#include "internal/magics.h"
-/*******************************************************************************
-* Structures and Typedefs *
-*******************************************************************************/
+/*********************************************************************************************************************************
+* Structures and Typedefs *
+*********************************************************************************************************************************/
/**
* Wrapper for the linux semaphore structure.
*/
diff --git a/src/VBox/Runtime/r0drv/nt/semmutex-r0drv-nt.cpp b/src/VBox/Runtime/r0drv/nt/semmutex-r0drv-nt.cpp
index 7c86cca..6848f6a 100644
--- a/src/VBox/Runtime/r0drv/nt/semmutex-r0drv-nt.cpp
+++ b/src/VBox/Runtime/r0drv/nt/semmutex-r0drv-nt.cpp
@@ -26,9 +26,9 @@
-/*******************************************************************************
-* Header Files *
-*******************************************************************************/
+/*********************************************************************************************************************************
+* Header Files *
+*********************************************************************************************************************************/
#define RTSEMMUTEX_WITHOUT_REMAPPING
#include "the-nt-kernel.h"
#include <iprt/semaphore.h>
@@ -40,9 +40,9 @@
#include "internal/magics.h"
-/*******************************************************************************
-* Structures and Typedefs *
-*******************************************************************************/
+/*********************************************************************************************************************************
+* Structures and Typedefs *
+*********************************************************************************************************************************/
/**
* NT mutex semaphore.
*/
diff --git a/src/VBox/Runtime/r0drv/nt/spinlock-r0drv-nt.cpp b/src/VBox/Runtime/r0drv/nt/spinlock-r0drv-nt.cpp
index 3c3b579..12f57db 100644
--- a/src/VBox/Runtime/r0drv/nt/spinlock-r0drv-nt.cpp
+++ b/src/VBox/Runtime/r0drv/nt/spinlock-r0drv-nt.cpp
@@ -25,9 +25,9 @@
*/
-/*******************************************************************************
-* Header Files *
-*******************************************************************************/
+/*********************************************************************************************************************************
+* Header Files *
+*********************************************************************************************************************************/
#include "the-nt-kernel.h"
#include <iprt/spinlock.h>
@@ -43,9 +43,9 @@
#include "internal/magics.h"
-/*******************************************************************************
-* Defined Constants And Macros *
-*******************************************************************************/
+/*********************************************************************************************************************************
+* Defined Constants And Macros *
+*********************************************************************************************************************************/
/** Apply the NoIrq hack if defined. */
#define RTSPINLOCK_NT_HACK_NOIRQ
@@ -57,9 +57,9 @@
#endif
-/*******************************************************************************
-* Structures and Typedefs *
-*******************************************************************************/
+/*********************************************************************************************************************************
+* Structures and Typedefs *
+*********************************************************************************************************************************/
/**
* Wrapper for the KSPIN_LOCK type.
*/
diff --git a/src/VBox/Runtime/r0drv/nt/thread-r0drv-nt.cpp b/src/VBox/Runtime/r0drv/nt/thread-r0drv-nt.cpp
index 4004320..dab9845 100644
--- a/src/VBox/Runtime/r0drv/nt/thread-r0drv-nt.cpp
+++ b/src/VBox/Runtime/r0drv/nt/thread-r0drv-nt.cpp
@@ -24,9 +24,10 @@
* terms and conditions of either the GPL or the CDDL or both.
*/
-/*******************************************************************************
-* Header Files *
-*******************************************************************************/
+
+/*********************************************************************************************************************************
+* Header Files *
+*********************************************************************************************************************************/
#include "the-nt-kernel.h"
#include "internal/iprt.h"
#include <iprt/thread.h>
@@ -75,12 +76,6 @@ RTDECL(int) RTThreadSleep(RTMSINTERVAL cMillies)
}
-RTDECL(int) RTThreadSleepCommon(RTMSINTERVAL cMillies)
-{
- return rtR0ThreadNtSleepCommon(cMillies);
-}
-
-
RTDECL(bool) RTThreadYield(void)
{
return ZwYieldExecution() != STATUS_NO_YIELD_PERFORMED;
diff --git a/src/VBox/Runtime/r0drv/nt/thread2-r0drv-nt.cpp b/src/VBox/Runtime/r0drv/nt/thread2-r0drv-nt.cpp
index bca2855..4bedc42 100644
--- a/src/VBox/Runtime/r0drv/nt/thread2-r0drv-nt.cpp
+++ b/src/VBox/Runtime/r0drv/nt/thread2-r0drv-nt.cpp
@@ -24,9 +24,10 @@
* terms and conditions of either the GPL or the CDDL or both.
*/
-/*******************************************************************************
-* Header Files *
-*******************************************************************************/
+
+/*********************************************************************************************************************************
+* Header Files *
+*********************************************************************************************************************************/
#include "the-nt-kernel.h"
#include <iprt/thread.h>
diff --git a/src/VBox/Runtime/r0drv/nt/time-r0drv-nt.cpp b/src/VBox/Runtime/r0drv/nt/time-r0drv-nt.cpp
index 99f90f3..5e63038 100644
--- a/src/VBox/Runtime/r0drv/nt/time-r0drv-nt.cpp
+++ b/src/VBox/Runtime/r0drv/nt/time-r0drv-nt.cpp
@@ -25,9 +25,9 @@
*/
-/*******************************************************************************
-* Header Files *
-*******************************************************************************/
+/*********************************************************************************************************************************
+* Header Files *
+*********************************************************************************************************************************/
#define LOG_GROUP RTLOGGROUP_TIME
#include "the-nt-kernel.h"
#include "internal-r0drv-nt.h"
diff --git a/src/VBox/Runtime/r0drv/nt/timer-r0drv-nt.cpp b/src/VBox/Runtime/r0drv/nt/timer-r0drv-nt.cpp
index c685015..c826e2d 100644
--- a/src/VBox/Runtime/r0drv/nt/timer-r0drv-nt.cpp
+++ b/src/VBox/Runtime/r0drv/nt/timer-r0drv-nt.cpp
@@ -24,9 +24,10 @@
* terms and conditions of either the GPL or the CDDL or both.
*/
-/*******************************************************************************
-* Header Files *
-*******************************************************************************/
+
+/*********************************************************************************************************************************
+* Header Files *
+*********************************************************************************************************************************/
#include "the-nt-kernel.h"
#include <iprt/timer.h>
@@ -45,9 +46,9 @@
#define RTR0TIMER_NT_MANUAL_RE_ARM 1
-/*******************************************************************************
-* Structures and Typedefs *
-*******************************************************************************/
+/*********************************************************************************************************************************
+* Structures and Typedefs *
+*********************************************************************************************************************************/
/**
* A sub timer structure.
*
diff --git a/src/VBox/Runtime/r0drv/os2/alloc-r0drv-os2.cpp b/src/VBox/Runtime/r0drv/os2/alloc-r0drv-os2.cpp
index 9028050..ebc7f04 100644
--- a/src/VBox/Runtime/r0drv/os2/alloc-r0drv-os2.cpp
+++ b/src/VBox/Runtime/r0drv/os2/alloc-r0drv-os2.cpp
@@ -29,9 +29,9 @@
*/
-/*******************************************************************************
-* Header Files *
-*******************************************************************************/
+/*********************************************************************************************************************************
+* Header Files *
+*********************************************************************************************************************************/
#include "the-os2-kernel.h"
#include "internal/iprt.h"
#include <iprt/mem.h>
diff --git a/src/VBox/Runtime/r0drv/os2/assert-r0drv-os2.cpp b/src/VBox/Runtime/r0drv/os2/assert-r0drv-os2.cpp
index 6980593..f65a892 100644
--- a/src/VBox/Runtime/r0drv/os2/assert-r0drv-os2.cpp
+++ b/src/VBox/Runtime/r0drv/os2/assert-r0drv-os2.cpp
@@ -29,9 +29,9 @@
*/
-/*******************************************************************************
-* Header Files *
-*******************************************************************************/
+/*********************************************************************************************************************************
+* Header Files *
+*********************************************************************************************************************************/
#include <iprt/assert.h>
#include <iprt/log.h>
#include <iprt/string.h>
@@ -42,18 +42,18 @@
#include "internal/assert.h"
-/*******************************************************************************
-* Global Variables *
-*******************************************************************************/
+/*********************************************************************************************************************************
+* Global Variables *
+*********************************************************************************************************************************/
/** The last assert message. (in DATA16) */
extern char g_szRTAssertMsg[2048];
/** The length of the last assert message. (in DATA16) */
extern size_t g_cchRTAssertMsg;
-/*******************************************************************************
-* Internal Functions *
-*******************************************************************************/
+/*********************************************************************************************************************************
+* Internal Functions *
+*********************************************************************************************************************************/
static DECLCALLBACK(size_t) rtR0Os2AssertOutputCB(void *pvArg, const char *pachChars, size_t cbChars);
diff --git a/src/VBox/Runtime/r0drv/os2/initterm-r0drv-os2.cpp b/src/VBox/Runtime/r0drv/os2/initterm-r0drv-os2.cpp
index 3c86ae3..3da040d 100644
--- a/src/VBox/Runtime/r0drv/os2/initterm-r0drv-os2.cpp
+++ b/src/VBox/Runtime/r0drv/os2/initterm-r0drv-os2.cpp
@@ -30,9 +30,10 @@
#define RT_STRICT
-/*******************************************************************************
-* Header Files *
-*******************************************************************************/
+
+/*********************************************************************************************************************************
+* Header Files *
+*********************************************************************************************************************************/
#include "the-os2-kernel.h"
#include "internal/initterm.h"
@@ -40,9 +41,9 @@
#include <iprt/assert.h>
-/*******************************************************************************
-* Global Variables *
-*******************************************************************************/
+/*********************************************************************************************************************************
+* Global Variables *
+*********************************************************************************************************************************/
/** Pointer to the 1st DOS variable table. */
PCDOSTABLE g_pDosTable = NULL;
/** Pointer to the 2nd DOS variable table. */
diff --git a/src/VBox/Runtime/r0drv/os2/memobj-r0drv-os2.cpp b/src/VBox/Runtime/r0drv/os2/memobj-r0drv-os2.cpp
index 3efaaea..8f6af0a 100644
--- a/src/VBox/Runtime/r0drv/os2/memobj-r0drv-os2.cpp
+++ b/src/VBox/Runtime/r0drv/os2/memobj-r0drv-os2.cpp
@@ -29,9 +29,9 @@
*/
-/*******************************************************************************
-* Header Files *
-*******************************************************************************/
+/*********************************************************************************************************************************
+* Header Files *
+*********************************************************************************************************************************/
#include "the-os2-kernel.h"
#include <iprt/memobj.h>
@@ -44,9 +44,9 @@
#include "internal/memobj.h"
-/*******************************************************************************
-* Structures and Typedefs *
-*******************************************************************************/
+/*********************************************************************************************************************************
+* Structures and Typedefs *
+*********************************************************************************************************************************/
/**
* The OS/2 version of the memory object structure.
*/
@@ -63,9 +63,9 @@ typedef struct RTR0MEMOBJDARWIN
} RTR0MEMOBJOS2, *PRTR0MEMOBJOS2;
-/*******************************************************************************
-* Internal Functions *
-*******************************************************************************/
+/*********************************************************************************************************************************
+* Internal Functions *
+*********************************************************************************************************************************/
static void rtR0MemObjFixPageList(KernPageList_t *paPages, ULONG cPages, ULONG cPagesRet);
diff --git a/src/VBox/Runtime/r0drv/os2/memuserkernel-r0drv-os2.cpp b/src/VBox/Runtime/r0drv/os2/memuserkernel-r0drv-os2.cpp
index a8cf0e1..d758c0a 100644
--- a/src/VBox/Runtime/r0drv/os2/memuserkernel-r0drv-os2.cpp
+++ b/src/VBox/Runtime/r0drv/os2/memuserkernel-r0drv-os2.cpp
@@ -25,9 +25,9 @@
*/
-/*******************************************************************************
-* Header Files *
-*******************************************************************************/
+/*********************************************************************************************************************************
+* Header Files *
+*********************************************************************************************************************************/
#include "the-os2-kernel.h"
#include <iprt/mem.h>
diff --git a/src/VBox/Runtime/r0drv/os2/process-r0drv-os2.cpp b/src/VBox/Runtime/r0drv/os2/process-r0drv-os2.cpp
index a05d061..585f114 100644
--- a/src/VBox/Runtime/r0drv/os2/process-r0drv-os2.cpp
+++ b/src/VBox/Runtime/r0drv/os2/process-r0drv-os2.cpp
@@ -29,9 +29,9 @@
*/
-/*******************************************************************************
-* Header Files *
-*******************************************************************************/
+/*********************************************************************************************************************************
+* Header Files *
+*********************************************************************************************************************************/
#include "the-os2-kernel.h"
#include <iprt/process.h>
diff --git a/src/VBox/Runtime/r0drv/os2/semevent-r0drv-os2.cpp b/src/VBox/Runtime/r0drv/os2/semevent-r0drv-os2.cpp
index 0dc7426..9a87898 100644
--- a/src/VBox/Runtime/r0drv/os2/semevent-r0drv-os2.cpp
+++ b/src/VBox/Runtime/r0drv/os2/semevent-r0drv-os2.cpp
@@ -29,9 +29,9 @@
*/
-/*******************************************************************************
-* Header Files *
-*******************************************************************************/
+/*********************************************************************************************************************************
+* Header Files *
+*********************************************************************************************************************************/
#include "the-os2-kernel.h"
#include "internal/iprt.h"
@@ -45,9 +45,9 @@
#include "internal/magics.h"
-/*******************************************************************************
-* Structures and Typedefs *
-*******************************************************************************/
+/*********************************************************************************************************************************
+* Structures and Typedefs *
+*********************************************************************************************************************************/
/**
* OS/2 event semaphore.
*/
diff --git a/src/VBox/Runtime/r0drv/os2/semeventmulti-r0drv-os2.cpp b/src/VBox/Runtime/r0drv/os2/semeventmulti-r0drv-os2.cpp
index ae06e21..add81b3 100644
--- a/src/VBox/Runtime/r0drv/os2/semeventmulti-r0drv-os2.cpp
+++ b/src/VBox/Runtime/r0drv/os2/semeventmulti-r0drv-os2.cpp
@@ -29,9 +29,9 @@
*/
-/*******************************************************************************
-* Header Files *
-*******************************************************************************/
+/*********************************************************************************************************************************
+* Header Files *
+*********************************************************************************************************************************/
#include "the-os2-kernel.h"
#include "internal/iprt.h"
@@ -44,9 +44,9 @@
#include "internal/magics.h"
-/*******************************************************************************
-* Structures and Typedefs *
-*******************************************************************************/
+/*********************************************************************************************************************************
+* Structures and Typedefs *
+*********************************************************************************************************************************/
/**
* OS/2 multiple release event semaphore.
*/
diff --git a/src/VBox/Runtime/r0drv/os2/semfastmutex-r0drv-os2.cpp b/src/VBox/Runtime/r0drv/os2/semfastmutex-r0drv-os2.cpp
index d2edff5..c6ffcb0 100644
--- a/src/VBox/Runtime/r0drv/os2/semfastmutex-r0drv-os2.cpp
+++ b/src/VBox/Runtime/r0drv/os2/semfastmutex-r0drv-os2.cpp
@@ -28,9 +28,10 @@
* OTHER DEALINGS IN THE SOFTWARE.
*/
-/*******************************************************************************
-* Header Files *
-*******************************************************************************/
+
+/*********************************************************************************************************************************
+* Header Files *
+*********************************************************************************************************************************/
#include "the-os2-kernel.h"
#include <iprt/semaphore.h>
@@ -42,9 +43,9 @@
#include "internal/magics.h"
-/*******************************************************************************
-* Structures and Typedefs *
-*******************************************************************************/
+/*********************************************************************************************************************************
+* Structures and Typedefs *
+*********************************************************************************************************************************/
/**
* Wrapper for the OS/2 KEE mutex semaphore.
*/
diff --git a/src/VBox/Runtime/r0drv/os2/spinlock-r0drv-os2.cpp b/src/VBox/Runtime/r0drv/os2/spinlock-r0drv-os2.cpp
index 3d716c6..1d0a034 100644
--- a/src/VBox/Runtime/r0drv/os2/spinlock-r0drv-os2.cpp
+++ b/src/VBox/Runtime/r0drv/os2/spinlock-r0drv-os2.cpp
@@ -28,9 +28,10 @@
* OTHER DEALINGS IN THE SOFTWARE.
*/
-/*******************************************************************************
-* Header Files *
-*******************************************************************************/
+
+/*********************************************************************************************************************************
+* Header Files *
+*********************************************************************************************************************************/
#include "the-os2-kernel.h"
#include <iprt/spinlock.h>
@@ -45,9 +46,9 @@
#include "internal/magics.h"
-/*******************************************************************************
-* Structures and Typedefs *
-*******************************************************************************/
+/*********************************************************************************************************************************
+* Structures and Typedefs *
+*********************************************************************************************************************************/
/**
* Wrapper for the SpinLock_t type.
*/
diff --git a/src/VBox/Runtime/r0drv/os2/thread-r0drv-os2.cpp b/src/VBox/Runtime/r0drv/os2/thread-r0drv-os2.cpp
index 5e4813a..b2cf47d 100644
--- a/src/VBox/Runtime/r0drv/os2/thread-r0drv-os2.cpp
+++ b/src/VBox/Runtime/r0drv/os2/thread-r0drv-os2.cpp
@@ -28,9 +28,10 @@
* OTHER DEALINGS IN THE SOFTWARE.
*/
-/*******************************************************************************
-* Header Files *
-*******************************************************************************/
+
+/*********************************************************************************************************************************
+* Header Files *
+*********************************************************************************************************************************/
#include "the-os2-kernel.h"
#include "internal/iprt.h"
#include <iprt/thread.h>
@@ -43,9 +44,9 @@
#include "internal/thread.h"
-/*******************************************************************************
-* Global Variables *
-*******************************************************************************/
+/*********************************************************************************************************************************
+* Global Variables *
+*********************************************************************************************************************************/
/** Per-cpu preemption counters. */
static int32_t volatile g_acPreemptDisabled[256];
diff --git a/src/VBox/Runtime/r0drv/os2/thread2-r0drv-os2.cpp b/src/VBox/Runtime/r0drv/os2/thread2-r0drv-os2.cpp
index 0c590f7..f792e00 100644
--- a/src/VBox/Runtime/r0drv/os2/thread2-r0drv-os2.cpp
+++ b/src/VBox/Runtime/r0drv/os2/thread2-r0drv-os2.cpp
@@ -28,9 +28,10 @@
* OTHER DEALINGS IN THE SOFTWARE.
*/
-/*******************************************************************************
-* Header Files *
-*******************************************************************************/
+
+/*********************************************************************************************************************************
+* Header Files *
+*********************************************************************************************************************************/
#include "the-os2-kernel.h"
#include <iprt/thread.h>
diff --git a/src/VBox/Runtime/r0drv/os2/time-r0drv-os2.cpp b/src/VBox/Runtime/r0drv/os2/time-r0drv-os2.cpp
index 778ee2b..de749de 100644
--- a/src/VBox/Runtime/r0drv/os2/time-r0drv-os2.cpp
+++ b/src/VBox/Runtime/r0drv/os2/time-r0drv-os2.cpp
@@ -29,9 +29,9 @@
*/
-/*******************************************************************************
-* Header Files *
-*******************************************************************************/
+/*********************************************************************************************************************************
+* Header Files *
+*********************************************************************************************************************************/
#include "the-os2-kernel.h"
#include <iprt/time.h>
diff --git a/src/VBox/Runtime/r0drv/os2/timer-r0drv-os2.cpp b/src/VBox/Runtime/r0drv/os2/timer-r0drv-os2.cpp
index 7a86f54..39b9025 100644
--- a/src/VBox/Runtime/r0drv/os2/timer-r0drv-os2.cpp
+++ b/src/VBox/Runtime/r0drv/os2/timer-r0drv-os2.cpp
@@ -29,9 +29,9 @@
*/
-/*******************************************************************************
-* Header Files *
-*******************************************************************************/
+/*********************************************************************************************************************************
+* Header Files *
+*********************************************************************************************************************************/
#include "the-os2-kernel.h"
#include <iprt/timer.h>
@@ -45,9 +45,9 @@
#include "internal/magics.h"
-/*******************************************************************************
-* Structures and Typedefs *
-*******************************************************************************/
+/*********************************************************************************************************************************
+* Structures and Typedefs *
+*********************************************************************************************************************************/
/**
* The internal representation of an OS/2 timer handle.
*/
@@ -81,9 +81,9 @@ typedef struct RTTIMER
} RTTIMER;
-/*******************************************************************************
-* Global Variables *
-*******************************************************************************/
+/*********************************************************************************************************************************
+* Global Variables *
+*********************************************************************************************************************************/
/** Spinlock protecting the timers. */
static RTSPINLOCK g_Spinlock = NIL_RTSPINLOCK;
/** The timer head. */
@@ -97,9 +97,9 @@ static uint32_t volatile g_cTimers = 0;
static uint32_t volatile g_u32ChangeNo;
-/*******************************************************************************
-* Internal Functions *
-*******************************************************************************/
+/*********************************************************************************************************************************
+* Internal Functions *
+*********************************************************************************************************************************/
RT_C_DECLS_BEGIN
DECLASM(void) rtTimerOs2Tick(void);
DECLASM(int) rtTimerOs2Arm(void);
diff --git a/src/VBox/Runtime/r0drv/powernotification-r0drv.c b/src/VBox/Runtime/r0drv/powernotification-r0drv.c
index 02333ef..1afec3d 100644
--- a/src/VBox/Runtime/r0drv/powernotification-r0drv.c
+++ b/src/VBox/Runtime/r0drv/powernotification-r0drv.c
@@ -25,9 +25,9 @@
*/
-/*******************************************************************************
-* Header Files *
-*******************************************************************************/
+/*********************************************************************************************************************************
+* Header Files *
+*********************************************************************************************************************************/
#include <iprt/power.h>
#include "internal/iprt.h"
@@ -45,9 +45,9 @@
#include "r0drv/power-r0drv.h"
-/*******************************************************************************
-* Structures and Typedefs *
-*******************************************************************************/
+/*********************************************************************************************************************************
+* Structures and Typedefs *
+*********************************************************************************************************************************/
/**
* Notification registration record tracking
* RTPowerRegisterNotification() calls.
@@ -67,9 +67,9 @@ typedef struct RTPOWERNOTIFYREG
typedef RTPOWERNOTIFYREG *PRTPOWERNOTIFYREG;
-/*******************************************************************************
-* Global Variables *
-*******************************************************************************/
+/*********************************************************************************************************************************
+* Global Variables *
+*********************************************************************************************************************************/
/** The spinlock protecting the list. */
static RTSPINLOCK volatile g_hRTPowerNotifySpinLock = NIL_RTSPINLOCK;
/** List of callbacks, in registration order. */
diff --git a/src/VBox/Runtime/r0drv/solaris/RTLogWriteDebugger-r0drv-solaris.c b/src/VBox/Runtime/r0drv/solaris/RTLogWriteDebugger-r0drv-solaris.c
index 3f93b99..3a7f721 100644
--- a/src/VBox/Runtime/r0drv/solaris/RTLogWriteDebugger-r0drv-solaris.c
+++ b/src/VBox/Runtime/r0drv/solaris/RTLogWriteDebugger-r0drv-solaris.c
@@ -25,9 +25,9 @@
*/
-/*******************************************************************************
-* Header Files *
-*******************************************************************************/
+/*********************************************************************************************************************************
+* Header Files *
+*********************************************************************************************************************************/
#include "the-solaris-kernel.h"
#include "internal/iprt.h"
#include <iprt/log.h>
diff --git a/src/VBox/Runtime/r0drv/solaris/RTMpPokeCpu-r0drv-solaris.c b/src/VBox/Runtime/r0drv/solaris/RTMpPokeCpu-r0drv-solaris.c
index 28bc974..c8d4f51 100644
--- a/src/VBox/Runtime/r0drv/solaris/RTMpPokeCpu-r0drv-solaris.c
+++ b/src/VBox/Runtime/r0drv/solaris/RTMpPokeCpu-r0drv-solaris.c
@@ -25,9 +25,9 @@
*/
-/*******************************************************************************
-* Header Files *
-*******************************************************************************/
+/*********************************************************************************************************************************
+* Header Files *
+*********************************************************************************************************************************/
#include "the-solaris-kernel.h"
#include "internal/iprt.h"
#include <iprt/mp.h>
diff --git a/src/VBox/Runtime/r0drv/solaris/alloc-r0drv-solaris.c b/src/VBox/Runtime/r0drv/solaris/alloc-r0drv-solaris.c
index 0876bef..8b23ca9 100644
--- a/src/VBox/Runtime/r0drv/solaris/alloc-r0drv-solaris.c
+++ b/src/VBox/Runtime/r0drv/solaris/alloc-r0drv-solaris.c
@@ -25,9 +25,9 @@
*/
-/*******************************************************************************
-* Header Files *
-*******************************************************************************/
+/*********************************************************************************************************************************
+* Header Files *
+*********************************************************************************************************************************/
#include "the-solaris-kernel.h"
#include "internal/iprt.h"
#include <iprt/mem.h>
@@ -40,9 +40,9 @@
#include "r0drv/alloc-r0drv.h"
-/*******************************************************************************
-* Structures and Typedefs *
-*******************************************************************************/
+/*********************************************************************************************************************************
+* Structures and Typedefs *
+*********************************************************************************************************************************/
static ddi_dma_attr_t s_rtR0SolDmaAttr =
{
DMA_ATTR_V0, /* Version Number */
diff --git a/src/VBox/Runtime/r0drv/solaris/assert-r0drv-solaris.c b/src/VBox/Runtime/r0drv/solaris/assert-r0drv-solaris.c
index 38aceb6..820936c 100644
--- a/src/VBox/Runtime/r0drv/solaris/assert-r0drv-solaris.c
+++ b/src/VBox/Runtime/r0drv/solaris/assert-r0drv-solaris.c
@@ -25,9 +25,9 @@
*/
-/*******************************************************************************
-* Header Files *
-*******************************************************************************/
+/*********************************************************************************************************************************
+* Header Files *
+*********************************************************************************************************************************/
#include "the-solaris-kernel.h"
#include "internal/iprt.h"
#include <iprt/assert.h>
diff --git a/src/VBox/Runtime/r0drv/solaris/dbgkrnlinfo-r0drv-solaris.c b/src/VBox/Runtime/r0drv/solaris/dbgkrnlinfo-r0drv-solaris.c
index 0118472..5fe1354 100644
--- a/src/VBox/Runtime/r0drv/solaris/dbgkrnlinfo-r0drv-solaris.c
+++ b/src/VBox/Runtime/r0drv/solaris/dbgkrnlinfo-r0drv-solaris.c
@@ -25,9 +25,9 @@
*/
-/*******************************************************************************
-* Header Files *
-*******************************************************************************/
+/*********************************************************************************************************************************
+* Header Files *
+*********************************************************************************************************************************/
#include "the-solaris-kernel.h"
#include "internal/iprt.h"
@@ -43,9 +43,9 @@
#include "internal/magics.h"
-/*******************************************************************************
-* Structures and Typedefs *
-*******************************************************************************/
+/*********************************************************************************************************************************
+* Structures and Typedefs *
+*********************************************************************************************************************************/
/**
* Solaris kernel debug info instance data.
*/
diff --git a/src/VBox/Runtime/r0drv/solaris/initterm-r0drv-solaris.c b/src/VBox/Runtime/r0drv/solaris/initterm-r0drv-solaris.c
index 7a7eb2c..4562920 100644
--- a/src/VBox/Runtime/r0drv/solaris/initterm-r0drv-solaris.c
+++ b/src/VBox/Runtime/r0drv/solaris/initterm-r0drv-solaris.c
@@ -25,9 +25,9 @@
*/
-/*******************************************************************************
-* Header Files *
-*******************************************************************************/
+/*********************************************************************************************************************************
+* Header Files *
+*********************************************************************************************************************************/
#include "the-solaris-kernel.h"
#include "internal/iprt.h"
@@ -39,9 +39,9 @@
#include "internal/initterm.h"
-/*******************************************************************************
-* Global Variables *
-*******************************************************************************/
+/*********************************************************************************************************************************
+* Global Variables *
+*********************************************************************************************************************************/
/** Kernel debug info handle. */
RTDBGKRNLINFO g_hKrnlDbgInfo;
/** Indicates that the spl routines (and therefore a bunch of other ones too)
diff --git a/src/VBox/Runtime/r0drv/solaris/memobj-r0drv-solaris.c b/src/VBox/Runtime/r0drv/solaris/memobj-r0drv-solaris.c
index 6018215..2b082a3 100644
--- a/src/VBox/Runtime/r0drv/solaris/memobj-r0drv-solaris.c
+++ b/src/VBox/Runtime/r0drv/solaris/memobj-r0drv-solaris.c
@@ -25,9 +25,9 @@
*/
-/*******************************************************************************
-* Header Files *
-*******************************************************************************/
+/*********************************************************************************************************************************
+* Header Files *
+*********************************************************************************************************************************/
#include "the-solaris-kernel.h"
#include "internal/iprt.h"
#include <iprt/memobj.h>
@@ -42,15 +42,16 @@
#include "internal/memobj.h"
#include "memobj-r0drv-solaris.h"
-/*******************************************************************************
-* Defined Constants And Macros *
-*******************************************************************************/
+
+/*********************************************************************************************************************************
+* Defined Constants And Macros *
+*********************************************************************************************************************************/
#define SOL_IS_KRNL_ADDR(vx) ((uintptr_t)(vx) >= kernelbase)
-/*******************************************************************************
-* Structures and Typedefs *
-*******************************************************************************/
+/*********************************************************************************************************************************
+* Structures and Typedefs *
+*********************************************************************************************************************************/
/**
* The Solaris version of the memory object structure.
*/
@@ -73,9 +74,9 @@ typedef struct RTR0MEMOBJSOL
} RTR0MEMOBJSOL, *PRTR0MEMOBJSOL;
-/*******************************************************************************
-* Global Variables *
-*******************************************************************************/
+/*********************************************************************************************************************************
+* Global Variables *
+*********************************************************************************************************************************/
static vnode_t g_PageVnode;
static kmutex_t g_OffsetMtx;
static u_offset_t g_offPage;
diff --git a/src/VBox/Runtime/r0drv/solaris/memuserkernel-r0drv-solaris.c b/src/VBox/Runtime/r0drv/solaris/memuserkernel-r0drv-solaris.c
index fcb3897..0568e18 100644
--- a/src/VBox/Runtime/r0drv/solaris/memuserkernel-r0drv-solaris.c
+++ b/src/VBox/Runtime/r0drv/solaris/memuserkernel-r0drv-solaris.c
@@ -25,9 +25,9 @@
*/
-/*******************************************************************************
-* Header Files *
-*******************************************************************************/
+/*********************************************************************************************************************************
+* Header Files *
+*********************************************************************************************************************************/
#include "the-solaris-kernel.h"
#include "internal/iprt.h"
#include <iprt/mem.h>
diff --git a/src/VBox/Runtime/r0drv/solaris/modulestub-r0drv-solaris.c b/src/VBox/Runtime/r0drv/solaris/modulestub-r0drv-solaris.c
index 1625bee..08dee84 100644
--- a/src/VBox/Runtime/r0drv/solaris/modulestub-r0drv-solaris.c
+++ b/src/VBox/Runtime/r0drv/solaris/modulestub-r0drv-solaris.c
@@ -25,15 +25,15 @@
*/
-/*******************************************************************************
-* Header Files *
-*******************************************************************************/
+/*********************************************************************************************************************************
+* Header Files *
+*********************************************************************************************************************************/
#include <sys/modctl.h>
-/*******************************************************************************
-* Global Variables *
-*******************************************************************************/
+/*********************************************************************************************************************************
+* Global Variables *
+*********************************************************************************************************************************/
static struct modlmisc g_rtModuleStubMisc =
{
&mod_miscops, /* extern from kernel */
diff --git a/src/VBox/Runtime/r0drv/solaris/mp-r0drv-solaris.c b/src/VBox/Runtime/r0drv/solaris/mp-r0drv-solaris.c
index 3eec3bc..9b736e1 100644
--- a/src/VBox/Runtime/r0drv/solaris/mp-r0drv-solaris.c
+++ b/src/VBox/Runtime/r0drv/solaris/mp-r0drv-solaris.c
@@ -25,9 +25,9 @@
*/
-/*******************************************************************************
-* Header Files *
-*******************************************************************************/
+/*********************************************************************************************************************************
+* Header Files *
+*********************************************************************************************************************************/
#include "the-solaris-kernel.h"
#include "internal/iprt.h"
#include <iprt/mp.h>
diff --git a/src/VBox/Runtime/r0drv/solaris/mpnotification-r0drv-solaris.c b/src/VBox/Runtime/r0drv/solaris/mpnotification-r0drv-solaris.c
index 89ea669..956ca9a 100644
--- a/src/VBox/Runtime/r0drv/solaris/mpnotification-r0drv-solaris.c
+++ b/src/VBox/Runtime/r0drv/solaris/mpnotification-r0drv-solaris.c
@@ -24,9 +24,10 @@
* terms and conditions of either the GPL or the CDDL or both.
*/
-/*******************************************************************************
-* Header Files *
-*******************************************************************************/
+
+/*********************************************************************************************************************************
+* Header Files *
+*********************************************************************************************************************************/
#include "the-solaris-kernel.h"
#include "internal/iprt.h"
@@ -38,9 +39,9 @@
#include "r0drv/mp-r0drv.h"
-/*******************************************************************************
-* Global Variables *
-*******************************************************************************/
+/*********************************************************************************************************************************
+* Global Variables *
+*********************************************************************************************************************************/
/** Whether CPUs are being watched or not. */
static volatile bool g_fSolCpuWatch = false;
/** Set of online cpus that is maintained by the MP callback.
diff --git a/src/VBox/Runtime/r0drv/solaris/process-r0drv-solaris.c b/src/VBox/Runtime/r0drv/solaris/process-r0drv-solaris.c
index 1611248..56a38eb 100644
--- a/src/VBox/Runtime/r0drv/solaris/process-r0drv-solaris.c
+++ b/src/VBox/Runtime/r0drv/solaris/process-r0drv-solaris.c
@@ -25,9 +25,9 @@
*/
-/*******************************************************************************
-* Header Files *
-*******************************************************************************/
+/*********************************************************************************************************************************
+* Header Files *
+*********************************************************************************************************************************/
#include "the-solaris-kernel.h"
#include "internal/iprt.h"
#include <iprt/process.h>
diff --git a/src/VBox/Runtime/r0drv/solaris/semevent-r0drv-solaris.c b/src/VBox/Runtime/r0drv/solaris/semevent-r0drv-solaris.c
index dec0dee..9092bbe 100644
--- a/src/VBox/Runtime/r0drv/solaris/semevent-r0drv-solaris.c
+++ b/src/VBox/Runtime/r0drv/solaris/semevent-r0drv-solaris.c
@@ -25,9 +25,9 @@
*/
-/*******************************************************************************
-* Header Files *
-*******************************************************************************/
+/*********************************************************************************************************************************
+* Header Files *
+*********************************************************************************************************************************/
#define RTSEMEVENT_WITHOUT_REMAPPING
#include "the-solaris-kernel.h"
#include "internal/iprt.h"
@@ -48,9 +48,9 @@
#include "semeventwait-r0drv-solaris.h"
-/*******************************************************************************
-* Structures and Typedefs *
-*******************************************************************************/
+/*********************************************************************************************************************************
+* Structures and Typedefs *
+*********************************************************************************************************************************/
/**
* Waiter entry. Lives on the stack.
*
diff --git a/src/VBox/Runtime/r0drv/solaris/semeventmulti-r0drv-solaris.c b/src/VBox/Runtime/r0drv/solaris/semeventmulti-r0drv-solaris.c
index 49a794c..a4fab1a 100644
--- a/src/VBox/Runtime/r0drv/solaris/semeventmulti-r0drv-solaris.c
+++ b/src/VBox/Runtime/r0drv/solaris/semeventmulti-r0drv-solaris.c
@@ -25,9 +25,9 @@
*/
-/*******************************************************************************
-* Header Files *
-*******************************************************************************/
+/*********************************************************************************************************************************
+* Header Files *
+*********************************************************************************************************************************/
#define RTSEMEVENTMULTI_WITHOUT_REMAPPING
#include "the-solaris-kernel.h"
#include "internal/iprt.h"
@@ -48,9 +48,9 @@
#include "semeventwait-r0drv-solaris.h"
-/*******************************************************************************
-* Defined Constants And Macros *
-*******************************************************************************/
+/*********************************************************************************************************************************
+* Defined Constants And Macros *
+*********************************************************************************************************************************/
/** @name fStateAndGen values
* @{ */
/** The state bit number. */
@@ -66,9 +66,9 @@
/** @} */
-/*******************************************************************************
-* Structures and Typedefs *
-*******************************************************************************/
+/*********************************************************************************************************************************
+* Structures and Typedefs *
+*********************************************************************************************************************************/
/**
* Solaris multiple release event semaphore.
*/
diff --git a/src/VBox/Runtime/r0drv/solaris/semfastmutex-r0drv-solaris.c b/src/VBox/Runtime/r0drv/solaris/semfastmutex-r0drv-solaris.c
index 6a9f831..45f05f9 100644
--- a/src/VBox/Runtime/r0drv/solaris/semfastmutex-r0drv-solaris.c
+++ b/src/VBox/Runtime/r0drv/solaris/semfastmutex-r0drv-solaris.c
@@ -25,9 +25,9 @@
*/
-/*******************************************************************************
-* Header Files *
-*******************************************************************************/
+/*********************************************************************************************************************************
+* Header Files *
+*********************************************************************************************************************************/
#include "the-solaris-kernel.h"
#include "internal/iprt.h"
#include <iprt/semaphore.h>
@@ -43,9 +43,9 @@
#include "internal/magics.h"
-/*******************************************************************************
-* Structures and Typedefs *
-*******************************************************************************/
+/*********************************************************************************************************************************
+* Structures and Typedefs *
+*********************************************************************************************************************************/
/**
* Wrapper for the Solaris mutex.
*/
diff --git a/src/VBox/Runtime/r0drv/solaris/semmutex-r0drv-solaris.c b/src/VBox/Runtime/r0drv/solaris/semmutex-r0drv-solaris.c
index 6af479c..974fd7c 100644
--- a/src/VBox/Runtime/r0drv/solaris/semmutex-r0drv-solaris.c
+++ b/src/VBox/Runtime/r0drv/solaris/semmutex-r0drv-solaris.c
@@ -25,9 +25,9 @@
*/
-/*******************************************************************************
-* Header Files *
-*******************************************************************************/
+/*********************************************************************************************************************************
+* Header Files *
+*********************************************************************************************************************************/
#define RTSEMMUTEX_WITHOUT_REMAPPING
#include "the-solaris-kernel.h"
#include "internal/iprt.h"
@@ -46,9 +46,9 @@
#include "internal/magics.h"
-/*******************************************************************************
-* Structures and Typedefs *
-*******************************************************************************/
+/*********************************************************************************************************************************
+* Structures and Typedefs *
+*********************************************************************************************************************************/
/**
* Wrapper for the solaris semaphore structure.
*/
diff --git a/src/VBox/Runtime/r0drv/solaris/spinlock-r0drv-solaris.c b/src/VBox/Runtime/r0drv/solaris/spinlock-r0drv-solaris.c
index 2ff7c42..b5b7c73 100644
--- a/src/VBox/Runtime/r0drv/solaris/spinlock-r0drv-solaris.c
+++ b/src/VBox/Runtime/r0drv/solaris/spinlock-r0drv-solaris.c
@@ -25,9 +25,9 @@
*/
-/*******************************************************************************
-* Header Files *
-*******************************************************************************/
+/*********************************************************************************************************************************
+* Header Files *
+*********************************************************************************************************************************/
#include "the-solaris-kernel.h"
#include "internal/iprt.h"
#include <iprt/spinlock.h>
@@ -44,9 +44,9 @@
#include "internal/magics.h"
-/*******************************************************************************
-* Structures and Typedefs *
-*******************************************************************************/
+/*********************************************************************************************************************************
+* Structures and Typedefs *
+*********************************************************************************************************************************/
/**
* Wrapper for the struct mutex type.
*/
diff --git a/src/VBox/Runtime/r0drv/solaris/thread-r0drv-solaris.c b/src/VBox/Runtime/r0drv/solaris/thread-r0drv-solaris.c
index 1bf7eeb..6ea692c 100644
--- a/src/VBox/Runtime/r0drv/solaris/thread-r0drv-solaris.c
+++ b/src/VBox/Runtime/r0drv/solaris/thread-r0drv-solaris.c
@@ -25,9 +25,9 @@
*/
-/*******************************************************************************
-* Header Files *
-*******************************************************************************/
+/*********************************************************************************************************************************
+* Header Files *
+*********************************************************************************************************************************/
#include "the-solaris-kernel.h"
#include "internal/iprt.h"
#include <iprt/thread.h>
diff --git a/src/VBox/Runtime/r0drv/solaris/thread2-r0drv-solaris.c b/src/VBox/Runtime/r0drv/solaris/thread2-r0drv-solaris.c
index 7d9c2b5..7defa8c 100644
--- a/src/VBox/Runtime/r0drv/solaris/thread2-r0drv-solaris.c
+++ b/src/VBox/Runtime/r0drv/solaris/thread2-r0drv-solaris.c
@@ -25,9 +25,9 @@
*/
-/*******************************************************************************
-* Header Files *
-*******************************************************************************/
+/*********************************************************************************************************************************
+* Header Files *
+*********************************************************************************************************************************/
#include "the-solaris-kernel.h"
#include "internal/iprt.h"
#include <iprt/thread.h>
diff --git a/src/VBox/Runtime/r0drv/solaris/threadctxhooks-r0drv-solaris.c b/src/VBox/Runtime/r0drv/solaris/threadctxhooks-r0drv-solaris.c
index b1b2e83..2129e51 100644
--- a/src/VBox/Runtime/r0drv/solaris/threadctxhooks-r0drv-solaris.c
+++ b/src/VBox/Runtime/r0drv/solaris/threadctxhooks-r0drv-solaris.c
@@ -25,9 +25,9 @@
*/
-/*******************************************************************************
-* Header Files *
-*******************************************************************************/
+/*********************************************************************************************************************************
+* Header Files *
+*********************************************************************************************************************************/
#include "the-solaris-kernel.h"
#include "internal/iprt.h"
@@ -40,9 +40,9 @@
#include "internal/thread.h"
-/*******************************************************************************
-* Structures and Typedefs *
-*******************************************************************************/
+/*********************************************************************************************************************************
+* Structures and Typedefs *
+*********************************************************************************************************************************/
/**
* The internal hook object for solaris.
*/
@@ -64,9 +64,9 @@ typedef struct RTTHREADCTXHOOKINT
typedef RTTHREADCTXHOOKINT *PRTTHREADCTXHOOKINT;
-/*******************************************************************************
-* Defined Constants And Macros *
-*******************************************************************************/
+/*********************************************************************************************************************************
+* Defined Constants And Macros *
+*********************************************************************************************************************************/
/** Validates a hook handle and returns rc if not valid. */
#define RTTHREADCTX_VALID_RETURN_RC(pThis, rc) \
do { \
diff --git a/src/VBox/Runtime/r0drv/solaris/time-r0drv-solaris.c b/src/VBox/Runtime/r0drv/solaris/time-r0drv-solaris.c
index 861c402..e82e9bf 100644
--- a/src/VBox/Runtime/r0drv/solaris/time-r0drv-solaris.c
+++ b/src/VBox/Runtime/r0drv/solaris/time-r0drv-solaris.c
@@ -25,9 +25,9 @@
*/
-/*******************************************************************************
-* Header Files *
-*******************************************************************************/
+/*********************************************************************************************************************************
+* Header Files *
+*********************************************************************************************************************************/
#define RTTIME_INCL_TIMESPEC
#include "the-solaris-kernel.h"
#include "internal/iprt.h"
diff --git a/src/VBox/Runtime/r0drv/solaris/timer-r0drv-solaris.c b/src/VBox/Runtime/r0drv/solaris/timer-r0drv-solaris.c
index 6f4b5e7..d975328 100644
--- a/src/VBox/Runtime/r0drv/solaris/timer-r0drv-solaris.c
+++ b/src/VBox/Runtime/r0drv/solaris/timer-r0drv-solaris.c
@@ -25,9 +25,9 @@
*/
-/*******************************************************************************
-* Header Files *
-*******************************************************************************/
+/*********************************************************************************************************************************
+* Header Files *
+*********************************************************************************************************************************/
#include "the-solaris-kernel.h"
#include "internal/iprt.h"
#include <iprt/timer.h>
@@ -46,9 +46,9 @@
#include "internal/magics.h"
-/*******************************************************************************
-* Structures and Typedefs *
-*******************************************************************************/
+/*********************************************************************************************************************************
+* Structures and Typedefs *
+*********************************************************************************************************************************/
/**
* The internal representation of a Solaris timer handle.
*/
@@ -120,9 +120,9 @@ typedef struct RTTIMER
} RTTIMER;
-/*******************************************************************************
-* Defined Constants And Macros *
-*******************************************************************************/
+/*********************************************************************************************************************************
+* Defined Constants And Macros *
+*********************************************************************************************************************************/
/** Validates that the timer is valid. */
#define RTTIMER_ASSERT_VALID_RET(pTimer) \
do \
@@ -133,9 +133,9 @@ typedef struct RTTIMER
} while (0)
-/*******************************************************************************
-* Internal Functions *
-*******************************************************************************/
+/*********************************************************************************************************************************
+* Internal Functions *
+*********************************************************************************************************************************/
static void rtTimerSolSingleCallbackWrapper(void *pvArg);
static void rtTimerSolStopIt(PRTTIMER pTimer);
diff --git a/src/VBox/Runtime/r3/alloc-ef-cpp.cpp b/src/VBox/Runtime/r3/alloc-ef-cpp.cpp
index 5c42ff1..7f51f20 100644
--- a/src/VBox/Runtime/r3/alloc-ef-cpp.cpp
+++ b/src/VBox/Runtime/r3/alloc-ef-cpp.cpp
@@ -24,18 +24,19 @@
* terms and conditions of either the GPL or the CDDL or both.
*/
-/*******************************************************************************
-* Header Files *
-*******************************************************************************/
+
+/*********************************************************************************************************************************
+* Header Files *
+*********************************************************************************************************************************/
#include "alloc-ef.h"
#include <iprt/asm.h>
#include <new>
-/*******************************************************************************
-* Defined Constants And Macros *
-*******************************************************************************/
+/*********************************************************************************************************************************
+* Defined Constants And Macros *
+*********************************************************************************************************************************/
/** @todo test this on MSC */
/** MSC declares the operators as cdecl it seems. */
@@ -56,15 +57,18 @@
#ifdef RT_EXCEPTIONS_ENABLED
# ifdef _MSC_VER
# define RT_EF_THROWS_BAD_ALLOC
+# define RT_EF_NOTHROW RT_NO_THROW_DEF
# else
# ifdef _GLIBCXX_THROW
# define RT_EF_THROWS_BAD_ALLOC _GLIBCXX_THROW(std::bad_alloc)
# else
# define RT_EF_THROWS_BAD_ALLOC throw(std::bad_alloc)
# endif
+# define RT_EF_NOTHROW throw()
# endif
#else /* !RT_EXCEPTIONS_ENABLED */
# define RT_EF_THROWS_BAD_ALLOC
+# define RT_EF_NOTHROW
#endif /* !RT_EXCEPTIONS_ENABLED */
@@ -77,20 +81,20 @@ void *RT_EF_CDECL operator new(RT_EF_SIZE_T cb) RT_EF_THROWS_BAD_ALLOC
}
-void *RT_EF_CDECL operator new(RT_EF_SIZE_T cb, const std::nothrow_t &) RT_NO_THROW
+void *RT_EF_CDECL operator new(RT_EF_SIZE_T cb, const std::nothrow_t &) RT_EF_NOTHROW
{
void *pv = rtR3MemAlloc("new nothrow", RTMEMTYPE_NEW, cb, cb, NULL, ASMReturnAddress(), NULL, 0, NULL);
return pv;
}
-void RT_EF_CDECL operator delete(void *pv) RT_NO_THROW
+void RT_EF_CDECL operator delete(void *pv) RT_EF_NOTHROW
{
rtR3MemFree("delete", RTMEMTYPE_DELETE, pv, ASMReturnAddress(), NULL, 0, NULL);
}
-void RT_EF_CDECL operator delete(void * pv, const std::nothrow_t &) RT_NO_THROW
+void RT_EF_CDECL operator delete(void * pv, const std::nothrow_t &) RT_EF_NOTHROW
{
rtR3MemFree("delete nothrow", RTMEMTYPE_DELETE, pv, ASMReturnAddress(), NULL, 0, NULL);
}
@@ -113,20 +117,20 @@ void *RT_EF_CDECL operator new[](RT_EF_SIZE_T cb) RT_EF_THROWS_BAD_ALLOC
}
-void * RT_EF_CDECL operator new[](RT_EF_SIZE_T cb, const std::nothrow_t &) RT_NO_THROW
+void * RT_EF_CDECL operator new[](RT_EF_SIZE_T cb, const std::nothrow_t &) RT_EF_NOTHROW
{
void *pv = rtR3MemAlloc("new[] nothrow", RTMEMTYPE_NEW_ARRAY, cb, cb, NULL, ASMReturnAddress(), NULL, 0, NULL);
return pv;
}
-void RT_EF_CDECL operator delete[](void * pv) RT_NO_THROW
+void RT_EF_CDECL operator delete[](void * pv) RT_EF_NOTHROW
{
rtR3MemFree("delete[]", RTMEMTYPE_DELETE_ARRAY, pv, ASMReturnAddress(), NULL, 0, NULL);
}
-void RT_EF_CDECL operator delete[](void *pv, const std::nothrow_t &) RT_NO_THROW
+void RT_EF_CDECL operator delete[](void *pv, const std::nothrow_t &) RT_EF_NOTHROW
{
rtR3MemFree("delete[] nothrow", RTMEMTYPE_DELETE_ARRAY, pv, ASMReturnAddress(), NULL, 0, NULL);
}
diff --git a/src/VBox/Runtime/r3/alloc-ef.cpp b/src/VBox/Runtime/r3/alloc-ef.cpp
index 62dff38..0245138 100644
--- a/src/VBox/Runtime/r3/alloc-ef.cpp
+++ b/src/VBox/Runtime/r3/alloc-ef.cpp
@@ -25,9 +25,9 @@
*/
-/*******************************************************************************
-* Header Files *
-*******************************************************************************/
+/*********************************************************************************************************************************
+* Header Files *
+*********************************************************************************************************************************/
#include "alloc-ef.h"
#include <iprt/mem.h>
#include <iprt/log.h>
@@ -54,18 +54,18 @@
#endif
-/*******************************************************************************
-* Defined Constants And Macros *
-*******************************************************************************/
+/*********************************************************************************************************************************
+* Defined Constants And Macros *
+*********************************************************************************************************************************/
#ifdef RTALLOC_REPLACE_MALLOC
# define RTMEM_REPLACMENT_ALIGN(a_cb) ((a_cb) >= 16 ? RT_ALIGN_Z(a_cb, 16) \
: (a_cb) >= sizeof(uintptr_t) ? RT_ALIGN_Z(a_cb, sizeof(uintptr_t)) : (a_cb))
#endif
-/*******************************************************************************
-* Global Variables *
-*******************************************************************************/
+/*********************************************************************************************************************************
+* Global Variables *
+*********************************************************************************************************************************/
#ifdef RTALLOC_EFENCE_TRACE
/** Spinlock protecting the all the block's globals. */
static volatile uint32_t g_BlocksLock;
@@ -96,9 +96,9 @@ void *gapvRTMemFreeWatch[4] = {NULL, NULL, NULL, NULL};
bool gfRTMemFreeLog = false;
-/*******************************************************************************
-* Internal Functions *
-*******************************************************************************/
+/*********************************************************************************************************************************
+* Internal Functions *
+*********************************************************************************************************************************/
#ifdef RTALLOC_REPLACE_MALLOC
static void rtMemReplaceMallocAndFriends(void);
#endif
@@ -824,38 +824,38 @@ RTDECL(void *) rtR3MemRealloc(const char *pszOp, RTMEMTYPE enmType, void *pvOld,
-RTDECL(void *) RTMemEfTmpAlloc(size_t cb, const char *pszTag, RT_SRC_POS_DECL) RT_NO_THROW
+RTDECL(void *) RTMemEfTmpAlloc(size_t cb, const char *pszTag, RT_SRC_POS_DECL) RT_NO_THROW_DEF
{
return rtR3MemAlloc("TmpAlloc", RTMEMTYPE_RTMEMALLOC, cb, cb, pszTag, ASMReturnAddress(), RT_SRC_POS_ARGS);
}
-RTDECL(void *) RTMemEfTmpAllocZ(size_t cb, const char *pszTag, RT_SRC_POS_DECL) RT_NO_THROW
+RTDECL(void *) RTMemEfTmpAllocZ(size_t cb, const char *pszTag, RT_SRC_POS_DECL) RT_NO_THROW_DEF
{
return rtR3MemAlloc("TmpAlloc", RTMEMTYPE_RTMEMALLOCZ, cb, cb, pszTag, ASMReturnAddress(), RT_SRC_POS_ARGS);
}
-RTDECL(void) RTMemEfTmpFree(void *pv, RT_SRC_POS_DECL) RT_NO_THROW
+RTDECL(void) RTMemEfTmpFree(void *pv, RT_SRC_POS_DECL) RT_NO_THROW_DEF
{
if (pv)
rtR3MemFree("Free", RTMEMTYPE_RTMEMFREE, pv, ASMReturnAddress(), RT_SRC_POS_ARGS);
}
-RTDECL(void *) RTMemEfAlloc(size_t cb, const char *pszTag, RT_SRC_POS_DECL) RT_NO_THROW
+RTDECL(void *) RTMemEfAlloc(size_t cb, const char *pszTag, RT_SRC_POS_DECL) RT_NO_THROW_DEF
{
return rtR3MemAlloc("Alloc", RTMEMTYPE_RTMEMALLOC, cb, cb, pszTag, ASMReturnAddress(), RT_SRC_POS_ARGS);
}
-RTDECL(void *) RTMemEfAllocZ(size_t cb, const char *pszTag, RT_SRC_POS_DECL) RT_NO_THROW
+RTDECL(void *) RTMemEfAllocZ(size_t cb, const char *pszTag, RT_SRC_POS_DECL) RT_NO_THROW_DEF
{
return rtR3MemAlloc("AllocZ", RTMEMTYPE_RTMEMALLOCZ, cb, cb, pszTag, ASMReturnAddress(), RT_SRC_POS_ARGS);
}
-RTDECL(void *) RTMemEfAllocVar(size_t cbUnaligned, const char *pszTag, RT_SRC_POS_DECL) RT_NO_THROW
+RTDECL(void *) RTMemEfAllocVar(size_t cbUnaligned, const char *pszTag, RT_SRC_POS_DECL) RT_NO_THROW_DEF
{
size_t cbAligned;
if (cbUnaligned >= 16)
@@ -866,7 +866,7 @@ RTDECL(void *) RTMemEfAllocVar(size_t cbUnaligned, const char *pszTag, RT_SRC_P
}
-RTDECL(void *) RTMemEfAllocZVar(size_t cbUnaligned, const char *pszTag, RT_SRC_POS_DECL) RT_NO_THROW
+RTDECL(void *) RTMemEfAllocZVar(size_t cbUnaligned, const char *pszTag, RT_SRC_POS_DECL) RT_NO_THROW_DEF
{
size_t cbAligned;
if (cbUnaligned >= 16)
@@ -877,20 +877,20 @@ RTDECL(void *) RTMemEfAllocZVar(size_t cbUnaligned, const char *pszTag, RT_SRC_
}
-RTDECL(void *) RTMemEfRealloc(void *pvOld, size_t cbNew, const char *pszTag, RT_SRC_POS_DECL) RT_NO_THROW
+RTDECL(void *) RTMemEfRealloc(void *pvOld, size_t cbNew, const char *pszTag, RT_SRC_POS_DECL) RT_NO_THROW_DEF
{
return rtR3MemRealloc("Realloc", RTMEMTYPE_RTMEMREALLOC, pvOld, cbNew, pszTag, ASMReturnAddress(), RT_SRC_POS_ARGS);
}
-RTDECL(void) RTMemEfFree(void *pv, RT_SRC_POS_DECL) RT_NO_THROW
+RTDECL(void) RTMemEfFree(void *pv, RT_SRC_POS_DECL) RT_NO_THROW_DEF
{
if (pv)
rtR3MemFree("Free", RTMEMTYPE_RTMEMFREE, pv, ASMReturnAddress(), RT_SRC_POS_ARGS);
}
-RTDECL(void *) RTMemEfDup(const void *pvSrc, size_t cb, const char *pszTag, RT_SRC_POS_DECL) RT_NO_THROW
+RTDECL(void *) RTMemEfDup(const void *pvSrc, size_t cb, const char *pszTag, RT_SRC_POS_DECL) RT_NO_THROW_DEF
{
void *pvDst = RTMemEfAlloc(cb, pszTag, RT_SRC_POS_ARGS);
if (pvDst)
@@ -899,7 +899,7 @@ RTDECL(void *) RTMemEfDup(const void *pvSrc, size_t cb, const char *pszTag, RT_S
}
-RTDECL(void *) RTMemEfDupEx(const void *pvSrc, size_t cbSrc, size_t cbExtra, const char *pszTag, RT_SRC_POS_DECL) RT_NO_THROW
+RTDECL(void *) RTMemEfDupEx(const void *pvSrc, size_t cbSrc, size_t cbExtra, const char *pszTag, RT_SRC_POS_DECL) RT_NO_THROW_DEF
{
void *pvDst = RTMemEfAlloc(cbSrc + cbExtra, pszTag, RT_SRC_POS_ARGS);
if (pvDst)
@@ -921,38 +921,38 @@ RTDECL(void *) RTMemEfDupEx(const void *pvSrc, size_t cbSrc, size_t cbExtra, con
-RTDECL(void *) RTMemEfTmpAllocNP(size_t cb, const char *pszTag) RT_NO_THROW
+RTDECL(void *) RTMemEfTmpAllocNP(size_t cb, const char *pszTag) RT_NO_THROW_DEF
{
return rtR3MemAlloc("TmpAlloc", RTMEMTYPE_RTMEMALLOC, cb, cb, pszTag, ASMReturnAddress(), NULL, 0, NULL);
}
-RTDECL(void *) RTMemEfTmpAllocZNP(size_t cb, const char *pszTag) RT_NO_THROW
+RTDECL(void *) RTMemEfTmpAllocZNP(size_t cb, const char *pszTag) RT_NO_THROW_DEF
{
return rtR3MemAlloc("TmpAllocZ", RTMEMTYPE_RTMEMALLOCZ, cb, cb, pszTag, ASMReturnAddress(), NULL, 0, NULL);
}
-RTDECL(void) RTMemEfTmpFreeNP(void *pv) RT_NO_THROW
+RTDECL(void) RTMemEfTmpFreeNP(void *pv) RT_NO_THROW_DEF
{
if (pv)
rtR3MemFree("Free", RTMEMTYPE_RTMEMFREE, pv, ASMReturnAddress(), NULL, 0, NULL);
}
-RTDECL(void *) RTMemEfAllocNP(size_t cb, const char *pszTag) RT_NO_THROW
+RTDECL(void *) RTMemEfAllocNP(size_t cb, const char *pszTag) RT_NO_THROW_DEF
{
return rtR3MemAlloc("Alloc", RTMEMTYPE_RTMEMALLOC, cb, cb, pszTag, ASMReturnAddress(), NULL, 0, NULL);
}
-RTDECL(void *) RTMemEfAllocZNP(size_t cb, const char *pszTag) RT_NO_THROW
+RTDECL(void *) RTMemEfAllocZNP(size_t cb, const char *pszTag) RT_NO_THROW_DEF
{
return rtR3MemAlloc("AllocZ", RTMEMTYPE_RTMEMALLOCZ, cb, cb, pszTag, ASMReturnAddress(), NULL, 0, NULL);
}
-RTDECL(void *) RTMemEfAllocVarNP(size_t cbUnaligned, const char *pszTag) RT_NO_THROW
+RTDECL(void *) RTMemEfAllocVarNP(size_t cbUnaligned, const char *pszTag) RT_NO_THROW_DEF
{
size_t cbAligned;
if (cbUnaligned >= 16)
@@ -963,7 +963,7 @@ RTDECL(void *) RTMemEfAllocVarNP(size_t cbUnaligned, const char *pszTag) RT_NO_
}
-RTDECL(void *) RTMemEfAllocZVarNP(size_t cbUnaligned, const char *pszTag) RT_NO_THROW
+RTDECL(void *) RTMemEfAllocZVarNP(size_t cbUnaligned, const char *pszTag) RT_NO_THROW_DEF
{
size_t cbAligned;
if (cbUnaligned >= 16)
@@ -974,20 +974,20 @@ RTDECL(void *) RTMemEfAllocZVarNP(size_t cbUnaligned, const char *pszTag) RT_NO
}
-RTDECL(void *) RTMemEfReallocNP(void *pvOld, size_t cbNew, const char *pszTag) RT_NO_THROW
+RTDECL(void *) RTMemEfReallocNP(void *pvOld, size_t cbNew, const char *pszTag) RT_NO_THROW_DEF
{
return rtR3MemRealloc("Realloc", RTMEMTYPE_RTMEMREALLOC, pvOld, cbNew, pszTag, ASMReturnAddress(), NULL, 0, NULL);
}
-RTDECL(void) RTMemEfFreeNP(void *pv) RT_NO_THROW
+RTDECL(void) RTMemEfFreeNP(void *pv) RT_NO_THROW_DEF
{
if (pv)
rtR3MemFree("Free", RTMEMTYPE_RTMEMFREE, pv, ASMReturnAddress(), NULL, 0, NULL);
}
-RTDECL(void *) RTMemEfDupNP(const void *pvSrc, size_t cb, const char *pszTag) RT_NO_THROW
+RTDECL(void *) RTMemEfDupNP(const void *pvSrc, size_t cb, const char *pszTag) RT_NO_THROW_DEF
{
void *pvDst = RTMemEfAlloc(cb, pszTag, NULL, 0, NULL);
if (pvDst)
@@ -996,7 +996,7 @@ RTDECL(void *) RTMemEfDupNP(const void *pvSrc, size_t cb, const char *pszTag) RT
}
-RTDECL(void *) RTMemEfDupExNP(const void *pvSrc, size_t cbSrc, size_t cbExtra, const char *pszTag) RT_NO_THROW
+RTDECL(void *) RTMemEfDupExNP(const void *pvSrc, size_t cbSrc, size_t cbExtra, const char *pszTag) RT_NO_THROW_DEF
{
void *pvDst = RTMemEfAlloc(cbSrc + cbExtra, pszTag, NULL, 0, NULL);
if (pvDst)
diff --git a/src/VBox/Runtime/r3/alloc.cpp b/src/VBox/Runtime/r3/alloc.cpp
index 1d01651..f236879 100644
--- a/src/VBox/Runtime/r3/alloc.cpp
+++ b/src/VBox/Runtime/r3/alloc.cpp
@@ -25,9 +25,9 @@
*/
-/*******************************************************************************
-* Defined Constants And Macros *
-*******************************************************************************/
+/*********************************************************************************************************************************
+* Defined Constants And Macros *
+*********************************************************************************************************************************/
#if defined(RTMEM_WRAP_TO_EF_APIS) && !defined(RTMEM_NO_WRAP_TO_EF_APIS)
# undef RTMEM_WRAP_TO_EF_APIS
# define RTALLOC_USE_EFENCE 1
@@ -44,9 +44,9 @@
#endif
-/*******************************************************************************
-* Header Files *
-*******************************************************************************/
+/*********************************************************************************************************************************
+* Header Files *
+*********************************************************************************************************************************/
#include "alloc-ef.h"
#include <iprt/mem.h>
@@ -85,25 +85,25 @@
#undef RTALLOC_USE_EFENCE
-RTDECL(void *) RTMemTmpAllocTag(size_t cb, const char *pszTag) RT_NO_THROW
+RTDECL(void *) RTMemTmpAllocTag(size_t cb, const char *pszTag) RT_NO_THROW_DEF
{
return RTMemAllocTag(cb, pszTag);
}
-RTDECL(void *) RTMemTmpAllocZTag(size_t cb, const char *pszTag) RT_NO_THROW
+RTDECL(void *) RTMemTmpAllocZTag(size_t cb, const char *pszTag) RT_NO_THROW_DEF
{
return RTMemAllocZTag(cb, pszTag);
}
-RTDECL(void) RTMemTmpFree(void *pv) RT_NO_THROW
+RTDECL(void) RTMemTmpFree(void *pv) RT_NO_THROW_DEF
{
RTMemFree(pv);
}
-RTDECL(void *) RTMemAllocTag(size_t cb, const char *pszTag) RT_NO_THROW
+RTDECL(void *) RTMemAllocTag(size_t cb, const char *pszTag) RT_NO_THROW_DEF
{
#ifdef RTALLOC_USE_EFENCE
void *pv = rtR3MemAlloc("Alloc", RTMEMTYPE_RTMEMALLOC, cb, cb, pszTag, ASMReturnAddress(), NULL, 0, NULL);
@@ -126,7 +126,7 @@ RTDECL(void *) RTMemAllocTag(size_t cb, const char *pszTag) RT_NO_THROW
}
-RTDECL(void *) RTMemAllocZTag(size_t cb, const char *pszTag) RT_NO_THROW
+RTDECL(void *) RTMemAllocZTag(size_t cb, const char *pszTag) RT_NO_THROW_DEF
{
#ifdef RTALLOC_USE_EFENCE
void *pv = rtR3MemAlloc("AllocZ", RTMEMTYPE_RTMEMALLOCZ, cb, cb, pszTag, ASMReturnAddress(), NULL, 0, NULL);
@@ -150,7 +150,7 @@ RTDECL(void *) RTMemAllocZTag(size_t cb, const char *pszTag) RT_NO_THROW
}
-RTDECL(void *) RTMemAllocVarTag(size_t cbUnaligned, const char *pszTag) RT_NO_THROW
+RTDECL(void *) RTMemAllocVarTag(size_t cbUnaligned, const char *pszTag) RT_NO_THROW_DEF
{
size_t cbAligned;
if (cbUnaligned >= 16)
@@ -166,7 +166,7 @@ RTDECL(void *) RTMemAllocVarTag(size_t cbUnaligned, const char *pszTag) RT_NO_TH
}
-RTDECL(void *) RTMemAllocZVarTag(size_t cbUnaligned, const char *pszTag) RT_NO_THROW
+RTDECL(void *) RTMemAllocZVarTag(size_t cbUnaligned, const char *pszTag) RT_NO_THROW_DEF
{
size_t cbAligned;
if (cbUnaligned >= 16)
@@ -182,7 +182,7 @@ RTDECL(void *) RTMemAllocZVarTag(size_t cbUnaligned, const char *pszTag) RT_NO_T
}
-RTDECL(void *) RTMemReallocTag(void *pvOld, size_t cbNew, const char *pszTag) RT_NO_THROW
+RTDECL(void *) RTMemReallocTag(void *pvOld, size_t cbNew, const char *pszTag) RT_NO_THROW_DEF
{
#ifdef RTALLOC_USE_EFENCE
void *pv = rtR3MemRealloc("Realloc", RTMEMTYPE_RTMEMREALLOC, pvOld, cbNew, pszTag, ASMReturnAddress(), NULL, 0, NULL);
@@ -207,7 +207,7 @@ RTDECL(void *) RTMemReallocTag(void *pvOld, size_t cbNew, const char *pszTag) R
}
-RTDECL(void) RTMemFree(void *pv) RT_NO_THROW
+RTDECL(void) RTMemFree(void *pv) RT_NO_THROW_DEF
{
if (pv)
#ifdef RTALLOC_USE_EFENCE
diff --git a/src/VBox/Runtime/r3/allocex.cpp b/src/VBox/Runtime/r3/allocex.cpp
index 3dba0ff..61b71bc 100644
--- a/src/VBox/Runtime/r3/allocex.cpp
+++ b/src/VBox/Runtime/r3/allocex.cpp
@@ -25,9 +25,9 @@
*/
-/*******************************************************************************
-* Header Files *
-*******************************************************************************/
+/*********************************************************************************************************************************
+* Header Files *
+*********************************************************************************************************************************/
#define RTMEM_NO_WRAP_TO_EF_APIS
#include <iprt/mem.h>
#include "internal/iprt.h"
@@ -38,7 +38,7 @@
#include "allocex.h"
-RTDECL(int) RTMemAllocExTag(size_t cb, size_t cbAlignment, uint32_t fFlags, const char *pszTag, void **ppv) RT_NO_THROW
+RTDECL(int) RTMemAllocExTag(size_t cb, size_t cbAlignment, uint32_t fFlags, const char *pszTag, void **ppv) RT_NO_THROW_DEF
{
/*
* Validate and adjust input.
@@ -104,7 +104,7 @@ RTDECL(int) RTMemAllocExTag(size_t cb, size_t cbAlignment, uint32_t fFlags, cons
RT_EXPORT_SYMBOL(RTMemAllocExTag);
-RTDECL(void) RTMemFreeEx(void *pv, size_t cb) RT_NO_THROW
+RTDECL(void) RTMemFreeEx(void *pv, size_t cb) RT_NO_THROW_DEF
{
if (!pv)
return;
diff --git a/src/VBox/Runtime/r3/darwin/RTCrStoreCreateSnapshotById-darwin.cpp b/src/VBox/Runtime/r3/darwin/RTCrStoreCreateSnapshotById-darwin.cpp
new file mode 100644
index 0000000..6b82afb
--- /dev/null
+++ b/src/VBox/Runtime/r3/darwin/RTCrStoreCreateSnapshotById-darwin.cpp
@@ -0,0 +1,249 @@
+/* $Id: RTCrStoreCreateSnapshotById-darwin.cpp $ */
+/** @file
+ * IPRT - RTCrStoreCreateSnapshotById, Darwin.
+ */
+
+/*
+ * Copyright (C) 2006-2015 Oracle Corporation
+ *
+ * This file is part of VirtualBox Open Source Edition (OSE), as
+ * available from http://www.virtualbox.org. This file is free software;
+ * you can redistribute it and/or modify it under the terms of the GNU
+ * General Public License (GPL) as published by the Free Software
+ * Foundation, in version 2 as it comes in the "COPYING" file of the
+ * VirtualBox OSE distribution. VirtualBox OSE is distributed in the
+ * hope that it will be useful, but WITHOUT ANY WARRANTY of any kind.
+ *
+ * The contents of this file may alternatively be used under the terms
+ * of the Common Development and Distribution License Version 1.0
+ * (CDDL) only, as it comes in the "COPYING.CDDL" file of the
+ * VirtualBox OSE distribution, in which case the provisions of the
+ * CDDL are applicable instead of those of the GPL.
+ *
+ * You may elect to license modified versions of this file under the
+ * terms and conditions of either the GPL or the CDDL or both.
+ */
+
+
+/*********************************************************************************************************************************
+* Header Files *
+*********************************************************************************************************************************/
+#include <iprt/crypto/store.h>
+#include "internal/iprt.h"
+
+#include <iprt/assert.h>
+#include <iprt/err.h>
+#include <iprt/file.h>
+
+/* HACK ALERT! Shut up those deprecated messages on SecKeychainSearchCreateFromAttributes and SecKeychainSearchCopyNext. */
+#include <CoreFoundation/CoreFoundation.h>
+#undef DEPRECATED_IN_MAC_OS_X_VERSION_10_7_AND_LATER
+#define DEPRECATED_IN_MAC_OS_X_VERSION_10_7_AND_LATER
+
+#include <Security/Security.h>
+
+
+/**
+ * Checks the trust settings of the certificate.
+ *
+ * @returns true if not out-right distructed, otherwise false.
+ * @param hCert The certificate.
+ * @param enmTrustDomain The trust settings domain to check relative to.
+ */
+static bool rtCrStoreIsDarwinCertTrustworthy(SecCertificateRef hCert, SecTrustSettingsDomain enmTrustDomain)
+{
+ bool fResult = true;
+ CFArrayRef hTrustSettings;
+ OSStatus orc = SecTrustSettingsCopyTrustSettings(hCert, enmTrustDomain, &hTrustSettings);
+ if (orc == noErr)
+ {
+ CFIndex const cTrustSettings = CFArrayGetCount(hTrustSettings);
+ for (CFIndex i = 0; i < cTrustSettings; i++)
+ {
+ CFDictionaryRef hDict = (CFDictionaryRef)CFArrayGetValueAtIndex(hTrustSettings, i);
+ AssertStmt(CFGetTypeID(hDict) == CFDictionaryGetTypeID(), continue);
+
+ CFNumberRef hNum = (CFNumberRef)CFDictionaryGetValue(hDict, kSecTrustSettingsResult);
+ if (hNum)
+ {
+ AssertStmt(CFGetTypeID(hNum) == CFNumberGetTypeID(), continue);
+ SInt32 iNum;
+ if (CFNumberGetValue(hNum, kCFNumberSInt32Type, &iNum))
+ {
+ if (iNum == kSecTrustSettingsResultDeny)
+ {
+ fResult = false;
+ break;
+ }
+ }
+ /* No need to release hNum (get rule). */
+ }
+ /* No need to release hDict (get rule). */
+ }
+ CFRelease(hTrustSettings);
+ }
+ else if (orc != errSecItemNotFound)
+ {
+ AssertFailed();
+ fResult = false;
+ }
+ return fResult;
+}
+
+
+static int rtCrStoreAddCertsFromNativeKeychain(RTCRSTORE hStore, SecKeychainRef hKeychain, SecTrustSettingsDomain enmTrustDomain,
+ int rc, PRTERRINFO pErrInfo)
+{
+ /*
+ * Enumerate the certificates in the keychain.
+ */
+ SecKeychainSearchRef hSearch;
+ OSStatus orc = SecKeychainSearchCreateFromAttributes(hKeychain, kSecCertificateItemClass, NULL, &hSearch);
+ if (orc == noErr)
+ {
+ SecKeychainItemRef hItem;
+ while ((orc = SecKeychainSearchCopyNext(hSearch, &hItem)) == noErr)
+ {
+ Assert(CFGetTypeID(hItem) == SecCertificateGetTypeID());
+ SecCertificateRef hCert = (SecCertificateRef)hItem;
+
+ /*
+ * Check if the current certificate is at all trusted, skip it if it's isn't.
+ */
+ if (rtCrStoreIsDarwinCertTrustworthy(hCert, enmTrustDomain))
+ {
+ /*
+ * Get the certificate data.
+ */
+ CFDataRef hEncodedCert = SecCertificateCopyData(hCert);
+ Assert(hEncodedCert);
+ if (hEncodedCert)
+ {
+ CFIndex cbEncoded = CFDataGetLength(hEncodedCert);
+ const uint8_t *pbEncoded = CFDataGetBytePtr(hEncodedCert);
+
+ RTERRINFOSTATIC StaticErrInfo;
+ int rc2 = RTCrStoreCertAddEncoded(hStore, RTCRCERTCTX_F_ENC_X509_DER | RTCRCERTCTX_F_ADD_IF_NOT_FOUND,
+ pbEncoded, cbEncoded, RTErrInfoInitStatic(&StaticErrInfo));
+ if (RT_FAILURE(rc2))
+ {
+ if (RTErrInfoIsSet(&StaticErrInfo.Core))
+ RTErrInfoAddF(pErrInfo, -rc2, " %s", StaticErrInfo.Core.pszMsg);
+ else
+ RTErrInfoAddF(pErrInfo, -rc2, " %Rrc adding cert", rc2);
+ rc = -rc2;
+ }
+
+ CFRelease(hEncodedCert);
+ }
+ }
+
+ CFRelease(hItem);
+ }
+ if (orc != errSecItemNotFound)
+ rc = RTErrInfoAddF(pErrInfo, -VERR_SEARCH_ERROR,
+ " SecKeychainSearchCopyNext failed with %#x", orc);
+ CFRelease(hSearch);
+ }
+ else
+ rc = RTErrInfoAddF(pErrInfo, -VERR_SEARCH_ERROR,
+ " SecKeychainSearchCreateFromAttributes failed with %#x", orc);
+ return rc;
+}
+
+
+static int rtCrStoreAddCertsFromNativeKeychainFile(RTCRSTORE hStore, const char *pszKeychain,
+ SecTrustSettingsDomain enmTrustDomain,
+ int rc, PRTERRINFO pErrInfo)
+{
+ /*
+ * Open the keychain and call common worker to do the job.
+ */
+ SecKeychainRef hKeychain;
+ OSStatus orc = SecKeychainOpen(pszKeychain, &hKeychain);
+ if (orc == noErr)
+ {
+ rc = rtCrStoreAddCertsFromNativeKeychain(hStore, hKeychain, enmTrustDomain, rc, pErrInfo);
+
+ CFRelease(hKeychain);
+ }
+ else if (RTFileExists(pszKeychain))
+ rc = RTErrInfoAddF(pErrInfo, -VERR_OPEN_FAILED, " SecKeychainOpen failed with %#x on '%s'", orc, pszKeychain);
+ return rc;
+}
+
+
+static int rtCrStoreAddCertsFromNativeKeystoreDomain(RTCRSTORE hStore, SecPreferencesDomain enmDomain,
+ SecTrustSettingsDomain enmTrustDomain,
+ int rc, PRTERRINFO pErrInfo)
+{
+ /*
+ * Get a list of keystores for this domain and call common worker on each.
+ */
+ CFArrayRef hKeychains;
+ OSStatus orc = SecKeychainCopyDomainSearchList(enmDomain, &hKeychains);
+ if (orc == noErr)
+ {
+ CFIndex const cEntries = CFArrayGetCount(hKeychains);
+ for (CFIndex i = 0; i < cEntries; i++)
+ {
+ SecKeychainRef hKeychain = (SecKeychainRef)CFArrayGetValueAtIndex(hKeychains, i);
+ Assert(CFGetTypeID(hKeychain) == SecKeychainGetTypeID());
+ CFRetain(hKeychain);
+
+ rc = rtCrStoreAddCertsFromNativeKeychain(hStore, hKeychain, enmTrustDomain, rc, pErrInfo);
+
+ CFRelease(hKeychain);
+ }
+
+ CFRelease(hKeychains);
+ }
+ else
+ rc = RTErrInfoAddF(pErrInfo, -VERR_SEARCH_ERROR,
+ " SecKeychainCopyDomainSearchList failed with %#x on %d", orc, enmDomain);
+ return rc;
+}
+
+
+RTDECL(int) RTCrStoreCreateSnapshotById(PRTCRSTORE phStore, RTCRSTOREID enmStoreId, PRTERRINFO pErrInfo)
+{
+ AssertReturn(enmStoreId > RTCRSTOREID_INVALID && enmStoreId < RTCRSTOREID_END, VERR_INVALID_PARAMETER);
+
+ /*
+ * Create an empty in-memory store.
+ */
+ RTCRSTORE hStore;
+ int rc = RTCrStoreCreateInMem(&hStore, 128);
+ if (RT_SUCCESS(rc))
+ {
+ *phStore = hStore;
+
+ /*
+ * Load the certificates corresponding to the given virtual store ID.
+ */
+ switch (enmStoreId)
+ {
+ case RTCRSTOREID_USER_TRUSTED_CAS_AND_CERTIFICATES:
+ rc = rtCrStoreAddCertsFromNativeKeystoreDomain(hStore, kSecPreferencesDomainUser,
+ kSecTrustSettingsDomainUser, rc, pErrInfo);
+ break;
+
+ case RTCRSTOREID_SYSTEM_TRUSTED_CAS_AND_CERTIFICATES:
+ rc = rtCrStoreAddCertsFromNativeKeystoreDomain(hStore, kSecPreferencesDomainSystem,
+ kSecTrustSettingsDomainSystem, rc, pErrInfo);
+ rc = rtCrStoreAddCertsFromNativeKeychainFile(hStore,
+ "/System/Library/Keychains/SystemRootCertificates.keychain",
+ kSecTrustSettingsDomainSystem, rc, pErrInfo);
+ break;
+
+ default:
+ AssertFailed(); /* implement me */
+ }
+ }
+ else
+ RTErrInfoSet(pErrInfo, rc, "RTCrStoreCreateInMem failed");
+ return rc;
+}
+RT_EXPORT_SYMBOL(RTCrStoreCreateSnapshotById);
+
+
diff --git a/src/VBox/Runtime/r3/darwin/RTPathUserDocuments-darwin.cpp b/src/VBox/Runtime/r3/darwin/RTPathUserDocuments-darwin.cpp
index df2fef9..b4e0604 100644
--- a/src/VBox/Runtime/r3/darwin/RTPathUserDocuments-darwin.cpp
+++ b/src/VBox/Runtime/r3/darwin/RTPathUserDocuments-darwin.cpp
@@ -24,9 +24,10 @@
* terms and conditions of either the GPL or the CDDL or both.
*/
-/*******************************************************************************
-* Header Files *
-*******************************************************************************/
+
+/*********************************************************************************************************************************
+* Header Files *
+*********************************************************************************************************************************/
#include <iprt/path.h>
#include "internal/iprt.h"
diff --git a/src/VBox/Runtime/r3/darwin/RTSystemQueryDmiString-darwin.cpp b/src/VBox/Runtime/r3/darwin/RTSystemQueryDmiString-darwin.cpp
index 71ff9f7..bbd9d4a 100644
--- a/src/VBox/Runtime/r3/darwin/RTSystemQueryDmiString-darwin.cpp
+++ b/src/VBox/Runtime/r3/darwin/RTSystemQueryDmiString-darwin.cpp
@@ -25,9 +25,9 @@
*/
-/*******************************************************************************
-* Header Files *
-*******************************************************************************/
+/*********************************************************************************************************************************
+* Header Files *
+*********************************************************************************************************************************/
#include <iprt/system.h>
#include "internal/iprt.h"
@@ -40,9 +40,9 @@
#include <IOKit/IOKitLib.h>
-/*******************************************************************************
-* Defined Constants And Macros *
-*******************************************************************************/
+/*********************************************************************************************************************************
+* Defined Constants And Macros *
+*********************************************************************************************************************************/
#define IOCLASS_PLATFORMEXPERTDEVICE "IOPlatformExpertDevice"
#define PROP_PRODUCT_NAME "product-name"
#define PROP_PRODUCT_VERSION "version"
diff --git a/src/VBox/Runtime/r3/darwin/filelock-darwin.cpp b/src/VBox/Runtime/r3/darwin/filelock-darwin.cpp
index 36f3225..662a16a 100644
--- a/src/VBox/Runtime/r3/darwin/filelock-darwin.cpp
+++ b/src/VBox/Runtime/r3/darwin/filelock-darwin.cpp
@@ -25,9 +25,9 @@
*/
-/*******************************************************************************
-* Header Files *
-*******************************************************************************/
+/*********************************************************************************************************************************
+* Header Files *
+*********************************************************************************************************************************/
#define LOG_GROUP RTLOGGROUP_FILE
#include <errno.h>
diff --git a/src/VBox/Runtime/r3/darwin/mp-darwin.cpp b/src/VBox/Runtime/r3/darwin/mp-darwin.cpp
index fba9c79..b3e5c1c 100644
--- a/src/VBox/Runtime/r3/darwin/mp-darwin.cpp
+++ b/src/VBox/Runtime/r3/darwin/mp-darwin.cpp
@@ -25,9 +25,9 @@
*/
-/*******************************************************************************
-* Header Files *
-*******************************************************************************/
+/*********************************************************************************************************************************
+* Header Files *
+*********************************************************************************************************************************/
#define LOG_GROUP RTLOGGROUP_SYSTEM
#include <iprt/types.h>
diff --git a/src/VBox/Runtime/r3/darwin/pathhost-darwin.cpp b/src/VBox/Runtime/r3/darwin/pathhost-darwin.cpp
index 7239354..1cba7fc 100644
--- a/src/VBox/Runtime/r3/darwin/pathhost-darwin.cpp
+++ b/src/VBox/Runtime/r3/darwin/pathhost-darwin.cpp
@@ -29,9 +29,9 @@
*/
-/*******************************************************************************
-* Header Files *
-*******************************************************************************/
+/*********************************************************************************************************************************
+* Header Files *
+*********************************************************************************************************************************/
#define LOG_GROUP RTLOGGROUP_PATH
#include <iprt/assert.h>
#include <iprt/string.h>
diff --git a/src/VBox/Runtime/r3/darwin/rtProcInitExePath-darwin.cpp b/src/VBox/Runtime/r3/darwin/rtProcInitExePath-darwin.cpp
index 6fce0eb..d110edc 100644
--- a/src/VBox/Runtime/r3/darwin/rtProcInitExePath-darwin.cpp
+++ b/src/VBox/Runtime/r3/darwin/rtProcInitExePath-darwin.cpp
@@ -24,9 +24,10 @@
* terms and conditions of either the GPL or the CDDL or both.
*/
-/*******************************************************************************
-* Header Files *
-*******************************************************************************/
+
+/*********************************************************************************************************************************
+* Header Files *
+*********************************************************************************************************************************/
#define LOG_GROUP RTLOGGROUP_PROCESS
#ifdef RT_OS_DARWIN
# include <mach-o/dyld.h>
diff --git a/src/VBox/Runtime/r3/darwin/sched-darwin.cpp b/src/VBox/Runtime/r3/darwin/sched-darwin.cpp
index 4dbdd95..ad1c454 100644
--- a/src/VBox/Runtime/r3/darwin/sched-darwin.cpp
+++ b/src/VBox/Runtime/r3/darwin/sched-darwin.cpp
@@ -25,9 +25,9 @@
*/
-/*******************************************************************************
-* Header Files *
-*******************************************************************************/
+/*********************************************************************************************************************************
+* Header Files *
+*********************************************************************************************************************************/
#define LOG_GROUP RTLOGGROUP_THREAD
#include <mach/thread_act.h>
#include <mach/thread_policy.h>
@@ -50,9 +50,9 @@
#include "internal/thread.h"
-/*******************************************************************************
-* Structures and Typedefs *
-*******************************************************************************/
+/*********************************************************************************************************************************
+* Structures and Typedefs *
+*********************************************************************************************************************************/
/**
* Configuration of one priority.
*/
@@ -76,9 +76,9 @@ typedef struct
} PROCPRIORITY;
-/*******************************************************************************
-* Global Variables *
-*******************************************************************************/
+/*********************************************************************************************************************************
+* Global Variables *
+*********************************************************************************************************************************/
/**
* Array of static priority configurations.
*
diff --git a/src/VBox/Runtime/r3/darwin/systemmem-darwin.cpp b/src/VBox/Runtime/r3/darwin/systemmem-darwin.cpp
index ec1f21e..9c48589 100644
--- a/src/VBox/Runtime/r3/darwin/systemmem-darwin.cpp
+++ b/src/VBox/Runtime/r3/darwin/systemmem-darwin.cpp
@@ -25,9 +25,9 @@
*/
-/*******************************************************************************
-* Header Files *
-*******************************************************************************/
+/*********************************************************************************************************************************
+* Header Files *
+*********************************************************************************************************************************/
#include <iprt/system.h>
#include "internal/iprt.h"
diff --git a/src/VBox/Runtime/r3/darwin/time-darwin.cpp b/src/VBox/Runtime/r3/darwin/time-darwin.cpp
index f71a3c3..179e9c5 100644
--- a/src/VBox/Runtime/r3/darwin/time-darwin.cpp
+++ b/src/VBox/Runtime/r3/darwin/time-darwin.cpp
@@ -25,9 +25,9 @@
*/
-/*******************************************************************************
-* Header Files *
-*******************************************************************************/
+/*********************************************************************************************************************************
+* Header Files *
+*********************************************************************************************************************************/
#define LOG_GROUP RTLOGGROUP_TIME
#define RTTIME_INCL_TIMEVAL
#include <mach/mach_time.h>
@@ -40,9 +40,9 @@
#include "internal/time.h"
-/*******************************************************************************
-* Global Variables *
-*******************************************************************************/
+/*********************************************************************************************************************************
+* Global Variables *
+*********************************************************************************************************************************/
static struct mach_timebase_info g_Info = { 0, 0 };
static double g_rdFactor = 0.0;
static bool g_fFailedToGetTimeBaseInfo = false;
diff --git a/src/VBox/Runtime/r3/dir.cpp b/src/VBox/Runtime/r3/dir.cpp
index 7d36da6..d8ea168 100644
--- a/src/VBox/Runtime/r3/dir.cpp
+++ b/src/VBox/Runtime/r3/dir.cpp
@@ -25,9 +25,9 @@
*/
-/*******************************************************************************
-* Header Files *
-*******************************************************************************/
+/*********************************************************************************************************************************
+* Header Files *
+*********************************************************************************************************************************/
#define LOG_GROUP RTLOGGROUP_DIR
#include <iprt/dir.h>
#include "internal/iprt.h"
diff --git a/src/VBox/Runtime/r3/dir2.cpp b/src/VBox/Runtime/r3/dir2.cpp
index b824299..82b1048 100644
--- a/src/VBox/Runtime/r3/dir2.cpp
+++ b/src/VBox/Runtime/r3/dir2.cpp
@@ -25,9 +25,9 @@
*/
-/*******************************************************************************
-* Header Files *
-*******************************************************************************/
+/*********************************************************************************************************************************
+* Header Files *
+*********************************************************************************************************************************/
#define LOG_GROUP RTLOGGROUP_DIR
#include <iprt/dir.h>
#include "internal/iprt.h"
diff --git a/src/VBox/Runtime/r3/fileio.cpp b/src/VBox/Runtime/r3/fileio.cpp
index e890533..4dd180b 100644
--- a/src/VBox/Runtime/r3/fileio.cpp
+++ b/src/VBox/Runtime/r3/fileio.cpp
@@ -24,9 +24,10 @@
* terms and conditions of either the GPL or the CDDL or both.
*/
-/*******************************************************************************
-* Header Files *
-*******************************************************************************/
+
+/*********************************************************************************************************************************
+* Header Files *
+*********************************************************************************************************************************/
#include "internal/iprt.h"
#include <iprt/file.h>
@@ -38,9 +39,9 @@
#include "internal/file.h"
-/*******************************************************************************
-* Global Variables *
-*******************************************************************************/
+/*********************************************************************************************************************************
+* Global Variables *
+*********************************************************************************************************************************/
/** Set of forced set open flags for files opened read-only. */
static unsigned g_fOpenReadSet = 0;
diff --git a/src/VBox/Runtime/r3/freebsd/fileaio-freebsd.cpp b/src/VBox/Runtime/r3/freebsd/fileaio-freebsd.cpp
index 2fb664d..e8f8934 100644
--- a/src/VBox/Runtime/r3/freebsd/fileaio-freebsd.cpp
+++ b/src/VBox/Runtime/r3/freebsd/fileaio-freebsd.cpp
@@ -25,9 +25,9 @@
*/
-/*******************************************************************************
-* Header Files *
-*******************************************************************************/
+/*********************************************************************************************************************************
+* Header Files *
+*********************************************************************************************************************************/
#define LOG_GROUP RTLOGGROUP_FILE
#include <iprt/asm.h>
#include <iprt/file.h>
@@ -48,9 +48,10 @@
#include <unistd.h>
#include <fcntl.h>
-/*******************************************************************************
-* Structures and Typedefs *
-*******************************************************************************/
+
+/*********************************************************************************************************************************
+* Structures and Typedefs *
+*********************************************************************************************************************************/
/**
* Async I/O completion context state.
*/
@@ -101,9 +102,9 @@ typedef struct RTFILEAIOREQINTERNAL
typedef RTFILEAIOREQINTERNAL *PRTFILEAIOREQINTERNAL;
-/*******************************************************************************
-* Defined Constants And Macros *
-*******************************************************************************/
+/*********************************************************************************************************************************
+* Defined Constants And Macros *
+*********************************************************************************************************************************/
/** The max number of events to get in one call. */
#define AIO_MAXIMUM_REQUESTS_PER_CONTEXT 64
diff --git a/src/VBox/Runtime/r3/freebsd/mp-freebsd.cpp b/src/VBox/Runtime/r3/freebsd/mp-freebsd.cpp
index 9670ee6..9212c10 100644
--- a/src/VBox/Runtime/r3/freebsd/mp-freebsd.cpp
+++ b/src/VBox/Runtime/r3/freebsd/mp-freebsd.cpp
@@ -24,9 +24,10 @@
* terms and conditions of either the GPL or the CDDL or both.
*/
-/*******************************************************************************
-* Header Files *
-*******************************************************************************/
+
+/*********************************************************************************************************************************
+* Header Files *
+*********************************************************************************************************************************/
#define LOG_GROUP RTLOGGROUP_SYSTEM
#include <unistd.h>
#include <stdio.h>
diff --git a/src/VBox/Runtime/r3/freebsd/rtProcInitExePath-freebsd.cpp b/src/VBox/Runtime/r3/freebsd/rtProcInitExePath-freebsd.cpp
index 3502236..4161fb5 100644
--- a/src/VBox/Runtime/r3/freebsd/rtProcInitExePath-freebsd.cpp
+++ b/src/VBox/Runtime/r3/freebsd/rtProcInitExePath-freebsd.cpp
@@ -24,9 +24,10 @@
* terms and conditions of either the GPL or the CDDL or both.
*/
-/*******************************************************************************
-* Header Files *
-*******************************************************************************/
+
+/*********************************************************************************************************************************
+* Header Files *
+*********************************************************************************************************************************/
#define LOG_GROUP RTLOGGROUP_PROCESS
#include <sys/param.h>
#include <sys/sysctl.h>
diff --git a/src/VBox/Runtime/r3/freebsd/systemmem-freebsd.cpp b/src/VBox/Runtime/r3/freebsd/systemmem-freebsd.cpp
index e21bc1e..2c27339 100644
--- a/src/VBox/Runtime/r3/freebsd/systemmem-freebsd.cpp
+++ b/src/VBox/Runtime/r3/freebsd/systemmem-freebsd.cpp
@@ -25,9 +25,9 @@
*/
-/*******************************************************************************
-* Header Files *
-*******************************************************************************/
+/*********************************************************************************************************************************
+* Header Files *
+*********************************************************************************************************************************/
#include <iprt/system.h>
#include "internal/iprt.h"
diff --git a/src/VBox/Runtime/r3/fs.cpp b/src/VBox/Runtime/r3/fs.cpp
index 4b7b322..1076f4d 100644
--- a/src/VBox/Runtime/r3/fs.cpp
+++ b/src/VBox/Runtime/r3/fs.cpp
@@ -25,9 +25,9 @@
*/
-/*******************************************************************************
-* Header Files *
-*******************************************************************************/
+/*********************************************************************************************************************************
+* Header Files *
+*********************************************************************************************************************************/
#include <iprt/fs.h>
#include "internal/iprt.h"
diff --git a/src/VBox/Runtime/r3/generic/allocex-r3-generic.cpp b/src/VBox/Runtime/r3/generic/allocex-r3-generic.cpp
index fa81e18..1d5d3f3 100644
--- a/src/VBox/Runtime/r3/generic/allocex-r3-generic.cpp
+++ b/src/VBox/Runtime/r3/generic/allocex-r3-generic.cpp
@@ -25,9 +25,9 @@
*/
-/*******************************************************************************
-* Header Files *
-*******************************************************************************/
+/*********************************************************************************************************************************
+* Header Files *
+*********************************************************************************************************************************/
#define RTMEM_NO_WRAP_TO_EF_APIS
#include <iprt/mem.h>
#include "internal/iprt.h"
diff --git a/src/VBox/Runtime/r3/generic/semspinmutex-r3-generic.cpp b/src/VBox/Runtime/r3/generic/semspinmutex-r3-generic.cpp
index b6b9b1a..cd8221c 100644
--- a/src/VBox/Runtime/r3/generic/semspinmutex-r3-generic.cpp
+++ b/src/VBox/Runtime/r3/generic/semspinmutex-r3-generic.cpp
@@ -25,9 +25,9 @@
*/
-/*******************************************************************************
-* Header Files *
-*******************************************************************************/
+/*********************************************************************************************************************************
+* Header Files *
+*********************************************************************************************************************************/
#include <iprt/semaphore.h>
#include "internal/iprt.h"
diff --git a/src/VBox/Runtime/r3/haiku/rtProcInitExePath-haiku.cpp b/src/VBox/Runtime/r3/haiku/rtProcInitExePath-haiku.cpp
index 09cbd5f..1468b86 100644
--- a/src/VBox/Runtime/r3/haiku/rtProcInitExePath-haiku.cpp
+++ b/src/VBox/Runtime/r3/haiku/rtProcInitExePath-haiku.cpp
@@ -24,9 +24,10 @@
* terms and conditions of either the GPL or the CDDL or both.
*/
-/*******************************************************************************
-* Header Files *
-*******************************************************************************/
+
+/*********************************************************************************************************************************
+* Header Files *
+*********************************************************************************************************************************/
#define LOG_GROUP RTLOGGROUP_PROCESS
#ifdef RT_OS_HAIKU
# include <image.h>
diff --git a/src/VBox/Runtime/r3/haiku/time-haiku.cpp b/src/VBox/Runtime/r3/haiku/time-haiku.cpp
index 960a447..ffb6d12 100644
--- a/src/VBox/Runtime/r3/haiku/time-haiku.cpp
+++ b/src/VBox/Runtime/r3/haiku/time-haiku.cpp
@@ -25,9 +25,9 @@
*/
-/*******************************************************************************
-* Header Files *
-*******************************************************************************/
+/*********************************************************************************************************************************
+* Header Files *
+*********************************************************************************************************************************/
#define LOG_GROUP RTLOGGROUP_TIME
#define RTTIME_INCL_TIMEVAL
#include <sys/time.h>
diff --git a/src/VBox/Runtime/r3/init.cpp b/src/VBox/Runtime/r3/init.cpp
index 20a037a..9236e88 100644
--- a/src/VBox/Runtime/r3/init.cpp
+++ b/src/VBox/Runtime/r3/init.cpp
@@ -25,9 +25,9 @@
*/
-/*******************************************************************************
-* Header Files *
-*******************************************************************************/
+/*********************************************************************************************************************************
+* Header Files *
+*********************************************************************************************************************************/
#define LOG_GROUP RTLOGGROUP_DEFAULT
#include <iprt/types.h> /* darwin: UINT32_C and others. */
@@ -74,9 +74,9 @@
#include "internal/time.h"
-/*******************************************************************************
-* Global Variables *
-*******************************************************************************/
+/*********************************************************************************************************************************
+* Global Variables *
+*********************************************************************************************************************************/
/** The number of calls to RTR3Init*. */
static int32_t volatile g_cUsers = 0;
/** Whether we're currently initializing the IPRT. */
diff --git a/src/VBox/Runtime/r3/isofs.cpp b/src/VBox/Runtime/r3/isofs.cpp
index 2dacf03..a387636 100644
--- a/src/VBox/Runtime/r3/isofs.cpp
+++ b/src/VBox/Runtime/r3/isofs.cpp
@@ -25,9 +25,9 @@
*/
-/*******************************************************************************
-* Header Files *
-*******************************************************************************/
+/*********************************************************************************************************************************
+* Header Files *
+*********************************************************************************************************************************/
#include <iprt/isofs.h>
#include <iprt/file.h>
diff --git a/src/VBox/Runtime/r3/linux/RTProcIsRunningByName-linux.cpp b/src/VBox/Runtime/r3/linux/RTProcIsRunningByName-linux.cpp
index 2e11ed8..d6fd711 100644
--- a/src/VBox/Runtime/r3/linux/RTProcIsRunningByName-linux.cpp
+++ b/src/VBox/Runtime/r3/linux/RTProcIsRunningByName-linux.cpp
@@ -24,9 +24,10 @@
* terms and conditions of either the GPL or the CDDL or both.
*/
-/*******************************************************************************
-* Header Files *
-*******************************************************************************/
+
+/*********************************************************************************************************************************
+* Header Files *
+*********************************************************************************************************************************/
#define LOG_GROUP RTLOGGROUP_PROCESS
#include <iprt/process.h>
#include <iprt/string.h>
diff --git a/src/VBox/Runtime/r3/linux/RTSystemQueryDmiString-linux.cpp b/src/VBox/Runtime/r3/linux/RTSystemQueryDmiString-linux.cpp
index 1f29d2e..2256e3c 100644
--- a/src/VBox/Runtime/r3/linux/RTSystemQueryDmiString-linux.cpp
+++ b/src/VBox/Runtime/r3/linux/RTSystemQueryDmiString-linux.cpp
@@ -25,9 +25,9 @@
*/
-/*******************************************************************************
-* Header Files *
-*******************************************************************************/
+/*********************************************************************************************************************************
+* Header Files *
+*********************************************************************************************************************************/
#include <iprt/system.h>
#include "internal/iprt.h"
diff --git a/src/VBox/Runtime/r3/linux/RTSystemShutdown-linux.cpp b/src/VBox/Runtime/r3/linux/RTSystemShutdown-linux.cpp
index 512b963..2d00928 100644
--- a/src/VBox/Runtime/r3/linux/RTSystemShutdown-linux.cpp
+++ b/src/VBox/Runtime/r3/linux/RTSystemShutdown-linux.cpp
@@ -25,9 +25,9 @@
*/
-/*******************************************************************************
-* Header Files *
-*******************************************************************************/
+/*********************************************************************************************************************************
+* Header Files *
+*********************************************************************************************************************************/
#include <iprt/system.h>
#include "internal/iprt.h"
diff --git a/src/VBox/Runtime/r3/linux/RTThreadGetNativeState-linux.cpp b/src/VBox/Runtime/r3/linux/RTThreadGetNativeState-linux.cpp
index 9669fc3..10e68a2 100644
--- a/src/VBox/Runtime/r3/linux/RTThreadGetNativeState-linux.cpp
+++ b/src/VBox/Runtime/r3/linux/RTThreadGetNativeState-linux.cpp
@@ -25,9 +25,9 @@
*/
-/*******************************************************************************
-* Header Files *
-*******************************************************************************/
+/*********************************************************************************************************************************
+* Header Files *
+*********************************************************************************************************************************/
#define LOG_GROUP RTLOGGROUP_PROCESS
#include <iprt/thread.h>
#include "internal/iprt.h"
diff --git a/src/VBox/Runtime/r3/linux/fileaio-linux.cpp b/src/VBox/Runtime/r3/linux/fileaio-linux.cpp
index 182a7ee..18e1311 100644
--- a/src/VBox/Runtime/r3/linux/fileaio-linux.cpp
+++ b/src/VBox/Runtime/r3/linux/fileaio-linux.cpp
@@ -45,9 +45,10 @@
* explanation would be nice, esp. seeing what Linus is quoted saying
* about it in the open man page... */
-/*******************************************************************************
-* Header Files *
-*******************************************************************************/
+
+/*********************************************************************************************************************************
+* Header Files *
+*********************************************************************************************************************************/
#define LOG_GROUP RTLOGGROUP_FILE
#include <iprt/asm.h>
#include <iprt/mem.h>
@@ -65,9 +66,9 @@
#include <iprt/file.h>
-/*******************************************************************************
-* Structures and Typedefs *
-*******************************************************************************/
+/*********************************************************************************************************************************
+* Structures and Typedefs *
+*********************************************************************************************************************************/
/** The async I/O context handle */
typedef unsigned long LNXKAIOCONTEXT;
@@ -216,9 +217,9 @@ typedef struct RTFILEAIOREQINTERNAL
typedef RTFILEAIOREQINTERNAL *PRTFILEAIOREQINTERNAL;
-/*******************************************************************************
-* Defined Constants And Macros *
-*******************************************************************************/
+/*********************************************************************************************************************************
+* Defined Constants And Macros *
+*********************************************************************************************************************************/
/** The max number of events to get in one call. */
#define AIO_MAXIMUM_REQUESTS_PER_CONTEXT 64
diff --git a/src/VBox/Runtime/r3/linux/mp-linux.cpp b/src/VBox/Runtime/r3/linux/mp-linux.cpp
index 159c6e0..1e9d23e 100644
--- a/src/VBox/Runtime/r3/linux/mp-linux.cpp
+++ b/src/VBox/Runtime/r3/linux/mp-linux.cpp
@@ -25,9 +25,9 @@
*/
-/*******************************************************************************
-* Header Files *
-*******************************************************************************/
+/*********************************************************************************************************************************
+* Header Files *
+*********************************************************************************************************************************/
#define LOG_GROUP RTLOGGROUP_SYSTEM
#include <stdio.h>
#include <errno.h>
diff --git a/src/VBox/Runtime/r3/linux/rtProcInitExePath-linux.cpp b/src/VBox/Runtime/r3/linux/rtProcInitExePath-linux.cpp
index dbec2b0..7d8a171 100644
--- a/src/VBox/Runtime/r3/linux/rtProcInitExePath-linux.cpp
+++ b/src/VBox/Runtime/r3/linux/rtProcInitExePath-linux.cpp
@@ -24,9 +24,10 @@
* terms and conditions of either the GPL or the CDDL or both.
*/
-/*******************************************************************************
-* Header Files *
-*******************************************************************************/
+
+/*********************************************************************************************************************************
+* Header Files *
+*********************************************************************************************************************************/
#define LOG_GROUP RTLOGGROUP_PROCESS
#include <unistd.h>
#include <errno.h>
diff --git a/src/VBox/Runtime/r3/linux/sched-linux.cpp b/src/VBox/Runtime/r3/linux/sched-linux.cpp
index e3410f3..b0b2847 100644
--- a/src/VBox/Runtime/r3/linux/sched-linux.cpp
+++ b/src/VBox/Runtime/r3/linux/sched-linux.cpp
@@ -47,9 +47,9 @@
#endif
-/*******************************************************************************
-* Header Files *
-*******************************************************************************/
+/*********************************************************************************************************************************
+* Header Files *
+*********************************************************************************************************************************/
#define LOG_GROUP RTLOGGROUP_THREAD
#include <errno.h>
#include <pthread.h>
@@ -68,9 +68,9 @@
#include "internal/thread.h"
-/*******************************************************************************
-* Structures and Typedefs *
-*******************************************************************************/
+/*********************************************************************************************************************************
+* Structures and Typedefs *
+*********************************************************************************************************************************/
/** Array scheduler attributes corresponding to each of the thread types.
* @internal */
@@ -121,9 +121,9 @@ typedef struct
} SAVEDPRIORITY, *PSAVEDPRIORITY;
-/*******************************************************************************
-* Global Variables *
-*******************************************************************************/
+/*********************************************************************************************************************************
+* Global Variables *
+*********************************************************************************************************************************/
/**
* Deltas for a process in which we are not restricted
* to only be lowering the priority.
@@ -262,9 +262,9 @@ static bool g_fInitialized = false;
-/*******************************************************************************
-* Internal Functions *
-*******************************************************************************/
+/*********************************************************************************************************************************
+* Internal Functions *
+*********************************************************************************************************************************/
/**
diff --git a/src/VBox/Runtime/r3/linux/semevent-linux.cpp b/src/VBox/Runtime/r3/linux/semevent-linux.cpp
index 065ef5b..01cdde1 100644
--- a/src/VBox/Runtime/r3/linux/semevent-linux.cpp
+++ b/src/VBox/Runtime/r3/linux/semevent-linux.cpp
@@ -41,9 +41,10 @@ asm volatile (".global epoll_pwait");
#else /* glibc < 2.6 */
-/*******************************************************************************
-* Header Files *
-*******************************************************************************/
+
+/*********************************************************************************************************************************
+* Header Files *
+*********************************************************************************************************************************/
#include <iprt/semaphore.h>
#include "internal/iprt.h"
@@ -71,9 +72,9 @@ asm volatile (".global epoll_pwait");
#endif
-/*******************************************************************************
-* Structures and Typedefs *
-*******************************************************************************/
+/*********************************************************************************************************************************
+* Structures and Typedefs *
+*********************************************************************************************************************************/
/**
* Linux (single wakup) event semaphore.
*/
diff --git a/src/VBox/Runtime/r3/linux/semeventmulti-linux.cpp b/src/VBox/Runtime/r3/linux/semeventmulti-linux.cpp
index 2e5dd70..d191d0a 100644
--- a/src/VBox/Runtime/r3/linux/semeventmulti-linux.cpp
+++ b/src/VBox/Runtime/r3/linux/semeventmulti-linux.cpp
@@ -43,9 +43,10 @@ asm volatile (".global epoll_pwait");
#else /* glibc < 2.6 */
-/*******************************************************************************
-* Header Files *
-*******************************************************************************/
+
+/*********************************************************************************************************************************
+* Header Files *
+*********************************************************************************************************************************/
#include <iprt/semaphore.h>
#include "internal/iprt.h"
@@ -73,9 +74,9 @@ asm volatile (".global epoll_pwait");
#endif
-/*******************************************************************************
-* Structures and Typedefs *
-*******************************************************************************/
+/*********************************************************************************************************************************
+* Structures and Typedefs *
+*********************************************************************************************************************************/
/**
* Linux multiple wakup event semaphore.
*/
diff --git a/src/VBox/Runtime/r3/linux/semmutex-linux.cpp b/src/VBox/Runtime/r3/linux/semmutex-linux.cpp
index af2a87c..b42c0c1 100644
--- a/src/VBox/Runtime/r3/linux/semmutex-linux.cpp
+++ b/src/VBox/Runtime/r3/linux/semmutex-linux.cpp
@@ -24,9 +24,10 @@
* terms and conditions of either the GPL or the CDDL or both.
*/
-/*******************************************************************************
-* Header Files *
-*******************************************************************************/
+
+/*********************************************************************************************************************************
+* Header Files *
+*********************************************************************************************************************************/
#include <iprt/semaphore.h>
#include "internal/iprt.h"
@@ -54,9 +55,9 @@
#endif
-/*******************************************************************************
-* Structures and Typedefs *
-*******************************************************************************/
+/*********************************************************************************************************************************
+* Structures and Typedefs *
+*********************************************************************************************************************************/
/**
* Linux internal representation of a Mutex semaphore.
*/
diff --git a/src/VBox/Runtime/r3/linux/sysfs.cpp b/src/VBox/Runtime/r3/linux/sysfs.cpp
index fda4068..28c60ae 100644
--- a/src/VBox/Runtime/r3/linux/sysfs.cpp
+++ b/src/VBox/Runtime/r3/linux/sysfs.cpp
@@ -25,9 +25,9 @@
*/
-/*******************************************************************************
-* Header Files *
-*******************************************************************************/
+/*********************************************************************************************************************************
+* Header Files *
+*********************************************************************************************************************************/
#define LOG_GROUP RTLOGGROUP_SYSTEM
#include <iprt/linux/sysfs.h>
#include <iprt/assert.h>
diff --git a/src/VBox/Runtime/r3/linux/systemmem-linux.cpp b/src/VBox/Runtime/r3/linux/systemmem-linux.cpp
index ad6edac..3607c3b 100644
--- a/src/VBox/Runtime/r3/linux/systemmem-linux.cpp
+++ b/src/VBox/Runtime/r3/linux/systemmem-linux.cpp
@@ -25,9 +25,9 @@
*/
-/*******************************************************************************
-* Header Files *
-*******************************************************************************/
+/*********************************************************************************************************************************
+* Header Files *
+*********************************************************************************************************************************/
#include <iprt/system.h>
#include "internal/iprt.h"
diff --git a/src/VBox/Runtime/r3/linux/thread-affinity-linux.cpp b/src/VBox/Runtime/r3/linux/thread-affinity-linux.cpp
index 0396c48..30d7209 100644
--- a/src/VBox/Runtime/r3/linux/thread-affinity-linux.cpp
+++ b/src/VBox/Runtime/r3/linux/thread-affinity-linux.cpp
@@ -25,9 +25,9 @@
*/
-/*******************************************************************************
-* Header Files *
-*******************************************************************************/
+/*********************************************************************************************************************************
+* Header Files *
+*********************************************************************************************************************************/
#ifndef _GNU_SOURCE
# define _GNU_SOURCE
#endif
diff --git a/src/VBox/Runtime/r3/linux/time-linux.cpp b/src/VBox/Runtime/r3/linux/time-linux.cpp
index 16dfd52..6532cd2 100644
--- a/src/VBox/Runtime/r3/linux/time-linux.cpp
+++ b/src/VBox/Runtime/r3/linux/time-linux.cpp
@@ -25,9 +25,9 @@
*/
-/*******************************************************************************
-* Header Files *
-*******************************************************************************/
+/*********************************************************************************************************************************
+* Header Files *
+*********************************************************************************************************************************/
#define LOG_GROUP RTLOGGROUP_TIME
#define RTTIME_INCL_TIMEVAL
#include <sys/time.h>
diff --git a/src/VBox/Runtime/r3/memsafer-r3.cpp b/src/VBox/Runtime/r3/memsafer-r3.cpp
index f67f698..0c7a2f4 100644
--- a/src/VBox/Runtime/r3/memsafer-r3.cpp
+++ b/src/VBox/Runtime/r3/memsafer-r3.cpp
@@ -25,9 +25,9 @@
*/
-/*******************************************************************************
-* Header Files *
-*******************************************************************************/
+/*********************************************************************************************************************************
+* Header Files *
+*********************************************************************************************************************************/
#include "internal/iprt.h"
#include <iprt/memsafer.h>
@@ -45,16 +45,16 @@
#endif
-/*******************************************************************************
-* Defined Constants And Macros *
-*******************************************************************************/
+/*********************************************************************************************************************************
+* Defined Constants And Macros *
+*********************************************************************************************************************************/
/** Allocation size alignment (power of two). */
#define RTMEMSAFER_ALIGN 16
-/*******************************************************************************
-* Structures and Typedefs *
-*******************************************************************************/
+/*********************************************************************************************************************************
+* Structures and Typedefs *
+*********************************************************************************************************************************/
/**
* Allocators.
*/
@@ -91,9 +91,9 @@ typedef struct RTMEMSAFERNODE
typedef RTMEMSAFERNODE *PRTMEMSAFERNODE;
-/*******************************************************************************
-* Global Variables *
-*******************************************************************************/
+/*********************************************************************************************************************************
+* Global Variables *
+*********************************************************************************************************************************/
/** Init once structure for this module. */
static RTONCE g_MemSaferOnce = RTONCE_INITIALIZER;
/** Critical section protecting the allocation tree. */
@@ -359,7 +359,7 @@ static int rtMemSaferMemAllocPages(PRTMEMSAFERNODE pThis)
}
-RTDECL(int) RTMemSaferAllocZExTag(void **ppvNew, size_t cb, uint32_t fFlags, const char *pszTag) RT_NO_THROW
+RTDECL(int) RTMemSaferAllocZExTag(void **ppvNew, size_t cb, uint32_t fFlags, const char *pszTag) RT_NO_THROW_DEF
{
/*
* Validate input.
@@ -426,7 +426,7 @@ RTDECL(int) RTMemSaferAllocZExTag(void **ppvNew, size_t cb, uint32_t fFlags, con
RT_EXPORT_SYMBOL(RTMemSaferAllocZExTag);
-RTDECL(void) RTMemSaferFree(void *pv, size_t cb) RT_NO_THROW
+RTDECL(void) RTMemSaferFree(void *pv, size_t cb) RT_NO_THROW_DEF
{
if (pv)
{
@@ -495,7 +495,7 @@ static int rtMemSaferReallocSimpler(size_t cbOld, void *pvOld, size_t cbNew, voi
}
-RTDECL(int) RTMemSaferReallocZExTag(size_t cbOld, void *pvOld, size_t cbNew, void **ppvNew, uint32_t fFlags, const char *pszTag) RT_NO_THROW
+RTDECL(int) RTMemSaferReallocZExTag(size_t cbOld, void *pvOld, size_t cbNew, void **ppvNew, uint32_t fFlags, const char *pszTag) RT_NO_THROW_DEF
{
int rc;
/* Real realloc. */
@@ -619,7 +619,7 @@ RTDECL(int) RTMemSaferReallocZExTag(size_t cbOld, void *pvOld, size_t cbNew, voi
RT_EXPORT_SYMBOL(RTMemSaferReallocZExTag);
-RTDECL(void *) RTMemSaferAllocZTag(size_t cb, const char *pszTag) RT_NO_THROW
+RTDECL(void *) RTMemSaferAllocZTag(size_t cb, const char *pszTag) RT_NO_THROW_DEF
{
void *pvNew = NULL;
int rc = RTMemSaferAllocZExTag(&pvNew, cb, 0 /*fFlags*/, pszTag);
@@ -630,7 +630,7 @@ RTDECL(void *) RTMemSaferAllocZTag(size_t cb, const char *pszTag) RT_NO_THROW
RT_EXPORT_SYMBOL(RTMemSaferAllocZTag);
-RTDECL(void *) RTMemSaferReallocZTag(size_t cbOld, void *pvOld, size_t cbNew, const char *pszTag) RT_NO_THROW
+RTDECL(void *) RTMemSaferReallocZTag(size_t cbOld, void *pvOld, size_t cbNew, const char *pszTag) RT_NO_THROW_DEF
{
void *pvNew = NULL;
int rc = RTMemSaferReallocZExTag(cbOld, pvOld, cbNew, &pvNew, 0 /*fFlags*/, pszTag);
diff --git a/src/VBox/Runtime/r3/nt/RTProcQueryParent-r3-nt.cpp b/src/VBox/Runtime/r3/nt/RTProcQueryParent-r3-nt.cpp
index aff6574..c847ddb 100644
--- a/src/VBox/Runtime/r3/nt/RTProcQueryParent-r3-nt.cpp
+++ b/src/VBox/Runtime/r3/nt/RTProcQueryParent-r3-nt.cpp
@@ -25,9 +25,9 @@
*/
-/*******************************************************************************
-* Header Files *
-*******************************************************************************/
+/*********************************************************************************************************************************
+* Header Files *
+*********************************************************************************************************************************/
#define LOG_GROUP RTLOGGROUP_PROCESS
#include <iprt/nt/nt.h>
diff --git a/src/VBox/Runtime/r3/nt/direnum-r3-nt.cpp b/src/VBox/Runtime/r3/nt/direnum-r3-nt.cpp
index 8ea5f30..4e88c65 100644
--- a/src/VBox/Runtime/r3/nt/direnum-r3-nt.cpp
+++ b/src/VBox/Runtime/r3/nt/direnum-r3-nt.cpp
@@ -25,9 +25,9 @@
*/
-/*******************************************************************************
-* Header Files *
-*******************************************************************************/
+/*********************************************************************************************************************************
+* Header Files *
+*********************************************************************************************************************************/
#define LOG_GROUP RTLOGGROUP_DIR
#include "internal-r3-nt.h"
@@ -43,9 +43,9 @@
#include "internal/dir.h"
-/*******************************************************************************
-* Defined Constants And Macros *
-*******************************************************************************/
+/*********************************************************************************************************************************
+* Defined Constants And Macros *
+*********************************************************************************************************************************/
/** Whether to return a single record (TRUE) or multiple (FALSE)o. */
#define RTDIR_NT_SINGLE_RECORD FALSE
diff --git a/src/VBox/Runtime/r3/nt/fs-nt.cpp b/src/VBox/Runtime/r3/nt/fs-nt.cpp
index 38b3257..bb96b51 100644
--- a/src/VBox/Runtime/r3/nt/fs-nt.cpp
+++ b/src/VBox/Runtime/r3/nt/fs-nt.cpp
@@ -25,9 +25,9 @@
*/
-/*******************************************************************************
-* Header Files *
-*******************************************************************************/
+/*********************************************************************************************************************************
+* Header Files *
+*********************************************************************************************************************************/
#define LOG_GROUP RTLOGGROUP_FS
#include "internal-r3-nt.h"
@@ -225,6 +225,11 @@ RTR3DECL(int) RTFsQueryProperties(const char *pszFsPath, PRTFSPROPERTIES pProper
}
+RTR3DECL(bool) RTFsIsCaseSensitive(const char *pszFsPath)
+{
+ return false;
+}
+
RTR3DECL(int) RTFsQueryType(const char *pszFsPath, PRTFSTYPE penmType)
{
diff --git a/src/VBox/Runtime/r3/nt/pathint-nt.cpp b/src/VBox/Runtime/r3/nt/pathint-nt.cpp
index a9b89cf..d06b262 100644
--- a/src/VBox/Runtime/r3/nt/pathint-nt.cpp
+++ b/src/VBox/Runtime/r3/nt/pathint-nt.cpp
@@ -25,9 +25,9 @@
*/
-/*******************************************************************************
-* Header Files *
-*******************************************************************************/
+/*********************************************************************************************************************************
+* Header Files *
+*********************************************************************************************************************************/
#define LOG_GROUP RTLOGGROUP_FS
#include "internal-r3-nt.h"
@@ -37,9 +37,9 @@
#include <iprt/assert.h>
-/*******************************************************************************
-* Global Variables *
-*******************************************************************************/
+/*********************************************************************************************************************************
+* Global Variables *
+*********************************************************************************************************************************/
static char const g_szPrefixUnc[] = "\\??\\UNC\\";
static char const g_szPrefix[] = "\\??\\";
diff --git a/src/VBox/Runtime/r3/nt/time-nt.cpp b/src/VBox/Runtime/r3/nt/time-nt.cpp
index 8211585..52f19ec 100644
--- a/src/VBox/Runtime/r3/nt/time-nt.cpp
+++ b/src/VBox/Runtime/r3/nt/time-nt.cpp
@@ -25,9 +25,9 @@
*/
-/*******************************************************************************
-* Header Files *
-*******************************************************************************/
+/*********************************************************************************************************************************
+* Header Files *
+*********************************************************************************************************************************/
#define LOG_GROUP RTLOGGROUP_TIME
#include "internal-r3-nt.h"
@@ -40,9 +40,9 @@
#include "internal/time.h"
-/*******************************************************************************
-* Global Variables *
-*******************************************************************************/
+/*********************************************************************************************************************************
+* Global Variables *
+*********************************************************************************************************************************/
/** Whether we've tried to resolve g_pfnRtlGetSystemTimePrecise or not. */
static bool g_fInitialized = false;
/** Pointer to RtlGetSystemTimePrecise, added in 6.2 (windows 8). */
diff --git a/src/VBox/Runtime/r3/os2/filelock-os2.cpp b/src/VBox/Runtime/r3/os2/filelock-os2.cpp
index f9ddfd3..484c488 100644
--- a/src/VBox/Runtime/r3/os2/filelock-os2.cpp
+++ b/src/VBox/Runtime/r3/os2/filelock-os2.cpp
@@ -25,9 +25,9 @@
*/
-/*******************************************************************************
-* Header Files *
-*******************************************************************************/
+/*********************************************************************************************************************************
+* Header Files *
+*********************************************************************************************************************************/
#define LOG_GROUP RTLOGGROUP_FILE
#include <errno.h>
diff --git a/src/VBox/Runtime/r3/os2/mp-os2.cpp b/src/VBox/Runtime/r3/os2/mp-os2.cpp
index d289212..39c53cf 100644
--- a/src/VBox/Runtime/r3/os2/mp-os2.cpp
+++ b/src/VBox/Runtime/r3/os2/mp-os2.cpp
@@ -25,9 +25,9 @@
*/
-/*******************************************************************************
-* Header Files *
-*******************************************************************************/
+/*********************************************************************************************************************************
+* Header Files *
+*********************************************************************************************************************************/
#define INCL_BASE
#define INCL_ERRORS
#include <os2.h>
diff --git a/src/VBox/Runtime/r3/os2/pipe-os2.cpp b/src/VBox/Runtime/r3/os2/pipe-os2.cpp
index 9b1ad48..31f99a4 100644
--- a/src/VBox/Runtime/r3/os2/pipe-os2.cpp
+++ b/src/VBox/Runtime/r3/os2/pipe-os2.cpp
@@ -25,9 +25,9 @@
*/
-/*******************************************************************************
-* Header Files *
-*******************************************************************************/
+/*********************************************************************************************************************************
+* Header Files *
+*********************************************************************************************************************************/
#define INCL_ERRORS
#define INCL_DOSSEMAPHORES
#include <os2.h>
@@ -49,16 +49,16 @@
#include "internal/magics.h"
-/*******************************************************************************
-* Defined Constants And Macros *
-*******************************************************************************/
+/*********************************************************************************************************************************
+* Defined Constants And Macros *
+*********************************************************************************************************************************/
/** The pipe buffer size we prefer. */
#define RTPIPE_OS2_SIZE _32K
-/*******************************************************************************
-* Structures and Typedefs *
-*******************************************************************************/
+/*********************************************************************************************************************************
+* Structures and Typedefs *
+*********************************************************************************************************************************/
typedef struct RTPIPEINTERNAL
{
/** Magic value (RTPIPE_MAGIC). */
diff --git a/src/VBox/Runtime/r3/os2/rtProcInitExePath-os2.cpp b/src/VBox/Runtime/r3/os2/rtProcInitExePath-os2.cpp
index eed5ffe..4b5b34d 100644
--- a/src/VBox/Runtime/r3/os2/rtProcInitExePath-os2.cpp
+++ b/src/VBox/Runtime/r3/os2/rtProcInitExePath-os2.cpp
@@ -24,9 +24,10 @@
* terms and conditions of either the GPL or the CDDL or both.
*/
-/*******************************************************************************
-* Header Files *
-*******************************************************************************/
+
+/*********************************************************************************************************************************
+* Header Files *
+*********************************************************************************************************************************/
#define LOG_GROUP RTLOGGROUP_PROCESS
#include <stdlib.h>
#include <stdio.h>
diff --git a/src/VBox/Runtime/r3/os2/sched-os2.cpp b/src/VBox/Runtime/r3/os2/sched-os2.cpp
index 7a463ba..eeccd21 100644
--- a/src/VBox/Runtime/r3/os2/sched-os2.cpp
+++ b/src/VBox/Runtime/r3/os2/sched-os2.cpp
@@ -29,9 +29,9 @@
#define OS2_SCHED_ENABLED
-/*******************************************************************************
-* Header Files *
-*******************************************************************************/
+/*********************************************************************************************************************************
+* Header Files *
+*********************************************************************************************************************************/
#define LOG_GROUP RTLOGGROUP_THREAD
#define INCL_BASE
#define INCL_ERRORS
@@ -45,9 +45,9 @@
#include "internal/thread.h"
-/*******************************************************************************
-* Structures and Typedefs *
-*******************************************************************************/
+/*********************************************************************************************************************************
+* Structures and Typedefs *
+*********************************************************************************************************************************/
/**
* Configuration of one priority.
*/
@@ -73,9 +73,9 @@ typedef struct
#define ANY_PROCESS_PRIORITY_CLASS (~0U)
-/*******************************************************************************
-* Global Variables *
-*******************************************************************************/
+/*********************************************************************************************************************************
+* Global Variables *
+*********************************************************************************************************************************/
/**
* Array of static priority configurations.
*/
diff --git a/src/VBox/Runtime/r3/os2/sems-os2.cpp b/src/VBox/Runtime/r3/os2/sems-os2.cpp
index 6999d01..c433282 100644
--- a/src/VBox/Runtime/r3/os2/sems-os2.cpp
+++ b/src/VBox/Runtime/r3/os2/sems-os2.cpp
@@ -25,9 +25,9 @@
*/
-/*******************************************************************************
-* Header Files *
-*******************************************************************************/
+/*********************************************************************************************************************************
+* Header Files *
+*********************************************************************************************************************************/
#define INCL_DOSSEMAPHORES
#define INCL_ERRORS
#include <os2.h>
diff --git a/src/VBox/Runtime/r3/os2/systemmem-os2.cpp b/src/VBox/Runtime/r3/os2/systemmem-os2.cpp
index 97c6efd..cdd46ee 100644
--- a/src/VBox/Runtime/r3/os2/systemmem-os2.cpp
+++ b/src/VBox/Runtime/r3/os2/systemmem-os2.cpp
@@ -25,9 +25,9 @@
*/
-/*******************************************************************************
-* Header Files *
-*******************************************************************************/
+/*********************************************************************************************************************************
+* Header Files *
+*********************************************************************************************************************************/
#define INCL_DOSMISC
#define INCL_ERRORS
#include <os2.h>
diff --git a/src/VBox/Runtime/r3/os2/thread-os2.cpp b/src/VBox/Runtime/r3/os2/thread-os2.cpp
index a5386e3..469f861 100644
--- a/src/VBox/Runtime/r3/os2/thread-os2.cpp
+++ b/src/VBox/Runtime/r3/os2/thread-os2.cpp
@@ -25,9 +25,9 @@
*/
-/*******************************************************************************
-* Header Files *
-*******************************************************************************/
+/*********************************************************************************************************************************
+* Header Files *
+*********************************************************************************************************************************/
#define LOG_GROUP RTLOGGROUP_THREAD
#define INCL_BASE
#include <os2.h>
@@ -51,16 +51,16 @@
#include "internal/thread.h"
-/*******************************************************************************
-* Global Variables *
-*******************************************************************************/
+/*********************************************************************************************************************************
+* Global Variables *
+*********************************************************************************************************************************/
/** Pointer to thread local memory which points to the current thread. */
static PRTTHREADINT *g_ppCurThread;
-/*******************************************************************************
-* Internal Functions *
-*******************************************************************************/
+/*********************************************************************************************************************************
+* Internal Functions *
+*********************************************************************************************************************************/
static void rtThreadNativeMain(void *pvArgs);
diff --git a/src/VBox/Runtime/r3/os2/time-os2.cpp b/src/VBox/Runtime/r3/os2/time-os2.cpp
index 13fcad0..cb1c07a 100644
--- a/src/VBox/Runtime/r3/os2/time-os2.cpp
+++ b/src/VBox/Runtime/r3/os2/time-os2.cpp
@@ -29,9 +29,9 @@
*/
-/*******************************************************************************
-* Header Files *
-*******************************************************************************/
+/*********************************************************************************************************************************
+* Header Files *
+*********************************************************************************************************************************/
#define LOG_GROUP RTLOGGROUP_TIME
#include <InnoTekLIBC/FastInfoBlocks.h>
diff --git a/src/VBox/Runtime/r3/path.cpp b/src/VBox/Runtime/r3/path.cpp
index 7c54dae..d1d438d 100644
--- a/src/VBox/Runtime/r3/path.cpp
+++ b/src/VBox/Runtime/r3/path.cpp
@@ -25,9 +25,9 @@
*/
-/*******************************************************************************
-* Header Files *
-*******************************************************************************/
+/*********************************************************************************************************************************
+* Header Files *
+*********************************************************************************************************************************/
#include "internal/iprt.h"
#include <iprt/assert.h>
#include <iprt/env.h>
diff --git a/src/VBox/Runtime/r3/poll.cpp b/src/VBox/Runtime/r3/poll.cpp
index 725feb7..b55c6a9 100644
--- a/src/VBox/Runtime/r3/poll.cpp
+++ b/src/VBox/Runtime/r3/poll.cpp
@@ -25,9 +25,9 @@
*/
-/*******************************************************************************
-* Header Files *
-*******************************************************************************/
+/*********************************************************************************************************************************
+* Header Files *
+*********************************************************************************************************************************/
#include <iprt/cdefs.h>
#ifdef RT_OS_WINDOWS
# include <Windows.h>
@@ -64,9 +64,9 @@
#include "internal/magics.h"
-/*******************************************************************************
-* Defined Constants And Macros *
-*******************************************************************************/
+/*********************************************************************************************************************************
+* Defined Constants And Macros *
+*********************************************************************************************************************************/
/** The maximum poll set size.
* @remarks To help portability, we set this to the Windows limit. We can lift
* this restriction later if it becomes necessary. */
@@ -74,9 +74,9 @@
-/*******************************************************************************
-* Structures and Typedefs *
-*******************************************************************************/
+/*********************************************************************************************************************************
+* Structures and Typedefs *
+*********************************************************************************************************************************/
/**
* Handle entry in a poll set.
*/
diff --git a/src/VBox/Runtime/r3/posix/RTFileQueryFsSizes-posix.cpp b/src/VBox/Runtime/r3/posix/RTFileQueryFsSizes-posix.cpp
index 68ea53c..0fb3a80 100644
--- a/src/VBox/Runtime/r3/posix/RTFileQueryFsSizes-posix.cpp
+++ b/src/VBox/Runtime/r3/posix/RTFileQueryFsSizes-posix.cpp
@@ -25,9 +25,9 @@
*/
-/*******************************************************************************
-* Header Files *
-*******************************************************************************/
+/*********************************************************************************************************************************
+* Header Files *
+*********************************************************************************************************************************/
#define LOG_GROUP RTLOGGROUP_FILE
#include <errno.h>
diff --git a/src/VBox/Runtime/r3/posix/RTHandleGetStandard-posix.cpp b/src/VBox/Runtime/r3/posix/RTHandleGetStandard-posix.cpp
index b8fcb65..1a8d981 100644
--- a/src/VBox/Runtime/r3/posix/RTHandleGetStandard-posix.cpp
+++ b/src/VBox/Runtime/r3/posix/RTHandleGetStandard-posix.cpp
@@ -25,9 +25,9 @@
*/
-/*******************************************************************************
-* Header Files *
-*******************************************************************************/
+/*********************************************************************************************************************************
+* Header Files *
+*********************************************************************************************************************************/
#include <errno.h>
#include <sys/stat.h>
#include <sys/types.h>
diff --git a/src/VBox/Runtime/r3/posix/RTMemProtect-posix.cpp b/src/VBox/Runtime/r3/posix/RTMemProtect-posix.cpp
index 08ebbb5..8d58793 100644
--- a/src/VBox/Runtime/r3/posix/RTMemProtect-posix.cpp
+++ b/src/VBox/Runtime/r3/posix/RTMemProtect-posix.cpp
@@ -25,9 +25,9 @@
*/
-/*******************************************************************************
-* Header Files *
-*******************************************************************************/
+/*********************************************************************************************************************************
+* Header Files *
+*********************************************************************************************************************************/
#include <iprt/alloc.h>
#include <iprt/assert.h>
#include <iprt/param.h>
@@ -38,7 +38,7 @@
#include <sys/mman.h>
-RTDECL(int) RTMemProtect(void *pv, size_t cb, unsigned fProtect) RT_NO_THROW
+RTDECL(int) RTMemProtect(void *pv, size_t cb, unsigned fProtect) RT_NO_THROW_DEF
{
/*
* Validate input.
diff --git a/src/VBox/Runtime/r3/posix/RTMpGetCount-posix.cpp b/src/VBox/Runtime/r3/posix/RTMpGetCount-posix.cpp
index c1fa8bb..1bfacc5 100644
--- a/src/VBox/Runtime/r3/posix/RTMpGetCount-posix.cpp
+++ b/src/VBox/Runtime/r3/posix/RTMpGetCount-posix.cpp
@@ -25,9 +25,9 @@
*/
-/*******************************************************************************
-* Header Files *
-*******************************************************************************/
+/*********************************************************************************************************************************
+* Header Files *
+*********************************************************************************************************************************/
#include <iprt/mp.h>
#include <iprt/assert.h>
diff --git a/src/VBox/Runtime/r3/posix/RTPathUserDocuments-posix.cpp b/src/VBox/Runtime/r3/posix/RTPathUserDocuments-posix.cpp
index 5fe34b8..fbfd2db 100644
--- a/src/VBox/Runtime/r3/posix/RTPathUserDocuments-posix.cpp
+++ b/src/VBox/Runtime/r3/posix/RTPathUserDocuments-posix.cpp
@@ -24,9 +24,10 @@
* terms and conditions of either the GPL or the CDDL or both.
*/
-/*******************************************************************************
-* Header Files *
-*******************************************************************************/
+
+/*********************************************************************************************************************************
+* Header Files *
+*********************************************************************************************************************************/
#include <iprt/path.h>
#include <iprt/err.h>
#include <iprt/assert.h>
diff --git a/src/VBox/Runtime/r3/posix/RTPathUserHome-posix.cpp b/src/VBox/Runtime/r3/posix/RTPathUserHome-posix.cpp
index 54c7d0f..c1d1af8 100644
--- a/src/VBox/Runtime/r3/posix/RTPathUserHome-posix.cpp
+++ b/src/VBox/Runtime/r3/posix/RTPathUserHome-posix.cpp
@@ -25,9 +25,9 @@
*/
-/*******************************************************************************
-* Header Files *
-*******************************************************************************/
+/*********************************************************************************************************************************
+* Header Files *
+*********************************************************************************************************************************/
#define LOG_GROUP RTLOGGROUP_PATH
#include <stdlib.h>
#include <limits.h>
diff --git a/src/VBox/Runtime/r3/posix/RTSystemQueryOSInfo-posix.cpp b/src/VBox/Runtime/r3/posix/RTSystemQueryOSInfo-posix.cpp
index 88c9ae6..691348f 100644
--- a/src/VBox/Runtime/r3/posix/RTSystemQueryOSInfo-posix.cpp
+++ b/src/VBox/Runtime/r3/posix/RTSystemQueryOSInfo-posix.cpp
@@ -24,9 +24,10 @@
* terms and conditions of either the GPL or the CDDL or both.
*/
-/*******************************************************************************
-* Header Files *
-*******************************************************************************/
+
+/*********************************************************************************************************************************
+* Header Files *
+*********************************************************************************************************************************/
#include <iprt/system.h>
#include <iprt/assert.h>
#include <iprt/string.h>
diff --git a/src/VBox/Runtime/r3/posix/RTSystemQueryTotalRam-posix.cpp b/src/VBox/Runtime/r3/posix/RTSystemQueryTotalRam-posix.cpp
index 71fe686..22862eb 100644
--- a/src/VBox/Runtime/r3/posix/RTSystemQueryTotalRam-posix.cpp
+++ b/src/VBox/Runtime/r3/posix/RTSystemQueryTotalRam-posix.cpp
@@ -25,9 +25,9 @@
*/
-/*******************************************************************************
-* Header Files *
-*******************************************************************************/
+/*********************************************************************************************************************************
+* Header Files *
+*********************************************************************************************************************************/
#include <iprt/system.h>
#include "internal/iprt.h"
diff --git a/src/VBox/Runtime/r3/posix/RTTimeNow-posix.cpp b/src/VBox/Runtime/r3/posix/RTTimeNow-posix.cpp
index 0549c30..9dee759 100644
--- a/src/VBox/Runtime/r3/posix/RTTimeNow-posix.cpp
+++ b/src/VBox/Runtime/r3/posix/RTTimeNow-posix.cpp
@@ -25,9 +25,9 @@
*/
-/*******************************************************************************
-* Header Files *
-*******************************************************************************/
+/*********************************************************************************************************************************
+* Header Files *
+*********************************************************************************************************************************/
#define LOG_GROUP RTLOGGROUP_TIME
#define RTTIME_INCL_TIMEVAL
#include <sys/time.h>
diff --git a/src/VBox/Runtime/r3/posix/RTTimeSet-posix.cpp b/src/VBox/Runtime/r3/posix/RTTimeSet-posix.cpp
index a198aa6..9f1a754 100644
--- a/src/VBox/Runtime/r3/posix/RTTimeSet-posix.cpp
+++ b/src/VBox/Runtime/r3/posix/RTTimeSet-posix.cpp
@@ -25,9 +25,9 @@
*/
-/*******************************************************************************
-* Header Files *
-*******************************************************************************/
+/*********************************************************************************************************************************
+* Header Files *
+*********************************************************************************************************************************/
#define LOG_GROUP RTLOGGROUP_TIME
#define RTTIME_INCL_TIMEVAL
#include <sys/time.h>
diff --git a/src/VBox/Runtime/r3/posix/allocex-r3-posix.cpp b/src/VBox/Runtime/r3/posix/allocex-r3-posix.cpp
index 78c38f2..0a8a657 100644
--- a/src/VBox/Runtime/r3/posix/allocex-r3-posix.cpp
+++ b/src/VBox/Runtime/r3/posix/allocex-r3-posix.cpp
@@ -25,9 +25,9 @@
*/
-/*******************************************************************************
-* Header Files *
-*******************************************************************************/
+/*********************************************************************************************************************************
+* Header Files *
+*********************************************************************************************************************************/
#define RTMEM_NO_WRAP_TO_EF_APIS
#include <iprt/mem.h>
#include "internal/iprt.h"
diff --git a/src/VBox/Runtime/r3/posix/dir-posix.cpp b/src/VBox/Runtime/r3/posix/dir-posix.cpp
index 5509a77..f1104db 100644
--- a/src/VBox/Runtime/r3/posix/dir-posix.cpp
+++ b/src/VBox/Runtime/r3/posix/dir-posix.cpp
@@ -25,9 +25,9 @@
*/
-/*******************************************************************************
-* Header Files *
-*******************************************************************************/
+/*********************************************************************************************************************************
+* Header Files *
+*********************************************************************************************************************************/
#define LOG_GROUP RTLOGGROUP_DIR
#include <errno.h>
#include <unistd.h>
diff --git a/src/VBox/Runtime/r3/posix/env-posix.cpp b/src/VBox/Runtime/r3/posix/env-posix.cpp
index 68b606d..8828804 100644
--- a/src/VBox/Runtime/r3/posix/env-posix.cpp
+++ b/src/VBox/Runtime/r3/posix/env-posix.cpp
@@ -25,9 +25,9 @@
*/
-/*******************************************************************************
-* Header Files *
-*******************************************************************************/
+/*********************************************************************************************************************************
+* Header Files *
+*********************************************************************************************************************************/
#ifdef RT_OS_DARWIN
/* pick the correct prototype for unsetenv. */
# define _POSIX_C_SOURCE 1
diff --git a/src/VBox/Runtime/r3/posix/errvars-posix.cpp b/src/VBox/Runtime/r3/posix/errvars-posix.cpp
index 7701237..d9bd742 100644
--- a/src/VBox/Runtime/r3/posix/errvars-posix.cpp
+++ b/src/VBox/Runtime/r3/posix/errvars-posix.cpp
@@ -25,9 +25,9 @@
*/
-/*******************************************************************************
-* Header Files *
-*******************************************************************************/
+/*********************************************************************************************************************************
+* Header Files *
+*********************************************************************************************************************************/
#include <netdb.h>
#include <errno.h>
diff --git a/src/VBox/Runtime/r3/posix/fileaio-posix.cpp b/src/VBox/Runtime/r3/posix/fileaio-posix.cpp
index 7d5c70f..c1a48e9 100644
--- a/src/VBox/Runtime/r3/posix/fileaio-posix.cpp
+++ b/src/VBox/Runtime/r3/posix/fileaio-posix.cpp
@@ -25,9 +25,9 @@
*/
-/*******************************************************************************
-* Header Files *
-*******************************************************************************/
+/*********************************************************************************************************************************
+* Header Files *
+*********************************************************************************************************************************/
#define LOG_GROUP RTLOGGROUP_DIR
#include <iprt/asm.h>
#include <iprt/file.h>
@@ -73,9 +73,10 @@
# define rtFileAioCtxDump(pCtxInt) do {} while (0)
#endif
-/*******************************************************************************
-* Structures and Typedefs *
-*******************************************************************************/
+
+/*********************************************************************************************************************************
+* Structures and Typedefs *
+*********************************************************************************************************************************/
/**
* Async I/O request state.
*/
diff --git a/src/VBox/Runtime/r3/posix/fileio-posix.cpp b/src/VBox/Runtime/r3/posix/fileio-posix.cpp
index 597883f..2203f96 100644
--- a/src/VBox/Runtime/r3/posix/fileio-posix.cpp
+++ b/src/VBox/Runtime/r3/posix/fileio-posix.cpp
@@ -25,9 +25,9 @@
*/
-/*******************************************************************************
-* Header Files *
-*******************************************************************************/
+/*********************************************************************************************************************************
+* Header Files *
+*********************************************************************************************************************************/
#define LOG_GROUP RTLOGGROUP_FILE
#include <errno.h>
@@ -69,9 +69,9 @@
-/*******************************************************************************
-* Defined Constants And Macros *
-*******************************************************************************/
+/*********************************************************************************************************************************
+* Defined Constants And Macros *
+*********************************************************************************************************************************/
/** Default file permissions for newly created files. */
#if defined(S_IRUSR) && defined(S_IWUSR)
# define RT_FILE_PERMISSION (S_IRUSR | S_IWUSR)
diff --git a/src/VBox/Runtime/r3/posix/fileio2-posix.cpp b/src/VBox/Runtime/r3/posix/fileio2-posix.cpp
index 73c42f5..a357c12 100644
--- a/src/VBox/Runtime/r3/posix/fileio2-posix.cpp
+++ b/src/VBox/Runtime/r3/posix/fileio2-posix.cpp
@@ -25,9 +25,9 @@
*/
-/*******************************************************************************
-* Header Files *
-*******************************************************************************/
+/*********************************************************************************************************************************
+* Header Files *
+*********************************************************************************************************************************/
#define LOG_GROUP RTLOGGROUP_FILE
#include <errno.h>
diff --git a/src/VBox/Runtime/r3/posix/filelock-posix.cpp b/src/VBox/Runtime/r3/posix/filelock-posix.cpp
index de7d3bf..8114cc4 100644
--- a/src/VBox/Runtime/r3/posix/filelock-posix.cpp
+++ b/src/VBox/Runtime/r3/posix/filelock-posix.cpp
@@ -25,9 +25,9 @@
*/
-/*******************************************************************************
-* Header Files *
-*******************************************************************************/
+/*********************************************************************************************************************************
+* Header Files *
+*********************************************************************************************************************************/
#define LOG_GROUP RTLOGGROUP_FILE
#include <errno.h>
diff --git a/src/VBox/Runtime/r3/posix/fs-posix.cpp b/src/VBox/Runtime/r3/posix/fs-posix.cpp
index 47ccc7b..d639228 100644
--- a/src/VBox/Runtime/r3/posix/fs-posix.cpp
+++ b/src/VBox/Runtime/r3/posix/fs-posix.cpp
@@ -25,9 +25,9 @@
*/
-/*******************************************************************************
-* Header Files *
-*******************************************************************************/
+/*********************************************************************************************************************************
+* Header Files *
+*********************************************************************************************************************************/
#define LOG_GROUP RTLOGGROUP_FS
#include <sys/statvfs.h>
#include <errno.h>
@@ -152,7 +152,11 @@ RTR3DECL(int) RTFsQueryProperties(const char *pszFsPath, PRTFSPROPERTIES pProper
* Calc/fake the returned values.
*/
pProperties->cbMaxComponent = StatVFS.f_namemax;
+#if defined(RT_OS_OS2) || defined(RT_OS_WINDOWS)
+ pProperties->fCaseSensitive = false;
+#else
pProperties->fCaseSensitive = true;
+#endif
pProperties->fCompressed = false;
pProperties->fFileCompression = false;
pProperties->fReadOnly = !!(StatVFS.f_flag & ST_RDONLY);
@@ -170,6 +174,16 @@ RTR3DECL(int) RTFsQueryProperties(const char *pszFsPath, PRTFSPROPERTIES pProper
}
+RTR3DECL(bool) RTFsIsCaseSensitive(const char *pszFsPath)
+{
+#if defined(RT_OS_OS2) || defined(RT_OS_WINDOWS)
+ return false;
+#else
+ return true;
+#endif
+}
+
+
RTR3DECL(int) RTFsQueryType(const char *pszFsPath, PRTFSTYPE penmType)
{
*penmType = RTFSTYPE_UNKNOWN;
diff --git a/src/VBox/Runtime/r3/posix/fs2-posix.cpp b/src/VBox/Runtime/r3/posix/fs2-posix.cpp
index fb5425d..b9fc7da 100644
--- a/src/VBox/Runtime/r3/posix/fs2-posix.cpp
+++ b/src/VBox/Runtime/r3/posix/fs2-posix.cpp
@@ -25,9 +25,9 @@
*/
-/*******************************************************************************
-* Header Files *
-*******************************************************************************/
+/*********************************************************************************************************************************
+* Header Files *
+*********************************************************************************************************************************/
#define RTTIME_INCL_TIMESPEC
#include <sys/time.h>
#include <sys/param.h>
diff --git a/src/VBox/Runtime/r3/posix/fs3-posix.cpp b/src/VBox/Runtime/r3/posix/fs3-posix.cpp
index bc3b72e..18c8925 100644
--- a/src/VBox/Runtime/r3/posix/fs3-posix.cpp
+++ b/src/VBox/Runtime/r3/posix/fs3-posix.cpp
@@ -25,9 +25,9 @@
*/
-/*******************************************************************************
-* Header Files *
-*******************************************************************************/
+/*********************************************************************************************************************************
+* Header Files *
+*********************************************************************************************************************************/
#include <iprt/fs.h>
#include "internal/iprt.h"
diff --git a/src/VBox/Runtime/r3/posix/ldrNative-posix.cpp b/src/VBox/Runtime/r3/posix/ldrNative-posix.cpp
index 35269d9..03d2cce 100644
--- a/src/VBox/Runtime/r3/posix/ldrNative-posix.cpp
+++ b/src/VBox/Runtime/r3/posix/ldrNative-posix.cpp
@@ -24,9 +24,10 @@
* terms and conditions of either the GPL or the CDDL or both.
*/
-/*******************************************************************************
-* Header Files *
-*******************************************************************************/
+
+/*********************************************************************************************************************************
+* Header Files *
+*********************************************************************************************************************************/
#define LOG_GROUP RTLOGGROUP_LDR
#include <dlfcn.h>
diff --git a/src/VBox/Runtime/r3/posix/path-posix.cpp b/src/VBox/Runtime/r3/posix/path-posix.cpp
index 683e7c4..0b42f19 100644
--- a/src/VBox/Runtime/r3/posix/path-posix.cpp
+++ b/src/VBox/Runtime/r3/posix/path-posix.cpp
@@ -25,9 +25,9 @@
*/
-/*******************************************************************************
-* Header Files *
-*******************************************************************************/
+/*********************************************************************************************************************************
+* Header Files *
+*********************************************************************************************************************************/
#define LOG_GROUP RTLOGGROUP_PATH
#include <stdlib.h>
#include <limits.h>
diff --git a/src/VBox/Runtime/r3/posix/path2-posix.cpp b/src/VBox/Runtime/r3/posix/path2-posix.cpp
index d3376f0..98b0e73 100644
--- a/src/VBox/Runtime/r3/posix/path2-posix.cpp
+++ b/src/VBox/Runtime/r3/posix/path2-posix.cpp
@@ -25,9 +25,9 @@
*/
-/*******************************************************************************
-* Header Files *
-*******************************************************************************/
+/*********************************************************************************************************************************
+* Header Files *
+*********************************************************************************************************************************/
#define LOG_GROUP RTLOGGROUP_PATH
#include <stdlib.h>
#include <limits.h>
diff --git a/src/VBox/Runtime/r3/posix/pathhost-posix.cpp b/src/VBox/Runtime/r3/posix/pathhost-posix.cpp
index bceee11..fa03b35 100644
--- a/src/VBox/Runtime/r3/posix/pathhost-posix.cpp
+++ b/src/VBox/Runtime/r3/posix/pathhost-posix.cpp
@@ -25,9 +25,9 @@
*/
-/*******************************************************************************
-* Header Files *
-*******************************************************************************/
+/*********************************************************************************************************************************
+* Header Files *
+*********************************************************************************************************************************/
#define LOG_GROUP RTLOGGROUP_PATH
#include "internal/iprt.h"
#include "internal/path.h"
@@ -39,9 +39,9 @@
#include <iprt/once.h>
-/*******************************************************************************
-* Global Variables *
-*******************************************************************************/
+/*********************************************************************************************************************************
+* Global Variables *
+*********************************************************************************************************************************/
/** Initialize once object. */
static RTONCE g_OnceInitPathConv = RTONCE_INITIALIZER;
/** If set, then we can pass UTF-8 thru directly. */
diff --git a/src/VBox/Runtime/r3/posix/pipe-posix.cpp b/src/VBox/Runtime/r3/posix/pipe-posix.cpp
index 949c928..f266422 100644
--- a/src/VBox/Runtime/r3/posix/pipe-posix.cpp
+++ b/src/VBox/Runtime/r3/posix/pipe-posix.cpp
@@ -25,9 +25,9 @@
*/
-/*******************************************************************************
-* Header Files *
-*******************************************************************************/
+/*********************************************************************************************************************************
+* Header Files *
+*********************************************************************************************************************************/
#include <iprt/pipe.h>
#include "internal/iprt.h"
@@ -58,9 +58,9 @@
#include "internal/pipe.h"
-/*******************************************************************************
-* Structures and Typedefs *
-*******************************************************************************/
+/*********************************************************************************************************************************
+* Structures and Typedefs *
+*********************************************************************************************************************************/
typedef struct RTPIPEINTERNAL
{
/** Magic value (RTPIPE_MAGIC). */
@@ -79,9 +79,9 @@ typedef struct RTPIPEINTERNAL
} RTPIPEINTERNAL;
-/*******************************************************************************
-* Defined Constants And Macros *
-*******************************************************************************/
+/*********************************************************************************************************************************
+* Defined Constants And Macros *
+*********************************************************************************************************************************/
/** @name RTPIPEINTERNAL::u32State defines
* @{ */
#define RTPIPE_POSIX_BLOCKING UINT32_C(0x40000000)
diff --git a/src/VBox/Runtime/r3/posix/process-creation-posix.cpp b/src/VBox/Runtime/r3/posix/process-creation-posix.cpp
index 3b9cdd7..bbf75d9 100644
--- a/src/VBox/Runtime/r3/posix/process-creation-posix.cpp
+++ b/src/VBox/Runtime/r3/posix/process-creation-posix.cpp
@@ -25,9 +25,9 @@
*/
-/*******************************************************************************
-* Header Files *
-*******************************************************************************/
+/*********************************************************************************************************************************
+* Header Files *
+*********************************************************************************************************************************/
#define LOG_GROUP RTLOGGROUP_PROCESS
#include <iprt/cdefs.h>
diff --git a/src/VBox/Runtime/r3/posix/process-posix.cpp b/src/VBox/Runtime/r3/posix/process-posix.cpp
index b96d840..0eefa6a 100644
--- a/src/VBox/Runtime/r3/posix/process-posix.cpp
+++ b/src/VBox/Runtime/r3/posix/process-posix.cpp
@@ -26,9 +26,9 @@
-/*******************************************************************************
-* Header Files *
-*******************************************************************************/
+/*********************************************************************************************************************************
+* Header Files *
+*********************************************************************************************************************************/
#define LOG_GROUP RTLOGGROUP_PROCESS
#include <unistd.h>
#include <stdlib.h>
diff --git a/src/VBox/Runtime/r3/posix/rand-posix.cpp b/src/VBox/Runtime/r3/posix/rand-posix.cpp
index cec0228..dcb67f3 100644
--- a/src/VBox/Runtime/r3/posix/rand-posix.cpp
+++ b/src/VBox/Runtime/r3/posix/rand-posix.cpp
@@ -25,9 +25,9 @@
*/
-/*******************************************************************************
-* Header Files *
-*******************************************************************************/
+/*********************************************************************************************************************************
+* Header Files *
+*********************************************************************************************************************************/
#include <errno.h>
#include <sys/stat.h>
#include <sys/types.h>
@@ -87,7 +87,7 @@ static DECLCALLBACK(int) rtRandAdvPosixDestroy(PRTRANDINT pThis)
}
-static int rtRandAdvPosixCreateSystem(PRTRAND phRand, const char *pszDev) RT_NO_THROW
+static int rtRandAdvPosixCreateSystem(PRTRAND phRand, const char *pszDev) RT_NO_THROW_DEF
{
/*
* Try open it first and then setup the handle structure.
@@ -125,13 +125,13 @@ static int rtRandAdvPosixCreateSystem(PRTRAND phRand, const char *pszDev) RT_NO_
}
-RTDECL(int) RTRandAdvCreateSystemFaster(PRTRAND phRand) RT_NO_THROW
+RTDECL(int) RTRandAdvCreateSystemFaster(PRTRAND phRand) RT_NO_THROW_DEF
{
return rtRandAdvPosixCreateSystem(phRand, "/dev/urandom");
}
-RTDECL(int) RTRandAdvCreateSystemTruer(PRTRAND phRand) RT_NO_THROW
+RTDECL(int) RTRandAdvCreateSystemTruer(PRTRAND phRand) RT_NO_THROW_DEF
{
return rtRandAdvPosixCreateSystem(phRand, "/dev/random");
}
diff --git a/src/VBox/Runtime/r3/posix/rtmempage-exec-mmap-heap-posix.cpp b/src/VBox/Runtime/r3/posix/rtmempage-exec-mmap-heap-posix.cpp
index 3431d04..5d580b6 100644
--- a/src/VBox/Runtime/r3/posix/rtmempage-exec-mmap-heap-posix.cpp
+++ b/src/VBox/Runtime/r3/posix/rtmempage-exec-mmap-heap-posix.cpp
@@ -25,9 +25,9 @@
*/
-/*******************************************************************************
-* Header Files *
-*******************************************************************************/
+/*********************************************************************************************************************************
+* Header Files *
+*********************************************************************************************************************************/
#include "internal/iprt.h"
#include <iprt/mem.h>
@@ -50,9 +50,9 @@
#endif
-/*******************************************************************************
-* Defined Constants And Macros *
-*******************************************************************************/
+/*********************************************************************************************************************************
+* Defined Constants And Macros *
+*********************************************************************************************************************************/
/** Threshold at which to we switch to simply calling mmap. */
#define RTMEMPAGEPOSIX_MMAP_THRESHOLD _128K
/** The size of a heap block (power of two) - in bytes. */
@@ -62,9 +62,9 @@ AssertCompile(RTMEMPAGEPOSIX_BLOCK_SIZE == (RTMEMPAGEPOSIX_BLOCK_SIZE / PAGE_SIZ
#define RTMEMPAGEPOSIX_BLOCK_PAGE_COUNT (RTMEMPAGEPOSIX_BLOCK_SIZE / PAGE_SIZE)
-/*******************************************************************************
-* Structures and Typedefs *
-*******************************************************************************/
+/*********************************************************************************************************************************
+* Structures and Typedefs *
+*********************************************************************************************************************************/
/** Pointer to a page heap block. */
typedef struct RTHEAPPAGEBLOCK *PRTHEAPPAGEBLOCK;
@@ -134,9 +134,9 @@ typedef struct RTHEAPPAGEALLOCARGS
} RTHEAPPAGEALLOCARGS;
-/*******************************************************************************
-* Global Variables *
-*******************************************************************************/
+/*********************************************************************************************************************************
+* Global Variables *
+*********************************************************************************************************************************/
/** Initialize once structure. */
static RTONCE g_MemPagePosixInitOnce = RTONCE_INITIALIZER;
/** The page heap. */
@@ -723,19 +723,19 @@ static void rtMemPagePosixFree(void *pv, size_t cb, PRTHEAPPAGE pHeap)
-RTDECL(void *) RTMemPageAllocTag(size_t cb, const char *pszTag) RT_NO_THROW
+RTDECL(void *) RTMemPageAllocTag(size_t cb, const char *pszTag) RT_NO_THROW_DEF
{
return rtMemPagePosixAlloc(cb, pszTag, false /*fZero*/, &g_MemPagePosixHeap);
}
-RTDECL(void *) RTMemPageAllocZTag(size_t cb, const char *pszTag) RT_NO_THROW
+RTDECL(void *) RTMemPageAllocZTag(size_t cb, const char *pszTag) RT_NO_THROW_DEF
{
return rtMemPagePosixAlloc(cb, pszTag, true /*fZero*/, &g_MemPagePosixHeap);
}
-RTDECL(void) RTMemPageFree(void *pv, size_t cb) RT_NO_THROW
+RTDECL(void) RTMemPageFree(void *pv, size_t cb) RT_NO_THROW_DEF
{
return rtMemPagePosixFree(pv, cb, &g_MemPagePosixHeap);
}
@@ -744,13 +744,13 @@ RTDECL(void) RTMemPageFree(void *pv, size_t cb) RT_NO_THROW
-RTDECL(void *) RTMemExecAllocTag(size_t cb, const char *pszTag) RT_NO_THROW
+RTDECL(void *) RTMemExecAllocTag(size_t cb, const char *pszTag) RT_NO_THROW_DEF
{
return rtMemPagePosixAlloc(cb, pszTag, false /*fZero*/, &g_MemExecPosixHeap);
}
-RTDECL(void) RTMemExecFree(void *pv, size_t cb) RT_NO_THROW
+RTDECL(void) RTMemExecFree(void *pv, size_t cb) RT_NO_THROW_DEF
{
return rtMemPagePosixFree(pv, cb, &g_MemExecPosixHeap);
}
diff --git a/src/VBox/Runtime/r3/posix/rtmempage-exec-mmap-posix.cpp b/src/VBox/Runtime/r3/posix/rtmempage-exec-mmap-posix.cpp
index 202723c..c6ecd61 100644
--- a/src/VBox/Runtime/r3/posix/rtmempage-exec-mmap-posix.cpp
+++ b/src/VBox/Runtime/r3/posix/rtmempage-exec-mmap-posix.cpp
@@ -25,9 +25,9 @@
*/
-/*******************************************************************************
-* Header Files *
-*******************************************************************************/
+/*********************************************************************************************************************************
+* Header Files *
+*********************************************************************************************************************************/
#include "internal/iprt.h"
#include <iprt/mem.h>
@@ -111,19 +111,19 @@ static void rtMemPagePosixFree(void *pv, size_t cb)
-RTDECL(void *) RTMemPageAllocTag(size_t cb, const char *pszTag) RT_NO_THROW
+RTDECL(void *) RTMemPageAllocTag(size_t cb, const char *pszTag) RT_NO_THROW_DEF
{
return rtMemPagePosixAlloc(cb, pszTag, false /*fZero*/, 0);
}
-RTDECL(void *) RTMemPageAllocZTag(size_t cb, const char *pszTag) RT_NO_THROW
+RTDECL(void *) RTMemPageAllocZTag(size_t cb, const char *pszTag) RT_NO_THROW_DEF
{
return rtMemPagePosixAlloc(cb, pszTag, true /*fZero*/, 0);
}
-RTDECL(void) RTMemPageFree(void *pv, size_t cb) RT_NO_THROW
+RTDECL(void) RTMemPageFree(void *pv, size_t cb) RT_NO_THROW_DEF
{
return rtMemPagePosixFree(pv, cb);
}
@@ -132,13 +132,13 @@ RTDECL(void) RTMemPageFree(void *pv, size_t cb) RT_NO_THROW
-RTDECL(void *) RTMemExecAllocTag(size_t cb, const char *pszTag) RT_NO_THROW
+RTDECL(void *) RTMemExecAllocTag(size_t cb, const char *pszTag) RT_NO_THROW_DEF
{
return rtMemPagePosixAlloc(cb, pszTag, false /*fZero*/, PROT_EXEC);
}
-RTDECL(void) RTMemExecFree(void *pv, size_t cb) RT_NO_THROW
+RTDECL(void) RTMemExecFree(void *pv, size_t cb) RT_NO_THROW_DEF
{
return rtMemPagePosixFree(pv, cb);
}
diff --git a/src/VBox/Runtime/r3/posix/sched-posix.cpp b/src/VBox/Runtime/r3/posix/sched-posix.cpp
index 23b9ac3..5d6e7b8 100644
--- a/src/VBox/Runtime/r3/posix/sched-posix.cpp
+++ b/src/VBox/Runtime/r3/posix/sched-posix.cpp
@@ -46,9 +46,10 @@
#define THREAD_LOGGING
#endif
-/*******************************************************************************
-* Header Files *
-*******************************************************************************/
+
+/*********************************************************************************************************************************
+* Header Files *
+*********************************************************************************************************************************/
#define LOG_GROUP RTLOGGROUP_THREAD
#include <errno.h>
#include <pthread.h>
@@ -67,9 +68,9 @@
#include "internal/thread.h"
-/*******************************************************************************
-* Structures and Typedefs *
-*******************************************************************************/
+/*********************************************************************************************************************************
+* Structures and Typedefs *
+*********************************************************************************************************************************/
/** Array scheduler attributes corresponding to each of the thread types. */
typedef struct PROCPRIORITYTYPE
@@ -117,9 +118,9 @@ typedef struct
} SAVEDPRIORITY, *PSAVEDPRIORITY;
-/*******************************************************************************
-* Global Variables *
-*******************************************************************************/
+/*********************************************************************************************************************************
+* Global Variables *
+*********************************************************************************************************************************/
/**
* Thread level priorities based on a 0..31 priority range
* as specified as the minimum for SCHED_RR/FIFO. FreeBSD
@@ -324,9 +325,9 @@ static enum
bool g_fCanNice = false;
-/*******************************************************************************
-* Internal Functions *
-*******************************************************************************/
+/*********************************************************************************************************************************
+* Internal Functions *
+*********************************************************************************************************************************/
/**
diff --git a/src/VBox/Runtime/r3/posix/semevent-posix.cpp b/src/VBox/Runtime/r3/posix/semevent-posix.cpp
index 90a17de..09cac5b 100644
--- a/src/VBox/Runtime/r3/posix/semevent-posix.cpp
+++ b/src/VBox/Runtime/r3/posix/semevent-posix.cpp
@@ -24,9 +24,10 @@
* terms and conditions of either the GPL or the CDDL or both.
*/
-/*******************************************************************************
-* Header Files *
-*******************************************************************************/
+
+/*********************************************************************************************************************************
+* Header Files *
+*********************************************************************************************************************************/
#include <iprt/semaphore.h>
#include "internal/iprt.h"
@@ -54,9 +55,9 @@
#endif
-/*******************************************************************************
-* Structures and Typedefs *
-*******************************************************************************/
+/*********************************************************************************************************************************
+* Structures and Typedefs *
+*********************************************************************************************************************************/
/** Internal representation of the POSIX implementation of an Event semaphore.
* The POSIX implementation uses a mutex and a condition variable to implement
diff --git a/src/VBox/Runtime/r3/posix/semeventmulti-posix.cpp b/src/VBox/Runtime/r3/posix/semeventmulti-posix.cpp
index a84ace1..752ddd8 100644
--- a/src/VBox/Runtime/r3/posix/semeventmulti-posix.cpp
+++ b/src/VBox/Runtime/r3/posix/semeventmulti-posix.cpp
@@ -24,9 +24,10 @@
* terms and conditions of either the GPL or the CDDL or both.
*/
-/*******************************************************************************
-* Header Files *
-*******************************************************************************/
+
+/*********************************************************************************************************************************
+* Header Files *
+*********************************************************************************************************************************/
#include <iprt/semaphore.h>
#include "internal/iprt.h"
@@ -45,9 +46,9 @@
#include <sys/time.h>
-/*******************************************************************************
-* Defined Constants And Macros *
-*******************************************************************************/
+/*********************************************************************************************************************************
+* Defined Constants And Macros *
+*********************************************************************************************************************************/
/** @def IPRT_HAVE_PTHREAD_CONDATTR_SETCLOCK
* Set if the platform implements pthread_condattr_setclock().
* Enables the use of the monotonic clock for waiting on condition variables. */
@@ -63,9 +64,9 @@
#endif
-/*******************************************************************************
-* Structures and Typedefs *
-*******************************************************************************/
+/*********************************************************************************************************************************
+* Structures and Typedefs *
+*********************************************************************************************************************************/
/** Posix internal representation of a Mutex Multi semaphore.
* The POSIX implementation uses a mutex and a condition variable to implement
* the automatic reset event semaphore semantics. */
diff --git a/src/VBox/Runtime/r3/posix/semmutex-posix.cpp b/src/VBox/Runtime/r3/posix/semmutex-posix.cpp
index 7e713be..56e3132 100644
--- a/src/VBox/Runtime/r3/posix/semmutex-posix.cpp
+++ b/src/VBox/Runtime/r3/posix/semmutex-posix.cpp
@@ -24,9 +24,10 @@
* terms and conditions of either the GPL or the CDDL or both.
*/
-/*******************************************************************************
-* Header Files *
-*******************************************************************************/
+
+/*********************************************************************************************************************************
+* Header Files *
+*********************************************************************************************************************************/
#include <iprt/semaphore.h>
#include "internal/iprt.h"
@@ -45,9 +46,9 @@
#include <sys/time.h>
-/*******************************************************************************
-* Structures and Typedefs *
-*******************************************************************************/
+/*********************************************************************************************************************************
+* Structures and Typedefs *
+*********************************************************************************************************************************/
/** Posix internal representation of a Mutex semaphore. */
struct RTSEMMUTEXINTERNAL
{
diff --git a/src/VBox/Runtime/r3/posix/semrw-posix.cpp b/src/VBox/Runtime/r3/posix/semrw-posix.cpp
index 8a47c92..4c8b2d9 100644
--- a/src/VBox/Runtime/r3/posix/semrw-posix.cpp
+++ b/src/VBox/Runtime/r3/posix/semrw-posix.cpp
@@ -24,9 +24,10 @@
* terms and conditions of either the GPL or the CDDL or both.
*/
-/*******************************************************************************
-* Header Files *
-*******************************************************************************/
+
+/*********************************************************************************************************************************
+* Header Files *
+*********************************************************************************************************************************/
#include <iprt/semaphore.h>
#include "internal/iprt.h"
@@ -46,9 +47,9 @@
#include "internal/strict.h"
-/*******************************************************************************
-* Defined Constants And Macros *
-*******************************************************************************/
+/*********************************************************************************************************************************
+* Defined Constants And Macros *
+*********************************************************************************************************************************/
/** @todo move this to r3/posix/something.h. */
#ifdef RT_OS_SOLARIS
# define ATOMIC_GET_PTHREAD_T(ppvVar, pThread) ASMAtomicReadSize(ppvVar, pThread)
@@ -60,9 +61,9 @@ AssertCompileSize(pthread_t, sizeof(void *));
#endif
-/*******************************************************************************
-* Structures and Typedefs *
-*******************************************************************************/
+/*********************************************************************************************************************************
+* Structures and Typedefs *
+*********************************************************************************************************************************/
/** Posix internal representation of a read-write semaphore. */
struct RTSEMRWINTERNAL
{
diff --git a/src/VBox/Runtime/r3/posix/symlink-posix.cpp b/src/VBox/Runtime/r3/posix/symlink-posix.cpp
index 1c819d5..46be2b4 100644
--- a/src/VBox/Runtime/r3/posix/symlink-posix.cpp
+++ b/src/VBox/Runtime/r3/posix/symlink-posix.cpp
@@ -25,9 +25,9 @@
*/
-/*******************************************************************************
-* Header Files *
-*******************************************************************************/
+/*********************************************************************************************************************************
+* Header Files *
+*********************************************************************************************************************************/
#define LOG_GROUP RTLOGGROUP_SYMLINK
#include <errno.h>
diff --git a/src/VBox/Runtime/r3/posix/thread-posix.cpp b/src/VBox/Runtime/r3/posix/thread-posix.cpp
index 917c1ca..caf3442 100644
--- a/src/VBox/Runtime/r3/posix/thread-posix.cpp
+++ b/src/VBox/Runtime/r3/posix/thread-posix.cpp
@@ -25,9 +25,9 @@
*/
-/*******************************************************************************
-* Header Files *
-*******************************************************************************/
+/*********************************************************************************************************************************
+* Header Files *
+*********************************************************************************************************************************/
#define LOG_GROUP RTLOGGROUP_THREAD
#include <errno.h>
#include <pthread.h>
@@ -67,18 +67,18 @@
#include "internal/thread.h"
-/*******************************************************************************
-* Defined Constants And Macros *
-*******************************************************************************/
+/*********************************************************************************************************************************
+* Defined Constants And Macros *
+*********************************************************************************************************************************/
#ifndef IN_GUEST
/** Includes RTThreadPoke. */
# define RTTHREAD_POSIX_WITH_POKE
#endif
-/*******************************************************************************
-* Global Variables *
-*******************************************************************************/
+/*********************************************************************************************************************************
+* Global Variables *
+*********************************************************************************************************************************/
/** The pthread key in which we store the pointer to our own PRTTHREAD structure. */
static pthread_key_t g_SelfKey;
#ifdef RTTHREAD_POSIX_WITH_POKE
@@ -112,9 +112,9 @@ static PFNPTHREADSETNAME g_pfnThreadSetName = NULL;
#endif /* IPRT_MAY_HAVE_PTHREAD_SET_NAME_NP */
-/*******************************************************************************
-* Internal Functions *
-*******************************************************************************/
+/*********************************************************************************************************************************
+* Internal Functions *
+*********************************************************************************************************************************/
static void *rtThreadNativeMain(void *pvArgs);
static void rtThreadKeyDestruct(void *pvValue);
static void rtThreadPosixPokeSignal(int iSignal);
diff --git a/src/VBox/Runtime/r3/posix/thread2-posix.cpp b/src/VBox/Runtime/r3/posix/thread2-posix.cpp
index 00e68a2..7bdbe2f 100644
--- a/src/VBox/Runtime/r3/posix/thread2-posix.cpp
+++ b/src/VBox/Runtime/r3/posix/thread2-posix.cpp
@@ -25,9 +25,9 @@
*/
-/*******************************************************************************
-* Header Files *
-*******************************************************************************/
+/*********************************************************************************************************************************
+* Header Files *
+*********************************************************************************************************************************/
#define LOG_GROUP RTLOGGROUP_THREAD
#include <errno.h>
#include <pthread.h>
diff --git a/src/VBox/Runtime/r3/posix/time-posix.cpp b/src/VBox/Runtime/r3/posix/time-posix.cpp
index d39ace6..7c6f372 100644
--- a/src/VBox/Runtime/r3/posix/time-posix.cpp
+++ b/src/VBox/Runtime/r3/posix/time-posix.cpp
@@ -25,9 +25,9 @@
*/
-/*******************************************************************************
-* Header Files *
-*******************************************************************************/
+/*********************************************************************************************************************************
+* Header Files *
+*********************************************************************************************************************************/
#define LOG_GROUP RTLOGGROUP_TIME
#define RTTIME_INCL_TIMEVAL
#include <sys/time.h>
diff --git a/src/VBox/Runtime/r3/posix/timelocal-posix.cpp b/src/VBox/Runtime/r3/posix/timelocal-posix.cpp
index 60f068e..08edad9 100644
--- a/src/VBox/Runtime/r3/posix/timelocal-posix.cpp
+++ b/src/VBox/Runtime/r3/posix/timelocal-posix.cpp
@@ -25,9 +25,9 @@
*/
-/*******************************************************************************
-* Header Files *
-*******************************************************************************/
+/*********************************************************************************************************************************
+* Header Files *
+*********************************************************************************************************************************/
#define LOG_GROUP RTLOGGROUP_TIME
#define RTTIME_INCL_TIMEVAL
#include <iprt/types.h>
diff --git a/src/VBox/Runtime/r3/posix/timer-posix.cpp b/src/VBox/Runtime/r3/posix/timer-posix.cpp
index f971cb2..3ba4ef6 100644
--- a/src/VBox/Runtime/r3/posix/timer-posix.cpp
+++ b/src/VBox/Runtime/r3/posix/timer-posix.cpp
@@ -24,9 +24,10 @@
* terms and conditions of either the GPL or the CDDL or both.
*/
-/*******************************************************************************
-* Defined Constants And Macros *
-*******************************************************************************/
+
+/*********************************************************************************************************************************
+* Defined Constants And Macros *
+*********************************************************************************************************************************/
/** Enables the use of POSIX RT timers. */
#ifndef RT_OS_SOLARIS /* Solaris 10 doesn't have SIGEV_THREAD */
# define IPRT_WITH_POSIX_TIMERS
@@ -43,9 +44,9 @@
#endif
-/*******************************************************************************
-* Header Files *
-*******************************************************************************/
+/*********************************************************************************************************************************
+* Header Files *
+*********************************************************************************************************************************/
#define LOG_GROUP RTLOGGROUP_TIMER
#include <iprt/timer.h>
#include <iprt/alloc.h>
@@ -73,9 +74,9 @@
#include <pthread.h>
-/*******************************************************************************
-* Global Variables *
-*******************************************************************************/
+/*********************************************************************************************************************************
+* Global Variables *
+*********************************************************************************************************************************/
#ifdef IPRT_WITH_POSIX_TIMERS
/** Init the critsect on first call. */
static RTONCE g_TimerOnce = RTONCE_INITIALIZER;
@@ -94,9 +95,9 @@ static RTTHREAD g_TimerThread;
#endif /* IPRT_WITH_POSIX_TIMERS */
-/*******************************************************************************
-* Structures and Typedefs *
-*******************************************************************************/
+/*********************************************************************************************************************************
+* Structures and Typedefs *
+*********************************************************************************************************************************/
/**
* The internal representation of a timer handle.
*/
diff --git a/src/VBox/Runtime/r3/posix/tls-posix.cpp b/src/VBox/Runtime/r3/posix/tls-posix.cpp
index c95705d..0eae42f 100644
--- a/src/VBox/Runtime/r3/posix/tls-posix.cpp
+++ b/src/VBox/Runtime/r3/posix/tls-posix.cpp
@@ -25,9 +25,9 @@
*/
-/*******************************************************************************
-* Header Files *
-*******************************************************************************/
+/*********************************************************************************************************************************
+* Header Files *
+*********************************************************************************************************************************/
#define LOG_GROUP RTLOGGROUP_THREAD
#include <errno.h>
#include <pthread.h>
@@ -57,7 +57,11 @@ RTR3DECL(RTTLS) RTTlsAlloc(void)
RTR3DECL(int) RTTlsAllocEx(PRTTLS piTls, PFNRTTLSDTOR pfnDestructor)
{
pthread_key_t iTls = (pthread_key_t)NIL_RTTLS;
+#if defined(__GNUC__) && defined(RT_ARCH_X86)
+ int rc = pthread_key_create(&iTls, (void (*)(void*))pfnDestructor);
+#else
int rc = pthread_key_create(&iTls, pfnDestructor);
+#endif
if (!rc)
{
*piTls = iTls;
diff --git a/src/VBox/Runtime/r3/posix/utf8-posix.cpp b/src/VBox/Runtime/r3/posix/utf8-posix.cpp
index caa97d0..a4481dd 100644
--- a/src/VBox/Runtime/r3/posix/utf8-posix.cpp
+++ b/src/VBox/Runtime/r3/posix/utf8-posix.cpp
@@ -25,9 +25,9 @@
*/
-/*******************************************************************************
-* Header Files *
-*******************************************************************************/
+/*********************************************************************************************************************************
+* Header Files *
+*********************************************************************************************************************************/
#include <iprt/string.h>
#include "internal/iprt.h"
diff --git a/src/VBox/Runtime/r3/process.cpp b/src/VBox/Runtime/r3/process.cpp
index ad55bc6..d48c783 100644
--- a/src/VBox/Runtime/r3/process.cpp
+++ b/src/VBox/Runtime/r3/process.cpp
@@ -26,9 +26,9 @@
-/*******************************************************************************
-* Header Files *
-*******************************************************************************/
+/*********************************************************************************************************************************
+* Header Files *
+*********************************************************************************************************************************/
#include <iprt/process.h>
#include <iprt/assert.h>
#include <iprt/err.h>
diff --git a/src/VBox/Runtime/r3/socket.cpp b/src/VBox/Runtime/r3/socket.cpp
index 56ac9bd..c42d3bc 100644
--- a/src/VBox/Runtime/r3/socket.cpp
+++ b/src/VBox/Runtime/r3/socket.cpp
@@ -25,9 +25,9 @@
*/
-/*******************************************************************************
-* Header Files *
-*******************************************************************************/
+/*********************************************************************************************************************************
+* Header Files *
+*********************************************************************************************************************************/
#ifdef RT_OS_WINDOWS
# include <winsock2.h>
# include <ws2tcpip.h>
@@ -72,9 +72,9 @@
#include "internal/string.h"
-/*******************************************************************************
-* Defined Constants And Macros *
-*******************************************************************************/
+/*********************************************************************************************************************************
+* Defined Constants And Macros *
+*********************************************************************************************************************************/
/* non-standard linux stuff (it seems). */
#ifndef MSG_NOSIGNAL
# define MSG_NOSIGNAL 0
@@ -121,9 +121,9 @@
#endif
-/*******************************************************************************
-* Structures and Typedefs *
-*******************************************************************************/
+/*********************************************************************************************************************************
+* Structures and Typedefs *
+*********************************************************************************************************************************/
/**
* Socket handle data.
*
diff --git a/src/VBox/Runtime/r3/solaris/RTSystemQueryDmiString-solaris.cpp b/src/VBox/Runtime/r3/solaris/RTSystemQueryDmiString-solaris.cpp
index 3619508..2fa09d7 100644
--- a/src/VBox/Runtime/r3/solaris/RTSystemQueryDmiString-solaris.cpp
+++ b/src/VBox/Runtime/r3/solaris/RTSystemQueryDmiString-solaris.cpp
@@ -25,9 +25,9 @@
*/
-/*******************************************************************************
-* Header Files *
-*******************************************************************************/
+/*********************************************************************************************************************************
+* Header Files *
+*********************************************************************************************************************************/
#include <iprt/system.h>
#include "internal/iprt.h"
diff --git a/src/VBox/Runtime/r3/solaris/RTSystemShutdown-solaris.cpp b/src/VBox/Runtime/r3/solaris/RTSystemShutdown-solaris.cpp
index d3da8da..192360a 100644
--- a/src/VBox/Runtime/r3/solaris/RTSystemShutdown-solaris.cpp
+++ b/src/VBox/Runtime/r3/solaris/RTSystemShutdown-solaris.cpp
@@ -25,9 +25,9 @@
*/
-/*******************************************************************************
-* Header Files *
-*******************************************************************************/
+/*********************************************************************************************************************************
+* Header Files *
+*********************************************************************************************************************************/
#include <iprt/system.h>
#include "internal/iprt.h"
diff --git a/src/VBox/Runtime/r3/solaris/coredumper-solaris.cpp b/src/VBox/Runtime/r3/solaris/coredumper-solaris.cpp
index 4ac0a04..8c0329e 100644
--- a/src/VBox/Runtime/r3/solaris/coredumper-solaris.cpp
+++ b/src/VBox/Runtime/r3/solaris/coredumper-solaris.cpp
@@ -25,9 +25,9 @@
*/
-/*******************************************************************************
-* Header Files *
-*******************************************************************************/
+/*********************************************************************************************************************************
+* Header Files *
+*********************************************************************************************************************************/
#define LOG_GROUP RTLOGGROUP_DEFAULT
#include <iprt/coredumper.h>
@@ -63,9 +63,9 @@
#include "internal/ldrELF64.h"
-/*******************************************************************************
-* Globals *
-*******************************************************************************/
+/*********************************************************************************************************************************
+* Globals *
+*********************************************************************************************************************************/
static RTNATIVETHREAD volatile g_CoreDumpThread = NIL_RTNATIVETHREAD;
static bool volatile g_fCoreDumpSignalSetup = false;
static uint32_t volatile g_fCoreDumpFlags = 0;
@@ -73,9 +73,9 @@ static char g_szCoreDumpDir[PATH_MAX] = { 0 };
static char g_szCoreDumpFile[PATH_MAX] = { 0 };
-/*******************************************************************************
-* Defined Constants And Macros *
-*******************************************************************************/
+/*********************************************************************************************************************************
+* Defined Constants And Macros *
+*********************************************************************************************************************************/
#define CORELOG_NAME "CoreDumper: "
#define CORELOG(a) Log(a)
#define CORELOGRELSYS(a) \
diff --git a/src/VBox/Runtime/r3/solaris/fileaio-solaris.cpp b/src/VBox/Runtime/r3/solaris/fileaio-solaris.cpp
index 59ddca0..8ff6b72 100644
--- a/src/VBox/Runtime/r3/solaris/fileaio-solaris.cpp
+++ b/src/VBox/Runtime/r3/solaris/fileaio-solaris.cpp
@@ -24,9 +24,10 @@
* terms and conditions of either the GPL or the CDDL or both.
*/
-/*******************************************************************************
-* Header Files *
-*******************************************************************************/
+
+/*********************************************************************************************************************************
+* Header Files *
+*********************************************************************************************************************************/
#define LOG_GROUP RTLOGGROUP_FILE
#include <iprt/asm.h>
#include <iprt/file.h>
@@ -43,9 +44,9 @@
#include <unistd.h>
-/*******************************************************************************
-* Structures and Typedefs *
-*******************************************************************************/
+/*********************************************************************************************************************************
+* Structures and Typedefs *
+*********************************************************************************************************************************/
/**
* Async I/O completion context state.
*/
@@ -88,9 +89,9 @@ typedef struct RTFILEAIOREQINTERNAL
typedef RTFILEAIOREQINTERNAL *PRTFILEAIOREQINTERNAL;
-/*******************************************************************************
-* Defined Constants And Macros *
-*******************************************************************************/
+/*********************************************************************************************************************************
+* Defined Constants And Macros *
+*********************************************************************************************************************************/
/** The max number of events to get in one call. */
#define AIO_MAXIMUM_REQUESTS_PER_CONTEXT 64
/** Id for the wakeup event. */
diff --git a/src/VBox/Runtime/r3/solaris/mp-solaris.cpp b/src/VBox/Runtime/r3/solaris/mp-solaris.cpp
index 12fdc0b..3d0f7a5 100644
--- a/src/VBox/Runtime/r3/solaris/mp-solaris.cpp
+++ b/src/VBox/Runtime/r3/solaris/mp-solaris.cpp
@@ -24,9 +24,10 @@
* terms and conditions of either the GPL or the CDDL or both.
*/
-/*******************************************************************************
-* Header Files *
-*******************************************************************************/
+
+/*********************************************************************************************************************************
+* Header Files *
+*********************************************************************************************************************************/
#define LOG_GROUP RTLOGGROUP_DEFAULT
#include <unistd.h>
#include <stdio.h>
@@ -44,9 +45,9 @@
#include <iprt/critsect.h>
-/*******************************************************************************
-* Global Variables *
-*******************************************************************************/
+/*********************************************************************************************************************************
+* Global Variables *
+*********************************************************************************************************************************/
/** Initialization serializing (rtMpSolarisOnce). */
static RTONCE g_MpSolarisOnce = RTONCE_INITIALIZER;
/** Critical section serializing access to kstat. */
diff --git a/src/VBox/Runtime/r3/solaris/rtProcInitExePath-solaris.cpp b/src/VBox/Runtime/r3/solaris/rtProcInitExePath-solaris.cpp
index 0a2fd2e..5c1c14b 100644
--- a/src/VBox/Runtime/r3/solaris/rtProcInitExePath-solaris.cpp
+++ b/src/VBox/Runtime/r3/solaris/rtProcInitExePath-solaris.cpp
@@ -24,9 +24,10 @@
* terms and conditions of either the GPL or the CDDL or both.
*/
-/*******************************************************************************
-* Header Files *
-*******************************************************************************/
+
+/*********************************************************************************************************************************
+* Header Files *
+*********************************************************************************************************************************/
#define LOG_GROUP RTLOGGROUP_PROCESS
#include <unistd.h>
#include <errno.h>
diff --git a/src/VBox/Runtime/r3/solaris/systemmem-solaris.cpp b/src/VBox/Runtime/r3/solaris/systemmem-solaris.cpp
index 66fd319..c8ae627 100644
--- a/src/VBox/Runtime/r3/solaris/systemmem-solaris.cpp
+++ b/src/VBox/Runtime/r3/solaris/systemmem-solaris.cpp
@@ -25,9 +25,9 @@
*/
-/*******************************************************************************
-* Header Files *
-*******************************************************************************/
+/*********************************************************************************************************************************
+* Header Files *
+*********************************************************************************************************************************/
#include <iprt/system.h>
#include "internal/iprt.h"
@@ -41,9 +41,9 @@
#include <kstat.h>
-/*******************************************************************************
-* Global Variables *
-*******************************************************************************/
+/*********************************************************************************************************************************
+* Global Variables *
+*********************************************************************************************************************************/
/** Initialize globals once. */
static RTONCE g_rtSysMemSolInitOnce = RTONCE_INITIALIZER;
/** Critical section serializing access to g_pKStatCtl and the other handles. */
diff --git a/src/VBox/Runtime/r3/solaris/thread-affinity-solaris.cpp b/src/VBox/Runtime/r3/solaris/thread-affinity-solaris.cpp
index dbe9e08..92ad05d 100644
--- a/src/VBox/Runtime/r3/solaris/thread-affinity-solaris.cpp
+++ b/src/VBox/Runtime/r3/solaris/thread-affinity-solaris.cpp
@@ -25,9 +25,9 @@
*/
-/*******************************************************************************
-* Header Files *
-*******************************************************************************/
+/*********************************************************************************************************************************
+* Header Files *
+*********************************************************************************************************************************/
#include <iprt/thread.h>
#include "internal/iprt.h"
diff --git a/src/VBox/Runtime/r3/stream.cpp b/src/VBox/Runtime/r3/stream.cpp
index 7b4a648..5487532 100644
--- a/src/VBox/Runtime/r3/stream.cpp
+++ b/src/VBox/Runtime/r3/stream.cpp
@@ -30,9 +30,10 @@
#define HAVE_FWRITE_UNLOCKED
#endif
-/*******************************************************************************
-* Header Files *
-*******************************************************************************/
+
+/*********************************************************************************************************************************
+* Header Files *
+*********************************************************************************************************************************/
#include <iprt/stream.h>
#include "internal/iprt.h"
@@ -70,9 +71,9 @@
#endif
-/*******************************************************************************
-* Structures and Typedefs *
-*******************************************************************************/
+/*********************************************************************************************************************************
+* Structures and Typedefs *
+*********************************************************************************************************************************/
/**
* File stream.
*/
@@ -97,9 +98,9 @@ typedef struct RTSTREAM
} RTSTREAM;
-/*******************************************************************************
-* Global Variables *
-*******************************************************************************/
+/*********************************************************************************************************************************
+* Global Variables *
+*********************************************************************************************************************************/
/** The standard input stream. */
static RTSTREAM g_StdIn =
{
diff --git a/src/VBox/Runtime/r3/tcp.cpp b/src/VBox/Runtime/r3/tcp.cpp
index a76b088..4131ecb 100644
--- a/src/VBox/Runtime/r3/tcp.cpp
+++ b/src/VBox/Runtime/r3/tcp.cpp
@@ -25,9 +25,9 @@
*/
-/*******************************************************************************
-* Header Files *
-*******************************************************************************/
+/*********************************************************************************************************************************
+* Header Files *
+*********************************************************************************************************************************/
#ifdef RT_OS_WINDOWS
# include <winsock2.h>
#else
@@ -62,9 +62,9 @@
#include "internal/socket.h"
-/*******************************************************************************
-* Defined Constants And Macros *
-*******************************************************************************/
+/*********************************************************************************************************************************
+* Defined Constants And Macros *
+*********************************************************************************************************************************/
/* non-standard linux stuff (it seems). */
#ifndef MSG_NOSIGNAL
# define MSG_NOSIGNAL 0
@@ -93,9 +93,9 @@
#define RTTCP_SERVER_BACKLOG 10
-/*******************************************************************************
-* Structures and Typedefs *
-*******************************************************************************/
+/*********************************************************************************************************************************
+* Structures and Typedefs *
+*********************************************************************************************************************************/
/**
* TCP Server state.
*/
@@ -142,9 +142,9 @@ typedef struct RTTCPSERVER
} RTTCPSERVER;
-/*******************************************************************************
-* Internal Functions *
-*******************************************************************************/
+/*********************************************************************************************************************************
+* Internal Functions *
+*********************************************************************************************************************************/
static DECLCALLBACK(int) rtTcpServerThread(RTTHREAD ThreadSelf, void *pvServer);
static int rtTcpServerListen(PRTTCPSERVER pServer);
static int rtTcpServerListenCleanup(PRTTCPSERVER pServer);
diff --git a/src/VBox/Runtime/r3/test.cpp b/src/VBox/Runtime/r3/test.cpp
index 451502f..00410c6 100644
--- a/src/VBox/Runtime/r3/test.cpp
+++ b/src/VBox/Runtime/r3/test.cpp
@@ -25,9 +25,9 @@
*/
-/*******************************************************************************
-* Header Files *
-*******************************************************************************/
+/*********************************************************************************************************************************
+* Header Files *
+*********************************************************************************************************************************/
#include <iprt/test.h>
#include <iprt/asm.h>
@@ -46,9 +46,9 @@
#include "internal/magics.h"
-/*******************************************************************************
-* Structures and Typedefs *
-*******************************************************************************/
+/*********************************************************************************************************************************
+* Structures and Typedefs *
+*********************************************************************************************************************************/
/**
* Guarded memory allocation record.
*/
@@ -149,9 +149,9 @@ typedef struct RTTESTINT
typedef RTTESTINT *PRTTESTINT;
-/*******************************************************************************
-* Defined Constants And Macros *
-*******************************************************************************/
+/*********************************************************************************************************************************
+* Defined Constants And Macros *
+*********************************************************************************************************************************/
/** Validate a test instance. */
#define RTTEST_VALID_RETURN(pTest) \
do { \
@@ -183,9 +183,9 @@ typedef RTTESTINT *PRTTESTINT;
} while (0)
-/*******************************************************************************
-* Internal Functions *
-*******************************************************************************/
+/*********************************************************************************************************************************
+* Internal Functions *
+*********************************************************************************************************************************/
static void rtTestGuardedFreeOne(PRTTESTGUARDEDMEM pMem);
static int rtTestPrintf(PRTTESTINT pTest, const char *pszFormat, ...);
static void rtTestXmlStart(PRTTESTINT pTest, const char *pszTest);
@@ -197,9 +197,9 @@ static void rtTestXmlElemEnd(PRTTESTINT pTest, const char *pszTag);
static void rtTestXmlEnd(PRTTESTINT pTest);
-/*******************************************************************************
-* Global Variables *
-*******************************************************************************/
+/*********************************************************************************************************************************
+* Global Variables *
+*********************************************************************************************************************************/
/** For serializing TLS init. */
static RTONCE g_TestInitOnce = RTONCE_INITIALIZER;
/** Our TLS entry. */
diff --git a/src/VBox/Runtime/r3/testi.cpp b/src/VBox/Runtime/r3/testi.cpp
index ecb8ff0..6799c05 100644
--- a/src/VBox/Runtime/r3/testi.cpp
+++ b/src/VBox/Runtime/r3/testi.cpp
@@ -25,9 +25,9 @@
*/
-/*******************************************************************************
-* Header Files *
-*******************************************************************************/
+/*********************************************************************************************************************************
+* Header Files *
+*********************************************************************************************************************************/
#include <iprt/test.h>
#include <iprt/stdarg.h>
diff --git a/src/VBox/Runtime/r3/udp.cpp b/src/VBox/Runtime/r3/udp.cpp
index c58975a..aa895e3 100644
--- a/src/VBox/Runtime/r3/udp.cpp
+++ b/src/VBox/Runtime/r3/udp.cpp
@@ -25,9 +25,9 @@
*/
-/*******************************************************************************
-* Header Files *
-*******************************************************************************/
+/*********************************************************************************************************************************
+* Header Files *
+*********************************************************************************************************************************/
#ifdef RT_OS_WINDOWS
# include <winsock2.h>
#else
@@ -58,18 +58,18 @@
#include "internal/socket.h"
-/*******************************************************************************
-* Defined Constants And Macros *
-*******************************************************************************/
+/*********************************************************************************************************************************
+* Defined Constants And Macros *
+*********************************************************************************************************************************/
/* fixup backlevel OSes. */
#if defined(RT_OS_OS2) || defined(RT_OS_WINDOWS)
# define socklen_t int
#endif
-/*******************************************************************************
-* Structures and Typedefs *
-*******************************************************************************/
+/*********************************************************************************************************************************
+* Structures and Typedefs *
+*********************************************************************************************************************************/
/**
* UDP Server state.
*/
@@ -113,9 +113,9 @@ typedef struct RTUDPSERVER
} RTUDPSERVER;
-/*******************************************************************************
-* Internal Functions *
-*******************************************************************************/
+/*********************************************************************************************************************************
+* Internal Functions *
+*********************************************************************************************************************************/
static DECLCALLBACK(int) rtUdpServerThread(RTTHREAD ThreadSelf, void *pvServer);
static int rtUdpServerListen(PRTUDPSERVER pServer);
static int rtUdpServerListenCleanup(PRTUDPSERVER pServer);
diff --git a/src/VBox/Runtime/r3/win/RTCrStoreCreateSnapshotById-win.cpp b/src/VBox/Runtime/r3/win/RTCrStoreCreateSnapshotById-win.cpp
new file mode 100644
index 0000000..4a9e185
--- /dev/null
+++ b/src/VBox/Runtime/r3/win/RTCrStoreCreateSnapshotById-win.cpp
@@ -0,0 +1,169 @@
+/* $Id: RTCrStoreCreateSnapshotById-win.cpp $ */
+/** @file
+ * IPRT - RTCrStoreCreateSnapshotById, Windows.
+ */
+
+/*
+ * Copyright (C) 2006-2015 Oracle Corporation
+ *
+ * This file is part of VirtualBox Open Source Edition (OSE), as
+ * available from http://www.virtualbox.org. This file is free software;
+ * you can redistribute it and/or modify it under the terms of the GNU
+ * General Public License (GPL) as published by the Free Software
+ * Foundation, in version 2 as it comes in the "COPYING" file of the
+ * VirtualBox OSE distribution. VirtualBox OSE is distributed in the
+ * hope that it will be useful, but WITHOUT ANY WARRANTY of any kind.
+ *
+ * The contents of this file may alternatively be used under the terms
+ * of the Common Development and Distribution License Version 1.0
+ * (CDDL) only, as it comes in the "COPYING.CDDL" file of the
+ * VirtualBox OSE distribution, in which case the provisions of the
+ * CDDL are applicable instead of those of the GPL.
+ *
+ * You may elect to license modified versions of this file under the
+ * terms and conditions of either the GPL or the CDDL or both.
+ */
+
+
+/*********************************************************************************************************************************
+* Header Files *
+*********************************************************************************************************************************/
+#include <iprt/crypto/store.h>
+#include "internal/iprt.h"
+
+#include <iprt/assert.h>
+#include <iprt/err.h>
+#include <iprt/once.h>
+#include <iprt/ldr.h>
+
+#include <Windows.h>
+
+
+/*********************************************************************************************************************************
+* Structures and Typedefs *
+*********************************************************************************************************************************/
+typedef HCERTSTORE (WINAPI *PFNCERTOPENSTORE)(PCSTR pszStoreProvider, DWORD dwEncodingType, HCRYPTPROV_LEGACY hCryptProv,
+ DWORD dwFlags, const void *pvParam);
+typedef BOOL (WINAPI *PFNCERTCLOSESTORE)(HCERTSTORE hCertStore, DWORD dwFlags);
+typedef PCCERT_CONTEXT (WINAPI *PFNCERTENUMCERTIFICATESINSTORE)(HCERTSTORE hCertStore, PCCERT_CONTEXT pPrevCertContext);
+
+
+
+static int rtCrStoreAddCertsFromNative(RTCRSTORE hStore, DWORD fStore, PCRTUTF16 pwszStoreName,
+ PFNCERTOPENSTORE pfnOpenStore, PFNCERTCLOSESTORE pfnCloseStore,
+ PFNCERTENUMCERTIFICATESINSTORE pfnEnumCerts, int rc, PRTERRINFO pErrInfo)
+{
+ DWORD fOpenStore = CERT_STORE_OPEN_EXISTING_FLAG | CERT_STORE_READONLY_FLAG;
+ HCERTSTORE hNativeStore = pfnOpenStore(CERT_STORE_PROV_SYSTEM_W, PKCS_7_ASN_ENCODING | X509_ASN_ENCODING,
+ NULL /* hCryptProv = default */, fStore | fOpenStore, pwszStoreName);
+ if (hStore)
+ {
+ PCCERT_CONTEXT pCurCtx = NULL;
+ while ((pCurCtx = pfnEnumCerts(hNativeStore, pCurCtx)) != NULL)
+ {
+ if (pCurCtx->dwCertEncodingType & X509_ASN_ENCODING)
+ {
+ RTERRINFOSTATIC StaticErrInfo;
+ RTASN1CURSORPRIMARY PrimaryCursor;
+ RTAsn1CursorInitPrimary(&PrimaryCursor, pCurCtx->pbCertEncoded, pCurCtx->cbCertEncoded,
+ RTErrInfoInitStatic(&StaticErrInfo),
+ &g_RTAsn1DefaultAllocator, RTASN1CURSOR_FLAGS_DER, "CurCtx");
+ RTCRX509CERTIFICATE MyCert;
+ int rc2 = RTCrX509Certificate_DecodeAsn1(&PrimaryCursor.Cursor, 0, &MyCert, "Cert");
+ if (RT_SUCCESS(rc2))
+ {
+ rc2 = RTCrStoreCertAddEncoded(hStore, RTCRCERTCTX_F_ENC_X509_DER | RTCRCERTCTX_F_ADD_IF_NOT_FOUND,
+ pCurCtx->pbCertEncoded, pCurCtx->cbCertEncoded,
+ RTErrInfoInitStatic(&StaticErrInfo));
+ RTCrX509Certificate_Delete(&MyCert);
+ }
+ if (RT_FAILURE(rc2))
+ {
+ if (RTErrInfoIsSet(&StaticErrInfo.Core))
+ RTErrInfoAddF(pErrInfo, -rc2, " %s", StaticErrInfo.Core.pszMsg);
+ else
+ RTErrInfoAddF(pErrInfo, -rc2, " %Rrc adding cert", rc2);
+ rc = -rc2;
+ }
+ }
+ }
+ pfnCloseStore(hNativeStore, CERT_CLOSE_STORE_CHECK_FLAG);
+ }
+ else
+ {
+ DWORD uLastErr = GetLastError();
+ if (uLastErr != ERROR_FILE_NOT_FOUND)
+ rc = RTErrInfoAddF(pErrInfo, -RTErrConvertFromWin32(uLastErr),
+ " CertOpenStore(%#x,'%ls') failed: %u", fStore, pwszStoreName);
+ }
+ return rc;
+}
+
+
+
+RTDECL(int) RTCrStoreCreateSnapshotById(PRTCRSTORE phStore, RTCRSTOREID enmStoreId, PRTERRINFO pErrInfo)
+{
+ AssertReturn(enmStoreId > RTCRSTOREID_INVALID && enmStoreId < RTCRSTOREID_END, VERR_INVALID_PARAMETER);
+
+ /*
+ * Create an empty in-memory store.
+ */
+ RTCRSTORE hStore;
+ int rc = RTCrStoreCreateInMem(&hStore, 128);
+ if (RT_SUCCESS(rc))
+ {
+ *phStore = hStore;
+
+ /*
+ * Resolve the APIs we need to do this job.
+ */
+ RTLDRMOD hLdrMod;
+ int rc2 = RTLdrLoadSystem("crypt32.dll", false /*NoUnload*/, &hLdrMod);
+ if (RT_SUCCESS(rc2))
+ {
+ PFNCERTOPENSTORE pfnOpenStore = NULL;
+ rc2 = RTLdrGetSymbol(hLdrMod, "CertOpenStore", (void **)&pfnOpenStore);
+
+ PFNCERTCLOSESTORE pfnCloseStore = NULL;
+ if (RT_SUCCESS(rc2))
+ rc2 = RTLdrGetSymbol(hLdrMod, "CertCloseStore", (void **)&pfnCloseStore);
+
+ PFNCERTENUMCERTIFICATESINSTORE pfnEnumCerts = NULL;
+ if (RT_SUCCESS(rc2))
+ rc2 = RTLdrGetSymbol(hLdrMod, "CertEnumCertificatesInStore", (void **)&pfnEnumCerts);
+ if (RT_SUCCESS(rc2))
+ {
+ /*
+ * Do the work.
+ */
+ switch (enmStoreId)
+ {
+ case RTCRSTOREID_USER_TRUSTED_CAS_AND_CERTIFICATES:
+ case RTCRSTOREID_SYSTEM_TRUSTED_CAS_AND_CERTIFICATES:
+ {
+ DWORD fStore = enmStoreId == RTCRSTOREID_USER_TRUSTED_CAS_AND_CERTIFICATES
+ ? CERT_SYSTEM_STORE_CURRENT_USER : CERT_SYSTEM_STORE_LOCAL_MACHINE;
+ static PCRTUTF16 const s_apwszStores[] = { L"AuthRoot", L"CA", L"MY", L"Root" };
+ for (uint32_t i = 0; i < RT_ELEMENTS(s_apwszStores); i++)
+ rc = rtCrStoreAddCertsFromNative(hStore, fStore, s_apwszStores[i], pfnOpenStore, pfnCloseStore,
+ pfnEnumCerts, rc, pErrInfo);
+ break;
+ }
+
+ default:
+ AssertFailed(); /* implement me */
+ }
+ }
+ else
+ rc = RTErrInfoSetF(pErrInfo, -rc2, "Error resolving crypt32.dll APIs");
+ RTLdrClose(hLdrMod);
+ }
+ else
+ rc = RTErrInfoSetF(pErrInfo, -rc2, "Error loading crypt32.dll");
+ }
+ else
+ RTErrInfoSet(pErrInfo, rc, "RTCrStoreCreateInMem failed");
+ return rc;
+}
+RT_EXPORT_SYMBOL(RTCrStoreCreateSnapshotById);
+
diff --git a/src/VBox/Runtime/r3/win/RTHandleGetStandard-win.cpp b/src/VBox/Runtime/r3/win/RTHandleGetStandard-win.cpp
index 1dbdca2..8f9c1f6 100644
--- a/src/VBox/Runtime/r3/win/RTHandleGetStandard-win.cpp
+++ b/src/VBox/Runtime/r3/win/RTHandleGetStandard-win.cpp
@@ -25,9 +25,9 @@
*/
-/*******************************************************************************
-* Header Files *
-*******************************************************************************/
+/*********************************************************************************************************************************
+* Header Files *
+*********************************************************************************************************************************/
#include "internal/iprt.h"
#include <iprt/handle.h>
diff --git a/src/VBox/Runtime/r3/win/RTLogWriteDebugger-win.cpp b/src/VBox/Runtime/r3/win/RTLogWriteDebugger-win.cpp
index 6c4ab76..c611df9 100644
--- a/src/VBox/Runtime/r3/win/RTLogWriteDebugger-win.cpp
+++ b/src/VBox/Runtime/r3/win/RTLogWriteDebugger-win.cpp
@@ -25,9 +25,9 @@
*/
-/*******************************************************************************
-* Header Files *
-*******************************************************************************/
+/*********************************************************************************************************************************
+* Header Files *
+*********************************************************************************************************************************/
#include <Windows.h>
#include <iprt/log.h>
diff --git a/src/VBox/Runtime/r3/win/RTSystemQueryDmiString-win.cpp b/src/VBox/Runtime/r3/win/RTSystemQueryDmiString-win.cpp
index 9c940da..7fc3287 100644
--- a/src/VBox/Runtime/r3/win/RTSystemQueryDmiString-win.cpp
+++ b/src/VBox/Runtime/r3/win/RTSystemQueryDmiString-win.cpp
@@ -25,9 +25,9 @@
*/
-/*******************************************************************************
-* Header Files *
-*******************************************************************************/
+/*********************************************************************************************************************************
+* Header Files *
+*********************************************************************************************************************************/
#define _WIN32_DCOM
#include <Windows.h>
#include <WbemCli.h>
diff --git a/src/VBox/Runtime/r3/win/RTSystemQueryOSInfo-win.cpp b/src/VBox/Runtime/r3/win/RTSystemQueryOSInfo-win.cpp
index f9eee83..c7a9c1f 100644
--- a/src/VBox/Runtime/r3/win/RTSystemQueryOSInfo-win.cpp
+++ b/src/VBox/Runtime/r3/win/RTSystemQueryOSInfo-win.cpp
@@ -24,9 +24,10 @@
* terms and conditions of either the GPL or the CDDL or both.
*/
-/*******************************************************************************
-* Header Files *
-*******************************************************************************/
+
+/*********************************************************************************************************************************
+* Header Files *
+*********************************************************************************************************************************/
#include "internal/iprt.h"
#include <Windows.h>
#include <WinUser.h>
@@ -38,9 +39,9 @@
#include <iprt/ctype.h>
-/*******************************************************************************
-* Structures and Typedefs *
-*******************************************************************************/
+/*********************************************************************************************************************************
+* Structures and Typedefs *
+*********************************************************************************************************************************/
/**
* These are the PRODUCT_* defines found in the Vista Platform SDK and returned
diff --git a/src/VBox/Runtime/r3/win/RTSystemQueryTotalRam-win.cpp b/src/VBox/Runtime/r3/win/RTSystemQueryTotalRam-win.cpp
index 62c133e..3449d19 100644
--- a/src/VBox/Runtime/r3/win/RTSystemQueryTotalRam-win.cpp
+++ b/src/VBox/Runtime/r3/win/RTSystemQueryTotalRam-win.cpp
@@ -25,9 +25,9 @@
*/
-/*******************************************************************************
-* Header Files *
-*******************************************************************************/
+/*********************************************************************************************************************************
+* Header Files *
+*********************************************************************************************************************************/
#include <windows.h>
#include <iprt/system.h>
#include "internal/iprt.h"
diff --git a/src/VBox/Runtime/r3/win/RTSystemShutdown-win.cpp b/src/VBox/Runtime/r3/win/RTSystemShutdown-win.cpp
index ab35912..6ae8554 100644
--- a/src/VBox/Runtime/r3/win/RTSystemShutdown-win.cpp
+++ b/src/VBox/Runtime/r3/win/RTSystemShutdown-win.cpp
@@ -25,9 +25,9 @@
*/
-/*******************************************************************************
-* Header Files *
-*******************************************************************************/
+/*********************************************************************************************************************************
+* Header Files *
+*********************************************************************************************************************************/
#include <iprt/system.h>
#include "internal/iprt.h"
diff --git a/src/VBox/Runtime/r3/win/RTUuidCreate-win.cpp b/src/VBox/Runtime/r3/win/RTUuidCreate-win.cpp
index cd35966..9136b0b 100644
--- a/src/VBox/Runtime/r3/win/RTUuidCreate-win.cpp
+++ b/src/VBox/Runtime/r3/win/RTUuidCreate-win.cpp
@@ -25,9 +25,9 @@
*/
-/*******************************************************************************
-* Header Files *
-*******************************************************************************/
+/*********************************************************************************************************************************
+* Header Files *
+*********************************************************************************************************************************/
#define LOG_GROUP RTLOGGROUP_UUID
#include <Windows.h>
diff --git a/src/VBox/Runtime/r3/win/VBoxRT-openssl.def b/src/VBox/Runtime/r3/win/VBoxRT-openssl.def
index e4fb30b..bb6e2b3 100644
--- a/src/VBox/Runtime/r3/win/VBoxRT-openssl.def
+++ b/src/VBox/Runtime/r3/win/VBoxRT-openssl.def
@@ -1,4 +1,4 @@
-; $Id: VBoxRT-openssl.def $
+; $Id: VBoxRT-openssl.def 100874 2015-06-09 14:01:31Z bird $
;; @file
; IPRT - Windows OpenSSL exports.
;
diff --git a/src/VBox/Runtime/r3/win/alloc-win.cpp b/src/VBox/Runtime/r3/win/alloc-win.cpp
index bb2a28e..906834a 100644
--- a/src/VBox/Runtime/r3/win/alloc-win.cpp
+++ b/src/VBox/Runtime/r3/win/alloc-win.cpp
@@ -25,9 +25,9 @@
*/
-/*******************************************************************************
-* Header Files *
-*******************************************************************************/
+/*********************************************************************************************************************************
+* Header Files *
+*********************************************************************************************************************************/
/*#define USE_VIRTUAL_ALLOC*/
#define LOG_GROUP RTLOGGROUP_MEM
#include <Windows.h>
@@ -43,7 +43,7 @@
#endif
-RTDECL(void *) RTMemExecAllocTag(size_t cb, const char *pszTag) RT_NO_THROW
+RTDECL(void *) RTMemExecAllocTag(size_t cb, const char *pszTag) RT_NO_THROW_DEF
{
/*
* Allocate first.
@@ -70,14 +70,14 @@ RTDECL(void *) RTMemExecAllocTag(size_t cb, const char *pszTag) RT_NO_THROW
}
-RTDECL(void) RTMemExecFree(void *pv, size_t cb) RT_NO_THROW
+RTDECL(void) RTMemExecFree(void *pv, size_t cb) RT_NO_THROW_DEF
{
if (pv)
free(pv);
}
-RTDECL(void *) RTMemPageAllocTag(size_t cb, const char *pszTag) RT_NO_THROW
+RTDECL(void *) RTMemPageAllocTag(size_t cb, const char *pszTag) RT_NO_THROW_DEF
{
#ifdef USE_VIRTUAL_ALLOC
void *pv = VirtualAlloc(NULL, RT_ALIGN_Z(cb, PAGE_SIZE), MEM_COMMIT, PAGE_READWRITE);
@@ -89,7 +89,7 @@ RTDECL(void *) RTMemPageAllocTag(size_t cb, const char *pszTag) RT_NO_THROW
}
-RTDECL(void *) RTMemPageAllocZTag(size_t cb, const char *pszTag) RT_NO_THROW
+RTDECL(void *) RTMemPageAllocZTag(size_t cb, const char *pszTag) RT_NO_THROW_DEF
{
#ifdef USE_VIRTUAL_ALLOC
void *pv = VirtualAlloc(NULL, RT_ALIGN_Z(cb, PAGE_SIZE), MEM_COMMIT, PAGE_READWRITE);
@@ -106,7 +106,7 @@ RTDECL(void *) RTMemPageAllocZTag(size_t cb, const char *pszTag) RT_NO_THROW
}
-RTDECL(void) RTMemPageFree(void *pv, size_t cb) RT_NO_THROW
+RTDECL(void) RTMemPageFree(void *pv, size_t cb) RT_NO_THROW_DEF
{
if (pv)
{
@@ -120,7 +120,7 @@ RTDECL(void) RTMemPageFree(void *pv, size_t cb) RT_NO_THROW
}
-RTDECL(int) RTMemProtect(void *pv, size_t cb, unsigned fProtect) RT_NO_THROW
+RTDECL(int) RTMemProtect(void *pv, size_t cb, unsigned fProtect) RT_NO_THROW_DEF
{
/*
* Validate input.
diff --git a/src/VBox/Runtime/r3/win/allocex-win.cpp b/src/VBox/Runtime/r3/win/allocex-win.cpp
index a62c09f..108530e 100644
--- a/src/VBox/Runtime/r3/win/allocex-win.cpp
+++ b/src/VBox/Runtime/r3/win/allocex-win.cpp
@@ -25,9 +25,9 @@
*/
-/*******************************************************************************
-* Header Files *
-*******************************************************************************/
+/*********************************************************************************************************************************
+* Header Files *
+*********************************************************************************************************************************/
#define RTMEM_NO_WRAP_TO_EF_APIS
#include <iprt/mem.h>
#include "internal/iprt.h"
diff --git a/src/VBox/Runtime/r3/win/dir-win.cpp b/src/VBox/Runtime/r3/win/dir-win.cpp
index ffc6099..f51d162 100644
--- a/src/VBox/Runtime/r3/win/dir-win.cpp
+++ b/src/VBox/Runtime/r3/win/dir-win.cpp
@@ -25,9 +25,9 @@
*/
-/*******************************************************************************
-* Header Files *
-*******************************************************************************/
+/*********************************************************************************************************************************
+* Header Files *
+*********************************************************************************************************************************/
#define LOG_GROUP RTLOGGROUP_DIR
#include <Windows.h>
diff --git a/src/VBox/Runtime/r3/win/direnum-win.cpp b/src/VBox/Runtime/r3/win/direnum-win.cpp
index 0a97a48..b3943af 100644
--- a/src/VBox/Runtime/r3/win/direnum-win.cpp
+++ b/src/VBox/Runtime/r3/win/direnum-win.cpp
@@ -25,9 +25,9 @@
*/
-/*******************************************************************************
-* Header Files *
-*******************************************************************************/
+/*********************************************************************************************************************************
+* Header Files *
+*********************************************************************************************************************************/
#define LOG_GROUP RTLOGGROUP_DIR
#include <Windows.h>
diff --git a/src/VBox/Runtime/r3/win/dllmain-win.cpp b/src/VBox/Runtime/r3/win/dllmain-win.cpp
index 02ad46b..ad57121 100644
--- a/src/VBox/Runtime/r3/win/dllmain-win.cpp
+++ b/src/VBox/Runtime/r3/win/dllmain-win.cpp
@@ -25,9 +25,9 @@
*/
-/*******************************************************************************
-* Header Files *
-*******************************************************************************/
+/*********************************************************************************************************************************
+* Header Files *
+*********************************************************************************************************************************/
#include <Windows.h>
#include <iprt/thread.h>
#include <iprt/param.h>
diff --git a/src/VBox/Runtime/r3/win/env-win.cpp b/src/VBox/Runtime/r3/win/env-win.cpp
index fcf9ac9..eda445c 100644
--- a/src/VBox/Runtime/r3/win/env-win.cpp
+++ b/src/VBox/Runtime/r3/win/env-win.cpp
@@ -25,9 +25,9 @@
*/
-/*******************************************************************************
-* Header Files *
-*******************************************************************************/
+/*********************************************************************************************************************************
+* Header Files *
+*********************************************************************************************************************************/
#include <iprt/env.h>
#include <iprt/alloca.h>
diff --git a/src/VBox/Runtime/r3/win/errvars-win.cpp b/src/VBox/Runtime/r3/win/errvars-win.cpp
index aa63fb6..c61f524 100644
--- a/src/VBox/Runtime/r3/win/errvars-win.cpp
+++ b/src/VBox/Runtime/r3/win/errvars-win.cpp
@@ -25,9 +25,9 @@
*/
-/*******************************************************************************
-* Header Files *
-*******************************************************************************/
+/*********************************************************************************************************************************
+* Header Files *
+*********************************************************************************************************************************/
#include <Winsock2.h>
#include <errno.h>
diff --git a/src/VBox/Runtime/r3/win/fileaio-win.cpp b/src/VBox/Runtime/r3/win/fileaio-win.cpp
index 6a233e6..511b2aa 100644
--- a/src/VBox/Runtime/r3/win/fileaio-win.cpp
+++ b/src/VBox/Runtime/r3/win/fileaio-win.cpp
@@ -25,9 +25,9 @@
*/
-/*******************************************************************************
-* Header Files *
-*******************************************************************************/
+/*********************************************************************************************************************************
+* Header Files *
+*********************************************************************************************************************************/
#define LOG_GROUP RTLOGGROUP_DIR
#include <iprt/asm.h>
@@ -41,9 +41,10 @@
#include <Windows.h>
-/*******************************************************************************
-* Structures and Typedefs *
-*******************************************************************************/
+
+/*********************************************************************************************************************************
+* Structures and Typedefs *
+*********************************************************************************************************************************/
/**
* Transfer direction.
@@ -113,9 +114,10 @@ typedef struct RTFILEAIOREQINTERNAL
/** Pointer to an internal request structure. */
typedef RTFILEAIOREQINTERNAL *PRTFILEAIOREQINTERNAL;
-/*******************************************************************************
-* Defined Constants And Macros *
-*******************************************************************************/
+
+/*********************************************************************************************************************************
+* Defined Constants And Macros *
+*********************************************************************************************************************************/
/** Id for the wakeup event. */
#define AIO_CONTEXT_WAKEUP_EVENT 1
/** Converts a pointer to an OVERLAPPED structure to a internal request. */
diff --git a/src/VBox/Runtime/r3/win/fileio-win.cpp b/src/VBox/Runtime/r3/win/fileio-win.cpp
index 133bca1..2f41236 100644
--- a/src/VBox/Runtime/r3/win/fileio-win.cpp
+++ b/src/VBox/Runtime/r3/win/fileio-win.cpp
@@ -25,9 +25,9 @@
*/
-/*******************************************************************************
-* Header Files *
-*******************************************************************************/
+/*********************************************************************************************************************************
+* Header Files *
+*********************************************************************************************************************************/
#define LOG_GROUP RTLOGGROUP_DIR
#ifndef _WIN32_WINNT
# define _WIN32_WINNT 0x0500
@@ -35,20 +35,24 @@
#include <Windows.h>
#include <iprt/file.h>
-#include <iprt/path.h>
+
+#include <iprt/asm.h>
#include <iprt/assert.h>
+#include <iprt/path.h>
#include <iprt/string.h>
#include <iprt/err.h>
+#include <iprt/ldr.h>
#include <iprt/log.h>
#include "internal/file.h"
#include "internal/fs.h"
#include "internal/path.h"
-/*******************************************************************************
-* Defined Constants And Macros *
-*******************************************************************************/
-
+/*********************************************************************************************************************************
+* Defined Constants And Macros *
+*********************************************************************************************************************************/
+typedef BOOL WINAPI FNVERIFYCONSOLEIOHANDLE(HANDLE);
+typedef FNVERIFYCONSOLEIOHANDLE *PFNVERIFYCONSOLEIOHANDLE; /* No, nobody fell on the keyboard, really! */
/**
* This is wrapper around the ugly SetFilePointer api.
@@ -823,14 +827,45 @@ RTR3DECL(int) RTFileQueryInfo(RTFILE hFile, PRTFSOBJINFO pObjInfo, RTFSOBJATTRAD
/*
* Query file info.
*/
+ HANDLE hHandle = (HANDLE)RTFileToNative(hFile);
+
BY_HANDLE_FILE_INFORMATION Data;
- if (!GetFileInformationByHandle((HANDLE)RTFileToNative(hFile), &Data))
+ if (!GetFileInformationByHandle(hHandle, &Data))
{
+ /*
+ * Console I/O handles make trouble here. On older windows versions they
+ * end up with ERROR_INVALID_HANDLE when handed to the above API, while on
+ * more recent ones they cause different errors to appear.
+ *
+ * Thus, we must ignore the latter and doubly verify invalid handle claims.
+ * We use the undocumented VerifyConsoleIoHandle to do this, falling back on
+ * GetFileType should it not be there.
+ */
DWORD dwErr = GetLastError();
- /* Only return if we *really* don't have a valid handle value,
- * everything else is fine here ... */
if (dwErr == ERROR_INVALID_HANDLE)
+ {
+ static PFNVERIFYCONSOLEIOHANDLE s_pfnVerifyConsoleIoHandle = NULL;
+ static bool volatile s_fInitialized = false;
+ PFNVERIFYCONSOLEIOHANDLE pfnVerifyConsoleIoHandle;
+ if (s_fInitialized)
+ pfnVerifyConsoleIoHandle = s_pfnVerifyConsoleIoHandle;
+ else
+ {
+ pfnVerifyConsoleIoHandle = (PFNVERIFYCONSOLEIOHANDLE)RTLdrGetSystemSymbol("kernel32.dll", "VerifyConsoleIoHandle");
+ ASMAtomicWriteBool(&s_fInitialized, true);
+ }
+ if ( pfnVerifyConsoleIoHandle
+ ? !pfnVerifyConsoleIoHandle(hHandle)
+ : GetFileType(hHandle) == FILE_TYPE_UNKNOWN && GetLastError() != NO_ERROR)
+ return VERR_INVALID_HANDLE;
+ }
+ /*
+ * On Windows 10 and (hopefully) 8.1 we get ERROR_INVALID_FUNCTION with console I/O
+ * handles. We must ignore these just like the above invalid handle error.
+ */
+ else if (dwErr != ERROR_INVALID_FUNCTION)
return RTErrConvertFromWin32(dwErr);
+
RT_ZERO(Data);
Data.dwFileAttributes = RTFS_DOS_NT_DEVICE;
}
diff --git a/src/VBox/Runtime/r3/win/fs-win.cpp b/src/VBox/Runtime/r3/win/fs-win.cpp
index 1bfccee..ec53f55 100644
--- a/src/VBox/Runtime/r3/win/fs-win.cpp
+++ b/src/VBox/Runtime/r3/win/fs-win.cpp
@@ -25,9 +25,9 @@
*/
-/*******************************************************************************
-* Header Files *
-*******************************************************************************/
+/*********************************************************************************************************************************
+* Header Files *
+*********************************************************************************************************************************/
#define LOG_GROUP RTLOGGROUP_FS
#include <windows.h>
@@ -337,6 +337,12 @@ RTR3DECL(int) RTFsQueryProperties(const char *pszFsPath, PRTFSPROPERTIES pProper
}
+RTR3DECL(bool) RTFsIsCaseSensitive(const char *pszFsPath)
+{
+ return false;
+}
+
+
/**
* Internal helper for comparing a WCHAR string with a char string.
*
diff --git a/src/VBox/Runtime/r3/win/init-win.cpp b/src/VBox/Runtime/r3/win/init-win.cpp
index f9a0cf5..24f2079 100644
--- a/src/VBox/Runtime/r3/win/init-win.cpp
+++ b/src/VBox/Runtime/r3/win/init-win.cpp
@@ -25,9 +25,9 @@
*/
-/*******************************************************************************
-* Header Files *
-*******************************************************************************/
+/*********************************************************************************************************************************
+* Header Files *
+*********************************************************************************************************************************/
#define LOG_GROUP RTLOGGROUP_DEFAULT
#include <Windows.h>
#ifndef LOAD_LIBRARY_SEARCH_APPLICATION_DIR
@@ -43,9 +43,9 @@
#include "../init.h"
-/*******************************************************************************
-* Global Variables *
-*******************************************************************************/
+/*********************************************************************************************************************************
+* Global Variables *
+*********************************************************************************************************************************/
/** Windows DLL loader protection level. */
DECLHIDDEN(RTR3WINLDRPROT) g_enmWinLdrProt = RTR3WINLDRPROT_NONE;
/** Our simplified windows version. */
diff --git a/src/VBox/Runtime/r3/win/ldrNative-win.cpp b/src/VBox/Runtime/r3/win/ldrNative-win.cpp
index e76ef7e..a415092 100644
--- a/src/VBox/Runtime/r3/win/ldrNative-win.cpp
+++ b/src/VBox/Runtime/r3/win/ldrNative-win.cpp
@@ -24,9 +24,10 @@
* terms and conditions of either the GPL or the CDDL or both.
*/
-/*******************************************************************************
-* Header Files *
-*******************************************************************************/
+
+/*********************************************************************************************************************************
+* Header Files *
+*********************************************************************************************************************************/
#define LOG_GROUP RTLOGGROUP_LDR
#include <Windows.h>
diff --git a/src/VBox/Runtime/r3/win/localipc-win.cpp b/src/VBox/Runtime/r3/win/localipc-win.cpp
index 19f8bcd..193c86e 100644
--- a/src/VBox/Runtime/r3/win/localipc-win.cpp
+++ b/src/VBox/Runtime/r3/win/localipc-win.cpp
@@ -24,9 +24,10 @@
* terms and conditions of either the GPL or the CDDL or both.
*/
-/*******************************************************************************
-* Header Files *
-*******************************************************************************/
+
+/*********************************************************************************************************************************
+* Header Files *
+*********************************************************************************************************************************/
/*
* We have to force NT 5.0 here because of
* ConvertStringSecurityDescriptorToSecurityDescriptor. Note that because of
@@ -56,9 +57,9 @@
#include "internal/magics.h"
-/*******************************************************************************
-* Defined Constants And Macros *
-*******************************************************************************/
+/*********************************************************************************************************************************
+* Defined Constants And Macros *
+*********************************************************************************************************************************/
/** Pipe prefix string. */
#define RTLOCALIPC_WIN_PREFIX "\\\\.\\pipe\\IPRT-"
@@ -112,9 +113,9 @@
// SDDL_ACE_BEGIN SDDL_ACCESS_ALLOWED ";;" SDDL_FILE_ALL ";;;" SDDL_LOCAL_SYSTEM SDDL_ACE_END
-/*******************************************************************************
-* Structures and Typedefs *
-*******************************************************************************/
+/*********************************************************************************************************************************
+* Structures and Typedefs *
+*********************************************************************************************************************************/
/**
* Local IPC service instance, Windows.
*/
@@ -186,9 +187,9 @@ typedef FNCONVERTSTRINGSECURITYDESCRIPTORTOSECURITYDESCRIPTOR
*PFNCONVERTSTRINGSECURITYDESCRIPTORTOSECURITYDESCRIPTOR; /* No, nobody fell on the keyboard, really! */
-/*******************************************************************************
-* Internal Functions *
-*******************************************************************************/
+/*********************************************************************************************************************************
+* Internal Functions *
+*********************************************************************************************************************************/
static int rtLocalIpcWinCreateSession(PRTLOCALIPCSESSION phClientSession, HANDLE hNmPipeSession);
diff --git a/src/VBox/Runtime/r3/win/mp-win.cpp b/src/VBox/Runtime/r3/win/mp-win.cpp
index 91d1de2..70d5205 100644
--- a/src/VBox/Runtime/r3/win/mp-win.cpp
+++ b/src/VBox/Runtime/r3/win/mp-win.cpp
@@ -25,9 +25,9 @@
*/
-/*******************************************************************************
-* Header Files *
-*******************************************************************************/
+/*********************************************************************************************************************************
+* Header Files *
+*********************************************************************************************************************************/
#define LOG_GROUP RTLOGGROUP_SYSTEM
#include <Windows.h>
diff --git a/src/VBox/Runtime/r3/win/path-win.cpp b/src/VBox/Runtime/r3/win/path-win.cpp
index b4b1e18..9e85c5a 100644
--- a/src/VBox/Runtime/r3/win/path-win.cpp
+++ b/src/VBox/Runtime/r3/win/path-win.cpp
@@ -25,9 +25,9 @@
*/
-/*******************************************************************************
-* Header Files *
-*******************************************************************************/
+/*********************************************************************************************************************************
+* Header Files *
+*********************************************************************************************************************************/
#define LOG_GROUP RTLOGGROUP_PATH
#include <Windows.h>
#include <Shlobj.h>
diff --git a/src/VBox/Runtime/r3/win/pipe-win.cpp b/src/VBox/Runtime/r3/win/pipe-win.cpp
index b1be306..e36a7c2 100644
--- a/src/VBox/Runtime/r3/win/pipe-win.cpp
+++ b/src/VBox/Runtime/r3/win/pipe-win.cpp
@@ -25,9 +25,9 @@
*/
-/*******************************************************************************
-* Header Files *
-*******************************************************************************/
+/*********************************************************************************************************************************
+* Header Files *
+*********************************************************************************************************************************/
#include <Windows.h>
#include <iprt/pipe.h>
@@ -47,16 +47,16 @@
#include "internal/magics.h"
-/*******************************************************************************
-* Defined Constants And Macros *
-*******************************************************************************/
+/*********************************************************************************************************************************
+* Defined Constants And Macros *
+*********************************************************************************************************************************/
/** The pipe buffer size we prefer. */
#define RTPIPE_NT_SIZE _64K
-/*******************************************************************************
-* Structures and Typedefs *
-*******************************************************************************/
+/*********************************************************************************************************************************
+* Structures and Typedefs *
+*********************************************************************************************************************************/
typedef struct RTPIPEINTERNAL
{
/** Magic value (RTPIPE_MAGIC). */
@@ -517,10 +517,11 @@ RTDECL(int) RTPipeFromNative(PRTPIPE phPipe, RTHCINTPTR hNativePipe, uint32_t f
|| Info.NamedPipeState == FILE_PIPE_CLOSING_STATE
|| Info.NamedPipeState == FILE_PIPE_DISCONNECTED_STATE,
VERR_INVALID_HANDLE);
- AssertStmt( Info.NamedPipeConfiguration
- == ( Info.NamedPipeEnd == FILE_PIPE_SERVER_END
- ? (pThis->fRead ? FILE_PIPE_INBOUND : FILE_PIPE_OUTBOUND)
- : (pThis->fRead ? FILE_PIPE_OUTBOUND : FILE_PIPE_INBOUND) ),
+ AssertStmt( Info.NamedPipeConfiguration
+ == ( Info.NamedPipeEnd == FILE_PIPE_SERVER_END
+ ? (pThis->fRead ? FILE_PIPE_INBOUND : FILE_PIPE_OUTBOUND)
+ : (pThis->fRead ? FILE_PIPE_OUTBOUND : FILE_PIPE_INBOUND) )
+ || Info.NamedPipeConfiguration == FILE_PIPE_FULL_DUPLEX,
VERR_INVALID_HANDLE);
if ( RT_SUCCESS(rc)
&& hNative2 == INVALID_HANDLE_VALUE
diff --git a/src/VBox/Runtime/r3/win/process-win.cpp b/src/VBox/Runtime/r3/win/process-win.cpp
index 353e941..c6dea93 100644
--- a/src/VBox/Runtime/r3/win/process-win.cpp
+++ b/src/VBox/Runtime/r3/win/process-win.cpp
@@ -25,9 +25,9 @@
*/
-/*******************************************************************************
-* Header Files *
-*******************************************************************************/
+/*********************************************************************************************************************************
+* Header Files *
+*********************************************************************************************************************************/
#define LOG_GROUP RTLOGGROUP_PROCESS
#include <iprt/asm.h> /* hack */
@@ -60,9 +60,9 @@
-/*******************************************************************************
-* Structures and Typedefs *
-*******************************************************************************/
+/*********************************************************************************************************************************
+* Structures and Typedefs *
+*********************************************************************************************************************************/
typedef WINADVAPI BOOL WINAPI FNCREATEPROCESSWITHLOGON(LPCWSTR,
LPCWSTR,
LPCWSTR,
@@ -107,9 +107,9 @@ typedef BOOL WINAPI FNUNLOADUSERPROFILE(HANDLE, HANDLE);
typedef FNUNLOADUSERPROFILE *PFNUNLOADUSERPROFILE;
-/*******************************************************************************
-* Global Variables *
-*******************************************************************************/
+/*********************************************************************************************************************************
+* Global Variables *
+*********************************************************************************************************************************/
/** Init once structure. */
static RTONCE g_rtProcWinInitOnce = RTONCE_INITIALIZER;
/** Critical section protecting the process array. */
diff --git a/src/VBox/Runtime/r3/win/rtFileNativeSetAttributes-win.cpp b/src/VBox/Runtime/r3/win/rtFileNativeSetAttributes-win.cpp
index 8646d28..0b05e86 100644
--- a/src/VBox/Runtime/r3/win/rtFileNativeSetAttributes-win.cpp
+++ b/src/VBox/Runtime/r3/win/rtFileNativeSetAttributes-win.cpp
@@ -24,9 +24,10 @@
* terms and conditions of either the GPL or the CDDL or both.
*/
-/*******************************************************************************
-* Header Files *
-*******************************************************************************/
+
+/*********************************************************************************************************************************
+* Header Files *
+*********************************************************************************************************************************/
/* APIs used here require DDK headers. */
#include <wdm.h>
diff --git a/src/VBox/Runtime/r3/win/rtProcInitExePath-win.cpp b/src/VBox/Runtime/r3/win/rtProcInitExePath-win.cpp
index 6e0d4d5..4248add 100644
--- a/src/VBox/Runtime/r3/win/rtProcInitExePath-win.cpp
+++ b/src/VBox/Runtime/r3/win/rtProcInitExePath-win.cpp
@@ -24,9 +24,10 @@
* terms and conditions of either the GPL or the CDDL or both.
*/
-/*******************************************************************************
-* Header Files *
-*******************************************************************************/
+
+/*********************************************************************************************************************************
+* Header Files *
+*********************************************************************************************************************************/
#define LOG_GROUP RTLOGGROUP_PROCESS
#include <Windows.h>
diff --git a/src/VBox/Runtime/r3/win/sched-win.cpp b/src/VBox/Runtime/r3/win/sched-win.cpp
index 0df9886..2bdb053 100644
--- a/src/VBox/Runtime/r3/win/sched-win.cpp
+++ b/src/VBox/Runtime/r3/win/sched-win.cpp
@@ -29,9 +29,9 @@
#define WIN32_SCHED_ENABLED
-/*******************************************************************************
-* Header Files *
-*******************************************************************************/
+/*********************************************************************************************************************************
+* Header Files *
+*********************************************************************************************************************************/
#define LOG_GROUP RTLOGGROUP_THREAD
#include <Windows.h>
@@ -43,9 +43,9 @@
#include "internal/thread.h"
-/*******************************************************************************
-* Structures and Typedefs *
-*******************************************************************************/
+/*********************************************************************************************************************************
+* Structures and Typedefs *
+*********************************************************************************************************************************/
/**
* Configuration of one priority.
*/
@@ -72,9 +72,9 @@ typedef struct
#define ANY_PROCESS_PRIORITY_CLASS (~0U)
-/*******************************************************************************
-* Global Variables *
-*******************************************************************************/
+/*********************************************************************************************************************************
+* Global Variables *
+*********************************************************************************************************************************/
/**
* Array of static priority configurations.
*/
diff --git a/src/VBox/Runtime/r3/win/semevent-win.cpp b/src/VBox/Runtime/r3/win/semevent-win.cpp
index 4dba0e3..ac426dd 100644
--- a/src/VBox/Runtime/r3/win/semevent-win.cpp
+++ b/src/VBox/Runtime/r3/win/semevent-win.cpp
@@ -25,9 +25,9 @@
*/
-/*******************************************************************************
-* Header Files *
-*******************************************************************************/
+/*********************************************************************************************************************************
+* Header Files *
+*********************************************************************************************************************************/
#define LOG_GROUP RTLOGGROUP_SEMAPHORE
#include <Windows.h>
@@ -45,9 +45,9 @@
#include "internal/strict.h"
-/*******************************************************************************
-* Defined Constants And Macros *
-*******************************************************************************/
+/*********************************************************************************************************************************
+* Defined Constants And Macros *
+*********************************************************************************************************************************/
struct RTSEMEVENTINTERNAL
{
/** Magic value (RTSEMEVENT_MAGIC). */
diff --git a/src/VBox/Runtime/r3/win/semeventmulti-win.cpp b/src/VBox/Runtime/r3/win/semeventmulti-win.cpp
index d6f6ef9..0ecdd34 100644
--- a/src/VBox/Runtime/r3/win/semeventmulti-win.cpp
+++ b/src/VBox/Runtime/r3/win/semeventmulti-win.cpp
@@ -28,9 +28,9 @@
*/
-/*******************************************************************************
-* Header Files *
-*******************************************************************************/
+/*********************************************************************************************************************************
+* Header Files *
+*********************************************************************************************************************************/
#define LOG_GROUP RTLOGGROUP_SEMAPHORE
#include <Windows.h>
@@ -48,9 +48,9 @@
#include "internal/strict.h"
-/*******************************************************************************
-* Defined Constants And Macros *
-*******************************************************************************/
+/*********************************************************************************************************************************
+* Defined Constants And Macros *
+*********************************************************************************************************************************/
struct RTSEMEVENTMULTIINTERNAL
{
/** Magic value (RTSEMEVENTMULTI_MAGIC). */
diff --git a/src/VBox/Runtime/r3/win/semmutex-win.cpp b/src/VBox/Runtime/r3/win/semmutex-win.cpp
index 169f27e..44c58bd 100644
--- a/src/VBox/Runtime/r3/win/semmutex-win.cpp
+++ b/src/VBox/Runtime/r3/win/semmutex-win.cpp
@@ -25,9 +25,9 @@
*/
-/*******************************************************************************
-* Header Files *
-*******************************************************************************/
+/*********************************************************************************************************************************
+* Header Files *
+*********************************************************************************************************************************/
#define LOG_GROUP RTLOGGROUP_SEMAPHORE
#include <Windows.h>
@@ -44,9 +44,9 @@
#include "internal/strict.h"
-/*******************************************************************************
-* Defined Constants And Macros *
-*******************************************************************************/
+/*********************************************************************************************************************************
+* Defined Constants And Macros *
+*********************************************************************************************************************************/
/** Posix internal representation of a Mutex semaphore. */
struct RTSEMMUTEXINTERNAL
{
diff --git a/src/VBox/Runtime/r3/win/symlink-win.cpp b/src/VBox/Runtime/r3/win/symlink-win.cpp
index e6ee839..68f20b0 100644
--- a/src/VBox/Runtime/r3/win/symlink-win.cpp
+++ b/src/VBox/Runtime/r3/win/symlink-win.cpp
@@ -25,9 +25,9 @@
*/
-/*******************************************************************************
-* Header Files *
-*******************************************************************************/
+/*********************************************************************************************************************************
+* Header Files *
+*********************************************************************************************************************************/
#define LOG_GROUP RTLOGGROUP_SYMLINK
#include <Windows.h>
@@ -44,9 +44,9 @@
-/*******************************************************************************
-* Structures and Typedefs *
-*******************************************************************************/
+/*********************************************************************************************************************************
+* Structures and Typedefs *
+*********************************************************************************************************************************/
typedef struct MY_REPARSE_DATA_BUFFER
{
ULONG ReparseTag;
diff --git a/src/VBox/Runtime/r3/win/thread-win.cpp b/src/VBox/Runtime/r3/win/thread-win.cpp
index 4256b78..8644bc3 100644
--- a/src/VBox/Runtime/r3/win/thread-win.cpp
+++ b/src/VBox/Runtime/r3/win/thread-win.cpp
@@ -25,9 +25,9 @@
*/
-/*******************************************************************************
-* Header Files *
-*******************************************************************************/
+/*********************************************************************************************************************************
+* Header Files *
+*********************************************************************************************************************************/
#define LOG_GROUP RTLOGGROUP_THREAD
#include <Windows.h>
@@ -46,16 +46,16 @@
#include "internal/thread.h"
-/*******************************************************************************
-* Defined Constants And Macros *
-*******************************************************************************/
+/*********************************************************************************************************************************
+* Defined Constants And Macros *
+*********************************************************************************************************************************/
/** The TLS index allocated for storing the RTTHREADINT pointer. */
static DWORD g_dwSelfTLS = TLS_OUT_OF_INDEXES;
-/*******************************************************************************
-* Internal Functions *
-*******************************************************************************/
+/*********************************************************************************************************************************
+* Internal Functions *
+*********************************************************************************************************************************/
static unsigned __stdcall rtThreadNativeMain(void *pvArgs);
static void rtThreadWinTellDebuggerThreadName(uint32_t idThread, const char *pszName);
diff --git a/src/VBox/Runtime/r3/win/thread2-win.cpp b/src/VBox/Runtime/r3/win/thread2-win.cpp
index d80fd21..657d719 100644
--- a/src/VBox/Runtime/r3/win/thread2-win.cpp
+++ b/src/VBox/Runtime/r3/win/thread2-win.cpp
@@ -25,9 +25,9 @@
*/
-/*******************************************************************************
-* Header Files *
-*******************************************************************************/
+/*********************************************************************************************************************************
+* Header Files *
+*********************************************************************************************************************************/
#define LOG_GROUP RTLOGGROUP_THREAD
#include <Windows.h>
diff --git a/src/VBox/Runtime/r3/win/time-win.cpp b/src/VBox/Runtime/r3/win/time-win.cpp
index 2ed062a..5498034 100644
--- a/src/VBox/Runtime/r3/win/time-win.cpp
+++ b/src/VBox/Runtime/r3/win/time-win.cpp
@@ -25,9 +25,9 @@
*/
-/*******************************************************************************
-* Header Files *
-*******************************************************************************/
+/*********************************************************************************************************************************
+* Header Files *
+*********************************************************************************************************************************/
#define LOG_GROUP RTLOGGROUP_TIME
#include <Windows.h>
diff --git a/src/VBox/Runtime/r3/win/time2-win.cpp b/src/VBox/Runtime/r3/win/time2-win.cpp
index 178bf77..6030c1d 100644
--- a/src/VBox/Runtime/r3/win/time2-win.cpp
+++ b/src/VBox/Runtime/r3/win/time2-win.cpp
@@ -25,9 +25,9 @@
*/
-/*******************************************************************************
-* Header Files *
-*******************************************************************************/
+/*********************************************************************************************************************************
+* Header Files *
+*********************************************************************************************************************************/
#define LOG_GROUP RTLOGGROUP_TIME
#include <Windows.h>
diff --git a/src/VBox/Runtime/r3/win/timer-win.cpp b/src/VBox/Runtime/r3/win/timer-win.cpp
index fb0c2f3..dc08ce3 100644
--- a/src/VBox/Runtime/r3/win/timer-win.cpp
+++ b/src/VBox/Runtime/r3/win/timer-win.cpp
@@ -50,9 +50,9 @@
#undef USE_CATCH_UP
-/*******************************************************************************
-* Header Files *
-*******************************************************************************/
+/*********************************************************************************************************************************
+* Header Files *
+*********************************************************************************************************************************/
#define LOG_GROUP RTLOGGROUP_TIMER
#define _WIN32_WINNT 0x0500
#include <Windows.h>
@@ -77,9 +77,9 @@ NTSYSAPI LONG NTAPI NtQueryTimerResolution(OUT PULONG MaximumResolution, OUT PUL
RT_C_DECLS_END
-/*******************************************************************************
-* Structures and Typedefs *
-*******************************************************************************/
+/*********************************************************************************************************************************
+* Structures and Typedefs *
+*********************************************************************************************************************************/
/**
* The internal representation of a timer handle.
*/
diff --git a/src/VBox/Runtime/r3/win/tls-win.cpp b/src/VBox/Runtime/r3/win/tls-win.cpp
index 5b11ffb..6d1790b 100644
--- a/src/VBox/Runtime/r3/win/tls-win.cpp
+++ b/src/VBox/Runtime/r3/win/tls-win.cpp
@@ -25,9 +25,9 @@
*/
-/*******************************************************************************
-* Header Files *
-*******************************************************************************/
+/*********************************************************************************************************************************
+* Header Files *
+*********************************************************************************************************************************/
#define LOG_GROUP RTLOGGROUP_THREAD
#include <Windows.h>
diff --git a/src/VBox/Runtime/r3/win/utf16locale-win.cpp b/src/VBox/Runtime/r3/win/utf16locale-win.cpp
index dbd24b8..5208d59 100644
--- a/src/VBox/Runtime/r3/win/utf16locale-win.cpp
+++ b/src/VBox/Runtime/r3/win/utf16locale-win.cpp
@@ -25,9 +25,9 @@
*/
-/*******************************************************************************
-* Header Files *
-*******************************************************************************/
+/*********************************************************************************************************************************
+* Header Files *
+*********************************************************************************************************************************/
#define LOG_GROUP RTLOGGROUP_UTF16
#include <Windows.h>
diff --git a/src/VBox/Runtime/r3/win/utf8-win.cpp b/src/VBox/Runtime/r3/win/utf8-win.cpp
index 0db68bb..01c378d 100644
--- a/src/VBox/Runtime/r3/win/utf8-win.cpp
+++ b/src/VBox/Runtime/r3/win/utf8-win.cpp
@@ -25,9 +25,9 @@
*/
-/*******************************************************************************
-* Header Files *
-*******************************************************************************/
+/*********************************************************************************************************************************
+* Header Files *
+*********************************************************************************************************************************/
#define LOG_GROUP RTLOGGROUP_UTF8
#include <Windows.h>
diff --git a/src/VBox/Runtime/r3/win/uuid-win.cpp b/src/VBox/Runtime/r3/win/uuid-win.cpp
index dbb15b2..15e51b0 100644
--- a/src/VBox/Runtime/r3/win/uuid-win.cpp
+++ b/src/VBox/Runtime/r3/win/uuid-win.cpp
@@ -25,9 +25,9 @@
*/
-/*******************************************************************************
-* Header Files *
-*******************************************************************************/
+/*********************************************************************************************************************************
+* Header Files *
+*********************************************************************************************************************************/
#define LOG_GROUP RTLOGGROUP_UUID
#include <Windows.h>
diff --git a/src/VBox/Runtime/r3/win/vcc100-kernel32-fakes.cpp b/src/VBox/Runtime/r3/win/vcc100-kernel32-fakes.cpp
index cc77bf9..947f7e4 100644
--- a/src/VBox/Runtime/r3/win/vcc100-kernel32-fakes.cpp
+++ b/src/VBox/Runtime/r3/win/vcc100-kernel32-fakes.cpp
@@ -25,9 +25,9 @@
*/
-/*******************************************************************************
-* Header Files *
-*******************************************************************************/
+/*********************************************************************************************************************************
+* Header Files *
+*********************************************************************************************************************************/
#include <iprt/cdefs.h>
#ifndef RT_ARCH_X86
diff --git a/src/VBox/Runtime/r3/xml.cpp b/src/VBox/Runtime/r3/xml.cpp
index b935455..d554d44 100644
--- a/src/VBox/Runtime/r3/xml.cpp
+++ b/src/VBox/Runtime/r3/xml.cpp
@@ -25,9 +25,9 @@
*/
-/*******************************************************************************
-* Header Files *
-*******************************************************************************/
+/*********************************************************************************************************************************
+* Header Files *
+*********************************************************************************************************************************/
#include <iprt/dir.h>
#include <iprt/file.h>
#include <iprt/err.h>
@@ -48,9 +48,9 @@
#include <map>
-/*******************************************************************************
-* Global Variables *
-*******************************************************************************/
+/*********************************************************************************************************************************
+* Global Variables *
+*********************************************************************************************************************************/
/**
* Global module initialization structure. This is to wrap non-reentrant bits
* of libxml, among other things.
diff --git a/src/VBox/Runtime/testcase/Makefile.kmk b/src/VBox/Runtime/testcase/Makefile.kmk
index 3ee37d2..ae4182d 100644
--- a/src/VBox/Runtime/testcase/Makefile.kmk
+++ b/src/VBox/Runtime/testcase/Makefile.kmk
@@ -84,7 +84,6 @@ PROGRAMS += \
tstRTList \
tstRTLockValidator \
tstLog \
- tstMemAutoPtr \
tstRTMemEf \
tstRTMemCache \
tstRTMemPool \
@@ -96,6 +95,7 @@ PROGRAMS += \
tstRTNetIPv6 \
tstOnce \
tstRTPath \
+ tstRTPathGlob \
tstRTPipe \
tstRTPoll \
tstRTPrfIO \
@@ -444,9 +444,6 @@ tstRTLockValidator_SOURCES = tstRTLockValidator.cpp
tstLog_TEMPLATE = VBOXR3TSTEXE
tstLog_SOURCES = tstLog.cpp
-tstMemAutoPtr_TEMPLATE = VBOXR3TSTEXE
-tstMemAutoPtr_SOURCES = tstMemAutoPtr.cpp
-
tstRTMemEf_TEMPLATE = VBOXR3TSTEXE
tstRTMemEf_SOURCES = tstRTMemEf.cpp
@@ -495,6 +492,9 @@ tstOnce_SOURCES = tstOnce.cpp
tstRTPath_TEMPLATE = VBOXR3TSTEXE
tstRTPath_SOURCES = tstRTPath.cpp
+tstRTPathGlob_TEMPLATE = VBOXR3TSTEXE
+tstRTPathGlob_SOURCES = tstRTPathGlob.cpp
+
tstRTPipe_TEMPLATE = VBOXR3TSTEXE
tstRTPipe_SOURCES = tstRTPipe.cpp
diff --git a/src/VBox/Runtime/testcase/ntGetTimerResolution.cpp b/src/VBox/Runtime/testcase/ntGetTimerResolution.cpp
index 9ee0d65..fa81e12 100644
--- a/src/VBox/Runtime/testcase/ntGetTimerResolution.cpp
+++ b/src/VBox/Runtime/testcase/ntGetTimerResolution.cpp
@@ -25,9 +25,9 @@
*/
-/*******************************************************************************
-* Header Files *
-*******************************************************************************/
+/*********************************************************************************************************************************
+* Header Files *
+*********************************************************************************************************************************/
#define _WIN32_WINNT 0x0500
#include <Windows.h>
#include <stdio.h>
diff --git a/src/VBox/Runtime/testcase/tstDarwinSched.cpp b/src/VBox/Runtime/testcase/tstDarwinSched.cpp
index 523a6f6..57955ce 100644
--- a/src/VBox/Runtime/testcase/tstDarwinSched.cpp
+++ b/src/VBox/Runtime/testcase/tstDarwinSched.cpp
@@ -25,9 +25,9 @@
*/
-/*******************************************************************************
-* Header Files *
-*******************************************************************************/
+/*********************************************************************************************************************************
+* Header Files *
+*********************************************************************************************************************************/
#include <mach/thread_act.h>
#include <mach/thread_policy.h>
#include <mach/thread_info.h>
diff --git a/src/VBox/Runtime/testcase/tstEnv.cpp b/src/VBox/Runtime/testcase/tstEnv.cpp
index ab66ca2..6eb6fbc 100644
--- a/src/VBox/Runtime/testcase/tstEnv.cpp
+++ b/src/VBox/Runtime/testcase/tstEnv.cpp
@@ -24,9 +24,10 @@
* terms and conditions of either the GPL or the CDDL or both.
*/
-/*******************************************************************************
-* Header Files *
-*******************************************************************************/
+
+/*********************************************************************************************************************************
+* Header Files *
+*********************************************************************************************************************************/
#include <iprt/env.h>
#include <iprt/initterm.h>
#include <iprt/err.h>
diff --git a/src/VBox/Runtime/testcase/tstFile.cpp b/src/VBox/Runtime/testcase/tstFile.cpp
index 8a1c081..e96a1c2 100644
--- a/src/VBox/Runtime/testcase/tstFile.cpp
+++ b/src/VBox/Runtime/testcase/tstFile.cpp
@@ -25,9 +25,9 @@
*/
-/*******************************************************************************
-* Header Files *
-*******************************************************************************/
+/*********************************************************************************************************************************
+* Header Files *
+*********************************************************************************************************************************/
#include <iprt/file.h>
#include <iprt/err.h>
#include <iprt/string.h>
diff --git a/src/VBox/Runtime/testcase/tstFileAppendWin-1.cpp b/src/VBox/Runtime/testcase/tstFileAppendWin-1.cpp
index d4e4152..275f126 100644
--- a/src/VBox/Runtime/testcase/tstFileAppendWin-1.cpp
+++ b/src/VBox/Runtime/testcase/tstFileAppendWin-1.cpp
@@ -25,18 +25,18 @@
*/
-/*******************************************************************************
-* Header Files *
-*******************************************************************************/
+/*********************************************************************************************************************************
+* Header Files *
+*********************************************************************************************************************************/
#include <Windows.h>
#include <stdio.h>
#include <string.h>
#include <stdarg.h>
-/*******************************************************************************
-* Global Variables *
-*******************************************************************************/
+/*********************************************************************************************************************************
+* Global Variables *
+*********************************************************************************************************************************/
static int g_cErrors = 0;
diff --git a/src/VBox/Runtime/testcase/tstFileLock.cpp b/src/VBox/Runtime/testcase/tstFileLock.cpp
index 21e4189..0fa2e56 100644
--- a/src/VBox/Runtime/testcase/tstFileLock.cpp
+++ b/src/VBox/Runtime/testcase/tstFileLock.cpp
@@ -25,9 +25,9 @@
*/
-/*******************************************************************************
-* Header Files *
-*******************************************************************************/
+/*********************************************************************************************************************************
+* Header Files *
+*********************************************************************************************************************************/
#include <iprt/file.h>
#include <iprt/stream.h>
#include <iprt/err.h>
diff --git a/src/VBox/Runtime/testcase/tstFork.cpp b/src/VBox/Runtime/testcase/tstFork.cpp
index b746887..bd1d82b 100644
--- a/src/VBox/Runtime/testcase/tstFork.cpp
+++ b/src/VBox/Runtime/testcase/tstFork.cpp
@@ -25,9 +25,9 @@
*/
-/*******************************************************************************
-* Header Files *
-*******************************************************************************/
+/*********************************************************************************************************************************
+* Header Files *
+*********************************************************************************************************************************/
#include <iprt/test.h>
#include <iprt/process.h>
#include <iprt/stream.h>
diff --git a/src/VBox/Runtime/testcase/tstHandleTable.cpp b/src/VBox/Runtime/testcase/tstHandleTable.cpp
index 7641393..b028406 100644
--- a/src/VBox/Runtime/testcase/tstHandleTable.cpp
+++ b/src/VBox/Runtime/testcase/tstHandleTable.cpp
@@ -24,9 +24,10 @@
* terms and conditions of either the GPL or the CDDL or both.
*/
-/*******************************************************************************
-* Header Files *
-*******************************************************************************/
+
+/*********************************************************************************************************************************
+* Header Files *
+*********************************************************************************************************************************/
#include <iprt/handletable.h>
#include <iprt/stream.h>
#include <iprt/initterm.h>
@@ -38,9 +39,9 @@
#include <iprt/string.h>
-/*******************************************************************************
-* Global Variables *
-*******************************************************************************/
+/*********************************************************************************************************************************
+* Global Variables *
+*********************************************************************************************************************************/
static unsigned g_cErrors;
static DECLCALLBACK(void) tstHandleTableTest1Delete(RTHANDLETABLE hHandleTable, uint32_t h, void *pvObj, void *pvCtx, void *pvUser)
@@ -487,7 +488,7 @@ int main(int argc, char **argv)
return 1;
case 'V':
- RTPrintf("$Revision: 100874 $\n");
+ RTPrintf("$Revision: 102121 $\n");
return 0;
default:
diff --git a/src/VBox/Runtime/testcase/tstIprtList.cpp b/src/VBox/Runtime/testcase/tstIprtList.cpp
index d3b973f..9a266b3 100644
--- a/src/VBox/Runtime/testcase/tstIprtList.cpp
+++ b/src/VBox/Runtime/testcase/tstIprtList.cpp
@@ -24,9 +24,10 @@
* terms and conditions of either the GPL or the CDDL or both.
*/
-/*******************************************************************************
-* Header Files *
-*******************************************************************************/
+
+/*********************************************************************************************************************************
+* Header Files *
+*********************************************************************************************************************************/
#include <iprt/cpp/mtlist.h>
#include <iprt/cpp/ministring.h>
@@ -36,9 +37,9 @@
#include <iprt/time.h>
-/*******************************************************************************
-* Global Variables *
-*******************************************************************************/
+/*********************************************************************************************************************************
+* Global Variables *
+*********************************************************************************************************************************/
/** Used for the string test. */
static const char *g_apszTestStrings[] =
{
diff --git a/src/VBox/Runtime/testcase/tstIprtMiniString.cpp b/src/VBox/Runtime/testcase/tstIprtMiniString.cpp
index 96e81c0..c26b60d 100644
--- a/src/VBox/Runtime/testcase/tstIprtMiniString.cpp
+++ b/src/VBox/Runtime/testcase/tstIprtMiniString.cpp
@@ -24,9 +24,10 @@
* terms and conditions of either the GPL or the CDDL or both.
*/
-/*******************************************************************************
-* Header Files *
-*******************************************************************************/
+
+/*********************************************************************************************************************************
+* Header Files *
+*********************************************************************************************************************************/
#include <iprt/cpp/ministring.h>
#include <iprt/err.h>
diff --git a/src/VBox/Runtime/testcase/tstLdr-2.cpp b/src/VBox/Runtime/testcase/tstLdr-2.cpp
index 56ab531..45d9014 100644
--- a/src/VBox/Runtime/testcase/tstLdr-2.cpp
+++ b/src/VBox/Runtime/testcase/tstLdr-2.cpp
@@ -25,9 +25,9 @@
*/
-/*******************************************************************************
-* Header Files *
-*******************************************************************************/
+/*********************************************************************************************************************************
+* Header Files *
+*********************************************************************************************************************************/
#include <iprt/ldr.h>
#include <iprt/alloc.h>
#include <iprt/stream.h>
diff --git a/src/VBox/Runtime/testcase/tstLdr-3.cpp b/src/VBox/Runtime/testcase/tstLdr-3.cpp
index a1c5a19..730cfca 100644
--- a/src/VBox/Runtime/testcase/tstLdr-3.cpp
+++ b/src/VBox/Runtime/testcase/tstLdr-3.cpp
@@ -25,9 +25,9 @@
*/
-/*******************************************************************************
-* Header Files *
-*******************************************************************************/
+/*********************************************************************************************************************************
+* Header Files *
+*********************************************************************************************************************************/
#include <iprt/ldr.h>
#include <iprt/alloc.h>
#include <iprt/stream.h>
@@ -38,9 +38,9 @@
#include <VBox/dis.h>
-/*******************************************************************************
-* Global Variables *
-*******************************************************************************/
+/*********************************************************************************************************************************
+* Global Variables *
+*********************************************************************************************************************************/
static RTUINTPTR g_uLoadAddr;
static RTLDRMOD g_hLdrMod;
static void *g_pvBits;
diff --git a/src/VBox/Runtime/testcase/tstLdr-4.cpp b/src/VBox/Runtime/testcase/tstLdr-4.cpp
index c8ad677..d2a7460 100644
--- a/src/VBox/Runtime/testcase/tstLdr-4.cpp
+++ b/src/VBox/Runtime/testcase/tstLdr-4.cpp
@@ -25,9 +25,9 @@
*/
-/*******************************************************************************
-* Header Files *
-*******************************************************************************/
+/*********************************************************************************************************************************
+* Header Files *
+*********************************************************************************************************************************/
#include <iprt/ldr.h>
#include <iprt/alloc.h>
#include <iprt/log.h>
diff --git a/src/VBox/Runtime/testcase/tstLdr.cpp b/src/VBox/Runtime/testcase/tstLdr.cpp
index 2ff3072..9518c60 100644
--- a/src/VBox/Runtime/testcase/tstLdr.cpp
+++ b/src/VBox/Runtime/testcase/tstLdr.cpp
@@ -25,9 +25,9 @@
*/
-/*******************************************************************************
-* Header Files *
-*******************************************************************************/
+/*********************************************************************************************************************************
+* Header Files *
+*********************************************************************************************************************************/
#include <iprt/ldr.h>
#include <iprt/alloc.h>
#include <iprt/stream.h>
@@ -37,9 +37,9 @@
#include <iprt/string.h>
-/*******************************************************************************
-* Global Variables *
-*******************************************************************************/
+/*********************************************************************************************************************************
+* Global Variables *
+*********************************************************************************************************************************/
/** If set, don't bitch when failing to resolve symbols. */
static bool g_fDontBitchOnResolveFailure = false;
/** Whether it's kernel model code or not.. */
diff --git a/src/VBox/Runtime/testcase/tstLdrDisasmTest.cpp b/src/VBox/Runtime/testcase/tstLdrDisasmTest.cpp
index 5017e03..3fa77bc 100644
--- a/src/VBox/Runtime/testcase/tstLdrDisasmTest.cpp
+++ b/src/VBox/Runtime/testcase/tstLdrDisasmTest.cpp
@@ -31,9 +31,9 @@
-/*******************************************************************************
-* Header Files *
-*******************************************************************************/
+/*********************************************************************************************************************************
+* Header Files *
+*********************************************************************************************************************************/
#include <VBox/dis.h>
#include <VBox/disopcode.h>
#include <iprt/string.h>
@@ -46,9 +46,9 @@ extern "C" DECLIMPORT(int) MyPrintf(const char *pszFormat, ...);
#endif
-/*******************************************************************************
-* Global Variables *
-*******************************************************************************/
+/*********************************************************************************************************************************
+* Global Variables *
+*********************************************************************************************************************************/
/* 32-bit code */
static const uint8_t g_ab32BitCode[] =
diff --git a/src/VBox/Runtime/testcase/tstLdrObj.cpp b/src/VBox/Runtime/testcase/tstLdrObj.cpp
index 41ff7fe..6bf89d4 100644
--- a/src/VBox/Runtime/testcase/tstLdrObj.cpp
+++ b/src/VBox/Runtime/testcase/tstLdrObj.cpp
@@ -31,9 +31,9 @@
-/*******************************************************************************
-* Header Files *
-*******************************************************************************/
+/*********************************************************************************************************************************
+* Header Files *
+*********************************************************************************************************************************/
#ifndef IN_RC
# error "not IN_RC!"
#endif
@@ -42,9 +42,9 @@
#include <iprt/string.h>
-/*******************************************************************************
-* Global Variables *
-*******************************************************************************/
+/*********************************************************************************************************************************
+* Global Variables *
+*********************************************************************************************************************************/
static const char szStr1[] = "some readonly string";
static char szStr2[6000] = "some read/write string";
static char achBss[8192];
diff --git a/src/VBox/Runtime/testcase/tstLdrObjR0.cpp b/src/VBox/Runtime/testcase/tstLdrObjR0.cpp
index c2656e2..800f600 100644
--- a/src/VBox/Runtime/testcase/tstLdrObjR0.cpp
+++ b/src/VBox/Runtime/testcase/tstLdrObjR0.cpp
@@ -31,9 +31,9 @@
-/*******************************************************************************
-* Header Files *
-*******************************************************************************/
+/*********************************************************************************************************************************
+* Header Files *
+*********************************************************************************************************************************/
#ifndef IN_RING0
# error "not IN_RING0!"
#endif
@@ -42,9 +42,9 @@
#include <iprt/string.h>
-/*******************************************************************************
-* Global Variables *
-*******************************************************************************/
+/*********************************************************************************************************************************
+* Global Variables *
+*********************************************************************************************************************************/
static const char szStr1[] = "some readonly string";
static char szStr2[6000] = "some read/write string";
static char achBss[8192];
diff --git a/src/VBox/Runtime/testcase/tstLog.cpp b/src/VBox/Runtime/testcase/tstLog.cpp
index 94ee73c..e907483 100644
--- a/src/VBox/Runtime/testcase/tstLog.cpp
+++ b/src/VBox/Runtime/testcase/tstLog.cpp
@@ -24,9 +24,10 @@
* terms and conditions of either the GPL or the CDDL or both.
*/
-/*******************************************************************************
-* Header Files *
-*******************************************************************************/
+
+/*********************************************************************************************************************************
+* Header Files *
+*********************************************************************************************************************************/
#include <iprt/log.h>
#include <iprt/initterm.h>
#include <iprt/err.h>
diff --git a/src/VBox/Runtime/testcase/tstMemAutoPtr.cpp b/src/VBox/Runtime/testcase/tstMemAutoPtr.cpp
deleted file mode 100644
index 9dd1211..0000000
--- a/src/VBox/Runtime/testcase/tstMemAutoPtr.cpp
+++ /dev/null
@@ -1,291 +0,0 @@
-/* $Id: tstMemAutoPtr.cpp $ */
-/** @file
- * IPRT - Testcase the RTCMemAutoPtr template.
- */
-
-/*
- * Copyright (C) 2008-2015 Oracle Corporation
- *
- * This file is part of VirtualBox Open Source Edition (OSE), as
- * available from http://www.virtualbox.org. This file is free software;
- * you can redistribute it and/or modify it under the terms of the GNU
- * General Public License (GPL) as published by the Free Software
- * Foundation, in version 2 as it comes in the "COPYING" file of the
- * VirtualBox OSE distribution. VirtualBox OSE is distributed in the
- * hope that it will be useful, but WITHOUT ANY WARRANTY of any kind.
- *
- * The contents of this file may alternatively be used under the terms
- * of the Common Development and Distribution License Version 1.0
- * (CDDL) only, as it comes in the "COPYING.CDDL" file of the
- * VirtualBox OSE distribution, in which case the provisions of the
- * CDDL are applicable instead of those of the GPL.
- *
- * You may elect to license modified versions of this file under the
- * terms and conditions of either the GPL or the CDDL or both.
- */
-
-/*******************************************************************************
-* Header Files *
-*******************************************************************************/
-#include <iprt/cpp/mem.h>
-#include <iprt/stream.h>
-#include <iprt/initterm.h>
-#include <iprt/string.h>
-#include <iprt/rand.h>
-
-
-/*******************************************************************************
-* Structures and Typedefs *
-*******************************************************************************/
-typedef struct TSTMEMAUTOPTRSTRUCT
-{
- uint32_t a;
- uint32_t b;
- uint32_t c;
-} TSTMEMAUTOPTRSTRUCT;
-
-
-/*******************************************************************************
-* Global Variables *
-*******************************************************************************/
-#ifndef TST_MEM_AUTO_PTR_ONLY_DISAS
-static unsigned g_cErrors = 0;
-static unsigned g_cFrees;
-#endif
-
-
-/*
- * Feel free to inspect with gdb / objdump / whatever / g++ -fverbose-asm in
- * a release build and compare with tstMemAutoPtrDisas1PureC.
- */
-extern "C" int tstMemAutoPtrDisas1(void **ppv)
-{
- RTCMemAutoPtr<TSTMEMAUTOPTRSTRUCT> Handle(1);
- if (!Handle)
- {
- Handle->a = RTRandU32();
- if (Handle->a < UINT32_MAX / 2)
- {
- *ppv = Handle.release();
- return VINF_SUCCESS;
- }
- }
- return VERR_TRY_AGAIN;
-}
-
-/*
- * For comparing to tstMemAutoPtrDisas1.
- */
-extern "C" int tstMemAutoPtrDisas1PureC(void **ppv)
-{
- TSTMEMAUTOPTRSTRUCT *pHandle = (TSTMEMAUTOPTRSTRUCT *)RTMemRealloc(NULL, sizeof(*pHandle));
- if (pHandle)
- {
- pHandle->a = RTRandU32();
- if (pHandle->a < UINT32_MAX / 2)
- {
- *ppv = pHandle;
- return VINF_SUCCESS;
- }
- RTMemFree(pHandle);
- }
- return VERR_TRY_AGAIN;
-}
-
-
-#ifndef TST_MEM_AUTO_PTR_ONLY_DISAS
-
-template <class T>
-void tstMemAutoPtrDestructorCounter(T *aMem)
-{
- if (aMem == NULL)
- {
- RTPrintf("tstMemAutoPtr(): Destructor called with NULL handle!\n");
- g_cErrors++;
- }
- else if (!VALID_PTR(aMem))
- {
- RTPrintf("tstMemAutoPtr(): Destructor called with a bad handle %p\n", aMem);
- g_cErrors++;
- }
- RTMemEfFreeNP(aMem);
- g_cFrees++;
-}
-
-
-void *tstMemAutoPtrAllocatorNoZero(void *pvOld, size_t cbNew, const char *pszTag)
-{
- void *pvNew = RTMemReallocTag(pvOld, cbNew, pszTag);
- if (pvNew)
- memset(pvNew, 0xfe, cbNew);
- return pvNew;
-}
-
-
-int main()
-{
- RTR3InitExeNoArguments(0);
- RTPrintf("tstMemAutoPtr: TESTING...\n");
-
-#define CHECK_EXPR(expr) \
- do { bool const f = !!(expr); if (!f) { RTPrintf("tstMemAutoPtr(%d): %s!\n", __LINE__, #expr); g_cErrors++; } } while (0)
-
- /*
- * Some simple stuff.
- */
- {
- RTCMemAutoPtr<char> NilObj;
- CHECK_EXPR(!NilObj);
- CHECK_EXPR(NilObj.get() == NULL);
- CHECK_EXPR(NilObj.release() == NULL);
- NilObj.reset();
- }
-
- {
- RTCMemAutoPtr<char> Alloc(10);
- CHECK_EXPR(Alloc.get() != NULL);
- char *pch = Alloc.release();
- CHECK_EXPR(pch != NULL);
- CHECK_EXPR(Alloc.get() == NULL);
-
- RTCMemAutoPtr<char> Manage(pch);
- CHECK_EXPR(Manage.get() == pch);
- CHECK_EXPR(&Manage[0] == pch);
- CHECK_EXPR(&Manage[1] == &pch[1]);
- CHECK_EXPR(&Manage[9] == &pch[9]);
- }
-
- /*
- * Use the electric fence memory API to check alternative template
- * arguments and also check some subscript / reference limit thing.
- */
- {
- RTCMemAutoPtr<char, RTCMemEfAutoFree<char>, RTMemEfReallocNP> Electric(10);
- CHECK_EXPR(Electric.get() != NULL);
- Electric[0] = '0';
- CHECK_EXPR(Electric[0] == '0');
- CHECK_EXPR(*Electric == '0');
- //CHECK_EXPR(Electric == '0');
- Electric[9] = '1';
- CHECK_EXPR(Electric[9] == '1');
- /* Electric[10] = '2'; - this will crash (of course) */
- }
-
- /*
- * Check that memory is actually free when it should be and isn't when it shouldn't.
- * Use the electric heap to get some extra checks.
- */
- g_cFrees = 0;
- {
- RTCMemAutoPtr<char, tstMemAutoPtrDestructorCounter, RTMemEfReallocNP> FreeIt(128);
- FreeIt[127] = '0';
- }
- CHECK_EXPR(g_cFrees == 1);
-
- g_cFrees = 0;
- {
- RTCMemAutoPtr<char, tstMemAutoPtrDestructorCounter, RTMemEfReallocNP> FreeIt2(128);
- FreeIt2[127] = '1';
- FreeIt2.reset();
- FreeIt2.alloc(128);
- FreeIt2[127] = '2';
- FreeIt2.reset(FreeIt2.get()); /* this one is weird, but it's how things works... */
- }
- CHECK_EXPR(g_cFrees == 2);
-
- g_cFrees = 0;
- {
- RTCMemAutoPtr<char, tstMemAutoPtrDestructorCounter, RTMemEfReallocNP> DontFreeIt(256);
- DontFreeIt[255] = '0';
- RTMemEfFreeNP(DontFreeIt.release());
- }
- CHECK_EXPR(g_cFrees == 0);
-
- g_cFrees = 0;
- {
- RTCMemAutoPtr<char, tstMemAutoPtrDestructorCounter, RTMemEfReallocNP> FreeIt3(128);
- FreeIt3[127] = '0';
- CHECK_EXPR(FreeIt3.realloc(128));
- FreeIt3[127] = '0';
- CHECK_EXPR(FreeIt3.realloc(256));
- FreeIt3[255] = '0';
- CHECK_EXPR(FreeIt3.realloc(64));
- FreeIt3[63] = '0';
- CHECK_EXPR(FreeIt3.realloc(32));
- FreeIt3[31] = '0';
- }
- CHECK_EXPR(g_cFrees == 1);
-
- g_cFrees = 0;
- {
- RTCMemAutoPtr<char, tstMemAutoPtrDestructorCounter, RTMemEfReallocNP> FreeIt4;
- CHECK_EXPR(FreeIt4.alloc(123));
- CHECK_EXPR(FreeIt4.realloc(543));
- FreeIt4 = (char *)NULL;
- CHECK_EXPR(FreeIt4.get() == NULL);
- }
- CHECK_EXPR(g_cFrees == 1);
-
- /*
- * Check the ->, [] and * (unary) operators with some useful struct.
- */
- {
- RTCMemAutoPtr<TSTMEMAUTOPTRSTRUCT> Struct1(1);
- Struct1->a = 0x11223344;
- Struct1->b = 0x55667788;
- Struct1->c = 0x99aabbcc;
- CHECK_EXPR(Struct1->a == 0x11223344);
- CHECK_EXPR(Struct1->b == 0x55667788);
- CHECK_EXPR(Struct1->c == 0x99aabbcc);
-
- Struct1[0].a = 0x11223344;
- Struct1[0].b = 0x55667788;
- Struct1[0].c = 0x99aabbcc;
- CHECK_EXPR(Struct1[0].a == 0x11223344);
- CHECK_EXPR(Struct1[0].b == 0x55667788);
- CHECK_EXPR(Struct1[0].c == 0x99aabbcc);
-
- (*Struct1).a = 0x11223344;
- (*Struct1).b = 0x55667788;
- (*Struct1).c = 0x99aabbcc;
- CHECK_EXPR((*Struct1).a == 0x11223344);
- CHECK_EXPR((*Struct1).b == 0x55667788);
- CHECK_EXPR((*Struct1).c == 0x99aabbcc);
-
- /* since at it... */
- Struct1.get()->a = 0x11223344;
- Struct1.get()->b = 0x55667788;
- Struct1.get()->c = 0x99aabbcc;
- CHECK_EXPR(Struct1.get()->a == 0x11223344);
- CHECK_EXPR(Struct1.get()->b == 0x55667788);
- CHECK_EXPR(Struct1.get()->c == 0x99aabbcc);
- }
-
- /*
- * Check the zeroing of memory.
- */
- {
- RTCMemAutoPtr<uint64_t, RTCMemAutoDestructor<uint64_t>, tstMemAutoPtrAllocatorNoZero> Zeroed1(1, true);
- CHECK_EXPR(*Zeroed1 == 0);
- }
-
- {
- RTCMemAutoPtr<uint64_t, RTCMemAutoDestructor<uint64_t>, tstMemAutoPtrAllocatorNoZero> Zeroed2;
- Zeroed2.alloc(5, true);
- CHECK_EXPR(Zeroed2[0] == 0);
- CHECK_EXPR(Zeroed2[1] == 0);
- CHECK_EXPR(Zeroed2[2] == 0);
- CHECK_EXPR(Zeroed2[3] == 0);
- CHECK_EXPR(Zeroed2[4] == 0);
- }
-
- /*
- * Summary.
- */
- if (!g_cErrors)
- RTPrintf("tstMemAutoPtr: SUCCESS\n");
- else
- RTPrintf("tstMemAutoPtr: FAILED - %d errors\n", g_cErrors);
- return !!g_cErrors;
-}
-#endif /* TST_MEM_AUTO_PTR_ONLY_DISAS */
diff --git a/src/VBox/Runtime/testcase/tstMove.cpp b/src/VBox/Runtime/testcase/tstMove.cpp
index fc9fb46..18dfacc 100644
--- a/src/VBox/Runtime/testcase/tstMove.cpp
+++ b/src/VBox/Runtime/testcase/tstMove.cpp
@@ -24,9 +24,10 @@
* terms and conditions of either the GPL or the CDDL or both.
*/
-/*******************************************************************************
-* Header Files *
-*******************************************************************************/
+
+/*********************************************************************************************************************************
+* Header Files *
+*********************************************************************************************************************************/
#include <iprt/file.h>
#include <iprt/path.h>
#include <iprt/dir.h>
diff --git a/src/VBox/Runtime/testcase/tstNoCrt-1.cpp b/src/VBox/Runtime/testcase/tstNoCrt-1.cpp
index ebe8135..21781be 100644
--- a/src/VBox/Runtime/testcase/tstNoCrt-1.cpp
+++ b/src/VBox/Runtime/testcase/tstNoCrt-1.cpp
@@ -24,9 +24,10 @@
* terms and conditions of either the GPL or the CDDL or both.
*/
-/*******************************************************************************
-* Header Files *
-*******************************************************************************/
+
+/*********************************************************************************************************************************
+* Header Files *
+*********************************************************************************************************************************/
#include <iprt/nocrt/string.h>
#include <iprt/stream.h>
#include <iprt/initterm.h>
@@ -36,9 +37,9 @@
#endif
-/*******************************************************************************
-* Structures and Typedefs *
-*******************************************************************************/
+/*********************************************************************************************************************************
+* Structures and Typedefs *
+*********************************************************************************************************************************/
#define TSTBUF_SIZE 8192
typedef struct TSTBUF
{
@@ -48,9 +49,9 @@ typedef struct TSTBUF
} TSTBUF, *PTSTBUF;
-/*******************************************************************************
-* Global Variables *
-*******************************************************************************/
+/*********************************************************************************************************************************
+* Global Variables *
+*********************************************************************************************************************************/
static unsigned g_cErrors = 0;
diff --git a/src/VBox/Runtime/testcase/tstOnce.cpp b/src/VBox/Runtime/testcase/tstOnce.cpp
index 1ee5702..f4926a3 100644
--- a/src/VBox/Runtime/testcase/tstOnce.cpp
+++ b/src/VBox/Runtime/testcase/tstOnce.cpp
@@ -24,9 +24,10 @@
* terms and conditions of either the GPL or the CDDL or both.
*/
-/*******************************************************************************
-* Header Files *
-*******************************************************************************/
+
+/*********************************************************************************************************************************
+* Header Files *
+*********************************************************************************************************************************/
#include <iprt/once.h>
#include <iprt/stream.h>
#include <iprt/initterm.h>
@@ -37,9 +38,9 @@
#include <iprt/asm.h>
-/*******************************************************************************
-* Global Variables *
-*******************************************************************************/
+/*********************************************************************************************************************************
+* Global Variables *
+*********************************************************************************************************************************/
static int g_cErrors = 0;
static bool g_fOnceCB1 = false;
static uint32_t volatile g_cOnce2CB = 0;
diff --git a/src/VBox/Runtime/testcase/tstPrfRT.cpp b/src/VBox/Runtime/testcase/tstPrfRT.cpp
index a77a26e..9ad95b7 100644
--- a/src/VBox/Runtime/testcase/tstPrfRT.cpp
+++ b/src/VBox/Runtime/testcase/tstPrfRT.cpp
@@ -24,9 +24,10 @@
* terms and conditions of either the GPL or the CDDL or both.
*/
-/*******************************************************************************
-* Header Files *
-*******************************************************************************/
+
+/*********************************************************************************************************************************
+* Header Files *
+*********************************************************************************************************************************/
#include <iprt/initterm.h>
#include <iprt/time.h>
#include <iprt/log.h>
diff --git a/src/VBox/Runtime/testcase/tstRTAssertCompile.cpp b/src/VBox/Runtime/testcase/tstRTAssertCompile.cpp
index 5ca22c7..4847633 100644
--- a/src/VBox/Runtime/testcase/tstRTAssertCompile.cpp
+++ b/src/VBox/Runtime/testcase/tstRTAssertCompile.cpp
@@ -25,9 +25,9 @@
*/
-/*******************************************************************************
-* Header Files *
-*******************************************************************************/
+/*********************************************************************************************************************************
+* Header Files *
+*********************************************************************************************************************************/
#include <iprt/assert.h>
diff --git a/src/VBox/Runtime/testcase/tstRTAvl.cpp b/src/VBox/Runtime/testcase/tstRTAvl.cpp
index f2e751a..88662f1 100644
--- a/src/VBox/Runtime/testcase/tstRTAvl.cpp
+++ b/src/VBox/Runtime/testcase/tstRTAvl.cpp
@@ -24,9 +24,10 @@
* terms and conditions of either the GPL or the CDDL or both.
*/
-/*******************************************************************************
-* Header Files *
-*******************************************************************************/
+
+/*********************************************************************************************************************************
+* Header Files *
+*********************************************************************************************************************************/
#include <iprt/avl.h>
#include <iprt/asm.h>
@@ -38,9 +39,9 @@
#include <iprt/test.h>
-/*******************************************************************************
-* Structures and Typedefs *
-*******************************************************************************/
+/*********************************************************************************************************************************
+* Structures and Typedefs *
+*********************************************************************************************************************************/
typedef struct TRACKER
{
/** The max key value (exclusive). */
@@ -56,9 +57,9 @@ typedef struct TRACKER
} TRACKER, *PTRACKER;
-/*******************************************************************************
-* Global Variables *
-*******************************************************************************/
+/*********************************************************************************************************************************
+* Global Variables *
+*********************************************************************************************************************************/
static RTTEST g_hTest;
static RTRAND g_hRand;
diff --git a/src/VBox/Runtime/testcase/tstRTBase64.cpp b/src/VBox/Runtime/testcase/tstRTBase64.cpp
index 6c6fb60..6149e15 100644
--- a/src/VBox/Runtime/testcase/tstRTBase64.cpp
+++ b/src/VBox/Runtime/testcase/tstRTBase64.cpp
@@ -24,9 +24,10 @@
* terms and conditions of either the GPL or the CDDL or both.
*/
-/*******************************************************************************
-* Header Files *
-*******************************************************************************/
+
+/*********************************************************************************************************************************
+* Header Files *
+*********************************************************************************************************************************/
#include <iprt/base64.h>
#include <iprt/err.h>
@@ -37,9 +38,9 @@
#include <iprt/test.h>
-/*******************************************************************************
-* Defined Constants And Macros *
-*******************************************************************************/
+/*********************************************************************************************************************************
+* Defined Constants And Macros *
+*********************************************************************************************************************************/
#if defined(RT_OS_OS2) || defined(RT_OS_WINDOWS)
# define MY_NL "\r\n"
#else
@@ -47,9 +48,9 @@
#endif
-/*******************************************************************************
-* Global Variables *
-*******************************************************************************/
+/*********************************************************************************************************************************
+* Global Variables *
+*********************************************************************************************************************************/
static void tstBase64(const void *pvData, size_t cbData,
diff --git a/src/VBox/Runtime/testcase/tstRTBigNum.cpp b/src/VBox/Runtime/testcase/tstRTBigNum.cpp
index df892e3..b915da1 100644
--- a/src/VBox/Runtime/testcase/tstRTBigNum.cpp
+++ b/src/VBox/Runtime/testcase/tstRTBigNum.cpp
@@ -24,9 +24,10 @@
* terms and conditions of either the GPL or the CDDL or both.
*/
-/*******************************************************************************
-* Header Files *
-*******************************************************************************/
+
+/*********************************************************************************************************************************
+* Header Files *
+*********************************************************************************************************************************/
#include <iprt/bignum.h>
#include <iprt/uint128.h>
@@ -40,9 +41,9 @@
#endif
-/*******************************************************************************
-* Global Variables *
-*******************************************************************************/
+/*********************************************************************************************************************************
+* Global Variables *
+*********************************************************************************************************************************/
static RTTEST g_hTest;
diff --git a/src/VBox/Runtime/testcase/tstRTBitOperations.cpp b/src/VBox/Runtime/testcase/tstRTBitOperations.cpp
index 7f4e9b6..b84f052 100644
--- a/src/VBox/Runtime/testcase/tstRTBitOperations.cpp
+++ b/src/VBox/Runtime/testcase/tstRTBitOperations.cpp
@@ -24,9 +24,10 @@
* terms and conditions of either the GPL or the CDDL or both.
*/
-/*******************************************************************************
-* Header Files *
-*******************************************************************************/
+
+/*********************************************************************************************************************************
+* Header Files *
+*********************************************************************************************************************************/
#include <iprt/asm.h>
#include <iprt/initterm.h>
@@ -162,7 +163,7 @@ int main()
MAP_CLEAR(p);
CHECK_GUARD(p);
- /* set */
+ /* bit set */
MAP_CLEAR(p);
ASMBitSet(&p->au32[0], 0);
ASMBitSet(&p->au32[0], 31);
@@ -185,7 +186,7 @@ int main()
CHECK(ASMAtomicBitTestAndSet(&p->au32[0], 16) && p->au32[0] == 0x40010001U);
CHECK(!ASMAtomicBitTestAndSet(&p->au32[0], 80) && p->au32[2] == 0x00010001U);
- /* clear */
+ /* bit clear */
MAP_SET(p);
ASMBitClear(&p->au32[0], 0);
ASMBitClear(&p->au32[0], 31);
@@ -208,6 +209,15 @@ int main()
CHECK(!ASMAtomicBitTestAndClear(&p->au32[0], 16) && p->au32[0] == ~0x40010001U);
CHECK(ASMAtomicBitTestAndClear(&p->au32[0], 80) && p->au32[2] == ~0x00010001U);
+ /* range set */
+ MAP_CLEAR(p);
+ ASMBitSetRange(&p->au32[0], 0, 5);
+ ASMBitSetRange(&p->au32[0], 6, 44);
+ ASMBitSetRange(&p->au32[0], 64, 65);
+ CHECK(p->au32[0] == 0xFFFFFFDFU);
+ CHECK(p->au32[1] == 0x00000FFFU);
+ CHECK(p->au32[2] == 0x00000001U);
+
/* toggle */
MAP_SET(p);
ASMBitToggle(&p->au32[0], 0);
diff --git a/src/VBox/Runtime/testcase/tstRTCType.cpp b/src/VBox/Runtime/testcase/tstRTCType.cpp
index c3fe55c..295a44a 100644
--- a/src/VBox/Runtime/testcase/tstRTCType.cpp
+++ b/src/VBox/Runtime/testcase/tstRTCType.cpp
@@ -24,9 +24,10 @@
* terms and conditions of either the GPL or the CDDL or both.
*/
-/*******************************************************************************
-* Header Files *
-*******************************************************************************/
+
+/*********************************************************************************************************************************
+* Header Files *
+*********************************************************************************************************************************/
#include <iprt/ctype.h>
#include <iprt/test.h>
@@ -37,9 +38,9 @@
#endif
-/*******************************************************************************
-* Global Variables *
-*******************************************************************************/
+/*********************************************************************************************************************************
+* Global Variables *
+*********************************************************************************************************************************/
#define TEST_X(a_ch, a_Macro, a_fMask) \
do { \
bool const fBit = RT_BOOL(g_afCharMap[(a_ch)] & (a_fMask)); \
diff --git a/src/VBox/Runtime/testcase/tstRTCidr.cpp b/src/VBox/Runtime/testcase/tstRTCidr.cpp
index bc9b92b..9a4772c 100644
--- a/src/VBox/Runtime/testcase/tstRTCidr.cpp
+++ b/src/VBox/Runtime/testcase/tstRTCidr.cpp
@@ -25,9 +25,9 @@
*/
-/*******************************************************************************
-* Header Files *
-*******************************************************************************/
+/*********************************************************************************************************************************
+* Header Files *
+*********************************************************************************************************************************/
#include <iprt/cidr.h>
#include <iprt/err.h>
@@ -35,9 +35,9 @@
#include <iprt/test.h>
-/*******************************************************************************
-* Defined Constants And Macros *
-*******************************************************************************/
+/*********************************************************************************************************************************
+* Defined Constants And Macros *
+*********************************************************************************************************************************/
#define CHECKNETWORK(String, rcExpected, ExpectedNetwork, ExpectedNetMask) \
do { \
RTNETADDRIPV4 Network, NetMask; \
diff --git a/src/VBox/Runtime/testcase/tstRTCircBuf.cpp b/src/VBox/Runtime/testcase/tstRTCircBuf.cpp
index 8da3834..399c200 100644
--- a/src/VBox/Runtime/testcase/tstRTCircBuf.cpp
+++ b/src/VBox/Runtime/testcase/tstRTCircBuf.cpp
@@ -24,9 +24,10 @@
* terms and conditions of either the GPL or the CDDL or both.
*/
-/*******************************************************************************
-* Header Files *
-*******************************************************************************/
+
+/*********************************************************************************************************************************
+* Header Files *
+*********************************************************************************************************************************/
#include <iprt/circbuf.h>
#include <iprt/err.h>
diff --git a/src/VBox/Runtime/testcase/tstRTCoreDump.cpp b/src/VBox/Runtime/testcase/tstRTCoreDump.cpp
index 722cda1..c8549fe 100644
--- a/src/VBox/Runtime/testcase/tstRTCoreDump.cpp
+++ b/src/VBox/Runtime/testcase/tstRTCoreDump.cpp
@@ -24,9 +24,10 @@
* terms and conditions of either the GPL or the CDDL or both.
*/
-/*******************************************************************************
-* Header Files *
-*******************************************************************************/
+
+/*********************************************************************************************************************************
+* Header Files *
+*********************************************************************************************************************************/
#include <iprt/coredumper.h>
#include <iprt/test.h>
@@ -35,9 +36,9 @@
#include <iprt/thread.h>
-/*******************************************************************************
-* Globals *
-*******************************************************************************/
+/*********************************************************************************************************************************
+* Globals *
+*********************************************************************************************************************************/
static DECLCALLBACK(int) SleepyThread(RTTHREAD hThread, void *pvUser)
{
NOREF(pvUser);
diff --git a/src/VBox/Runtime/testcase/tstRTCritSect.cpp b/src/VBox/Runtime/testcase/tstRTCritSect.cpp
index d8d910b..e8e7726 100644
--- a/src/VBox/Runtime/testcase/tstRTCritSect.cpp
+++ b/src/VBox/Runtime/testcase/tstRTCritSect.cpp
@@ -24,9 +24,10 @@
* terms and conditions of either the GPL or the CDDL or both.
*/
-/*******************************************************************************
-* Header Files *
-*******************************************************************************/
+
+/*********************************************************************************************************************************
+* Header Files *
+*********************************************************************************************************************************/
#ifdef TRY_WIN32_CRIT
# include <Windows.h>
#endif
@@ -86,9 +87,9 @@ DECLINLINE(int) RTCritSectDelete(PCRITICAL_SECTION pCritSect)
#endif /* TRY_WIN32_CRIT */
-/*******************************************************************************
-* Structures and Typedefs *
-*******************************************************************************/
+/*********************************************************************************************************************************
+* Structures and Typedefs *
+*********************************************************************************************************************************/
/**
* Arguments to ThreadTest1().
*/
@@ -137,9 +138,9 @@ typedef struct THREADTEST2ARGS
} THREADTEST2ARGS, *PTHREADTEST2ARGS;
-/*******************************************************************************
-* Global Variables *
-*******************************************************************************/
+/*********************************************************************************************************************************
+* Global Variables *
+*********************************************************************************************************************************/
/** The test handle. */
static RTTEST g_hTest;
@@ -491,7 +492,7 @@ int main(int argc, char **argv)
return 1;
case 'V':
- RTPrintf("$Revision: 100874 $\n");
+ RTPrintf("$Revision: 102121 $\n");
return 0;
default:
diff --git a/src/VBox/Runtime/testcase/tstRTCritSectRw.cpp b/src/VBox/Runtime/testcase/tstRTCritSectRw.cpp
index a172813..63354b8 100644
--- a/src/VBox/Runtime/testcase/tstRTCritSectRw.cpp
+++ b/src/VBox/Runtime/testcase/tstRTCritSectRw.cpp
@@ -24,9 +24,10 @@
* terms and conditions of either the GPL or the CDDL or both.
*/
-/*******************************************************************************
-* Header Files *
-*******************************************************************************/
+
+/*********************************************************************************************************************************
+* Header Files *
+*********************************************************************************************************************************/
#include <iprt/critsect.h>
#include <iprt/asm.h>
@@ -43,9 +44,9 @@
#include <iprt/thread.h>
-/*******************************************************************************
-* Global Variables *
-*******************************************************************************/
+/*********************************************************************************************************************************
+* Global Variables *
+*********************************************************************************************************************************/
static RTTEST g_hTest;
static RTCRITSECTRW g_CritSectRw;
static bool volatile g_fTerminate;
diff --git a/src/VBox/Runtime/testcase/tstRTDarwinMachKernel.cpp b/src/VBox/Runtime/testcase/tstRTDarwinMachKernel.cpp
index ac66f5d..64a2de3 100644
--- a/src/VBox/Runtime/testcase/tstRTDarwinMachKernel.cpp
+++ b/src/VBox/Runtime/testcase/tstRTDarwinMachKernel.cpp
@@ -25,9 +25,9 @@
*/
-/*******************************************************************************
-* Header Files *
-*******************************************************************************/
+/*********************************************************************************************************************************
+* Header Files *
+*********************************************************************************************************************************/
#include <iprt/dbg.h>
#include <iprt/err.h>
#include <iprt/string.h>
diff --git a/src/VBox/Runtime/testcase/tstRTDigest-2.cpp b/src/VBox/Runtime/testcase/tstRTDigest-2.cpp
index 915b7ae..ce9ef5f 100644
--- a/src/VBox/Runtime/testcase/tstRTDigest-2.cpp
+++ b/src/VBox/Runtime/testcase/tstRTDigest-2.cpp
@@ -24,9 +24,10 @@
* terms and conditions of either the GPL or the CDDL or both.
*/
-/*******************************************************************************
-* Header Files *
-*******************************************************************************/
+
+/*********************************************************************************************************************************
+* Header Files *
+*********************************************************************************************************************************/
#include <iprt/crypto/digest.h>
#include <iprt/md2.h>
#include <iprt/md5.h>
@@ -39,9 +40,9 @@
#include <iprt/string.h>
-/*******************************************************************************
-* Structures and Typedefs *
-*******************************************************************************/
+/*********************************************************************************************************************************
+* Structures and Typedefs *
+*********************************************************************************************************************************/
typedef struct TESTRTDIGEST
{
/** Pointer to the input. */
@@ -55,9 +56,9 @@ typedef struct TESTRTDIGEST
} TESTRTDIGEST;
-/*******************************************************************************
-* Global Variables *
-*******************************************************************************/
+/*********************************************************************************************************************************
+* Global Variables *
+*********************************************************************************************************************************/
#include "72kb-random.h"
diff --git a/src/VBox/Runtime/testcase/tstRTDigest.cpp b/src/VBox/Runtime/testcase/tstRTDigest.cpp
index 5dbfb73..e048d0d 100644
--- a/src/VBox/Runtime/testcase/tstRTDigest.cpp
+++ b/src/VBox/Runtime/testcase/tstRTDigest.cpp
@@ -25,9 +25,9 @@
*/
-/*******************************************************************************
-* Header Files *
-*******************************************************************************/
+/*********************************************************************************************************************************
+* Header Files *
+*********************************************************************************************************************************/
#include <iprt/sha.h>
#include <iprt/md2.h>
#include <iprt/md5.h>
diff --git a/src/VBox/Runtime/testcase/tstRTDirCreateUniqueNumbered.cpp b/src/VBox/Runtime/testcase/tstRTDirCreateUniqueNumbered.cpp
index 96628fd..dc751d1 100644
--- a/src/VBox/Runtime/testcase/tstRTDirCreateUniqueNumbered.cpp
+++ b/src/VBox/Runtime/testcase/tstRTDirCreateUniqueNumbered.cpp
@@ -24,9 +24,10 @@
* terms and conditions of either the GPL or the CDDL or both.
*/
-/*******************************************************************************
-* Header Files *
-*******************************************************************************/
+
+/*********************************************************************************************************************************
+* Header Files *
+*********************************************************************************************************************************/
#include <iprt/dir.h>
#include <iprt/path.h>
@@ -35,9 +36,9 @@
#include <iprt/test.h>
-/*******************************************************************************
-* Global Variables *
-*******************************************************************************/
+/*********************************************************************************************************************************
+* Global Variables *
+*********************************************************************************************************************************/
static char g_szTempPath[RTPATH_MAX - 50];
diff --git a/src/VBox/Runtime/testcase/tstRTDvm.cpp b/src/VBox/Runtime/testcase/tstRTDvm.cpp
index e80823c..10641cd 100644
--- a/src/VBox/Runtime/testcase/tstRTDvm.cpp
+++ b/src/VBox/Runtime/testcase/tstRTDvm.cpp
@@ -25,9 +25,9 @@
*/
-/*******************************************************************************
-* Header Files *
-*******************************************************************************/
+/*********************************************************************************************************************************
+* Header Files *
+*********************************************************************************************************************************/
#include <iprt/dvm.h>
#include <iprt/err.h>
@@ -36,9 +36,9 @@
#include <iprt/string.h>
-/*******************************************************************************
-* Structures and Typedefs *
-*******************************************************************************/
+/*********************************************************************************************************************************
+* Structures and Typedefs *
+*********************************************************************************************************************************/
/**
* Disk structure.
*/
@@ -58,7 +58,7 @@ typedef struct TSTRTDVMDISK
-static int dvmDiskRead(void *pvUser, uint64_t off, void *pvBuf, size_t cbRead)
+static DECLCALLBACK(int) dvmDiskRead(void *pvUser, uint64_t off, void *pvBuf, size_t cbRead)
{
PTSTRTDVMDISK pDisk = (PTSTRTDVMDISK)pvUser;
@@ -67,7 +67,7 @@ static int dvmDiskRead(void *pvUser, uint64_t off, void *pvBuf, size_t cbRead)
return RTDvmVolumeRead(pDisk->hVol, off, pvBuf, cbRead);
}
-static int dvmDiskWrite(void *pvUser, uint64_t off, const void *pvBuf, size_t cbWrite)
+static DECLCALLBACK(int) dvmDiskWrite(void *pvUser, uint64_t off, const void *pvBuf, size_t cbWrite)
{
PTSTRTDVMDISK pDisk = (PTSTRTDVMDISK)pvUser;
diff --git a/src/VBox/Runtime/testcase/tstRTErrUnique.cpp b/src/VBox/Runtime/testcase/tstRTErrUnique.cpp
index 3c57bbe..369ab88 100644
--- a/src/VBox/Runtime/testcase/tstRTErrUnique.cpp
+++ b/src/VBox/Runtime/testcase/tstRTErrUnique.cpp
@@ -25,9 +25,9 @@
*/
-/*******************************************************************************
-* Header Files *
-*******************************************************************************/
+/*********************************************************************************************************************************
+* Header Files *
+*********************************************************************************************************************************/
#include <iprt/err.h>
#include <iprt/string.h>
#include <iprt/test.h>
@@ -36,9 +36,9 @@
#endif
-/*******************************************************************************
-* Global Variables *
-*******************************************************************************/
+/*********************************************************************************************************************************
+* Global Variables *
+*********************************************************************************************************************************/
/** Array of messages.
* The data is generated by a sed script.
*/
diff --git a/src/VBox/Runtime/testcase/tstRTFileAio.cpp b/src/VBox/Runtime/testcase/tstRTFileAio.cpp
index 24e475e..e21f847 100644
--- a/src/VBox/Runtime/testcase/tstRTFileAio.cpp
+++ b/src/VBox/Runtime/testcase/tstRTFileAio.cpp
@@ -25,9 +25,9 @@
*/
-/*******************************************************************************
-* Header Files *
-*******************************************************************************/
+/*********************************************************************************************************************************
+* Header Files *
+*********************************************************************************************************************************/
#include <iprt/file.h>
#include <iprt/err.h>
@@ -37,17 +37,17 @@
#include <iprt/test.h>
-/*******************************************************************************
-* Defined Constants And Macros *
-*******************************************************************************/
+/*********************************************************************************************************************************
+* Defined Constants And Macros *
+*********************************************************************************************************************************/
/** @todo make configurable through cmd line. */
#define TSTFILEAIO_MAX_REQS_IN_FLIGHT 64
#define TSTFILEAIO_BUFFER_SIZE (64*_1K)
-/*******************************************************************************
-* Global Variables *
-*******************************************************************************/
+/*********************************************************************************************************************************
+* Global Variables *
+*********************************************************************************************************************************/
static RTTEST g_hTest = NIL_RTTEST;
diff --git a/src/VBox/Runtime/testcase/tstRTFileAppend-1.cpp b/src/VBox/Runtime/testcase/tstRTFileAppend-1.cpp
index 40dbe1f..aa6a314 100644
--- a/src/VBox/Runtime/testcase/tstRTFileAppend-1.cpp
+++ b/src/VBox/Runtime/testcase/tstRTFileAppend-1.cpp
@@ -25,9 +25,9 @@
*/
-/*******************************************************************************
-* Header Files *
-*******************************************************************************/
+/*********************************************************************************************************************************
+* Header Files *
+*********************************************************************************************************************************/
#include <iprt/file.h>
#include <iprt/err.h>
diff --git a/src/VBox/Runtime/testcase/tstRTFileGetSize-1.cpp b/src/VBox/Runtime/testcase/tstRTFileGetSize-1.cpp
index 2fcf9a2..158f2c5 100644
--- a/src/VBox/Runtime/testcase/tstRTFileGetSize-1.cpp
+++ b/src/VBox/Runtime/testcase/tstRTFileGetSize-1.cpp
@@ -24,9 +24,10 @@
* terms and conditions of either the GPL or the CDDL or both.
*/
-/*******************************************************************************
-* Header Files *
-*******************************************************************************/
+
+/*********************************************************************************************************************************
+* Header Files *
+*********************************************************************************************************************************/
#include <iprt/file.h>
#include <iprt/err.h>
diff --git a/src/VBox/Runtime/testcase/tstRTFileModeStringToFlags.cpp b/src/VBox/Runtime/testcase/tstRTFileModeStringToFlags.cpp
index 41d765e..5af6944 100644
--- a/src/VBox/Runtime/testcase/tstRTFileModeStringToFlags.cpp
+++ b/src/VBox/Runtime/testcase/tstRTFileModeStringToFlags.cpp
@@ -24,9 +24,10 @@
* terms and conditions of either the GPL or the CDDL or both.
*/
-/*******************************************************************************
-* Header Files *
-*******************************************************************************/
+
+/*********************************************************************************************************************************
+* Header Files *
+*********************************************************************************************************************************/
#include <iprt/file.h>
#include <iprt/stream.h>
#include <iprt/string.h>
diff --git a/src/VBox/Runtime/testcase/tstRTFilesystem.cpp b/src/VBox/Runtime/testcase/tstRTFilesystem.cpp
index 04b81aa..5ad4855 100644
--- a/src/VBox/Runtime/testcase/tstRTFilesystem.cpp
+++ b/src/VBox/Runtime/testcase/tstRTFilesystem.cpp
@@ -25,9 +25,9 @@
*/
-/*******************************************************************************
-* Header Files *
-*******************************************************************************/
+/*********************************************************************************************************************************
+* Header Files *
+*********************************************************************************************************************************/
#include <iprt/filesystem.h>
#include <iprt/vfs.h>
#include <iprt/err.h>
@@ -36,9 +36,9 @@
#include <iprt/string.h>
-/*******************************************************************************
-* Structures and Typedefs *
-*******************************************************************************/
+/*********************************************************************************************************************************
+* Structures and Typedefs *
+*********************************************************************************************************************************/
static int tstRTFilesystem(RTTEST hTest, RTVFSFILE hVfsFile)
{
diff --git a/src/VBox/Runtime/testcase/tstRTFsQueries.cpp b/src/VBox/Runtime/testcase/tstRTFsQueries.cpp
index 148504c..3a840b5 100644
--- a/src/VBox/Runtime/testcase/tstRTFsQueries.cpp
+++ b/src/VBox/Runtime/testcase/tstRTFsQueries.cpp
@@ -24,9 +24,10 @@
* terms and conditions of either the GPL or the CDDL or both.
*/
-/*******************************************************************************
-* Header Files *
-*******************************************************************************/
+
+/*********************************************************************************************************************************
+* Header Files *
+*********************************************************************************************************************************/
#include <iprt/path.h>
#include <iprt/initterm.h>
#include <iprt/stream.h>
diff --git a/src/VBox/Runtime/testcase/tstRTGetOpt.cpp b/src/VBox/Runtime/testcase/tstRTGetOpt.cpp
index 631655e..7b7d41d 100644
--- a/src/VBox/Runtime/testcase/tstRTGetOpt.cpp
+++ b/src/VBox/Runtime/testcase/tstRTGetOpt.cpp
@@ -25,9 +25,9 @@
*/
-/*******************************************************************************
-* Header Files *
-*******************************************************************************/
+/*********************************************************************************************************************************
+* Header Files *
+*********************************************************************************************************************************/
#include <iprt/net.h>
#include <iprt/getopt.h>
diff --git a/src/VBox/Runtime/testcase/tstRTGetOptArgv.cpp b/src/VBox/Runtime/testcase/tstRTGetOptArgv.cpp
index 58bde6f..c8b49e0 100644
--- a/src/VBox/Runtime/testcase/tstRTGetOptArgv.cpp
+++ b/src/VBox/Runtime/testcase/tstRTGetOptArgv.cpp
@@ -24,9 +24,10 @@
* terms and conditions of either the GPL or the CDDL or both.
*/
-/*******************************************************************************
-* Header Files *
-*******************************************************************************/
+
+/*********************************************************************************************************************************
+* Header Files *
+*********************************************************************************************************************************/
#include <iprt/path.h>
#include <iprt/err.h>
@@ -37,9 +38,9 @@
#include <iprt/test.h>
-/*******************************************************************************
-* Global Variables *
-*******************************************************************************/
+/*********************************************************************************************************************************
+* Global Variables *
+*********************************************************************************************************************************/
static const struct
{
/** The input string, bourne shell. */
diff --git a/src/VBox/Runtime/testcase/tstRTHeapOffset.cpp b/src/VBox/Runtime/testcase/tstRTHeapOffset.cpp
index 1a5e5ef..b63907b 100644
--- a/src/VBox/Runtime/testcase/tstRTHeapOffset.cpp
+++ b/src/VBox/Runtime/testcase/tstRTHeapOffset.cpp
@@ -24,9 +24,10 @@
* terms and conditions of either the GPL or the CDDL or both.
*/
-/*******************************************************************************
-* Header Files *
-*******************************************************************************/
+
+/*********************************************************************************************************************************
+* Header Files *
+*********************************************************************************************************************************/
#include <iprt/heap.h>
#include <iprt/assert.h>
diff --git a/src/VBox/Runtime/testcase/tstRTHeapSimple.cpp b/src/VBox/Runtime/testcase/tstRTHeapSimple.cpp
index b333c91..bb31648 100644
--- a/src/VBox/Runtime/testcase/tstRTHeapSimple.cpp
+++ b/src/VBox/Runtime/testcase/tstRTHeapSimple.cpp
@@ -24,9 +24,10 @@
* terms and conditions of either the GPL or the CDDL or both.
*/
-/*******************************************************************************
-* Header Files *
-*******************************************************************************/
+
+/*********************************************************************************************************************************
+* Header Files *
+*********************************************************************************************************************************/
#include <iprt/heap.h>
#include <iprt/initterm.h>
#include <iprt/err.h>
diff --git a/src/VBox/Runtime/testcase/tstRTHttp.cpp b/src/VBox/Runtime/testcase/tstRTHttp.cpp
index a722b30..79469dc 100644
--- a/src/VBox/Runtime/testcase/tstRTHttp.cpp
+++ b/src/VBox/Runtime/testcase/tstRTHttp.cpp
@@ -24,21 +24,25 @@
* terms and conditions of either the GPL or the CDDL or both.
*/
-/*******************************************************************************
-* Header Files *
-*******************************************************************************/
-#include <iprt/err.h>
+
+/*********************************************************************************************************************************
+* Header Files *
+*********************************************************************************************************************************/
#include <iprt/http.h>
-#include <iprt/mem.h>
+
+#include <iprt/err.h>
#include <iprt/file.h>
+#include <iprt/initterm.h>
+#include <iprt/mem.h>
+#include <iprt/message.h>
#include <iprt/stream.h>
#include <iprt/string.h>
-#include <iprt/initterm.h>
#include <iprt/vfslowlevel.h>
#include <iprt/zip.h>
#define CAFILE_NAME "tstHttp-tempcafile.crt"
+#if 0
static int extractPCA3G5(RTHTTP hHttp, PRTSTREAM CAFile, uint8_t *pu8Buf, size_t cbBuf)
{
uint8_t *abSha1;
@@ -186,6 +190,7 @@ static void checkError(RTHTTP hHttp, int rc, const char *pszFile)
else
RTPrintf("Error %Rrc trying to fetch '%s'\n", rc, pszFile);
}
+#endif
int main(int argc, char **argv)
{
@@ -199,6 +204,8 @@ int main(int argc, char **argv)
return 1;
}
+#if 0 /* rewrite to modified API and use test.h! */
+
for (int i = 1; i < argc; i++)
{
if (!strcmp(argv[i], "default"))
@@ -341,4 +348,9 @@ int main(int argc, char **argv)
// RTFileDelete(CAFILE_NAME);
return !!cErrors;
+#else
+ RTMsgError("Needs rewriting. You're better off debugging the actual code in the GUI!\n");
+ return RTEXITCODE_SKIPPED;
+#endif
}
+
diff --git a/src/VBox/Runtime/testcase/tstRTInlineAsm.cpp b/src/VBox/Runtime/testcase/tstRTInlineAsm.cpp
index 67ab696..0f735cc 100644
--- a/src/VBox/Runtime/testcase/tstRTInlineAsm.cpp
+++ b/src/VBox/Runtime/testcase/tstRTInlineAsm.cpp
@@ -24,9 +24,10 @@
* terms and conditions of either the GPL or the CDDL or both.
*/
-/*******************************************************************************
-* Header Files *
-*******************************************************************************/
+
+/*********************************************************************************************************************************
+* Header Files *
+*********************************************************************************************************************************/
#include <iprt/asm.h>
#include <iprt/asm-math.h>
@@ -54,9 +55,9 @@
-/*******************************************************************************
-* Defined Constants And Macros *
-*******************************************************************************/
+/*********************************************************************************************************************************
+* Defined Constants And Macros *
+*********************************************************************************************************************************/
#define CHECKVAL(val, expect, fmt) \
do \
{ \
@@ -98,9 +99,9 @@
} while (0)
-/*******************************************************************************
-* Global Variables *
-*******************************************************************************/
+/*********************************************************************************************************************************
+* Global Variables *
+*********************************************************************************************************************************/
/** The test instance. */
static RTTEST g_hTest;
diff --git a/src/VBox/Runtime/testcase/tstRTLdrVerifyPeImage.cpp b/src/VBox/Runtime/testcase/tstRTLdrVerifyPeImage.cpp
index b0b68c3..43f08cf 100644
--- a/src/VBox/Runtime/testcase/tstRTLdrVerifyPeImage.cpp
+++ b/src/VBox/Runtime/testcase/tstRTLdrVerifyPeImage.cpp
@@ -25,9 +25,9 @@
*/
-/*******************************************************************************
-* Header Files *
-*******************************************************************************/
+/*********************************************************************************************************************************
+* Header Files *
+*********************************************************************************************************************************/
#include <iprt/test.h>
#include <iprt/mem.h>
#include <iprt/ldr.h>
@@ -36,9 +36,9 @@
#include <iprt/string.h>
-/*******************************************************************************
-* Global Variables *
-*******************************************************************************/
+/*********************************************************************************************************************************
+* Global Variables *
+*********************************************************************************************************************************/
static int g_iDummy = 0;
static DECLCALLBACK(int) TestCallback(RTLDRMOD hLdrMod, RTLDRSIGNATURETYPE enmSignature,
diff --git a/src/VBox/Runtime/testcase/tstRTList.cpp b/src/VBox/Runtime/testcase/tstRTList.cpp
index 54d3b72..02f3f1a 100644
--- a/src/VBox/Runtime/testcase/tstRTList.cpp
+++ b/src/VBox/Runtime/testcase/tstRTList.cpp
@@ -25,9 +25,9 @@
*/
-/*******************************************************************************
-* Header Files *
-*******************************************************************************/
+/*********************************************************************************************************************************
+* Header Files *
+*********************************************************************************************************************************/
#include <iprt/list.h>
#include <iprt/err.h>
@@ -36,9 +36,9 @@
#include <iprt/test.h>
-/*******************************************************************************
-* Structures and Typedefs *
-*******************************************************************************/
+/*********************************************************************************************************************************
+* Structures and Typedefs *
+*********************************************************************************************************************************/
typedef struct LISTELEM
{
/** Test data */
diff --git a/src/VBox/Runtime/testcase/tstRTLocalIpc.cpp b/src/VBox/Runtime/testcase/tstRTLocalIpc.cpp
index 56a7ecc..8f48f6a 100644
--- a/src/VBox/Runtime/testcase/tstRTLocalIpc.cpp
+++ b/src/VBox/Runtime/testcase/tstRTLocalIpc.cpp
@@ -25,9 +25,9 @@
*/
-/*******************************************************************************
-* Header Files *
-*******************************************************************************/
+/*********************************************************************************************************************************
+* Header Files *
+*********************************************************************************************************************************/
#include <iprt/env.h>
#include <iprt/localipc.h>
#include <iprt/mem.h>
diff --git a/src/VBox/Runtime/testcase/tstRTLockValidator.cpp b/src/VBox/Runtime/testcase/tstRTLockValidator.cpp
index c899213..dea8a2f 100644
--- a/src/VBox/Runtime/testcase/tstRTLockValidator.cpp
+++ b/src/VBox/Runtime/testcase/tstRTLockValidator.cpp
@@ -25,9 +25,9 @@
*/
-/*******************************************************************************
-* Header Files *
-*******************************************************************************/
+/*********************************************************************************************************************************
+* Header Files *
+*********************************************************************************************************************************/
#include <iprt/lockvalidator.h>
#include <iprt/asm.h> /* for return addresses */
@@ -39,9 +39,9 @@
#include <iprt/time.h>
-/*******************************************************************************
-* Defined Constants And Macros *
-*******************************************************************************/
+/*********************************************************************************************************************************
+* Defined Constants And Macros *
+*********************************************************************************************************************************/
#define SECS_SIMPLE_TEST 1
#define SECS_RACE_TEST 3
#define TEST_SMALL_TIMEOUT ( 10*1000)
@@ -49,9 +49,9 @@
#define TEST_DEBUG_TIMEOUT (3600*1000)
-/*******************************************************************************
-* Global Variables *
-*******************************************************************************/
+/*********************************************************************************************************************************
+* Global Variables *
+*********************************************************************************************************************************/
/** The testcase handle. */
static RTTEST g_hTest;
/** Flip this in the debugger to get some peace to single step wild code. */
diff --git a/src/VBox/Runtime/testcase/tstRTManifest.cpp b/src/VBox/Runtime/testcase/tstRTManifest.cpp
index b402fba..91209a8 100644
--- a/src/VBox/Runtime/testcase/tstRTManifest.cpp
+++ b/src/VBox/Runtime/testcase/tstRTManifest.cpp
@@ -24,9 +24,10 @@
* terms and conditions of either the GPL or the CDDL or both.
*/
-/*******************************************************************************
-* Header Files *
-*******************************************************************************/
+
+/*********************************************************************************************************************************
+* Header Files *
+*********************************************************************************************************************************/
#include <iprt/manifest.h>
#include <iprt/string.h>
diff --git a/src/VBox/Runtime/testcase/tstRTMemCache.cpp b/src/VBox/Runtime/testcase/tstRTMemCache.cpp
index cd89177..46784b2 100644
--- a/src/VBox/Runtime/testcase/tstRTMemCache.cpp
+++ b/src/VBox/Runtime/testcase/tstRTMemCache.cpp
@@ -24,9 +24,10 @@
* terms and conditions of either the GPL or the CDDL or both.
*/
-/*******************************************************************************
-* Header Files *
-*******************************************************************************/
+
+/*********************************************************************************************************************************
+* Header Files *
+*********************************************************************************************************************************/
#include <iprt/memcache.h>
#include <iprt/asm.h>
@@ -42,9 +43,9 @@
#include <iprt/thread.h>
-/*******************************************************************************
-* Structures and Typedefs *
-*******************************************************************************/
+/*********************************************************************************************************************************
+* Structures and Typedefs *
+*********************************************************************************************************************************/
typedef struct TST3THREAD
{
RTTHREAD hThread;
@@ -55,9 +56,9 @@ typedef struct TST3THREAD
} TST3THREAD, *PTST3THREAD;
-/*******************************************************************************
-* Global Variables *
-*******************************************************************************/
+/*********************************************************************************************************************************
+* Global Variables *
+*********************************************************************************************************************************/
/** The test handle */
static RTTEST g_hTest;
/** Global mem cache handle for use in some of the testcases. */
diff --git a/src/VBox/Runtime/testcase/tstRTMemEf.cpp b/src/VBox/Runtime/testcase/tstRTMemEf.cpp
index 63ee641..1215e79 100644
--- a/src/VBox/Runtime/testcase/tstRTMemEf.cpp
+++ b/src/VBox/Runtime/testcase/tstRTMemEf.cpp
@@ -24,9 +24,10 @@
* terms and conditions of either the GPL or the CDDL or both.
*/
-/*******************************************************************************
-* Header Files *
-*******************************************************************************/
+
+/*********************************************************************************************************************************
+* Header Files *
+*********************************************************************************************************************************/
#include <iprt/mem.h>
#include <iprt/asm.h>
@@ -35,9 +36,9 @@
#include <iprt/string.h>
-/*******************************************************************************
-* Global Variables *
-*******************************************************************************/
+/*********************************************************************************************************************************
+* Global Variables *
+*********************************************************************************************************************************/
static unsigned g_cErrors = 0;
diff --git a/src/VBox/Runtime/testcase/tstRTMemPool.cpp b/src/VBox/Runtime/testcase/tstRTMemPool.cpp
index 7468abb..63a6ad3 100644
--- a/src/VBox/Runtime/testcase/tstRTMemPool.cpp
+++ b/src/VBox/Runtime/testcase/tstRTMemPool.cpp
@@ -24,9 +24,10 @@
* terms and conditions of either the GPL or the CDDL or both.
*/
-/*******************************************************************************
-* Header Files *
-*******************************************************************************/
+
+/*********************************************************************************************************************************
+* Header Files *
+*********************************************************************************************************************************/
#include <iprt/mempool.h>
#include <iprt/asm.h>
@@ -38,9 +39,9 @@
#include <iprt/rand.h>
-/*******************************************************************************
-* Global Variables *
-*******************************************************************************/
+/*********************************************************************************************************************************
+* Global Variables *
+*********************************************************************************************************************************/
/** The test handle */
static RTTEST g_hTest;
/** Memory pool for tst4. */
diff --git a/src/VBox/Runtime/testcase/tstRTMemSafer.cpp b/src/VBox/Runtime/testcase/tstRTMemSafer.cpp
index 64e2a8b..4eb69f7 100644
--- a/src/VBox/Runtime/testcase/tstRTMemSafer.cpp
+++ b/src/VBox/Runtime/testcase/tstRTMemSafer.cpp
@@ -25,9 +25,9 @@
*/
-/*******************************************************************************
-* Header Files *
-*******************************************************************************/
+/*********************************************************************************************************************************
+* Header Files *
+*********************************************************************************************************************************/
#include <iprt/memsafer.h>
#include <iprt/asm.h>
diff --git a/src/VBox/Runtime/testcase/tstRTMemWipe.cpp b/src/VBox/Runtime/testcase/tstRTMemWipe.cpp
index ca088ce..6b1fb94 100644
--- a/src/VBox/Runtime/testcase/tstRTMemWipe.cpp
+++ b/src/VBox/Runtime/testcase/tstRTMemWipe.cpp
@@ -25,9 +25,9 @@
*/
-/*******************************************************************************
-* Header Files *
-*******************************************************************************/
+/*********************************************************************************************************************************
+* Header Files *
+*********************************************************************************************************************************/
#include <iprt/path.h>
#include <iprt/rand.h>
#include <iprt/string.h>
@@ -37,9 +37,9 @@
#include <iprt/test.h>
-/*******************************************************************************
-* Global Variables *
-*******************************************************************************/
+/*********************************************************************************************************************************
+* Global Variables *
+*********************************************************************************************************************************/
static void doMemWipeThoroughly(RTTEST hTest)
{
diff --git a/src/VBox/Runtime/testcase/tstRTMp-1.cpp b/src/VBox/Runtime/testcase/tstRTMp-1.cpp
index 3f326bf..610c53a 100644
--- a/src/VBox/Runtime/testcase/tstRTMp-1.cpp
+++ b/src/VBox/Runtime/testcase/tstRTMp-1.cpp
@@ -24,9 +24,10 @@
* terms and conditions of either the GPL or the CDDL or both.
*/
-/*******************************************************************************
-* Header Files *
-*******************************************************************************/
+
+/*********************************************************************************************************************************
+* Header Files *
+*********************************************************************************************************************************/
#include <iprt/mp.h>
#include <iprt/cpuset.h>
#include <iprt/err.h>
diff --git a/src/VBox/Runtime/testcase/tstRTNetIPv4.cpp b/src/VBox/Runtime/testcase/tstRTNetIPv4.cpp
index 00acbfd..34beab1 100644
--- a/src/VBox/Runtime/testcase/tstRTNetIPv4.cpp
+++ b/src/VBox/Runtime/testcase/tstRTNetIPv4.cpp
@@ -25,9 +25,9 @@
*/
-/*******************************************************************************
-* Header Files *
-*******************************************************************************/
+/*********************************************************************************************************************************
+* Header Files *
+*********************************************************************************************************************************/
#include <iprt/net.h>
#include <iprt/err.h>
@@ -35,9 +35,9 @@
#include <iprt/test.h>
-/*******************************************************************************
-* Defined Constants And Macros *
-*******************************************************************************/
+/*********************************************************************************************************************************
+* Defined Constants And Macros *
+*********************************************************************************************************************************/
#define CHECKADDR(String, rcExpected, ExpectedAddr) \
do { \
RTNETADDRIPV4 Addr; \
diff --git a/src/VBox/Runtime/testcase/tstRTNetIPv6.cpp b/src/VBox/Runtime/testcase/tstRTNetIPv6.cpp
index a023827..1c86750 100644
--- a/src/VBox/Runtime/testcase/tstRTNetIPv6.cpp
+++ b/src/VBox/Runtime/testcase/tstRTNetIPv6.cpp
@@ -25,9 +25,9 @@
*/
-/*******************************************************************************
-* Header Files *
-*******************************************************************************/
+/*********************************************************************************************************************************
+* Header Files *
+*********************************************************************************************************************************/
#include <iprt/net.h>
#include <iprt/err.h>
@@ -36,9 +36,10 @@
#include <iprt/string.h>
-/*******************************************************************************
-* Defined Constants And Macros *
-*******************************************************************************/
+
+/*********************************************************************************************************************************
+* Defined Constants And Macros *
+*********************************************************************************************************************************/
#define CHECKADDR(String, rcExpected, u32_0, u32_1, u32_2, u32_3) \
do { \
RTNETADDRIPV6 Addr; \
diff --git a/src/VBox/Runtime/testcase/tstRTPath.cpp b/src/VBox/Runtime/testcase/tstRTPath.cpp
index e1056cd..48f0e71 100644
--- a/src/VBox/Runtime/testcase/tstRTPath.cpp
+++ b/src/VBox/Runtime/testcase/tstRTPath.cpp
@@ -24,9 +24,10 @@
* terms and conditions of either the GPL or the CDDL or both.
*/
-/*******************************************************************************
-* Header Files *
-*******************************************************************************/
+
+/*********************************************************************************************************************************
+* Header Files *
+*********************************************************************************************************************************/
#include <iprt/path.h>
#include <iprt/err.h>
diff --git a/src/VBox/Runtime/testcase/tstRTZip.cpp b/src/VBox/Runtime/testcase/tstRTPathGlob.cpp
similarity index 52%
copy from src/VBox/Runtime/testcase/tstRTZip.cpp
copy to src/VBox/Runtime/testcase/tstRTPathGlob.cpp
index d050cef..916efc5 100644
--- a/src/VBox/Runtime/testcase/tstRTZip.cpp
+++ b/src/VBox/Runtime/testcase/tstRTPathGlob.cpp
@@ -1,10 +1,10 @@
-/* $Id: tstRTZip.cpp $ */
+/* $Id: tstRTPathGlob.cpp $ */
/** @file
- * IPRT Testcase - RTZip, kind of.
+ * IPRT Testcase - Manual RTPathGlob test.
*/
/*
- * Copyright (C) 2010-2015 Oracle Corporation
+ * Copyright (C) 2006-2015 Oracle Corporation
*
* This file is part of VirtualBox Open Source Edition (OSE), as
* available from http://www.virtualbox.org. This file is free software;
@@ -25,63 +25,58 @@
*/
-/*******************************************************************************
-* Header Files *
-*******************************************************************************/
-#include <iprt/zip.h>
+/*********************************************************************************************************************************
+* Header Files *
+*********************************************************************************************************************************/
+#include <iprt/path.h>
-#include <iprt/env.h>
#include <iprt/err.h>
-#include <iprt/initterm.h>
-#include <iprt/file.h>
-#include <iprt/mem.h>
-#include <iprt/message.h>
-#include <iprt/param.h>
#include <iprt/string.h>
#include <iprt/test.h>
-static void testFile(const char *pszFilename)
-{
- size_t cbSrcActually = 0;
- void *pvSrc;
- size_t cbSrc;
- int rc = RTFileReadAll(pszFilename, &pvSrc, &cbSrc);
- RTTESTI_CHECK_RC_OK_RETV(rc);
-
- size_t cbDstActually = 0;
- size_t cbDst = RT_MAX(cbSrc * 8, _1M);
- void *pvDst = RTMemAllocZ(cbDst);
-
- rc = RTZipBlockDecompress(RTZIPTYPE_ZLIB, 0, pvSrc, cbSrc, &cbSrcActually, pvDst, cbDst, &cbDstActually);
- RTTestIPrintf(RTTESTLVL_ALWAYS, "cbSrc=%zu cbSrcActually=%zu cbDst=%zu cbDstActually=%zu rc=%Rrc\n",
- cbSrc, cbSrcActually, cbDst, cbDstActually, rc);
- RTTESTI_CHECK_RC_OK(rc);
-
-}
-
-
int main(int argc, char **argv)
{
+ /*
+ * Init RT+Test.
+ */
RTTEST hTest;
- int rc = RTTestInitAndCreate("tstRTZip", &hTest);
+ int rc = RTTestInitExAndCreate(argc, &argv, 0, "tstRTPathGlob", &hTest);
if (rc)
return rc;
RTTestBanner(hTest);
- if (argc > 1)
- {
- for (int i = 1; i < argc; i++)
- testFile(argv[i]);
- }
- else
+ if (argc <= 1)
+ return RTTestSkipAndDestroy(hTest, "Requires arguments");
+
+
+ /*
+ * Manual glob testing.
+ */
+ for (int i = 1; i < argc; i++)
{
- /** @todo testcase */
+ uint32_t cResults = UINT32_MAX;
+ PCRTPATHGLOBENTRY pHead = (PCRTPATHGLOBENTRY)&cResults;
+ rc = RTPathGlob(argv[i], 0, &pHead, &cResults);
+ RTTestPrintf(hTest, RTTESTLVL_ALWAYS, "#%u '%s' -> %Rrc cResult=%u\n", i, argv[i], rc, cResults);
+ if (RT_SUCCESS(rc))
+ {
+ uint32_t iEntry = 0;
+ for (PCRTPATHGLOBENTRY pCur = pHead; pCur; pCur = pCur->pNext, iEntry++)
+ {
+ RTTestPrintf(hTest, RTTESTLVL_ALWAYS, " #%3u: '%s'\n", iEntry, pCur->szPath);
+ RTTEST_CHECK(hTest, strlen(pCur->szPath) == pCur->cchPath);
+ }
+
+ RTPathGlobFree(pHead);
+ }
}
+
/*
* Summary.
*/
return RTTestSummaryAndDestroy(hTest);
}
+
diff --git a/src/VBox/Runtime/testcase/tstRTPipe.cpp b/src/VBox/Runtime/testcase/tstRTPipe.cpp
index 35e1568..845f57f 100644
--- a/src/VBox/Runtime/testcase/tstRTPipe.cpp
+++ b/src/VBox/Runtime/testcase/tstRTPipe.cpp
@@ -25,9 +25,9 @@
*/
-/*******************************************************************************
-* Header Files *
-*******************************************************************************/
+/*********************************************************************************************************************************
+* Header Files *
+*********************************************************************************************************************************/
#include <iprt/pipe.h>
#include <iprt/env.h>
@@ -41,9 +41,9 @@
#include <iprt/test.h>
-/*******************************************************************************
-* Global Variables *
-*******************************************************************************/
+/*********************************************************************************************************************************
+* Global Variables *
+*********************************************************************************************************************************/
static const char g_szTest4Message[] = "This is test #4, everything is working fine.\n\r";
static const char g_szTest5Message[] = "This is test #5, everything is working fine.\n\r";
diff --git a/src/VBox/Runtime/testcase/tstRTPoll.cpp b/src/VBox/Runtime/testcase/tstRTPoll.cpp
index 2249fc7..da916b1 100644
--- a/src/VBox/Runtime/testcase/tstRTPoll.cpp
+++ b/src/VBox/Runtime/testcase/tstRTPoll.cpp
@@ -25,9 +25,9 @@
*/
-/*******************************************************************************
-* Header Files *
-*******************************************************************************/
+/*********************************************************************************************************************************
+* Header Files *
+*********************************************************************************************************************************/
#include <iprt/poll.h>
#include <iprt/err.h>
diff --git a/src/VBox/Runtime/testcase/tstRTPrfIO.cpp b/src/VBox/Runtime/testcase/tstRTPrfIO.cpp
index b4c3edc..8a649e3 100644
--- a/src/VBox/Runtime/testcase/tstRTPrfIO.cpp
+++ b/src/VBox/Runtime/testcase/tstRTPrfIO.cpp
@@ -25,9 +25,9 @@
*/
-/*******************************************************************************
-* Header Files *
-*******************************************************************************/
+/*********************************************************************************************************************************
+* Header Files *
+*********************************************************************************************************************************/
#include <iprt/file.h>
#include <iprt/dir.h>
#include <iprt/fs.h>
@@ -40,9 +40,9 @@
#include <iprt/time.h>
-/*******************************************************************************
-* Global Variables *
-*******************************************************************************/
+/*********************************************************************************************************************************
+* Global Variables *
+*********************************************************************************************************************************/
/** The test instance handle. */
static RTTEST g_hTest;
/** The max number of nanoseconds to benchmark an operation. */
@@ -65,9 +65,9 @@ static char g_szNotExitingDir[RTPATH_MAX];
static char g_szNotExitingDirFile[RTPATH_MAX];
-/*******************************************************************************
-* Defined Constants And Macros *
-*******************************************************************************/
+/*********************************************************************************************************************************
+* Defined Constants And Macros *
+*********************************************************************************************************************************/
/**
* Benchmark an operation.
@@ -210,7 +210,7 @@ int main(int argc, char **argv)
break;
case 'V':
- RTTestPrintf(g_hTest, RTTESTLVL_ALWAYS, "$Revision: 100874 $\n");
+ RTTestPrintf(g_hTest, RTTESTLVL_ALWAYS, "$Revision: 102121 $\n");
return RTTestSummaryAndDestroy(g_hTest);
case 'h':
diff --git a/src/VBox/Runtime/testcase/tstRTProcCreateEx.cpp b/src/VBox/Runtime/testcase/tstRTProcCreateEx.cpp
index 89fef57..220666c 100644
--- a/src/VBox/Runtime/testcase/tstRTProcCreateEx.cpp
+++ b/src/VBox/Runtime/testcase/tstRTProcCreateEx.cpp
@@ -25,9 +25,9 @@
*/
-/*******************************************************************************
-* Header Files *
-*******************************************************************************/
+/*********************************************************************************************************************************
+* Header Files *
+*********************************************************************************************************************************/
#include <iprt/process.h>
#include <iprt/assert.h>
@@ -49,9 +49,10 @@
# include <Security.h>
#endif
-/*******************************************************************************
-* Global Variables *
-*******************************************************************************/
+
+/*********************************************************************************************************************************
+* Global Variables *
+*********************************************************************************************************************************/
static char g_szExecName[RTPATH_MAX];
diff --git a/src/VBox/Runtime/testcase/tstRTProcCreatePrf.cpp b/src/VBox/Runtime/testcase/tstRTProcCreatePrf.cpp
index 2e746ee..ca0aeb0 100644
--- a/src/VBox/Runtime/testcase/tstRTProcCreatePrf.cpp
+++ b/src/VBox/Runtime/testcase/tstRTProcCreatePrf.cpp
@@ -25,9 +25,9 @@
*/
-/*******************************************************************************
-* Header Files *
-*******************************************************************************/
+/*********************************************************************************************************************************
+* Header Files *
+*********************************************************************************************************************************/
#include <iprt/process.h>
#include <iprt/test.h>
#include <iprt/time.h>
diff --git a/src/VBox/Runtime/testcase/tstRTProcIsRunningByName.cpp b/src/VBox/Runtime/testcase/tstRTProcIsRunningByName.cpp
index 64be70b..2da8166 100644
--- a/src/VBox/Runtime/testcase/tstRTProcIsRunningByName.cpp
+++ b/src/VBox/Runtime/testcase/tstRTProcIsRunningByName.cpp
@@ -24,9 +24,10 @@
* terms and conditions of either the GPL or the CDDL or both.
*/
-/*******************************************************************************
-* Header Files *
-*******************************************************************************/
+
+/*********************************************************************************************************************************
+* Header Files *
+*********************************************************************************************************************************/
#include <iprt/process.h>
#include <iprt/initterm.h>
#include <iprt/stream.h>
diff --git a/src/VBox/Runtime/testcase/tstRTProcQueryUsername.cpp b/src/VBox/Runtime/testcase/tstRTProcQueryUsername.cpp
index ba47025..fd26d3b 100644
--- a/src/VBox/Runtime/testcase/tstRTProcQueryUsername.cpp
+++ b/src/VBox/Runtime/testcase/tstRTProcQueryUsername.cpp
@@ -25,9 +25,9 @@
*/
-/*******************************************************************************
-* Header Files *
-*******************************************************************************/
+/*********************************************************************************************************************************
+* Header Files *
+*********************************************************************************************************************************/
#include <iprt/initterm.h>
#include <iprt/err.h>
#include <iprt/string.h>
diff --git a/src/VBox/Runtime/testcase/tstRTProcWait.cpp b/src/VBox/Runtime/testcase/tstRTProcWait.cpp
index 8a0bedf..bd1740b 100644
--- a/src/VBox/Runtime/testcase/tstRTProcWait.cpp
+++ b/src/VBox/Runtime/testcase/tstRTProcWait.cpp
@@ -25,9 +25,9 @@
*/
-/*******************************************************************************
-* Header Files *
-*******************************************************************************/
+/*********************************************************************************************************************************
+* Header Files *
+*********************************************************************************************************************************/
#include <iprt/initterm.h>
#include <iprt/process.h>
#include <iprt/thread.h>
diff --git a/src/VBox/Runtime/testcase/tstRTR0DbgKrnlInfo.cpp b/src/VBox/Runtime/testcase/tstRTR0DbgKrnlInfo.cpp
index 8867938..04cfe42 100644
--- a/src/VBox/Runtime/testcase/tstRTR0DbgKrnlInfo.cpp
+++ b/src/VBox/Runtime/testcase/tstRTR0DbgKrnlInfo.cpp
@@ -24,9 +24,10 @@
* terms and conditions of either the GPL or the CDDL or both.
*/
-/*******************************************************************************
-* Header Files *
-*******************************************************************************/
+
+/*********************************************************************************************************************************
+* Header Files *
+*********************************************************************************************************************************/
#include <iprt/thread.h>
#include <iprt/asm-amd64-x86.h>
diff --git a/src/VBox/Runtime/testcase/tstRTR0DbgKrnlInfoDriver.cpp b/src/VBox/Runtime/testcase/tstRTR0DbgKrnlInfoDriver.cpp
index 61c6606..5bb4ef7 100644
--- a/src/VBox/Runtime/testcase/tstRTR0DbgKrnlInfoDriver.cpp
+++ b/src/VBox/Runtime/testcase/tstRTR0DbgKrnlInfoDriver.cpp
@@ -24,9 +24,10 @@
* terms and conditions of either the GPL or the CDDL or both.
*/
-/*******************************************************************************
-* Header Files *
-*******************************************************************************/
+
+/*********************************************************************************************************************************
+* Header Files *
+*********************************************************************************************************************************/
#include <iprt/initterm.h>
#include <iprt/err.h>
diff --git a/src/VBox/Runtime/testcase/tstRTR0MemUserKernel.cpp b/src/VBox/Runtime/testcase/tstRTR0MemUserKernel.cpp
index 4327893..e5c7a7b 100644
--- a/src/VBox/Runtime/testcase/tstRTR0MemUserKernel.cpp
+++ b/src/VBox/Runtime/testcase/tstRTR0MemUserKernel.cpp
@@ -24,9 +24,10 @@
* terms and conditions of either the GPL or the CDDL or both.
*/
-/*******************************************************************************
-* Header Files *
-*******************************************************************************/
+
+/*********************************************************************************************************************************
+* Header Files *
+*********************************************************************************************************************************/
#include <iprt/mem.h>
#include <iprt/err.h>
diff --git a/src/VBox/Runtime/testcase/tstRTR0MemUserKernelDriver.cpp b/src/VBox/Runtime/testcase/tstRTR0MemUserKernelDriver.cpp
index 3c7a815..60b0c9c 100644
--- a/src/VBox/Runtime/testcase/tstRTR0MemUserKernelDriver.cpp
+++ b/src/VBox/Runtime/testcase/tstRTR0MemUserKernelDriver.cpp
@@ -24,9 +24,10 @@
* terms and conditions of either the GPL or the CDDL or both.
*/
-/*******************************************************************************
-* Header Files *
-*******************************************************************************/
+
+/*********************************************************************************************************************************
+* Header Files *
+*********************************************************************************************************************************/
#include <iprt/initterm.h>
#include <iprt/err.h>
diff --git a/src/VBox/Runtime/testcase/tstRTR0SemMutex.cpp b/src/VBox/Runtime/testcase/tstRTR0SemMutex.cpp
index cf54059..193dd2a 100644
--- a/src/VBox/Runtime/testcase/tstRTR0SemMutex.cpp
+++ b/src/VBox/Runtime/testcase/tstRTR0SemMutex.cpp
@@ -24,9 +24,10 @@
* terms and conditions of either the GPL or the CDDL or both.
*/
-/*******************************************************************************
-* Header Files *
-*******************************************************************************/
+
+/*********************************************************************************************************************************
+* Header Files *
+*********************************************************************************************************************************/
#include <iprt/semaphore.h>
#include <iprt/err.h>
@@ -37,9 +38,9 @@
#include "tstRTR0SemMutex.h"
-/*******************************************************************************
-* Global Variables *
-*******************************************************************************/
+/*********************************************************************************************************************************
+* Global Variables *
+*********************************************************************************************************************************/
/** The mutex used in test #2. */
static RTSEMMUTEX g_hMtxTest2 = NIL_RTSEMMUTEX;
diff --git a/src/VBox/Runtime/testcase/tstRTR0SemMutexDriver.cpp b/src/VBox/Runtime/testcase/tstRTR0SemMutexDriver.cpp
index 6b6eb3a..b0a802c 100644
--- a/src/VBox/Runtime/testcase/tstRTR0SemMutexDriver.cpp
+++ b/src/VBox/Runtime/testcase/tstRTR0SemMutexDriver.cpp
@@ -24,9 +24,10 @@
* terms and conditions of either the GPL or the CDDL or both.
*/
-/*******************************************************************************
-* Header Files *
-*******************************************************************************/
+
+/*********************************************************************************************************************************
+* Header Files *
+*********************************************************************************************************************************/
#include <iprt/initterm.h>
#include <iprt/err.h>
@@ -41,9 +42,10 @@
# include "tstRTR0SemMutex.h"
#endif
-/*******************************************************************************
-* Structures and Typedefs *
-*******************************************************************************/
+
+/*********************************************************************************************************************************
+* Structures and Typedefs *
+*********************************************************************************************************************************/
typedef struct TSTRTR0SEMMUTEXREQ
{
SUPR0SERVICEREQHDR Hdr;
@@ -52,9 +54,9 @@ typedef struct TSTRTR0SEMMUTEXREQ
typedef TSTRTR0SEMMUTEXREQ *PTSTRTR0SEMMUTEXREQ;
-/*******************************************************************************
-* Global Variables *
-*******************************************************************************/
+/*********************************************************************************************************************************
+* Global Variables *
+*********************************************************************************************************************************/
static RTTEST g_hTest;
diff --git a/src/VBox/Runtime/testcase/tstRTR0Thread.cpp b/src/VBox/Runtime/testcase/tstRTR0Thread.cpp
index beebef0..4dedc80 100644
--- a/src/VBox/Runtime/testcase/tstRTR0Thread.cpp
+++ b/src/VBox/Runtime/testcase/tstRTR0Thread.cpp
@@ -24,9 +24,10 @@
* terms and conditions of either the GPL or the CDDL or both.
*/
-/*******************************************************************************
-* Header Files *
-*******************************************************************************/
+
+/*********************************************************************************************************************************
+* Header Files *
+*********************************************************************************************************************************/
#include <iprt/thread.h>
#include <iprt/asm-amd64-x86.h>
diff --git a/src/VBox/Runtime/testcase/tstRTR0ThreadDriver.cpp b/src/VBox/Runtime/testcase/tstRTR0ThreadDriver.cpp
index b190c1d..452aab8 100644
--- a/src/VBox/Runtime/testcase/tstRTR0ThreadDriver.cpp
+++ b/src/VBox/Runtime/testcase/tstRTR0ThreadDriver.cpp
@@ -24,9 +24,10 @@
* terms and conditions of either the GPL or the CDDL or both.
*/
-/*******************************************************************************
-* Header Files *
-*******************************************************************************/
+
+/*********************************************************************************************************************************
+* Header Files *
+*********************************************************************************************************************************/
#include <iprt/initterm.h>
#include <iprt/err.h>
diff --git a/src/VBox/Runtime/testcase/tstRTR0ThreadPreemption.cpp b/src/VBox/Runtime/testcase/tstRTR0ThreadPreemption.cpp
index fe79b1f..36fdc3d 100644
--- a/src/VBox/Runtime/testcase/tstRTR0ThreadPreemption.cpp
+++ b/src/VBox/Runtime/testcase/tstRTR0ThreadPreemption.cpp
@@ -24,9 +24,10 @@
* terms and conditions of either the GPL or the CDDL or both.
*/
-/*******************************************************************************
-* Header Files *
-*******************************************************************************/
+
+/*********************************************************************************************************************************
+* Header Files *
+*********************************************************************************************************************************/
#include <iprt/thread.h>
#include <iprt/asm-amd64-x86.h>
diff --git a/src/VBox/Runtime/testcase/tstRTR0ThreadPreemptionDriver.cpp b/src/VBox/Runtime/testcase/tstRTR0ThreadPreemptionDriver.cpp
index cfb9377..846de02 100644
--- a/src/VBox/Runtime/testcase/tstRTR0ThreadPreemptionDriver.cpp
+++ b/src/VBox/Runtime/testcase/tstRTR0ThreadPreemptionDriver.cpp
@@ -24,9 +24,10 @@
* terms and conditions of either the GPL or the CDDL or both.
*/
-/*******************************************************************************
-* Header Files *
-*******************************************************************************/
+
+/*********************************************************************************************************************************
+* Header Files *
+*********************************************************************************************************************************/
#include <iprt/initterm.h>
#include <iprt/asm.h>
@@ -44,9 +45,10 @@
# include "tstRTR0ThreadPreemption.h"
#endif
-/*******************************************************************************
-* Global Variables *
-*******************************************************************************/
+
+/*********************************************************************************************************************************
+* Global Variables *
+*********************************************************************************************************************************/
static bool volatile g_fTerminate = false;
diff --git a/src/VBox/Runtime/testcase/tstRTR0Timer.cpp b/src/VBox/Runtime/testcase/tstRTR0Timer.cpp
index 5affc65..af1d18e 100644
--- a/src/VBox/Runtime/testcase/tstRTR0Timer.cpp
+++ b/src/VBox/Runtime/testcase/tstRTR0Timer.cpp
@@ -25,9 +25,9 @@
*/
-/*******************************************************************************
-* Header Files *
-*******************************************************************************/
+/*********************************************************************************************************************************
+* Header Files *
+*********************************************************************************************************************************/
#include <iprt/timer.h>
#include <iprt/asm.h>
@@ -45,9 +45,9 @@
#include "tstRTR0Common.h"
-/*******************************************************************************
-* Structures and Typedefs *
-*******************************************************************************/
+/*********************************************************************************************************************************
+* Structures and Typedefs *
+*********************************************************************************************************************************/
typedef struct
{
/** Array of nano second timestamp of the first few shots. */
@@ -108,9 +108,9 @@ typedef struct TSTRTR0TIMEROMNI1
typedef TSTRTR0TIMEROMNI1 *PTSTRTR0TIMEROMNI1;
-/*******************************************************************************
-* Global Variables *
-*******************************************************************************/
+/*********************************************************************************************************************************
+* Global Variables *
+*********************************************************************************************************************************/
/**
* Latency data.
*/
diff --git a/src/VBox/Runtime/testcase/tstRTR0TimerDriver.cpp b/src/VBox/Runtime/testcase/tstRTR0TimerDriver.cpp
index 549695d..ded7837 100644
--- a/src/VBox/Runtime/testcase/tstRTR0TimerDriver.cpp
+++ b/src/VBox/Runtime/testcase/tstRTR0TimerDriver.cpp
@@ -24,9 +24,10 @@
* terms and conditions of either the GPL or the CDDL or both.
*/
-/*******************************************************************************
-* Header Files *
-*******************************************************************************/
+
+/*********************************************************************************************************************************
+* Header Files *
+*********************************************************************************************************************************/
#include <iprt/initterm.h>
#include <iprt/err.h>
diff --git a/src/VBox/Runtime/testcase/tstRTReqPool.cpp b/src/VBox/Runtime/testcase/tstRTReqPool.cpp
index 999a9ea..e1a8e96 100644
--- a/src/VBox/Runtime/testcase/tstRTReqPool.cpp
+++ b/src/VBox/Runtime/testcase/tstRTReqPool.cpp
@@ -25,9 +25,9 @@
*/
-/*******************************************************************************
-* Header Files *
-*******************************************************************************/
+/*********************************************************************************************************************************
+* Header Files *
+*********************************************************************************************************************************/
#include <iprt/req.h>
#include <iprt/err.h>
@@ -37,9 +37,9 @@
-/*******************************************************************************
-* Global Variables *
-*******************************************************************************/
+/*********************************************************************************************************************************
+* Global Variables *
+*********************************************************************************************************************************/
static RTTEST g_hTest = NIL_RTTEST;
diff --git a/src/VBox/Runtime/testcase/tstRTS3.cpp b/src/VBox/Runtime/testcase/tstRTS3.cpp
index 7d773e7..b02e8e3 100644
--- a/src/VBox/Runtime/testcase/tstRTS3.cpp
+++ b/src/VBox/Runtime/testcase/tstRTS3.cpp
@@ -25,9 +25,9 @@
*/
-/*******************************************************************************
-* Header Files *
-*******************************************************************************/
+/*********************************************************************************************************************************
+* Header Files *
+*********************************************************************************************************************************/
#include <iprt/s3.h>
#include <iprt/stream.h>
#include <iprt/initterm.h>
@@ -35,9 +35,9 @@
#include <iprt/test.h>
-/*******************************************************************************
-* Defined Constants And Macros *
-*******************************************************************************/
+/*********************************************************************************************************************************
+* Defined Constants And Macros *
+*********************************************************************************************************************************/
/* Manual configuration of this testcase */
#define TSTS3_CREATEBUCKET
#define TSTS3_PUTGETKEY
@@ -55,7 +55,7 @@
# define TSTS3_PUTGETKEY_GETFILE "tstS3_fetched"
#endif /* TSTS3_PUTGETKEY */
-static int progress(unsigned uPercent, void *pvUser)
+static DECLCALLBACK(int) progress(unsigned uPercent, void *pvUser)
{
#ifdef TSTS3_SHOWPROGRESS
RTTestIPrintf(RTTESTLVL_ALWAYS, " Progress for %s - %d%% done.\n", (char*)pvUser, (int)uPercent);
diff --git a/src/VBox/Runtime/testcase/tstRTSemEventMulti.cpp b/src/VBox/Runtime/testcase/tstRTSemEventMulti.cpp
index 6f7312c..0c422cb 100644
--- a/src/VBox/Runtime/testcase/tstRTSemEventMulti.cpp
+++ b/src/VBox/Runtime/testcase/tstRTSemEventMulti.cpp
@@ -25,9 +25,9 @@
*/
-/*******************************************************************************
-* Header Files *
-*******************************************************************************/
+/*********************************************************************************************************************************
+* Header Files *
+*********************************************************************************************************************************/
#include <iprt/semaphore.h>
#include <iprt/asm.h>
@@ -40,9 +40,9 @@
#include <iprt/time.h>
-/*******************************************************************************
-* Global Variables *
-*******************************************************************************/
+/*********************************************************************************************************************************
+* Global Variables *
+*********************************************************************************************************************************/
/** The test handle. */
static RTTEST g_hTest;
diff --git a/src/VBox/Runtime/testcase/tstRTSemRW.cpp b/src/VBox/Runtime/testcase/tstRTSemRW.cpp
index 017cc7d..f99be4d 100644
--- a/src/VBox/Runtime/testcase/tstRTSemRW.cpp
+++ b/src/VBox/Runtime/testcase/tstRTSemRW.cpp
@@ -24,9 +24,10 @@
* terms and conditions of either the GPL or the CDDL or both.
*/
-/*******************************************************************************
-* Header Files *
-*******************************************************************************/
+
+/*********************************************************************************************************************************
+* Header Files *
+*********************************************************************************************************************************/
#include <iprt/semaphore.h>
#include <iprt/asm.h>
@@ -42,9 +43,9 @@
#include <iprt/thread.h>
-/*******************************************************************************
-* Global Variables *
-*******************************************************************************/
+/*********************************************************************************************************************************
+* Global Variables *
+*********************************************************************************************************************************/
static RTTEST g_hTest;
static RTSEMRW g_hSemRW = NIL_RTSEMRW;
static bool volatile g_fTerminate;
diff --git a/src/VBox/Runtime/testcase/tstRTSemXRoads.cpp b/src/VBox/Runtime/testcase/tstRTSemXRoads.cpp
index 11a8d58..9886c68 100644
--- a/src/VBox/Runtime/testcase/tstRTSemXRoads.cpp
+++ b/src/VBox/Runtime/testcase/tstRTSemXRoads.cpp
@@ -25,9 +25,9 @@
*/
-/*******************************************************************************
-* Header Files *
-*******************************************************************************/
+/*********************************************************************************************************************************
+* Header Files *
+*********************************************************************************************************************************/
#include <iprt/semaphore.h>
#include <iprt/asm.h>
@@ -38,9 +38,9 @@
#include <iprt/time.h>
-/*******************************************************************************
-* Global Variables *
-*******************************************************************************/
+/*********************************************************************************************************************************
+* Global Variables *
+*********************************************************************************************************************************/
static RTTEST g_hTest;
static uint32_t volatile g_cNSCrossings;
diff --git a/src/VBox/Runtime/testcase/tstRTSort.cpp b/src/VBox/Runtime/testcase/tstRTSort.cpp
index be7f38f..f1b6365 100644
--- a/src/VBox/Runtime/testcase/tstRTSort.cpp
+++ b/src/VBox/Runtime/testcase/tstRTSort.cpp
@@ -24,9 +24,10 @@
* terms and conditions of either the GPL or the CDDL or both.
*/
-/*******************************************************************************
-* Header Files *
-*******************************************************************************/
+
+/*********************************************************************************************************************************
+* Header Files *
+*********************************************************************************************************************************/
#include <iprt/sort.h>
#include <iprt/err.h>
@@ -35,9 +36,9 @@
#include <iprt/test.h>
-/*******************************************************************************
-* Structures and Typedefs *
-*******************************************************************************/
+/*********************************************************************************************************************************
+* Structures and Typedefs *
+*********************************************************************************************************************************/
typedef struct TSTRTSORTAPV
{
uint32_t aValues[8192];
diff --git a/src/VBox/Runtime/testcase/tstRTStrAlloc.cpp b/src/VBox/Runtime/testcase/tstRTStrAlloc.cpp
index 5b2c43e..72c3ff8 100644
--- a/src/VBox/Runtime/testcase/tstRTStrAlloc.cpp
+++ b/src/VBox/Runtime/testcase/tstRTStrAlloc.cpp
@@ -24,9 +24,10 @@
* terms and conditions of either the GPL or the CDDL or both.
*/
-/*******************************************************************************
-* Header Files *
-*******************************************************************************/
+
+/*********************************************************************************************************************************
+* Header Files *
+*********************************************************************************************************************************/
#include <iprt/string.h>
#include <iprt/asm.h>
diff --git a/src/VBox/Runtime/testcase/tstRTStrCache.cpp b/src/VBox/Runtime/testcase/tstRTStrCache.cpp
index 5b19d3f..1646611 100644
--- a/src/VBox/Runtime/testcase/tstRTStrCache.cpp
+++ b/src/VBox/Runtime/testcase/tstRTStrCache.cpp
@@ -24,9 +24,10 @@
* terms and conditions of either the GPL or the CDDL or both.
*/
-/*******************************************************************************
-* Header Files *
-*******************************************************************************/
+
+/*********************************************************************************************************************************
+* Header Files *
+*********************************************************************************************************************************/
#include <iprt/strcache.h>
#include <iprt/asm.h>
diff --git a/src/VBox/Runtime/testcase/tstRTStrCatCopy.cpp b/src/VBox/Runtime/testcase/tstRTStrCatCopy.cpp
index 6e1b6bf..02b85af 100644
--- a/src/VBox/Runtime/testcase/tstRTStrCatCopy.cpp
+++ b/src/VBox/Runtime/testcase/tstRTStrCatCopy.cpp
@@ -24,9 +24,10 @@
* terms and conditions of either the GPL or the CDDL or both.
*/
-/*******************************************************************************
-* Header Files *
-*******************************************************************************/
+
+/*********************************************************************************************************************************
+* Header Files *
+*********************************************************************************************************************************/
#include <iprt/string.h>
#include <iprt/test.h>
diff --git a/src/VBox/Runtime/testcase/tstRTStrFormat.cpp b/src/VBox/Runtime/testcase/tstRTStrFormat.cpp
index 32048a0..5d737dc 100644
--- a/src/VBox/Runtime/testcase/tstRTStrFormat.cpp
+++ b/src/VBox/Runtime/testcase/tstRTStrFormat.cpp
@@ -24,9 +24,10 @@
* terms and conditions of either the GPL or the CDDL or both.
*/
-/*******************************************************************************
-* Header Files *
-*******************************************************************************/
+
+/*********************************************************************************************************************************
+* Header Files *
+*********************************************************************************************************************************/
#include <iprt/string.h>
#include <iprt/initterm.h>
diff --git a/src/VBox/Runtime/testcase/tstRTStrVersion.cpp b/src/VBox/Runtime/testcase/tstRTStrVersion.cpp
index 1300b40..87e99eb 100644
--- a/src/VBox/Runtime/testcase/tstRTStrVersion.cpp
+++ b/src/VBox/Runtime/testcase/tstRTStrVersion.cpp
@@ -24,9 +24,10 @@
* terms and conditions of either the GPL or the CDDL or both.
*/
-/*******************************************************************************
-* Header Files *
-*******************************************************************************/
+
+/*********************************************************************************************************************************
+* Header Files *
+*********************************************************************************************************************************/
#include <iprt/string.h>
#include <iprt/test.h>
diff --git a/src/VBox/Runtime/testcase/tstRTSymlink.cpp b/src/VBox/Runtime/testcase/tstRTSymlink.cpp
index 909a7b4..2058cd8 100644
--- a/src/VBox/Runtime/testcase/tstRTSymlink.cpp
+++ b/src/VBox/Runtime/testcase/tstRTSymlink.cpp
@@ -25,9 +25,9 @@
*/
-/*******************************************************************************
-* Header Files *
-*******************************************************************************/
+/*********************************************************************************************************************************
+* Header Files *
+*********************************************************************************************************************************/
#include <iprt/symlink.h>
#include <iprt/test.h>
diff --git a/src/VBox/Runtime/testcase/tstRTSystemQueryDmi.cpp b/src/VBox/Runtime/testcase/tstRTSystemQueryDmi.cpp
index 8a02b05..aad04db 100644
--- a/src/VBox/Runtime/testcase/tstRTSystemQueryDmi.cpp
+++ b/src/VBox/Runtime/testcase/tstRTSystemQueryDmi.cpp
@@ -24,9 +24,10 @@
* terms and conditions of either the GPL or the CDDL or both.
*/
-/*******************************************************************************
-* Header Files *
-*******************************************************************************/
+
+/*********************************************************************************************************************************
+* Header Files *
+*********************************************************************************************************************************/
#include <iprt/system.h>
#include <iprt/assert.h>
diff --git a/src/VBox/Runtime/testcase/tstRTSystemQueryOsInfo.cpp b/src/VBox/Runtime/testcase/tstRTSystemQueryOsInfo.cpp
index 0406c44..2146748 100644
--- a/src/VBox/Runtime/testcase/tstRTSystemQueryOsInfo.cpp
+++ b/src/VBox/Runtime/testcase/tstRTSystemQueryOsInfo.cpp
@@ -24,9 +24,10 @@
* terms and conditions of either the GPL or the CDDL or both.
*/
-/*******************************************************************************
-* Header Files *
-*******************************************************************************/
+
+/*********************************************************************************************************************************
+* Header Files *
+*********************************************************************************************************************************/
#include <iprt/system.h>
#include <iprt/assert.h>
@@ -34,9 +35,9 @@
#include <iprt/test.h>
-/*******************************************************************************
-* Global Variables *
-*******************************************************************************/
+/*********************************************************************************************************************************
+* Global Variables *
+*********************************************************************************************************************************/
static int g_cErrors = 0;
diff --git a/src/VBox/Runtime/testcase/tstRTTcp-1.cpp b/src/VBox/Runtime/testcase/tstRTTcp-1.cpp
index fba5a89..7a2d183 100644
--- a/src/VBox/Runtime/testcase/tstRTTcp-1.cpp
+++ b/src/VBox/Runtime/testcase/tstRTTcp-1.cpp
@@ -31,9 +31,9 @@
#include <iprt/test.h>
-/*******************************************************************************
-* Global Variables *
-*******************************************************************************/
+/*********************************************************************************************************************************
+* Global Variables *
+*********************************************************************************************************************************/
static RTTEST g_hTest;
diff --git a/src/VBox/Runtime/testcase/tstRTTemp.cpp b/src/VBox/Runtime/testcase/tstRTTemp.cpp
index 36d813b..3e582de 100644
--- a/src/VBox/Runtime/testcase/tstRTTemp.cpp
+++ b/src/VBox/Runtime/testcase/tstRTTemp.cpp
@@ -24,9 +24,10 @@
* terms and conditions of either the GPL or the CDDL or both.
*/
-/*******************************************************************************
-* Header Files *
-*******************************************************************************/
+
+/*********************************************************************************************************************************
+* Header Files *
+*********************************************************************************************************************************/
#include <iprt/dir.h>
#include <iprt/file.h>
#include <iprt/path.h>
@@ -41,9 +42,9 @@
#include <iprt/test.h>
-/*******************************************************************************
-* Global Variables *
-*******************************************************************************/
+/*********************************************************************************************************************************
+* Global Variables *
+*********************************************************************************************************************************/
static char g_szTempPath[RTPATH_MAX - 50];
diff --git a/src/VBox/Runtime/testcase/tstRTThreadExecutionTime.cpp b/src/VBox/Runtime/testcase/tstRTThreadExecutionTime.cpp
index 0eb4255..a966356 100644
--- a/src/VBox/Runtime/testcase/tstRTThreadExecutionTime.cpp
+++ b/src/VBox/Runtime/testcase/tstRTThreadExecutionTime.cpp
@@ -24,9 +24,10 @@
* terms and conditions of either the GPL or the CDDL or both.
*/
-/*******************************************************************************
-* Header Files *
-*******************************************************************************/
+
+/*********************************************************************************************************************************
+* Header Files *
+*********************************************************************************************************************************/
#include <iprt/thread.h>
#include <iprt/asm.h>
@@ -36,9 +37,9 @@
#include <iprt/time.h>
-/*******************************************************************************
-* Global Variables *
-*******************************************************************************/
+/*********************************************************************************************************************************
+* Global Variables *
+*********************************************************************************************************************************/
static RTTEST g_hTest;
static volatile uint64_t g_kernel, g_user;
diff --git a/src/VBox/Runtime/testcase/tstRTThreadPoke.cpp b/src/VBox/Runtime/testcase/tstRTThreadPoke.cpp
index d63cce2..7bc1b7b 100644
--- a/src/VBox/Runtime/testcase/tstRTThreadPoke.cpp
+++ b/src/VBox/Runtime/testcase/tstRTThreadPoke.cpp
@@ -24,18 +24,19 @@
* terms and conditions of either the GPL or the CDDL or both.
*/
-/*******************************************************************************
-* Header Files *
-*******************************************************************************/
+
+/*********************************************************************************************************************************
+* Header Files *
+*********************************************************************************************************************************/
#include <iprt/thread.h>
#include <iprt/test.h>
#include <iprt/string.h>
-/*******************************************************************************
-* Global Variables *
-*******************************************************************************/
+/*********************************************************************************************************************************
+* Global Variables *
+*********************************************************************************************************************************/
static RTTEST g_hTest;
diff --git a/src/VBox/Runtime/testcase/tstRTTime.cpp b/src/VBox/Runtime/testcase/tstRTTime.cpp
index a8db004..f661a9c 100644
--- a/src/VBox/Runtime/testcase/tstRTTime.cpp
+++ b/src/VBox/Runtime/testcase/tstRTTime.cpp
@@ -24,9 +24,10 @@
* terms and conditions of either the GPL or the CDDL or both.
*/
-/*******************************************************************************
-* Header Files *
-*******************************************************************************/
+
+/*********************************************************************************************************************************
+* Header Files *
+*********************************************************************************************************************************/
#include <iprt/time.h>
#include <iprt/err.h>
diff --git a/src/VBox/Runtime/testcase/tstRTTimeSpec.cpp b/src/VBox/Runtime/testcase/tstRTTimeSpec.cpp
index bdddec5..96d43da 100644
--- a/src/VBox/Runtime/testcase/tstRTTimeSpec.cpp
+++ b/src/VBox/Runtime/testcase/tstRTTimeSpec.cpp
@@ -24,9 +24,10 @@
* terms and conditions of either the GPL or the CDDL or both.
*/
-/*******************************************************************************
-* Header Files *
-*******************************************************************************/
+
+/*********************************************************************************************************************************
+* Header Files *
+*********************************************************************************************************************************/
#if !defined(RT_OS_WINDOWS)
# define RTTIME_INCL_TIMEVAL
# define RTTIME_INCL_TIMESPEC
diff --git a/src/VBox/Runtime/testcase/tstRTUri.cpp b/src/VBox/Runtime/testcase/tstRTUri.cpp
index 2324c1b..adc1ab5 100644
--- a/src/VBox/Runtime/testcase/tstRTUri.cpp
+++ b/src/VBox/Runtime/testcase/tstRTUri.cpp
@@ -24,9 +24,10 @@
* terms and conditions of either the GPL or the CDDL or both.
*/
-/*******************************************************************************
-* Header Files *
-*******************************************************************************/
+
+/*********************************************************************************************************************************
+* Header Files *
+*********************************************************************************************************************************/
#include <iprt/uri.h>
#include <iprt/string.h>
@@ -34,9 +35,10 @@
#include <iprt/mem.h>
#include <iprt/test.h>
-/*******************************************************************************
-* Test data *
-*******************************************************************************/
+
+/*********************************************************************************************************************************
+* Test data *
+*********************************************************************************************************************************/
static const char *g_apcszTestURIs[] =
{
diff --git a/src/VBox/Runtime/testcase/tstRTUuid.cpp b/src/VBox/Runtime/testcase/tstRTUuid.cpp
index 7ed10ca..5a75d1b 100644
--- a/src/VBox/Runtime/testcase/tstRTUuid.cpp
+++ b/src/VBox/Runtime/testcase/tstRTUuid.cpp
@@ -25,9 +25,9 @@
*/
-/*******************************************************************************
-* Header Files *
-*******************************************************************************/
+/*********************************************************************************************************************************
+* Header Files *
+*********************************************************************************************************************************/
#include <iprt/uuid.h>
#include <iprt/test.h>
#include <iprt/stream.h>
diff --git a/src/VBox/Runtime/testcase/tstRTZip.cpp b/src/VBox/Runtime/testcase/tstRTZip.cpp
index d050cef..b79bfd6 100644
--- a/src/VBox/Runtime/testcase/tstRTZip.cpp
+++ b/src/VBox/Runtime/testcase/tstRTZip.cpp
@@ -25,9 +25,9 @@
*/
-/*******************************************************************************
-* Header Files *
-*******************************************************************************/
+/*********************************************************************************************************************************
+* Header Files *
+*********************************************************************************************************************************/
#include <iprt/zip.h>
#include <iprt/env.h>
diff --git a/src/VBox/Runtime/testcase/tstRand.cpp b/src/VBox/Runtime/testcase/tstRand.cpp
index bef6e1f..a41d3ac 100644
--- a/src/VBox/Runtime/testcase/tstRand.cpp
+++ b/src/VBox/Runtime/testcase/tstRand.cpp
@@ -24,9 +24,10 @@
* terms and conditions of either the GPL or the CDDL or both.
*/
-/*******************************************************************************
-* Header Files *
-*******************************************************************************/
+
+/*********************************************************************************************************************************
+* Header Files *
+*********************************************************************************************************************************/
#include <iprt/rand.h>
#include <iprt/stream.h>
#include <iprt/initterm.h>
@@ -34,9 +35,9 @@
#include <iprt/assert.h>
-/*******************************************************************************
-* Structures and Typedefs *
-*******************************************************************************/
+/*********************************************************************************************************************************
+* Structures and Typedefs *
+*********************************************************************************************************************************/
typedef struct TSTMEMAUTOPTRSTRUCT
{
uint32_t a;
@@ -45,9 +46,9 @@ typedef struct TSTMEMAUTOPTRSTRUCT
} TSTMEMAUTOPTRSTRUCT;
-/*******************************************************************************
-* Defined Constants And Macros *
-*******************************************************************************/
+/*********************************************************************************************************************************
+* Defined Constants And Macros *
+*********************************************************************************************************************************/
#define CHECK_EXPR(expr) \
do { bool const f = !!(expr); if (RT_UNLIKELY(!f)) { RTPrintf("tstRand(%d): %s!\n", __LINE__, #expr); g_cErrors++; } } while (0)
#define CHECK_EXPR_MSG(expr, msg) \
@@ -64,9 +65,10 @@ typedef struct TSTMEMAUTOPTRSTRUCT
#define TST_RAND_SAMPLE_RANGES 16
-/*******************************************************************************
-* Global Variables *
-*******************************************************************************/
+
+/*********************************************************************************************************************************
+* Global Variables *
+*********************************************************************************************************************************/
static unsigned g_cErrors = 0;
diff --git a/src/VBox/Runtime/testcase/tstSemMutex.cpp b/src/VBox/Runtime/testcase/tstSemMutex.cpp
index cfaa66c..73f6bdc 100644
--- a/src/VBox/Runtime/testcase/tstSemMutex.cpp
+++ b/src/VBox/Runtime/testcase/tstSemMutex.cpp
@@ -24,9 +24,10 @@
* terms and conditions of either the GPL or the CDDL or both.
*/
-/*******************************************************************************
-* Header Files *
-*******************************************************************************/
+
+/*********************************************************************************************************************************
+* Header Files *
+*********************************************************************************************************************************/
#include <iprt/semaphore.h>
#include <iprt/string.h>
#include <iprt/thread.h>
@@ -37,9 +38,9 @@
#include <iprt/assert.h>
-/*******************************************************************************
-* Global Variables *
-*******************************************************************************/
+/*********************************************************************************************************************************
+* Global Variables *
+*********************************************************************************************************************************/
static RTSEMMUTEX g_hMutex = NIL_RTSEMMUTEX;
static bool volatile g_fTerminate;
static bool g_fYield;
@@ -62,7 +63,7 @@ int PrintError(const char *pszFormat, ...)
}
-int ThreadTest1(RTTHREAD ThreadSelf, void *pvUser)
+static DECLCALLBACK(int) ThreadTest1(RTTHREAD ThreadSelf, void *pvUser)
{
uint64_t *pu64 = (uint64_t *)pvUser;
for (;;)
diff --git a/src/VBox/Runtime/testcase/tstSemPingPong.cpp b/src/VBox/Runtime/testcase/tstSemPingPong.cpp
index dd55be4..c8300f2 100644
--- a/src/VBox/Runtime/testcase/tstSemPingPong.cpp
+++ b/src/VBox/Runtime/testcase/tstSemPingPong.cpp
@@ -24,9 +24,10 @@
* terms and conditions of either the GPL or the CDDL or both.
*/
-/*******************************************************************************
-* Header Files *
-*******************************************************************************/
+
+/*********************************************************************************************************************************
+* Header Files *
+*********************************************************************************************************************************/
#include <iprt/semaphore.h>
#include <iprt/string.h>
#include <iprt/stream.h>
@@ -34,15 +35,16 @@
#include <iprt/thread.h>
#include <iprt/asm.h>
-/*******************************************************************************
-* Defined Constants And Macros *
-*******************************************************************************/
+
+/*********************************************************************************************************************************
+* Defined Constants And Macros *
+*********************************************************************************************************************************/
#define TSTSEMPINGPONG_ITERATIONS 1000000
-/*******************************************************************************
-* Global Variables *
-*******************************************************************************/
+/*********************************************************************************************************************************
+* Global Variables *
+*********************************************************************************************************************************/
static volatile uint32_t g_cErrors = 0;
static DECLCALLBACK(int) tstSemPingPongThread(RTTHREAD hThread, void *pvPP)
diff --git a/src/VBox/Runtime/testcase/tstStrSimplePattern.cpp b/src/VBox/Runtime/testcase/tstStrSimplePattern.cpp
index 061bbee..e61ca91 100644
--- a/src/VBox/Runtime/testcase/tstStrSimplePattern.cpp
+++ b/src/VBox/Runtime/testcase/tstStrSimplePattern.cpp
@@ -25,9 +25,9 @@
*/
-/*******************************************************************************
-* Header Files *
-*******************************************************************************/
+/*********************************************************************************************************************************
+* Header Files *
+*********************************************************************************************************************************/
#include <iprt/string.h>
#include <iprt/stream.h>
#include <iprt/err.h>
diff --git a/src/VBox/Runtime/testcase/tstTSC.cpp b/src/VBox/Runtime/testcase/tstTSC.cpp
index dcc3a1c..fee193b 100644
--- a/src/VBox/Runtime/testcase/tstTSC.cpp
+++ b/src/VBox/Runtime/testcase/tstTSC.cpp
@@ -24,9 +24,10 @@
* terms and conditions of either the GPL or the CDDL or both.
*/
-/*******************************************************************************
-* Header Files *
-*******************************************************************************/
+
+/*********************************************************************************************************************************
+* Header Files *
+*********************************************************************************************************************************/
#include <iprt/asm-amd64-x86.h>
#include <iprt/asm.h>
#include <iprt/getopt.h>
@@ -38,9 +39,9 @@
#include <iprt/time.h>
-/*******************************************************************************
-* Structures and Typedefs *
-*******************************************************************************/
+/*********************************************************************************************************************************
+* Structures and Typedefs *
+*********************************************************************************************************************************/
typedef struct TSCDATA
{
/** The TSC. */
@@ -56,9 +57,9 @@ typedef struct TSCDATA
} TSCDATA, *PTSCDATA;
-/*******************************************************************************
-* Global Variables *
-*******************************************************************************/
+/*********************************************************************************************************************************
+* Global Variables *
+*********************************************************************************************************************************/
/** The number of CPUs waiting on their user event semaphore. */
static volatile uint32_t g_cWaiting;
/** The number of CPUs ready (in spin) to do the TSC read. */
@@ -77,9 +78,9 @@ static volatile uint32_t g_cFailed;
static volatile bool g_fDone;
-/*******************************************************************************
-* Internal Functions *
-*******************************************************************************/
+/*********************************************************************************************************************************
+* Internal Functions *
+*********************************************************************************************************************************/
static DECLCALLBACK(int) ThreadFunction(RTTHREAD Thread, void *pvUser);
@@ -437,7 +438,7 @@ int main(int argc, char **argv)
return 1;
case 'V':
- RTPrintf("$Revision: 100874 $\n");
+ RTPrintf("$Revision: 102121 $\n");
return 0;
default:
diff --git a/src/VBox/Runtime/testcase/tstTermCallbacks.cpp b/src/VBox/Runtime/testcase/tstTermCallbacks.cpp
index df8247c..eccd299 100644
--- a/src/VBox/Runtime/testcase/tstTermCallbacks.cpp
+++ b/src/VBox/Runtime/testcase/tstTermCallbacks.cpp
@@ -25,9 +25,9 @@
*/
-/*******************************************************************************
-* Header Files *
-*******************************************************************************/
+/*********************************************************************************************************************************
+* Header Files *
+*********************************************************************************************************************************/
#include <iprt/initterm.h>
#include <iprt/test.h>
@@ -35,9 +35,10 @@
#include <iprt/err.h>
#include <iprt/initterm.h>
-/*******************************************************************************
-* Global Variables *
-*******************************************************************************/
+
+/*********************************************************************************************************************************
+* Global Variables *
+*********************************************************************************************************************************/
static uint32_t g_cCalls;
static uint32_t g_fCalled;
diff --git a/src/VBox/Runtime/testcase/tstThread-1.cpp b/src/VBox/Runtime/testcase/tstThread-1.cpp
index d45c190..59741c8 100644
--- a/src/VBox/Runtime/testcase/tstThread-1.cpp
+++ b/src/VBox/Runtime/testcase/tstThread-1.cpp
@@ -24,18 +24,19 @@
* terms and conditions of either the GPL or the CDDL or both.
*/
-/*******************************************************************************
-* Header Files *
-*******************************************************************************/
+
+/*********************************************************************************************************************************
+* Header Files *
+*********************************************************************************************************************************/
#include <iprt/thread.h>
#include <iprt/stream.h>
#include <iprt/initterm.h>
#include <iprt/err.h>
-/*******************************************************************************
-* Global Variables *
-*******************************************************************************/
+/*********************************************************************************************************************************
+* Global Variables *
+*********************************************************************************************************************************/
static unsigned volatile g_cErrors = 0;
diff --git a/src/VBox/Runtime/testcase/tstTime-2.cpp b/src/VBox/Runtime/testcase/tstTime-2.cpp
index 9e30767..0153243 100644
--- a/src/VBox/Runtime/testcase/tstTime-2.cpp
+++ b/src/VBox/Runtime/testcase/tstTime-2.cpp
@@ -24,9 +24,10 @@
* terms and conditions of either the GPL or the CDDL or both.
*/
-/*******************************************************************************
-* Header Files *
-*******************************************************************************/
+
+/*********************************************************************************************************************************
+* Header Files *
+*********************************************************************************************************************************/
#include <iprt/time.h>
#include <iprt/stream.h>
#include <iprt/initterm.h>
diff --git a/src/VBox/Runtime/testcase/tstTime-3.cpp b/src/VBox/Runtime/testcase/tstTime-3.cpp
index a31dc5b..3c103cc 100644
--- a/src/VBox/Runtime/testcase/tstTime-3.cpp
+++ b/src/VBox/Runtime/testcase/tstTime-3.cpp
@@ -24,9 +24,10 @@
* terms and conditions of either the GPL or the CDDL or both.
*/
-/*******************************************************************************
-* Header Files *
-*******************************************************************************/
+
+/*********************************************************************************************************************************
+* Header Files *
+*********************************************************************************************************************************/
#ifdef RT_OS_WINDOWS
# include <Windows.h>
diff --git a/src/VBox/Runtime/testcase/tstTime-4.cpp b/src/VBox/Runtime/testcase/tstTime-4.cpp
index 5958901..a16fd54 100644
--- a/src/VBox/Runtime/testcase/tstTime-4.cpp
+++ b/src/VBox/Runtime/testcase/tstTime-4.cpp
@@ -24,9 +24,10 @@
* terms and conditions of either the GPL or the CDDL or both.
*/
-/*******************************************************************************
-* Header Files *
-*******************************************************************************/
+
+/*********************************************************************************************************************************
+* Header Files *
+*********************************************************************************************************************************/
#include <iprt/time.h>
#include <iprt/stream.h>
#include <iprt/initterm.h>
diff --git a/src/VBox/Runtime/testcase/tstTimer.cpp b/src/VBox/Runtime/testcase/tstTimer.cpp
index c5dfd90..932ca26 100644
--- a/src/VBox/Runtime/testcase/tstTimer.cpp
+++ b/src/VBox/Runtime/testcase/tstTimer.cpp
@@ -24,9 +24,10 @@
* terms and conditions of either the GPL or the CDDL or both.
*/
-/*******************************************************************************
-* Header Files *
-*******************************************************************************/
+
+/*********************************************************************************************************************************
+* Header Files *
+*********************************************************************************************************************************/
#include <iprt/timer.h>
#include <iprt/time.h>
#include <iprt/thread.h>
@@ -38,9 +39,9 @@
-/*******************************************************************************
-* Global Variables *
-*******************************************************************************/
+/*********************************************************************************************************************************
+* Global Variables *
+*********************************************************************************************************************************/
static volatile unsigned gcTicks;
static volatile uint64_t gu64Min;
static volatile uint64_t gu64Max;
diff --git a/src/VBox/Runtime/testcase/tstTimerLR.cpp b/src/VBox/Runtime/testcase/tstTimerLR.cpp
index eea33fe..781b85c 100644
--- a/src/VBox/Runtime/testcase/tstTimerLR.cpp
+++ b/src/VBox/Runtime/testcase/tstTimerLR.cpp
@@ -24,9 +24,10 @@
* terms and conditions of either the GPL or the CDDL or both.
*/
-/*******************************************************************************
-* Header Files *
-*******************************************************************************/
+
+/*********************************************************************************************************************************
+* Header Files *
+*********************************************************************************************************************************/
#include <iprt/timer.h>
#include <iprt/time.h>
#include <iprt/thread.h>
@@ -37,9 +38,9 @@
-/*******************************************************************************
-* Global Variables *
-*******************************************************************************/
+/*********************************************************************************************************************************
+* Global Variables *
+*********************************************************************************************************************************/
static volatile unsigned gcTicks;
static volatile uint64_t gu64Min;
static volatile uint64_t gu64Max;
diff --git a/src/VBox/Runtime/testcase/tstUtf8.cpp b/src/VBox/Runtime/testcase/tstUtf8.cpp
index d5c7217..91c3f08 100644
--- a/src/VBox/Runtime/testcase/tstUtf8.cpp
+++ b/src/VBox/Runtime/testcase/tstUtf8.cpp
@@ -24,9 +24,10 @@
* terms and conditions of either the GPL or the CDDL or both.
*/
-/*******************************************************************************
-* Header Files *
-*******************************************************************************/
+
+/*********************************************************************************************************************************
+* Header Files *
+*********************************************************************************************************************************/
#include <iprt/string.h>
#include <iprt/alloc.h>
diff --git a/src/VBox/Runtime/testcase/tstVector.cpp b/src/VBox/Runtime/testcase/tstVector.cpp
index 935a5bb..a91774d 100644
--- a/src/VBox/Runtime/testcase/tstVector.cpp
+++ b/src/VBox/Runtime/testcase/tstVector.cpp
@@ -24,9 +24,10 @@
* terms and conditions of either the GPL or the CDDL or both.
*/
-/*******************************************************************************
-* Header Files *
-*******************************************************************************/
+
+/*********************************************************************************************************************************
+* Header Files *
+*********************************************************************************************************************************/
#include <iprt/test.h>
#include <iprt/vector.h>
diff --git a/src/VBox/Runtime/tools/RTSignTool.cpp b/src/VBox/Runtime/tools/RTSignTool.cpp
index 817daff..7bcd222 100644
--- a/src/VBox/Runtime/tools/RTSignTool.cpp
+++ b/src/VBox/Runtime/tools/RTSignTool.cpp
@@ -495,11 +495,14 @@ static RTEXITCODE HandleVerifyExe(int cArgs, char **papszArgs)
switch (ch)
{
case 'r': case 'a':
- rc = RTCrStoreCertAddFromFile(ch == 'r' ? State.hRootStore : State.hAdditionalStore, 0, ValueUnion.psz,
- RTErrInfoInitStatic(&StaticErrInfo));
+ rc = RTCrStoreCertAddFromFile(ch == 'r' ? State.hRootStore : State.hAdditionalStore,
+ RTCRCERTCTX_F_ADD_IF_NOT_FOUND | RTCRCERTCTX_F_ADD_CONTINUE_ON_ERROR,
+ ValueUnion.psz, RTErrInfoInitStatic(&StaticErrInfo));
if (RT_FAILURE(rc))
return RTMsgErrorExit(RTEXITCODE_FAILURE, "Error loading certificate '%s': %Rrc - %s",
ValueUnion.psz, rc, StaticErrInfo.szMsg);
+ if (RTErrInfoIsSet(&StaticErrInfo.Core))
+ RTMsgWarning("Warnings loading certificate '%s': %s", ValueUnion.psz, StaticErrInfo.szMsg);
break;
case 't':
diff --git a/src/VBox/Runtime/win/RTErrConvertFromWin32.cpp b/src/VBox/Runtime/win/RTErrConvertFromWin32.cpp
index 5f7da88..d1ca110 100644
--- a/src/VBox/Runtime/win/RTErrConvertFromWin32.cpp
+++ b/src/VBox/Runtime/win/RTErrConvertFromWin32.cpp
@@ -24,9 +24,10 @@
* terms and conditions of either the GPL or the CDDL or both.
*/
-/*******************************************************************************
-* Header Files *
-*******************************************************************************/
+
+/*********************************************************************************************************************************
+* Header Files *
+*********************************************************************************************************************************/
#include <Windows.h>
#include <iprt/err.h>
diff --git a/src/VBox/Runtime/win/errmsgwin.cpp b/src/VBox/Runtime/win/errmsgwin.cpp
index bf749f8..e816fd6 100644
--- a/src/VBox/Runtime/win/errmsgwin.cpp
+++ b/src/VBox/Runtime/win/errmsgwin.cpp
@@ -24,9 +24,10 @@
* terms and conditions of either the GPL or the CDDL or both.
*/
-/*******************************************************************************
-* Header Files *
-*******************************************************************************/
+
+/*********************************************************************************************************************************
+* Header Files *
+*********************************************************************************************************************************/
#include <Windows.h>
#include <iprt/err.h>
@@ -35,9 +36,9 @@
#include <iprt/err.h>
-/*******************************************************************************
-* Global Variables *
-*******************************************************************************/
+/*********************************************************************************************************************************
+* Global Variables *
+*********************************************************************************************************************************/
/** Array of messages.
* The data is generated by a sed script.
*/
diff --git a/src/VBox/Storage/DMG.cpp b/src/VBox/Storage/DMG.cpp
index 918512a..a1187f8 100644
--- a/src/VBox/Storage/DMG.cpp
+++ b/src/VBox/Storage/DMG.cpp
@@ -15,9 +15,10 @@
* hope that it will be useful, but WITHOUT ANY WARRANTY of any kind.
*/
-/*******************************************************************************
-* Header Files *
-*******************************************************************************/
+
+/*********************************************************************************************************************************
+* Header Files *
+*********************************************************************************************************************************/
#define LOG_GROUP LOG_GROUP_VD_DMG
#include <VBox/vd-plugin.h>
#include <VBox/vd-ifs.h>
@@ -36,9 +37,10 @@
#include "VDBackends.h"
-/*******************************************************************************
-* Structures and Typedefs *
-*******************************************************************************/
+
+/*********************************************************************************************************************************
+* Structures and Typedefs *
+*********************************************************************************************************************************/
#if 0
/** @def VBOX_WITH_DIRECT_XAR_ACCESS
* When defined, we will use RTVfs to access the XAR file instead of going
@@ -391,9 +393,10 @@ typedef struct DMGINFLATESTATE
ssize_t iOffset;
} DMGINFLATESTATE;
-/*******************************************************************************
-* Defined Constants And Macros *
-*******************************************************************************/
+
+/*********************************************************************************************************************************
+* Defined Constants And Macros *
+*********************************************************************************************************************************/
/** @def DMG_PRINTF
* Wrapper for LogRel.
*/
@@ -413,9 +416,9 @@ typedef struct DMGINFLATESTATE
} while (0)
-/*******************************************************************************
-* Static Variables *
-*******************************************************************************/
+/*********************************************************************************************************************************
+* Static Variables *
+*********************************************************************************************************************************/
/** NULL-terminated array of supported file extensions. */
static const VDFILEEXTENSION s_aDmgFileExtensions[] =
@@ -424,9 +427,10 @@ static const VDFILEEXTENSION s_aDmgFileExtensions[] =
{NULL, VDTYPE_INVALID}
};
-/*******************************************************************************
-* Internal Functions *
-*******************************************************************************/
+
+/*********************************************************************************************************************************
+* Internal Functions *
+*********************************************************************************************************************************/
static void dmgUdifFtrHost2FileEndian(PDMGUDIF pUdif);
static void dmgUdifFtrFile2HostEndian(PDMGUDIF pUdif);
@@ -1548,7 +1552,7 @@ static int dmgOpenImageWithinXar(uint32_t fOpen, PVDINTERFACEIOINT pVDIfIoInt, v
* @param pThis The DMG instance data.
* @param uOpenFlags Flags for defining the open type.
*/
-static int dmgOpenImage(PDMGIMAGE pThis, unsigned uOpenFlags)
+static DECLCALLBACK(int) dmgOpenImage(PDMGIMAGE pThis, unsigned uOpenFlags)
{
pThis->uOpenFlags = uOpenFlags;
@@ -1869,7 +1873,7 @@ static DECLCALLBACK(int) dmgCreate(const char *pszFilename, uint64_t cbSize,
}
/** @interface_method_impl{VBOXHDDBACKEND,pfnRename} */
-static int dmgRename(void *pBackendData, const char *pszFilename)
+static DECLCALLBACK(int) dmgRename(void *pBackendData, const char *pszFilename)
{
LogFlowFunc(("pBackendData=%#p pszFilename=%#p\n", pBackendData, pszFilename));
int rc = VERR_NOT_SUPPORTED;
diff --git a/src/VBox/Storage/Debug/VDDbgIoLog.cpp b/src/VBox/Storage/Debug/VDDbgIoLog.cpp
index 1012bd8..a032755 100644
--- a/src/VBox/Storage/Debug/VDDbgIoLog.cpp
+++ b/src/VBox/Storage/Debug/VDDbgIoLog.cpp
@@ -16,9 +16,10 @@
* hope that it will be useful, but WITHOUT ANY WARRANTY of any kind.
*/
-/*******************************************************************************
-* Header Files *
-*******************************************************************************/
+
+/*********************************************************************************************************************************
+* Header Files *
+*********************************************************************************************************************************/
#define LOGGROUP LOGGROUP_DEFAULT
#include <VBox/vddbg.h>
#include <VBox/err.h>
@@ -30,9 +31,10 @@
#include <iprt/semaphore.h>
#include <iprt/asm.h>
-/*******************************************************************************
-* Structures in a I/O log file, little endian *
-*******************************************************************************/
+
+/*********************************************************************************************************************************
+* Structures in a I/O log file, little endian *
+*********************************************************************************************************************************/
/**
* I/O log header.
@@ -120,9 +122,10 @@ typedef struct IoLogEntryDiscard
} IoLogEntryDiscard;
#pragma pack()
-/*******************************************************************************
-* Constants And Macros, Structures and Typedefs *
-*******************************************************************************/
+
+/*********************************************************************************************************************************
+* Constants And Macros, Structures and Typedefs *
+*********************************************************************************************************************************/
/**
* I/O logger instance data.
@@ -166,9 +169,10 @@ typedef struct VDIOLOGENTINT
/** Pointer to the internal I/O log entry data. */
typedef VDIOLOGENTINT *PVDIOLOGENTINT;
-/*******************************************************************************
-* Internal Functions *
-*******************************************************************************/
+
+/*********************************************************************************************************************************
+* Internal Functions *
+*********************************************************************************************************************************/
/**
* Creates a new empty I/O logger.
diff --git a/src/VBox/Storage/ISCSI.cpp b/src/VBox/Storage/ISCSI.cpp
index f340b6b..93c6fbf 100644
--- a/src/VBox/Storage/ISCSI.cpp
+++ b/src/VBox/Storage/ISCSI.cpp
@@ -16,9 +16,9 @@
*/
-/*******************************************************************************
-* Header Files *
-*******************************************************************************/
+/*********************************************************************************************************************************
+* Header Files *
+*********************************************************************************************************************************/
#define LOG_GROUP LOG_GROUP_VD_ISCSI
#include <VBox/vd-plugin.h>
#include <VBox/err.h>
@@ -38,9 +38,10 @@
#include "VDBackends.h"
-/*******************************************************************************
-* Defined Constants And Macros *
-*******************************************************************************/
+
+/*********************************************************************************************************************************
+* Defined Constants And Macros *
+*********************************************************************************************************************************/
/** The maximum number of release log entries per image. */
#define MAX_LOG_REL_ERRORS 1024
@@ -267,9 +268,9 @@ typedef enum ISCSIPDUFLAGS
} ISCSIPDUFLAGS;
-/*******************************************************************************
-* Structures and Typedefs *
-*******************************************************************************/
+/*********************************************************************************************************************************
+* Structures and Typedefs *
+*********************************************************************************************************************************/
/**
* iSCSI login negotiation parameter
@@ -612,9 +613,9 @@ typedef struct ISCSIIMAGE
} ISCSIIMAGE;
-/*******************************************************************************
-* Static Variables *
-*******************************************************************************/
+/*********************************************************************************************************************************
+* Static Variables *
+*********************************************************************************************************************************/
/** Default initiator basename. */
static const char *s_iscsiDefaultInitiatorBasename = "iqn.2009-08.com.sun.virtualbox.initiator";
@@ -653,9 +654,10 @@ static const VDCONFIGINFO s_iscsiConfigInfo[] =
{ NULL, NULL, VDCFGVALUETYPE_INTEGER, 0 }
};
-/*******************************************************************************
-* Internal Functions *
-*******************************************************************************/
+
+/*********************************************************************************************************************************
+* Internal Functions *
+*********************************************************************************************************************************/
/* iSCSI low-level functions (only to be used from the iSCSI high-level functions). */
static uint32_t iscsiNewITT(PISCSIIMAGE pImage);
@@ -1205,7 +1207,7 @@ static int iscsiTransportOpen(PISCSIIMAGE pImage)
* @returns VBox status.
* @param pImage The iSCSI connection state to be used.
*/
-static int iscsiAttach(void *pvUser)
+static DECLCALLBACK(int) iscsiAttach(void *pvUser)
{
int rc;
uint32_t itt;
@@ -1218,10 +1220,10 @@ static int iscsiAttach(void *pvUser)
size_t cbChallenge = 0; /* shut up gcc */
uint8_t bChapIdx;
uint8_t aResponse[RTMD5HASHSIZE];
- uint32_t cnISCSIReq;
+ uint32_t cnISCSIReq = 0;
ISCSIREQ aISCSIReq[4];
uint32_t aReqBHS[12];
- uint32_t cnISCSIRes;
+ uint32_t cnISCSIRes = 0;
ISCSIRES aISCSIRes[2];
uint32_t aResBHS[12];
unsigned cRetries = 5;
@@ -1720,7 +1722,7 @@ out:
* @returns VBox status.
* @param pImage The iSCSI connection state to be used.
*/
-static int iscsiDetach(void *pvUser)
+static DECLCALLBACK(int) iscsiDetach(void *pvUser)
{
int rc;
uint32_t itt;
@@ -3541,7 +3543,7 @@ static int iscsiCommandAsync(PISCSIIMAGE pImage, PSCSIREQ pScsiReq,
return rc;
}
-static void iscsiCommandCompleteSync(PISCSIIMAGE pImage, int rcReq, void *pvUser)
+static DECLCALLBACK(void) iscsiCommandCompleteSync(PISCSIIMAGE pImage, int rcReq, void *pvUser)
{
PISCSICMDSYNC pIScsiCmdSync = (PISCSICMDSYNC)pvUser;
@@ -3679,7 +3681,7 @@ static int iscsiExecSync(PISCSIIMAGE pImage, PFNISCSIEXEC pfnExec, void *pvUser)
}
-static void iscsiCommandAsyncComplete(PISCSIIMAGE pImage, int rcReq, void *pvUser)
+static DECLCALLBACK(void) iscsiCommandAsyncComplete(PISCSIIMAGE pImage, int rcReq, void *pvUser)
{
bool fComplete = true;
size_t cbTransfered = 0;
@@ -4548,7 +4550,7 @@ out:
/** @copydoc VBOXHDDBACKEND::pfnCheckIfValid */
-static int iscsiCheckIfValid(const char *pszFilename, PVDINTERFACE pVDIfsDisk,
+static DECLCALLBACK(int) iscsiCheckIfValid(const char *pszFilename, PVDINTERFACE pVDIfsDisk,
PVDINTERFACE pVDIfsImage, VDTYPE *penmType)
{
LogFlowFunc(("pszFilename=\"%s\"\n", pszFilename));
@@ -4562,9 +4564,9 @@ static int iscsiCheckIfValid(const char *pszFilename, PVDINTERFACE pVDIfsDisk,
}
/** @copydoc VBOXHDDBACKEND::pfnOpen */
-static int iscsiOpen(const char *pszFilename, unsigned uOpenFlags,
- PVDINTERFACE pVDIfsDisk, PVDINTERFACE pVDIfsImage,
- VDTYPE enmType, void **ppBackendData)
+static DECLCALLBACK(int) iscsiOpen(const char *pszFilename, unsigned uOpenFlags,
+ PVDINTERFACE pVDIfsDisk, PVDINTERFACE pVDIfsImage,
+ VDTYPE enmType, void **ppBackendData)
{
LogFlowFunc(("pszFilename=\"%s\" uOpenFlags=%#x pVDIfsDisk=%#p pVDIfsImage=%#p enmType=%u ppBackendData=%#p\n", pszFilename, uOpenFlags, pVDIfsDisk, pVDIfsImage, enmType, ppBackendData));
int rc;
@@ -4626,14 +4628,14 @@ out:
}
/** @copydoc VBOXHDDBACKEND::pfnCreate */
-static int iscsiCreate(const char *pszFilename, uint64_t cbSize,
- unsigned uImageFlags, const char *pszComment,
- PCVDGEOMETRY pPCHSGeometry, PCVDGEOMETRY pLCHSGeometry,
- PCRTUUID pUuid, unsigned uOpenFlags,
- unsigned uPercentStart, unsigned uPercentSpan,
- PVDINTERFACE pVDIfsDisk, PVDINTERFACE pVDIfsImage,
- PVDINTERFACE pVDIfsOperation, VDTYPE enmType,
- void **ppBackendData)
+static DECLCALLBACK(int) iscsiCreate(const char *pszFilename, uint64_t cbSize,
+ unsigned uImageFlags, const char *pszComment,
+ PCVDGEOMETRY pPCHSGeometry, PCVDGEOMETRY pLCHSGeometry,
+ PCRTUUID pUuid, unsigned uOpenFlags,
+ unsigned uPercentStart, unsigned uPercentSpan,
+ PVDINTERFACE pVDIfsDisk, PVDINTERFACE pVDIfsImage,
+ PVDINTERFACE pVDIfsOperation, VDTYPE enmType,
+ void **ppBackendData)
{
LogFlowFunc(("pszFilename=\"%s\" cbSize=%llu uImageFlags=%#x pszComment=\"%s\" pPCHSGeometry=%#p pLCHSGeometry=%#p Uuid=%RTuuid uOpenFlags=%#x uPercentStart=%u uPercentSpan=%u pVDIfsDisk=%#p pVDIfsImage=%#p pVDIfsOperation=%#p enmType=%u ppBackendData=%#p",
pszFilename, cbSize, uImageFlags, pszComment, pPCHSGeometry, pLCHSGeometry, pUuid, uOpenFlags, uPercentStart, uPercentSpan, pVDIfsDisk, pVDIfsImage, pVDIfsOperation, enmType, ppBackendData));
@@ -4644,7 +4646,7 @@ static int iscsiCreate(const char *pszFilename, uint64_t cbSize,
}
/** @copydoc VBOXHDDBACKEND::pfnClose */
-static int iscsiClose(void *pBackendData, bool fDelete)
+static DECLCALLBACK(int) iscsiClose(void *pBackendData, bool fDelete)
{
LogFlowFunc(("pBackendData=%#p fDelete=%d\n", pBackendData, fDelete));
PISCSIIMAGE pImage = (PISCSIIMAGE)pBackendData;
@@ -4660,8 +4662,8 @@ static int iscsiClose(void *pBackendData, bool fDelete)
}
/** @copydoc VBOXHDDBACKEND::pfnRead */
-static int iscsiRead(void *pBackendData, uint64_t uOffset, size_t cbToRead,
- PVDIOCTX pIoCtx, size_t *pcbActuallyRead)
+static DECLCALLBACK(int) iscsiRead(void *pBackendData, uint64_t uOffset, size_t cbToRead,
+ PVDIOCTX pIoCtx, size_t *pcbActuallyRead)
{
PISCSIIMAGE pImage = (PISCSIIMAGE)pBackendData;
int rc = VINF_SUCCESS;
@@ -4783,9 +4785,9 @@ static int iscsiRead(void *pBackendData, uint64_t uOffset, size_t cbToRead,
}
/** @copydoc VBOXHDDBACKEND::pfnWrite */
-static int iscsiWrite(void *pBackendData, uint64_t uOffset, size_t cbToWrite,
- PVDIOCTX pIoCtx, size_t *pcbWriteProcess, size_t *pcbPreRead,
- size_t *pcbPostRead, unsigned fWrite)
+static DECLCALLBACK(int) iscsiWrite(void *pBackendData, uint64_t uOffset, size_t cbToWrite,
+ PVDIOCTX pIoCtx, size_t *pcbWriteProcess, size_t *pcbPreRead,
+ size_t *pcbPostRead, unsigned fWrite)
{
LogFlowFunc(("pBackendData=%p uOffset=%llu pIoCtx=%#p cbToWrite=%u pcbWriteProcess=%p pcbPreRead=%p pcbPostRead=%p fWrite=%u\n",
pBackendData, uOffset, pIoCtx, cbToWrite, pcbWriteProcess, pcbPreRead, pcbPostRead, fWrite));
@@ -4909,7 +4911,7 @@ static int iscsiWrite(void *pBackendData, uint64_t uOffset, size_t cbToWrite,
}
/** @copydoc VBOXHDDBACKEND::pfnFlush */
-static int iscsiFlush(void *pBackendData, PVDIOCTX pIoCtx)
+static DECLCALLBACK(int) iscsiFlush(void *pBackendData, PVDIOCTX pIoCtx)
{
LogFlowFunc(("pBackendData=%p pIoCtx=%#p\n", pBackendData, pIoCtx));
PISCSIIMAGE pImage = (PISCSIIMAGE)pBackendData;
@@ -4969,7 +4971,7 @@ static int iscsiFlush(void *pBackendData, PVDIOCTX pIoCtx)
}
/** @copydoc VBOXHDDBACKEND::pfnGetVersion */
-static unsigned iscsiGetVersion(void *pBackendData)
+static DECLCALLBACK(unsigned) iscsiGetVersion(void *pBackendData)
{
LogFlowFunc(("pBackendData=%#p\n", pBackendData));
PISCSIIMAGE pImage = (PISCSIIMAGE)pBackendData;
@@ -4981,7 +4983,7 @@ static unsigned iscsiGetVersion(void *pBackendData)
}
/** @copydoc VBOXHDDBACKEND::pfnGetSectorSize */
-static uint32_t iscsiGetSectorSize(void *pBackendData)
+static DECLCALLBACK(uint32_t) iscsiGetSectorSize(void *pBackendData)
{
LogFlowFunc(("pBackendData=%#p\n", pBackendData));
PISCSIIMAGE pImage = (PISCSIIMAGE)pBackendData;
@@ -4995,7 +4997,7 @@ static uint32_t iscsiGetSectorSize(void *pBackendData)
}
/** @copydoc VBOXHDDBACKEND::pfnGetSize */
-static uint64_t iscsiGetSize(void *pBackendData)
+static DECLCALLBACK(uint64_t) iscsiGetSize(void *pBackendData)
{
LogFlowFunc(("pBackendData=%#p\n", pBackendData));
PISCSIIMAGE pImage = (PISCSIIMAGE)pBackendData;
@@ -5009,7 +5011,7 @@ static uint64_t iscsiGetSize(void *pBackendData)
}
/** @copydoc VBOXHDDBACKEND::pfnGetFileSize */
-static uint64_t iscsiGetFileSize(void *pBackendData)
+static DECLCALLBACK(uint64_t) iscsiGetFileSize(void *pBackendData)
{
LogFlowFunc(("pBackendData=%#p\n", pBackendData));
PISCSIIMAGE pImage = (PISCSIIMAGE)pBackendData;
@@ -5024,7 +5026,7 @@ static uint64_t iscsiGetFileSize(void *pBackendData)
}
/** @copydoc VBOXHDDBACKEND::pfnGetPCHSGeometry */
-static int iscsiGetPCHSGeometry(void *pBackendData, PVDGEOMETRY pPCHSGeometry)
+static DECLCALLBACK(int) iscsiGetPCHSGeometry(void *pBackendData, PVDGEOMETRY pPCHSGeometry)
{
LogFlowFunc(("pBackendData=%#p pPCHSGeometry=%#p\n", pBackendData, pPCHSGeometry));
PISCSIIMAGE pImage = (PISCSIIMAGE)pBackendData;
@@ -5042,7 +5044,7 @@ static int iscsiGetPCHSGeometry(void *pBackendData, PVDGEOMETRY pPCHSGeometry)
}
/** @copydoc VBOXHDDBACKEND::pfnSetPCHSGeometry */
-static int iscsiSetPCHSGeometry(void *pBackendData, PCVDGEOMETRY pPCHSGeometry)
+static DECLCALLBACK(int) iscsiSetPCHSGeometry(void *pBackendData, PCVDGEOMETRY pPCHSGeometry)
{
LogFlowFunc(("pBackendData=%#p pPCHSGeometry=%#p PCHS=%u/%u/%u\n", pBackendData, pPCHSGeometry, pPCHSGeometry->cCylinders, pPCHSGeometry->cHeads, pPCHSGeometry->cSectors));
PISCSIIMAGE pImage = (PISCSIIMAGE)pBackendData;
@@ -5068,7 +5070,7 @@ out:
}
/** @copydoc VBOXHDDBACKEND::pfnGetLCHSGeometry */
-static int iscsiGetLCHSGeometry(void *pBackendData, PVDGEOMETRY pLCHSGeometry)
+static DECLCALLBACK(int) iscsiGetLCHSGeometry(void *pBackendData, PVDGEOMETRY pLCHSGeometry)
{
LogFlowFunc(("pBackendData=%#p pLCHSGeometry=%#p\n", pBackendData, pLCHSGeometry));
PISCSIIMAGE pImage = (PISCSIIMAGE)pBackendData;
@@ -5086,7 +5088,7 @@ static int iscsiGetLCHSGeometry(void *pBackendData, PVDGEOMETRY pLCHSGeometry)
}
/** @copydoc VBOXHDDBACKEND::pfnSetLCHSGeometry */
-static int iscsiSetLCHSGeometry(void *pBackendData, PCVDGEOMETRY pLCHSGeometry)
+static DECLCALLBACK(int) iscsiSetLCHSGeometry(void *pBackendData, PCVDGEOMETRY pLCHSGeometry)
{
LogFlowFunc(("pBackendData=%#p pLCHSGeometry=%#p LCHS=%u/%u/%u\n", pBackendData, pLCHSGeometry, pLCHSGeometry->cCylinders, pLCHSGeometry->cHeads, pLCHSGeometry->cSectors));
PISCSIIMAGE pImage = (PISCSIIMAGE)pBackendData;
@@ -5112,7 +5114,7 @@ out:
}
/** @copydoc VBOXHDDBACKEND::pfnGetImageFlags */
-static unsigned iscsiGetImageFlags(void *pBackendData)
+static DECLCALLBACK(unsigned) iscsiGetImageFlags(void *pBackendData)
{
LogFlowFunc(("pBackendData=%#p\n", pBackendData));
PISCSIIMAGE pImage = (PISCSIIMAGE)pBackendData;
@@ -5128,7 +5130,7 @@ static unsigned iscsiGetImageFlags(void *pBackendData)
}
/** @copydoc VBOXHDDBACKEND::pfnGetOpenFlags */
-static unsigned iscsiGetOpenFlags(void *pBackendData)
+static DECLCALLBACK(unsigned) iscsiGetOpenFlags(void *pBackendData)
{
LogFlowFunc(("pBackendData=%#p\n", pBackendData));
PISCSIIMAGE pImage = (PISCSIIMAGE)pBackendData;
@@ -5146,7 +5148,7 @@ static unsigned iscsiGetOpenFlags(void *pBackendData)
}
/** @copydoc VBOXHDDBACKEND::pfnSetOpenFlags */
-static int iscsiSetOpenFlags(void *pBackendData, unsigned uOpenFlags)
+static DECLCALLBACK(int) iscsiSetOpenFlags(void *pBackendData, unsigned uOpenFlags)
{
LogFlowFunc(("pBackendData=%#p\n uOpenFlags=%#x", pBackendData, uOpenFlags));
PISCSIIMAGE pImage = (PISCSIIMAGE)pBackendData;
@@ -5183,8 +5185,8 @@ out:
}
/** @copydoc VBOXHDDBACKEND::pfnGetComment */
-static int iscsiGetComment(void *pBackendData, char *pszComment,
- size_t cbComment)
+static DECLCALLBACK(int) iscsiGetComment(void *pBackendData, char *pszComment,
+ size_t cbComment)
{
LogFlowFunc(("pBackendData=%#p pszComment=%#p cbComment=%zu\n", pBackendData, pszComment, cbComment));
PISCSIIMAGE pImage = (PISCSIIMAGE)pBackendData;
@@ -5202,7 +5204,7 @@ static int iscsiGetComment(void *pBackendData, char *pszComment,
}
/** @copydoc VBOXHDDBACKEND::pfnSetComment */
-static int iscsiSetComment(void *pBackendData, const char *pszComment)
+static DECLCALLBACK(int) iscsiSetComment(void *pBackendData, const char *pszComment)
{
LogFlowFunc(("pBackendData=%#p pszComment=\"%s\"\n", pBackendData, pszComment));
PISCSIIMAGE pImage = (PISCSIIMAGE)pBackendData;
@@ -5225,7 +5227,7 @@ static int iscsiSetComment(void *pBackendData, const char *pszComment)
}
/** @copydoc VBOXHDDBACKEND::pfnGetUuid */
-static int iscsiGetUuid(void *pBackendData, PRTUUID pUuid)
+static DECLCALLBACK(int) iscsiGetUuid(void *pBackendData, PRTUUID pUuid)
{
LogFlowFunc(("pBackendData=%#p pUuid=%#p\n", pBackendData, pUuid));
PISCSIIMAGE pImage = (PISCSIIMAGE)pBackendData;
@@ -5243,7 +5245,7 @@ static int iscsiGetUuid(void *pBackendData, PRTUUID pUuid)
}
/** @copydoc VBOXHDDBACKEND::pfnSetUuid */
-static int iscsiSetUuid(void *pBackendData, PCRTUUID pUuid)
+static DECLCALLBACK(int) iscsiSetUuid(void *pBackendData, PCRTUUID pUuid)
{
LogFlowFunc(("pBackendData=%#p Uuid=%RTuuid\n", pBackendData, pUuid));
PISCSIIMAGE pImage = (PISCSIIMAGE)pBackendData;
@@ -5267,7 +5269,7 @@ static int iscsiSetUuid(void *pBackendData, PCRTUUID pUuid)
}
/** @copydoc VBOXHDDBACKEND::pfnGetModificationUuid */
-static int iscsiGetModificationUuid(void *pBackendData, PRTUUID pUuid)
+static DECLCALLBACK(int) iscsiGetModificationUuid(void *pBackendData, PRTUUID pUuid)
{
LogFlowFunc(("pBackendData=%#p pUuid=%#p\n", pBackendData, pUuid));
PISCSIIMAGE pImage = (PISCSIIMAGE)pBackendData;
@@ -5285,7 +5287,7 @@ static int iscsiGetModificationUuid(void *pBackendData, PRTUUID pUuid)
}
/** @copydoc VBOXHDDBACKEND::pfnSetModificationUuid */
-static int iscsiSetModificationUuid(void *pBackendData, PCRTUUID pUuid)
+static DECLCALLBACK(int) iscsiSetModificationUuid(void *pBackendData, PCRTUUID pUuid)
{
LogFlowFunc(("pBackendData=%#p Uuid=%RTuuid\n", pBackendData, pUuid));
PISCSIIMAGE pImage = (PISCSIIMAGE)pBackendData;
@@ -5309,7 +5311,7 @@ static int iscsiSetModificationUuid(void *pBackendData, PCRTUUID pUuid)
}
/** @copydoc VBOXHDDBACKEND::pfnGetParentUuid */
-static int iscsiGetParentUuid(void *pBackendData, PRTUUID pUuid)
+static DECLCALLBACK(int) iscsiGetParentUuid(void *pBackendData, PRTUUID pUuid)
{
LogFlowFunc(("pBackendData=%#p pUuid=%#p\n", pBackendData, pUuid));
PISCSIIMAGE pImage = (PISCSIIMAGE)pBackendData;
@@ -5327,7 +5329,7 @@ static int iscsiGetParentUuid(void *pBackendData, PRTUUID pUuid)
}
/** @copydoc VBOXHDDBACKEND::pfnSetParentUuid */
-static int iscsiSetParentUuid(void *pBackendData, PCRTUUID pUuid)
+static DECLCALLBACK(int) iscsiSetParentUuid(void *pBackendData, PCRTUUID pUuid)
{
LogFlowFunc(("pBackendData=%#p Uuid=%RTuuid\n", pBackendData, pUuid));
PISCSIIMAGE pImage = (PISCSIIMAGE)pBackendData;
@@ -5351,7 +5353,7 @@ static int iscsiSetParentUuid(void *pBackendData, PCRTUUID pUuid)
}
/** @copydoc VBOXHDDBACKEND::pfnGetParentModificationUuid */
-static int iscsiGetParentModificationUuid(void *pBackendData, PRTUUID pUuid)
+static DECLCALLBACK(int) iscsiGetParentModificationUuid(void *pBackendData, PRTUUID pUuid)
{
LogFlowFunc(("pBackendData=%#p pUuid=%#p\n", pBackendData, pUuid));
PISCSIIMAGE pImage = (PISCSIIMAGE)pBackendData;
@@ -5369,7 +5371,7 @@ static int iscsiGetParentModificationUuid(void *pBackendData, PRTUUID pUuid)
}
/** @copydoc VBOXHDDBACKEND::pfnSetParentModificationUuid */
-static int iscsiSetParentModificationUuid(void *pBackendData, PCRTUUID pUuid)
+static DECLCALLBACK(int) iscsiSetParentModificationUuid(void *pBackendData, PCRTUUID pUuid)
{
LogFlowFunc(("pBackendData=%#p Uuid=%RTuuid\n", pBackendData, pUuid));
PISCSIIMAGE pImage = (PISCSIIMAGE)pBackendData;
@@ -5393,7 +5395,7 @@ static int iscsiSetParentModificationUuid(void *pBackendData, PCRTUUID pUuid)
}
/** @copydoc VBOXHDDBACKEND::pfnDump */
-static void iscsiDump(void *pBackendData)
+static DECLCALLBACK(void) iscsiDump(void *pBackendData)
{
PISCSIIMAGE pImage = (PISCSIIMAGE)pBackendData;
@@ -5406,7 +5408,7 @@ static void iscsiDump(void *pBackendData)
}
/** @copydoc VBOXHDDBACKEND::pfnComposeLocation */
-static int iscsiComposeLocation(PVDINTERFACE pConfig, char **pszLocation)
+static DECLCALLBACK(int) iscsiComposeLocation(PVDINTERFACE pConfig, char **pszLocation)
{
char *pszTarget = NULL;
char *pszLUN = NULL;
@@ -5433,7 +5435,7 @@ static int iscsiComposeLocation(PVDINTERFACE pConfig, char **pszLocation)
}
/** @copydoc VBOXHDDBACKEND::pfnComposeName */
-static int iscsiComposeName(PVDINTERFACE pConfig, char **pszName)
+static DECLCALLBACK(int) iscsiComposeName(PVDINTERFACE pConfig, char **pszName)
{
char *pszTarget = NULL;
char *pszLUN = NULL;
diff --git a/src/VBox/Storage/Parallels.cpp b/src/VBox/Storage/Parallels.cpp
index 487974e..052122f 100644
--- a/src/VBox/Storage/Parallels.cpp
+++ b/src/VBox/Storage/Parallels.cpp
@@ -97,9 +97,10 @@ typedef struct PARALLELSIMAGE
uint64_t cbFileCurrent;
} PARALLELSIMAGE, *PPARALLELSIMAGE;
-/*******************************************************************************
-* Static Variables *
-*******************************************************************************/
+
+/*********************************************************************************************************************************
+* Static Variables *
+*********************************************************************************************************************************/
/** NULL-terminated array of supported file extensions. */
static const VDFILEEXTENSION s_aParallelsFileExtensions[] =
@@ -357,8 +358,8 @@ out:
}
/** @copydoc VBOXHDDBACKEND::pfnCheckIfValid */
-static int parallelsCheckIfValid(const char *pszFilename, PVDINTERFACE pVDIfsDisk,
- PVDINTERFACE pVDIfsImage, VDTYPE *penmType)
+static DECLCALLBACK(int) parallelsCheckIfValid(const char *pszFilename, PVDINTERFACE pVDIfsDisk,
+ PVDINTERFACE pVDIfsImage, VDTYPE *penmType)
{
int rc;
PVDIOSTORAGE pStorage;
@@ -417,9 +418,9 @@ static int parallelsCheckIfValid(const char *pszFilename, PVDINTERFACE pVDIfsDis
}
/** @copydoc VBOXHDDBACKEND::pfnOpen */
-static int parallelsOpen(const char *pszFilename, unsigned uOpenFlags,
- PVDINTERFACE pVDIfsDisk, PVDINTERFACE pVDIfsImage,
- VDTYPE enmType, void **ppBackendData)
+static DECLCALLBACK(int) parallelsOpen(const char *pszFilename, unsigned uOpenFlags,
+ PVDINTERFACE pVDIfsDisk, PVDINTERFACE pVDIfsImage,
+ VDTYPE enmType, void **ppBackendData)
{
LogFlowFunc(("pszFilename=\"%s\" uOpenFlags=%#x pVDIfsDisk=%#p pVDIfsImage=%#p enmType=%u ppBackendData=%#p\n", pszFilename, uOpenFlags, pVDIfsDisk, pVDIfsImage, enmType, ppBackendData));
int rc;
@@ -467,15 +468,15 @@ out:
}
/** @copydoc VBOXHDDBACKEND::pfnCreate */
-static int parallelsCreate(const char *pszFilename, uint64_t cbSize,
- unsigned uImageFlags, const char *pszComment,
- PCVDGEOMETRY pPCHSGeometry,
- PCVDGEOMETRY pLCHSGeometry, PCRTUUID pUuid,
- unsigned uOpenFlags, unsigned uPercentStart,
- unsigned uPercentSpan, PVDINTERFACE pVDIfsDisk,
- PVDINTERFACE pVDIfsImage,
- PVDINTERFACE pVDIfsOperation, VDTYPE enmType,
- void **ppBackendData)
+static DECLCALLBACK(int) parallelsCreate(const char *pszFilename, uint64_t cbSize,
+ unsigned uImageFlags, const char *pszComment,
+ PCVDGEOMETRY pPCHSGeometry,
+ PCVDGEOMETRY pLCHSGeometry, PCRTUUID pUuid,
+ unsigned uOpenFlags, unsigned uPercentStart,
+ unsigned uPercentSpan, PVDINTERFACE pVDIfsDisk,
+ PVDINTERFACE pVDIfsImage,
+ PVDINTERFACE pVDIfsOperation, VDTYPE enmType,
+ void **ppBackendData)
{
LogFlowFunc(("pszFilename=\"%s\" cbSize=%llu uImageFlags=%#x pszComment=\"%s\" pPCHSGeometry=%#p pLCHSGeometry=%#p Uuid=%RTuuid uOpenFlags=%#x uPercentStart=%u uPercentSpan=%u pVDIfsDisk=%#p pVDIfsImage=%#p pVDIfsOperation=%#p enmType=%u ppBackendData=%#p",
pszFilename, cbSize, uImageFlags, pszComment, pPCHSGeometry, pLCHSGeometry, pUuid, uOpenFlags, uPercentStart, uPercentSpan, pVDIfsDisk, pVDIfsImage, pVDIfsOperation, enmType, ppBackendData));
@@ -554,7 +555,7 @@ out:
}
/** @copydoc VBOXHDDBACKEND::pfnRename */
-static int parallelsRename(void *pBackendData, const char *pszFilename)
+static DECLCALLBACK(int) parallelsRename(void *pBackendData, const char *pszFilename)
{
LogFlowFunc(("pBackendData=%#p pszFilename=%#p\n", pBackendData, pszFilename));
int rc = VINF_SUCCESS;
@@ -600,7 +601,7 @@ out:
}
/** @copydoc VBOXHDDBACKEND::pfnClose */
-static int parallelsClose(void *pBackendData, bool fDelete)
+static DECLCALLBACK(int) parallelsClose(void *pBackendData, bool fDelete)
{
LogFlowFunc(("pBackendData=%#p fDelete=%d\n", pBackendData, fDelete));
PPARALLELSIMAGE pImage = (PPARALLELSIMAGE)pBackendData;
@@ -614,8 +615,8 @@ static int parallelsClose(void *pBackendData, bool fDelete)
}
/** @copydoc VBOXHDDBACKEND::pfnRead */
-static int parallelsRead(void *pBackendData, uint64_t uOffset, size_t cbToRead,
- PVDIOCTX pIoCtx, size_t *pcbActuallyRead)
+static DECLCALLBACK(int) parallelsRead(void *pBackendData, uint64_t uOffset, size_t cbToRead,
+ PVDIOCTX pIoCtx, size_t *pcbActuallyRead)
{
LogFlowFunc(("pBackendData=%#p uOffset=%llu pIoCtx=%#p cbToRead=%zu pcbActuallyRead=%#p\n",
pBackendData, uOffset, pIoCtx, cbToRead, pcbActuallyRead));
@@ -659,9 +660,9 @@ static int parallelsRead(void *pBackendData, uint64_t uOffset, size_t cbToRead,
}
/** @copydoc VBOXHDDBACKEND::pfnWrite */
-static int parallelsWrite(void *pBackendData, uint64_t uOffset, size_t cbToWrite,
- PVDIOCTX pIoCtx, size_t *pcbWriteProcess, size_t *pcbPreRead,
- size_t *pcbPostRead, unsigned fWrite)
+static DECLCALLBACK(int) parallelsWrite(void *pBackendData, uint64_t uOffset, size_t cbToWrite,
+ PVDIOCTX pIoCtx, size_t *pcbWriteProcess, size_t *pcbPreRead,
+ size_t *pcbPostRead, unsigned fWrite)
{
LogFlowFunc(("pBackendData=%#p uOffset=%llu pIoCtx=%#p cbToWrite=%zu pcbWriteProcess=%#p\n",
pBackendData, uOffset, pIoCtx, cbToWrite, pcbWriteProcess));
@@ -743,7 +744,7 @@ static int parallelsWrite(void *pBackendData, uint64_t uOffset, size_t cbToWrite
}
/** @copydoc VBOXHDDBACKEND::pfnFlush */
-static int parallelsFlush(void *pBackendData, PVDIOCTX pIoCtx)
+static DECLCALLBACK(int) parallelsFlush(void *pBackendData, PVDIOCTX pIoCtx)
{
int rc = VINF_SUCCESS;
PPARALLELSIMAGE pImage = (PPARALLELSIMAGE)pBackendData;
@@ -758,7 +759,7 @@ static int parallelsFlush(void *pBackendData, PVDIOCTX pIoCtx)
}
/** @copydoc VBOXHDDBACKEND::pfnGetVersion */
-static unsigned parallelsGetVersion(void *pBackendData)
+static DECLCALLBACK(unsigned) parallelsGetVersion(void *pBackendData)
{
LogFlowFunc(("pBackendData=%#p\n", pBackendData));
PPARALLELSIMAGE pImage = (PPARALLELSIMAGE)pBackendData;
@@ -772,7 +773,7 @@ static unsigned parallelsGetVersion(void *pBackendData)
}
/** @copydoc VBOXHDDBACKEND::pfnGetSectorSize */
-static uint32_t parallelsGetSectorSize(void *pBackendData)
+static DECLCALLBACK(uint32_t) parallelsGetSectorSize(void *pBackendData)
{
LogFlowFunc(("pBackendData=%#p\n", pBackendData));
PPARALLELSIMAGE pImage = (PPARALLELSIMAGE)pBackendData;
@@ -788,7 +789,7 @@ static uint32_t parallelsGetSectorSize(void *pBackendData)
}
/** @copydoc VBOXHDDBACKEND::pfnGetSize */
-static uint64_t parallelsGetSize(void *pBackendData)
+static DECLCALLBACK(uint64_t) parallelsGetSize(void *pBackendData)
{
LogFlowFunc(("pBackendData=%#p\n", pBackendData));
PPARALLELSIMAGE pImage = (PPARALLELSIMAGE)pBackendData;
@@ -804,7 +805,7 @@ static uint64_t parallelsGetSize(void *pBackendData)
}
/** @copydoc VBOXHDDBACKEND::pfnGetFileSize */
-static uint64_t parallelsGetFileSize(void *pBackendData)
+static DECLCALLBACK(uint64_t) parallelsGetFileSize(void *pBackendData)
{
LogFlowFunc(("pBackendData=%#p\n", pBackendData));
PPARALLELSIMAGE pImage = (PPARALLELSIMAGE)pBackendData;
@@ -820,8 +821,8 @@ static uint64_t parallelsGetFileSize(void *pBackendData)
}
/** @copydoc VBOXHDDBACKEND::pfnGetPCHSGeometry */
-static int parallelsGetPCHSGeometry(void *pBackendData,
- PVDGEOMETRY pPCHSGeometry)
+static DECLCALLBACK(int) parallelsGetPCHSGeometry(void *pBackendData,
+ PVDGEOMETRY pPCHSGeometry)
{
LogFlowFunc(("pBackendData=%#p pPCHSGeometry=%#p\n", pBackendData, pPCHSGeometry));
PPARALLELSIMAGE pImage = (PPARALLELSIMAGE)pBackendData;
@@ -847,8 +848,8 @@ static int parallelsGetPCHSGeometry(void *pBackendData,
}
/** @copydoc VBOXHDDBACKEND::pfnSetPCHSGeometry */
-static int parallelsSetPCHSGeometry(void *pBackendData,
- PCVDGEOMETRY pPCHSGeometry)
+static DECLCALLBACK(int) parallelsSetPCHSGeometry(void *pBackendData,
+ PCVDGEOMETRY pPCHSGeometry)
{
LogFlowFunc(("pBackendData=%#p pPCHSGeometry=%#p PCHS=%u/%u/%u\n", pBackendData, pPCHSGeometry, pPCHSGeometry->cCylinders, pPCHSGeometry->cHeads, pPCHSGeometry->cSectors));
PPARALLELSIMAGE pImage = (PPARALLELSIMAGE)pBackendData;
@@ -876,8 +877,8 @@ out:
}
/** @copydoc VBOXHDDBACKEND::pfnGetLCHSGeometry */
-static int parallelsGetLCHSGeometry(void *pBackendData,
- PVDGEOMETRY pLCHSGeometry)
+static DECLCALLBACK(int) parallelsGetLCHSGeometry(void *pBackendData,
+ PVDGEOMETRY pLCHSGeometry)
{
LogFlowFunc(("pBackendData=%#p pLCHSGeometry=%#p\n", pBackendData, pLCHSGeometry));
PPARALLELSIMAGE pImage = (PPARALLELSIMAGE)pBackendData;
@@ -903,8 +904,8 @@ static int parallelsGetLCHSGeometry(void *pBackendData,
}
/** @copydoc VBOXHDDBACKEND::pfnSetLCHSGeometry */
-static int parallelsSetLCHSGeometry(void *pBackendData,
- PCVDGEOMETRY pLCHSGeometry)
+static DECLCALLBACK(int) parallelsSetLCHSGeometry(void *pBackendData,
+ PCVDGEOMETRY pLCHSGeometry)
{
LogFlowFunc(("pBackendData=%#p pLCHSGeometry=%#p LCHS=%u/%u/%u\n", pBackendData, pLCHSGeometry, pLCHSGeometry->cCylinders, pLCHSGeometry->cHeads, pLCHSGeometry->cSectors));
PPARALLELSIMAGE pImage = (PPARALLELSIMAGE)pBackendData;
@@ -932,7 +933,7 @@ out:
}
/** @copydoc VBOXHDDBACKEND::pfnGetImageFlags */
-static unsigned parallelsGetImageFlags(void *pBackendData)
+static DECLCALLBACK(unsigned) parallelsGetImageFlags(void *pBackendData)
{
LogFlowFunc(("pBackendData=%#p\n", pBackendData));
PPARALLELSIMAGE pImage = (PPARALLELSIMAGE)pBackendData;
@@ -950,7 +951,7 @@ static unsigned parallelsGetImageFlags(void *pBackendData)
}
/** @copydoc VBOXHDDBACKEND::pfnGetOpenFlags */
-static unsigned parallelsGetOpenFlags(void *pBackendData)
+static DECLCALLBACK(unsigned) parallelsGetOpenFlags(void *pBackendData)
{
LogFlowFunc(("pBackendData=%#p\n", pBackendData));
PPARALLELSIMAGE pImage = (PPARALLELSIMAGE)pBackendData;
@@ -968,7 +969,7 @@ static unsigned parallelsGetOpenFlags(void *pBackendData)
}
/** @copydoc VBOXHDDBACKEND::pfnSetOpenFlags */
-static int parallelsSetOpenFlags(void *pBackendData, unsigned uOpenFlags)
+static DECLCALLBACK(int) parallelsSetOpenFlags(void *pBackendData, unsigned uOpenFlags)
{
LogFlowFunc(("pBackendData=%#p\n uOpenFlags=%#x", pBackendData, uOpenFlags));
PPARALLELSIMAGE pImage = (PPARALLELSIMAGE)pBackendData;
@@ -993,8 +994,8 @@ out:
}
/** @copydoc VBOXHDDBACKEND::pfnGetComment */
-static int parallelsGetComment(void *pBackendData, char *pszComment,
- size_t cbComment)
+static DECLCALLBACK(int) parallelsGetComment(void *pBackendData, char *pszComment,
+ size_t cbComment)
{
LogFlowFunc(("pBackendData=%#p pszComment=%#p cbComment=%zu\n", pBackendData, pszComment, cbComment));
PPARALLELSIMAGE pImage = (PPARALLELSIMAGE)pBackendData;
@@ -1012,7 +1013,7 @@ static int parallelsGetComment(void *pBackendData, char *pszComment,
}
/** @copydoc VBOXHDDBACKEND::pfnSetComment */
-static int parallelsSetComment(void *pBackendData, const char *pszComment)
+static DECLCALLBACK(int) parallelsSetComment(void *pBackendData, const char *pszComment)
{
LogFlowFunc(("pBackendData=%#p pszComment=\"%s\"\n", pBackendData, pszComment));
PPARALLELSIMAGE pImage = (PPARALLELSIMAGE)pBackendData;
@@ -1035,7 +1036,7 @@ static int parallelsSetComment(void *pBackendData, const char *pszComment)
}
/** @copydoc VBOXHDDBACKEND::pfnGetUuid */
-static int parallelsGetUuid(void *pBackendData, PRTUUID pUuid)
+static DECLCALLBACK(int) parallelsGetUuid(void *pBackendData, PRTUUID pUuid)
{
LogFlowFunc(("pBackendData=%#p pUuid=%#p\n", pBackendData, pUuid));
PPARALLELSIMAGE pImage = (PPARALLELSIMAGE)pBackendData;
@@ -1053,7 +1054,7 @@ static int parallelsGetUuid(void *pBackendData, PRTUUID pUuid)
}
/** @copydoc VBOXHDDBACKEND::pfnSetUuid */
-static int parallelsSetUuid(void *pBackendData, PCRTUUID pUuid)
+static DECLCALLBACK(int) parallelsSetUuid(void *pBackendData, PCRTUUID pUuid)
{
LogFlowFunc(("pBackendData=%#p Uuid=%RTuuid\n", pBackendData, pUuid));
PPARALLELSIMAGE pImage = (PPARALLELSIMAGE)pBackendData;
@@ -1076,7 +1077,7 @@ static int parallelsSetUuid(void *pBackendData, PCRTUUID pUuid)
}
/** @copydoc VBOXHDDBACKEND::pfnGetModificationUuid */
-static int parallelsGetModificationUuid(void *pBackendData, PRTUUID pUuid)
+static DECLCALLBACK(int) parallelsGetModificationUuid(void *pBackendData, PRTUUID pUuid)
{
LogFlowFunc(("pBackendData=%#p pUuid=%#p\n", pBackendData, pUuid));
PPARALLELSIMAGE pImage = (PPARALLELSIMAGE)pBackendData;
@@ -1094,7 +1095,7 @@ static int parallelsGetModificationUuid(void *pBackendData, PRTUUID pUuid)
}
/** @copydoc VBOXHDDBACKEND::pfnSetModificationUuid */
-static int parallelsSetModificationUuid(void *pBackendData, PCRTUUID pUuid)
+static DECLCALLBACK(int) parallelsSetModificationUuid(void *pBackendData, PCRTUUID pUuid)
{
LogFlowFunc(("pBackendData=%#p Uuid=%RTuuid\n", pBackendData, pUuid));
PPARALLELSIMAGE pImage = (PPARALLELSIMAGE)pBackendData;
@@ -1117,7 +1118,7 @@ static int parallelsSetModificationUuid(void *pBackendData, PCRTUUID pUuid)
}
/** @copydoc VBOXHDDBACKEND::pfnGetParentUuid */
-static int parallelsGetParentUuid(void *pBackendData, PRTUUID pUuid)
+static DECLCALLBACK(int) parallelsGetParentUuid(void *pBackendData, PRTUUID pUuid)
{
LogFlowFunc(("pBackendData=%#p pUuid=%#p\n", pBackendData, pUuid));
PPARALLELSIMAGE pImage = (PPARALLELSIMAGE)pBackendData;
@@ -1135,7 +1136,7 @@ static int parallelsGetParentUuid(void *pBackendData, PRTUUID pUuid)
}
/** @copydoc VBOXHDDBACKEND::pfnSetParentUuid */
-static int parallelsSetParentUuid(void *pBackendData, PCRTUUID pUuid)
+static DECLCALLBACK(int) parallelsSetParentUuid(void *pBackendData, PCRTUUID pUuid)
{
LogFlowFunc(("pBackendData=%#p Uuid=%RTuuid\n", pBackendData, pUuid));
PPARALLELSIMAGE pImage = (PPARALLELSIMAGE)pBackendData;
@@ -1158,7 +1159,7 @@ static int parallelsSetParentUuid(void *pBackendData, PCRTUUID pUuid)
}
/** @copydoc VBOXHDDBACKEND::pfnGetParentModificationUuid */
-static int parallelsGetParentModificationUuid(void *pBackendData, PRTUUID pUuid)
+static DECLCALLBACK(int) parallelsGetParentModificationUuid(void *pBackendData, PRTUUID pUuid)
{
LogFlowFunc(("pBackendData=%#p pUuid=%#p\n", pBackendData, pUuid));
PPARALLELSIMAGE pImage = (PPARALLELSIMAGE)pBackendData;
@@ -1176,7 +1177,7 @@ static int parallelsGetParentModificationUuid(void *pBackendData, PRTUUID pUuid)
}
/** @copydoc VBOXHDDBACKEND::pfnSetParentModificationUuid */
-static int parallelsSetParentModificationUuid(void *pBackendData, PCRTUUID pUuid)
+static DECLCALLBACK(int) parallelsSetParentModificationUuid(void *pBackendData, PCRTUUID pUuid)
{
LogFlowFunc(("pBackendData=%#p Uuid=%RTuuid\n", pBackendData, pUuid));
PPARALLELSIMAGE pImage = (PPARALLELSIMAGE)pBackendData;
@@ -1199,7 +1200,7 @@ static int parallelsSetParentModificationUuid(void *pBackendData, PCRTUUID pUuid
}
/** @copydoc VBOXHDDBACKEND::pfnDump */
-static void parallelsDump(void *pBackendData)
+static DECLCALLBACK(void) parallelsDump(void *pBackendData)
{
PPARALLELSIMAGE pImage = (PPARALLELSIMAGE)pBackendData;
diff --git a/src/VBox/Storage/QCOW.cpp b/src/VBox/Storage/QCOW.cpp
index ae483b4..7a7209f 100644
--- a/src/VBox/Storage/QCOW.cpp
+++ b/src/VBox/Storage/QCOW.cpp
@@ -15,9 +15,10 @@
* hope that it will be useful, but WITHOUT ANY WARRANTY of any kind.
*/
-/*******************************************************************************
-* Header Files *
-*******************************************************************************/
+
+/*********************************************************************************************************************************
+* Header Files *
+*********************************************************************************************************************************/
#define LOG_GROUP LOG_GROUP_VD_QCOW
#include <VBox/vd-plugin.h>
#include <VBox/err.h>
@@ -46,9 +47,10 @@
* - resizing
*/
-/*******************************************************************************
-* Structures in a QCOW image, big endian *
-*******************************************************************************/
+
+/*********************************************************************************************************************************
+* Structures in a QCOW image, big endian *
+*********************************************************************************************************************************/
#pragma pack(1)
typedef struct QCowHeader
@@ -130,9 +132,9 @@ typedef QCowHeader *PQCowHeader;
#define QCOW_V2_COMPRESSED_FLAG RT_BIT_64(62)
-/*******************************************************************************
-* Constants And Macros, Structures and Typedefs *
-*******************************************************************************/
+/*********************************************************************************************************************************
+* Constants And Macros, Structures and Typedefs *
+*********************************************************************************************************************************/
/**
* QCOW L2 cache entry.
@@ -287,9 +289,10 @@ typedef struct QCOWCLUSTERASYNCALLOC
size_t cbToWrite;
} QCOWCLUSTERASYNCALLOC, *PQCOWCLUSTERASYNCALLOC;
-/*******************************************************************************
-* Static Variables *
-*******************************************************************************/
+
+/*********************************************************************************************************************************
+* Static Variables *
+*********************************************************************************************************************************/
/** NULL-terminated array of supported file extensions. */
static const VDFILEEXTENSION s_aQCowFileExtensions[] =
@@ -299,9 +302,10 @@ static const VDFILEEXTENSION s_aQCowFileExtensions[] =
{NULL, VDTYPE_INVALID}
};
-/*******************************************************************************
-* Internal Functions *
-*******************************************************************************/
+
+/*********************************************************************************************************************************
+* Internal Functions *
+*********************************************************************************************************************************/
/**
* Return power of 2 or 0 if num error.
@@ -1435,8 +1439,8 @@ static DECLCALLBACK(int) qcowAsyncClusterAllocUpdate(void *pBackendData, PVDIOCT
}
/** @copydoc VBOXHDDBACKEND::pfnCheckIfValid */
-static int qcowCheckIfValid(const char *pszFilename, PVDINTERFACE pVDIfsDisk,
- PVDINTERFACE pVDIfsImage, VDTYPE *penmType)
+static DECLCALLBACK(int) qcowCheckIfValid(const char *pszFilename, PVDINTERFACE pVDIfsDisk,
+ PVDINTERFACE pVDIfsImage, VDTYPE *penmType)
{
LogFlowFunc(("pszFilename=\"%s\" pVDIfsDisk=%#p pVDIfsImage=%#p\n", pszFilename, pVDIfsDisk, pVDIfsImage));
PVDIOSTORAGE pStorage = NULL;
@@ -1491,9 +1495,9 @@ out:
}
/** @copydoc VBOXHDDBACKEND::pfnOpen */
-static int qcowOpen(const char *pszFilename, unsigned uOpenFlags,
- PVDINTERFACE pVDIfsDisk, PVDINTERFACE pVDIfsImage,
- VDTYPE enmType, void **ppBackendData)
+static DECLCALLBACK(int) qcowOpen(const char *pszFilename, unsigned uOpenFlags,
+ PVDINTERFACE pVDIfsDisk, PVDINTERFACE pVDIfsImage,
+ VDTYPE enmType, void **ppBackendData)
{
LogFlowFunc(("pszFilename=\"%s\" uOpenFlags=%#x pVDIfsDisk=%#p pVDIfsImage=%#p enmType=%u ppBackendData=%#p\n", pszFilename, uOpenFlags, pVDIfsDisk, pVDIfsImage, enmType, ppBackendData));
int rc;
@@ -1540,14 +1544,14 @@ out:
}
/** @copydoc VBOXHDDBACKEND::pfnCreate */
-static int qcowCreate(const char *pszFilename, uint64_t cbSize,
- unsigned uImageFlags, const char *pszComment,
- PCVDGEOMETRY pPCHSGeometry, PCVDGEOMETRY pLCHSGeometry,
- PCRTUUID pUuid, unsigned uOpenFlags,
- unsigned uPercentStart, unsigned uPercentSpan,
- PVDINTERFACE pVDIfsDisk, PVDINTERFACE pVDIfsImage,
- PVDINTERFACE pVDIfsOperation, VDTYPE enmType,
- void **ppBackendData)
+static DECLCALLBACK(int) qcowCreate(const char *pszFilename, uint64_t cbSize,
+ unsigned uImageFlags, const char *pszComment,
+ PCVDGEOMETRY pPCHSGeometry, PCVDGEOMETRY pLCHSGeometry,
+ PCRTUUID pUuid, unsigned uOpenFlags,
+ unsigned uPercentStart, unsigned uPercentSpan,
+ PVDINTERFACE pVDIfsDisk, PVDINTERFACE pVDIfsImage,
+ PVDINTERFACE pVDIfsOperation, VDTYPE enmType,
+ void **ppBackendData)
{
LogFlowFunc(("pszFilename=\"%s\" cbSize=%llu uImageFlags=%#x pszComment=\"%s\" pPCHSGeometry=%#p pLCHSGeometry=%#p Uuid=%RTuuid uOpenFlags=%#x uPercentStart=%u uPercentSpan=%u pVDIfsDisk=%#p pVDIfsImage=%#p pVDIfsOperation=%#p enmType=%u ppBackendData=%#p",
pszFilename, cbSize, uImageFlags, pszComment, pPCHSGeometry, pLCHSGeometry, pUuid, uOpenFlags, uPercentStart, uPercentSpan, pVDIfsDisk, pVDIfsImage, pVDIfsOperation, enmType, ppBackendData));
@@ -1626,7 +1630,7 @@ out:
}
/** @copydoc VBOXHDDBACKEND::pfnRename */
-static int qcowRename(void *pBackendData, const char *pszFilename)
+static DECLCALLBACK(int) qcowRename(void *pBackendData, const char *pszFilename)
{
LogFlowFunc(("pBackendData=%#p pszFilename=%#p\n", pBackendData, pszFilename));
int rc = VINF_SUCCESS;
@@ -1672,7 +1676,7 @@ out:
}
/** @copydoc VBOXHDDBACKEND::pfnClose */
-static int qcowClose(void *pBackendData, bool fDelete)
+static DECLCALLBACK(int) qcowClose(void *pBackendData, bool fDelete)
{
LogFlowFunc(("pBackendData=%#p fDelete=%d\n", pBackendData, fDelete));
PQCOWIMAGE pImage = (PQCOWIMAGE)pBackendData;
@@ -1685,7 +1689,7 @@ static int qcowClose(void *pBackendData, bool fDelete)
return rc;
}
-static int qcowRead(void *pBackendData, uint64_t uOffset, size_t cbToRead,
+static DECLCALLBACK(int) qcowRead(void *pBackendData, uint64_t uOffset, size_t cbToRead,
PVDIOCTX pIoCtx, size_t *pcbActuallyRead)
{
LogFlowFunc(("pBackendData=%#p uOffset=%llu pIoCtx=%#p cbToRead=%zu pcbActuallyRead=%#p\n",
@@ -1736,7 +1740,7 @@ out:
return rc;
}
-static int qcowWrite(void *pBackendData, uint64_t uOffset, size_t cbToWrite,
+static DECLCALLBACK(int) qcowWrite(void *pBackendData, uint64_t uOffset, size_t cbToWrite,
PVDIOCTX pIoCtx, size_t *pcbWriteProcess, size_t *pcbPreRead,
size_t *pcbPostRead, unsigned fWrite)
{
@@ -1918,7 +1922,7 @@ out:
return rc;
}
-static int qcowFlush(void *pBackendData, PVDIOCTX pIoCtx)
+static DECLCALLBACK(int) qcowFlush(void *pBackendData, PVDIOCTX pIoCtx)
{
LogFlowFunc(("pBackendData=%#p\n", pBackendData));
PQCOWIMAGE pImage = (PQCOWIMAGE)pBackendData;
@@ -1936,7 +1940,7 @@ static int qcowFlush(void *pBackendData, PVDIOCTX pIoCtx)
}
/** @copydoc VBOXHDDBACKEND::pfnGetVersion */
-static unsigned qcowGetVersion(void *pBackendData)
+static DECLCALLBACK(unsigned) qcowGetVersion(void *pBackendData)
{
LogFlowFunc(("pBackendData=%#p\n", pBackendData));
PQCOWIMAGE pImage = (PQCOWIMAGE)pBackendData;
@@ -1950,7 +1954,7 @@ static unsigned qcowGetVersion(void *pBackendData)
}
/** @copydoc VBOXHDDBACKEND::pfnGetSectorSize */
-static uint32_t qcowGetSectorSize(void *pBackendData)
+static DECLCALLBACK(uint32_t) qcowGetSectorSize(void *pBackendData)
{
LogFlowFunc(("pBackendData=%#p\n", pBackendData));
PQCOWIMAGE pImage = (PQCOWIMAGE)pBackendData;
@@ -1966,7 +1970,7 @@ static uint32_t qcowGetSectorSize(void *pBackendData)
}
/** @copydoc VBOXHDDBACKEND::pfnGetSize */
-static uint64_t qcowGetSize(void *pBackendData)
+static DECLCALLBACK(uint64_t) qcowGetSize(void *pBackendData)
{
LogFlowFunc(("pBackendData=%#p\n", pBackendData));
PQCOWIMAGE pImage = (PQCOWIMAGE)pBackendData;
@@ -1982,7 +1986,7 @@ static uint64_t qcowGetSize(void *pBackendData)
}
/** @copydoc VBOXHDDBACKEND::pfnGetFileSize */
-static uint64_t qcowGetFileSize(void *pBackendData)
+static DECLCALLBACK(uint64_t) qcowGetFileSize(void *pBackendData)
{
LogFlowFunc(("pBackendData=%#p\n", pBackendData));
PQCOWIMAGE pImage = (PQCOWIMAGE)pBackendData;
@@ -2006,7 +2010,7 @@ static uint64_t qcowGetFileSize(void *pBackendData)
}
/** @copydoc VBOXHDDBACKEND::pfnGetPCHSGeometry */
-static int qcowGetPCHSGeometry(void *pBackendData,
+static DECLCALLBACK(int) qcowGetPCHSGeometry(void *pBackendData,
PVDGEOMETRY pPCHSGeometry)
{
LogFlowFunc(("pBackendData=%#p pPCHSGeometry=%#p\n", pBackendData, pPCHSGeometry));
@@ -2033,7 +2037,7 @@ static int qcowGetPCHSGeometry(void *pBackendData,
}
/** @copydoc VBOXHDDBACKEND::pfnSetPCHSGeometry */
-static int qcowSetPCHSGeometry(void *pBackendData,
+static DECLCALLBACK(int) qcowSetPCHSGeometry(void *pBackendData,
PCVDGEOMETRY pPCHSGeometry)
{
LogFlowFunc(("pBackendData=%#p pPCHSGeometry=%#p PCHS=%u/%u/%u\n", pBackendData, pPCHSGeometry, pPCHSGeometry->cCylinders, pPCHSGeometry->cHeads, pPCHSGeometry->cSectors));
@@ -2062,7 +2066,7 @@ out:
}
/** @copydoc VBOXHDDBACKEND::pfnGetLCHSGeometry */
-static int qcowGetLCHSGeometry(void *pBackendData,
+static DECLCALLBACK(int) qcowGetLCHSGeometry(void *pBackendData,
PVDGEOMETRY pLCHSGeometry)
{
LogFlowFunc(("pBackendData=%#p pLCHSGeometry=%#p\n", pBackendData, pLCHSGeometry));
@@ -2089,7 +2093,7 @@ static int qcowGetLCHSGeometry(void *pBackendData,
}
/** @copydoc VBOXHDDBACKEND::pfnSetLCHSGeometry */
-static int qcowSetLCHSGeometry(void *pBackendData,
+static DECLCALLBACK(int) qcowSetLCHSGeometry(void *pBackendData,
PCVDGEOMETRY pLCHSGeometry)
{
LogFlowFunc(("pBackendData=%#p pLCHSGeometry=%#p LCHS=%u/%u/%u\n", pBackendData, pLCHSGeometry, pLCHSGeometry->cCylinders, pLCHSGeometry->cHeads, pLCHSGeometry->cSectors));
@@ -2118,7 +2122,7 @@ out:
}
/** @copydoc VBOXHDDBACKEND::pfnGetImageFlags */
-static unsigned qcowGetImageFlags(void *pBackendData)
+static DECLCALLBACK(unsigned) qcowGetImageFlags(void *pBackendData)
{
LogFlowFunc(("pBackendData=%#p\n", pBackendData));
PQCOWIMAGE pImage = (PQCOWIMAGE)pBackendData;
@@ -2136,7 +2140,7 @@ static unsigned qcowGetImageFlags(void *pBackendData)
}
/** @copydoc VBOXHDDBACKEND::pfnGetOpenFlags */
-static unsigned qcowGetOpenFlags(void *pBackendData)
+static DECLCALLBACK(unsigned) qcowGetOpenFlags(void *pBackendData)
{
LogFlowFunc(("pBackendData=%#p\n", pBackendData));
PQCOWIMAGE pImage = (PQCOWIMAGE)pBackendData;
@@ -2154,7 +2158,7 @@ static unsigned qcowGetOpenFlags(void *pBackendData)
}
/** @copydoc VBOXHDDBACKEND::pfnSetOpenFlags */
-static int qcowSetOpenFlags(void *pBackendData, unsigned uOpenFlags)
+static DECLCALLBACK(int) qcowSetOpenFlags(void *pBackendData, unsigned uOpenFlags)
{
LogFlowFunc(("pBackendData=%#p\n uOpenFlags=%#x", pBackendData, uOpenFlags));
PQCOWIMAGE pImage = (PQCOWIMAGE)pBackendData;
@@ -2180,7 +2184,7 @@ out:
}
/** @copydoc VBOXHDDBACKEND::pfnGetComment */
-static int qcowGetComment(void *pBackendData, char *pszComment,
+static DECLCALLBACK(int) qcowGetComment(void *pBackendData, char *pszComment,
size_t cbComment)
{
LogFlowFunc(("pBackendData=%#p pszComment=%#p cbComment=%zu\n", pBackendData, pszComment, cbComment));
@@ -2199,7 +2203,7 @@ static int qcowGetComment(void *pBackendData, char *pszComment,
}
/** @copydoc VBOXHDDBACKEND::pfnSetComment */
-static int qcowSetComment(void *pBackendData, const char *pszComment)
+static DECLCALLBACK(int) qcowSetComment(void *pBackendData, const char *pszComment)
{
LogFlowFunc(("pBackendData=%#p pszComment=\"%s\"\n", pBackendData, pszComment));
PQCOWIMAGE pImage = (PQCOWIMAGE)pBackendData;
@@ -2222,7 +2226,7 @@ static int qcowSetComment(void *pBackendData, const char *pszComment)
}
/** @copydoc VBOXHDDBACKEND::pfnGetUuid */
-static int qcowGetUuid(void *pBackendData, PRTUUID pUuid)
+static DECLCALLBACK(int) qcowGetUuid(void *pBackendData, PRTUUID pUuid)
{
LogFlowFunc(("pBackendData=%#p pUuid=%#p\n", pBackendData, pUuid));
PQCOWIMAGE pImage = (PQCOWIMAGE)pBackendData;
@@ -2240,7 +2244,7 @@ static int qcowGetUuid(void *pBackendData, PRTUUID pUuid)
}
/** @copydoc VBOXHDDBACKEND::pfnSetUuid */
-static int qcowSetUuid(void *pBackendData, PCRTUUID pUuid)
+static DECLCALLBACK(int) qcowSetUuid(void *pBackendData, PCRTUUID pUuid)
{
LogFlowFunc(("pBackendData=%#p Uuid=%RTuuid\n", pBackendData, pUuid));
PQCOWIMAGE pImage = (PQCOWIMAGE)pBackendData;
@@ -2264,7 +2268,7 @@ static int qcowSetUuid(void *pBackendData, PCRTUUID pUuid)
}
/** @copydoc VBOXHDDBACKEND::pfnGetModificationUuid */
-static int qcowGetModificationUuid(void *pBackendData, PRTUUID pUuid)
+static DECLCALLBACK(int) qcowGetModificationUuid(void *pBackendData, PRTUUID pUuid)
{
LogFlowFunc(("pBackendData=%#p pUuid=%#p\n", pBackendData, pUuid));
PQCOWIMAGE pImage = (PQCOWIMAGE)pBackendData;
@@ -2282,7 +2286,7 @@ static int qcowGetModificationUuid(void *pBackendData, PRTUUID pUuid)
}
/** @copydoc VBOXHDDBACKEND::pfnSetModificationUuid */
-static int qcowSetModificationUuid(void *pBackendData, PCRTUUID pUuid)
+static DECLCALLBACK(int) qcowSetModificationUuid(void *pBackendData, PCRTUUID pUuid)
{
LogFlowFunc(("pBackendData=%#p Uuid=%RTuuid\n", pBackendData, pUuid));
PQCOWIMAGE pImage = (PQCOWIMAGE)pBackendData;
@@ -2305,7 +2309,7 @@ static int qcowSetModificationUuid(void *pBackendData, PCRTUUID pUuid)
}
/** @copydoc VBOXHDDBACKEND::pfnGetParentUuid */
-static int qcowGetParentUuid(void *pBackendData, PRTUUID pUuid)
+static DECLCALLBACK(int) qcowGetParentUuid(void *pBackendData, PRTUUID pUuid)
{
LogFlowFunc(("pBackendData=%#p pUuid=%#p\n", pBackendData, pUuid));
PQCOWIMAGE pImage = (PQCOWIMAGE)pBackendData;
@@ -2323,7 +2327,7 @@ static int qcowGetParentUuid(void *pBackendData, PRTUUID pUuid)
}
/** @copydoc VBOXHDDBACKEND::pfnSetParentUuid */
-static int qcowSetParentUuid(void *pBackendData, PCRTUUID pUuid)
+static DECLCALLBACK(int) qcowSetParentUuid(void *pBackendData, PCRTUUID pUuid)
{
LogFlowFunc(("pBackendData=%#p Uuid=%RTuuid\n", pBackendData, pUuid));
PQCOWIMAGE pImage = (PQCOWIMAGE)pBackendData;
@@ -2346,7 +2350,7 @@ static int qcowSetParentUuid(void *pBackendData, PCRTUUID pUuid)
}
/** @copydoc VBOXHDDBACKEND::pfnGetParentModificationUuid */
-static int qcowGetParentModificationUuid(void *pBackendData, PRTUUID pUuid)
+static DECLCALLBACK(int) qcowGetParentModificationUuid(void *pBackendData, PRTUUID pUuid)
{
LogFlowFunc(("pBackendData=%#p pUuid=%#p\n", pBackendData, pUuid));
PQCOWIMAGE pImage = (PQCOWIMAGE)pBackendData;
@@ -2364,7 +2368,7 @@ static int qcowGetParentModificationUuid(void *pBackendData, PRTUUID pUuid)
}
/** @copydoc VBOXHDDBACKEND::pfnSetParentModificationUuid */
-static int qcowSetParentModificationUuid(void *pBackendData, PCRTUUID pUuid)
+static DECLCALLBACK(int) qcowSetParentModificationUuid(void *pBackendData, PCRTUUID pUuid)
{
LogFlowFunc(("pBackendData=%#p Uuid=%RTuuid\n", pBackendData, pUuid));
PQCOWIMAGE pImage = (PQCOWIMAGE)pBackendData;
@@ -2387,7 +2391,7 @@ static int qcowSetParentModificationUuid(void *pBackendData, PCRTUUID pUuid)
}
/** @copydoc VBOXHDDBACKEND::pfnDump */
-static void qcowDump(void *pBackendData)
+static DECLCALLBACK(void) qcowDump(void *pBackendData)
{
PQCOWIMAGE pImage = (PQCOWIMAGE)pBackendData;
@@ -2402,7 +2406,7 @@ static void qcowDump(void *pBackendData)
}
/** @copydoc VBOXHDDBACKEND::pfnGetParentFilename */
-static int qcowGetParentFilename(void *pBackendData, char **ppszParentFilename)
+static DECLCALLBACK(int) qcowGetParentFilename(void *pBackendData, char **ppszParentFilename)
{
int rc = VINF_SUCCESS;
PQCOWIMAGE pImage = (PQCOWIMAGE)pBackendData;
@@ -2421,7 +2425,7 @@ static int qcowGetParentFilename(void *pBackendData, char **ppszParentFilename)
}
/** @copydoc VBOXHDDBACKEND::pfnSetParentFilename */
-static int qcowSetParentFilename(void *pBackendData, const char *pszParentFilename)
+static DECLCALLBACK(int) qcowSetParentFilename(void *pBackendData, const char *pszParentFilename)
{
int rc = VINF_SUCCESS;
PQCOWIMAGE pImage = (PQCOWIMAGE)pBackendData;
diff --git a/src/VBox/Storage/QED.cpp b/src/VBox/Storage/QED.cpp
index dac943f..8296802 100644
--- a/src/VBox/Storage/QED.cpp
+++ b/src/VBox/Storage/QED.cpp
@@ -15,9 +15,10 @@
* hope that it will be useful, but WITHOUT ANY WARRANTY of any kind.
*/
-/*******************************************************************************
-* Header Files *
-*******************************************************************************/
+
+/*********************************************************************************************************************************
+* Header Files *
+*********************************************************************************************************************************/
#define LOG_GROUP LOG_GROUP_VD_QED
#include <VBox/vd-plugin.h>
#include <VBox/err.h>
@@ -41,9 +42,10 @@
* - resizing which requires block relocation (very rare case)
*/
-/*******************************************************************************
-* Structures in a QED image, little endian *
-*******************************************************************************/
+
+/*********************************************************************************************************************************
+* Structures in a QED image, little endian *
+*********************************************************************************************************************************/
#pragma pack(1)
typedef struct QedHeader
@@ -118,9 +120,10 @@ typedef QedHeader *PQedHeader;
#define QED_AUTORESET_FEATURE_MASK (0)
/** @} */
-/*******************************************************************************
-* Constants And Macros, Structures and Typedefs *
-*******************************************************************************/
+
+/*********************************************************************************************************************************
+* Constants And Macros, Structures and Typedefs *
+*********************************************************************************************************************************/
/**
* QED L2 cache entry.
@@ -252,9 +255,10 @@ typedef struct QEDCLUSTERASYNCALLOC
size_t cbToWrite;
} QEDCLUSTERASYNCALLOC, *PQEDCLUSTERASYNCALLOC;
-/*******************************************************************************
-* Static Variables *
-*******************************************************************************/
+
+/*********************************************************************************************************************************
+* Static Variables *
+*********************************************************************************************************************************/
/** NULL-terminated array of supported file extensions. */
static const VDFILEEXTENSION s_aQedFileExtensions[] =
@@ -263,9 +267,10 @@ static const VDFILEEXTENSION s_aQedFileExtensions[] =
{NULL, VDTYPE_INVALID}
};
-/*******************************************************************************
-* Internal Functions *
-*******************************************************************************/
+
+/*********************************************************************************************************************************
+* Internal Functions *
+*********************************************************************************************************************************/
/**
* Converts the image header to the host endianess and performs basic checks.
@@ -1528,8 +1533,8 @@ static DECLCALLBACK(int) qedAsyncClusterAllocUpdate(void *pBackendData, PVDIOCTX
}
/** @copydoc VBOXHDDBACKEND::pfnCheckIfValid */
-static int qedCheckIfValid(const char *pszFilename, PVDINTERFACE pVDIfsDisk,
- PVDINTERFACE pVDIfsImage, VDTYPE *penmType)
+static DECLCALLBACK(int) qedCheckIfValid(const char *pszFilename, PVDINTERFACE pVDIfsDisk,
+ PVDINTERFACE pVDIfsImage, VDTYPE *penmType)
{
LogFlowFunc(("pszFilename=\"%s\" pVDIfsDisk=%#p pVDIfsImage=%#p\n", pszFilename, pVDIfsDisk, pVDIfsImage));
PVDIOSTORAGE pStorage = NULL;
@@ -1584,9 +1589,9 @@ out:
}
/** @copydoc VBOXHDDBACKEND::pfnOpen */
-static int qedOpen(const char *pszFilename, unsigned uOpenFlags,
- PVDINTERFACE pVDIfsDisk, PVDINTERFACE pVDIfsImage,
- VDTYPE enmType, void **ppBackendData)
+static DECLCALLBACK(int) qedOpen(const char *pszFilename, unsigned uOpenFlags,
+ PVDINTERFACE pVDIfsDisk, PVDINTERFACE pVDIfsImage,
+ VDTYPE enmType, void **ppBackendData)
{
LogFlowFunc(("pszFilename=\"%s\" uOpenFlags=%#x pVDIfsDisk=%#p pVDIfsImage=%#p enmType=%u ppBackendData=%#p\n", pszFilename, uOpenFlags, pVDIfsDisk, pVDIfsImage, enmType, ppBackendData));
int rc;
@@ -1633,14 +1638,14 @@ out:
}
/** @copydoc VBOXHDDBACKEND::pfnCreate */
-static int qedCreate(const char *pszFilename, uint64_t cbSize,
- unsigned uImageFlags, const char *pszComment,
- PCVDGEOMETRY pPCHSGeometry, PCVDGEOMETRY pLCHSGeometry,
- PCRTUUID pUuid, unsigned uOpenFlags,
- unsigned uPercentStart, unsigned uPercentSpan,
- PVDINTERFACE pVDIfsDisk, PVDINTERFACE pVDIfsImage,
- PVDINTERFACE pVDIfsOperation, VDTYPE enmType,
- void **ppBackendData)
+static DECLCALLBACK(int) qedCreate(const char *pszFilename, uint64_t cbSize,
+ unsigned uImageFlags, const char *pszComment,
+ PCVDGEOMETRY pPCHSGeometry, PCVDGEOMETRY pLCHSGeometry,
+ PCRTUUID pUuid, unsigned uOpenFlags,
+ unsigned uPercentStart, unsigned uPercentSpan,
+ PVDINTERFACE pVDIfsDisk, PVDINTERFACE pVDIfsImage,
+ PVDINTERFACE pVDIfsOperation, VDTYPE enmType,
+ void **ppBackendData)
{
LogFlowFunc(("pszFilename=\"%s\" cbSize=%llu uImageFlags=%#x pszComment=\"%s\" pPCHSGeometry=%#p pLCHSGeometry=%#p Uuid=%RTuuid uOpenFlags=%#x uPercentStart=%u uPercentSpan=%u pVDIfsDisk=%#p pVDIfsImage=%#p pVDIfsOperation=%#p enmType=%d ppBackendData=%#p",
pszFilename, cbSize, uImageFlags, pszComment, pPCHSGeometry, pLCHSGeometry, pUuid, uOpenFlags, uPercentStart, uPercentSpan, pVDIfsDisk, pVDIfsImage, pVDIfsOperation, enmType, ppBackendData));
@@ -1719,7 +1724,7 @@ out:
}
/** @copydoc VBOXHDDBACKEND::pfnRename */
-static int qedRename(void *pBackendData, const char *pszFilename)
+static DECLCALLBACK(int) qedRename(void *pBackendData, const char *pszFilename)
{
LogFlowFunc(("pBackendData=%#p pszFilename=%#p\n", pBackendData, pszFilename));
int rc = VINF_SUCCESS;
@@ -1765,7 +1770,7 @@ out:
}
/** @copydoc VBOXHDDBACKEND::pfnClose */
-static int qedClose(void *pBackendData, bool fDelete)
+static DECLCALLBACK(int) qedClose(void *pBackendData, bool fDelete)
{
LogFlowFunc(("pBackendData=%#p fDelete=%d\n", pBackendData, fDelete));
PQEDIMAGE pImage = (PQEDIMAGE)pBackendData;
@@ -1778,8 +1783,8 @@ static int qedClose(void *pBackendData, bool fDelete)
return rc;
}
-static int qedRead(void *pBackendData, uint64_t uOffset, size_t cbToRead,
- PVDIOCTX pIoCtx, size_t *pcbActuallyRead)
+static DECLCALLBACK(int) qedRead(void *pBackendData, uint64_t uOffset, size_t cbToRead,
+ PVDIOCTX pIoCtx, size_t *pcbActuallyRead)
{
LogFlowFunc(("pBackendData=%#p uOffset=%llu pIoCtx=%#p cbToRead=%zu pcbActuallyRead=%#p\n",
pBackendData, uOffset, pIoCtx, cbToRead, pcbActuallyRead));
@@ -1829,9 +1834,9 @@ out:
return rc;
}
-static int qedWrite(void *pBackendData, uint64_t uOffset, size_t cbToWrite,
- PVDIOCTX pIoCtx, size_t *pcbWriteProcess, size_t *pcbPreRead,
- size_t *pcbPostRead, unsigned fWrite)
+static DECLCALLBACK(int) qedWrite(void *pBackendData, uint64_t uOffset, size_t cbToWrite,
+ PVDIOCTX pIoCtx, size_t *pcbWriteProcess, size_t *pcbPreRead,
+ size_t *pcbPostRead, unsigned fWrite)
{
LogFlowFunc(("pBackendData=%#p uOffset=%llu pIoCtx=%#p cbToWrite=%zu pcbWriteProcess=%#p pcbPreRead=%#p pcbPostRead=%#p\n",
pBackendData, uOffset, pIoCtx, cbToWrite, pcbWriteProcess, pcbPreRead, pcbPostRead));
@@ -2012,7 +2017,7 @@ out:
return rc;
}
-static int qedFlush(void *pBackendData, PVDIOCTX pIoCtx)
+static DECLCALLBACK(int) qedFlush(void *pBackendData, PVDIOCTX pIoCtx)
{
LogFlowFunc(("pBackendData=%#p\n", pBackendData));
PQEDIMAGE pImage = (PQEDIMAGE)pBackendData;
@@ -2030,7 +2035,7 @@ static int qedFlush(void *pBackendData, PVDIOCTX pIoCtx)
}
/** @copydoc VBOXHDDBACKEND::pfnGetVersion */
-static unsigned qedGetVersion(void *pBackendData)
+static DECLCALLBACK(unsigned) qedGetVersion(void *pBackendData)
{
LogFlowFunc(("pBackendData=%#p\n", pBackendData));
PQEDIMAGE pImage = (PQEDIMAGE)pBackendData;
@@ -2044,7 +2049,7 @@ static unsigned qedGetVersion(void *pBackendData)
}
/** @copydoc VBOXHDDBACKEND::pfnGetSectorSize */
-static uint32_t qedGetSectorSize(void *pBackendData)
+static DECLCALLBACK(uint32_t) qedGetSectorSize(void *pBackendData)
{
LogFlowFunc(("pBackendData=%#p\n", pBackendData));
PQEDIMAGE pImage = (PQEDIMAGE)pBackendData;
@@ -2060,7 +2065,7 @@ static uint32_t qedGetSectorSize(void *pBackendData)
}
/** @copydoc VBOXHDDBACKEND::pfnGetSize */
-static uint64_t qedGetSize(void *pBackendData)
+static DECLCALLBACK(uint64_t) qedGetSize(void *pBackendData)
{
LogFlowFunc(("pBackendData=%#p\n", pBackendData));
PQEDIMAGE pImage = (PQEDIMAGE)pBackendData;
@@ -2076,7 +2081,7 @@ static uint64_t qedGetSize(void *pBackendData)
}
/** @copydoc VBOXHDDBACKEND::pfnGetFileSize */
-static uint64_t qedGetFileSize(void *pBackendData)
+static DECLCALLBACK(uint64_t) qedGetFileSize(void *pBackendData)
{
LogFlowFunc(("pBackendData=%#p\n", pBackendData));
PQEDIMAGE pImage = (PQEDIMAGE)pBackendData;
@@ -2100,8 +2105,8 @@ static uint64_t qedGetFileSize(void *pBackendData)
}
/** @copydoc VBOXHDDBACKEND::pfnGetPCHSGeometry */
-static int qedGetPCHSGeometry(void *pBackendData,
- PVDGEOMETRY pPCHSGeometry)
+static DECLCALLBACK(int) qedGetPCHSGeometry(void *pBackendData,
+ PVDGEOMETRY pPCHSGeometry)
{
LogFlowFunc(("pBackendData=%#p pPCHSGeometry=%#p\n", pBackendData, pPCHSGeometry));
PQEDIMAGE pImage = (PQEDIMAGE)pBackendData;
@@ -2127,8 +2132,8 @@ static int qedGetPCHSGeometry(void *pBackendData,
}
/** @copydoc VBOXHDDBACKEND::pfnSetPCHSGeometry */
-static int qedSetPCHSGeometry(void *pBackendData,
- PCVDGEOMETRY pPCHSGeometry)
+static DECLCALLBACK(int) qedSetPCHSGeometry(void *pBackendData,
+ PCVDGEOMETRY pPCHSGeometry)
{
LogFlowFunc(("pBackendData=%#p pPCHSGeometry=%#p PCHS=%u/%u/%u\n", pBackendData, pPCHSGeometry, pPCHSGeometry->cCylinders, pPCHSGeometry->cHeads, pPCHSGeometry->cSectors));
PQEDIMAGE pImage = (PQEDIMAGE)pBackendData;
@@ -2156,8 +2161,8 @@ out:
}
/** @copydoc VBOXHDDBACKEND::pfnGetLCHSGeometry */
-static int qedGetLCHSGeometry(void *pBackendData,
- PVDGEOMETRY pLCHSGeometry)
+static DECLCALLBACK(int) qedGetLCHSGeometry(void *pBackendData,
+ PVDGEOMETRY pLCHSGeometry)
{
LogFlowFunc(("pBackendData=%#p pLCHSGeometry=%#p\n", pBackendData, pLCHSGeometry));
PQEDIMAGE pImage = (PQEDIMAGE)pBackendData;
@@ -2183,8 +2188,8 @@ static int qedGetLCHSGeometry(void *pBackendData,
}
/** @copydoc VBOXHDDBACKEND::pfnSetLCHSGeometry */
-static int qedSetLCHSGeometry(void *pBackendData,
- PCVDGEOMETRY pLCHSGeometry)
+static DECLCALLBACK(int) qedSetLCHSGeometry(void *pBackendData,
+ PCVDGEOMETRY pLCHSGeometry)
{
LogFlowFunc(("pBackendData=%#p pLCHSGeometry=%#p LCHS=%u/%u/%u\n", pBackendData, pLCHSGeometry, pLCHSGeometry->cCylinders, pLCHSGeometry->cHeads, pLCHSGeometry->cSectors));
PQEDIMAGE pImage = (PQEDIMAGE)pBackendData;
@@ -2212,7 +2217,7 @@ out:
}
/** @copydoc VBOXHDDBACKEND::pfnGetImageFlags */
-static unsigned qedGetImageFlags(void *pBackendData)
+static DECLCALLBACK(unsigned) qedGetImageFlags(void *pBackendData)
{
LogFlowFunc(("pBackendData=%#p\n", pBackendData));
PQEDIMAGE pImage = (PQEDIMAGE)pBackendData;
@@ -2230,7 +2235,7 @@ static unsigned qedGetImageFlags(void *pBackendData)
}
/** @copydoc VBOXHDDBACKEND::pfnGetOpenFlags */
-static unsigned qedGetOpenFlags(void *pBackendData)
+static DECLCALLBACK(unsigned) qedGetOpenFlags(void *pBackendData)
{
LogFlowFunc(("pBackendData=%#p\n", pBackendData));
PQEDIMAGE pImage = (PQEDIMAGE)pBackendData;
@@ -2248,7 +2253,7 @@ static unsigned qedGetOpenFlags(void *pBackendData)
}
/** @copydoc VBOXHDDBACKEND::pfnSetOpenFlags */
-static int qedSetOpenFlags(void *pBackendData, unsigned uOpenFlags)
+static DECLCALLBACK(int) qedSetOpenFlags(void *pBackendData, unsigned uOpenFlags)
{
LogFlowFunc(("pBackendData=%#p\n uOpenFlags=%#x", pBackendData, uOpenFlags));
PQEDIMAGE pImage = (PQEDIMAGE)pBackendData;
@@ -2274,8 +2279,8 @@ out:
}
/** @copydoc VBOXHDDBACKEND::pfnGetComment */
-static int qedGetComment(void *pBackendData, char *pszComment,
- size_t cbComment)
+static DECLCALLBACK(int) qedGetComment(void *pBackendData, char *pszComment,
+ size_t cbComment)
{
LogFlowFunc(("pBackendData=%#p pszComment=%#p cbComment=%zu\n", pBackendData, pszComment, cbComment));
PQEDIMAGE pImage = (PQEDIMAGE)pBackendData;
@@ -2293,7 +2298,7 @@ static int qedGetComment(void *pBackendData, char *pszComment,
}
/** @copydoc VBOXHDDBACKEND::pfnSetComment */
-static int qedSetComment(void *pBackendData, const char *pszComment)
+static DECLCALLBACK(int) qedSetComment(void *pBackendData, const char *pszComment)
{
LogFlowFunc(("pBackendData=%#p pszComment=\"%s\"\n", pBackendData, pszComment));
PQEDIMAGE pImage = (PQEDIMAGE)pBackendData;
@@ -2316,7 +2321,7 @@ static int qedSetComment(void *pBackendData, const char *pszComment)
}
/** @copydoc VBOXHDDBACKEND::pfnGetUuid */
-static int qedGetUuid(void *pBackendData, PRTUUID pUuid)
+static DECLCALLBACK(int) qedGetUuid(void *pBackendData, PRTUUID pUuid)
{
LogFlowFunc(("pBackendData=%#p pUuid=%#p\n", pBackendData, pUuid));
PQEDIMAGE pImage = (PQEDIMAGE)pBackendData;
@@ -2334,7 +2339,7 @@ static int qedGetUuid(void *pBackendData, PRTUUID pUuid)
}
/** @copydoc VBOXHDDBACKEND::pfnSetUuid */
-static int qedSetUuid(void *pBackendData, PCRTUUID pUuid)
+static DECLCALLBACK(int) qedSetUuid(void *pBackendData, PCRTUUID pUuid)
{
LogFlowFunc(("pBackendData=%#p Uuid=%RTuuid\n", pBackendData, pUuid));
PQEDIMAGE pImage = (PQEDIMAGE)pBackendData;
@@ -2358,7 +2363,7 @@ static int qedSetUuid(void *pBackendData, PCRTUUID pUuid)
}
/** @copydoc VBOXHDDBACKEND::pfnGetModificationUuid */
-static int qedGetModificationUuid(void *pBackendData, PRTUUID pUuid)
+static DECLCALLBACK(int) qedGetModificationUuid(void *pBackendData, PRTUUID pUuid)
{
LogFlowFunc(("pBackendData=%#p pUuid=%#p\n", pBackendData, pUuid));
PQEDIMAGE pImage = (PQEDIMAGE)pBackendData;
@@ -2376,7 +2381,7 @@ static int qedGetModificationUuid(void *pBackendData, PRTUUID pUuid)
}
/** @copydoc VBOXHDDBACKEND::pfnSetModificationUuid */
-static int qedSetModificationUuid(void *pBackendData, PCRTUUID pUuid)
+static DECLCALLBACK(int) qedSetModificationUuid(void *pBackendData, PCRTUUID pUuid)
{
LogFlowFunc(("pBackendData=%#p Uuid=%RTuuid\n", pBackendData, pUuid));
PQEDIMAGE pImage = (PQEDIMAGE)pBackendData;
@@ -2399,7 +2404,7 @@ static int qedSetModificationUuid(void *pBackendData, PCRTUUID pUuid)
}
/** @copydoc VBOXHDDBACKEND::pfnGetParentUuid */
-static int qedGetParentUuid(void *pBackendData, PRTUUID pUuid)
+static DECLCALLBACK(int) qedGetParentUuid(void *pBackendData, PRTUUID pUuid)
{
LogFlowFunc(("pBackendData=%#p pUuid=%#p\n", pBackendData, pUuid));
PQEDIMAGE pImage = (PQEDIMAGE)pBackendData;
@@ -2417,7 +2422,7 @@ static int qedGetParentUuid(void *pBackendData, PRTUUID pUuid)
}
/** @copydoc VBOXHDDBACKEND::pfnSetParentUuid */
-static int qedSetParentUuid(void *pBackendData, PCRTUUID pUuid)
+static DECLCALLBACK(int) qedSetParentUuid(void *pBackendData, PCRTUUID pUuid)
{
LogFlowFunc(("pBackendData=%#p Uuid=%RTuuid\n", pBackendData, pUuid));
PQEDIMAGE pImage = (PQEDIMAGE)pBackendData;
@@ -2440,7 +2445,7 @@ static int qedSetParentUuid(void *pBackendData, PCRTUUID pUuid)
}
/** @copydoc VBOXHDDBACKEND::pfnGetParentModificationUuid */
-static int qedGetParentModificationUuid(void *pBackendData, PRTUUID pUuid)
+static DECLCALLBACK(int) qedGetParentModificationUuid(void *pBackendData, PRTUUID pUuid)
{
LogFlowFunc(("pBackendData=%#p pUuid=%#p\n", pBackendData, pUuid));
PQEDIMAGE pImage = (PQEDIMAGE)pBackendData;
@@ -2458,7 +2463,7 @@ static int qedGetParentModificationUuid(void *pBackendData, PRTUUID pUuid)
}
/** @copydoc VBOXHDDBACKEND::pfnSetParentModificationUuid */
-static int qedSetParentModificationUuid(void *pBackendData, PCRTUUID pUuid)
+static DECLCALLBACK(int) qedSetParentModificationUuid(void *pBackendData, PCRTUUID pUuid)
{
LogFlowFunc(("pBackendData=%#p Uuid=%RTuuid\n", pBackendData, pUuid));
PQEDIMAGE pImage = (PQEDIMAGE)pBackendData;
@@ -2481,7 +2486,7 @@ static int qedSetParentModificationUuid(void *pBackendData, PCRTUUID pUuid)
}
/** @copydoc VBOXHDDBACKEND::pfnDump */
-static void qedDump(void *pBackendData)
+static DECLCALLBACK(void) qedDump(void *pBackendData)
{
PQEDIMAGE pImage = (PQEDIMAGE)pBackendData;
@@ -2496,7 +2501,7 @@ static void qedDump(void *pBackendData)
}
/** @copydoc VBOXHDDBACKEND::pfnGetParentFilename */
-static int qedGetParentFilename(void *pBackendData, char **ppszParentFilename)
+static DECLCALLBACK(int) qedGetParentFilename(void *pBackendData, char **ppszParentFilename)
{
int rc = VINF_SUCCESS;
PQEDIMAGE pImage = (PQEDIMAGE)pBackendData;
@@ -2515,7 +2520,7 @@ static int qedGetParentFilename(void *pBackendData, char **ppszParentFilename)
}
/** @copydoc VBOXHDDBACKEND::pfnSetParentFilename */
-static int qedSetParentFilename(void *pBackendData, const char *pszParentFilename)
+static DECLCALLBACK(int) qedSetParentFilename(void *pBackendData, const char *pszParentFilename)
{
int rc = VINF_SUCCESS;
PQEDIMAGE pImage = (PQEDIMAGE)pBackendData;
@@ -2565,11 +2570,11 @@ static int qedSetParentFilename(void *pBackendData, const char *pszParentFilenam
}
/** @copydoc VBOXHDDBACKEND::pfnResize */
-static int qedResize(void *pBackendData, uint64_t cbSize,
- PCVDGEOMETRY pPCHSGeometry, PCVDGEOMETRY pLCHSGeometry,
- unsigned uPercentStart, unsigned uPercentSpan,
- PVDINTERFACE pVDIfsDisk, PVDINTERFACE pVDIfsImage,
- PVDINTERFACE pVDIfsOperation)
+static DECLCALLBACK(int) qedResize(void *pBackendData, uint64_t cbSize,
+ PCVDGEOMETRY pPCHSGeometry, PCVDGEOMETRY pLCHSGeometry,
+ unsigned uPercentStart, unsigned uPercentSpan,
+ PVDINTERFACE pVDIfsDisk, PVDINTERFACE pVDIfsImage,
+ PVDINTERFACE pVDIfsOperation)
{
PQEDIMAGE pImage = (PQEDIMAGE)pBackendData;
int rc = VINF_SUCCESS;
diff --git a/src/VBox/Storage/RAW.cpp b/src/VBox/Storage/RAW.cpp
index b0c4ec7..fe70d45 100644
--- a/src/VBox/Storage/RAW.cpp
+++ b/src/VBox/Storage/RAW.cpp
@@ -15,9 +15,10 @@
* hope that it will be useful, but WITHOUT ANY WARRANTY of any kind.
*/
-/*******************************************************************************
-* Header Files *
-*******************************************************************************/
+
+/*********************************************************************************************************************************
+* Header Files *
+*********************************************************************************************************************************/
#define LOG_GROUP LOG_GROUP_VD_RAW
#include <VBox/vd-plugin.h>
#include <VBox/err.h>
@@ -29,9 +30,10 @@
#include "VDBackends.h"
-/*******************************************************************************
-* Constants And Macros, Structures and Typedefs *
-*******************************************************************************/
+
+/*********************************************************************************************************************************
+* Constants And Macros, Structures and Typedefs *
+*********************************************************************************************************************************/
/**
* Raw image data structure.
@@ -77,9 +79,10 @@ typedef struct RAWIMAGE
/** The maximum reasonable size of a floppy image (big format 2.88MB medium). */
#define RAW_MAX_FLOPPY_IMG_SIZE (512 * 82 * 48 * 2)
-/*******************************************************************************
-* Static Variables *
-*******************************************************************************/
+
+/*********************************************************************************************************************************
+* Static Variables *
+*********************************************************************************************************************************/
/** NULL-terminated array of supported file extensions. */
static const VDFILEEXTENSION s_aRawFileExtensions[] =
@@ -94,9 +97,10 @@ static const VDFILEEXTENSION s_aRawFileExtensions[] =
{NULL, VDTYPE_INVALID}
};
-/*******************************************************************************
-* Internal Functions *
-*******************************************************************************/
+
+/*********************************************************************************************************************************
+* Internal Functions *
+*********************************************************************************************************************************/
/**
* Internal. Flush image data to disk.
@@ -343,8 +347,8 @@ out:
/** @copydoc VBOXHDDBACKEND::pfnCheckIfValid */
-static int rawCheckIfValid(const char *pszFilename, PVDINTERFACE pVDIfsDisk,
- PVDINTERFACE pVDIfsImage, VDTYPE *penmType)
+static DECLCALLBACK(int) rawCheckIfValid(const char *pszFilename, PVDINTERFACE pVDIfsDisk,
+ PVDINTERFACE pVDIfsImage, VDTYPE *penmType)
{
LogFlowFunc(("pszFilename=\"%s\" pVDIfsDisk=%#p pVDIfsImage=%#p\n", pszFilename, pVDIfsDisk, pVDIfsImage));
PVDIOSTORAGE pStorage = NULL;
@@ -426,9 +430,9 @@ out:
}
/** @copydoc VBOXHDDBACKEND::pfnOpen */
-static int rawOpen(const char *pszFilename, unsigned uOpenFlags,
- PVDINTERFACE pVDIfsDisk, PVDINTERFACE pVDIfsImage,
- VDTYPE enmType, void **ppBackendData)
+static DECLCALLBACK(int) rawOpen(const char *pszFilename, unsigned uOpenFlags,
+ PVDINTERFACE pVDIfsDisk, PVDINTERFACE pVDIfsImage,
+ VDTYPE enmType, void **ppBackendData)
{
LogFlowFunc(("pszFilename=\"%s\" uOpenFlags=%#x pVDIfsDisk=%#p pVDIfsImage=%#p enmType=%u ppBackendData=%#p\n", pszFilename, uOpenFlags, pVDIfsDisk, pVDIfsImage, enmType, ppBackendData));
int rc;
@@ -481,14 +485,14 @@ out:
}
/** @copydoc VBOXHDDBACKEND::pfnCreate */
-static int rawCreate(const char *pszFilename, uint64_t cbSize,
- unsigned uImageFlags, const char *pszComment,
- PCVDGEOMETRY pPCHSGeometry, PCVDGEOMETRY pLCHSGeometry,
- PCRTUUID pUuid, unsigned uOpenFlags,
- unsigned uPercentStart, unsigned uPercentSpan,
- PVDINTERFACE pVDIfsDisk, PVDINTERFACE pVDIfsImage,
- PVDINTERFACE pVDIfsOperation, VDTYPE enmType,
- void **ppBackendData)
+static DECLCALLBACK(int) rawCreate(const char *pszFilename, uint64_t cbSize,
+ unsigned uImageFlags, const char *pszComment,
+ PCVDGEOMETRY pPCHSGeometry, PCVDGEOMETRY pLCHSGeometry,
+ PCRTUUID pUuid, unsigned uOpenFlags,
+ unsigned uPercentStart, unsigned uPercentSpan,
+ PVDINTERFACE pVDIfsDisk, PVDINTERFACE pVDIfsImage,
+ PVDINTERFACE pVDIfsOperation, VDTYPE enmType,
+ void **ppBackendData)
{
LogFlowFunc(("pszFilename=\"%s\" cbSize=%llu uImageFlags=%#x pszComment=\"%s\" pPCHSGeometry=%#p pLCHSGeometry=%#p Uuid=%RTuuid uOpenFlags=%#x uPercentStart=%u uPercentSpan=%u pVDIfsDisk=%#p pVDIfsImage=%#p pVDIfsOperation=%#p enmType=%u ppBackendData=%#p",
pszFilename, cbSize, uImageFlags, pszComment, pPCHSGeometry, pLCHSGeometry, pUuid, uOpenFlags, uPercentStart, uPercentSpan, pVDIfsDisk, pVDIfsImage, pVDIfsOperation, enmType, ppBackendData));
@@ -568,7 +572,7 @@ out:
}
/** @copydoc VBOXHDDBACKEND::pfnRename */
-static int rawRename(void *pBackendData, const char *pszFilename)
+static DECLCALLBACK(int) rawRename(void *pBackendData, const char *pszFilename)
{
LogFlowFunc(("pBackendData=%#p pszFilename=%#p\n", pBackendData, pszFilename));
int rc = VINF_SUCCESS;
@@ -614,7 +618,7 @@ out:
}
/** @copydoc VBOXHDDBACKEND::pfnClose */
-static int rawClose(void *pBackendData, bool fDelete)
+static DECLCALLBACK(int) rawClose(void *pBackendData, bool fDelete)
{
LogFlowFunc(("pBackendData=%#p fDelete=%d\n", pBackendData, fDelete));
PRAWIMAGE pImage = (PRAWIMAGE)pBackendData;
@@ -628,8 +632,8 @@ static int rawClose(void *pBackendData, bool fDelete)
}
/** @copydoc VBOXHDDBACKEND::pfnRead */
-static int rawRead(void *pBackendData, uint64_t uOffset, size_t cbRead,
- PVDIOCTX pIoCtx, size_t *pcbActuallyRead)
+static DECLCALLBACK(int) rawRead(void *pBackendData, uint64_t uOffset, size_t cbRead,
+ PVDIOCTX pIoCtx, size_t *pcbActuallyRead)
{
int rc = VINF_SUCCESS;
PRAWIMAGE pImage = (PRAWIMAGE)pBackendData;
@@ -643,9 +647,9 @@ static int rawRead(void *pBackendData, uint64_t uOffset, size_t cbRead,
}
/** @copydoc VBOXHDDBACKEND::pfnWrite */
-static int rawWrite(void *pBackendData, uint64_t uOffset, size_t cbWrite,
- PVDIOCTX pIoCtx, size_t *pcbWriteProcess, size_t *pcbPreRead,
- size_t *pcbPostRead, unsigned fWrite)
+static DECLCALLBACK(int) rawWrite(void *pBackendData, uint64_t uOffset, size_t cbWrite,
+ PVDIOCTX pIoCtx, size_t *pcbWriteProcess, size_t *pcbPreRead,
+ size_t *pcbPostRead, unsigned fWrite)
{
int rc = VINF_SUCCESS;
PRAWIMAGE pImage = (PRAWIMAGE)pBackendData;
@@ -663,7 +667,7 @@ static int rawWrite(void *pBackendData, uint64_t uOffset, size_t cbWrite,
}
/** @copydoc VBOXHDDBACKEND::pfnFlush */
-static int rawFlush(void *pBackendData, PVDIOCTX pIoCtx)
+static DECLCALLBACK(int) rawFlush(void *pBackendData, PVDIOCTX pIoCtx)
{
int rc = VINF_SUCCESS;
PRAWIMAGE pImage = (PRAWIMAGE)pBackendData;
@@ -676,7 +680,7 @@ static int rawFlush(void *pBackendData, PVDIOCTX pIoCtx)
}
/** @copydoc VBOXHDDBACKEND::pfnGetVersion */
-static unsigned rawGetVersion(void *pBackendData)
+static DECLCALLBACK(unsigned) rawGetVersion(void *pBackendData)
{
LogFlowFunc(("pBackendData=%#p\n", pBackendData));
PRAWIMAGE pImage = (PRAWIMAGE)pBackendData;
@@ -690,7 +694,7 @@ static unsigned rawGetVersion(void *pBackendData)
}
/** @copydoc VBOXHDDBACKEND::pfnGetSize */
-static uint32_t rawGetSectorSize(void *pBackendData)
+static DECLCALLBACK(uint32_t) rawGetSectorSize(void *pBackendData)
{
LogFlowFunc(("pBackendData=%#p\n", pBackendData));
PRAWIMAGE pImage = (PRAWIMAGE)pBackendData;
@@ -706,7 +710,7 @@ static uint32_t rawGetSectorSize(void *pBackendData)
}
/** @copydoc VBOXHDDBACKEND::pfnGetSize */
-static uint64_t rawGetSize(void *pBackendData)
+static DECLCALLBACK(uint64_t) rawGetSize(void *pBackendData)
{
LogFlowFunc(("pBackendData=%#p\n", pBackendData));
PRAWIMAGE pImage = (PRAWIMAGE)pBackendData;
@@ -722,7 +726,7 @@ static uint64_t rawGetSize(void *pBackendData)
}
/** @copydoc VBOXHDDBACKEND::pfnGetFileSize */
-static uint64_t rawGetFileSize(void *pBackendData)
+static DECLCALLBACK(uint64_t) rawGetFileSize(void *pBackendData)
{
LogFlowFunc(("pBackendData=%#p\n", pBackendData));
PRAWIMAGE pImage = (PRAWIMAGE)pBackendData;
@@ -746,8 +750,8 @@ static uint64_t rawGetFileSize(void *pBackendData)
}
/** @copydoc VBOXHDDBACKEND::pfnGetPCHSGeometry */
-static int rawGetPCHSGeometry(void *pBackendData,
- PVDGEOMETRY pPCHSGeometry)
+static DECLCALLBACK(int) rawGetPCHSGeometry(void *pBackendData,
+ PVDGEOMETRY pPCHSGeometry)
{
LogFlowFunc(("pBackendData=%#p pPCHSGeometry=%#p\n", pBackendData, pPCHSGeometry));
PRAWIMAGE pImage = (PRAWIMAGE)pBackendData;
@@ -773,8 +777,8 @@ static int rawGetPCHSGeometry(void *pBackendData,
}
/** @copydoc VBOXHDDBACKEND::pfnSetPCHSGeometry */
-static int rawSetPCHSGeometry(void *pBackendData,
- PCVDGEOMETRY pPCHSGeometry)
+static DECLCALLBACK(int) rawSetPCHSGeometry(void *pBackendData,
+ PCVDGEOMETRY pPCHSGeometry)
{
LogFlowFunc(("pBackendData=%#p pPCHSGeometry=%#p PCHS=%u/%u/%u\n", pBackendData, pPCHSGeometry, pPCHSGeometry->cCylinders, pPCHSGeometry->cHeads, pPCHSGeometry->cSectors));
PRAWIMAGE pImage = (PRAWIMAGE)pBackendData;
@@ -802,8 +806,8 @@ out:
}
/** @copydoc VBOXHDDBACKEND::pfnGetLCHSGeometry */
-static int rawGetLCHSGeometry(void *pBackendData,
- PVDGEOMETRY pLCHSGeometry)
+static DECLCALLBACK(int) rawGetLCHSGeometry(void *pBackendData,
+ PVDGEOMETRY pLCHSGeometry)
{
LogFlowFunc(("pBackendData=%#p pLCHSGeometry=%#p\n", pBackendData, pLCHSGeometry));
PRAWIMAGE pImage = (PRAWIMAGE)pBackendData;
@@ -829,8 +833,8 @@ static int rawGetLCHSGeometry(void *pBackendData,
}
/** @copydoc VBOXHDDBACKEND::pfnSetLCHSGeometry */
-static int rawSetLCHSGeometry(void *pBackendData,
- PCVDGEOMETRY pLCHSGeometry)
+static DECLCALLBACK(int) rawSetLCHSGeometry(void *pBackendData,
+ PCVDGEOMETRY pLCHSGeometry)
{
LogFlowFunc(("pBackendData=%#p pLCHSGeometry=%#p LCHS=%u/%u/%u\n", pBackendData, pLCHSGeometry, pLCHSGeometry->cCylinders, pLCHSGeometry->cHeads, pLCHSGeometry->cSectors));
PRAWIMAGE pImage = (PRAWIMAGE)pBackendData;
@@ -858,7 +862,7 @@ out:
}
/** @copydoc VBOXHDDBACKEND::pfnGetImageFlags */
-static unsigned rawGetImageFlags(void *pBackendData)
+static DECLCALLBACK(unsigned) rawGetImageFlags(void *pBackendData)
{
LogFlowFunc(("pBackendData=%#p\n", pBackendData));
PRAWIMAGE pImage = (PRAWIMAGE)pBackendData;
@@ -876,7 +880,7 @@ static unsigned rawGetImageFlags(void *pBackendData)
}
/** @copydoc VBOXHDDBACKEND::pfnGetOpenFlags */
-static unsigned rawGetOpenFlags(void *pBackendData)
+static DECLCALLBACK(unsigned) rawGetOpenFlags(void *pBackendData)
{
LogFlowFunc(("pBackendData=%#p\n", pBackendData));
PRAWIMAGE pImage = (PRAWIMAGE)pBackendData;
@@ -894,7 +898,7 @@ static unsigned rawGetOpenFlags(void *pBackendData)
}
/** @copydoc VBOXHDDBACKEND::pfnSetOpenFlags */
-static int rawSetOpenFlags(void *pBackendData, unsigned uOpenFlags)
+static DECLCALLBACK(int) rawSetOpenFlags(void *pBackendData, unsigned uOpenFlags)
{
LogFlowFunc(("pBackendData=%#p\n uOpenFlags=%#x", pBackendData, uOpenFlags));
PRAWIMAGE pImage = (PRAWIMAGE)pBackendData;
@@ -921,8 +925,8 @@ out:
}
/** @copydoc VBOXHDDBACKEND::pfnGetComment */
-static int rawGetComment(void *pBackendData, char *pszComment,
- size_t cbComment)
+static DECLCALLBACK(int) rawGetComment(void *pBackendData, char *pszComment,
+ size_t cbComment)
{
LogFlowFunc(("pBackendData=%#p pszComment=%#p cbComment=%zu\n", pBackendData, pszComment, cbComment));
PRAWIMAGE pImage = (PRAWIMAGE)pBackendData;
@@ -940,7 +944,7 @@ static int rawGetComment(void *pBackendData, char *pszComment,
}
/** @copydoc VBOXHDDBACKEND::pfnSetComment */
-static int rawSetComment(void *pBackendData, const char *pszComment)
+static DECLCALLBACK(int) rawSetComment(void *pBackendData, const char *pszComment)
{
LogFlowFunc(("pBackendData=%#p pszComment=\"%s\"\n", pBackendData, pszComment));
PRAWIMAGE pImage = (PRAWIMAGE)pBackendData;
@@ -963,7 +967,7 @@ static int rawSetComment(void *pBackendData, const char *pszComment)
}
/** @copydoc VBOXHDDBACKEND::pfnGetUuid */
-static int rawGetUuid(void *pBackendData, PRTUUID pUuid)
+static DECLCALLBACK(int) rawGetUuid(void *pBackendData, PRTUUID pUuid)
{
LogFlowFunc(("pBackendData=%#p pUuid=%#p\n", pBackendData, pUuid));
PRAWIMAGE pImage = (PRAWIMAGE)pBackendData;
@@ -981,7 +985,7 @@ static int rawGetUuid(void *pBackendData, PRTUUID pUuid)
}
/** @copydoc VBOXHDDBACKEND::pfnSetUuid */
-static int rawSetUuid(void *pBackendData, PCRTUUID pUuid)
+static DECLCALLBACK(int) rawSetUuid(void *pBackendData, PCRTUUID pUuid)
{
LogFlowFunc(("pBackendData=%#p Uuid=%RTuuid\n", pBackendData, pUuid));
PRAWIMAGE pImage = (PRAWIMAGE)pBackendData;
@@ -1005,7 +1009,7 @@ static int rawSetUuid(void *pBackendData, PCRTUUID pUuid)
}
/** @copydoc VBOXHDDBACKEND::pfnGetModificationUuid */
-static int rawGetModificationUuid(void *pBackendData, PRTUUID pUuid)
+static DECLCALLBACK(int) rawGetModificationUuid(void *pBackendData, PRTUUID pUuid)
{
LogFlowFunc(("pBackendData=%#p pUuid=%#p\n", pBackendData, pUuid));
PRAWIMAGE pImage = (PRAWIMAGE)pBackendData;
@@ -1023,7 +1027,7 @@ static int rawGetModificationUuid(void *pBackendData, PRTUUID pUuid)
}
/** @copydoc VBOXHDDBACKEND::pfnSetModificationUuid */
-static int rawSetModificationUuid(void *pBackendData, PCRTUUID pUuid)
+static DECLCALLBACK(int) rawSetModificationUuid(void *pBackendData, PCRTUUID pUuid)
{
LogFlowFunc(("pBackendData=%#p Uuid=%RTuuid\n", pBackendData, pUuid));
PRAWIMAGE pImage = (PRAWIMAGE)pBackendData;
@@ -1046,7 +1050,7 @@ static int rawSetModificationUuid(void *pBackendData, PCRTUUID pUuid)
}
/** @copydoc VBOXHDDBACKEND::pfnGetParentUuid */
-static int rawGetParentUuid(void *pBackendData, PRTUUID pUuid)
+static DECLCALLBACK(int) rawGetParentUuid(void *pBackendData, PRTUUID pUuid)
{
LogFlowFunc(("pBackendData=%#p pUuid=%#p\n", pBackendData, pUuid));
PRAWIMAGE pImage = (PRAWIMAGE)pBackendData;
@@ -1064,7 +1068,7 @@ static int rawGetParentUuid(void *pBackendData, PRTUUID pUuid)
}
/** @copydoc VBOXHDDBACKEND::pfnSetParentUuid */
-static int rawSetParentUuid(void *pBackendData, PCRTUUID pUuid)
+static DECLCALLBACK(int) rawSetParentUuid(void *pBackendData, PCRTUUID pUuid)
{
LogFlowFunc(("pBackendData=%#p Uuid=%RTuuid\n", pBackendData, pUuid));
PRAWIMAGE pImage = (PRAWIMAGE)pBackendData;
@@ -1087,7 +1091,7 @@ static int rawSetParentUuid(void *pBackendData, PCRTUUID pUuid)
}
/** @copydoc VBOXHDDBACKEND::pfnGetParentModificationUuid */
-static int rawGetParentModificationUuid(void *pBackendData, PRTUUID pUuid)
+static DECLCALLBACK(int) rawGetParentModificationUuid(void *pBackendData, PRTUUID pUuid)
{
LogFlowFunc(("pBackendData=%#p pUuid=%#p\n", pBackendData, pUuid));
PRAWIMAGE pImage = (PRAWIMAGE)pBackendData;
@@ -1105,7 +1109,7 @@ static int rawGetParentModificationUuid(void *pBackendData, PRTUUID pUuid)
}
/** @copydoc VBOXHDDBACKEND::pfnSetParentModificationUuid */
-static int rawSetParentModificationUuid(void *pBackendData, PCRTUUID pUuid)
+static DECLCALLBACK(int) rawSetParentModificationUuid(void *pBackendData, PCRTUUID pUuid)
{
LogFlowFunc(("pBackendData=%#p Uuid=%RTuuid\n", pBackendData, pUuid));
PRAWIMAGE pImage = (PRAWIMAGE)pBackendData;
@@ -1128,7 +1132,7 @@ static int rawSetParentModificationUuid(void *pBackendData, PCRTUUID pUuid)
}
/** @copydoc VBOXHDDBACKEND::pfnDump */
-static void rawDump(void *pBackendData)
+static DECLCALLBACK(void) rawDump(void *pBackendData)
{
PRAWIMAGE pImage = (PRAWIMAGE)pBackendData;
diff --git a/src/VBox/Storage/VCICache.cpp b/src/VBox/Storage/VCICache.cpp
index 1dade36..dd514b8 100644
--- a/src/VBox/Storage/VCICache.cpp
+++ b/src/VBox/Storage/VCICache.cpp
@@ -15,9 +15,10 @@
* hope that it will be useful, but WITHOUT ANY WARRANTY of any kind.
*/
-/*******************************************************************************
-* Header Files *
-*******************************************************************************/
+
+/*********************************************************************************************************************************
+* Header Files *
+*********************************************************************************************************************************/
#define LOG_GROUP LOG_GROUP_VD_RAW /** @todo logging group */
#include <VBox/vd-cache-backend.h>
#include <VBox/err.h>
@@ -201,9 +202,10 @@ AssertCompileSize(VciBlkMap, VCI_BLOCK_SIZE);
/** Block bitmap entry */
typedef uint8_t VciBlkMapEnt;
-/*******************************************************************************
-* Constants And Macros, Structures and Typedefs *
-*******************************************************************************/
+
+/*********************************************************************************************************************************
+* Constants And Macros, Structures and Typedefs *
+*********************************************************************************************************************************/
/**
* Block range descriptor.
@@ -373,9 +375,10 @@ typedef struct VCICACHE
#define VCIBLKMAP_ALLOC_META RT_BIT(0)
#define VCIBLKMAP_ALLOC_MASK 0x1
-/*******************************************************************************
-* Static Variables *
-*******************************************************************************/
+
+/*********************************************************************************************************************************
+* Static Variables *
+*********************************************************************************************************************************/
/** NULL-terminated array of supported file extensions. */
static const char *const s_apszVciFileExtensions[] =
@@ -384,9 +387,10 @@ static const char *const s_apszVciFileExtensions[] =
NULL
};
-/*******************************************************************************
-* Internal Functions *
-*******************************************************************************/
+
+/*********************************************************************************************************************************
+* Internal Functions *
+*********************************************************************************************************************************/
/**
* Internal. Flush image data to disk.
@@ -1443,8 +1447,8 @@ static int vciCreateImage(PVCICACHE pCache, uint64_t cbSize,
}
/** @copydoc VDCACHEBACKEND::pfnProbe */
-static int vciProbe(const char *pszFilename, PVDINTERFACE pVDIfsCache,
- PVDINTERFACE pVDIfsImage)
+static DECLCALLBACK(int) vciProbe(const char *pszFilename, PVDINTERFACE pVDIfsCache,
+ PVDINTERFACE pVDIfsImage)
{
VciHdr Hdr;
PVDIOSTORAGE pStorage = NULL;
@@ -1500,9 +1504,9 @@ out:
}
/** @copydoc VDCACHEBACKEND::pfnOpen */
-static int vciOpen(const char *pszFilename, unsigned uOpenFlags,
- PVDINTERFACE pVDIfsDisk, PVDINTERFACE pVDIfsImage,
- void **ppBackendData)
+static DECLCALLBACK(int) vciOpen(const char *pszFilename, unsigned uOpenFlags,
+ PVDINTERFACE pVDIfsDisk, PVDINTERFACE pVDIfsImage,
+ void **ppBackendData)
{
LogFlowFunc(("pszFilename=\"%s\" uOpenFlags=%#x pVDIfsDisk=%#p pVDIfsImage=%#p ppBackendData=%#p\n", pszFilename, uOpenFlags, pVDIfsDisk, pVDIfsImage, ppBackendData));
int rc;
@@ -1547,12 +1551,12 @@ out:
}
/** @copydoc VDCACHEBACKEND::pfnCreate */
-static int vciCreate(const char *pszFilename, uint64_t cbSize,
- unsigned uImageFlags, const char *pszComment,
- PCRTUUID pUuid, unsigned uOpenFlags,
- unsigned uPercentStart, unsigned uPercentSpan,
- PVDINTERFACE pVDIfsDisk, PVDINTERFACE pVDIfsImage,
- PVDINTERFACE pVDIfsOperation, void **ppBackendData)
+static DECLCALLBACK(int) vciCreate(const char *pszFilename, uint64_t cbSize,
+ unsigned uImageFlags, const char *pszComment,
+ PCRTUUID pUuid, unsigned uOpenFlags,
+ unsigned uPercentStart, unsigned uPercentSpan,
+ PVDINTERFACE pVDIfsDisk, PVDINTERFACE pVDIfsImage,
+ PVDINTERFACE pVDIfsOperation, void **ppBackendData)
{
LogFlowFunc(("pszFilename=\"%s\" cbSize=%llu uImageFlags=%#x pszComment=\"%s\" Uuid=%RTuuid uOpenFlags=%#x uPercentStart=%u uPercentSpan=%u pVDIfsDisk=%#p pVDIfsImage=%#p pVDIfsOperation=%#p ppBackendData=%#p",
pszFilename, cbSize, uImageFlags, pszComment, pUuid, uOpenFlags, uPercentStart, uPercentSpan, pVDIfsDisk, pVDIfsImage, pVDIfsOperation, ppBackendData));
@@ -1621,7 +1625,7 @@ out:
}
/** @copydoc VDCACHEBACKEND::pfnClose */
-static int vciClose(void *pBackendData, bool fDelete)
+static DECLCALLBACK(int) vciClose(void *pBackendData, bool fDelete)
{
LogFlowFunc(("pBackendData=%#p fDelete=%d\n", pBackendData, fDelete));
PVCICACHE pCache = (PVCICACHE)pBackendData;
@@ -1635,8 +1639,8 @@ static int vciClose(void *pBackendData, bool fDelete)
}
/** @copydoc VDCACHEBACKEND::pfnRead */
-static int vciRead(void *pBackendData, uint64_t uOffset, size_t cbToRead,
- PVDIOCTX pIoCtx, size_t *pcbActuallyRead)
+static DECLCALLBACK(int) vciRead(void *pBackendData, uint64_t uOffset, size_t cbToRead,
+ PVDIOCTX pIoCtx, size_t *pcbActuallyRead)
{
LogFlowFunc(("pBackendData=%#p uOffset=%llu cbToRead=%zu pIoCtx=%#p pcbActuallyRead=%#p\n",
pBackendData, uOffset, cbToRead, pIoCtx, pcbActuallyRead));
@@ -1675,8 +1679,8 @@ static int vciRead(void *pBackendData, uint64_t uOffset, size_t cbToRead,
}
/** @copydoc VDCACHEBACKEND::pfnWrite */
-static int vciWrite(void *pBackendData, uint64_t uOffset, size_t cbToWrite,
- PVDIOCTX pIoCtx, size_t *pcbWriteProcess)
+static DECLCALLBACK(int) vciWrite(void *pBackendData, uint64_t uOffset, size_t cbToWrite,
+ PVDIOCTX pIoCtx, size_t *pcbWriteProcess)
{
LogFlowFunc(("pBackendData=%#p uOffset=%llu cbToWrite=%zu pIoCtx=%#p pcbWriteProcess=%#p\n",
pBackendData, uOffset, cbToWrite, pIoCtx, pcbWriteProcess));
@@ -1701,7 +1705,7 @@ static int vciWrite(void *pBackendData, uint64_t uOffset, size_t cbToWrite,
}
/** @copydoc VDCACHEBACKEND::pfnFlush */
-static int vciFlush(void *pBackendData, PVDIOCTX pIoCtx)
+static DECLCALLBACK(int) vciFlush(void *pBackendData, PVDIOCTX pIoCtx)
{
LogFlowFunc(("pBackendData=%#p\n", pBackendData));
PVCICACHE pCache = (PVCICACHE)pBackendData;
@@ -1713,7 +1717,7 @@ static int vciFlush(void *pBackendData, PVDIOCTX pIoCtx)
}
/** @copydoc VDCACHEBACKEND::pfnGetVersion */
-static unsigned vciGetVersion(void *pBackendData)
+static DECLCALLBACK(unsigned) vciGetVersion(void *pBackendData)
{
LogFlowFunc(("pBackendData=%#p\n", pBackendData));
PVCICACHE pCache = (PVCICACHE)pBackendData;
@@ -1727,7 +1731,7 @@ static unsigned vciGetVersion(void *pBackendData)
}
/** @copydoc VDCACHEBACKEND::pfnGetSize */
-static uint64_t vciGetSize(void *pBackendData)
+static DECLCALLBACK(uint64_t) vciGetSize(void *pBackendData)
{
LogFlowFunc(("pBackendData=%#p\n", pBackendData));
PVCICACHE pCache = (PVCICACHE)pBackendData;
@@ -1743,7 +1747,7 @@ static uint64_t vciGetSize(void *pBackendData)
}
/** @copydoc VDCACHEBACKEND::pfnGetFileSize */
-static uint64_t vciGetFileSize(void *pBackendData)
+static DECLCALLBACK(uint64_t) vciGetFileSize(void *pBackendData)
{
LogFlowFunc(("pBackendData=%#p\n", pBackendData));
PVCICACHE pCache = (PVCICACHE)pBackendData;
@@ -1767,7 +1771,7 @@ static uint64_t vciGetFileSize(void *pBackendData)
}
/** @copydoc VDCACHEBACKEND::pfnGetImageFlags */
-static unsigned vciGetImageFlags(void *pBackendData)
+static DECLCALLBACK(unsigned) vciGetImageFlags(void *pBackendData)
{
LogFlowFunc(("pBackendData=%#p\n", pBackendData));
PVCICACHE pCache = (PVCICACHE)pBackendData;
@@ -1785,7 +1789,7 @@ static unsigned vciGetImageFlags(void *pBackendData)
}
/** @copydoc VDCACHEBACKEND::pfnGetOpenFlags */
-static unsigned vciGetOpenFlags(void *pBackendData)
+static DECLCALLBACK(unsigned) vciGetOpenFlags(void *pBackendData)
{
LogFlowFunc(("pBackendData=%#p\n", pBackendData));
PVCICACHE pCache = (PVCICACHE)pBackendData;
@@ -1803,7 +1807,7 @@ static unsigned vciGetOpenFlags(void *pBackendData)
}
/** @copydoc VDCACHEBACKEND::pfnSetOpenFlags */
-static int vciSetOpenFlags(void *pBackendData, unsigned uOpenFlags)
+static DECLCALLBACK(int) vciSetOpenFlags(void *pBackendData, unsigned uOpenFlags)
{
LogFlowFunc(("pBackendData=%#p\n uOpenFlags=%#x", pBackendData, uOpenFlags));
PVCICACHE pCache = (PVCICACHE)pBackendData;
@@ -1829,8 +1833,8 @@ out:
}
/** @copydoc VDCACHEBACKEND::pfnGetComment */
-static int vciGetComment(void *pBackendData, char *pszComment,
- size_t cbComment)
+static DECLCALLBACK(int) vciGetComment(void *pBackendData, char *pszComment,
+ size_t cbComment)
{
LogFlowFunc(("pBackendData=%#p pszComment=%#p cbComment=%zu\n", pBackendData, pszComment, cbComment));
PVCICACHE pCache = (PVCICACHE)pBackendData;
@@ -1848,7 +1852,7 @@ static int vciGetComment(void *pBackendData, char *pszComment,
}
/** @copydoc VDCACHEBACKEND::pfnSetComment */
-static int vciSetComment(void *pBackendData, const char *pszComment)
+static DECLCALLBACK(int) vciSetComment(void *pBackendData, const char *pszComment)
{
LogFlowFunc(("pBackendData=%#p pszComment=\"%s\"\n", pBackendData, pszComment));
PVCICACHE pCache = (PVCICACHE)pBackendData;
@@ -1871,7 +1875,7 @@ static int vciSetComment(void *pBackendData, const char *pszComment)
}
/** @copydoc VDCACHEBACKEND::pfnGetUuid */
-static int vciGetUuid(void *pBackendData, PRTUUID pUuid)
+static DECLCALLBACK(int) vciGetUuid(void *pBackendData, PRTUUID pUuid)
{
LogFlowFunc(("pBackendData=%#p pUuid=%#p\n", pBackendData, pUuid));
PVCICACHE pCache = (PVCICACHE)pBackendData;
@@ -1889,7 +1893,7 @@ static int vciGetUuid(void *pBackendData, PRTUUID pUuid)
}
/** @copydoc VDCACHEBACKEND::pfnSetUuid */
-static int vciSetUuid(void *pBackendData, PCRTUUID pUuid)
+static DECLCALLBACK(int) vciSetUuid(void *pBackendData, PCRTUUID pUuid)
{
LogFlowFunc(("pBackendData=%#p Uuid=%RTuuid\n", pBackendData, pUuid));
PVCICACHE pCache = (PVCICACHE)pBackendData;
@@ -1913,7 +1917,7 @@ static int vciSetUuid(void *pBackendData, PCRTUUID pUuid)
}
/** @copydoc VDCACHEBACKEND::pfnGetModificationUuid */
-static int vciGetModificationUuid(void *pBackendData, PRTUUID pUuid)
+static DECLCALLBACK(int) vciGetModificationUuid(void *pBackendData, PRTUUID pUuid)
{
LogFlowFunc(("pBackendData=%#p pUuid=%#p\n", pBackendData, pUuid));
PVCICACHE pCache = (PVCICACHE)pBackendData;
@@ -1931,7 +1935,7 @@ static int vciGetModificationUuid(void *pBackendData, PRTUUID pUuid)
}
/** @copydoc VDCACHEBACKEND::pfnSetModificationUuid */
-static int vciSetModificationUuid(void *pBackendData, PCRTUUID pUuid)
+static DECLCALLBACK(int) vciSetModificationUuid(void *pBackendData, PCRTUUID pUuid)
{
LogFlowFunc(("pBackendData=%#p Uuid=%RTuuid\n", pBackendData, pUuid));
PVCICACHE pCache = (PVCICACHE)pBackendData;
@@ -1954,7 +1958,7 @@ static int vciSetModificationUuid(void *pBackendData, PCRTUUID pUuid)
}
/** @copydoc VDCACHEBACKEND::pfnDump */
-static void vciDump(void *pBackendData)
+static DECLCALLBACK(void) vciDump(void *pBackendData)
{
NOREF(pBackendData);
}
diff --git a/src/VBox/Storage/VD.cpp b/src/VBox/Storage/VD.cpp
index b9cde06..b63d085 100644
--- a/src/VBox/Storage/VD.cpp
+++ b/src/VBox/Storage/VD.cpp
@@ -15,9 +15,10 @@
* hope that it will be useful, but WITHOUT ANY WARRANTY of any kind.
*/
-/*******************************************************************************
-* Header Files *
-*******************************************************************************/
+
+/*********************************************************************************************************************************
+* Header Files *
+*********************************************************************************************************************************/
#define LOG_GROUP LOG_GROUP_VD
#include <VBox/vd.h>
#include <VBox/err.h>
@@ -660,11 +661,11 @@ static PCVDFILTERBACKEND *g_apFilterBackends = NULL;
static RTLDRMOD *g_ahFilterBackendPlugins = NULL;
/** Forward declaration of the async discard helper. */
-static int vdDiscardHelperAsync(PVDIOCTX pIoCtx);
-static int vdWriteHelperAsync(PVDIOCTX pIoCtx);
+static DECLCALLBACK(int) vdDiscardHelperAsync(PVDIOCTX pIoCtx);
+static DECLCALLBACK(int) vdWriteHelperAsync(PVDIOCTX pIoCtx);
static void vdDiskProcessBlockedIoCtx(PVBOXHDD pDisk);
static int vdDiskUnlock(PVBOXHDD pDisk, PVDIOCTX pIoCtxRc);
-static DECLCALLBACK(void) vdIoCtxSyncComplete(void *pvUser1, void *pvUser2, int rcReq);
+static void vdIoCtxSyncComplete(void *pvUser1, void *pvUser2, int rcReq);
/**
* internal: add several backends.
@@ -2010,7 +2011,7 @@ static int vdDiskReadHelper(PVBOXHDD pDisk, PVDIMAGE pImage, PVDIMAGE pImagePare
* internal: read the specified amount of data in whatever blocks the backend
* will give us - async version.
*/
-static int vdReadHelperAsync(PVDIOCTX pIoCtx)
+static DECLCALLBACK(int) vdReadHelperAsync(PVDIOCTX pIoCtx)
{
int rc;
PVBOXHDD pDisk = pIoCtx->pDisk;
@@ -2164,8 +2165,8 @@ static int vdReadHelperAsync(PVDIOCTX pIoCtx)
/**
* internal: parent image read wrapper for compacting.
*/
-static int vdParentRead(void *pvUser, uint64_t uOffset, void *pvBuf,
- size_t cbRead)
+static DECLCALLBACK(int) vdParentRead(void *pvUser, uint64_t uOffset, void *pvBuf,
+ size_t cbRead)
{
PVDPARENTSTATEDESC pParentState = (PVDPARENTSTATEDESC)pvUser;
@@ -2521,7 +2522,7 @@ static int vdCopyHelper(PVBOXHDD pDiskFrom, PVDIMAGE pImageFrom, PVBOXHDD pDiskT
/**
* Flush helper async version.
*/
-static int vdSetModifiedHelperAsync(PVDIOCTX pIoCtx)
+static DECLCALLBACK(int) vdSetModifiedHelperAsync(PVDIOCTX pIoCtx)
{
int rc = VINF_SUCCESS;
PVBOXHDD pDisk = pIoCtx->pDisk;
@@ -2586,7 +2587,7 @@ static int vdSetModifiedFlagAsync(PVBOXHDD pDisk, PVDIOCTX pIoCtx)
return rc;
}
-static int vdWriteHelperCommitAsync(PVDIOCTX pIoCtx)
+static DECLCALLBACK(int) vdWriteHelperCommitAsync(PVDIOCTX pIoCtx)
{
int rc = VINF_SUCCESS;
PVDIMAGE pImage = pIoCtx->Req.Io.pImageStart;
@@ -2614,7 +2615,7 @@ static int vdWriteHelperCommitAsync(PVDIOCTX pIoCtx)
return rc;
}
-static int vdWriteHelperOptimizedCmpAndWriteAsync(PVDIOCTX pIoCtx)
+static DECLCALLBACK(int) vdWriteHelperOptimizedCmpAndWriteAsync(PVDIOCTX pIoCtx)
{
int rc = VINF_SUCCESS;
PVDIMAGE pImage = pIoCtx->Req.Io.pImageCur;
@@ -2692,7 +2693,7 @@ static int vdWriteHelperOptimizedCmpAndWriteAsync(PVDIOCTX pIoCtx)
return rc;
}
-static int vdWriteHelperOptimizedPreReadAsync(PVDIOCTX pIoCtx)
+static DECLCALLBACK(int) vdWriteHelperOptimizedPreReadAsync(PVDIOCTX pIoCtx)
{
int rc = VINF_SUCCESS;
@@ -2721,7 +2722,7 @@ static int vdWriteHelperOptimizedPreReadAsync(PVDIOCTX pIoCtx)
* that do not change the data relative to the state as of the parent images.
* All backends which support differential/growing images support this - async version.
*/
-static int vdWriteHelperOptimizedAsync(PVDIOCTX pIoCtx)
+static DECLCALLBACK(int) vdWriteHelperOptimizedAsync(PVDIOCTX pIoCtx)
{
PVBOXHDD pDisk = pIoCtx->pDisk;
uint64_t uOffset = pIoCtx->Type.Child.uOffsetSaved;
@@ -2771,7 +2772,7 @@ static int vdWriteHelperOptimizedAsync(PVDIOCTX pIoCtx)
return VINF_SUCCESS;
}
-static int vdWriteHelperStandardReadImageAsync(PVDIOCTX pIoCtx)
+static DECLCALLBACK(int) vdWriteHelperStandardReadImageAsync(PVDIOCTX pIoCtx)
{
int rc = VINF_SUCCESS;
@@ -2806,7 +2807,7 @@ static int vdWriteHelperStandardReadImageAsync(PVDIOCTX pIoCtx)
return rc;
}
-static int vdWriteHelperStandardAssemble(PVDIOCTX pIoCtx)
+static DECLCALLBACK(int) vdWriteHelperStandardAssemble(PVDIOCTX pIoCtx)
{
int rc = VINF_SUCCESS;
size_t cbPostRead = pIoCtx->Type.Child.cbPostRead;
@@ -2869,7 +2870,7 @@ static int vdWriteHelperStandardAssemble(PVDIOCTX pIoCtx)
return rc;
}
-static int vdWriteHelperStandardPreReadAsync(PVDIOCTX pIoCtx)
+static DECLCALLBACK(int) vdWriteHelperStandardPreReadAsync(PVDIOCTX pIoCtx)
{
int rc = VINF_SUCCESS;
@@ -2891,7 +2892,7 @@ static int vdWriteHelperStandardPreReadAsync(PVDIOCTX pIoCtx)
return rc;
}
-static int vdWriteHelperStandardAsync(PVDIOCTX pIoCtx)
+static DECLCALLBACK(int) vdWriteHelperStandardAsync(PVDIOCTX pIoCtx)
{
PVBOXHDD pDisk = pIoCtx->pDisk;
uint64_t uOffset = pIoCtx->Type.Child.uOffsetSaved;
@@ -2952,7 +2953,7 @@ static int vdWriteHelperStandardAsync(PVDIOCTX pIoCtx)
* internal: write buffer to the image, taking care of block boundaries and
* write optimizations - async version.
*/
-static int vdWriteHelperAsync(PVDIOCTX pIoCtx)
+static DECLCALLBACK(int) vdWriteHelperAsync(PVDIOCTX pIoCtx)
{
int rc;
size_t cbWrite = pIoCtx->Req.Io.cbTransfer;
@@ -3132,7 +3133,7 @@ static int vdWriteHelperAsync(PVDIOCTX pIoCtx)
/**
* Flush helper async version.
*/
-static int vdFlushHelperAsync(PVDIOCTX pIoCtx)
+static DECLCALLBACK(int) vdFlushHelperAsync(PVDIOCTX pIoCtx)
{
int rc = VINF_SUCCESS;
PVBOXHDD pDisk = pIoCtx->pDisk;
@@ -3176,7 +3177,7 @@ static int vdFlushHelperAsync(PVDIOCTX pIoCtx)
* @returns VBox status code.
* @param pIoCtx The I/O context to operate on.
*/
-static int vdDiscardWholeBlockAsync(PVDIOCTX pIoCtx)
+static DECLCALLBACK(int) vdDiscardWholeBlockAsync(PVDIOCTX pIoCtx)
{
int rc = VINF_SUCCESS;
PVBOXHDD pDisk = pIoCtx->pDisk;
@@ -3314,7 +3315,7 @@ static int vdDiscardRemoveBlocksAsync(PVBOXHDD pDisk, PVDIOCTX pIoCtx, size_t cb
* @returns VBox status code.
* @param pIoCtx The I/O context to operate on.
*/
-static int vdDiscardCurrentRangeAsync(PVDIOCTX pIoCtx)
+static DECLCALLBACK(int) vdDiscardCurrentRangeAsync(PVDIOCTX pIoCtx)
{
PVBOXHDD pDisk = pIoCtx->pDisk;
PVDDISCARDSTATE pDiscard = pDisk->pDiscard;
@@ -3387,7 +3388,7 @@ static int vdDiscardCurrentRangeAsync(PVDIOCTX pIoCtx)
* @returns VBox status code.
* @param pIoCtx The I/O context to operate on.
*/
-static int vdDiscardHelperAsync(PVDIOCTX pIoCtx)
+static DECLCALLBACK(int) vdDiscardHelperAsync(PVDIOCTX pIoCtx)
{
int rc = VINF_SUCCESS;
PVBOXHDD pDisk = pIoCtx->pDisk;
@@ -3921,9 +3922,9 @@ out:
/**
* VD async I/O interface open callback.
*/
-static int vdIOOpenFallback(void *pvUser, const char *pszLocation,
- uint32_t fOpen, PFNVDCOMPLETED pfnCompleted,
- void **ppStorage)
+static DECLCALLBACK(int) vdIOOpenFallback(void *pvUser, const char *pszLocation,
+ uint32_t fOpen, PFNVDCOMPLETED pfnCompleted,
+ void **ppStorage)
{
PVDIIOFALLBACKSTORAGE pStorage = (PVDIIOFALLBACKSTORAGE)RTMemAllocZ(sizeof(VDIIOFALLBACKSTORAGE));
@@ -3947,7 +3948,7 @@ static int vdIOOpenFallback(void *pvUser, const char *pszLocation,
/**
* VD async I/O interface close callback.
*/
-static int vdIOCloseFallback(void *pvUser, void *pvStorage)
+static DECLCALLBACK(int) vdIOCloseFallback(void *pvUser, void *pvStorage)
{
PVDIIOFALLBACKSTORAGE pStorage = (PVDIIOFALLBACKSTORAGE)pvStorage;
@@ -3956,22 +3957,22 @@ static int vdIOCloseFallback(void *pvUser, void *pvStorage)
return VINF_SUCCESS;
}
-static int vdIODeleteFallback(void *pvUser, const char *pcszFilename)
+static DECLCALLBACK(int) vdIODeleteFallback(void *pvUser, const char *pcszFilename)
{
return RTFileDelete(pcszFilename);
}
-static int vdIOMoveFallback(void *pvUser, const char *pcszSrc, const char *pcszDst, unsigned fMove)
+static DECLCALLBACK(int) vdIOMoveFallback(void *pvUser, const char *pcszSrc, const char *pcszDst, unsigned fMove)
{
return RTFileMove(pcszSrc, pcszDst, fMove);
}
-static int vdIOGetFreeSpaceFallback(void *pvUser, const char *pcszFilename, int64_t *pcbFreeSpace)
+static DECLCALLBACK(int) vdIOGetFreeSpaceFallback(void *pvUser, const char *pcszFilename, int64_t *pcbFreeSpace)
{
return RTFsQuerySizes(pcszFilename, NULL, pcbFreeSpace, NULL, NULL);
}
-static int vdIOGetModificationTimeFallback(void *pvUser, const char *pcszFilename, PRTTIMESPEC pModificationTime)
+static DECLCALLBACK(int) vdIOGetModificationTimeFallback(void *pvUser, const char *pcszFilename, PRTTIMESPEC pModificationTime)
{
RTFSOBJINFO info;
int rc = RTPathQueryInfo(pcszFilename, &info, RTFSOBJATTRADD_NOTHING);
@@ -3983,7 +3984,7 @@ static int vdIOGetModificationTimeFallback(void *pvUser, const char *pcszFilenam
/**
* VD async I/O interface callback for retrieving the file size.
*/
-static int vdIOGetSizeFallback(void *pvUser, void *pvStorage, uint64_t *pcbSize)
+static DECLCALLBACK(int) vdIOGetSizeFallback(void *pvUser, void *pvStorage, uint64_t *pcbSize)
{
PVDIIOFALLBACKSTORAGE pStorage = (PVDIIOFALLBACKSTORAGE)pvStorage;
@@ -3993,7 +3994,7 @@ static int vdIOGetSizeFallback(void *pvUser, void *pvStorage, uint64_t *pcbSize)
/**
* VD async I/O interface callback for setting the file size.
*/
-static int vdIOSetSizeFallback(void *pvUser, void *pvStorage, uint64_t cbSize)
+static DECLCALLBACK(int) vdIOSetSizeFallback(void *pvUser, void *pvStorage, uint64_t cbSize)
{
PVDIIOFALLBACKSTORAGE pStorage = (PVDIIOFALLBACKSTORAGE)pvStorage;
@@ -4003,7 +4004,7 @@ static int vdIOSetSizeFallback(void *pvUser, void *pvStorage, uint64_t cbSize)
/**
* VD async I/O interface callback for a synchronous write to the file.
*/
-static int vdIOWriteSyncFallback(void *pvUser, void *pvStorage, uint64_t uOffset,
+static DECLCALLBACK(int) vdIOWriteSyncFallback(void *pvUser, void *pvStorage, uint64_t uOffset,
const void *pvBuf, size_t cbWrite, size_t *pcbWritten)
{
PVDIIOFALLBACKSTORAGE pStorage = (PVDIIOFALLBACKSTORAGE)pvStorage;
@@ -4014,7 +4015,7 @@ static int vdIOWriteSyncFallback(void *pvUser, void *pvStorage, uint64_t uOffset
/**
* VD async I/O interface callback for a synchronous read from the file.
*/
-static int vdIOReadSyncFallback(void *pvUser, void *pvStorage, uint64_t uOffset,
+static DECLCALLBACK(int) vdIOReadSyncFallback(void *pvUser, void *pvStorage, uint64_t uOffset,
void *pvBuf, size_t cbRead, size_t *pcbRead)
{
PVDIIOFALLBACKSTORAGE pStorage = (PVDIIOFALLBACKSTORAGE)pvStorage;
@@ -4025,7 +4026,7 @@ static int vdIOReadSyncFallback(void *pvUser, void *pvStorage, uint64_t uOffset,
/**
* VD async I/O interface callback for a synchronous flush of the file data.
*/
-static int vdIOFlushSyncFallback(void *pvUser, void *pvStorage)
+static DECLCALLBACK(int) vdIOFlushSyncFallback(void *pvUser, void *pvStorage)
{
PVDIIOFALLBACKSTORAGE pStorage = (PVDIIOFALLBACKSTORAGE)pvStorage;
@@ -4035,10 +4036,10 @@ static int vdIOFlushSyncFallback(void *pvUser, void *pvStorage)
/**
* VD async I/O interface callback for a asynchronous read from the file.
*/
-static int vdIOReadAsyncFallback(void *pvUser, void *pStorage, uint64_t uOffset,
- PCRTSGSEG paSegments, size_t cSegments,
- size_t cbRead, void *pvCompletion,
- void **ppTask)
+static DECLCALLBACK(int) vdIOReadAsyncFallback(void *pvUser, void *pStorage, uint64_t uOffset,
+ PCRTSGSEG paSegments, size_t cSegments,
+ size_t cbRead, void *pvCompletion,
+ void **ppTask)
{
return VERR_NOT_IMPLEMENTED;
}
@@ -4046,10 +4047,10 @@ static int vdIOReadAsyncFallback(void *pvUser, void *pStorage, uint64_t uOffset,
/**
* VD async I/O interface callback for a asynchronous write to the file.
*/
-static int vdIOWriteAsyncFallback(void *pvUser, void *pStorage, uint64_t uOffset,
- PCRTSGSEG paSegments, size_t cSegments,
- size_t cbWrite, void *pvCompletion,
- void **ppTask)
+static DECLCALLBACK(int) vdIOWriteAsyncFallback(void *pvUser, void *pStorage, uint64_t uOffset,
+ PCRTSGSEG paSegments, size_t cSegments,
+ size_t cbWrite, void *pvCompletion,
+ void **ppTask)
{
return VERR_NOT_IMPLEMENTED;
}
@@ -4057,8 +4058,8 @@ static int vdIOWriteAsyncFallback(void *pvUser, void *pStorage, uint64_t uOffset
/**
* VD async I/O interface callback for a asynchronous flush of the file data.
*/
-static int vdIOFlushAsyncFallback(void *pvUser, void *pStorage,
- void *pvCompletion, void **ppTask)
+static DECLCALLBACK(int) vdIOFlushAsyncFallback(void *pvUser, void *pStorage,
+ void *pvCompletion, void **ppTask)
{
return VERR_NOT_IMPLEMENTED;
}
@@ -4506,7 +4507,7 @@ static void vdXferTryLockDiskDeferIoTask(PVDIOTASK pIoTask)
}
}
-static int vdIOIntReqCompleted(void *pvUser, int rcReq)
+static DECLCALLBACK(int) vdIOIntReqCompleted(void *pvUser, int rcReq)
{
PVDIOTASK pIoTask = (PVDIOTASK)pvUser;
@@ -4520,8 +4521,8 @@ static int vdIOIntReqCompleted(void *pvUser, int rcReq)
/**
* VD I/O interface callback for opening a file.
*/
-static int vdIOIntOpen(void *pvUser, const char *pszLocation,
- unsigned uOpenFlags, PPVDIOSTORAGE ppIoStorage)
+static DECLCALLBACK(int) vdIOIntOpen(void *pvUser, const char *pszLocation,
+ unsigned uOpenFlags, PPVDIOSTORAGE ppIoStorage)
{
int rc = VINF_SUCCESS;
PVDIO pVDIo = (PVDIO)pvUser;
@@ -4554,13 +4555,13 @@ static int vdIOIntOpen(void *pvUser, const char *pszLocation,
return rc;
}
-static int vdIOIntTreeMetaXferDestroy(PAVLRFOFFNODECORE pNode, void *pvUser)
+static DECLCALLBACK(int) vdIOIntTreeMetaXferDestroy(PAVLRFOFFNODECORE pNode, void *pvUser)
{
AssertMsgFailed(("Tree should be empty at this point!\n"));
return VINF_SUCCESS;
}
-static int vdIOIntClose(void *pvUser, PVDIOSTORAGE pIoStorage)
+static DECLCALLBACK(int) vdIOIntClose(void *pvUser, PVDIOSTORAGE pIoStorage)
{
int rc = VINF_SUCCESS;
PVDIO pVDIo = (PVDIO)pvUser;
@@ -4573,55 +4574,55 @@ static int vdIOIntClose(void *pvUser, PVDIOSTORAGE pIoStorage)
return rc;
}
-static int vdIOIntDelete(void *pvUser, const char *pcszFilename)
+static DECLCALLBACK(int) vdIOIntDelete(void *pvUser, const char *pcszFilename)
{
PVDIO pVDIo = (PVDIO)pvUser;
return pVDIo->pInterfaceIo->pfnDelete(pVDIo->pInterfaceIo->Core.pvUser,
pcszFilename);
}
-static int vdIOIntMove(void *pvUser, const char *pcszSrc, const char *pcszDst,
- unsigned fMove)
+static DECLCALLBACK(int) vdIOIntMove(void *pvUser, const char *pcszSrc, const char *pcszDst,
+ unsigned fMove)
{
PVDIO pVDIo = (PVDIO)pvUser;
return pVDIo->pInterfaceIo->pfnMove(pVDIo->pInterfaceIo->Core.pvUser,
pcszSrc, pcszDst, fMove);
}
-static int vdIOIntGetFreeSpace(void *pvUser, const char *pcszFilename,
- int64_t *pcbFreeSpace)
+static DECLCALLBACK(int) vdIOIntGetFreeSpace(void *pvUser, const char *pcszFilename,
+ int64_t *pcbFreeSpace)
{
PVDIO pVDIo = (PVDIO)pvUser;
return pVDIo->pInterfaceIo->pfnGetFreeSpace(pVDIo->pInterfaceIo->Core.pvUser,
pcszFilename, pcbFreeSpace);
}
-static int vdIOIntGetModificationTime(void *pvUser, const char *pcszFilename,
- PRTTIMESPEC pModificationTime)
+static DECLCALLBACK(int) vdIOIntGetModificationTime(void *pvUser, const char *pcszFilename,
+ PRTTIMESPEC pModificationTime)
{
PVDIO pVDIo = (PVDIO)pvUser;
return pVDIo->pInterfaceIo->pfnGetModificationTime(pVDIo->pInterfaceIo->Core.pvUser,
pcszFilename, pModificationTime);
}
-static int vdIOIntGetSize(void *pvUser, PVDIOSTORAGE pIoStorage,
- uint64_t *pcbSize)
+static DECLCALLBACK(int) vdIOIntGetSize(void *pvUser, PVDIOSTORAGE pIoStorage,
+ uint64_t *pcbSize)
{
PVDIO pVDIo = (PVDIO)pvUser;
return pVDIo->pInterfaceIo->pfnGetSize(pVDIo->pInterfaceIo->Core.pvUser,
pIoStorage->pStorage, pcbSize);
}
-static int vdIOIntSetSize(void *pvUser, PVDIOSTORAGE pIoStorage,
- uint64_t cbSize)
+static DECLCALLBACK(int) vdIOIntSetSize(void *pvUser, PVDIOSTORAGE pIoStorage,
+ uint64_t cbSize)
{
PVDIO pVDIo = (PVDIO)pvUser;
return pVDIo->pInterfaceIo->pfnSetSize(pVDIo->pInterfaceIo->Core.pvUser,
pIoStorage->pStorage, cbSize);
}
-static int vdIOIntReadUser(void *pvUser, PVDIOSTORAGE pIoStorage, uint64_t uOffset,
- PVDIOCTX pIoCtx, size_t cbRead)
+static DECLCALLBACK(int) vdIOIntReadUser(void *pvUser, PVDIOSTORAGE pIoStorage, uint64_t uOffset,
+ PVDIOCTX pIoCtx, size_t cbRead)
{
int rc = VINF_SUCCESS;
PVDIO pVDIo = (PVDIO)pvUser;
@@ -4717,9 +4718,9 @@ static int vdIOIntReadUser(void *pvUser, PVDIOSTORAGE pIoStorage, uint64_t uOffs
return rc;
}
-static int vdIOIntWriteUser(void *pvUser, PVDIOSTORAGE pIoStorage, uint64_t uOffset,
- PVDIOCTX pIoCtx, size_t cbWrite, PFNVDXFERCOMPLETED pfnComplete,
- void *pvCompleteUser)
+static DECLCALLBACK(int) vdIOIntWriteUser(void *pvUser, PVDIOSTORAGE pIoStorage, uint64_t uOffset,
+ PVDIOCTX pIoCtx, size_t cbWrite, PFNVDXFERCOMPLETED pfnComplete,
+ void *pvCompleteUser)
{
int rc = VINF_SUCCESS;
PVDIO pVDIo = (PVDIO)pvUser;
@@ -4817,10 +4818,10 @@ static int vdIOIntWriteUser(void *pvUser, PVDIOSTORAGE pIoStorage, uint64_t uOff
return rc;
}
-static int vdIOIntReadMeta(void *pvUser, PVDIOSTORAGE pIoStorage, uint64_t uOffset,
- void *pvBuf, size_t cbRead, PVDIOCTX pIoCtx,
- PPVDMETAXFER ppMetaXfer, PFNVDXFERCOMPLETED pfnComplete,
- void *pvCompleteUser)
+static DECLCALLBACK(int) vdIOIntReadMeta(void *pvUser, PVDIOSTORAGE pIoStorage, uint64_t uOffset,
+ void *pvBuf, size_t cbRead, PVDIOCTX pIoCtx,
+ PPVDMETAXFER ppMetaXfer, PFNVDXFERCOMPLETED pfnComplete,
+ void *pvCompleteUser)
{
PVDIO pVDIo = (PVDIO)pvUser;
PVBOXHDD pDisk = pVDIo->pDisk;
@@ -4939,9 +4940,9 @@ static int vdIOIntReadMeta(void *pvUser, PVDIOSTORAGE pIoStorage, uint64_t uOffs
return rc;
}
-static int vdIOIntWriteMeta(void *pvUser, PVDIOSTORAGE pIoStorage, uint64_t uOffset,
- const void *pvBuf, size_t cbWrite, PVDIOCTX pIoCtx,
- PFNVDXFERCOMPLETED pfnComplete, void *pvCompleteUser)
+static DECLCALLBACK(int) vdIOIntWriteMeta(void *pvUser, PVDIOSTORAGE pIoStorage, uint64_t uOffset,
+ const void *pvBuf, size_t cbWrite, PVDIOCTX pIoCtx,
+ PFNVDXFERCOMPLETED pfnComplete, void *pvCompleteUser)
{
PVDIO pVDIo = (PVDIO)pvUser;
PVBOXHDD pDisk = pVDIo->pDisk;
@@ -5097,7 +5098,7 @@ static int vdIOIntWriteMeta(void *pvUser, PVDIOSTORAGE pIoStorage, uint64_t uOff
return rc;
}
-static void vdIOIntMetaXferRelease(void *pvUser, PVDMETAXFER pMetaXfer)
+static DECLCALLBACK(void) vdIOIntMetaXferRelease(void *pvUser, PVDMETAXFER pMetaXfer)
{
PVDIO pVDIo = (PVDIO)pvUser;
PVBOXHDD pDisk = pVDIo->pDisk;
@@ -5132,8 +5133,8 @@ static void vdIOIntMetaXferRelease(void *pvUser, PVDMETAXFER pMetaXfer)
}
}
-static int vdIOIntFlush(void *pvUser, PVDIOSTORAGE pIoStorage, PVDIOCTX pIoCtx,
- PFNVDXFERCOMPLETED pfnComplete, void *pvCompleteUser)
+static DECLCALLBACK(int) vdIOIntFlush(void *pvUser, PVDIOSTORAGE pIoStorage, PVDIOCTX pIoCtx,
+ PFNVDXFERCOMPLETED pfnComplete, void *pvCompleteUser)
{
PVDIO pVDIo = (PVDIO)pvUser;
PVBOXHDD pDisk = pVDIo->pDisk;
@@ -5209,8 +5210,8 @@ static int vdIOIntFlush(void *pvUser, PVDIOSTORAGE pIoStorage, PVDIOCTX pIoCtx,
return rc;
}
-static size_t vdIOIntIoCtxCopyTo(void *pvUser, PVDIOCTX pIoCtx,
- const void *pvBuf, size_t cbBuf)
+static DECLCALLBACK(size_t) vdIOIntIoCtxCopyTo(void *pvUser, PVDIOCTX pIoCtx,
+ const void *pvBuf, size_t cbBuf)
{
PVDIO pVDIo = (PVDIO)pvUser;
PVBOXHDD pDisk = pVDIo->pDisk;
@@ -5229,8 +5230,8 @@ static size_t vdIOIntIoCtxCopyTo(void *pvUser, PVDIOCTX pIoCtx,
return cbCopied;
}
-static size_t vdIOIntIoCtxCopyFrom(void *pvUser, PVDIOCTX pIoCtx,
- void *pvBuf, size_t cbBuf)
+static DECLCALLBACK(size_t) vdIOIntIoCtxCopyFrom(void *pvUser, PVDIOCTX pIoCtx,
+ void *pvBuf, size_t cbBuf)
{
PVDIO pVDIo = (PVDIO)pvUser;
PVBOXHDD pDisk = pVDIo->pDisk;
@@ -5249,7 +5250,7 @@ static size_t vdIOIntIoCtxCopyFrom(void *pvUser, PVDIOCTX pIoCtx,
return cbCopied;
}
-static size_t vdIOIntIoCtxSet(void *pvUser, PVDIOCTX pIoCtx, int ch, size_t cb)
+static DECLCALLBACK(size_t) vdIOIntIoCtxSet(void *pvUser, PVDIOCTX pIoCtx, int ch, size_t cb)
{
PVDIO pVDIo = (PVDIO)pvUser;
PVBOXHDD pDisk = pVDIo->pDisk;
@@ -5268,9 +5269,9 @@ static size_t vdIOIntIoCtxSet(void *pvUser, PVDIOCTX pIoCtx, int ch, size_t cb)
return cbSet;
}
-static size_t vdIOIntIoCtxSegArrayCreate(void *pvUser, PVDIOCTX pIoCtx,
- PRTSGSEG paSeg, unsigned *pcSeg,
- size_t cbData)
+static DECLCALLBACK(size_t) vdIOIntIoCtxSegArrayCreate(void *pvUser, PVDIOCTX pIoCtx,
+ PRTSGSEG paSeg, unsigned *pcSeg,
+ size_t cbData)
{
PVDIO pVDIo = (PVDIO)pvUser;
PVBOXHDD pDisk = pVDIo->pDisk;
@@ -5290,8 +5291,8 @@ static size_t vdIOIntIoCtxSegArrayCreate(void *pvUser, PVDIOCTX pIoCtx,
return cbCreated;
}
-static void vdIOIntIoCtxCompleted(void *pvUser, PVDIOCTX pIoCtx, int rcReq,
- size_t cbCompleted)
+static DECLCALLBACK(void) vdIOIntIoCtxCompleted(void *pvUser, PVDIOCTX pIoCtx, int rcReq,
+ size_t cbCompleted)
{
PVDIO pVDIo = (PVDIO)pvUser;
PVBOXHDD pDisk = pVDIo->pDisk;
@@ -5359,8 +5360,8 @@ static DECLCALLBACK(size_t) vdIOIntIoCtxGetDataUnitSize(void *pvUser, PVDIOCTX p
/**
* VD I/O interface callback for opening a file (limited version for VDGetFormat).
*/
-static int vdIOIntOpenLimited(void *pvUser, const char *pszLocation,
- uint32_t fOpen, PPVDIOSTORAGE ppIoStorage)
+static DECLCALLBACK(int) vdIOIntOpenLimited(void *pvUser, const char *pszLocation,
+ uint32_t fOpen, PPVDIOSTORAGE ppIoStorage)
{
int rc = VINF_SUCCESS;
PVDINTERFACEIO pInterfaceIo = (PVDINTERFACEIO)pvUser;
@@ -5378,7 +5379,7 @@ static int vdIOIntOpenLimited(void *pvUser, const char *pszLocation,
return rc;
}
-static int vdIOIntCloseLimited(void *pvUser, PVDIOSTORAGE pIoStorage)
+static DECLCALLBACK(int) vdIOIntCloseLimited(void *pvUser, PVDIOSTORAGE pIoStorage)
{
PVDINTERFACEIO pInterfaceIo = (PVDINTERFACEIO)pvUser;
int rc = pInterfaceIo->pfnClose(NULL, pIoStorage->pStorage);
@@ -5387,53 +5388,53 @@ static int vdIOIntCloseLimited(void *pvUser, PVDIOSTORAGE pIoStorage)
return rc;
}
-static int vdIOIntDeleteLimited(void *pvUser, const char *pcszFilename)
+static DECLCALLBACK(int) vdIOIntDeleteLimited(void *pvUser, const char *pcszFilename)
{
PVDINTERFACEIO pInterfaceIo = (PVDINTERFACEIO)pvUser;
return pInterfaceIo->pfnDelete(NULL, pcszFilename);
}
-static int vdIOIntMoveLimited(void *pvUser, const char *pcszSrc,
- const char *pcszDst, unsigned fMove)
+static DECLCALLBACK(int) vdIOIntMoveLimited(void *pvUser, const char *pcszSrc,
+ const char *pcszDst, unsigned fMove)
{
PVDINTERFACEIO pInterfaceIo = (PVDINTERFACEIO)pvUser;
return pInterfaceIo->pfnMove(NULL, pcszSrc, pcszDst, fMove);
}
-static int vdIOIntGetFreeSpaceLimited(void *pvUser, const char *pcszFilename,
- int64_t *pcbFreeSpace)
+static DECLCALLBACK(int) vdIOIntGetFreeSpaceLimited(void *pvUser, const char *pcszFilename,
+ int64_t *pcbFreeSpace)
{
PVDINTERFACEIO pInterfaceIo = (PVDINTERFACEIO)pvUser;
return pInterfaceIo->pfnGetFreeSpace(NULL, pcszFilename, pcbFreeSpace);
}
-static int vdIOIntGetModificationTimeLimited(void *pvUser,
- const char *pcszFilename,
- PRTTIMESPEC pModificationTime)
+static DECLCALLBACK(int) vdIOIntGetModificationTimeLimited(void *pvUser,
+ const char *pcszFilename,
+ PRTTIMESPEC pModificationTime)
{
PVDINTERFACEIO pInterfaceIo = (PVDINTERFACEIO)pvUser;
return pInterfaceIo->pfnGetModificationTime(NULL, pcszFilename, pModificationTime);
}
-static int vdIOIntGetSizeLimited(void *pvUser, PVDIOSTORAGE pIoStorage,
- uint64_t *pcbSize)
+static DECLCALLBACK(int) vdIOIntGetSizeLimited(void *pvUser, PVDIOSTORAGE pIoStorage,
+ uint64_t *pcbSize)
{
PVDINTERFACEIO pInterfaceIo = (PVDINTERFACEIO)pvUser;
return pInterfaceIo->pfnGetSize(NULL, pIoStorage->pStorage, pcbSize);
}
-static int vdIOIntSetSizeLimited(void *pvUser, PVDIOSTORAGE pIoStorage,
- uint64_t cbSize)
+static DECLCALLBACK(int) vdIOIntSetSizeLimited(void *pvUser, PVDIOSTORAGE pIoStorage,
+ uint64_t cbSize)
{
PVDINTERFACEIO pInterfaceIo = (PVDINTERFACEIO)pvUser;
return pInterfaceIo->pfnSetSize(NULL, pIoStorage->pStorage, cbSize);
}
-static int vdIOIntWriteUserLimited(void *pvUser, PVDIOSTORAGE pStorage,
- uint64_t uOffset, PVDIOCTX pIoCtx,
- size_t cbWrite,
- PFNVDXFERCOMPLETED pfnComplete,
- void *pvCompleteUser)
+static DECLCALLBACK(int) vdIOIntWriteUserLimited(void *pvUser, PVDIOSTORAGE pStorage,
+ uint64_t uOffset, PVDIOCTX pIoCtx,
+ size_t cbWrite,
+ PFNVDXFERCOMPLETED pfnComplete,
+ void *pvCompleteUser)
{
NOREF(pvUser);
NOREF(pStorage);
@@ -5445,9 +5446,9 @@ static int vdIOIntWriteUserLimited(void *pvUser, PVDIOSTORAGE pStorage,
AssertMsgFailedReturn(("This needs to be implemented when called\n"), VERR_NOT_IMPLEMENTED);
}
-static int vdIOIntReadUserLimited(void *pvUser, PVDIOSTORAGE pStorage,
- uint64_t uOffset, PVDIOCTX pIoCtx,
- size_t cbRead)
+static DECLCALLBACK(int) vdIOIntReadUserLimited(void *pvUser, PVDIOSTORAGE pStorage,
+ uint64_t uOffset, PVDIOCTX pIoCtx,
+ size_t cbRead)
{
NOREF(pvUser);
NOREF(pStorage);
@@ -5457,11 +5458,11 @@ static int vdIOIntReadUserLimited(void *pvUser, PVDIOSTORAGE pStorage,
AssertMsgFailedReturn(("This needs to be implemented when called\n"), VERR_NOT_IMPLEMENTED);
}
-static int vdIOIntWriteMetaLimited(void *pvUser, PVDIOSTORAGE pStorage,
- uint64_t uOffset, const void *pvBuffer,
- size_t cbBuffer, PVDIOCTX pIoCtx,
- PFNVDXFERCOMPLETED pfnComplete,
- void *pvCompleteUser)
+static DECLCALLBACK(int) vdIOIntWriteMetaLimited(void *pvUser, PVDIOSTORAGE pStorage,
+ uint64_t uOffset, const void *pvBuffer,
+ size_t cbBuffer, PVDIOCTX pIoCtx,
+ PFNVDXFERCOMPLETED pfnComplete,
+ void *pvCompleteUser)
{
PVDINTERFACEIO pInterfaceIo = (PVDINTERFACEIO)pvUser;
@@ -5472,12 +5473,12 @@ static int vdIOIntWriteMetaLimited(void *pvUser, PVDIOSTORAGE pStorage,
return pInterfaceIo->pfnWriteSync(NULL, pStorage->pStorage, uOffset, pvBuffer, cbBuffer, NULL);
}
-static int vdIOIntReadMetaLimited(void *pvUser, PVDIOSTORAGE pStorage,
- uint64_t uOffset, void *pvBuffer,
- size_t cbBuffer, PVDIOCTX pIoCtx,
- PPVDMETAXFER ppMetaXfer,
- PFNVDXFERCOMPLETED pfnComplete,
- void *pvCompleteUser)
+static DECLCALLBACK(int) vdIOIntReadMetaLimited(void *pvUser, PVDIOSTORAGE pStorage,
+ uint64_t uOffset, void *pvBuffer,
+ size_t cbBuffer, PVDIOCTX pIoCtx,
+ PPVDMETAXFER ppMetaXfer,
+ PFNVDXFERCOMPLETED pfnComplete,
+ void *pvCompleteUser)
{
PVDINTERFACEIO pInterfaceIo = (PVDINTERFACEIO)pvUser;
@@ -5496,10 +5497,10 @@ static int vdIOIntMetaXferReleaseLimited(void *pvUser, PVDMETAXFER pMetaXfer)
return VINF_SUCCESS;
}
-static int vdIOIntFlushLimited(void *pvUser, PVDIOSTORAGE pStorage,
- PVDIOCTX pIoCtx,
- PFNVDXFERCOMPLETED pfnComplete,
- void *pvCompleteUser)
+static DECLCALLBACK(int) vdIOIntFlushLimited(void *pvUser, PVDIOSTORAGE pStorage,
+ PVDIOCTX pIoCtx,
+ PFNVDXFERCOMPLETED pfnComplete,
+ void *pvCompleteUser)
{
PVDINTERFACEIO pInterfaceIo = (PVDINTERFACEIO)pvUser;
@@ -5513,7 +5514,7 @@ static int vdIOIntFlushLimited(void *pvUser, PVDIOSTORAGE pStorage,
/**
* internal: send output to the log (unconditionally).
*/
-int vdLogMessage(void *pvUser, const char *pszFormat, va_list args)
+static DECLCALLBACK(int) vdLogMessage(void *pvUser, const char *pszFormat, va_list args)
{
NOREF(pvUser);
RTLogPrintfV(pszFormat, args);
@@ -5645,7 +5646,7 @@ static void vdIfIoIntCallbacksSetup(PVDINTERFACEIOINT pIfIoInt)
/**
* Internally used completion handler for synchronous I/O contexts.
*/
-static DECLCALLBACK(void) vdIoCtxSyncComplete(void *pvUser1, void *pvUser2, int rcReq)
+static void vdIoCtxSyncComplete(void *pvUser1, void *pvUser2, int rcReq)
{
PVBOXHDD pDisk = (PVBOXHDD)pvUser1;
RTSEMEVENT hEvent = (RTSEMEVENT)pvUser2;
@@ -8775,7 +8776,7 @@ VBOXDDU_DECL(int) VDPrepareWithFilters(PVBOXHDD pDisk, PVDINTERFACE pVDIfsOperat
size_t cbPostRead = 0;
rc = pImage->Backend->pfnWrite(pImage->pBackendData, uOffset,
cbThisRead, &IoCtx, &cbThisWrite,
- &cbPreRead, &cbPostRead, VD_WRITE_NO_ALLOC);
+ &cbPreRead, &cbPostRead, 0);
if (RT_FAILURE(rc))
break;
Assert(cbThisWrite == cbThisRead);
@@ -11056,3 +11057,19 @@ VBOXDDU_DECL(int) VDRepair(PVDINTERFACE pVDIfsDisk, PVDINTERFACE pVDIfsImage,
return rc;
}
+/**
+ * generic plugin functions
+ */
+
+/** @copydoc VBOXHDDBACKEND::pfnComposeLocation */
+DECLCALLBACK(int) genericFileComposeLocation(PVDINTERFACE pConfig, char **pszLocation)
+{
+ *pszLocation = NULL;
+ return VINF_SUCCESS;
+}
+/** @copydoc VBOXHDDBACKEND::pfnComposeName */
+DECLCALLBACK(int) genericFileComposeName(PVDINTERFACE pConfig, char **pszName)
+{
+ *pszName = NULL;
+ return VINF_SUCCESS;
+}
diff --git a/src/VBox/Storage/VDI.cpp b/src/VBox/Storage/VDI.cpp
index d61bf2a..eecacad 100644
--- a/src/VBox/Storage/VDI.cpp
+++ b/src/VBox/Storage/VDI.cpp
@@ -15,9 +15,10 @@
* hope that it will be useful, but WITHOUT ANY WARRANTY of any kind.
*/
-/*******************************************************************************
-* Header Files *
-*******************************************************************************/
+
+/*********************************************************************************************************************************
+* Header Files *
+*********************************************************************************************************************************/
#define LOG_GROUP LOG_GROUP_VD_VDI
#include <VBox/vd-plugin.h>
#include "VDICore.h"
@@ -38,9 +39,10 @@
#define SET_ENDIAN_U32(conv, u32) (conv == VDIECONV_H2F ? RT_H2LE_U32(u32) : RT_LE2H_U32(u32))
#define SET_ENDIAN_U64(conv, u64) (conv == VDIECONV_H2F ? RT_H2LE_U64(u64) : RT_LE2H_U64(u64))
-/*******************************************************************************
-* Static Variables *
-*******************************************************************************/
+
+/*********************************************************************************************************************************
+* Static Variables *
+*********************************************************************************************************************************/
/** NULL-terminated array of supported file extensions. */
static const VDFILEEXTENSION s_aVdiFileExtensions[] =
@@ -49,9 +51,10 @@ static const VDFILEEXTENSION s_aVdiFileExtensions[] =
{NULL, VDTYPE_INVALID}
};
-/*******************************************************************************
-* Internal Functions *
-*******************************************************************************/
+
+/*********************************************************************************************************************************
+* Internal Functions *
+*********************************************************************************************************************************/
static unsigned getPowerOfTwo(unsigned uNumber);
static void vdiInitPreHeader(PVDIPREHEADER pPreHdr);
static int vdiValidatePreHeader(PVDIPREHEADER pPreHdr);
@@ -1307,8 +1310,8 @@ static DECLCALLBACK(int) vdiBlockAllocUpdate(void *pBackendData, PVDIOCTX pIoCtx
}
/** @copydoc VBOXHDDBACKEND::pfnCheckIfValid */
-static int vdiCheckIfValid(const char *pszFilename, PVDINTERFACE pVDIfsDisk,
- PVDINTERFACE pVDIfsImage, VDTYPE *penmType)
+static DECLCALLBACK(int) vdiCheckIfValid(const char *pszFilename, PVDINTERFACE pVDIfsDisk,
+ PVDINTERFACE pVDIfsImage, VDTYPE *penmType)
{
LogFlowFunc(("pszFilename=\"%s\"\n", pszFilename));
int rc = VINF_SUCCESS;
@@ -1346,9 +1349,9 @@ out:
}
/** @copydoc VBOXHDDBACKEND::pfnOpen */
-static int vdiOpen(const char *pszFilename, unsigned uOpenFlags,
- PVDINTERFACE pVDIfsDisk, PVDINTERFACE pVDIfsImage,
- VDTYPE enmType, void **ppBackendData)
+static DECLCALLBACK(int) vdiOpen(const char *pszFilename, unsigned uOpenFlags,
+ PVDINTERFACE pVDIfsDisk, PVDINTERFACE pVDIfsImage,
+ VDTYPE enmType, void **ppBackendData)
{
LogFlowFunc(("pszFilename=\"%s\" uOpenFlags=%#x pVDIfsDisk=%#p pVDIfsImage=%#p enmType=%u ppBackendData=%#p\n", pszFilename, uOpenFlags, pVDIfsDisk, pVDIfsImage, enmType, ppBackendData));
int rc;
@@ -1395,14 +1398,14 @@ out:
}
/** @copydoc VBOXHDDBACKEND::pfnCreate */
-static int vdiCreate(const char *pszFilename, uint64_t cbSize,
- unsigned uImageFlags, const char *pszComment,
- PCVDGEOMETRY pPCHSGeometry, PCVDGEOMETRY pLCHSGeometry,
- PCRTUUID pUuid, unsigned uOpenFlags,
- unsigned uPercentStart, unsigned uPercentSpan,
- PVDINTERFACE pVDIfsDisk, PVDINTERFACE pVDIfsImage,
- PVDINTERFACE pVDIfsOperation, VDTYPE enmType,
- void **ppBackendData)
+static DECLCALLBACK(int) vdiCreate(const char *pszFilename, uint64_t cbSize,
+ unsigned uImageFlags, const char *pszComment,
+ PCVDGEOMETRY pPCHSGeometry, PCVDGEOMETRY pLCHSGeometry,
+ PCRTUUID pUuid, unsigned uOpenFlags,
+ unsigned uPercentStart, unsigned uPercentSpan,
+ PVDINTERFACE pVDIfsDisk, PVDINTERFACE pVDIfsImage,
+ PVDINTERFACE pVDIfsOperation, VDTYPE enmType,
+ void **ppBackendData)
{
LogFlowFunc(("pszFilename=\"%s\" cbSize=%llu uImageFlags=%#x pszComment=\"%s\" pPCHSGeometry=%#p pLCHSGeometry=%#p Uuid=%RTuuid uOpenFlags=%#x uPercentStart=%u uPercentSpan=%u pVDIfsDisk=%#p pVDIfsImage=%#p pVDIfsOperation=%#p enmType=%u ppBackendData=%#p\n",
pszFilename, cbSize, uImageFlags, pszComment, pPCHSGeometry, pLCHSGeometry, pUuid, uOpenFlags, uPercentStart, uPercentSpan, pVDIfsDisk, pVDIfsImage, pVDIfsOperation, enmType, ppBackendData));
@@ -1502,7 +1505,7 @@ out:
}
/** @copydoc VBOXHDDBACKEND::pfnRename */
-static int vdiRename(void *pBackendData, const char *pszFilename)
+static DECLCALLBACK(int) vdiRename(void *pBackendData, const char *pszFilename)
{
LogFlowFunc(("pBackendData=%#p pszFilename=%#p\n", pBackendData, pszFilename));
@@ -1549,7 +1552,7 @@ out:
}
/** @copydoc VBOXHDDBACKEND::pfnClose */
-static int vdiClose(void *pBackendData, bool fDelete)
+static DECLCALLBACK(int) vdiClose(void *pBackendData, bool fDelete)
{
LogFlowFunc(("pBackendData=%#p fDelete=%d\n", pBackendData, fDelete));
PVDIIMAGEDESC pImage = (PVDIIMAGEDESC)pBackendData;
@@ -1562,8 +1565,8 @@ static int vdiClose(void *pBackendData, bool fDelete)
return rc;
}
-static int vdiRead(void *pBackendData, uint64_t uOffset, size_t cbToRead,
- PVDIOCTX pIoCtx, size_t *pcbActuallyRead)
+static DECLCALLBACK(int) vdiRead(void *pBackendData, uint64_t uOffset, size_t cbToRead,
+ PVDIOCTX pIoCtx, size_t *pcbActuallyRead)
{
LogFlowFunc(("pBackendData=%#p uOffset=%llu pIoCtx=%#p cbToRead=%zu pcbActuallyRead=%#p\n",
pBackendData, uOffset, pIoCtx, cbToRead, pcbActuallyRead));
@@ -1629,9 +1632,9 @@ out:
return rc;
}
-static int vdiWrite(void *pBackendData, uint64_t uOffset, size_t cbToWrite,
- PVDIOCTX pIoCtx, size_t *pcbWriteProcess, size_t *pcbPreRead,
- size_t *pcbPostRead, unsigned fWrite)
+static DECLCALLBACK(int) vdiWrite(void *pBackendData, uint64_t uOffset, size_t cbToWrite,
+ PVDIOCTX pIoCtx, size_t *pcbWriteProcess, size_t *pcbPreRead,
+ size_t *pcbPostRead, unsigned fWrite)
{
LogFlowFunc(("pBackendData=%#p uOffset=%llu pIoCtx=%#p cbToWrite=%zu pcbWriteProcess=%#p pcbPreRead=%#p pcbPostRead=%#p\n",
pBackendData, uOffset, pIoCtx, cbToWrite, pcbWriteProcess, pcbPreRead, pcbPostRead));
@@ -1753,7 +1756,7 @@ out:
return rc;
}
-static int vdiFlush(void *pBackendData, PVDIOCTX pIoCtx)
+static DECLCALLBACK(int) vdiFlush(void *pBackendData, PVDIOCTX pIoCtx)
{
LogFlowFunc(("pBackendData=%#p\n", pBackendData));
PVDIIMAGEDESC pImage = (PVDIIMAGEDESC)pBackendData;
@@ -1767,7 +1770,7 @@ static int vdiFlush(void *pBackendData, PVDIOCTX pIoCtx)
}
/** @copydoc VBOXHDDBACKEND::pfnGetVersion */
-static unsigned vdiGetVersion(void *pBackendData)
+static DECLCALLBACK(unsigned) vdiGetVersion(void *pBackendData)
{
LogFlowFunc(("pBackendData=%#p\n", pBackendData));
PVDIIMAGEDESC pImage = (PVDIIMAGEDESC)pBackendData;
@@ -1785,7 +1788,7 @@ static unsigned vdiGetVersion(void *pBackendData)
}
/** @copydoc VBOXHDDBACKEND::pfnGetSectorSize */
-static uint32_t vdiGetSectorSize(void *pBackendData)
+static DECLCALLBACK(uint32_t) vdiGetSectorSize(void *pBackendData)
{
LogFlowFunc(("pBackendData=%#p\n", pBackendData));
PVDIIMAGEDESC pImage = (PVDIIMAGEDESC)pBackendData;
@@ -1801,7 +1804,7 @@ static uint32_t vdiGetSectorSize(void *pBackendData)
}
/** @copydoc VBOXHDDBACKEND::pfnGetSize */
-static uint64_t vdiGetSize(void *pBackendData)
+static DECLCALLBACK(uint64_t) vdiGetSize(void *pBackendData)
{
LogFlowFunc(("pBackendData=%#p\n", pBackendData));
PVDIIMAGEDESC pImage = (PVDIIMAGEDESC)pBackendData;
@@ -1819,7 +1822,7 @@ static uint64_t vdiGetSize(void *pBackendData)
}
/** @copydoc VBOXHDDBACKEND::pfnGetFileSize */
-static uint64_t vdiGetFileSize(void *pBackendData)
+static DECLCALLBACK(uint64_t) vdiGetFileSize(void *pBackendData)
{
LogFlowFunc(("pBackendData=%#p\n", pBackendData));
PVDIIMAGEDESC pImage = (PVDIIMAGEDESC)pBackendData;
@@ -1843,7 +1846,7 @@ static uint64_t vdiGetFileSize(void *pBackendData)
}
/** @copydoc VBOXHDDBACKEND::pfnGetPCHSGeometry */
-static int vdiGetPCHSGeometry(void *pBackendData, PVDGEOMETRY pPCHSGeometry)
+static DECLCALLBACK(int) vdiGetPCHSGeometry(void *pBackendData, PVDGEOMETRY pPCHSGeometry)
{
LogFlowFunc(("pBackendData=%#p pPCHSGeometry=%#p\n", pBackendData, pPCHSGeometry));
PVDIIMAGEDESC pImage = (PVDIIMAGEDESC)pBackendData;
@@ -1869,7 +1872,7 @@ static int vdiGetPCHSGeometry(void *pBackendData, PVDGEOMETRY pPCHSGeometry)
}
/** @copydoc VBOXHDDBACKEND::pfnSetPCHSGeometry */
-static int vdiSetPCHSGeometry(void *pBackendData, PCVDGEOMETRY pPCHSGeometry)
+static DECLCALLBACK(int) vdiSetPCHSGeometry(void *pBackendData, PCVDGEOMETRY pPCHSGeometry)
{
LogFlowFunc(("pBackendData=%#p pPCHSGeometry=%#p PCHS=%u/%u/%u\n", pBackendData, pPCHSGeometry, pPCHSGeometry->cCylinders, pPCHSGeometry->cHeads, pPCHSGeometry->cSectors));
PVDIIMAGEDESC pImage = (PVDIIMAGEDESC)pBackendData;
@@ -1897,7 +1900,7 @@ out:
}
/** @copydoc VBOXHDDBACKEND::pfnGetLCHSGeometry */
-static int vdiGetLCHSGeometry(void *pBackendData, PVDGEOMETRY pLCHSGeometry)
+static DECLCALLBACK(int) vdiGetLCHSGeometry(void *pBackendData, PVDGEOMETRY pLCHSGeometry)
{
LogFlowFunc(("pBackendData=%#p pLCHSGeometry=%#p\n", pBackendData, pLCHSGeometry));
PVDIIMAGEDESC pImage = (PVDIIMAGEDESC)pBackendData;
@@ -1932,7 +1935,7 @@ static int vdiGetLCHSGeometry(void *pBackendData, PVDGEOMETRY pLCHSGeometry)
}
/** @copydoc VBOXHDDBACKEND::pfnSetLCHSGeometry */
-static int vdiSetLCHSGeometry(void *pBackendData, PCVDGEOMETRY pLCHSGeometry)
+static DECLCALLBACK(int) vdiSetLCHSGeometry(void *pBackendData, PCVDGEOMETRY pLCHSGeometry)
{
LogFlowFunc(("pBackendData=%#p pLCHSGeometry=%#p LCHS=%u/%u/%u\n", pBackendData, pLCHSGeometry, pLCHSGeometry->cCylinders, pLCHSGeometry->cHeads, pLCHSGeometry->cSectors));
PVDIIMAGEDESC pImage = (PVDIIMAGEDESC)pBackendData;
@@ -1971,7 +1974,7 @@ out:
}
/** @copydoc VBOXHDDBACKEND::pfnGetImageFlags */
-static unsigned vdiGetImageFlags(void *pBackendData)
+static DECLCALLBACK(unsigned) vdiGetImageFlags(void *pBackendData)
{
LogFlowFunc(("pBackendData=%#p\n", pBackendData));
PVDIIMAGEDESC pImage = (PVDIIMAGEDESC)pBackendData;
@@ -1989,7 +1992,7 @@ static unsigned vdiGetImageFlags(void *pBackendData)
}
/** @copydoc VBOXHDDBACKEND::pfnGetOpenFlags */
-static unsigned vdiGetOpenFlags(void *pBackendData)
+static DECLCALLBACK(unsigned) vdiGetOpenFlags(void *pBackendData)
{
LogFlowFunc(("pBackendData=%#p\n", pBackendData));
PVDIIMAGEDESC pImage = (PVDIIMAGEDESC)pBackendData;
@@ -2007,7 +2010,7 @@ static unsigned vdiGetOpenFlags(void *pBackendData)
}
/** @copydoc VBOXHDDBACKEND::pfnSetOpenFlags */
-static int vdiSetOpenFlags(void *pBackendData, unsigned uOpenFlags)
+static DECLCALLBACK(int) vdiSetOpenFlags(void *pBackendData, unsigned uOpenFlags)
{
LogFlowFunc(("pBackendData=%#p uOpenFlags=%#x\n", pBackendData, uOpenFlags));
PVDIIMAGEDESC pImage = (PVDIIMAGEDESC)pBackendData;
@@ -2037,8 +2040,8 @@ out:
}
/** @copydoc VBOXHDDBACKEND::pfnGetComment */
-static int vdiGetComment(void *pBackendData, char *pszComment,
- size_t cbComment)
+static DECLCALLBACK(int) vdiGetComment(void *pBackendData, char *pszComment,
+ size_t cbComment)
{
LogFlowFunc(("pBackendData=%#p pszComment=%#p cbComment=%zu\n", pBackendData, pszComment, cbComment));
PVDIIMAGEDESC pImage = (PVDIIMAGEDESC)pBackendData;
@@ -2073,7 +2076,7 @@ static int vdiGetComment(void *pBackendData, char *pszComment,
}
/** @copydoc VBOXHDDBACKEND::pfnGetComment */
-static int vdiSetComment(void *pBackendData, const char *pszComment)
+static DECLCALLBACK(int) vdiSetComment(void *pBackendData, const char *pszComment)
{
LogFlowFunc(("pBackendData=%#p pszComment=\"%s\"\n", pBackendData, pszComment));
PVDIIMAGEDESC pImage = (PVDIIMAGEDESC)pBackendData;
@@ -2120,7 +2123,7 @@ out:
}
/** @copydoc VBOXHDDBACKEND::pfnGetUuid */
-static int vdiGetUuid(void *pBackendData, PRTUUID pUuid)
+static DECLCALLBACK(int) vdiGetUuid(void *pBackendData, PRTUUID pUuid)
{
LogFlowFunc(("pBackendData=%#p pUuid=%#p\n", pBackendData, pUuid));
PVDIIMAGEDESC pImage = (PVDIIMAGEDESC)pBackendData;
@@ -2141,7 +2144,7 @@ static int vdiGetUuid(void *pBackendData, PRTUUID pUuid)
}
/** @copydoc VBOXHDDBACKEND::pfnSetUuid */
-static int vdiSetUuid(void *pBackendData, PCRTUUID pUuid)
+static DECLCALLBACK(int) vdiSetUuid(void *pBackendData, PCRTUUID pUuid)
{
LogFlowFunc(("pBackendData=%#p Uuid=%RTuuid\n", pBackendData, pUuid));
PVDIIMAGEDESC pImage = (PVDIIMAGEDESC)pBackendData;
@@ -2175,7 +2178,7 @@ static int vdiSetUuid(void *pBackendData, PCRTUUID pUuid)
}
/** @copydoc VBOXHDDBACKEND::pfnGetModificationUuid */
-static int vdiGetModificationUuid(void *pBackendData, PRTUUID pUuid)
+static DECLCALLBACK(int) vdiGetModificationUuid(void *pBackendData, PRTUUID pUuid)
{
LogFlowFunc(("pBackendData=%#p pUuid=%#p\n", pBackendData, pUuid));
PVDIIMAGEDESC pImage = (PVDIIMAGEDESC)pBackendData;
@@ -2196,7 +2199,7 @@ static int vdiGetModificationUuid(void *pBackendData, PRTUUID pUuid)
}
/** @copydoc VBOXHDDBACKEND::pfnSetModificationUuid */
-static int vdiSetModificationUuid(void *pBackendData, PCRTUUID pUuid)
+static DECLCALLBACK(int) vdiSetModificationUuid(void *pBackendData, PCRTUUID pUuid)
{
LogFlowFunc(("pBackendData=%#p Uuid=%RTuuid\n", pBackendData, pUuid));
PVDIIMAGEDESC pImage = (PVDIIMAGEDESC)pBackendData;
@@ -2230,7 +2233,7 @@ static int vdiSetModificationUuid(void *pBackendData, PCRTUUID pUuid)
}
/** @copydoc VBOXHDDBACKEND::pfnGetParentUuid */
-static int vdiGetParentUuid(void *pBackendData, PRTUUID pUuid)
+static DECLCALLBACK(int) vdiGetParentUuid(void *pBackendData, PRTUUID pUuid)
{
LogFlowFunc(("pBackendData=%#p pUuid=%#p\n", pBackendData, pUuid));
PVDIIMAGEDESC pImage = (PVDIIMAGEDESC)pBackendData;
@@ -2251,7 +2254,7 @@ static int vdiGetParentUuid(void *pBackendData, PRTUUID pUuid)
}
/** @copydoc VBOXHDDBACKEND::pfnSetParentUuid */
-static int vdiSetParentUuid(void *pBackendData, PCRTUUID pUuid)
+static DECLCALLBACK(int) vdiSetParentUuid(void *pBackendData, PCRTUUID pUuid)
{
LogFlowFunc(("pBackendData=%#p Uuid=%RTuuid\n", pBackendData, pUuid));
PVDIIMAGEDESC pImage = (PVDIIMAGEDESC)pBackendData;
@@ -2285,7 +2288,7 @@ static int vdiSetParentUuid(void *pBackendData, PCRTUUID pUuid)
}
/** @copydoc VBOXHDDBACKEND::pfnGetParentModificationUuid */
-static int vdiGetParentModificationUuid(void *pBackendData, PRTUUID pUuid)
+static DECLCALLBACK(int) vdiGetParentModificationUuid(void *pBackendData, PRTUUID pUuid)
{
LogFlowFunc(("pBackendData=%#p pUuid=%#p\n", pBackendData, pUuid));
PVDIIMAGEDESC pImage = (PVDIIMAGEDESC)pBackendData;
@@ -2306,7 +2309,7 @@ static int vdiGetParentModificationUuid(void *pBackendData, PRTUUID pUuid)
}
/** @copydoc VBOXHDDBACKEND::pfnSetParentModificationUuid */
-static int vdiSetParentModificationUuid(void *pBackendData, PCRTUUID pUuid)
+static DECLCALLBACK(int) vdiSetParentModificationUuid(void *pBackendData, PCRTUUID pUuid)
{
LogFlowFunc(("pBackendData=%#p Uuid=%RTuuid\n", pBackendData, pUuid));
PVDIIMAGEDESC pImage = (PVDIIMAGEDESC)pBackendData;
@@ -2337,7 +2340,7 @@ static int vdiSetParentModificationUuid(void *pBackendData, PCRTUUID pUuid)
}
/** @copydoc VBOXHDDBACKEND::pfnDump */
-static void vdiDump(void *pBackendData)
+static DECLCALLBACK(void) vdiDump(void *pBackendData)
{
PVDIIMAGEDESC pImage = (PVDIIMAGEDESC)pBackendData;
@@ -2399,16 +2402,16 @@ static void vdiDump(void *pBackendData)
}
/** @copydoc VBOXHDDBACKEND::pfnCompact */
-static int vdiCompact(void *pBackendData, unsigned uPercentStart,
- unsigned uPercentSpan, PVDINTERFACE pVDIfsDisk,
- PVDINTERFACE pVDIfsImage, PVDINTERFACE pVDIfsOperation)
+static DECLCALLBACK(int) vdiCompact(void *pBackendData, unsigned uPercentStart,
+ unsigned uPercentSpan, PVDINTERFACE pVDIfsDisk,
+ PVDINTERFACE pVDIfsImage, PVDINTERFACE pVDIfsOperation)
{
PVDIIMAGEDESC pImage = (PVDIIMAGEDESC)pBackendData;
int rc = VINF_SUCCESS;
void *pvBuf = NULL, *pvTmp = NULL;
unsigned *paBlocks2 = NULL;
- int (*pfnParentRead)(void *, uint64_t, void *, size_t) = NULL;
+ DECLCALLBACKMEMBER(int, pfnParentRead)(void *, uint64_t, void *, size_t) = NULL;
void *pvParent = NULL;
PVDINTERFACEPARENTSTATE pIfParentState = VDIfParentStateGet(pVDIfsOperation);
if (pIfParentState)
@@ -2647,11 +2650,11 @@ static int vdiCompact(void *pBackendData, unsigned uPercentStart,
/** @copydoc VBOXHDDBACKEND::pfnResize */
-static int vdiResize(void *pBackendData, uint64_t cbSize,
- PCVDGEOMETRY pPCHSGeometry, PCVDGEOMETRY pLCHSGeometry,
- unsigned uPercentStart, unsigned uPercentSpan,
- PVDINTERFACE pVDIfsDisk, PVDINTERFACE pVDIfsImage,
- PVDINTERFACE pVDIfsOperation)
+static DECLCALLBACK(int) vdiResize(void *pBackendData, uint64_t cbSize,
+ PCVDGEOMETRY pPCHSGeometry, PCVDGEOMETRY pLCHSGeometry,
+ unsigned uPercentStart, unsigned uPercentSpan,
+ PVDINTERFACE pVDIfsDisk, PVDINTERFACE pVDIfsImage,
+ PVDINTERFACE pVDIfsOperation)
{
PVDIIMAGEDESC pImage = (PVDIIMAGEDESC)pBackendData;
int rc = VINF_SUCCESS;
diff --git a/src/VBox/Storage/VDIfVfs.cpp b/src/VBox/Storage/VDIfVfs.cpp
index 5fbd8a9..3160610 100644
--- a/src/VBox/Storage/VDIfVfs.cpp
+++ b/src/VBox/Storage/VDIfVfs.cpp
@@ -16,9 +16,9 @@
*/
-/*******************************************************************************
-* Header Files *
-*******************************************************************************/
+/*********************************************************************************************************************************
+* Header Files *
+*********************************************************************************************************************************/
#include <iprt/types.h>
#include <iprt/assert.h>
#include <iprt/mem.h>
@@ -32,9 +32,10 @@
#include <VBox/vd.h>
#include <VBox/vd-ifs-internal.h>
-/*******************************************************************************
-* Structures and Typedefs *
-*******************************************************************************/
+
+/*********************************************************************************************************************************
+* Structures and Typedefs *
+*********************************************************************************************************************************/
/**
* The internal data of an VD I/O to VFS file or I/O stream wrapper.
diff --git a/src/VBox/Storage/VDVfs.cpp b/src/VBox/Storage/VDVfs.cpp
index f2edfca..a2b313f 100644
--- a/src/VBox/Storage/VDVfs.cpp
+++ b/src/VBox/Storage/VDVfs.cpp
@@ -16,9 +16,9 @@
*/
-/*******************************************************************************
-* Header Files *
-*******************************************************************************/
+/*********************************************************************************************************************************
+* Header Files *
+*********************************************************************************************************************************/
#include <iprt/types.h>
#include <iprt/assert.h>
#include <iprt/mem.h>
@@ -31,9 +31,10 @@
#include <iprt/poll.h>
#include <VBox/vd.h>
-/*******************************************************************************
-* Structures and Typedefs *
-*******************************************************************************/
+
+/*********************************************************************************************************************************
+* Structures and Typedefs *
+*********************************************************************************************************************************/
/**
* The internal data of a DVM volume I/O stream.
diff --git a/src/VBox/Storage/VHD.cpp b/src/VBox/Storage/VHD.cpp
index 4725e4f..03c5e96 100644
--- a/src/VBox/Storage/VHD.cpp
+++ b/src/VBox/Storage/VHD.cpp
@@ -15,9 +15,10 @@
* hope that it will be useful, but WITHOUT ANY WARRANTY of any kind.
*/
-/*******************************************************************************
-* Header Files *
-*******************************************************************************/
+
+/*********************************************************************************************************************************
+* Header Files *
+*********************************************************************************************************************************/
#define LOG_GROUP LOG_GROUP_VD_VHD
#include <VBox/vd-plugin.h>
#include <VBox/err.h>
@@ -233,9 +234,10 @@ typedef struct VHDIMAGEEXPAND
#define VHDIMAGEEXPAND_STATUS_SET(fFlags, cShift, uVal) \
ASMAtomicOrU32(&(fFlags), ((uVal) & VHDIMAGEEXPAND_STATUS_MASK) << (cShift))
-/*******************************************************************************
-* Static Variables *
-*******************************************************************************/
+
+/*********************************************************************************************************************************
+* Static Variables *
+*********************************************************************************************************************************/
/** NULL-terminated array of supported file extensions. */
static const VDFILEEXTENSION s_aVhdFileExtensions[] =
@@ -244,9 +246,10 @@ static const VDFILEEXTENSION s_aVhdFileExtensions[] =
{NULL, VDTYPE_INVALID}
};
-/*******************************************************************************
-* Internal Functions *
-*******************************************************************************/
+
+/*********************************************************************************************************************************
+* Internal Functions *
+*********************************************************************************************************************************/
/**
@@ -688,22 +691,22 @@ static int vhdAsyncExpansionStepCompleted(void *pBackendData, PVDIOCTX pIoCtx, v
return VERR_VD_ASYNC_IO_IN_PROGRESS;
}
-static int vhdAsyncExpansionDataBlockBitmapComplete(void *pBackendData, PVDIOCTX pIoCtx, void *pvUser, int rcReq)
+static DECLCALLBACK(int) vhdAsyncExpansionDataBlockBitmapComplete(void *pBackendData, PVDIOCTX pIoCtx, void *pvUser, int rcReq)
{
return vhdAsyncExpansionStepCompleted(pBackendData, pIoCtx, pvUser, rcReq, VHDIMAGEEXPAND_BLOCKBITMAP_STATUS_SHIFT);
}
-static int vhdAsyncExpansionDataComplete(void *pBackendData, PVDIOCTX pIoCtx, void *pvUser, int rcReq)
+static DECLCALLBACK(int) vhdAsyncExpansionDataComplete(void *pBackendData, PVDIOCTX pIoCtx, void *pvUser, int rcReq)
{
return vhdAsyncExpansionStepCompleted(pBackendData, pIoCtx, pvUser, rcReq, VHDIMAGEEXPAND_USERBLOCK_STATUS_SHIFT);
}
-static int vhdAsyncExpansionBatUpdateComplete(void *pBackendData, PVDIOCTX pIoCtx, void *pvUser, int rcReq)
+static DECLCALLBACK(int) vhdAsyncExpansionBatUpdateComplete(void *pBackendData, PVDIOCTX pIoCtx, void *pvUser, int rcReq)
{
return vhdAsyncExpansionStepCompleted(pBackendData, pIoCtx, pvUser, rcReq, VHDIMAGEEXPAND_BAT_STATUS_SHIFT);
}
-static int vhdAsyncExpansionFooterUpdateComplete(void *pBackendData, PVDIOCTX pIoCtx, void *pvUser, int rcReq)
+static DECLCALLBACK(int) vhdAsyncExpansionFooterUpdateComplete(void *pBackendData, PVDIOCTX pIoCtx, void *pvUser, int rcReq)
{
return vhdAsyncExpansionStepCompleted(pBackendData, pIoCtx, pvUser, rcReq, VHDIMAGEEXPAND_FOOTER_STATUS_SHIFT);
}
@@ -1235,8 +1238,8 @@ out:
/** @copydoc VBOXHDDBACKEND::pfnCheckIfValid */
-static int vhdCheckIfValid(const char *pszFilename, PVDINTERFACE pVDIfsDisk,
- PVDINTERFACE pVDIfsImage, VDTYPE *penmType)
+static DECLCALLBACK(int) vhdCheckIfValid(const char *pszFilename, PVDINTERFACE pVDIfsDisk,
+ PVDINTERFACE pVDIfsImage, VDTYPE *penmType)
{
LogFlowFunc(("pszFilename=\"%s\" pVDIfsDisk=%#p pVDIfsImage=%#p\n", pszFilename, pVDIfsDisk, pVDIfsImage));
int rc;
@@ -1292,9 +1295,9 @@ out:
}
/** @copydoc VBOXHDDBACKEND::pfnOpen */
-static int vhdOpen(const char *pszFilename, unsigned uOpenFlags,
- PVDINTERFACE pVDIfsDisk, PVDINTERFACE pVDIfsImage,
- VDTYPE enmType, void **ppBackendData)
+static DECLCALLBACK(int) vhdOpen(const char *pszFilename, unsigned uOpenFlags,
+ PVDINTERFACE pVDIfsDisk, PVDINTERFACE pVDIfsImage,
+ VDTYPE enmType, void **ppBackendData)
{
LogFlowFunc(("pszFilename=\"%s\" uOpenFlags=%#x pVDIfsDisk=%#p pVDIfsImage=%#p enmType=%u ppBackendData=%#p\n", pszFilename, uOpenFlags, pVDIfsDisk, pVDIfsImage, enmType, ppBackendData));
int rc = VINF_SUCCESS;
@@ -1341,14 +1344,14 @@ out:
}
/** @copydoc VBOXHDDBACKEND::pfnCreate */
-static int vhdCreate(const char *pszFilename, uint64_t cbSize,
- unsigned uImageFlags, const char *pszComment,
- PCVDGEOMETRY pPCHSGeometry, PCVDGEOMETRY pLCHSGeometry,
- PCRTUUID pUuid, unsigned uOpenFlags,
- unsigned uPercentStart, unsigned uPercentSpan,
- PVDINTERFACE pVDIfsDisk, PVDINTERFACE pVDIfsImage,
- PVDINTERFACE pVDIfsOperation, VDTYPE enmType,
- void **ppBackendData)
+static DECLCALLBACK(int) vhdCreate(const char *pszFilename, uint64_t cbSize,
+ unsigned uImageFlags, const char *pszComment,
+ PCVDGEOMETRY pPCHSGeometry, PCVDGEOMETRY pLCHSGeometry,
+ PCRTUUID pUuid, unsigned uOpenFlags,
+ unsigned uPercentStart, unsigned uPercentSpan,
+ PVDINTERFACE pVDIfsDisk, PVDINTERFACE pVDIfsImage,
+ PVDINTERFACE pVDIfsOperation, VDTYPE enmType,
+ void **ppBackendData)
{
LogFlowFunc(("pszFilename=\"%s\" cbSize=%llu uImageFlags=%#x pszComment=\"%s\" pPCHSGeometry=%#p pLCHSGeometry=%#p Uuid=%RTuuid uOpenFlags=%#x uPercentStart=%u uPercentSpan=%u pVDIfsDisk=%#p pVDIfsImage=%#p pVDIfsOperation=%#p enmType=%u ppBackendData=%#p",
pszFilename, cbSize, uImageFlags, pszComment, pPCHSGeometry, pLCHSGeometry, pUuid, uOpenFlags, uPercentStart, uPercentSpan, pVDIfsDisk, pVDIfsImage, pVDIfsOperation, enmType, ppBackendData));
@@ -1428,7 +1431,7 @@ out:
}
/** @copydoc VBOXHDDBACKEND::pfnRename */
-static int vhdRename(void *pBackendData, const char *pszFilename)
+static DECLCALLBACK(int) vhdRename(void *pBackendData, const char *pszFilename)
{
LogFlowFunc(("pBackendData=%#p pszFilename=%#p\n", pBackendData, pszFilename));
int rc = VINF_SUCCESS;
@@ -1474,7 +1477,7 @@ out:
}
/** @copydoc VBOXHDDBACKEND::pfnClose */
-static int vhdClose(void *pBackendData, bool fDelete)
+static DECLCALLBACK(int) vhdClose(void *pBackendData, bool fDelete)
{
LogFlowFunc(("pBackendData=%#p fDelete=%d\n", pBackendData, fDelete));
PVHDIMAGE pImage = (PVHDIMAGE)pBackendData;
@@ -1488,8 +1491,8 @@ static int vhdClose(void *pBackendData, bool fDelete)
}
/** @copydoc VBOXHDDBACKEND::pfnRead */
-static int vhdRead(void *pBackendData, uint64_t uOffset, size_t cbRead,
- PVDIOCTX pIoCtx, size_t *pcbActuallyRead)
+static DECLCALLBACK(int) vhdRead(void *pBackendData, uint64_t uOffset, size_t cbRead,
+ PVDIOCTX pIoCtx, size_t *pcbActuallyRead)
{
PVHDIMAGE pImage = (PVHDIMAGE)pBackendData;
int rc = VINF_SUCCESS;
@@ -1604,9 +1607,9 @@ static int vhdRead(void *pBackendData, uint64_t uOffset, size_t cbRead,
}
/** @copydoc VBOXHDDBACKEND::pfnWrite */
-static int vhdWrite(void *pBackendData, uint64_t uOffset, size_t cbWrite,
- PVDIOCTX pIoCtx, size_t *pcbWriteProcess, size_t *pcbPreRead,
- size_t *pcbPostRead, unsigned fWrite)
+static DECLCALLBACK(int) vhdWrite(void *pBackendData, uint64_t uOffset, size_t cbWrite,
+ PVDIOCTX pIoCtx, size_t *pcbWriteProcess, size_t *pcbPreRead,
+ size_t *pcbPostRead, unsigned fWrite)
{
PVHDIMAGE pImage = (PVHDIMAGE)pBackendData;
int rc = VINF_SUCCESS;
@@ -1838,7 +1841,7 @@ static int vhdWrite(void *pBackendData, uint64_t uOffset, size_t cbWrite,
}
/** @copydoc VBOXHDDBACKEND::pfnFlush */
-static int vhdFlush(void *pBackendData, PVDIOCTX pIoCtx)
+static DECLCALLBACK(int) vhdFlush(void *pBackendData, PVDIOCTX pIoCtx)
{
PVHDIMAGE pImage = (PVHDIMAGE)pBackendData;
@@ -1847,7 +1850,7 @@ static int vhdFlush(void *pBackendData, PVDIOCTX pIoCtx)
}
/** @copydoc VBOXHDDBACKEND::pfnGetVersion */
-static unsigned vhdGetVersion(void *pBackendData)
+static DECLCALLBACK(unsigned) vhdGetVersion(void *pBackendData)
{
LogFlowFunc(("pBackendData=%#p\n", pBackendData));
PVHDIMAGE pImage = (PVHDIMAGE)pBackendData;
@@ -1863,7 +1866,7 @@ static unsigned vhdGetVersion(void *pBackendData)
}
/** @copydoc VBOXHDDBACKEND::pfnGetSectorSize */
-static uint32_t vhdGetSectorSize(void *pBackendData)
+static DECLCALLBACK(uint32_t) vhdGetSectorSize(void *pBackendData)
{
LogFlowFunc(("pBackendData=%#p\n", pBackendData));
PVHDIMAGE pImage = (PVHDIMAGE)pBackendData;
@@ -1879,7 +1882,7 @@ static uint32_t vhdGetSectorSize(void *pBackendData)
}
/** @copydoc VBOXHDDBACKEND::pfnGetSize */
-static uint64_t vhdGetSize(void *pBackendData)
+static DECLCALLBACK(uint64_t) vhdGetSize(void *pBackendData)
{
LogFlowFunc(("pBackendData=%#p\n", pBackendData));
PVHDIMAGE pImage = (PVHDIMAGE)pBackendData;
@@ -1895,7 +1898,7 @@ static uint64_t vhdGetSize(void *pBackendData)
}
/** @copydoc VBOXHDDBACKEND::pfnGetFileSize */
-static uint64_t vhdGetFileSize(void *pBackendData)
+static DECLCALLBACK(uint64_t) vhdGetFileSize(void *pBackendData)
{
LogFlowFunc(("pBackendData=%#p\n", pBackendData));
PVHDIMAGE pImage = (PVHDIMAGE)pBackendData;
@@ -1911,7 +1914,7 @@ static uint64_t vhdGetFileSize(void *pBackendData)
}
/** @copydoc VBOXHDDBACKEND::pfnGetPCHSGeometry */
-static int vhdGetPCHSGeometry(void *pBackendData, PVDGEOMETRY pPCHSGeometry)
+static DECLCALLBACK(int) vhdGetPCHSGeometry(void *pBackendData, PVDGEOMETRY pPCHSGeometry)
{
LogFlowFunc(("pBackendData=%#p pPCHSGeometry=%#p\n", pBackendData, pPCHSGeometry));
PVHDIMAGE pImage = (PVHDIMAGE)pBackendData;
@@ -1937,7 +1940,7 @@ static int vhdGetPCHSGeometry(void *pBackendData, PVDGEOMETRY pPCHSGeometry)
}
/** @copydoc VBOXHDDBACKEND::pfnSetPCHSGeometry */
-static int vhdSetPCHSGeometry(void *pBackendData, PCVDGEOMETRY pPCHSGeometry)
+static DECLCALLBACK(int) vhdSetPCHSGeometry(void *pBackendData, PCVDGEOMETRY pPCHSGeometry)
{
LogFlowFunc(("pBackendData=%#p pPCHSGeometry=%#p PCHS=%u/%u/%u\n", pBackendData, pPCHSGeometry, pPCHSGeometry->cCylinders, pPCHSGeometry->cHeads, pPCHSGeometry->cSectors));
PVHDIMAGE pImage = (PVHDIMAGE)pBackendData;
@@ -1965,7 +1968,7 @@ out:
}
/** @copydoc VBOXHDDBACKEND::pfnGetLCHSGeometry */
-static int vhdGetLCHSGeometry(void *pBackendData, PVDGEOMETRY pLCHSGeometry)
+static DECLCALLBACK(int) vhdGetLCHSGeometry(void *pBackendData, PVDGEOMETRY pLCHSGeometry)
{
LogFlowFunc(("pBackendData=%#p pLCHSGeometry=%#p\n", pBackendData, pLCHSGeometry));
PVHDIMAGE pImage = (PVHDIMAGE)pBackendData;
@@ -1991,7 +1994,7 @@ LogFlowFunc(("pBackendData=%#p pLCHSGeometry=%#p\n", pBackendData, pLCHSGeometry
}
/** @copydoc VBOXHDDBACKEND::pfnSetLCHSGeometry */
-static int vhdSetLCHSGeometry(void *pBackendData, PCVDGEOMETRY pLCHSGeometry)
+static DECLCALLBACK(int) vhdSetLCHSGeometry(void *pBackendData, PCVDGEOMETRY pLCHSGeometry)
{
PVHDIMAGE pImage = (PVHDIMAGE)pBackendData;
int rc;
@@ -2018,7 +2021,7 @@ out:
}
/** @copydoc VBOXHDDBACKEND::pfnGetImageFlags */
-static unsigned vhdGetImageFlags(void *pBackendData)
+static DECLCALLBACK(unsigned) vhdGetImageFlags(void *pBackendData)
{
LogFlowFunc(("pBackendData=%#p\n", pBackendData));
PVHDIMAGE pImage = (PVHDIMAGE)pBackendData;
@@ -2036,7 +2039,7 @@ static unsigned vhdGetImageFlags(void *pBackendData)
}
/** @copydoc VBOXHDDBACKEND::pfnGetOpenFlags */
-static unsigned vhdGetOpenFlags(void *pBackendData)
+static DECLCALLBACK(unsigned) vhdGetOpenFlags(void *pBackendData)
{
LogFlowFunc(("pBackendData=%#p\n", pBackendData));
PVHDIMAGE pImage = (PVHDIMAGE)pBackendData;
@@ -2054,7 +2057,7 @@ static unsigned vhdGetOpenFlags(void *pBackendData)
}
/** @copydoc VBOXHDDBACKEND::pfnSetOpenFlags */
-static int vhdSetOpenFlags(void *pBackendData, unsigned uOpenFlags)
+static DECLCALLBACK(int) vhdSetOpenFlags(void *pBackendData, unsigned uOpenFlags)
{
LogFlowFunc(("pBackendData=%#p\n uOpenFlags=%#x", pBackendData, uOpenFlags));
PVHDIMAGE pImage = (PVHDIMAGE)pBackendData;
@@ -2081,8 +2084,8 @@ out:
}
/** @copydoc VBOXHDDBACKEND::pfnGetComment */
-static int vhdGetComment(void *pBackendData, char *pszComment,
- size_t cbComment)
+static DECLCALLBACK(int) vhdGetComment(void *pBackendData, char *pszComment,
+ size_t cbComment)
{
LogFlowFunc(("pBackendData=%#p pszComment=%#p cbComment=%zu\n", pBackendData, pszComment, cbComment));
PVHDIMAGE pImage = (PVHDIMAGE)pBackendData;
@@ -2100,7 +2103,7 @@ static int vhdGetComment(void *pBackendData, char *pszComment,
}
/** @copydoc VBOXHDDBACKEND::pfnSetComment */
-static int vhdSetComment(void *pBackendData, const char *pszComment)
+static DECLCALLBACK(int) vhdSetComment(void *pBackendData, const char *pszComment)
{
LogFlowFunc(("pBackendData=%#p pszComment=\"%s\"\n", pBackendData, pszComment));
PVHDIMAGE pImage = (PVHDIMAGE)pBackendData;
@@ -2123,7 +2126,7 @@ static int vhdSetComment(void *pBackendData, const char *pszComment)
}
/** @copydoc VBOXHDDBACKEND::pfnGetUuid */
-static int vhdGetUuid(void *pBackendData, PRTUUID pUuid)
+static DECLCALLBACK(int) vhdGetUuid(void *pBackendData, PRTUUID pUuid)
{
LogFlowFunc(("pBackendData=%#p pUuid=%#p\n", pBackendData, pUuid));
PVHDIMAGE pImage = (PVHDIMAGE)pBackendData;
@@ -2144,7 +2147,7 @@ static int vhdGetUuid(void *pBackendData, PRTUUID pUuid)
}
/** @copydoc VBOXHDDBACKEND::pfnSetUuid */
-static int vhdSetUuid(void *pBackendData, PCRTUUID pUuid)
+static DECLCALLBACK(int) vhdSetUuid(void *pBackendData, PCRTUUID pUuid)
{
LogFlowFunc(("pBackendData=%#p Uuid=%RTuuid\n", pBackendData, pUuid));
PVHDIMAGE pImage = (PVHDIMAGE)pBackendData;
@@ -2179,7 +2182,7 @@ static int vhdSetUuid(void *pBackendData, PCRTUUID pUuid)
}
/** @copydoc VBOXHDDBACKEND::pfnGetModificationUuid */
-static int vhdGetModificationUuid(void *pBackendData, PRTUUID pUuid)
+static DECLCALLBACK(int) vhdGetModificationUuid(void *pBackendData, PRTUUID pUuid)
{
LogFlowFunc(("pBackendData=%#p pUuid=%#p\n", pBackendData, pUuid));
PVHDIMAGE pImage = (PVHDIMAGE)pBackendData;
@@ -2197,7 +2200,7 @@ static int vhdGetModificationUuid(void *pBackendData, PRTUUID pUuid)
}
/** @copydoc VBOXHDDBACKEND::pfnSetModificationUuid */
-static int vhdSetModificationUuid(void *pBackendData, PCRTUUID pUuid)
+static DECLCALLBACK(int) vhdSetModificationUuid(void *pBackendData, PCRTUUID pUuid)
{
LogFlowFunc(("pBackendData=%#p Uuid=%RTuuid\n", pBackendData, pUuid));
PVHDIMAGE pImage = (PVHDIMAGE)pBackendData;
@@ -2220,7 +2223,7 @@ static int vhdSetModificationUuid(void *pBackendData, PCRTUUID pUuid)
}
/** @copydoc VBOXHDDBACKEND::pfnGetParentUuid */
-static int vhdGetParentUuid(void *pBackendData, PRTUUID pUuid)
+static DECLCALLBACK(int) vhdGetParentUuid(void *pBackendData, PRTUUID pUuid)
{
LogFlowFunc(("pBackendData=%#p pUuid=%#p\n", pBackendData, pUuid));
PVHDIMAGE pImage = (PVHDIMAGE)pBackendData;
@@ -2241,7 +2244,7 @@ static int vhdGetParentUuid(void *pBackendData, PRTUUID pUuid)
}
/** @copydoc VBOXHDDBACKEND::pfnSetParentUuid */
-static int vhdSetParentUuid(void *pBackendData, PCRTUUID pUuid)
+static DECLCALLBACK(int) vhdSetParentUuid(void *pBackendData, PCRTUUID pUuid)
{
LogFlowFunc(("pBackendData=%#p Uuid=%RTuuid\n", pBackendData, pUuid));
PVHDIMAGE pImage = (PVHDIMAGE)pBackendData;
@@ -2267,7 +2270,7 @@ static int vhdSetParentUuid(void *pBackendData, PCRTUUID pUuid)
}
/** @copydoc VBOXHDDBACKEND::pfnGetParentModificationUuid */
-static int vhdGetParentModificationUuid(void *pBackendData, PRTUUID pUuid)
+static DECLCALLBACK(int) vhdGetParentModificationUuid(void *pBackendData, PRTUUID pUuid)
{
LogFlowFunc(("pBackendData=%#p pUuid=%#p\n", pBackendData, pUuid));
PVHDIMAGE pImage = (PVHDIMAGE)pBackendData;
@@ -2285,7 +2288,7 @@ static int vhdGetParentModificationUuid(void *pBackendData, PRTUUID pUuid)
}
/** @copydoc VBOXHDDBACKEND::pfnSetParentModificationUuid */
-static int vhdSetParentModificationUuid(void *pBackendData, PCRTUUID pUuid)
+static DECLCALLBACK(int) vhdSetParentModificationUuid(void *pBackendData, PCRTUUID pUuid)
{
LogFlowFunc(("pBackendData=%#p Uuid=%RTuuid\n", pBackendData, pUuid));
PVHDIMAGE pImage = (PVHDIMAGE)pBackendData;
@@ -2308,7 +2311,7 @@ static int vhdSetParentModificationUuid(void *pBackendData, PCRTUUID pUuid)
}
/** @copydoc VBOXHDDBACKEND::pfnDump */
-static void vhdDump(void *pBackendData)
+static DECLCALLBACK(void) vhdDump(void *pBackendData)
{
PVHDIMAGE pImage = (PVHDIMAGE)pBackendData;
@@ -2325,7 +2328,7 @@ static void vhdDump(void *pBackendData)
}
/** @copydoc VBOXHDDBACKEND::pfnGetTimestamp */
-static int vhdGetTimeStamp(void *pBackendData, PRTTIMESPEC pTimeStamp)
+static DECLCALLBACK(int) vhdGetTimeStamp(void *pBackendData, PRTTIMESPEC pTimeStamp)
{
int rc = VINF_SUCCESS;
PVHDIMAGE pImage = (PVHDIMAGE)pBackendData;
@@ -2342,7 +2345,7 @@ static int vhdGetTimeStamp(void *pBackendData, PRTTIMESPEC pTimeStamp)
}
/** @copydoc VBOXHDDBACKEND::pfnGetParentTimeStamp */
-static int vhdGetParentTimeStamp(void *pBackendData, PRTTIMESPEC pTimeStamp)
+static DECLCALLBACK(int) vhdGetParentTimeStamp(void *pBackendData, PRTTIMESPEC pTimeStamp)
{
int rc = VINF_SUCCESS;
PVHDIMAGE pImage = (PVHDIMAGE)pBackendData;
@@ -2359,7 +2362,7 @@ static int vhdGetParentTimeStamp(void *pBackendData, PRTTIMESPEC pTimeStamp)
}
/** @copydoc VBOXHDDBACKEND::pfnSetParentTimeStamp */
-static int vhdSetParentTimeStamp(void *pBackendData, PCRTTIMESPEC pTimeStamp)
+static DECLCALLBACK(int) vhdSetParentTimeStamp(void *pBackendData, PCRTTIMESPEC pTimeStamp)
{
int rc = VINF_SUCCESS;
PVHDIMAGE pImage = (PVHDIMAGE)pBackendData;
@@ -2383,7 +2386,7 @@ static int vhdSetParentTimeStamp(void *pBackendData, PCRTTIMESPEC pTimeStamp)
}
/** @copydoc VBOXHDDBACKEND::pfnGetParentFilename */
-static int vhdGetParentFilename(void *pBackendData, char **ppszParentFilename)
+static DECLCALLBACK(int) vhdGetParentFilename(void *pBackendData, char **ppszParentFilename)
{
int rc = VINF_SUCCESS;
PVHDIMAGE pImage = (PVHDIMAGE)pBackendData;
@@ -2399,7 +2402,7 @@ static int vhdGetParentFilename(void *pBackendData, char **ppszParentFilename)
}
/** @copydoc VBOXHDDBACKEND::pfnSetParentFilename */
-static int vhdSetParentFilename(void *pBackendData, const char *pszParentFilename)
+static DECLCALLBACK(int) vhdSetParentFilename(void *pBackendData, const char *pszParentFilename)
{
int rc = VINF_SUCCESS;
PVHDIMAGE pImage = (PVHDIMAGE)pBackendData;
@@ -2428,16 +2431,16 @@ static int vhdSetParentFilename(void *pBackendData, const char *pszParentFilenam
}
/** @copydoc VBOXHDDBACKEND::pfnCompact */
-static int vhdCompact(void *pBackendData, unsigned uPercentStart,
- unsigned uPercentSpan, PVDINTERFACE pVDIfsDisk,
- PVDINTERFACE pVDIfsImage, PVDINTERFACE pVDIfsOperation)
+static DECLCALLBACK(int) vhdCompact(void *pBackendData, unsigned uPercentStart,
+ unsigned uPercentSpan, PVDINTERFACE pVDIfsDisk,
+ PVDINTERFACE pVDIfsImage, PVDINTERFACE pVDIfsOperation)
{
PVHDIMAGE pImage = (PVHDIMAGE)pBackendData;
int rc = VINF_SUCCESS;
void *pvBuf = NULL, *pvReplace = NULL;
uint32_t *paBlocks = NULL;
- int (*pfnParentRead)(void *, uint64_t, void *, size_t) = NULL;
+ DECLCALLBACKMEMBER(int, pfnParentRead)(void *, uint64_t, void *, size_t) = NULL;
void *pvParent = NULL;
PVDINTERFACEPARENTSTATE pIfParentState = VDIfParentStateGet(pVDIfsOperation);
if (pIfParentState)
@@ -2667,11 +2670,11 @@ static int vhdCompact(void *pBackendData, unsigned uPercentStart,
}
/** @copydoc VBOXHDDBACKEND::pfnResize */
-static int vhdResize(void *pBackendData, uint64_t cbSize,
- PCVDGEOMETRY pPCHSGeometry, PCVDGEOMETRY pLCHSGeometry,
- unsigned uPercentStart, unsigned uPercentSpan,
- PVDINTERFACE pVDIfsDisk, PVDINTERFACE pVDIfsImage,
- PVDINTERFACE pVDIfsOperation)
+static DECLCALLBACK(int) vhdResize(void *pBackendData, uint64_t cbSize,
+ PCVDGEOMETRY pPCHSGeometry, PCVDGEOMETRY pLCHSGeometry,
+ unsigned uPercentStart, unsigned uPercentSpan,
+ PVDINTERFACE pVDIfsDisk, PVDINTERFACE pVDIfsImage,
+ PVDINTERFACE pVDIfsOperation)
{
PVHDIMAGE pImage = (PVHDIMAGE)pBackendData;
int rc = VINF_SUCCESS;
diff --git a/src/VBox/Storage/VHDX.cpp b/src/VBox/Storage/VHDX.cpp
index 25159e2..5a10e34 100644
--- a/src/VBox/Storage/VHDX.cpp
+++ b/src/VBox/Storage/VHDX.cpp
@@ -15,9 +15,10 @@
* hope that it will be useful, but WITHOUT ANY WARRANTY of any kind.
*/
-/*******************************************************************************
-* Header Files *
-*******************************************************************************/
+
+/*********************************************************************************************************************************
+* Header Files *
+*********************************************************************************************************************************/
#define LOG_GROUP LOG_GROUP_VD_VHDX
#include <VBox/vd-plugin.h>
#include <VBox/err.h>
@@ -32,9 +33,10 @@
#include "VDBackends.h"
-/*******************************************************************************
-* On disk data structures *
-*******************************************************************************/
+
+/*********************************************************************************************************************************
+* On disk data structures *
+*********************************************************************************************************************************/
/**
* VHDX file type identifier.
@@ -473,9 +475,10 @@ typedef struct VhdxParentLocatorEntry
/** Pointer to an on disk VHDX parent locator entry. */
typedef struct VhdxParentLocatorEntry *PVhdxParentLocatorEntry;
-/*******************************************************************************
-* Constants And Macros, Structures and Typedefs *
-*******************************************************************************/
+
+/*********************************************************************************************************************************
+* Constants And Macros, Structures and Typedefs *
+*********************************************************************************************************************************/
typedef enum VHDXMETADATAITEM
{
@@ -565,9 +568,10 @@ typedef enum VHDXECONV
#define SET_ENDIAN_U32(u32) (enmConv == VHDXECONV_H2F ? RT_H2LE_U32(u32) : RT_LE2H_U32(u32))
#define SET_ENDIAN_U64(u64) (enmConv == VHDXECONV_H2F ? RT_H2LE_U64(u64) : RT_LE2H_U64(u64))
-/*******************************************************************************
-* Static Variables *
-*******************************************************************************/
+
+/*********************************************************************************************************************************
+* Static Variables *
+*********************************************************************************************************************************/
/**
* NULL-terminated array of supported file extensions.
@@ -592,9 +596,10 @@ static const VHDXMETADATAITEMPROPS s_aVhdxMetadataItemProps[] =
{VHDX_METADATA_TBL_ENTRY_ITEM_PARENT_LOCATOR, false, false, true, VHDXMETADATAITEM_PARENT_LOCATOR}
};
-/*******************************************************************************
-* Internal Functions *
-*******************************************************************************/
+
+/*********************************************************************************************************************************
+* Internal Functions *
+*********************************************************************************************************************************/
/**
* Converts the file identifier between file and host endianness.
@@ -1731,8 +1736,8 @@ static int vhdxOpenImage(PVHDXIMAGE pImage, unsigned uOpenFlags)
/** @copydoc VBOXHDDBACKEND::pfnCheckIfValid */
-static int vhdxCheckIfValid(const char *pszFilename, PVDINTERFACE pVDIfsDisk,
- PVDINTERFACE pVDIfsImage, VDTYPE *penmType)
+static DECLCALLBACK(int) vhdxCheckIfValid(const char *pszFilename, PVDINTERFACE pVDIfsDisk,
+ PVDINTERFACE pVDIfsImage, VDTYPE *penmType)
{
LogFlowFunc(("pszFilename=\"%s\" pVDIfsDisk=%#p pVDIfsImage=%#p\n", pszFilename, pVDIfsDisk, pVDIfsImage));
PVDIOSTORAGE pStorage = NULL;
@@ -1787,9 +1792,9 @@ static int vhdxCheckIfValid(const char *pszFilename, PVDINTERFACE pVDIfsDisk,
}
/** @copydoc VBOXHDDBACKEND::pfnOpen */
-static int vhdxOpen(const char *pszFilename, unsigned uOpenFlags,
- PVDINTERFACE pVDIfsDisk, PVDINTERFACE pVDIfsImage,
- VDTYPE enmType, void **ppBackendData)
+static DECLCALLBACK(int) vhdxOpen(const char *pszFilename, unsigned uOpenFlags,
+ PVDINTERFACE pVDIfsDisk, PVDINTERFACE pVDIfsImage,
+ VDTYPE enmType, void **ppBackendData)
{
LogFlowFunc(("pszFilename=\"%s\" uOpenFlags=%#x pVDIfsDisk=%#p pVDIfsImage=%#p enmType=%u ppBackendData=%#p\n", pszFilename, uOpenFlags, pVDIfsDisk, pVDIfsImage, enmType, ppBackendData));
int rc;
@@ -1845,7 +1850,7 @@ static DECLCALLBACK(int) vhdxCreate(const char *pszFilename, uint64_t cbSize,
}
/** @copydoc VBOXHDDBACKEND::pfnRename */
-static int vhdxRename(void *pBackendData, const char *pszFilename)
+static DECLCALLBACK(int) vhdxRename(void *pBackendData, const char *pszFilename)
{
LogFlowFunc(("pBackendData=%#p pszFilename=%#p\n", pBackendData, pszFilename));
int rc = VINF_SUCCESS;
@@ -1887,7 +1892,7 @@ static int vhdxRename(void *pBackendData, const char *pszFilename)
}
/** @copydoc VBOXHDDBACKEND::pfnClose */
-static int vhdxClose(void *pBackendData, bool fDelete)
+static DECLCALLBACK(int) vhdxClose(void *pBackendData, bool fDelete)
{
LogFlowFunc(("pBackendData=%#p fDelete=%d\n", pBackendData, fDelete));
PVHDXIMAGE pImage = (PVHDXIMAGE)pBackendData;
@@ -1901,8 +1906,8 @@ static int vhdxClose(void *pBackendData, bool fDelete)
}
/** @copydoc VBOXHDDBACKEND::pfnRead */
-static int vhdxRead(void *pBackendData, uint64_t uOffset, size_t cbToRead,
- PVDIOCTX pIoCtx, size_t *pcbActuallyRead)
+static DECLCALLBACK(int) vhdxRead(void *pBackendData, uint64_t uOffset, size_t cbToRead,
+ PVDIOCTX pIoCtx, size_t *pcbActuallyRead)
{
LogFlowFunc(("pBackendData=%#p uOffset=%llu pIoCtx=%#p cbToRead=%zu pcbActuallyRead=%#p\n",
pBackendData, uOffset, pIoCtx, cbToRead, pcbActuallyRead));
@@ -1959,9 +1964,9 @@ static int vhdxRead(void *pBackendData, uint64_t uOffset, size_t cbToRead,
}
/** @copydoc VBOXHDDBACKEND::pfnWrite */
-static int vhdxWrite(void *pBackendData, uint64_t uOffset, size_t cbToWrite,
- PVDIOCTX pIoCtx, size_t *pcbWriteProcess, size_t *pcbPreRead,
- size_t *pcbPostRead, unsigned fWrite)
+static DECLCALLBACK(int) vhdxWrite(void *pBackendData, uint64_t uOffset, size_t cbToWrite,
+ PVDIOCTX pIoCtx, size_t *pcbWriteProcess, size_t *pcbPreRead,
+ size_t *pcbPostRead, unsigned fWrite)
{
LogFlowFunc(("pBackendData=%#p uOffset=%llu pIoCtx=%#p cbToWrite=%zu pcbWriteProcess=%#p pcbPreRead=%#p pcbPostRead=%#p\n",
pBackendData, uOffset, pIoCtx, cbToWrite, pcbWriteProcess, pcbPreRead, pcbPostRead));
@@ -1985,7 +1990,7 @@ static int vhdxWrite(void *pBackendData, uint64_t uOffset, size_t cbToWrite,
}
/** @copydoc VBOXHDDBACKEND::pfnFlush */
-static int vhdxFlush(void *pBackendData, PVDIOCTX pIoCtx)
+static DECLCALLBACK(int) vhdxFlush(void *pBackendData, PVDIOCTX pIoCtx)
{
LogFlowFunc(("pBackendData=%#p pIoCtx=%#p\n", pBackendData, pIoCtx));
PVHDXIMAGE pImage = (PVHDXIMAGE)pBackendData;
@@ -2001,7 +2006,7 @@ static int vhdxFlush(void *pBackendData, PVDIOCTX pIoCtx)
}
/** @copydoc VBOXHDDBACKEND::pfnGetVersion */
-static unsigned vhdxGetVersion(void *pBackendData)
+static DECLCALLBACK(unsigned) vhdxGetVersion(void *pBackendData)
{
LogFlowFunc(("pBackendData=%#p\n", pBackendData));
PVHDXIMAGE pImage = (PVHDXIMAGE)pBackendData;
@@ -2015,7 +2020,7 @@ static unsigned vhdxGetVersion(void *pBackendData)
}
/** @copydoc VBOXHDDBACKEND::pfnGetSectorSize */
-static uint32_t vhdxGetSectorSize(void *pBackendData)
+static DECLCALLBACK(uint32_t) vhdxGetSectorSize(void *pBackendData)
{
LogFlowFunc(("pBackendData=%#p\n", pBackendData));
PVHDXIMAGE pImage = (PVHDXIMAGE)pBackendData;
@@ -2031,7 +2036,7 @@ static uint32_t vhdxGetSectorSize(void *pBackendData)
}
/** @copydoc VBOXHDDBACKEND::pfnGetSize */
-static uint64_t vhdxGetSize(void *pBackendData)
+static DECLCALLBACK(uint64_t) vhdxGetSize(void *pBackendData)
{
LogFlowFunc(("pBackendData=%#p\n", pBackendData));
PVHDXIMAGE pImage = (PVHDXIMAGE)pBackendData;
@@ -2047,7 +2052,7 @@ static uint64_t vhdxGetSize(void *pBackendData)
}
/** @copydoc VBOXHDDBACKEND::pfnGetFileSize */
-static uint64_t vhdxGetFileSize(void *pBackendData)
+static DECLCALLBACK(uint64_t) vhdxGetFileSize(void *pBackendData)
{
LogFlowFunc(("pBackendData=%#p\n", pBackendData));
PVHDXIMAGE pImage = (PVHDXIMAGE)pBackendData;
@@ -2071,8 +2076,8 @@ static uint64_t vhdxGetFileSize(void *pBackendData)
}
/** @copydoc VBOXHDDBACKEND::pfnGetPCHSGeometry */
-static int vhdxGetPCHSGeometry(void *pBackendData,
- PVDGEOMETRY pPCHSGeometry)
+static DECLCALLBACK(int) vhdxGetPCHSGeometry(void *pBackendData,
+ PVDGEOMETRY pPCHSGeometry)
{
LogFlowFunc(("pBackendData=%#p pPCHSGeometry=%#p\n", pBackendData, pPCHSGeometry));
PVHDXIMAGE pImage = (PVHDXIMAGE)pBackendData;
@@ -2098,8 +2103,8 @@ static int vhdxGetPCHSGeometry(void *pBackendData,
}
/** @copydoc VBOXHDDBACKEND::pfnSetPCHSGeometry */
-static int vhdxSetPCHSGeometry(void *pBackendData,
- PCVDGEOMETRY pPCHSGeometry)
+static DECLCALLBACK(int) vhdxSetPCHSGeometry(void *pBackendData,
+ PCVDGEOMETRY pPCHSGeometry)
{
LogFlowFunc(("pBackendData=%#p pPCHSGeometry=%#p PCHS=%u/%u/%u\n", pBackendData, pPCHSGeometry, pPCHSGeometry->cCylinders, pPCHSGeometry->cHeads, pPCHSGeometry->cSectors));
PVHDXIMAGE pImage = (PVHDXIMAGE)pBackendData;
@@ -2122,8 +2127,8 @@ static int vhdxSetPCHSGeometry(void *pBackendData,
}
/** @copydoc VBOXHDDBACKEND::pfnGetLCHSGeometry */
-static int vhdxGetLCHSGeometry(void *pBackendData,
- PVDGEOMETRY pLCHSGeometry)
+static DECLCALLBACK(int) vhdxGetLCHSGeometry(void *pBackendData,
+ PVDGEOMETRY pLCHSGeometry)
{
LogFlowFunc(("pBackendData=%#p pLCHSGeometry=%#p\n", pBackendData, pLCHSGeometry));
PVHDXIMAGE pImage = (PVHDXIMAGE)pBackendData;
@@ -2146,8 +2151,8 @@ static int vhdxGetLCHSGeometry(void *pBackendData,
}
/** @copydoc VBOXHDDBACKEND::pfnSetLCHSGeometry */
-static int vhdxSetLCHSGeometry(void *pBackendData,
- PCVDGEOMETRY pLCHSGeometry)
+static DECLCALLBACK(int) vhdxSetLCHSGeometry(void *pBackendData,
+ PCVDGEOMETRY pLCHSGeometry)
{
LogFlowFunc(("pBackendData=%#p pLCHSGeometry=%#p LCHS=%u/%u/%u\n", pBackendData, pLCHSGeometry, pLCHSGeometry->cCylinders, pLCHSGeometry->cHeads, pLCHSGeometry->cSectors));
PVHDXIMAGE pImage = (PVHDXIMAGE)pBackendData;
@@ -2170,7 +2175,7 @@ static int vhdxSetLCHSGeometry(void *pBackendData,
}
/** @copydoc VBOXHDDBACKEND::pfnGetImageFlags */
-static unsigned vhdxGetImageFlags(void *pBackendData)
+static DECLCALLBACK(unsigned) vhdxGetImageFlags(void *pBackendData)
{
LogFlowFunc(("pBackendData=%#p\n", pBackendData));
PVHDXIMAGE pImage = (PVHDXIMAGE)pBackendData;
@@ -2188,7 +2193,7 @@ static unsigned vhdxGetImageFlags(void *pBackendData)
}
/** @copydoc VBOXHDDBACKEND::pfnGetOpenFlags */
-static unsigned vhdxGetOpenFlags(void *pBackendData)
+static DECLCALLBACK(unsigned) vhdxGetOpenFlags(void *pBackendData)
{
LogFlowFunc(("pBackendData=%#p\n", pBackendData));
PVHDXIMAGE pImage = (PVHDXIMAGE)pBackendData;
@@ -2206,7 +2211,7 @@ static unsigned vhdxGetOpenFlags(void *pBackendData)
}
/** @copydoc VBOXHDDBACKEND::pfnSetOpenFlags */
-static int vhdxSetOpenFlags(void *pBackendData, unsigned uOpenFlags)
+static DECLCALLBACK(int) vhdxSetOpenFlags(void *pBackendData, unsigned uOpenFlags)
{
LogFlowFunc(("pBackendData=%#p\n uOpenFlags=%#x", pBackendData, uOpenFlags));
PVHDXIMAGE pImage = (PVHDXIMAGE)pBackendData;
@@ -2228,8 +2233,8 @@ static int vhdxSetOpenFlags(void *pBackendData, unsigned uOpenFlags)
}
/** @copydoc VBOXHDDBACKEND::pfnGetComment */
-static int vhdxGetComment(void *pBackendData, char *pszComment,
- size_t cbComment)
+static DECLCALLBACK(int) vhdxGetComment(void *pBackendData, char *pszComment,
+ size_t cbComment)
{
LogFlowFunc(("pBackendData=%#p pszComment=%#p cbComment=%zu\n", pBackendData, pszComment, cbComment));
PVHDXIMAGE pImage = (PVHDXIMAGE)pBackendData;
@@ -2247,7 +2252,7 @@ static int vhdxGetComment(void *pBackendData, char *pszComment,
}
/** @copydoc VBOXHDDBACKEND::pfnSetComment */
-static int vhdxSetComment(void *pBackendData, const char *pszComment)
+static DECLCALLBACK(int) vhdxSetComment(void *pBackendData, const char *pszComment)
{
LogFlowFunc(("pBackendData=%#p pszComment=\"%s\"\n", pBackendData, pszComment));
PVHDXIMAGE pImage = (PVHDXIMAGE)pBackendData;
@@ -2270,7 +2275,7 @@ static int vhdxSetComment(void *pBackendData, const char *pszComment)
}
/** @copydoc VBOXHDDBACKEND::pfnGetUuid */
-static int vhdxGetUuid(void *pBackendData, PRTUUID pUuid)
+static DECLCALLBACK(int) vhdxGetUuid(void *pBackendData, PRTUUID pUuid)
{
LogFlowFunc(("pBackendData=%#p pUuid=%#p\n", pBackendData, pUuid));
PVHDXIMAGE pImage = (PVHDXIMAGE)pBackendData;
@@ -2288,7 +2293,7 @@ static int vhdxGetUuid(void *pBackendData, PRTUUID pUuid)
}
/** @copydoc VBOXHDDBACKEND::pfnSetUuid */
-static int vhdxSetUuid(void *pBackendData, PCRTUUID pUuid)
+static DECLCALLBACK(int) vhdxSetUuid(void *pBackendData, PCRTUUID pUuid)
{
LogFlowFunc(("pBackendData=%#p Uuid=%RTuuid\n", pBackendData, pUuid));
PVHDXIMAGE pImage = (PVHDXIMAGE)pBackendData;
@@ -2312,7 +2317,7 @@ static int vhdxSetUuid(void *pBackendData, PCRTUUID pUuid)
}
/** @copydoc VBOXHDDBACKEND::pfnGetModificationUuid */
-static int vhdxGetModificationUuid(void *pBackendData, PRTUUID pUuid)
+static DECLCALLBACK(int) vhdxGetModificationUuid(void *pBackendData, PRTUUID pUuid)
{
LogFlowFunc(("pBackendData=%#p pUuid=%#p\n", pBackendData, pUuid));
PVHDXIMAGE pImage = (PVHDXIMAGE)pBackendData;
@@ -2330,7 +2335,7 @@ static int vhdxGetModificationUuid(void *pBackendData, PRTUUID pUuid)
}
/** @copydoc VBOXHDDBACKEND::pfnSetModificationUuid */
-static int vhdxSetModificationUuid(void *pBackendData, PCRTUUID pUuid)
+static DECLCALLBACK(int) vhdxSetModificationUuid(void *pBackendData, PCRTUUID pUuid)
{
LogFlowFunc(("pBackendData=%#p Uuid=%RTuuid\n", pBackendData, pUuid));
PVHDXIMAGE pImage = (PVHDXIMAGE)pBackendData;
@@ -2353,7 +2358,7 @@ static int vhdxSetModificationUuid(void *pBackendData, PCRTUUID pUuid)
}
/** @copydoc VBOXHDDBACKEND::pfnGetParentUuid */
-static int vhdxGetParentUuid(void *pBackendData, PRTUUID pUuid)
+static DECLCALLBACK(int) vhdxGetParentUuid(void *pBackendData, PRTUUID pUuid)
{
LogFlowFunc(("pBackendData=%#p pUuid=%#p\n", pBackendData, pUuid));
PVHDXIMAGE pImage = (PVHDXIMAGE)pBackendData;
@@ -2371,7 +2376,7 @@ static int vhdxGetParentUuid(void *pBackendData, PRTUUID pUuid)
}
/** @copydoc VBOXHDDBACKEND::pfnSetParentUuid */
-static int vhdxSetParentUuid(void *pBackendData, PCRTUUID pUuid)
+static DECLCALLBACK(int) vhdxSetParentUuid(void *pBackendData, PCRTUUID pUuid)
{
LogFlowFunc(("pBackendData=%#p Uuid=%RTuuid\n", pBackendData, pUuid));
PVHDXIMAGE pImage = (PVHDXIMAGE)pBackendData;
@@ -2394,7 +2399,7 @@ static int vhdxSetParentUuid(void *pBackendData, PCRTUUID pUuid)
}
/** @copydoc VBOXHDDBACKEND::pfnGetParentModificationUuid */
-static int vhdxGetParentModificationUuid(void *pBackendData, PRTUUID pUuid)
+static DECLCALLBACK(int) vhdxGetParentModificationUuid(void *pBackendData, PRTUUID pUuid)
{
LogFlowFunc(("pBackendData=%#p pUuid=%#p\n", pBackendData, pUuid));
PVHDXIMAGE pImage = (PVHDXIMAGE)pBackendData;
@@ -2412,7 +2417,7 @@ static int vhdxGetParentModificationUuid(void *pBackendData, PRTUUID pUuid)
}
/** @copydoc VBOXHDDBACKEND::pfnSetParentModificationUuid */
-static int vhdxSetParentModificationUuid(void *pBackendData, PCRTUUID pUuid)
+static DECLCALLBACK(int) vhdxSetParentModificationUuid(void *pBackendData, PCRTUUID pUuid)
{
LogFlowFunc(("pBackendData=%#p Uuid=%RTuuid\n", pBackendData, pUuid));
PVHDXIMAGE pImage = (PVHDXIMAGE)pBackendData;
@@ -2435,7 +2440,7 @@ static int vhdxSetParentModificationUuid(void *pBackendData, PCRTUUID pUuid)
}
/** @copydoc VBOXHDDBACKEND::pfnDump */
-static void vhdxDump(void *pBackendData)
+static DECLCALLBACK(void) vhdxDump(void *pBackendData)
{
PVHDXIMAGE pImage = (PVHDXIMAGE)pBackendData;
diff --git a/src/VBox/Storage/VMDK.cpp b/src/VBox/Storage/VMDK.cpp
index c433c4d..141736d 100644
--- a/src/VBox/Storage/VMDK.cpp
+++ b/src/VBox/Storage/VMDK.cpp
@@ -15,9 +15,10 @@
* hope that it will be useful, but WITHOUT ANY WARRANTY of any kind.
*/
-/*******************************************************************************
-* Header Files *
-*******************************************************************************/
+
+/*********************************************************************************************************************************
+* Header Files *
+*********************************************************************************************************************************/
#define LOG_GROUP LOG_GROUP_VD_VMDK
#include <VBox/vd-plugin.h>
#include <VBox/err.h>
@@ -34,9 +35,10 @@
#include "VDBackends.h"
-/*******************************************************************************
-* Constants And Macros, Structures and Typedefs *
-*******************************************************************************/
+
+/*********************************************************************************************************************************
+* Constants And Macros, Structures and Typedefs *
+*********************************************************************************************************************************/
/** Maximum encoded string size (including NUL) we allow for VMDK images.
* Deliberately not set high to avoid running out of descriptor space. */
@@ -509,9 +511,10 @@ typedef struct VMDKGRAINALLOCASYNC
uint64_t uRGTSector;
} VMDKGRAINALLOCASYNC, *PVMDKGRAINALLOCASYNC;
-/*******************************************************************************
-* Static Variables *
-*******************************************************************************/
+
+/*********************************************************************************************************************************
+* Static Variables *
+*********************************************************************************************************************************/
/** NULL-terminated array of supported file extensions. */
static const VDFILEEXTENSION s_aVmdkFileExtensions[] =
@@ -520,9 +523,10 @@ static const VDFILEEXTENSION s_aVmdkFileExtensions[] =
{NULL, VDTYPE_INVALID}
};
-/*******************************************************************************
-* Internal Functions *
-*******************************************************************************/
+
+/*********************************************************************************************************************************
+* Internal Functions *
+*********************************************************************************************************************************/
static void vmdkFreeStreamBuffers(PVMDKEXTENT pExtent);
static int vmdkFreeExtentData(PVMDKIMAGE pImage, PVMDKEXTENT pExtent,
@@ -533,8 +537,8 @@ static int vmdkFlushImage(PVMDKIMAGE pImage, PVDIOCTX pIoCtx);
static int vmdkSetImageComment(PVMDKIMAGE pImage, const char *pszComment);
static int vmdkFreeImage(PVMDKIMAGE pImage, bool fDelete);
-static int vmdkAllocGrainComplete(void *pBackendData, PVDIOCTX pIoCtx,
- void *pvUser, int rcReq);
+static DECLCALLBACK(int) vmdkAllocGrainComplete(void *pBackendData, PVDIOCTX pIoCtx,
+ void *pvUser, int rcReq);
/**
* Internal: open a file (using a file descriptor cache to ensure each file
@@ -3245,7 +3249,7 @@ static int vmdkOpenImage(PVMDKIMAGE pImage, unsigned uOpenFlags)
{
case VMDKETYPE_HOSTED_SPARSE:
rc = vmdkFileOpen(pImage, &pExtent->pFile, pExtent->pszFullname,
- VDOpenFlagsToFileOpenFlags(uOpenFlags | (pExtent->enmAccess == VMDKACCESS_READONLY) ? VD_OPEN_FLAGS_READONLY : 0,
+ VDOpenFlagsToFileOpenFlags(uOpenFlags | ((pExtent->enmAccess == VMDKACCESS_READONLY) ? VD_OPEN_FLAGS_READONLY : 0),
false /* fCreate */));
if (RT_FAILURE(rc))
{
@@ -3272,7 +3276,7 @@ static int vmdkOpenImage(PVMDKIMAGE pImage, unsigned uOpenFlags)
case VMDKETYPE_VMFS:
case VMDKETYPE_FLAT:
rc = vmdkFileOpen(pImage, &pExtent->pFile, pExtent->pszFullname,
- VDOpenFlagsToFileOpenFlags(uOpenFlags | (pExtent->enmAccess == VMDKACCESS_READONLY) ? VD_OPEN_FLAGS_READONLY : 0,
+ VDOpenFlagsToFileOpenFlags(uOpenFlags | ((pExtent->enmAccess == VMDKACCESS_READONLY) ? VD_OPEN_FLAGS_READONLY : 0),
false /* fCreate */));
if (RT_FAILURE(rc))
{
@@ -3398,7 +3402,7 @@ static int vmdkCreateRawImage(PVMDKIMAGE pImage, const PVBOXHDDRAW pRaw,
/* Open flat image, the raw disk. */
rc = vmdkFileOpen(pImage, &pExtent->pFile, pExtent->pszFullname,
- VDOpenFlagsToFileOpenFlags(pImage->uOpenFlags | (pExtent->enmAccess == VMDKACCESS_READONLY) ? VD_OPEN_FLAGS_READONLY : 0,
+ VDOpenFlagsToFileOpenFlags(pImage->uOpenFlags | ((pExtent->enmAccess == VMDKACCESS_READONLY) ? VD_OPEN_FLAGS_READONLY : 0),
false /* fCreate */));
if (RT_FAILURE(rc))
return vdIfError(pImage->pIfError, rc, RT_SRC_POS, N_("VMDK: could not open raw disk file '%s'"), pExtent->pszFullname);
@@ -3506,7 +3510,7 @@ static int vmdkCreateRawImage(PVMDKIMAGE pImage, const PVBOXHDDRAW pRaw,
/* Create partition table flat image. */
rc = vmdkFileOpen(pImage, &pExtent->pFile, pExtent->pszFullname,
- VDOpenFlagsToFileOpenFlags(pImage->uOpenFlags | (pExtent->enmAccess == VMDKACCESS_READONLY) ? VD_OPEN_FLAGS_READONLY : 0,
+ VDOpenFlagsToFileOpenFlags(pImage->uOpenFlags | ((pExtent->enmAccess == VMDKACCESS_READONLY) ? VD_OPEN_FLAGS_READONLY : 0),
true /* fCreate */));
if (RT_FAILURE(rc))
return vdIfError(pImage->pIfError, rc, RT_SRC_POS, N_("VMDK: could not create new partition data file '%s'"), pExtent->pszFullname);
@@ -3541,7 +3545,7 @@ static int vmdkCreateRawImage(PVMDKIMAGE pImage, const PVBOXHDDRAW pRaw,
/* Open flat image, the raw partition. */
rc = vmdkFileOpen(pImage, &pExtent->pFile, pExtent->pszFullname,
- VDOpenFlagsToFileOpenFlags(pImage->uOpenFlags | (pExtent->enmAccess == VMDKACCESS_READONLY) ? VD_OPEN_FLAGS_READONLY : 0,
+ VDOpenFlagsToFileOpenFlags(pImage->uOpenFlags | ((pExtent->enmAccess == VMDKACCESS_READONLY) ? VD_OPEN_FLAGS_READONLY : 0),
false /* fCreate */));
if (RT_FAILURE(rc))
return vdIfError(pImage->pIfError, rc, RT_SRC_POS, N_("VMDK: could not open raw partition file '%s'"), pExtent->pszFullname);
@@ -5227,8 +5231,8 @@ static char *vmdkStrReplace(const char *pszWhere, const char *pszWhat,
/** @copydoc VBOXHDDBACKEND::pfnCheckIfValid */
-static int vmdkCheckIfValid(const char *pszFilename, PVDINTERFACE pVDIfsDisk,
- PVDINTERFACE pVDIfsImage, VDTYPE *penmType)
+static DECLCALLBACK(int) vmdkCheckIfValid(const char *pszFilename, PVDINTERFACE pVDIfsDisk,
+ PVDINTERFACE pVDIfsImage, VDTYPE *penmType)
{
LogFlowFunc(("pszFilename=\"%s\" pVDIfsDisk=%#p pVDIfsImage=%#p penmType=%#p\n",
pszFilename, pVDIfsDisk, pVDIfsImage, penmType));
@@ -5272,9 +5276,9 @@ out:
}
/** @copydoc VBOXHDDBACKEND::pfnOpen */
-static int vmdkOpen(const char *pszFilename, unsigned uOpenFlags,
- PVDINTERFACE pVDIfsDisk, PVDINTERFACE pVDIfsImage,
- VDTYPE enmType, void **ppBackendData)
+static DECLCALLBACK(int) vmdkOpen(const char *pszFilename, unsigned uOpenFlags,
+ PVDINTERFACE pVDIfsDisk, PVDINTERFACE pVDIfsImage,
+ VDTYPE enmType, void **ppBackendData)
{
LogFlowFunc(("pszFilename=\"%s\" uOpenFlags=%#x pVDIfsDisk=%#p pVDIfsImage=%#p enmType=%u ppBackendData=%#p\n", pszFilename, uOpenFlags, pVDIfsDisk, pVDIfsImage, enmType, ppBackendData));
int rc;
@@ -5325,14 +5329,14 @@ out:
}
/** @copydoc VBOXHDDBACKEND::pfnCreate */
-static int vmdkCreate(const char *pszFilename, uint64_t cbSize,
- unsigned uImageFlags, const char *pszComment,
- PCVDGEOMETRY pPCHSGeometry, PCVDGEOMETRY pLCHSGeometry,
- PCRTUUID pUuid, unsigned uOpenFlags,
- unsigned uPercentStart, unsigned uPercentSpan,
- PVDINTERFACE pVDIfsDisk, PVDINTERFACE pVDIfsImage,
- PVDINTERFACE pVDIfsOperation, VDTYPE enmType,
- void **ppBackendData)
+static DECLCALLBACK(int) vmdkCreate(const char *pszFilename, uint64_t cbSize,
+ unsigned uImageFlags, const char *pszComment,
+ PCVDGEOMETRY pPCHSGeometry, PCVDGEOMETRY pLCHSGeometry,
+ PCRTUUID pUuid, unsigned uOpenFlags,
+ unsigned uPercentStart, unsigned uPercentSpan,
+ PVDINTERFACE pVDIfsDisk, PVDINTERFACE pVDIfsImage,
+ PVDINTERFACE pVDIfsOperation, VDTYPE enmType,
+ void **ppBackendData)
{
LogFlowFunc(("pszFilename=\"%s\" cbSize=%llu uImageFlags=%#x pszComment=\"%s\" pPCHSGeometry=%#p pLCHSGeometry=%#p Uuid=%RTuuid uOpenFlags=%#x uPercentStart=%u uPercentSpan=%u pVDIfsDisk=%#p pVDIfsImage=%#p pVDIfsOperation=%#p enmType=%u ppBackendData=%#p\n",
pszFilename, cbSize, uImageFlags, pszComment, pPCHSGeometry, pLCHSGeometry, pUuid, uOpenFlags, uPercentStart, uPercentSpan, pVDIfsDisk, pVDIfsImage, pVDIfsOperation, enmType, ppBackendData));
@@ -5451,7 +5455,7 @@ out:
}
/** @copydoc VBOXHDDBACKEND::pfnRename */
-static int vmdkRename(void *pBackendData, const char *pszFilename)
+static DECLCALLBACK(int) vmdkRename(void *pBackendData, const char *pszFilename)
{
LogFlowFunc(("pBackendData=%#p pszFilename=%#p\n", pBackendData, pszFilename));
@@ -5706,7 +5710,7 @@ out:
}
/** @copydoc VBOXHDDBACKEND::pfnClose */
-static int vmdkClose(void *pBackendData, bool fDelete)
+static DECLCALLBACK(int) vmdkClose(void *pBackendData, bool fDelete)
{
LogFlowFunc(("pBackendData=%#p fDelete=%d\n", pBackendData, fDelete));
PVMDKIMAGE pImage = (PVMDKIMAGE)pBackendData;
@@ -5720,8 +5724,8 @@ static int vmdkClose(void *pBackendData, bool fDelete)
}
/** @copydoc VBOXHDDBACKEND::pfnRead */
-static int vmdkRead(void *pBackendData, uint64_t uOffset, size_t cbToRead,
- PVDIOCTX pIoCtx, size_t *pcbActuallyRead)
+static DECLCALLBACK(int) vmdkRead(void *pBackendData, uint64_t uOffset, size_t cbToRead,
+ PVDIOCTX pIoCtx, size_t *pcbActuallyRead)
{
LogFlowFunc(("pBackendData=%#p uOffset=%llu pIoCtx=%#p cbToRead=%zu pcbActuallyRead=%#p\n",
pBackendData, uOffset, pIoCtx, cbToRead, pcbActuallyRead));
@@ -5843,9 +5847,9 @@ out:
}
/** @copydoc VBOXHDDBACKEND::pfnWrite */
-static int vmdkWrite(void *pBackendData, uint64_t uOffset, size_t cbToWrite,
- PVDIOCTX pIoCtx, size_t *pcbWriteProcess, size_t *pcbPreRead,
- size_t *pcbPostRead, unsigned fWrite)
+static DECLCALLBACK(int) vmdkWrite(void *pBackendData, uint64_t uOffset, size_t cbToWrite,
+ PVDIOCTX pIoCtx, size_t *pcbWriteProcess, size_t *pcbPreRead,
+ size_t *pcbPostRead, unsigned fWrite)
{
LogFlowFunc(("pBackendData=%#p uOffset=%llu pIoCtx=%#p cbToWrite=%zu pcbWriteProcess=%#p pcbPreRead=%#p pcbPostRead=%#p\n",
pBackendData, uOffset, pIoCtx, cbToWrite, pcbWriteProcess, pcbPreRead, pcbPostRead));
@@ -5989,7 +5993,7 @@ out:
}
/** @copydoc VBOXHDDBACKEND::pfnFlush */
-static int vmdkFlush(void *pBackendData, PVDIOCTX pIoCtx)
+static DECLCALLBACK(int) vmdkFlush(void *pBackendData, PVDIOCTX pIoCtx)
{
PVMDKIMAGE pImage = (PVMDKIMAGE)pBackendData;
@@ -5997,7 +6001,7 @@ static int vmdkFlush(void *pBackendData, PVDIOCTX pIoCtx)
}
/** @copydoc VBOXHDDBACKEND::pfnGetVersion */
-static unsigned vmdkGetVersion(void *pBackendData)
+static DECLCALLBACK(unsigned) vmdkGetVersion(void *pBackendData)
{
LogFlowFunc(("pBackendData=%#p\n", pBackendData));
PVMDKIMAGE pImage = (PVMDKIMAGE)pBackendData;
@@ -6011,7 +6015,7 @@ static unsigned vmdkGetVersion(void *pBackendData)
}
/** @copydoc VBOXHDDBACKEND::pfnGetSectorSize */
-static uint32_t vmdkGetSectorSize(void *pBackendData)
+static DECLCALLBACK(uint32_t) vmdkGetSectorSize(void *pBackendData)
{
LogFlowFunc(("pBackendData=%#p\n", pBackendData));
PVMDKIMAGE pImage = (PVMDKIMAGE)pBackendData;
@@ -6025,7 +6029,7 @@ static uint32_t vmdkGetSectorSize(void *pBackendData)
}
/** @copydoc VBOXHDDBACKEND::pfnGetSize */
-static uint64_t vmdkGetSize(void *pBackendData)
+static DECLCALLBACK(uint64_t) vmdkGetSize(void *pBackendData)
{
LogFlowFunc(("pBackendData=%#p\n", pBackendData));
PVMDKIMAGE pImage = (PVMDKIMAGE)pBackendData;
@@ -6039,7 +6043,7 @@ static uint64_t vmdkGetSize(void *pBackendData)
}
/** @copydoc VBOXHDDBACKEND::pfnGetFileSize */
-static uint64_t vmdkGetFileSize(void *pBackendData)
+static DECLCALLBACK(uint64_t) vmdkGetFileSize(void *pBackendData)
{
LogFlowFunc(("pBackendData=%#p\n", pBackendData));
PVMDKIMAGE pImage = (PVMDKIMAGE)pBackendData;
@@ -6072,7 +6076,7 @@ static uint64_t vmdkGetFileSize(void *pBackendData)
}
/** @copydoc VBOXHDDBACKEND::pfnGetPCHSGeometry */
-static int vmdkGetPCHSGeometry(void *pBackendData, PVDGEOMETRY pPCHSGeometry)
+static DECLCALLBACK(int) vmdkGetPCHSGeometry(void *pBackendData, PVDGEOMETRY pPCHSGeometry)
{
LogFlowFunc(("pBackendData=%#p pPCHSGeometry=%#p\n", pBackendData, pPCHSGeometry));
PVMDKIMAGE pImage = (PVMDKIMAGE)pBackendData;
@@ -6098,7 +6102,7 @@ static int vmdkGetPCHSGeometry(void *pBackendData, PVDGEOMETRY pPCHSGeometry)
}
/** @copydoc VBOXHDDBACKEND::pfnSetPCHSGeometry */
-static int vmdkSetPCHSGeometry(void *pBackendData, PCVDGEOMETRY pPCHSGeometry)
+static DECLCALLBACK(int) vmdkSetPCHSGeometry(void *pBackendData, PCVDGEOMETRY pPCHSGeometry)
{
LogFlowFunc(("pBackendData=%#p pPCHSGeometry=%#p PCHS=%u/%u/%u\n", pBackendData, pPCHSGeometry, pPCHSGeometry->cCylinders, pPCHSGeometry->cHeads, pPCHSGeometry->cSectors));
PVMDKIMAGE pImage = (PVMDKIMAGE)pBackendData;
@@ -6134,7 +6138,7 @@ out:
}
/** @copydoc VBOXHDDBACKEND::pfnGetLCHSGeometry */
-static int vmdkGetLCHSGeometry(void *pBackendData, PVDGEOMETRY pLCHSGeometry)
+static DECLCALLBACK(int) vmdkGetLCHSGeometry(void *pBackendData, PVDGEOMETRY pLCHSGeometry)
{
LogFlowFunc(("pBackendData=%#p pLCHSGeometry=%#p\n", pBackendData, pLCHSGeometry));
PVMDKIMAGE pImage = (PVMDKIMAGE)pBackendData;
@@ -6160,7 +6164,7 @@ static int vmdkGetLCHSGeometry(void *pBackendData, PVDGEOMETRY pLCHSGeometry)
}
/** @copydoc VBOXHDDBACKEND::pfnSetLCHSGeometry */
-static int vmdkSetLCHSGeometry(void *pBackendData, PCVDGEOMETRY pLCHSGeometry)
+static DECLCALLBACK(int) vmdkSetLCHSGeometry(void *pBackendData, PCVDGEOMETRY pLCHSGeometry)
{
LogFlowFunc(("pBackendData=%#p pLCHSGeometry=%#p LCHS=%u/%u/%u\n", pBackendData, pLCHSGeometry, pLCHSGeometry->cCylinders, pLCHSGeometry->cHeads, pLCHSGeometry->cSectors));
PVMDKIMAGE pImage = (PVMDKIMAGE)pBackendData;
@@ -6196,7 +6200,7 @@ out:
}
/** @copydoc VBOXHDDBACKEND::pfnGetImageFlags */
-static unsigned vmdkGetImageFlags(void *pBackendData)
+static DECLCALLBACK(unsigned) vmdkGetImageFlags(void *pBackendData)
{
LogFlowFunc(("pBackendData=%#p\n", pBackendData));
PVMDKIMAGE pImage = (PVMDKIMAGE)pBackendData;
@@ -6214,7 +6218,7 @@ static unsigned vmdkGetImageFlags(void *pBackendData)
}
/** @copydoc VBOXHDDBACKEND::pfnGetOpenFlags */
-static unsigned vmdkGetOpenFlags(void *pBackendData)
+static DECLCALLBACK(unsigned) vmdkGetOpenFlags(void *pBackendData)
{
LogFlowFunc(("pBackendData=%#p\n", pBackendData));
PVMDKIMAGE pImage = (PVMDKIMAGE)pBackendData;
@@ -6232,7 +6236,7 @@ static unsigned vmdkGetOpenFlags(void *pBackendData)
}
/** @copydoc VBOXHDDBACKEND::pfnSetOpenFlags */
-static int vmdkSetOpenFlags(void *pBackendData, unsigned uOpenFlags)
+static DECLCALLBACK(int) vmdkSetOpenFlags(void *pBackendData, unsigned uOpenFlags)
{
LogFlowFunc(("pBackendData=%#p uOpenFlags=%#x\n", pBackendData, uOpenFlags));
PVMDKIMAGE pImage = (PVMDKIMAGE)pBackendData;
@@ -6268,7 +6272,7 @@ out:
}
/** @copydoc VBOXHDDBACKEND::pfnGetComment */
-static int vmdkGetComment(void *pBackendData, char *pszComment,
+static DECLCALLBACK(int) vmdkGetComment(void *pBackendData, char *pszComment,
size_t cbComment)
{
LogFlowFunc(("pBackendData=%#p pszComment=%#p cbComment=%zu\n", pBackendData, pszComment, cbComment));
@@ -6307,7 +6311,7 @@ out:
}
/** @copydoc VBOXHDDBACKEND::pfnSetComment */
-static int vmdkSetComment(void *pBackendData, const char *pszComment)
+static DECLCALLBACK(int) vmdkSetComment(void *pBackendData, const char *pszComment)
{
LogFlowFunc(("pBackendData=%#p pszComment=\"%s\"\n", pBackendData, pszComment));
PVMDKIMAGE pImage = (PVMDKIMAGE)pBackendData;
@@ -6339,7 +6343,7 @@ out:
}
/** @copydoc VBOXHDDBACKEND::pfnGetUuid */
-static int vmdkGetUuid(void *pBackendData, PRTUUID pUuid)
+static DECLCALLBACK(int) vmdkGetUuid(void *pBackendData, PRTUUID pUuid)
{
LogFlowFunc(("pBackendData=%#p pUuid=%#p\n", pBackendData, pUuid));
PVMDKIMAGE pImage = (PVMDKIMAGE)pBackendData;
@@ -6360,7 +6364,7 @@ static int vmdkGetUuid(void *pBackendData, PRTUUID pUuid)
}
/** @copydoc VBOXHDDBACKEND::pfnSetUuid */
-static int vmdkSetUuid(void *pBackendData, PCRTUUID pUuid)
+static DECLCALLBACK(int) vmdkSetUuid(void *pBackendData, PCRTUUID pUuid)
{
LogFlowFunc(("pBackendData=%#p Uuid=%RTuuid\n", pBackendData, pUuid));
PVMDKIMAGE pImage = (PVMDKIMAGE)pBackendData;
@@ -6396,7 +6400,7 @@ static int vmdkSetUuid(void *pBackendData, PCRTUUID pUuid)
}
/** @copydoc VBOXHDDBACKEND::pfnGetModificationUuid */
-static int vmdkGetModificationUuid(void *pBackendData, PRTUUID pUuid)
+static DECLCALLBACK(int) vmdkGetModificationUuid(void *pBackendData, PRTUUID pUuid)
{
LogFlowFunc(("pBackendData=%#p pUuid=%#p\n", pBackendData, pUuid));
PVMDKIMAGE pImage = (PVMDKIMAGE)pBackendData;
@@ -6417,7 +6421,7 @@ static int vmdkGetModificationUuid(void *pBackendData, PRTUUID pUuid)
}
/** @copydoc VBOXHDDBACKEND::pfnSetModificationUuid */
-static int vmdkSetModificationUuid(void *pBackendData, PCRTUUID pUuid)
+static DECLCALLBACK(int) vmdkSetModificationUuid(void *pBackendData, PCRTUUID pUuid)
{
LogFlowFunc(("pBackendData=%#p Uuid=%RTuuid\n", pBackendData, pUuid));
PVMDKIMAGE pImage = (PVMDKIMAGE)pBackendData;
@@ -6456,7 +6460,7 @@ static int vmdkSetModificationUuid(void *pBackendData, PCRTUUID pUuid)
}
/** @copydoc VBOXHDDBACKEND::pfnGetParentUuid */
-static int vmdkGetParentUuid(void *pBackendData, PRTUUID pUuid)
+static DECLCALLBACK(int) vmdkGetParentUuid(void *pBackendData, PRTUUID pUuid)
{
LogFlowFunc(("pBackendData=%#p pUuid=%#p\n", pBackendData, pUuid));
PVMDKIMAGE pImage = (PVMDKIMAGE)pBackendData;
@@ -6477,7 +6481,7 @@ static int vmdkGetParentUuid(void *pBackendData, PRTUUID pUuid)
}
/** @copydoc VBOXHDDBACKEND::pfnSetParentUuid */
-static int vmdkSetParentUuid(void *pBackendData, PCRTUUID pUuid)
+static DECLCALLBACK(int) vmdkSetParentUuid(void *pBackendData, PCRTUUID pUuid)
{
LogFlowFunc(("pBackendData=%#p Uuid=%RTuuid\n", pBackendData, pUuid));
PVMDKIMAGE pImage = (PVMDKIMAGE)pBackendData;
@@ -6512,7 +6516,7 @@ static int vmdkSetParentUuid(void *pBackendData, PCRTUUID pUuid)
}
/** @copydoc VBOXHDDBACKEND::pfnGetParentModificationUuid */
-static int vmdkGetParentModificationUuid(void *pBackendData, PRTUUID pUuid)
+static DECLCALLBACK(int) vmdkGetParentModificationUuid(void *pBackendData, PRTUUID pUuid)
{
LogFlowFunc(("pBackendData=%#p pUuid=%#p\n", pBackendData, pUuid));
PVMDKIMAGE pImage = (PVMDKIMAGE)pBackendData;
@@ -6533,7 +6537,7 @@ static int vmdkGetParentModificationUuid(void *pBackendData, PRTUUID pUuid)
}
/** @copydoc VBOXHDDBACKEND::pfnSetParentModificationUuid */
-static int vmdkSetParentModificationUuid(void *pBackendData, PCRTUUID pUuid)
+static DECLCALLBACK(int) vmdkSetParentModificationUuid(void *pBackendData, PCRTUUID pUuid)
{
LogFlowFunc(("pBackendData=%#p Uuid=%RTuuid\n", pBackendData, pUuid));
PVMDKIMAGE pImage = (PVMDKIMAGE)pBackendData;
@@ -6568,7 +6572,7 @@ static int vmdkSetParentModificationUuid(void *pBackendData, PCRTUUID pUuid)
}
/** @copydoc VBOXHDDBACKEND::pfnDump */
-static void vmdkDump(void *pBackendData)
+static DECLCALLBACK(void) vmdkDump(void *pBackendData)
{
PVMDKIMAGE pImage = (PVMDKIMAGE)pBackendData;
diff --git a/src/VBox/Storage/testcase/Makefile.kmk b/src/VBox/Storage/testcase/Makefile.kmk
index 5ebc364..c6a2821 100644
--- a/src/VBox/Storage/testcase/Makefile.kmk
+++ b/src/VBox/Storage/testcase/Makefile.kmk
@@ -19,17 +19,6 @@ SUB_DEPTH = ../../../..
include $(KBUILD_PATH)/subheader.kmk
#
-# vditool - useful too for manipulating VDIs, but now pretty obsolete and
-# probably will go away soon. Testcase only now.
-#
-if defined(VBOX_WITH_TESTCASES) || defined(VBOX_WITH_VDITOOL)
- PROGRAMS += vditool
- vditool_TEMPLATE = VBOXR3TSTEXE
- vditool_LIBS = $(LIB_DDU)
- vditool_SOURCES = vditool.cpp
-endif
-
-#
# Basic testcases for the VD code.
#
ifdef VBOX_WITH_TESTCASES
diff --git a/src/VBox/Storage/testcase/VDIoBackendMem.cpp b/src/VBox/Storage/testcase/VDIoBackendMem.cpp
index b572fe7..85e5cae 100644
--- a/src/VBox/Storage/testcase/VDIoBackendMem.cpp
+++ b/src/VBox/Storage/testcase/VDIoBackendMem.cpp
@@ -74,7 +74,7 @@ typedef struct VDIOBACKENDMEM
volatile uint32_t cReqsWaiting;
} VDIOBACKENDMEM;
-static int vdIoBackendMemThread(RTTHREAD hThread, void *pvUser);
+static DECLCALLBACK(int) vdIoBackendMemThread(RTTHREAD hThread, void *pvUser);
/**
* Pokes the I/O thread that something interesting happened.
@@ -196,7 +196,7 @@ int VDIoBackendMemTransfer(PVDIOBACKENDMEM pIoBackend, PVDMEMDISK pMemDisk,
* @param hThread The thread handle.
* @param pvUser Opaque user data.
*/
-static int vdIoBackendMemThread(RTTHREAD hThread, void *pvUser)
+static DECLCALLBACK(int) vdIoBackendMemThread(RTTHREAD hThread, void *pvUser)
{
PVDIOBACKENDMEM pIoBackend = (PVDIOBACKENDMEM)pvUser;
diff --git a/src/VBox/Storage/testcase/VDMemDisk.cpp b/src/VBox/Storage/testcase/VDMemDisk.cpp
index e953657..8815b33 100644
--- a/src/VBox/Storage/testcase/VDMemDisk.cpp
+++ b/src/VBox/Storage/testcase/VDMemDisk.cpp
@@ -76,7 +76,7 @@ int VDMemDiskCreate(PPVDMEMDISK ppMemDisk, uint64_t cbSize)
return rc;
}
-static int vdMemDiskDestroy(PAVLRU64NODECORE pNode, void *pvUser)
+static DECLCALLBACK(int) vdMemDiskDestroy(PAVLRU64NODECORE pNode, void *pvUser)
{
PVDMEMDISKSEG pSeg = (PVDMEMDISKSEG)pNode;
RTMemFree(pSeg->pvSeg);
@@ -307,7 +307,7 @@ int VDMemDiskGetSize(PVDMEMDISK pMemDisk, uint64_t *pcbSize)
* @param pvParam Opaque user data containing the pointer to
* the file handle.
*/
-static int vdMemDiskSegmentWriteToFile(PAVLRU64NODECORE pNode, void *pvParam)
+static DECLCALLBACK(int) vdMemDiskSegmentWriteToFile(PAVLRU64NODECORE pNode, void *pvParam)
{
PVDMEMDISKSEG pSeg = (PVDMEMDISKSEG)pNode;
RTFILE hFile = *(PRTFILE)pvParam;
diff --git a/src/VBox/Storage/testcase/VDScript.cpp b/src/VBox/Storage/testcase/VDScript.cpp
index 8d84beb..6b7df7e 100644
--- a/src/VBox/Storage/testcase/VDScript.cpp
+++ b/src/VBox/Storage/testcase/VDScript.cpp
@@ -42,6 +42,7 @@
* and: http://slps.github.com/zoo/c/iso-9899-tc3.html
* and: http://www.open-std.org/jtc1/sc22/WG14/www/docs/n1256.pdf
*/
+
#define LOGGROUP LOGGROUP_DEFAULT
#include <iprt/string.h>
#include <iprt/list.h>
@@ -2878,7 +2879,7 @@ DECLHIDDEN(int) VDScriptCtxCreate(PVDSCRIPTCTX phScriptCtx)
return rc;
}
-static int vdScriptCtxDestroyFnSpace(PRTSTRSPACECORE pStr, void *pvUser)
+static DECLCALLBACK(int) vdScriptCtxDestroyFnSpace(PRTSTRSPACECORE pStr, void *pvUser)
{
NOREF(pvUser);
diff --git a/src/VBox/Storage/testcase/tstVD-2.cpp b/src/VBox/Storage/testcase/tstVD-2.cpp
index 7e81ffc..3dc1fc2 100644
--- a/src/VBox/Storage/testcase/tstVD-2.cpp
+++ b/src/VBox/Storage/testcase/tstVD-2.cpp
@@ -26,9 +26,10 @@
#include "stdio.h"
#include "stdlib.h"
-/*******************************************************************************
-* Global Variables *
-*******************************************************************************/
+
+/*********************************************************************************************************************************
+* Global Variables *
+*********************************************************************************************************************************/
/** The error count. */
unsigned g_cErrors = 0;
@@ -42,7 +43,7 @@ static struct KeyValuePair {
{ NULL, NULL }
};
-static bool tstAreKeysValid(void *pvUser, const char *pszzValid)
+static DECLCALLBACK(bool) tstAreKeysValid(void *pvUser, const char *pszzValid)
{
return true;
}
@@ -55,7 +56,7 @@ static const char *tstGetValueByKey(const char *pszKey)
return NULL;
}
-static int tstQuerySize(void *pvUser, const char *pszName, size_t *pcbValue)
+static DECLCALLBACK(int) tstQuerySize(void *pvUser, const char *pszName, size_t *pcbValue)
{
const char *pszValue = tstGetValueByKey(pszName);
if (!pszValue)
@@ -64,7 +65,7 @@ static int tstQuerySize(void *pvUser, const char *pszName, size_t *pcbValue)
return VINF_SUCCESS;
}
-static int tstQuery(void *pvUser, const char *pszName, char *pszValue, size_t cchValue)
+static DECLCALLBACK(int) tstQuery(void *pvUser, const char *pszName, char *pszValue, size_t cchValue)
{
const char *pszTmp = tstGetValueByKey(pszName);
if (!pszValue)
diff --git a/src/VBox/Storage/testcase/tstVD.cpp b/src/VBox/Storage/testcase/tstVD.cpp
index 953b5c3..d9df6cf 100644
--- a/src/VBox/Storage/testcase/tstVD.cpp
+++ b/src/VBox/Storage/testcase/tstVD.cpp
@@ -15,9 +15,10 @@
* hope that it will be useful, but WITHOUT ANY WARRANTY of any kind.
*/
-/*******************************************************************************
-* Header Files *
-*******************************************************************************/
+
+/*********************************************************************************************************************************
+* Header Files *
+*********************************************************************************************************************************/
#include <VBox/vd.h>
#include <VBox/err.h>
#include <VBox/log.h>
@@ -36,15 +37,15 @@
#define VDI_TEST
#define VMDK_TEST
-/*******************************************************************************
-* Global Variables *
-*******************************************************************************/
+
+/*********************************************************************************************************************************
+* Global Variables *
+*********************************************************************************************************************************/
/** The error count. */
unsigned g_cErrors = 0;
-static void tstVDError(void *pvUser, int rc, RT_SRC_POS_DECL,
- const char *pszFormat, va_list va)
+static DECLCALLBACK(void) tstVDError(void *pvUser, int rc, RT_SRC_POS_DECL, const char *pszFormat, va_list va)
{
g_cErrors++;
RTPrintf("tstVD: Error %Rrc at %s:%u (%s): ", rc, RT_SRC_POS_ARGS);
@@ -52,7 +53,7 @@ static void tstVDError(void *pvUser, int rc, RT_SRC_POS_DECL,
RTPrintf("\n");
}
-static int tstVDMessage(void *pvUser, const char *pszFormat, va_list va)
+static DECLCALLBACK(int) tstVDMessage(void *pvUser, const char *pszFormat, va_list va)
{
RTPrintf("tstVD: ");
RTPrintfV(pszFormat, va);
diff --git a/src/VBox/Storage/testcase/tstVDCopy.cpp b/src/VBox/Storage/testcase/tstVDCopy.cpp
index 6d73560..415217f 100644
--- a/src/VBox/Storage/testcase/tstVDCopy.cpp
+++ b/src/VBox/Storage/testcase/tstVDCopy.cpp
@@ -30,18 +30,18 @@
/* from VBoxHDD.cpp */
#define VD_MERGE_BUFFER_SIZE (16 * _1M)
-/*******************************************************************************
-* Global Variables *
-*******************************************************************************/
+
+/*********************************************************************************************************************************
+* Global Variables *
+*********************************************************************************************************************************/
/** The error count. */
unsigned g_cErrors = 0;
-static void tstVDError(void *pvUser, int rc, RT_SRC_POS_DECL,
- const char *pszFormat, va_list va)
+static DECLCALLBACK(void) tstVDError(void *pvUser, int rc, RT_SRC_POS_DECL, const char *pszFormat, va_list va)
{
g_cErrors++;
- RTPrintf("tstVD: Error %Rrc at %s:%u (%s): ", rc, RT_SRC_POS_ARGS);
+ RTPrintf("tstVDCopy: Error %Rrc at %s:%u (%s): ", rc, RT_SRC_POS_ARGS);
RTPrintfV(pszFormat, va);
RTPrintf("\n");
}
diff --git a/src/VBox/Storage/testcase/tstVDIo.cpp b/src/VBox/Storage/testcase/tstVDIo.cpp
index 08862be..71f0f9a 100644
--- a/src/VBox/Storage/testcase/tstVDIo.cpp
+++ b/src/VBox/Storage/testcase/tstVDIo.cpp
@@ -512,17 +512,16 @@ static DECLCALLBACK(int) vdScriptCallbackPrint(PVDSCRIPTARG paScriptArgs, void *
return VINF_SUCCESS;
}
-static void tstVDError(void *pvUser, int rc, RT_SRC_POS_DECL,
- const char *pszFormat, va_list va)
+static DECLCALLBACK(void) tstVDError(void *pvUser, int rc, RT_SRC_POS_DECL, const char *pszFormat, va_list va)
{
- RTPrintf("tstVD: Error %Rrc at %s:%u (%s): ", rc, RT_SRC_POS_ARGS);
+ RTPrintf("tstVDIo: Error %Rrc at %s:%u (%s): ", rc, RT_SRC_POS_ARGS);
RTPrintfV(pszFormat, va);
RTPrintf("\n");
}
-static int tstVDMessage(void *pvUser, const char *pszFormat, va_list va)
+static DECLCALLBACK(int) tstVDMessage(void *pvUser, const char *pszFormat, va_list va)
{
- RTPrintf("tstVD: ");
+ RTPrintf("tstVDIo: ");
RTPrintfV(pszFormat, va);
return VINF_SUCCESS;
}
diff --git a/src/VBox/Storage/testcase/tstVDShareable.cpp b/src/VBox/Storage/testcase/tstVDShareable.cpp
index 834f6a9..d23849b 100644
--- a/src/VBox/Storage/testcase/tstVDShareable.cpp
+++ b/src/VBox/Storage/testcase/tstVDShareable.cpp
@@ -15,9 +15,10 @@
* hope that it will be useful, but WITHOUT ANY WARRANTY of any kind.
*/
-/*******************************************************************************
-* Header Files *
-*******************************************************************************/
+
+/*********************************************************************************************************************************
+* Header Files *
+*********************************************************************************************************************************/
#include <VBox/vd.h>
#include <VBox/err.h>
#include <VBox/log.h>
@@ -36,25 +37,25 @@
#define VDI_TEST
#define VMDK_TEST
-/*******************************************************************************
-* Global Variables *
-*******************************************************************************/
+
+/*********************************************************************************************************************************
+* Global Variables *
+*********************************************************************************************************************************/
/** The error count. */
unsigned g_cErrors = 0;
-static void tstVDError(void *pvUser, int rc, RT_SRC_POS_DECL,
- const char *pszFormat, va_list va)
+static DECLCALLBACK(void) tstVDError(void *pvUser, int rc, RT_SRC_POS_DECL, const char *pszFormat, va_list va)
{
g_cErrors++;
- RTPrintf("tstVD: Error %Rrc at %s:%u (%s): ", rc, RT_SRC_POS_ARGS);
+ RTPrintf("tstVDShareable: Error %Rrc at %s:%u (%s): ", rc, RT_SRC_POS_ARGS);
RTPrintfV(pszFormat, va);
RTPrintf("\n");
}
-static int tstVDMessage(void *pvUser, const char *pszFormat, va_list va)
+static DECLCALLBACK(int) tstVDMessage(void *pvUser, const char *pszFormat, va_list va)
{
- RTPrintf("tstVD: ");
+ RTPrintf("tstVDShareable: ");
RTPrintfV(pszFormat, va);
return VINF_SUCCESS;
}
@@ -121,7 +122,7 @@ int main(int argc, char *argv[])
RTR3InitExe(argc, &argv, 0);
int rc;
- RTPrintf("tstVD: TESTING...\n");
+ RTPrintf("tstVDShareable: TESTING...\n");
/*
* Clean up potential leftovers from previous unsuccessful runs.
@@ -133,7 +134,7 @@ int main(int argc, char *argv[])
rc = RTDirCreate("tmp", RTFS_UNIX_IRWXU, 0);
if (RT_FAILURE(rc))
{
- RTPrintf("tstVD: Failed to create 'tmp' directory! rc=%Rrc\n", rc);
+ RTPrintf("tstVDShareable: Failed to create 'tmp' directory! rc=%Rrc\n", rc);
g_cErrors++;
}
}
@@ -143,7 +144,7 @@ int main(int argc, char *argv[])
VD_IMAGE_FLAGS_FIXED);
if (RT_FAILURE(rc))
{
- RTPrintf("tstVD: VDI shareable test failed! rc=%Rrc\n", rc);
+ RTPrintf("tstVDShareable: VDI shareable test failed! rc=%Rrc\n", rc);
g_cErrors++;
}
#endif /* VDI_TEST */
@@ -156,16 +157,16 @@ int main(int argc, char *argv[])
rc = VDShutdown();
if (RT_FAILURE(rc))
{
- RTPrintf("tstVD: unloading backends failed! rc=%Rrc\n", rc);
+ RTPrintf("tstVDShareable: unloading backends failed! rc=%Rrc\n", rc);
g_cErrors++;
}
/*
* Summary
*/
if (!g_cErrors)
- RTPrintf("tstVD: SUCCESS\n");
+ RTPrintf("tstVDShareable: SUCCESS\n");
else
- RTPrintf("tstVD: FAILURE - %d errors\n", g_cErrors);
+ RTPrintf("tstVDShareable: FAILURE - %d errors\n", g_cErrors);
return !!g_cErrors;
}
diff --git a/src/VBox/Storage/testcase/tstVDSnap.cpp b/src/VBox/Storage/testcase/tstVDSnap.cpp
index 19215fb..21c961f 100644
--- a/src/VBox/Storage/testcase/tstVDSnap.cpp
+++ b/src/VBox/Storage/testcase/tstVDSnap.cpp
@@ -74,26 +74,26 @@ typedef struct VDDISKSEG
uint8_t *pbDataDiff;
} VDDISKSEG, *PVDDISKSEG;
-/*******************************************************************************
-* Global Variables *
-*******************************************************************************/
+
+/*********************************************************************************************************************************
+* Global Variables *
+*********************************************************************************************************************************/
/** The error count. */
unsigned g_cErrors = 0;
/** Global RNG state. */
RTRAND g_hRand;
-static void tstVDError(void *pvUser, int rc, RT_SRC_POS_DECL,
- const char *pszFormat, va_list va)
+static DECLCALLBACK(void) tstVDError(void *pvUser, int rc, RT_SRC_POS_DECL, const char *pszFormat, va_list va)
{
g_cErrors++;
- RTPrintf("tstVD: Error %Rrc at %s:%u (%s): ", rc, RT_SRC_POS_ARGS);
+ RTPrintf("tstVDSnap: Error %Rrc at %s:%u (%s): ", rc, RT_SRC_POS_ARGS);
RTPrintfV(pszFormat, va);
RTPrintf("\n");
}
-static int tstVDMessage(void *pvUser, const char *pszFormat, va_list va)
+static DECLCALLBACK(int) tstVDMessage(void *pvUser, const char *pszFormat, va_list va)
{
- RTPrintf("tstVD: ");
+ RTPrintf("tstVDSnap: ");
RTPrintfV(pszFormat, va);
return VINF_SUCCESS;
}
diff --git a/src/VBox/Storage/testcase/vbox-img.cpp b/src/VBox/Storage/testcase/vbox-img.cpp
index 3a4b26a..0256fb7 100644
--- a/src/VBox/Storage/testcase/vbox-img.cpp
+++ b/src/VBox/Storage/testcase/vbox-img.cpp
@@ -15,9 +15,10 @@
* hope that it will be useful, but WITHOUT ANY WARRANTY of any kind.
*/
-/*******************************************************************************
-* Header Files *
-*******************************************************************************/
+
+/*********************************************************************************************************************************
+* Header Files *
+*********************************************************************************************************************************/
#include <VBox/vd.h>
#include <VBox/err.h>
#include <VBox/version.h>
@@ -107,15 +108,14 @@ struct HandlerArg
static PVDINTERFACE pVDIfs;
-static DECLCALLBACK(void) handleVDError(void *pvUser, int rc, RT_SRC_POS_DECL,
- const char *pszFormat, va_list va)
+static DECLCALLBACK(void) handleVDError(void *pvUser, int rc, RT_SRC_POS_DECL, const char *pszFormat, va_list va)
{
NOREF(pvUser);
NOREF(rc);
RTMsgErrorV(pszFormat, va);
}
-static int handleVDMessage(void *pvUser, const char *pszFormat, va_list va)
+static DECLCALLBACK(int) handleVDMessage(void *pvUser, const char *pszFormat, va_list va)
{
NOREF(pvUser);
RTPrintfV(pszFormat, va);
@@ -473,9 +473,8 @@ typedef struct FILEIOSTATE
uint8_t abBuffer[16 *_1M];
} FILEIOSTATE, *PFILEIOSTATE;
-static int convInOpen(void *pvUser, const char *pszLocation,
- uint32_t fOpen, PFNVDCOMPLETED pfnCompleted,
- void **ppStorage)
+static DECLCALLBACK(int) convInOpen(void *pvUser, const char *pszLocation, uint32_t fOpen, PFNVDCOMPLETED pfnCompleted,
+ void **ppStorage)
{
NOREF(pvUser);
/* Validate input. */
@@ -501,7 +500,7 @@ static int convInOpen(void *pvUser, const char *pszLocation,
return VINF_SUCCESS;
}
-static int convInClose(void *pvUser, void *pStorage)
+static DECLCALLBACK(int) convInClose(void *pvUser, void *pStorage)
{
NOREF(pvUser);
AssertPtrReturn(pStorage, VERR_INVALID_POINTER);
@@ -512,15 +511,14 @@ static int convInClose(void *pvUser, void *pStorage)
return VINF_SUCCESS;
}
-static int convInDelete(void *pvUser, const char *pcszFilename)
+static DECLCALLBACK(int) convInDelete(void *pvUser, const char *pcszFilename)
{
NOREF(pvUser);
NOREF(pcszFilename);
AssertFailedReturn(VERR_NOT_SUPPORTED);
}
-static int convInMove(void *pvUser, const char *pcszSrc, const char *pcszDst,
- unsigned fMove)
+static DECLCALLBACK(int) convInMove(void *pvUser, const char *pcszSrc, const char *pcszDst, unsigned fMove)
{
NOREF(pvUser);
NOREF(pcszSrc);
@@ -529,8 +527,7 @@ static int convInMove(void *pvUser, const char *pcszSrc, const char *pcszDst,
AssertFailedReturn(VERR_NOT_SUPPORTED);
}
-static int convInGetFreeSpace(void *pvUser, const char *pcszFilename,
- int64_t *pcbFreeSpace)
+static DECLCALLBACK(int) convInGetFreeSpace(void *pvUser, const char *pcszFilename, int64_t *pcbFreeSpace)
{
NOREF(pvUser);
NOREF(pcszFilename);
@@ -539,8 +536,7 @@ static int convInGetFreeSpace(void *pvUser, const char *pcszFilename,
return VINF_SUCCESS;
}
-static int convInGetModificationTime(void *pvUser, const char *pcszFilename,
- PRTTIMESPEC pModificationTime)
+static DECLCALLBACK(int) convInGetModificationTime(void *pvUser, const char *pcszFilename, PRTTIMESPEC pModificationTime)
{
NOREF(pvUser);
NOREF(pcszFilename);
@@ -548,7 +544,7 @@ static int convInGetModificationTime(void *pvUser, const char *pcszFilename,
AssertFailedReturn(VERR_NOT_SUPPORTED);
}
-static int convInGetSize(void *pvUser, void *pStorage, uint64_t *pcbSize)
+static DECLCALLBACK(int) convInGetSize(void *pvUser, void *pStorage, uint64_t *pcbSize)
{
NOREF(pvUser);
NOREF(pStorage);
@@ -556,7 +552,7 @@ static int convInGetSize(void *pvUser, void *pStorage, uint64_t *pcbSize)
AssertFailedReturn(VERR_NOT_SUPPORTED);
}
-static int convInSetSize(void *pvUser, void *pStorage, uint64_t cbSize)
+static DECLCALLBACK(int) convInSetSize(void *pvUser, void *pStorage, uint64_t cbSize)
{
NOREF(pvUser);
NOREF(pStorage);
@@ -564,8 +560,8 @@ static int convInSetSize(void *pvUser, void *pStorage, uint64_t cbSize)
AssertFailedReturn(VERR_NOT_SUPPORTED);
}
-static int convInRead(void *pvUser, void *pStorage, uint64_t uOffset,
- void *pvBuffer, size_t cbBuffer, size_t *pcbRead)
+static DECLCALLBACK(int) convInRead(void *pvUser, void *pStorage, uint64_t uOffset,
+ void *pvBuffer, size_t cbBuffer, size_t *pcbRead)
{
NOREF(pvUser);
AssertPtrReturn(pStorage, VERR_INVALID_POINTER);
@@ -651,9 +647,8 @@ static int convInRead(void *pvUser, void *pStorage, uint64_t uOffset,
return VINF_SUCCESS;
}
-static int convInWrite(void *pvUser, void *pStorage, uint64_t uOffset,
- const void *pvBuffer, size_t cbBuffer,
- size_t *pcbWritten)
+static DECLCALLBACK(int) convInWrite(void *pvUser, void *pStorage, uint64_t uOffset, const void *pvBuffer, size_t cbBuffer,
+ size_t *pcbWritten)
{
NOREF(pvUser);
NOREF(pStorage);
@@ -664,16 +659,15 @@ static int convInWrite(void *pvUser, void *pStorage, uint64_t uOffset,
AssertFailedReturn(VERR_NOT_SUPPORTED);
}
-static int convInFlush(void *pvUser, void *pStorage)
+static DECLCALLBACK(int) convInFlush(void *pvUser, void *pStorage)
{
NOREF(pvUser);
NOREF(pStorage);
return VINF_SUCCESS;
}
-static int convOutOpen(void *pvUser, const char *pszLocation,
- uint32_t fOpen, PFNVDCOMPLETED pfnCompleted,
- void **ppStorage)
+static DECLCALLBACK(int) convOutOpen(void *pvUser, const char *pszLocation, uint32_t fOpen, PFNVDCOMPLETED pfnCompleted,
+ void **ppStorage)
{
NOREF(pvUser);
/* Validate input. */
@@ -699,7 +693,7 @@ static int convOutOpen(void *pvUser, const char *pszLocation,
return VINF_SUCCESS;
}
-static int convOutClose(void *pvUser, void *pStorage)
+static DECLCALLBACK(int) convOutClose(void *pvUser, void *pStorage)
{
NOREF(pvUser);
AssertPtrReturn(pStorage, VERR_INVALID_POINTER);
@@ -715,15 +709,14 @@ static int convOutClose(void *pvUser, void *pStorage)
return rc;
}
-static int convOutDelete(void *pvUser, const char *pcszFilename)
+static DECLCALLBACK(int) convOutDelete(void *pvUser, const char *pcszFilename)
{
NOREF(pvUser);
NOREF(pcszFilename);
AssertFailedReturn(VERR_NOT_SUPPORTED);
}
-static int convOutMove(void *pvUser, const char *pcszSrc, const char *pcszDst,
- unsigned fMove)
+static DECLCALLBACK(int) convOutMove(void *pvUser, const char *pcszSrc, const char *pcszDst, unsigned fMove)
{
NOREF(pvUser);
NOREF(pcszSrc);
@@ -732,8 +725,7 @@ static int convOutMove(void *pvUser, const char *pcszSrc, const char *pcszDst,
AssertFailedReturn(VERR_NOT_SUPPORTED);
}
-static int convOutGetFreeSpace(void *pvUser, const char *pcszFilename,
- int64_t *pcbFreeSpace)
+static DECLCALLBACK(int) convOutGetFreeSpace(void *pvUser, const char *pcszFilename, int64_t *pcbFreeSpace)
{
NOREF(pvUser);
NOREF(pcszFilename);
@@ -742,8 +734,7 @@ static int convOutGetFreeSpace(void *pvUser, const char *pcszFilename,
return VINF_SUCCESS;
}
-static int convOutGetModificationTime(void *pvUser, const char *pcszFilename,
- PRTTIMESPEC pModificationTime)
+static DECLCALLBACK(int) convOutGetModificationTime(void *pvUser, const char *pcszFilename, PRTTIMESPEC pModificationTime)
{
NOREF(pvUser);
NOREF(pcszFilename);
@@ -751,7 +742,7 @@ static int convOutGetModificationTime(void *pvUser, const char *pcszFilename,
AssertFailedReturn(VERR_NOT_SUPPORTED);
}
-static int convOutGetSize(void *pvUser, void *pStorage, uint64_t *pcbSize)
+static DECLCALLBACK(int) convOutGetSize(void *pvUser, void *pStorage, uint64_t *pcbSize)
{
NOREF(pvUser);
NOREF(pStorage);
@@ -759,7 +750,7 @@ static int convOutGetSize(void *pvUser, void *pStorage, uint64_t *pcbSize)
AssertFailedReturn(VERR_NOT_SUPPORTED);
}
-static int convOutSetSize(void *pvUser, void *pStorage, uint64_t cbSize)
+static DECLCALLBACK(int) convOutSetSize(void *pvUser, void *pStorage, uint64_t cbSize)
{
NOREF(pvUser);
NOREF(pStorage);
@@ -767,8 +758,8 @@ static int convOutSetSize(void *pvUser, void *pStorage, uint64_t cbSize)
AssertFailedReturn(VERR_NOT_SUPPORTED);
}
-static int convOutRead(void *pvUser, void *pStorage, uint64_t uOffset,
- void *pvBuffer, size_t cbBuffer, size_t *pcbRead)
+static DECLCALLBACK(int) convOutRead(void *pvUser, void *pStorage, uint64_t uOffset, void *pvBuffer, size_t cbBuffer,
+ size_t *pcbRead)
{
NOREF(pvUser);
NOREF(pStorage);
@@ -779,9 +770,8 @@ static int convOutRead(void *pvUser, void *pStorage, uint64_t uOffset,
AssertFailedReturn(VERR_NOT_SUPPORTED);
}
-static int convOutWrite(void *pvUser, void *pStorage, uint64_t uOffset,
- const void *pvBuffer, size_t cbBuffer,
- size_t *pcbWritten)
+static DECLCALLBACK(int) convOutWrite(void *pvUser, void *pStorage, uint64_t uOffset, const void *pvBuffer, size_t cbBuffer,
+ size_t *pcbWritten)
{
NOREF(pvUser);
AssertPtrReturn(pStorage, VERR_INVALID_POINTER);
@@ -825,7 +815,7 @@ static int convOutWrite(void *pvUser, void *pStorage, uint64_t uOffset,
return VINF_SUCCESS;
}
-static int convOutFlush(void *pvUser, void *pStorage)
+static DECLCALLBACK(int) convOutFlush(void *pvUser, void *pStorage)
{
NOREF(pvUser);
NOREF(pStorage);
diff --git a/src/VBox/Storage/testcase/vditool.cpp b/src/VBox/Storage/testcase/vditool.cpp
deleted file mode 100644
index 0352943..0000000
--- a/src/VBox/Storage/testcase/vditool.cpp
+++ /dev/null
@@ -1,471 +0,0 @@
-/** @file
- *
- * VBox HDD container maintenance/conversion utility
- */
-
-/*
- * Copyright (C) 2006-2011 Oracle Corporation
- *
- * This file is part of VirtualBox Open Source Edition (OSE), as
- * available from http://www.virtualbox.org. This file is free software;
- * you can redistribute it and/or modify it under the terms of the GNU
- * General Public License (GPL) as published by the Free Software
- * Foundation, in version 2 as it comes in the "COPYING" file of the
- * VirtualBox OSE distribution. VirtualBox OSE is distributed in the
- * hope that it will be useful, but WITHOUT ANY WARRANTY of any kind.
- */
-
-/*******************************************************************************
-* Header Files *
-*******************************************************************************/
-#include <VBox/vd.h>
-#include <iprt/alloc.h>
-#include <iprt/file.h>
-#include <iprt/stream.h>
-#include <iprt/string.h>
-#include <iprt/initterm.h>
-#include <VBox/err.h>
-#include <VBox/log.h>
-#include <VBox/version.h>
-
-#include <stdlib.h>
-
-
-
-static void ascii2upper(char *psz)
-{
- for (;*psz; psz++)
- if (*psz >= 'a' && *psz <= 'z')
- *psz += 'A' - 'a';
-}
-
-static int UsageExit()
-{
- RTPrintf("Usage: vditool <Command> [Params]\n"
- "Commands and params:\n"
- " NEW Filename Mbytes - create new image\n"
-#if 0
- " DD Filename DDFilename - create new image from DD format image\n"
- " CONVERT Filename - convert VDI image from old format\n"
- " DUMP Filename - debug dump\n"
- " RESETGEO Filename - reset geometry information\n"
- " COPY FromImage ToImage - make image copy\n"
- " COPYDD FromImage DDFilename - make a DD copy of the image\n"
- " SHRINK Filename - optimize (reduce) VDI image size\n"
-#endif
- );
- return 1;
-}
-
-static int SyntaxError(const char *pszMsg)
-{
- RTPrintf("Syntax error: %s\n\n", pszMsg);
- UsageExit();
- return 1;
-}
-
-/**
- * Our internal functions use UTF8
- */
-static int FilenameToUtf8(char **pszUtf8Filename, const char *pszFilename)
-{
- int rc = RTStrCurrentCPToUtf8(pszUtf8Filename, pszFilename);
- if (RT_FAILURE(rc))
- RTPrintf("Error converting filename '%s' to UTF8! (rc=%Rrc)\n",
- pszFilename, rc);
- return rc;
-}
-
-/**
- * Prints a done message indicating success or failure.
- * @returns rc
- * @param rc Status code.
- */
-static int PrintDone(int rc)
-{
- if (rc == VINF_SUCCESS)
- RTPrintf("The operation completed successfully!\n");
- else if (RT_SUCCESS(rc))
- RTPrintf("The operation completed successfully! (rc=%Rrc)\n", rc);
- else
- RTPrintf("FAILURE: %Rrf (%Rrc)\n", rc, rc);
- return rc;
-}
-
-static int NewImage(const char *pszFilename, uint64_t cMBs)
-{
- RTPrintf("Creating VDI: file=\"%s\" size=%RU64MB...\n",
- pszFilename, cMBs);
-
- /* translate argv[] to UTF8 */
- char *pszUtf8Filename;
- int rc = FilenameToUtf8(&pszUtf8Filename, pszFilename);
- if (RT_FAILURE(rc))
- return rc;
-
- PVBOXHDD hdd;
- rc = VDCreate(NULL, VDTYPE_HDD, &hdd);
- if (RT_FAILURE(rc))
- return PrintDone(rc);
-
- VDGEOMETRY geo = { 0, 0, 0 }; /* auto-detect */
- rc = VDCreateBase(hdd, "vdi", pszUtf8Filename,
- (uint64_t)cMBs * _1M,
- VD_IMAGE_FLAGS_NONE,
- "Newly created test image",
- &geo, &geo, NULL,
- VD_OPEN_FLAGS_NORMAL,
- NULL, NULL);
- return PrintDone(rc);
-}
-
-#if 0
-static int ConvertDDImage(const char *pszFilename, const char *pszDDFilename)
-{
- RTPrintf("Converting VDI: from DD image file=\"%s\" to file=\"%s\"...\n",
- pszDDFilename, pszFilename);
-
- /* translate argv[] to UTF8 */
- char *pszUtf8Filename, *pszUtf8DDFilename;
- int rc = FilenameToUtf8(&pszUtf8Filename, pszFilename);
- if (RT_FAILURE(rc))
- return rc;
- rc = FilenameToUtf8(&pszUtf8DDFilename, pszDDFilename);
- if (RT_FAILURE(rc))
- return rc;
-
- /* open raw image file. */
- RTFILE File;
- rc = RTFileOpen(&File, pszUtf8DDFilename, RTFILE_O_OPEN | RTFILE_O_READ | RTFILE_O_DENY_WRITE);
- if (RT_FAILURE(rc))
- {
- RTPrintf("File=\"%s\" open error: %Rrf\n", pszDDFilename, rc);
- return rc;
- }
-
- /* get image size. */
- uint64_t cbFile;
- rc = RTFileGetSize(File, &cbFile);
- if (RT_SUCCESS(rc))
- {
- RTPrintf("Creating fixed image with size %u Bytes...\n", (unsigned)cbFile);
- rc = VDICreateBaseImage(pszUtf8Filename,
- VDI_IMAGE_TYPE_FIXED,
- cbFile,
- "Converted from DD test image", NULL, NULL);
- PrintDone(rc);
- if (RT_SUCCESS(rc))
- {
- RTPrintf("Writing data...\n");
- PVDIDISK pVdi = VDIDiskCreate();
- rc = VDIDiskOpenImage(pVdi, pszUtf8Filename, VDI_OPEN_FLAGS_NORMAL);
- if (RT_SUCCESS(rc))
- {
- /* alloc work buffer. */
- void *pvBuf = RTMemAlloc(VDIDiskGetBufferSize(pVdi));
- if (pvBuf)
- {
- uint64_t off = 0;
- while (off < cbFile)
- {
- size_t cbRead = 0;
- rc = RTFileRead(File, pvBuf, VDIDiskGetBufferSize(pVdi), &cbRead);
- if (RT_FAILURE(rc) || !cbRead)
- break;
- rc = VDIDiskWrite(pVdi, off, pvBuf, cbRead);
- if (RT_FAILURE(rc))
- break;
- off += cbRead;
- }
-
- RTMemFree(pvBuf);
- }
- else
- rc = VERR_NO_MEMORY;
-
- VDIDiskCloseImage(pVdi);
- }
-
- if (RT_FAILURE(rc))
- {
- /* delete image on error */
- VDIDeleteImage(pszUtf8Filename);
- }
- PrintDone(rc);
- }
- }
- RTFileClose(File);
-
- return rc;
-}
-#endif
-
-#if 0
-static DECLCALLBACK(int) ProcessCallback(PVM pVM, unsigned uPercent, void *pvUser)
-{
- unsigned *pPercent = (unsigned *)pvUser;
-
- if (*pPercent != uPercent)
- {
- *pPercent = uPercent;
- RTPrintf(".");
- if ((uPercent % 10) == 0 && uPercent)
- RTPrintf("%d%%", uPercent);
- RTStrmFlush(g_pStdOut);
- }
-
- return VINF_SUCCESS;
-}
-#endif
-
-#if 0
-static int ConvertOldImage(const char *pszFilename)
-{
- RTPrintf("Converting VDI image file=\"%s\" to a new format...\n"
- "progress: 0%%",
- pszFilename);
-
- /* translate argv[] to UTF8 */
- char *pszUtf8Filename;
- int rc = FilenameToUtf8(&pszUtf8Filename, pszFilename);
- if (RT_FAILURE(rc))
- return rc;
-
- unsigned uPercent = 0;
- rc = VDIConvertImage(pszUtf8Filename, ProcessCallback, &uPercent);
- RTPrintf("\n");
- return PrintDone(rc);
-}
-#endif
-
-#if 0
-static int DumpImage(const char *pszFilename)
-{
- RTPrintf("Dumping VDI image file=\"%s\" into the log file...\n", pszFilename);
- PVDIDISK pVdi = VDIDiskCreate();
-
- /* translate argv[] to UTF8 */
- char *pszUtf8Filename;
- int rc = FilenameToUtf8(&pszUtf8Filename, pszFilename);
- if (RT_FAILURE(rc))
- return rc;
- rc = VDIDiskOpenImage(pVdi, pszUtf8Filename, VDI_OPEN_FLAGS_READONLY);
- if (RT_SUCCESS(rc))
- {
- VDIDiskDumpImages(pVdi);
- VDIDiskCloseAllImages(pVdi);
- }
- return PrintDone(rc);
-}
-#endif
-
-#if 0
-static int ResetImageGeometry(const char *pszFilename)
-{
- RTPrintf("Resetting geometry info of VDI image file=\"%s\"\n", pszFilename);
- PVDIDISK pVdi = VDIDiskCreate();
-
- /* translate argv[] to UTF8 */
- char *pszUtf8Filename;
- int rc = FilenameToUtf8(&pszUtf8Filename, pszFilename);
- if (RT_FAILURE(rc))
- return rc;
-
- rc = VDIDiskOpenImage(pVdi, pszUtf8Filename, VDI_OPEN_FLAGS_NORMAL);
- if (RT_SUCCESS(rc))
- {
- VDGEOMETRY LCHSGeometry = {0, 0, 0};
- rc = VDIDiskSetLCHSGeometry(pVdi, &LCHSGeometry);
- }
- VDIDiskCloseImage(pVdi);
- return PrintDone(rc);
-}
-#endif
-
-#if 0
-static int CopyImage(const char *pszDstFile, const char *pszSrcFile)
-{
- RTPrintf("Copying VDI image file=\"%s\" to image file=\"%s\"...\n"
- "progress: 0%%",
- pszSrcFile, pszDstFile);
-
- /* translate argv[] to UTF8 */
- char *pszUtf8SrcFile, *pszUtf8DstFile;
- int rc = FilenameToUtf8(&pszUtf8SrcFile, pszSrcFile);
- if (RT_FAILURE(rc))
- return rc;
- rc = FilenameToUtf8(&pszUtf8DstFile, pszDstFile);
- if (RT_FAILURE(rc))
- return rc;
-
- unsigned uPrecent = 0;
- rc = VDICopyImage(pszUtf8DstFile, pszUtf8SrcFile, NULL, ProcessCallback, &uPrecent);
- RTPrintf("\n");
- return PrintDone(rc);
-}
-#endif
-
-#if 0
-static int CopyToDD(const char *pszDstFile, const char *pszSrcFile)
-{
- RTPrintf("Copying VDI image file=\"%s\" to DD file=\"%s\"...\n",
- pszSrcFile, pszDstFile);
- PVDIDISK pVdi = VDIDiskCreate();
-
- /* translate argv[] to UTF8 */
- char *pszUtf8SrcFile, *pszUtf8DstFile;
- int rc = FilenameToUtf8(&pszUtf8SrcFile, pszSrcFile);
- if (RT_FAILURE(rc))
- return rc;
- rc = FilenameToUtf8(&pszUtf8DstFile, pszDstFile);
- if (RT_FAILURE(rc))
- return rc;
-
- rc = VDIDiskOpenImage(pVdi, pszUtf8SrcFile, VDI_OPEN_FLAGS_NORMAL);
- if (RT_SUCCESS(rc))
- {
- RTFILE FileDst;
- rc = RTFileOpen(&FileDst, pszUtf8DstFile, RTFILE_O_CREATE | RTFILE_O_READWRITE | RTFILE_O_DENY_WRITE);
- if (RT_SUCCESS(rc))
- {
- uint64_t cbSrc = VDIDiskGetSize(pVdi);
- const unsigned cbBuf = VDIDiskGetBlockSize(pVdi); /* or perhaps VDIDiskGetBufferSize(pVdi)? */
- void *pvBuf = RTMemAlloc(cbBuf);
- if (pvBuf)
- {
- uint64_t off = 0;
- while (off < cbSrc)
- {
- rc = VDIDiskRead(pVdi, off, pvBuf, cbBuf);
- if (RT_FAILURE(rc))
- break;
- rc = RTFileWrite(FileDst, pvBuf, cbBuf, NULL);
- if (RT_FAILURE(rc))
- break;
- off += cbBuf;
- }
- RTMemFree(pvBuf);
- }
- RTFileClose(FileDst);
- }
- }
- VDIDiskCloseImage(pVdi);
- return PrintDone(rc);
-}
-#endif
-
-#if 0
-static int ShrinkImage(const char *pszFilename)
-{
- RTPrintf("Shrinking VDI image file=\"%s\"...\n"
- "progress: 0%%",
- pszFilename);
-
- /* translate argv[] to UTF8 */
- char *pszUtf8Filename;
- int rc = FilenameToUtf8(&pszUtf8Filename, pszFilename);
- if (RT_FAILURE(rc))
- return rc;
-
- unsigned uPrecent;
- rc = VDIShrinkImage(pszUtf8Filename, ProcessCallback, &uPrecent);
- RTPrintf("\n");
- return PrintDone(rc);
-}
-#endif
-
-int main(int argc, char **argv)
-{
- putenv((char*)"VBOX_LOG_DEST=stdout");
- putenv((char*)"VBOX_LOG_FLAGS=");
-
- RTR3InitExe(argc, &argv, 0);
- RTPrintf("vditool -- for internal use only!\n"
- "Copyright (C) 2009-" VBOX_C_YEAR " " VBOX_VENDOR "\n\n");
-
- /*
- * Do cmd line parsing.
- */
- if (argc < 2)
- return UsageExit();
-
- char szCmd[16];
- if (strlen(argv[1]) >= sizeof(szCmd))
- return SyntaxError("Invalid command!");
- strcpy(szCmd, argv[1]);
- ascii2upper(szCmd);
-
- PRTLOGGER pLogger;
- static const char * const s_apszGroups[] = VBOX_LOGGROUP_NAMES;
- int rc = RTLogCreate(&pLogger, 0 /*fFlags*/, "all" /*pszGroupSettings*/,
- NULL /*pszEnvVarBase*/, RT_ELEMENTS(s_apszGroups), s_apszGroups, RTLOGDEST_STDOUT,
- NULL /*pszFilenameFmt*/);
- RTLogRelSetDefaultInstance(pLogger);
-
- if (strcmp(szCmd, "NEW") == 0)
- {
- if (argc != 4)
- return SyntaxError("Invalid argument count!");
-
- uint64_t cMBs;
- rc = RTStrToUInt64Ex(argv[3], NULL, 10, &cMBs);
- if (RT_FAILURE(rc))
- return SyntaxError("Invalid number!");
- if (cMBs < 2)
- {
- RTPrintf("error: Disk size %RU64MB must be at least 2MB!\n", cMBs);
- return 1;
- }
-
- rc = NewImage(argv[2], cMBs);
- }
-#if 0
- else if (strcmp(szCmd, "DD") == 0)
- {
- if (argc != 4)
- return SyntaxError("Invalid argument count!");
- rc = ConvertDDImage(argv[2], argv[3]);
- }
- else if (strcmp(szCmd, "CONVERT") == 0)
- {
- if (argc != 3)
- return SyntaxError("Invalid argument count!");
- rc = ConvertOldImage(argv[2]);
- }
- else if (strcmp(szCmd, "DUMP") == 0)
- {
- if (argc != 3)
- return SyntaxError("Invalid argument count!");
- rc = DumpImage(argv[2]);
- }
- else if (strcmp(szCmd, "RESETGEO") == 0)
- {
- if (argc != 3)
- return SyntaxError("Invalid argument count!");
- rc = ResetImageGeometry(argv[2]);
- }
- else if (strcmp(szCmd, "COPY") == 0)
- {
- if (argc != 4)
- return SyntaxError("Invalid argument count!");
- rc = CopyImage(argv[3], argv[2]);
- }
- else if (strcmp(szCmd, "COPYDD") == 0)
- {
- if (argc != 4)
- return SyntaxError("Invalid argument count!");
- rc = CopyToDD(argv[3], argv[2]);
- }
- else if (strcmp(szCmd, "SHRINK") == 0)
- {
- if (argc != 3)
- return SyntaxError("Invalid argument count!");
- rc = ShrinkImage(argv[2]);
- }
-#endif
- else
- return SyntaxError("Invalid command!");
-
- RTLogFlush(NULL);
- return !RT_SUCCESS(rc);
-}
diff --git a/src/VBox/VMM/Makefile.kmk b/src/VBox/VMM/Makefile.kmk
index 5458af8..e8e6d00 100644
--- a/src/VBox/VMM/Makefile.kmk
+++ b/src/VBox/VMM/Makefile.kmk
@@ -25,6 +25,16 @@ endif
include $(PATH_SUB_CURRENT)/testcase/Makefile.kmk
+# Fail on unsupported hosts.
+ifeq ($(KBUILD_TARGET_ARCH),x86)
+ ifeq ($(KBUILD_TARGET),darwin)
+ $(error 32-bit darwin is no longer a supported VirtualBox host. Go back to 4.3 or older for 32-bit support.)
+ else ifeq ($(KBUILD_TARGET),solaris)
+ $(error 32-bit solaris is no longer a supported VirtualBox host. Go back to 4.2 or older for 32-bit support.)
+ endif
+endif
+
+
#
# Globals
#
@@ -119,9 +129,6 @@ if "$(KBUILD_TYPE)" == "debug" && "$(USERNAME)" == "bird"
VBoxVMM_DEFS += RTMEM_WRAP_TO_EF_APIS
endif
VBoxVMM_DEFS.darwin = VMM_R0_SWITCH_STACK
-VBoxVMM_DEFS.darwin.x86 = \
- VBOX_WITH_2X_4GB_ADDR_SPACE VBOX_WITH_2X_4GB_ADDR_SPACE_IN_R3 \
- VBOX_WITH_HYBRID_32BIT_KERNEL VBOX_WITH_HYBRID_32BIT_KERNEL_IN_R3
VBoxVMM_INCS = \
include \
@@ -276,8 +283,6 @@ ifdef VBOX_WITH_RAW_MODE
VBoxVMM_SOURCES.amd64 = \
VMMSwitcher/AMD64To32Bit.asm \
VMMSwitcher/AMD64ToPAE.asm
- VBoxVMM_SOURCES.darwin.x86 += \
- VMMSwitcher/AMD64ToPAE.asm
endif
VBoxVMM_SOURCES.x86 += \
VMMSwitcher/32BitToAMD64.asm \
@@ -423,12 +428,6 @@ if defined(VBOX_WITH_RAW_MODE) && !defined(VBOX_ONLY_EXTPACKS)
ifdef VBOX_WITH_VMM_R0_SWITCH_STACK
VMMRC_DEFS += VMM_R0_SWITCH_STACK
endif
- ifeq ($(KBUILD_TARGET_ARCH),x86)
- VMMRC_DEFS.darwin = VMM_R0_SWITCH_STACK
- VMMRC_DEFS.darwin = \
- VBOX_WITH_2X_4GB_ADDR_SPACE VBOX_WITH_2X_4GB_ADDR_SPACE_IN_RC \
- VBOX_WITH_HYBRID_32BIT_KERNEL VBOX_WITH_HYBRID_32BIT_KERNEL_IN_RC
- endif
VMMRC_INCS := \
include \
@@ -550,9 +549,6 @@ ifndef VBOX_ONLY_EXTPACKS
VMMR0_DEFS += VMM_R0_SWITCH_STACK
endif
VMMR0_DEFS.darwin = VMM_R0_SWITCH_STACK
- VMMR0_DEFS.darwin.x86 = \
- VBOX_WITH_2X_4GB_ADDR_SPACE VBOX_WITH_2X_4GB_ADDR_SPACE_IN_R0 \
- VBOX_WITH_HYBRID_32BIT_KERNEL VBOX_WITH_HYBRID_32BIT_KERNEL_IN_R0
VMMR0_DEFS.win.amd64 = VBOX_WITH_KERNEL_USING_XMM
VMMR0_INCS = \
@@ -636,8 +632,6 @@ ifndef VBOX_ONLY_EXTPACKS
VMMR0/VMMR0JmpA-amd64.asm
VMMR0_SOURCES.x86 = \
VMMR0/VMMR0JmpA-x86.asm
- VMMR0_SOURCES.darwin.x86 = \
- VMMRZ/PGMRZDynMap.cpp
VMMR0_LIBS = \
$(PATH_STAGE_LIB)/ServicesR0$(VBOX_SUFF_LIB) \
diff --git a/src/VBox/VMM/VMMAll/CPUMAllMsrs.cpp b/src/VBox/VMM/VMMAll/CPUMAllMsrs.cpp
index 504492a..84c25c0 100644
--- a/src/VBox/VMM/VMMAll/CPUMAllMsrs.cpp
+++ b/src/VBox/VMM/VMMAll/CPUMAllMsrs.cpp
@@ -15,9 +15,10 @@
* hope that it will be useful, but WITHOUT ANY WARRANTY of any kind.
*/
-/*******************************************************************************
-* Header Files *
-*******************************************************************************/
+
+/*********************************************************************************************************************************
+* Header Files *
+*********************************************************************************************************************************/
#define LOG_GROUP LOG_GROUP_CPUM
#include <VBox/vmm/cpum.h>
#include <VBox/vmm/pdmapi.h>
@@ -29,9 +30,9 @@
#include <VBox/err.h>
-/*******************************************************************************
-* Defined Constants And Macros *
-*******************************************************************************/
+/*********************************************************************************************************************************
+* Defined Constants And Macros *
+*********************************************************************************************************************************/
/**
* Validates the CPUMMSRRANGE::offCpumCpu value and declares a local variable
* pointing to it.
@@ -48,9 +49,9 @@
a_Type *a_VarName = (a_Type *)((uintptr_t)&(a_pVCpu)->cpum.s + (a_pRange)->offCpumCpu)
-/*******************************************************************************
-* Structures and Typedefs *
-*******************************************************************************/
+/*********************************************************************************************************************************
+* Structures and Typedefs *
+*********************************************************************************************************************************/
/**
* Implements reading one or more MSRs.
diff --git a/src/VBox/VMM/VMMAll/CPUMAllRegs.cpp b/src/VBox/VMM/VMMAll/CPUMAllRegs.cpp
index 055dc52..badd7b8 100644
--- a/src/VBox/VMM/VMMAll/CPUMAllRegs.cpp
+++ b/src/VBox/VMM/VMMAll/CPUMAllRegs.cpp
@@ -16,9 +16,9 @@
*/
-/*******************************************************************************
-* Header Files *
-*******************************************************************************/
+/*********************************************************************************************************************************
+* Header Files *
+*********************************************************************************************************************************/
#define LOG_GROUP LOG_GROUP_CPUM
#include <VBox/vmm/cpum.h>
#include <VBox/vmm/patm.h>
@@ -53,9 +53,9 @@ AssertCompile2MemberOffsets(VM, cpum.s.HostFeatures, cpum.ro.HostFeatures);
AssertCompile2MemberOffsets(VM, cpum.s.GuestFeatures, cpum.ro.GuestFeatures);
-/*******************************************************************************
-* Defined Constants And Macros *
-*******************************************************************************/
+/*********************************************************************************************************************************
+* Defined Constants And Macros *
+*********************************************************************************************************************************/
/**
* Converts a CPUMCPU::Guest pointer into a VMCPU pointer.
*
@@ -324,23 +324,15 @@ VMMDECL(void) CPUMSetHyperLDTR(PVMCPU pVCpu, RTSEL SelLDTR)
*/
#ifdef IN_RING0
# if HC_ARCH_BITS == 32 && defined(VBOX_WITH_64_BITS_GUESTS)
-# ifndef VBOX_WITH_HYBRID_32BIT_KERNEL
-# define MAYBE_LOAD_DRx(a_pVCpu, a_fnLoad, a_uValue) \
+# define MAYBE_LOAD_DRx(a_pVCpu, a_fnLoad, a_uValue) \
do { \
if (!CPUMIsGuestInLongModeEx(&(a_pVCpu)->cpum.s.Guest)) \
a_fnLoad(a_uValue); \
else \
(a_pVCpu)->cpum.s.fUseFlags |= CPUM_SYNC_DEBUG_REGS_HYPER; \
} while (0)
-# else
-# define MAYBE_LOAD_DRx(a_pVCpu, a_fnLoad, a_uValue) \
- do { \
- /** @todo we're not loading the correct guest value here! */ \
- a_fnLoad(a_uValue); \
- } while (0)
-# endif
# else
-# define MAYBE_LOAD_DRx(a_pVCpu, a_fnLoad, a_uValue) \
+# define MAYBE_LOAD_DRx(a_pVCpu, a_fnLoad, a_uValue) \
do { \
a_fnLoad(a_uValue); \
} while (0)
diff --git a/src/VBox/VMM/VMMAll/CPUMStack.cpp b/src/VBox/VMM/VMMAll/CPUMStack.cpp
index 9c1cc17..c65a557 100644
--- a/src/VBox/VMM/VMMAll/CPUMStack.cpp
+++ b/src/VBox/VMM/VMMAll/CPUMStack.cpp
@@ -16,9 +16,9 @@
*/
-/*******************************************************************************
-* Header Files *
-*******************************************************************************/
+/*********************************************************************************************************************************
+* Header Files *
+*********************************************************************************************************************************/
#include <VBox/vmm/cpum.h>
#include "CPUMInternal.h"
#include <VBox/vmm/vm.h>
diff --git a/src/VBox/VMM/VMMAll/CSAMAll.cpp b/src/VBox/VMM/VMMAll/CSAMAll.cpp
index a0f7e87..6f4a3e7 100644
--- a/src/VBox/VMM/VMMAll/CSAMAll.cpp
+++ b/src/VBox/VMM/VMMAll/CSAMAll.cpp
@@ -16,9 +16,9 @@
*/
-/*******************************************************************************
-* Header Files *
-*******************************************************************************/
+/*********************************************************************************************************************************
+* Header Files *
+*********************************************************************************************************************************/
#define LOG_GROUP LOG_GROUP_CSAM
#include <VBox/vmm/cpum.h>
#include <VBox/vmm/stam.h>
diff --git a/src/VBox/VMM/VMMAll/DBGFAll.cpp b/src/VBox/VMM/VMMAll/DBGFAll.cpp
index d5a1fa1..e72b508 100644
--- a/src/VBox/VMM/VMMAll/DBGFAll.cpp
+++ b/src/VBox/VMM/VMMAll/DBGFAll.cpp
@@ -16,9 +16,9 @@
*/
-/*******************************************************************************
-* Header Files *
-*******************************************************************************/
+/*********************************************************************************************************************************
+* Header Files *
+*********************************************************************************************************************************/
#define LOG_GROUP LOG_GROUP_DBGF
#include <VBox/vmm/dbgf.h>
#include "DBGFInternal.h"
diff --git a/src/VBox/VMM/VMMAll/EMAll.cpp b/src/VBox/VMM/VMMAll/EMAll.cpp
index 0eff76b..6248a3f 100644
--- a/src/VBox/VMM/VMMAll/EMAll.cpp
+++ b/src/VBox/VMM/VMMAll/EMAll.cpp
@@ -15,9 +15,10 @@
* hope that it will be useful, but WITHOUT ANY WARRANTY of any kind.
*/
-/*******************************************************************************
-* Header Files *
-*******************************************************************************/
+
+/*********************************************************************************************************************************
+* Header Files *
+*********************************************************************************************************************************/
#define LOG_GROUP LOG_GROUP_EM
#include <VBox/vmm/em.h>
#include <VBox/vmm/mm.h>
@@ -60,9 +61,9 @@
#endif
-/*******************************************************************************
-* Defined Constants And Macros *
-*******************************************************************************/
+/*********************************************************************************************************************************
+* Defined Constants And Macros *
+*********************************************************************************************************************************/
/** @def EM_ASSERT_FAULT_RETURN
* Safety check.
*
@@ -79,18 +80,18 @@
#endif
-/*******************************************************************************
-* Internal Functions *
-*******************************************************************************/
+/*********************************************************************************************************************************
+* Internal Functions *
+*********************************************************************************************************************************/
#if !defined(VBOX_WITH_IEM) || defined(VBOX_COMPARE_IEM_AND_EM)
DECLINLINE(VBOXSTRICTRC) emInterpretInstructionCPUOuter(PVMCPU pVCpu, PDISCPUSTATE pDis, PCPUMCTXCORE pRegFrame,
RTGCPTR pvFault, EMCODETYPE enmCodeType, uint32_t *pcbSize);
#endif
-/*******************************************************************************
-* Global Variables *
-*******************************************************************************/
+/*********************************************************************************************************************************
+* Global Variables *
+*********************************************************************************************************************************/
#ifdef VBOX_COMPARE_IEM_AND_EM
static const uint32_t g_fInterestingFFs = VMCPU_FF_TO_R3
| VMCPU_FF_CSAM_PENDING_ACTION | VMCPU_FF_CSAM_SCAN_PAGE | VMCPU_FF_INHIBIT_INTERRUPTS
@@ -2381,7 +2382,7 @@ static int emInterpretLockOrXorAnd(PVM pVM, PVMCPU pVCpu, PDISCPUSTATE pDis, PCP
DISQPVPARAMVAL param1, param2;
NOREF(pvFault);
-#if HC_ARCH_BITS == 32 && !defined(VBOX_WITH_HYBRID_32BIT_KERNEL_IN_R0)
+#if HC_ARCH_BITS == 32
Assert(pDis->Param1.cb <= 4);
#endif
@@ -3013,7 +3014,7 @@ static int emInterpretCmpXchg(PVM pVM, PVMCPU pVCpu, PDISCPUSTATE pDis, PCPUMCTX
DISQPVPARAMVAL param1, param2;
NOREF(pvFault);
-#if HC_ARCH_BITS == 32 && !defined(VBOX_WITH_HYBRID_32BIT_KERNEL_IN_R0)
+#if HC_ARCH_BITS == 32
Assert(pDis->Param1.cb <= 4);
#endif
@@ -3727,16 +3728,6 @@ DECLINLINE(VBOXSTRICTRC) emInterpretInstructionCPU(PVM pVM, PVMCPU pVCpu, PDISCP
&& uOpCode != OP_BTS
&& uOpCode != OP_BTR
&& uOpCode != OP_BTC
-# ifdef VBOX_WITH_HYBRID_32BIT_KERNEL_IN_R0
- && uOpCode != OP_CMPXCHG /* solaris */
- && uOpCode != OP_AND /* windows */
- && uOpCode != OP_OR /* windows */
- && uOpCode != OP_XOR /* because we can */
- && uOpCode != OP_ADD /* windows (dripple) */
- && uOpCode != OP_ADC /* because we can */
- && uOpCode != OP_SUB /* because we can */
- /** @todo OP_BTS or is that a different kind of failure? */
-# endif
)
{
# ifdef VBOX_WITH_STATISTICS
diff --git a/src/VBox/VMM/VMMAll/EMAllA.asm b/src/VBox/VMM/VMMAll/EMAllA.asm
index 05744be..73fc7d8 100644
--- a/src/VBox/VMM/VMMAll/EMAllA.asm
+++ b/src/VBox/VMM/VMMAll/EMAllA.asm
@@ -43,19 +43,6 @@
%ifdef RT_ARCH_AMD64
%define CAN_DO_8_BYTE_OP 1
%endif
-%ifdef VBOX_WITH_HYBRID_32BIT_KERNEL_IN_R0
- %define CAN_DO_8_BYTE_OP 1
- %define MY_PTR_REG64 rcx
-%endif
-
-
-;*******************************************************************************
-;* External Symbols *
-;*******************************************************************************
-%ifdef VBOX_WITH_HYBRID_32BIT_KERNEL_IN_R0
-extern NAME(SUPR0Abs64bitKernelCS)
-extern NAME(SUPR0AbsKernelCS)
-%endif
BEGINCODE
@@ -187,22 +174,6 @@ BEGINPROC EMEmulateAnd
pushf
pop MY_RET_REG
retn
-
-%ifdef VBOX_WITH_HYBRID_32BIT_KERNEL_IN_R0
-.do_qword:
- db 0xea ; jmp far .sixtyfourbit_mode
- dd .sixtyfourbit_mode, NAME(SUPR0Abs64bitKernelCS)
-BITS 64
-.sixtyfourbit_mode:
- and esp, 0ffffffffh
- and MY_PTR_REG, 0ffffffffh
- mov rdx, qword [rsp + 08h] ; rdx = second parameter
- and [MY_PTR_REG64], rdx ; do 8 bytes AND
- jmp far [.fpret wrt rip]
-.fpret: ; 16:32 Pointer to .done.
- dd .done, NAME(SUPR0AbsKernelCS)
-BITS 32
-%endif ; VBOX_WITH_HYBRID_32BIT_KERNEL_IN_R0
ENDPROC EMEmulateAnd
@@ -276,22 +247,6 @@ BEGINPROC EMEmulateLockAnd
%endif
mov eax, VINF_SUCCESS
retn
-
-%ifdef VBOX_WITH_HYBRID_32BIT_KERNEL_IN_R0
-.do_qword:
- db 0xea ; jmp far .sixtyfourbit_mode
- dd .sixtyfourbit_mode, NAME(SUPR0Abs64bitKernelCS)
-BITS 64
-.sixtyfourbit_mode:
- and esp, 0ffffffffh
- and MY_PTR_REG, 0ffffffffh
- mov rdx, qword [rsp + 08h] ; rdx = second parameter
- lock and [MY_PTR_REG64], rdx ; do 8 bytes OR
- jmp far [.fpret wrt rip]
-.fpret: ; 16:32 Pointer to .done.
- dd .done, NAME(SUPR0AbsKernelCS)
-BITS 32
-%endif ; VBOX_WITH_HYBRID_32BIT_KERNEL_IN_R0
ENDPROC EMEmulateLockAnd
;;
@@ -356,22 +311,6 @@ BEGINPROC EMEmulateOr
pushf
pop MY_RET_REG
retn
-
-%ifdef VBOX_WITH_HYBRID_32BIT_KERNEL_IN_R0
-.do_qword:
- db 0xea ; jmp far .sixtyfourbit_mode
- dd .sixtyfourbit_mode, NAME(SUPR0Abs64bitKernelCS)
-BITS 64
-.sixtyfourbit_mode:
- and esp, 0ffffffffh
- and MY_PTR_REG, 0ffffffffh
- mov rdx, qword [rsp + 08h] ; rdx = second parameter
- or [MY_PTR_REG64], rdx ; do 8 bytes OR
- jmp far [.fpret wrt rip]
-.fpret: ; 16:32 Pointer to .done.
- dd .done, NAME(SUPR0AbsKernelCS)
-BITS 32
-%endif ; VBOX_WITH_HYBRID_32BIT_KERNEL_IN_R0
ENDPROC EMEmulateOr
@@ -445,22 +384,6 @@ BEGINPROC EMEmulateLockOr
%endif
mov eax, VINF_SUCCESS
retn
-
-%ifdef VBOX_WITH_HYBRID_32BIT_KERNEL_IN_R0
-.do_qword:
- db 0xea ; jmp far .sixtyfourbit_mode
- dd .sixtyfourbit_mode, NAME(SUPR0Abs64bitKernelCS)
-BITS 64
-.sixtyfourbit_mode:
- and esp, 0ffffffffh
- and MY_PTR_REG, 0ffffffffh
- mov rdx, qword [rsp + 08h] ; rdx = second parameter
- lock or [MY_PTR_REG64], rdx ; do 8 bytes OR
- jmp far [.fpret wrt rip]
-.fpret: ; 16:32 Pointer to .done.
- dd .done, NAME(SUPR0AbsKernelCS)
-BITS 32
-%endif ; VBOX_WITH_HYBRID_32BIT_KERNEL_IN_R0
ENDPROC EMEmulateLockOr
@@ -526,22 +449,6 @@ BEGINPROC EMEmulateXor
pushf
pop MY_RET_REG
retn
-
-%ifdef VBOX_WITH_HYBRID_32BIT_KERNEL_IN_R0
-.do_qword:
- db 0xea ; jmp far .sixtyfourbit_mode
- dd .sixtyfourbit_mode, NAME(SUPR0Abs64bitKernelCS)
-BITS 64
-.sixtyfourbit_mode:
- and esp, 0ffffffffh
- and MY_PTR_REG, 0ffffffffh
- mov rdx, qword [rsp + 08h] ; rdx = second parameter
- xor [MY_PTR_REG64], rdx ; do 8 bytes XOR
- jmp far [.fpret wrt rip]
-.fpret: ; 16:32 Pointer to .done.
- dd .done, NAME(SUPR0AbsKernelCS)
-BITS 32
-%endif ; VBOX_WITH_HYBRID_32BIT_KERNEL_IN_R0
ENDPROC EMEmulateXor
;;
@@ -614,22 +521,6 @@ BEGINPROC EMEmulateLockXor
%endif
mov eax, VINF_SUCCESS
retn
-
-%ifdef VBOX_WITH_HYBRID_32BIT_KERNEL_IN_R0
-.do_qword:
- db 0xea ; jmp far .sixtyfourbit_mode
- dd .sixtyfourbit_mode, NAME(SUPR0Abs64bitKernelCS)
-BITS 64
-.sixtyfourbit_mode:
- and esp, 0ffffffffh
- and MY_PTR_REG, 0ffffffffh
- mov rdx, qword [rsp + 08h] ; rdx = second parameter
- lock xor [MY_PTR_REG64], rdx ; do 8 bytes OR
- jmp far [.fpret wrt rip]
-.fpret: ; 16:32 Pointer to .done.
- dd .done, NAME(SUPR0AbsKernelCS)
-BITS 32
-%endif ; VBOX_WITH_HYBRID_32BIT_KERNEL_IN_R0
ENDPROC EMEmulateLockXor
;;
@@ -820,22 +711,6 @@ BEGINPROC EMEmulateAdd
pushf
pop MY_RET_REG
retn
-
-%ifdef VBOX_WITH_HYBRID_32BIT_KERNEL_IN_R0
-.do_qword:
- db 0xea ; jmp far .sixtyfourbit_mode
- dd .sixtyfourbit_mode, NAME(SUPR0Abs64bitKernelCS)
-BITS 64
-.sixtyfourbit_mode:
- and esp, 0ffffffffh
- and MY_PTR_REG, 0ffffffffh
- mov rdx, qword [rsp + 08h] ; rdx = second parameter
- add [MY_PTR_REG64], rdx ; do 8 bytes ADD
- jmp far [.fpret wrt rip]
-.fpret: ; 16:32 Pointer to .done.
- dd .done, NAME(SUPR0AbsKernelCS)
-BITS 32
-%endif ; VBOX_WITH_HYBRID_32BIT_KERNEL_IN_R0
ENDPROC EMEmulateAdd
@@ -905,23 +780,6 @@ BEGINPROC EMEmulateAdcWithCarrySet
pushf
pop MY_RET_REG
retn
-
-%ifdef VBOX_WITH_HYBRID_32BIT_KERNEL_IN_R0
-.do_qword:
- db 0xea ; jmp far .sixtyfourbit_mode
- dd .sixtyfourbit_mode, NAME(SUPR0Abs64bitKernelCS)
-BITS 64
-.sixtyfourbit_mode:
- and esp, 0ffffffffh
- and MY_PTR_REG, 0ffffffffh
- mov rdx, qword [rsp + 08h] ; rdx = second parameter
- stc ; set carry flag
- adc [MY_PTR_REG64], rdx ; do 8 bytes ADC
- jmp far [.fpret wrt rip]
-.fpret: ; 16:32 Pointer to .done.
- dd .done, NAME(SUPR0AbsKernelCS)
-BITS 32
-%endif ; VBOX_WITH_HYBRID_32BIT_KERNEL_IN_R0
ENDPROC EMEmulateAdcWithCarrySet
@@ -987,22 +845,6 @@ BEGINPROC EMEmulateSub
pushf
pop MY_RET_REG
retn
-
-%ifdef VBOX_WITH_HYBRID_32BIT_KERNEL_IN_R0
-.do_qword:
- db 0xea ; jmp far .sixtyfourbit_mode
- dd .sixtyfourbit_mode, NAME(SUPR0Abs64bitKernelCS)
-BITS 64
-.sixtyfourbit_mode:
- and esp, 0ffffffffh
- and MY_PTR_REG, 0ffffffffh
- mov rdx, qword [rsp + 08h] ; rdx = second parameter
- sub [MY_PTR_REG64], rdx ; do 8 bytes SUB
- jmp far [.fpret wrt rip]
-.fpret: ; 16:32 Pointer to .done.
- dd .done, NAME(SUPR0AbsKernelCS)
-BITS 32
-%endif ; VBOX_WITH_HYBRID_32BIT_KERNEL_IN_R0
ENDPROC EMEmulateSub
@@ -1219,26 +1061,6 @@ BEGINPROC EMEmulateLockCmpXchg
pop xBX
retn
-
-%ifdef VBOX_WITH_HYBRID_32BIT_KERNEL_IN_R0
-.do_qword:
- db 0xea ; jmp far .sixtyfourbit_mode
- dd .sixtyfourbit_mode, NAME(SUPR0Abs64bitKernelCS)
-BITS 64
-.sixtyfourbit_mode:
- and ebx, 0ffffffffh
- and esp, 0ffffffffh
- and ecx, 0ffffffffh
- mov rax, qword [rbx] ; load 2nd parameter's value
- mov rdx, qword [rsp + 0ch + 4] ; rdx = third parameter
-
- lock cmpxchg qword [rcx], rdx ; do 8 byte CMPXCHG
- mov qword [rbx], rax
- jmp far [.fpret wrt rip]
-.fpret: ; 16:32 Pointer to .done.
- dd .done, NAME(SUPR0AbsKernelCS)
-BITS 32
-%endif ; VBOX_WITH_HYBRID_32BIT_KERNEL_IN_R0
ENDPROC EMEmulateLockCmpXchg
@@ -1327,26 +1149,6 @@ BEGINPROC EMEmulateCmpXchg
pop xBX
retn
-
-%ifdef VBOX_WITH_HYBRID_32BIT_KERNEL_IN_R0
-.do_qword:
- db 0xea ; jmp far .sixtyfourbit_mode
- dd .sixtyfourbit_mode, NAME(SUPR0Abs64bitKernelCS)
-BITS 64
-.sixtyfourbit_mode:
- and ebx, 0ffffffffh
- and esp, 0ffffffffh
- and ecx, 0ffffffffh
- mov rax, qword [rbx] ; load 2nd parameter's value
- mov rdx, qword [rsp + 0ch + 4] ; rdx = third parameter
-
- cmpxchg qword [rcx], rdx ; do 8 byte CMPXCHG
- mov qword [rbx], rax
- jmp far [.fpret wrt rip]
-.fpret: ; 16:32 Pointer to .done.
- dd .done, NAME(SUPR0AbsKernelCS)
-BITS 32
-%endif ; VBOX_WITH_HYBRID_32BIT_KERNEL_IN_R0
ENDPROC EMEmulateCmpXchg
@@ -1564,23 +1366,6 @@ BEGINPROC EMEmulateLockXAdd
pop MY_RET_REG
retn
-
-%ifdef VBOX_WITH_HYBRID_32BIT_KERNEL_IN_R0
-.do_qword:
- db 0xea ; jmp far .sixtyfourbit_mode
- dd .sixtyfourbit_mode, NAME(SUPR0Abs64bitKernelCS)
-BITS 64
-.sixtyfourbit_mode:
- and esp, 0ffffffffh
- and edx, 0ffffffffh
- and MY_PTR_REG, 0ffffffffh
- mov rax, qword [rdx] ; load 2nd parameter's value
- and [MY_PTR_REG64], rax ; do 8 bytes XADD
- jmp far [.fpret wrt rip]
-.fpret: ; 16:32 Pointer to .done.
- dd .done, NAME(SUPR0AbsKernelCS)
-BITS 32
-%endif ; VBOX_WITH_HYBRID_32BIT_KERNEL_IN_R0
ENDPROC EMEmulateLockXAdd
@@ -1653,22 +1438,5 @@ BEGINPROC EMEmulateXAdd
pop MY_RET_REG
retn
-
-%ifdef VBOX_WITH_HYBRID_32BIT_KERNEL_IN_R0
-.do_qword:
- db 0xea ; jmp far .sixtyfourbit_mode
- dd .sixtyfourbit_mode, NAME(SUPR0Abs64bitKernelCS)
-BITS 64
-.sixtyfourbit_mode:
- and esp, 0ffffffffh
- and edx, 0ffffffffh
- and MY_PTR_REG, 0ffffffffh
- mov rax, qword [rdx] ; load 2nd parameter's value
- and [MY_PTR_REG64], rax ; do 8 bytes XADD
- jmp far [.fpret wrt rip]
-.fpret: ; 16:32 Pointer to .done.
- dd .done, NAME(SUPR0AbsKernelCS)
-BITS 32
-%endif ; VBOX_WITH_HYBRID_32BIT_KERNEL_IN_R0
ENDPROC EMEmulateXAdd
diff --git a/src/VBox/VMM/VMMAll/FTMAll.cpp b/src/VBox/VMM/VMMAll/FTMAll.cpp
index a286434..ae3e260 100644
--- a/src/VBox/VMM/VMMAll/FTMAll.cpp
+++ b/src/VBox/VMM/VMMAll/FTMAll.cpp
@@ -16,9 +16,9 @@
*/
-/*******************************************************************************
-* Header Files *
-*******************************************************************************/
+/*********************************************************************************************************************************
+* Header Files *
+*********************************************************************************************************************************/
#define LOG_GROUP LOG_GROUP_FTM
#include "FTMInternal.h"
#include <VBox/vmm/vm.h>
diff --git a/src/VBox/VMM/VMMAll/GIMAll.cpp b/src/VBox/VMM/VMMAll/GIMAll.cpp
index b96fd97..4184d7a 100644
--- a/src/VBox/VMM/VMMAll/GIMAll.cpp
+++ b/src/VBox/VMM/VMMAll/GIMAll.cpp
@@ -16,9 +16,9 @@
*/
-/*******************************************************************************
-* Header Files *
-*******************************************************************************/
+/*********************************************************************************************************************************
+* Header Files *
+*********************************************************************************************************************************/
#define LOG_GROUP LOG_GROUP_GIM
#include "GIMInternal.h"
#include <VBox/err.h>
diff --git a/src/VBox/VMM/VMMAll/GIMAllHv.cpp b/src/VBox/VMM/VMMAll/GIMAllHv.cpp
index 8e8f345..a987d0c 100644
--- a/src/VBox/VMM/VMMAll/GIMAllHv.cpp
+++ b/src/VBox/VMM/VMMAll/GIMAllHv.cpp
@@ -15,9 +15,10 @@
* hope that it will be useful, but WITHOUT ANY WARRANTY of any kind.
*/
-/*******************************************************************************
-* Header Files *
-*******************************************************************************/
+
+/*********************************************************************************************************************************
+* Header Files *
+*********************************************************************************************************************************/
#define LOG_GROUP LOG_GROUP_GIM
#include "GIMHvInternal.h"
#include "GIMInternal.h"
diff --git a/src/VBox/VMM/VMMAll/GIMAllKvm.cpp b/src/VBox/VMM/VMMAll/GIMAllKvm.cpp
index bef6665..0f07374 100644
--- a/src/VBox/VMM/VMMAll/GIMAllKvm.cpp
+++ b/src/VBox/VMM/VMMAll/GIMAllKvm.cpp
@@ -15,9 +15,10 @@
* hope that it will be useful, but WITHOUT ANY WARRANTY of any kind.
*/
-/*******************************************************************************
-* Header Files *
-*******************************************************************************/
+
+/*********************************************************************************************************************************
+* Header Files *
+*********************************************************************************************************************************/
#define LOG_GROUP LOG_GROUP_GIM
#include "GIMKvmInternal.h"
#include "GIMInternal.h"
@@ -133,8 +134,8 @@ VMM_INT_DECL(int) gimKvmHypercall(PVMCPU pVCpu, PCPUMCTX pCtx)
*/
VMM_INT_DECL(bool) gimKvmAreHypercallsEnabled(PVMCPU pVCpu)
{
- /* KVM paravirt interface doesn't have hypercall control bits like Hyper-V does
- that guests can control. It's always enabled. */
+ /* KVM paravirt interface doesn't have hypercall control bits (like Hyper-V does)
+ that guests can control, i.e. hypercalls are always enabled. */
return true;
}
diff --git a/src/VBox/VMM/VMMAll/HMAll.cpp b/src/VBox/VMM/VMMAll/HMAll.cpp
index 965c2ab..c8506ef 100644
--- a/src/VBox/VMM/VMMAll/HMAll.cpp
+++ b/src/VBox/VMM/VMMAll/HMAll.cpp
@@ -16,9 +16,9 @@
*/
-/*******************************************************************************
-* Header Files *
-*******************************************************************************/
+/*********************************************************************************************************************************
+* Header Files *
+*********************************************************************************************************************************/
#define LOG_GROUP LOG_GROUP_HM
#include <VBox/vmm/hm.h>
#include <VBox/vmm/pgm.h>
@@ -65,16 +65,8 @@ static void hmQueueInvlPage(PVMCPU pVCpu, RTGCPTR GCVirt)
/* Nothing to do if a TLB flush is already pending */
if (VMCPU_FF_IS_SET(pVCpu, VMCPU_FF_TLB_FLUSH))
return;
-#if 1
VMCPU_FF_SET(pVCpu, VMCPU_FF_TLB_FLUSH);
NOREF(GCVirt);
-#else
- /* Be very careful when activating this code! */
- if (iPage == RT_ELEMENTS(pVCpu->hm.s.TlbShootdown.aPages))
- VMCPU_FF_SET(pVCpu, VMCPU_FF_TLB_FLUSH);
- else
- VMCPU_FF_SET(pVCpu, VMCPU_FF_TLB_SHOOTDOWN);
-#endif
}
diff --git a/src/VBox/VMM/VMMAll/IEMAll.cpp b/src/VBox/VMM/VMMAll/IEMAll.cpp
index f88f72b..9493186 100644
--- a/src/VBox/VMM/VMMAll/IEMAll.cpp
+++ b/src/VBox/VMM/VMMAll/IEMAll.cpp
@@ -77,9 +77,10 @@
//#define IEM_LOG_MEMORY_WRITES
#define IEM_IMPLEMENTS_TASKSWITCH
-/*******************************************************************************
-* Header Files *
-*******************************************************************************/
+
+/*********************************************************************************************************************************
+* Header Files *
+*********************************************************************************************************************************/
#define LOG_GROUP LOG_GROUP_IEM
#include <VBox/vmm/iem.h>
#include <VBox/vmm/cpum.h>
@@ -115,9 +116,9 @@
-/*******************************************************************************
-* Structures and Typedefs *
-*******************************************************************************/
+/*********************************************************************************************************************************
+* Structures and Typedefs *
+*********************************************************************************************************************************/
/** @typedef PFNIEMOP
* Pointer to an opcode decoder function.
*/
@@ -144,11 +145,11 @@ typedef VBOXSTRICTRC (__attribute__((__fastcall__)) * PFNIEMOP)(PIEMCPU pIemCpu)
#elif defined(_MSC_VER) && defined(RT_ARCH_X86)
typedef VBOXSTRICTRC (__fastcall * PFNIEMOP)(PIEMCPU pIemCpu);
# define FNIEMOP_DEF(a_Name) \
- IEM_STATIC /*__declspec(naked)*/ VBOXSTRICTRC __fastcall a_Name(PIEMCPU pIemCpu) RT_NO_THROW
+ IEM_STATIC /*__declspec(naked)*/ VBOXSTRICTRC __fastcall a_Name(PIEMCPU pIemCpu) RT_NO_THROW_DEF
# define FNIEMOP_DEF_1(a_Name, a_Type0, a_Name0) \
- IEM_STATIC /*__declspec(naked)*/ VBOXSTRICTRC __fastcall a_Name(PIEMCPU pIemCpu, a_Type0 a_Name0) RT_NO_THROW
+ IEM_STATIC /*__declspec(naked)*/ VBOXSTRICTRC __fastcall a_Name(PIEMCPU pIemCpu, a_Type0 a_Name0) RT_NO_THROW_DEF
# define FNIEMOP_DEF_2(a_Name, a_Type0, a_Name0, a_Type1, a_Name1) \
- IEM_STATIC /*__declspec(naked)*/ VBOXSTRICTRC __fastcall a_Name(PIEMCPU pIemCpu, a_Type0 a_Name0, a_Type1 a_Name1) RT_NO_THROW
+ IEM_STATIC /*__declspec(naked)*/ VBOXSTRICTRC __fastcall a_Name(PIEMCPU pIemCpu, a_Type0 a_Name0, a_Type1 a_Name1) RT_NO_THROW_DEF
#elif defined(__GNUC__)
typedef VBOXSTRICTRC (* PFNIEMOP)(PIEMCPU pIemCpu);
@@ -162,11 +163,11 @@ typedef VBOXSTRICTRC (* PFNIEMOP)(PIEMCPU pIemCpu);
#else
typedef VBOXSTRICTRC (* PFNIEMOP)(PIEMCPU pIemCpu);
# define FNIEMOP_DEF(a_Name) \
- IEM_STATIC VBOXSTRICTRC a_Name(PIEMCPU pIemCpu) RT_NO_THROW
+ IEM_STATIC VBOXSTRICTRC a_Name(PIEMCPU pIemCpu) RT_NO_THROW_DEF
# define FNIEMOP_DEF_1(a_Name, a_Type0, a_Name0) \
- IEM_STATIC VBOXSTRICTRC a_Name(PIEMCPU pIemCpu, a_Type0 a_Name0) RT_NO_THROW
+ IEM_STATIC VBOXSTRICTRC a_Name(PIEMCPU pIemCpu, a_Type0 a_Name0) RT_NO_THROW_DEF
# define FNIEMOP_DEF_2(a_Name, a_Type0, a_Name0, a_Type1, a_Name1) \
- IEM_STATIC VBOXSTRICTRC a_Name(PIEMCPU pIemCpu, a_Type0 a_Name0, a_Type1 a_Name1) RT_NO_THROW
+ IEM_STATIC VBOXSTRICTRC a_Name(PIEMCPU pIemCpu, a_Type0 a_Name0, a_Type1 a_Name1) RT_NO_THROW_DEF
#endif
@@ -185,9 +186,9 @@ typedef union IEMSELDESC
typedef IEMSELDESC *PIEMSELDESC;
-/*******************************************************************************
-* Defined Constants And Macros *
-*******************************************************************************/
+/*********************************************************************************************************************************
+* Defined Constants And Macros *
+*********************************************************************************************************************************/
/** Temporary hack to disable the double execution. Will be removed in favor
* of a dedicated execution mode in EM. */
//#define IEM_VERIFICATION_MODE_NO_REM
@@ -315,9 +316,9 @@ typedef IEMSELDESC *PIEMSELDESC;
#define IEM_IS_CANONICAL(a_u64Addr) X86_IS_CANONICAL(a_u64Addr)
-/*******************************************************************************
-* Global Variables *
-*******************************************************************************/
+/*********************************************************************************************************************************
+* Global Variables *
+*********************************************************************************************************************************/
extern const PFNIEMOP g_apfnOneByteMap[256]; /* not static since we need to forward declare it. */
@@ -672,9 +673,9 @@ size_t g_cbIemWrote;
#endif
-/*******************************************************************************
-* Internal Functions *
-*******************************************************************************/
+/*********************************************************************************************************************************
+* Internal Functions *
+*********************************************************************************************************************************/
IEM_STATIC VBOXSTRICTRC iemRaiseTaskSwitchFaultWithErr(PIEMCPU pIemCpu, uint16_t uErr);
IEM_STATIC VBOXSTRICTRC iemRaiseTaskSwitchFaultCurrentTSS(PIEMCPU pIemCpu);
IEM_STATIC VBOXSTRICTRC iemRaiseTaskSwitchFault0(PIEMCPU pIemCpu);
diff --git a/src/VBox/VMM/VMMAll/IEMAllAImplC.cpp b/src/VBox/VMM/VMMAll/IEMAllAImplC.cpp
index 3374cfb..3114a42 100644
--- a/src/VBox/VMM/VMMAll/IEMAllAImplC.cpp
+++ b/src/VBox/VMM/VMMAll/IEMAllAImplC.cpp
@@ -15,17 +15,18 @@
* hope that it will be useful, but WITHOUT ANY WARRANTY of any kind.
*/
-/*******************************************************************************
-* Header Files *
-*******************************************************************************/
+
+/*********************************************************************************************************************************
+* Header Files *
+*********************************************************************************************************************************/
#include "IEMInternal.h"
#include <VBox/vmm/vm.h>
#include <iprt/x86.h>
-/*******************************************************************************
-* Global Variables *
-*******************************************************************************/
+/*********************************************************************************************************************************
+* Global Variables *
+*********************************************************************************************************************************/
/**
* Parity calculation table.
*
diff --git a/src/VBox/VMM/VMMAll/IOMAll.cpp b/src/VBox/VMM/VMMAll/IOMAll.cpp
index 59129fe..056434d 100644
--- a/src/VBox/VMM/VMMAll/IOMAll.cpp
+++ b/src/VBox/VMM/VMMAll/IOMAll.cpp
@@ -15,9 +15,10 @@
* hope that it will be useful, but WITHOUT ANY WARRANTY of any kind.
*/
-/*******************************************************************************
-* Header Files *
-*******************************************************************************/
+
+/*********************************************************************************************************************************
+* Header Files *
+*********************************************************************************************************************************/
#define LOG_GROUP LOG_GROUP_IOM
#include <VBox/vmm/iom.h>
#include <VBox/vmm/mm.h>
diff --git a/src/VBox/VMM/VMMAll/IOMAllMMIO.cpp b/src/VBox/VMM/VMMAll/IOMAllMMIO.cpp
index 6a45b9d..e4d45ec 100644
--- a/src/VBox/VMM/VMMAll/IOMAllMMIO.cpp
+++ b/src/VBox/VMM/VMMAll/IOMAllMMIO.cpp
@@ -16,9 +16,9 @@
*/
-/*******************************************************************************
-* Header Files *
-*******************************************************************************/
+/*********************************************************************************************************************************
+* Header Files *
+*********************************************************************************************************************************/
#define LOG_GROUP LOG_GROUP_IOM
#include <VBox/vmm/iom.h>
#include <VBox/vmm/cpum.h>
@@ -45,9 +45,10 @@
#include <iprt/asm.h>
#include <iprt/string.h>
-/*******************************************************************************
-* Defined Constants And Macros *
-*******************************************************************************/
+
+/*********************************************************************************************************************************
+* Defined Constants And Macros *
+*********************************************************************************************************************************/
/** @def IEM_USE_IEM_INSTEAD
* Use IEM instead of IOM for interpreting MMIO accesses.
* Because of PATM/CSAM issues in raw-mode, we've split this up into 2nd and 3rd
@@ -58,9 +59,9 @@
#endif
-/*******************************************************************************
-* Global Variables *
-*******************************************************************************/
+/*********************************************************************************************************************************
+* Global Variables *
+*********************************************************************************************************************************/
/**
* Array for fast recode of the operand size (1/2/4/8 bytes) to bit shift value.
diff --git a/src/VBox/VMM/VMMAll/MMAll.cpp b/src/VBox/VMM/VMMAll/MMAll.cpp
index 842078c..402fd6c 100644
--- a/src/VBox/VMM/VMMAll/MMAll.cpp
+++ b/src/VBox/VMM/VMMAll/MMAll.cpp
@@ -16,9 +16,9 @@
*/
-/*******************************************************************************
-* Header Files *
-*******************************************************************************/
+/*********************************************************************************************************************************
+* Header Files *
+*********************************************************************************************************************************/
#define LOG_GROUP LOG_GROUP_MM_HYPER
#include <VBox/vmm/mm.h>
#include <VBox/vmm/vmm.h>
diff --git a/src/VBox/VMM/VMMAll/MMAllHyper.cpp b/src/VBox/VMM/VMMAll/MMAllHyper.cpp
index 1ae88e7..1673f7c 100644
--- a/src/VBox/VMM/VMMAll/MMAllHyper.cpp
+++ b/src/VBox/VMM/VMMAll/MMAllHyper.cpp
@@ -16,9 +16,9 @@
*/
-/*******************************************************************************
-* Header Files *
-*******************************************************************************/
+/*********************************************************************************************************************************
+* Header Files *
+*********************************************************************************************************************************/
#define LOG_GROUP LOG_GROUP_MM_HYPER_HEAP
#include <VBox/vmm/mm.h>
#include <VBox/vmm/stam.h>
@@ -33,9 +33,9 @@
#include <iprt/string.h>
-/*******************************************************************************
-* Defined Constants And Macros *
-*******************************************************************************/
+/*********************************************************************************************************************************
+* Defined Constants And Macros *
+*********************************************************************************************************************************/
#define ASSERT_L(u1, u2) AssertMsg((u1) < (u2), ("u1=%#x u2=%#x\n", u1, u2))
#define ASSERT_LE(u1, u2) AssertMsg((u1) <= (u2), ("u1=%#x u2=%#x\n", u1, u2))
#define ASSERT_GE(u1, u2) AssertMsg((u1) >= (u2), ("u1=%#x u2=%#x\n", u1, u2))
@@ -131,9 +131,9 @@
} while (0)
-/*******************************************************************************
-* Internal Functions *
-*******************************************************************************/
+/*********************************************************************************************************************************
+* Internal Functions *
+*********************************************************************************************************************************/
static PMMHYPERCHUNK mmHyperAllocChunk(PMMHYPERHEAP pHeap, uint32_t cb, unsigned uAlignment);
static void *mmHyperAllocPages(PMMHYPERHEAP pHeap, uint32_t cb);
#ifdef VBOX_WITH_STATISTICS
diff --git a/src/VBox/VMM/VMMAll/MMAllPagePool.cpp b/src/VBox/VMM/VMMAll/MMAllPagePool.cpp
index 060d825..b8a28ab 100644
--- a/src/VBox/VMM/VMMAll/MMAllPagePool.cpp
+++ b/src/VBox/VMM/VMMAll/MMAllPagePool.cpp
@@ -17,9 +17,10 @@
* hope that it will be useful, but WITHOUT ANY WARRANTY of any kind.
*/
-/*******************************************************************************
-* Header Files *
-*******************************************************************************/
+
+/*********************************************************************************************************************************
+* Header Files *
+*********************************************************************************************************************************/
#define LOG_GROUP LOG_GROUP_MM_POOL
#include <VBox/vmm/mm.h>
#include <VBox/vmm/pgm.h>
diff --git a/src/VBox/VMM/VMMAll/PATMAll.cpp b/src/VBox/VMM/VMMAll/PATMAll.cpp
index 8bdd9a7..bf5b997 100644
--- a/src/VBox/VMM/VMMAll/PATMAll.cpp
+++ b/src/VBox/VMM/VMMAll/PATMAll.cpp
@@ -15,9 +15,10 @@
* hope that it will be useful, but WITHOUT ANY WARRANTY of any kind.
*/
-/*******************************************************************************
-* Header Files *
-*******************************************************************************/
+
+/*********************************************************************************************************************************
+* Header Files *
+*********************************************************************************************************************************/
#define LOG_GROUP LOG_GROUP_PATM
#include <VBox/vmm/patm.h>
#include <VBox/vmm/cpum.h>
diff --git a/src/VBox/VMM/VMMAll/PDMAll.cpp b/src/VBox/VMM/VMMAll/PDMAll.cpp
index ba30894..84006a0 100644
--- a/src/VBox/VMM/VMMAll/PDMAll.cpp
+++ b/src/VBox/VMM/VMMAll/PDMAll.cpp
@@ -16,9 +16,9 @@
*/
-/*******************************************************************************
-* Header Files *
-*******************************************************************************/
+/*********************************************************************************************************************************
+* Header Files *
+*********************************************************************************************************************************/
#define LOG_GROUP LOG_GROUP_PDM
#include "PDMInternal.h"
#include <VBox/vmm/pdm.h>
diff --git a/src/VBox/VMM/VMMAll/PDMAllCritSect.cpp b/src/VBox/VMM/VMMAll/PDMAllCritSect.cpp
index 5e7782f..ce9e8c4 100644
--- a/src/VBox/VMM/VMMAll/PDMAllCritSect.cpp
+++ b/src/VBox/VMM/VMMAll/PDMAllCritSect.cpp
@@ -16,9 +16,9 @@
*/
-/*******************************************************************************
-* Header Files *
-*******************************************************************************/
+/*********************************************************************************************************************************
+* Header Files *
+*********************************************************************************************************************************/
#define LOG_GROUP LOG_GROUP_PDM//_CRITSECT
#include "PDMInternal.h"
#include <VBox/vmm/pdmcritsect.h>
@@ -41,9 +41,9 @@
#endif
-/*******************************************************************************
-* Defined Constants And Macros *
-*******************************************************************************/
+/*********************************************************************************************************************************
+* Defined Constants And Macros *
+*********************************************************************************************************************************/
/** The number loops to spin for in ring-3. */
#define PDMCRITSECT_SPIN_COUNT_R3 20
/** The number loops to spin for in ring-0. */
diff --git a/src/VBox/VMM/VMMAll/PDMAllCritSectBoth.cpp b/src/VBox/VMM/VMMAll/PDMAllCritSectBoth.cpp
index 32561b4..2e0ec84 100644
--- a/src/VBox/VMM/VMMAll/PDMAllCritSectBoth.cpp
+++ b/src/VBox/VMM/VMMAll/PDMAllCritSectBoth.cpp
@@ -16,9 +16,9 @@
*/
-/*******************************************************************************
-* Header Files *
-*******************************************************************************/
+/*********************************************************************************************************************************
+* Header Files *
+*********************************************************************************************************************************/
#define LOG_GROUP LOG_GROUP_PDM//_CRITSECT
#include "PDMInternal.h"
#include <VBox/vmm/pdmcritsect.h>
diff --git a/src/VBox/VMM/VMMAll/PDMAllCritSectRw.cpp b/src/VBox/VMM/VMMAll/PDMAllCritSectRw.cpp
index 9f8da8c..2413176 100644
--- a/src/VBox/VMM/VMMAll/PDMAllCritSectRw.cpp
+++ b/src/VBox/VMM/VMMAll/PDMAllCritSectRw.cpp
@@ -16,9 +16,9 @@
*/
-/*******************************************************************************
-* Header Files *
-*******************************************************************************/
+/*********************************************************************************************************************************
+* Header Files *
+*********************************************************************************************************************************/
#define LOG_GROUP LOG_GROUP_PDM//_CRITSECT
#include "PDMInternal.h"
#include <VBox/vmm/pdmcritsectrw.h>
@@ -41,9 +41,9 @@
#endif
-/*******************************************************************************
-* Defined Constants And Macros *
-*******************************************************************************/
+/*********************************************************************************************************************************
+* Defined Constants And Macros *
+*********************************************************************************************************************************/
/** The number loops to spin for shared access in ring-3. */
#define PDMCRITSECTRW_SHRD_SPIN_COUNT_R3 20
/** The number loops to spin for shared access in ring-0. */
diff --git a/src/VBox/VMM/VMMAll/PDMAllNetShaper.cpp b/src/VBox/VMM/VMMAll/PDMAllNetShaper.cpp
index c32f194..7b2bef3 100644
--- a/src/VBox/VMM/VMMAll/PDMAllNetShaper.cpp
+++ b/src/VBox/VMM/VMMAll/PDMAllNetShaper.cpp
@@ -16,9 +16,9 @@
*/
-/*******************************************************************************
-* Header Files *
-*******************************************************************************/
+/*********************************************************************************************************************************
+* Header Files *
+*********************************************************************************************************************************/
#define LOG_GROUP LOG_GROUP_NET_SHAPER
#include <VBox/vmm/pdm.h>
#include <VBox/log.h>
diff --git a/src/VBox/VMM/VMMAll/PDMAllQueue.cpp b/src/VBox/VMM/VMMAll/PDMAllQueue.cpp
index 0c4d483..8c196ca 100644
--- a/src/VBox/VMM/VMMAll/PDMAllQueue.cpp
+++ b/src/VBox/VMM/VMMAll/PDMAllQueue.cpp
@@ -16,9 +16,9 @@
*/
-/*******************************************************************************
-* Header Files *
-*******************************************************************************/
+/*********************************************************************************************************************************
+* Header Files *
+*********************************************************************************************************************************/
#define LOG_GROUP LOG_GROUP_PDM_QUEUE
#include "PDMInternal.h"
#include <VBox/vmm/pdm.h>
diff --git a/src/VBox/VMM/VMMAll/PGMAll.cpp b/src/VBox/VMM/VMMAll/PGMAll.cpp
index 5432f4a..af31b34 100644
--- a/src/VBox/VMM/VMMAll/PGMAll.cpp
+++ b/src/VBox/VMM/VMMAll/PGMAll.cpp
@@ -15,9 +15,10 @@
* hope that it will be useful, but WITHOUT ANY WARRANTY of any kind.
*/
-/*******************************************************************************
-* Header Files *
-*******************************************************************************/
+
+/*********************************************************************************************************************************
+* Header Files *
+*********************************************************************************************************************************/
#define LOG_GROUP LOG_GROUP_PGM
#include <VBox/vmm/pgm.h>
#include <VBox/vmm/cpum.h>
@@ -46,9 +47,9 @@
#include <VBox/err.h>
-/*******************************************************************************
-* Structures and Typedefs *
-*******************************************************************************/
+/*********************************************************************************************************************************
+* Structures and Typedefs *
+*********************************************************************************************************************************/
/**
* Stated structure for PGM_GST_NAME(HandlerVirtualUpdate) that's
* passed to PGM_GST_NAME(VirtHandlerUpdateOne) during enumeration.
@@ -66,9 +67,9 @@ typedef struct PGMHVUSTATE
} PGMHVUSTATE, *PPGMHVUSTATE;
-/*******************************************************************************
-* Internal Functions *
-*******************************************************************************/
+/*********************************************************************************************************************************
+* Internal Functions *
+*********************************************************************************************************************************/
DECLINLINE(int) pgmShwGetLongModePDPtr(PVMCPU pVCpu, RTGCPTR64 GCPtr, PX86PML4E *ppPml4e, PX86PDPT *ppPdpt, PX86PDPAE *ppPD);
DECLINLINE(int) pgmShwGetPaePoolPagePD(PVMCPU pVCpu, RTGCPTR GCPtr, PPGMPOOLPAGE *ppShwPde);
#ifndef IN_RC
diff --git a/src/VBox/VMM/VMMAll/PGMAllHandler.cpp b/src/VBox/VMM/VMMAll/PGMAllHandler.cpp
index b69053e..6f67df6 100644
--- a/src/VBox/VMM/VMMAll/PGMAllHandler.cpp
+++ b/src/VBox/VMM/VMMAll/PGMAllHandler.cpp
@@ -16,9 +16,9 @@
*/
-/*******************************************************************************
-* Header Files *
-*******************************************************************************/
+/*********************************************************************************************************************************
+* Header Files *
+*********************************************************************************************************************************/
#define LOG_GROUP LOG_GROUP_PGM
#include <VBox/vmm/dbgf.h>
#include <VBox/vmm/pgm.h>
@@ -46,9 +46,9 @@
#include <VBox/vmm/selm.h>
-/*******************************************************************************
-* Internal Functions *
-*******************************************************************************/
+/*********************************************************************************************************************************
+* Internal Functions *
+*********************************************************************************************************************************/
static int pgmHandlerPhysicalSetRamFlagsAndFlushShadowPTs(PVM pVM, PPGMPHYSHANDLER pCur, PPGMRAMRANGE pRam);
static void pgmHandlerPhysicalDeregisterNotifyREM(PVM pVM, PPGMPHYSHANDLER pCur);
static void pgmHandlerPhysicalResetRamFlags(PVM pVM, PPGMPHYSHANDLER pCur);
diff --git a/src/VBox/VMM/VMMAll/PGMAllMap.cpp b/src/VBox/VMM/VMMAll/PGMAllMap.cpp
index b759ecb..766c8e8 100644
--- a/src/VBox/VMM/VMMAll/PGMAllMap.cpp
+++ b/src/VBox/VMM/VMMAll/PGMAllMap.cpp
@@ -15,9 +15,10 @@
* hope that it will be useful, but WITHOUT ANY WARRANTY of any kind.
*/
-/*******************************************************************************
-* Header Files *
-*******************************************************************************/
+
+/*********************************************************************************************************************************
+* Header Files *
+*********************************************************************************************************************************/
#define LOG_GROUP LOG_GROUP_PGM
#include <VBox/vmm/pgm.h>
#include <VBox/vmm/em.h>
diff --git a/src/VBox/VMM/VMMAll/PGMAllPhys.cpp b/src/VBox/VMM/VMMAll/PGMAllPhys.cpp
index b74c859..0036af4 100644
--- a/src/VBox/VMM/VMMAll/PGMAllPhys.cpp
+++ b/src/VBox/VMM/VMMAll/PGMAllPhys.cpp
@@ -15,9 +15,10 @@
* hope that it will be useful, but WITHOUT ANY WARRANTY of any kind.
*/
-/*******************************************************************************
-* Header Files *
-*******************************************************************************/
+
+/*********************************************************************************************************************************
+* Header Files *
+*********************************************************************************************************************************/
#define LOG_GROUP LOG_GROUP_PGM_PHYS
#include <VBox/vmm/pgm.h>
#include <VBox/vmm/trpm.h>
@@ -41,9 +42,9 @@
#endif
-/*******************************************************************************
-* Defined Constants And Macros *
-*******************************************************************************/
+/*********************************************************************************************************************************
+* Defined Constants And Macros *
+*********************************************************************************************************************************/
/** Enable the physical TLB. */
#define PGM_WITH_PHYS_TLB
diff --git a/src/VBox/VMM/VMMAll/PGMAllPool.cpp b/src/VBox/VMM/VMMAll/PGMAllPool.cpp
index c3dc3d4..a119a24 100644
--- a/src/VBox/VMM/VMMAll/PGMAllPool.cpp
+++ b/src/VBox/VMM/VMMAll/PGMAllPool.cpp
@@ -16,9 +16,9 @@
*/
-/*******************************************************************************
-* Header Files *
-*******************************************************************************/
+/*********************************************************************************************************************************
+* Header Files *
+*********************************************************************************************************************************/
#define LOG_GROUP LOG_GROUP_PGM_POOL
#include <VBox/vmm/pgm.h>
#include <VBox/vmm/mm.h>
@@ -40,9 +40,9 @@
#include <iprt/string.h>
-/*******************************************************************************
-* Internal Functions *
-*******************************************************************************/
+/*********************************************************************************************************************************
+* Internal Functions *
+*********************************************************************************************************************************/
RT_C_DECLS_BEGIN
DECLINLINE(unsigned) pgmPoolTrackGetShadowEntrySize(PGMPOOLKIND enmKind);
DECLINLINE(unsigned) pgmPoolTrackGetGuestEntrySize(PGMPOOLKIND enmKind);
diff --git a/src/VBox/VMM/VMMAll/REMAll.cpp b/src/VBox/VMM/VMMAll/REMAll.cpp
index 4947673..3426423 100644
--- a/src/VBox/VMM/VMMAll/REMAll.cpp
+++ b/src/VBox/VMM/VMMAll/REMAll.cpp
@@ -16,9 +16,9 @@
*/
-/*******************************************************************************
-* Header Files *
-*******************************************************************************/
+/*********************************************************************************************************************************
+* Header Files *
+*********************************************************************************************************************************/
#define LOG_GROUP LOG_GROUP_REM
#ifdef VBOX_WITH_REM
# include <VBox/vmm/rem.h>
diff --git a/src/VBox/VMM/VMMAll/SELMAll.cpp b/src/VBox/VMM/VMMAll/SELMAll.cpp
index 163e337..9915b01 100644
--- a/src/VBox/VMM/VMMAll/SELMAll.cpp
+++ b/src/VBox/VMM/VMMAll/SELMAll.cpp
@@ -16,9 +16,9 @@
*/
-/*******************************************************************************
-* Header Files *
-*******************************************************************************/
+/*********************************************************************************************************************************
+* Header Files *
+*********************************************************************************************************************************/
#define LOG_GROUP LOG_GROUP_SELM
#include <VBox/vmm/selm.h>
#include <VBox/vmm/stam.h>
@@ -39,9 +39,9 @@
#include "SELMInline.h"
-/*******************************************************************************
-* Global Variables *
-*******************************************************************************/
+/*********************************************************************************************************************************
+* Global Variables *
+*********************************************************************************************************************************/
#if defined(LOG_ENABLED) && defined(VBOX_WITH_RAW_MODE_NOT_R0)
/** Segment register names. */
static char const g_aszSRegNms[X86_SREG_COUNT][4] = { "ES", "CS", "SS", "DS", "FS", "GS" };
@@ -1043,7 +1043,7 @@ l_tryagain:
#endif /* VBOX_WITH_RAW_MODE_NOT_R0 */
-#if defined(VBOX_WITH_RAW_MODE) || (HC_ARCH_BITS != 64 && !defined(VBOX_WITH_HYBRID_32BIT_KERNEL))
+#if defined(VBOX_WITH_RAW_MODE) || (HC_ARCH_BITS != 64 && defined(VBOX_WITH_64_BITS_GUESTS))
/**
* Gets the hypervisor code selector (CS).
@@ -1117,7 +1117,7 @@ VMMDECL(RTRCPTR) SELMGetHyperGDT(PVM pVM)
return (RTRCPTR)MMHyperR3ToRC(pVM, pVM->selm.s.paGdtR3);
}
-#endif /* defined(VBOX_WITH_RAW_MODE) || (HC_ARCH_BITS != 64 && !defined(VBOX_WITH_HYBRID_32BIT_KERNEL)) */
+#endif /* defined(VBOX_WITH_RAW_MODE) || (HC_ARCH_BITS != 64 && defined(VBOX_WITH_64_BITS_GUESTS)) */
/**
* Gets info about the current TSS.
diff --git a/src/VBox/VMM/VMMAll/TMAll.cpp b/src/VBox/VMM/VMMAll/TMAll.cpp
index 4c556cb..c824e6b 100644
--- a/src/VBox/VMM/VMMAll/TMAll.cpp
+++ b/src/VBox/VMM/VMMAll/TMAll.cpp
@@ -16,9 +16,9 @@
*/
-/*******************************************************************************
-* Header Files *
-*******************************************************************************/
+/*********************************************************************************************************************************
+* Header Files *
+*********************************************************************************************************************************/
#define LOG_GROUP LOG_GROUP_TM
#include <VBox/vmm/tm.h>
#include <VBox/vmm/mm.h>
@@ -46,9 +46,9 @@
#include "TMInline.h"
-/*******************************************************************************
-* Defined Constants And Macros *
-*******************************************************************************/
+/*********************************************************************************************************************************
+* Defined Constants And Macros *
+*********************************************************************************************************************************/
/** @def TMTIMER_ASSERT_CRITSECT
* Checks that the caller owns the critical section if one is associated with
* the timer. */
diff --git a/src/VBox/VMM/VMMAll/TMAllCpu.cpp b/src/VBox/VMM/VMMAll/TMAllCpu.cpp
index d9bed90..b89131c 100644
--- a/src/VBox/VMM/VMMAll/TMAllCpu.cpp
+++ b/src/VBox/VMM/VMMAll/TMAllCpu.cpp
@@ -16,9 +16,9 @@
*/
-/*******************************************************************************
-* Header Files *
-*******************************************************************************/
+/*********************************************************************************************************************************
+* Header Files *
+*********************************************************************************************************************************/
#define LOG_GROUP LOG_GROUP_TM
#include <VBox/vmm/tm.h>
#include <iprt/asm-amd64-x86.h> /* for SUPGetCpuHzFromGIP */
diff --git a/src/VBox/VMM/VMMAll/TMAllReal.cpp b/src/VBox/VMM/VMMAll/TMAllReal.cpp
index a9d01a2..a31c935 100644
--- a/src/VBox/VMM/VMMAll/TMAllReal.cpp
+++ b/src/VBox/VMM/VMMAll/TMAllReal.cpp
@@ -16,9 +16,9 @@
*/
-/*******************************************************************************
-* Header Files *
-*******************************************************************************/
+/*********************************************************************************************************************************
+* Header Files *
+*********************************************************************************************************************************/
#define LOG_GROUP LOG_GROUP_TM
#include <VBox/vmm/tm.h>
#include "TMInternal.h"
diff --git a/src/VBox/VMM/VMMAll/TMAllVirtual.cpp b/src/VBox/VMM/VMMAll/TMAllVirtual.cpp
index a5c9afa..011829f 100644
--- a/src/VBox/VMM/VMMAll/TMAllVirtual.cpp
+++ b/src/VBox/VMM/VMMAll/TMAllVirtual.cpp
@@ -16,9 +16,9 @@
*/
-/*******************************************************************************
-* Header Files *
-*******************************************************************************/
+/*********************************************************************************************************************************
+* Header Files *
+*********************************************************************************************************************************/
#define LOG_GROUP LOG_GROUP_TM
#include <VBox/vmm/tm.h>
#include <VBox/vmm/dbgftrace.h>
@@ -45,8 +45,8 @@
/**
* @interface_method_impl{RTTIMENANOTSDATA, pfnBadPrev}
*/
-DECLEXPORT(void) tmVirtualNanoTSBadPrev(PRTTIMENANOTSDATA pData, uint64_t u64NanoTS, uint64_t u64DeltaPrev,
- uint64_t u64PrevNanoTS)
+DECLCALLBACK(DECLEXPORT(void)) tmVirtualNanoTSBadPrev(PRTTIMENANOTSDATA pData, uint64_t u64NanoTS, uint64_t u64DeltaPrev,
+ uint64_t u64PrevNanoTS)
{
PVM pVM = RT_FROM_MEMBER(pData, VM, CTX_SUFF(tm.s.VirtualGetRawData));
pData->cBadPrev++;
@@ -67,7 +67,7 @@ DECLEXPORT(void) tmVirtualNanoTSBadPrev(PRTTIMENANOTSDATA pData, uint64_t u64Nan
* fGetGipCpu feature the current worker relies upon becomes unavailable. The
* last two events may occur as CPUs are taken online.
*/
-DECLEXPORT(uint64_t) tmVirtualNanoTSRediscover(PRTTIMENANOTSDATA pData)
+DECLCALLBACK(DECLEXPORT(uint64_t)) tmVirtualNanoTSRediscover(PRTTIMENANOTSDATA pData)
{
PVM pVM = RT_FROM_MEMBER(pData, VM, CTX_SUFF(tm.s.VirtualGetRawData));
diff --git a/src/VBox/VMM/VMMAll/TRPMAll.cpp b/src/VBox/VMM/VMMAll/TRPMAll.cpp
index 916019e..3465db3 100644
--- a/src/VBox/VMM/VMMAll/TRPMAll.cpp
+++ b/src/VBox/VMM/VMMAll/TRPMAll.cpp
@@ -16,9 +16,9 @@
*/
-/*******************************************************************************
-* Header Files *
-*******************************************************************************/
+/*********************************************************************************************************************************
+* Header Files *
+*********************************************************************************************************************************/
#define LOG_GROUP LOG_GROUP_TRPM
#include <VBox/vmm/trpm.h>
#include <VBox/vmm/pgm.h>
diff --git a/src/VBox/VMM/VMMAll/VMAll.cpp b/src/VBox/VMM/VMMAll/VMAll.cpp
index 2e4e16f..eae1351 100644
--- a/src/VBox/VMM/VMMAll/VMAll.cpp
+++ b/src/VBox/VMM/VMMAll/VMAll.cpp
@@ -16,9 +16,9 @@
*/
-/*******************************************************************************
-* Header Files *
-*******************************************************************************/
+/*********************************************************************************************************************************
+* Header Files *
+*********************************************************************************************************************************/
#define LOG_GROUP LOG_GROUP_VM
#include "VMInternal.h"
#include <VBox/vmm/vmm.h>
diff --git a/src/VBox/VMM/VMMAll/VMMAll.cpp b/src/VBox/VMM/VMMAll/VMMAll.cpp
index f6482b9..f7194ff 100644
--- a/src/VBox/VMM/VMMAll/VMMAll.cpp
+++ b/src/VBox/VMM/VMMAll/VMMAll.cpp
@@ -16,9 +16,9 @@
*/
-/*******************************************************************************
-* Header Files *
-*******************************************************************************/
+/*********************************************************************************************************************************
+* Header Files *
+*********************************************************************************************************************************/
#define LOG_GROUP LOG_GROUP_VMM
#include <VBox/vmm/vmm.h>
#include "VMMInternal.h"
@@ -30,9 +30,9 @@
#include <iprt/mp.h>
-/*******************************************************************************
-* Global Variables *
-*******************************************************************************/
+/*********************************************************************************************************************************
+* Global Variables *
+*********************************************************************************************************************************/
/** User counter for the vmmInitFormatTypes function (pro forma). */
static volatile uint32_t g_cFormatTypeUsers = 0;
diff --git a/src/VBox/VMM/VMMR0/CPUMR0.cpp b/src/VBox/VMM/VMMR0/CPUMR0.cpp
index 26a9c94..a894a96 100644
--- a/src/VBox/VMM/VMMR0/CPUMR0.cpp
+++ b/src/VBox/VMM/VMMR0/CPUMR0.cpp
@@ -16,9 +16,9 @@
*/
-/*******************************************************************************
-* Header Files *
-*******************************************************************************/
+/*********************************************************************************************************************************
+* Header Files *
+*********************************************************************************************************************************/
#define LOG_GROUP LOG_GROUP_CPUM
#include <VBox/vmm/cpum.h>
#include "CPUMInternal.h"
@@ -36,9 +36,9 @@
#include <iprt/x86.h>
-/*******************************************************************************
-* Structures and Typedefs *
-*******************************************************************************/
+/*********************************************************************************************************************************
+* Structures and Typedefs *
+*********************************************************************************************************************************/
#ifdef VBOX_WITH_VMMR0_DISABLE_LAPIC_NMI
/**
* Local APIC mappings.
@@ -66,9 +66,9 @@ typedef struct CPUMHOSTLAPIC
#endif
-/*******************************************************************************
-* Global Variables *
-*******************************************************************************/
+/*********************************************************************************************************************************
+* Global Variables *
+*********************************************************************************************************************************/
#ifdef VBOX_WITH_VMMR0_DISABLE_LAPIC_NMI
static CPUMHOSTLAPIC g_aLApics[RTCPUSET_MAX_CPUS];
#endif
@@ -93,9 +93,9 @@ const g_aCpuidUnifyBits[] =
-/*******************************************************************************
-* Internal Functions *
-*******************************************************************************/
+/*********************************************************************************************************************************
+* Internal Functions *
+*********************************************************************************************************************************/
#ifdef VBOX_WITH_VMMR0_DISABLE_LAPIC_NMI
static int cpumR0MapLocalApics(void);
static void cpumR0UnmapLocalApics(void);
@@ -255,11 +255,7 @@ VMMR0_INT_DECL(int) CPUMR0InitVM(PVM pVM)
if (fExtFeaturesEDX & X86_CPUID_EXT_FEATURE_EDX_SYSCALL)
{
#ifdef RT_ARCH_X86
-# ifdef VBOX_WITH_HYBRID_32BIT_KERNEL
- if (fExtFeaturesEDX & X86_CPUID_EXT_FEATURE_EDX_LONG_MODE)
-# else
if (!ASMIsIntelCpu())
-# endif
#endif
{
uint64_t fEfer = ASMRdMsr(MSR_K6_EFER);
@@ -399,7 +395,7 @@ VMMR0_INT_DECL(int) CPUMR0Trap07Handler(PVM pVM, PVMCPU pVCpu, PCPUMCTX pCtx)
VMMR0_INT_DECL(int) CPUMR0LoadGuestFPU(PVM pVM, PVMCPU pVCpu, PCPUMCTX pCtx)
{
Assert(!RTThreadPreemptIsEnabled(NIL_RTTHREAD));
-#if HC_ARCH_BITS == 32 && defined(VBOX_WITH_64_BITS_GUESTS) && !defined(VBOX_WITH_HYBRID_32BIT_KERNEL)
+#if HC_ARCH_BITS == 32 && defined(VBOX_WITH_64_BITS_GUESTS)
if (CPUMIsGuestInLongModeEx(pCtx))
{
Assert(!(pVCpu->cpum.s.fUseFlags & CPUM_SYNC_FPU_STATE));
@@ -463,7 +459,7 @@ VMMR0_INT_DECL(int) CPUMR0SaveGuestFPU(PVM pVM, PVMCPU pVCpu, PCPUMCTX pCtx)
AssertReturn((pVCpu->cpum.s.fUseFlags & CPUM_USED_FPU), VINF_SUCCESS);
NOREF(pVM); NOREF(pCtx);
-#if HC_ARCH_BITS == 32 && defined(VBOX_WITH_64_BITS_GUESTS) && !defined(VBOX_WITH_HYBRID_32BIT_KERNEL)
+#if HC_ARCH_BITS == 32 && defined(VBOX_WITH_64_BITS_GUESTS)
if (CPUMIsGuestInLongModeEx(pCtx))
{
if (!(pVCpu->cpum.s.fUseFlags & CPUM_SYNC_FPU_STATE))
@@ -530,15 +526,10 @@ static int cpumR0SaveHostDebugState(PVMCPU pVCpu)
/*
* Save the host state.
*/
-#ifdef VBOX_WITH_HYBRID_32BIT_KERNEL
- AssertCompile((uintptr_t)&pVCpu->cpum.s.Host.dr3 - (uintptr_t)&pVCpu->cpum.s.Host.dr0 == sizeof(uint64_t) * 3);
- cpumR0SaveDRx(&pVCpu->cpum.s.Host.dr0);
-#else
pVCpu->cpum.s.Host.dr0 = ASMGetDR0();
pVCpu->cpum.s.Host.dr1 = ASMGetDR1();
pVCpu->cpum.s.Host.dr2 = ASMGetDR2();
pVCpu->cpum.s.Host.dr3 = ASMGetDR3();
-#endif
pVCpu->cpum.s.Host.dr6 = ASMGetDR6();
/** @todo dr7 might already have been changed to 0x400; don't care right now as it's harmless. */
pVCpu->cpum.s.Host.dr7 = ASMGetDR7();
@@ -582,7 +573,7 @@ VMMR0_INT_DECL(bool) CPUMR0DebugStateMaybeSaveGuestAndRestoreHost(PVMCPU pVCpu,
*/
if (pVCpu->cpum.s.fUseFlags & CPUM_USED_DEBUG_REGS_GUEST)
{
-#if HC_ARCH_BITS == 32 && defined(VBOX_WITH_64_BITS_GUESTS) && !defined(VBOX_WITH_HYBRID_32BIT_KERNEL)
+#if HC_ARCH_BITS == 32 && defined(VBOX_WITH_64_BITS_GUESTS)
if (CPUMIsGuestInLongModeEx(&pVCpu->cpum.s.Guest))
{
uint64_t uDr6 = pVCpu->cpum.s.Guest.dr[6];
@@ -593,14 +584,10 @@ VMMR0_INT_DECL(bool) CPUMR0DebugStateMaybeSaveGuestAndRestoreHost(PVMCPU pVCpu,
else
#endif
{
-#ifdef VBOX_WITH_HYBRID_32BIT_KERNEL
- cpumR0SaveDRx(&pVCpu->cpum.s.Guest.dr[0]);
-#else
pVCpu->cpum.s.Guest.dr[0] = ASMGetDR0();
pVCpu->cpum.s.Guest.dr[1] = ASMGetDR1();
pVCpu->cpum.s.Guest.dr[2] = ASMGetDR2();
pVCpu->cpum.s.Guest.dr[3] = ASMGetDR3();
-#endif
if (fDr6)
pVCpu->cpum.s.Guest.dr[6] = ASMGetDR6();
}
@@ -618,15 +605,10 @@ VMMR0_INT_DECL(bool) CPUMR0DebugStateMaybeSaveGuestAndRestoreHost(PVMCPU pVCpu,
if (uCurDR7 != X86_DR7_INIT_VAL)
ASMSetDR7(X86_DR7_INIT_VAL);
-#ifdef VBOX_WITH_HYBRID_32BIT_KERNEL
- AssertCompile((uintptr_t)&pVCpu->cpum.s.Host.dr3 - (uintptr_t)&pVCpu->cpum.s.Host.dr0 == sizeof(uint64_t) * 3);
- cpumR0LoadDRx(&pVCpu->cpum.s.Host.dr0);
-#else
ASMSetDR0(pVCpu->cpum.s.Host.dr0);
ASMSetDR1(pVCpu->cpum.s.Host.dr1);
ASMSetDR2(pVCpu->cpum.s.Host.dr2);
ASMSetDR3(pVCpu->cpum.s.Host.dr3);
-#endif
/** @todo consider only updating if they differ, esp. DR6. Need to figure how
* expensive DRx reads are over DRx writes. */
ASMSetDR6(pVCpu->cpum.s.Host.dr6);
@@ -659,7 +641,7 @@ VMMR0_INT_DECL(bool) CPUMR0DebugStateMaybeSaveGuest(PVMCPU pVCpu, bool fDr6)
*/
if (pVCpu->cpum.s.fUseFlags & CPUM_USED_DEBUG_REGS_GUEST)
{
-#if HC_ARCH_BITS == 32 && defined(VBOX_WITH_64_BITS_GUESTS) && !defined(VBOX_WITH_HYBRID_32BIT_KERNEL)
+#if HC_ARCH_BITS == 32 && defined(VBOX_WITH_64_BITS_GUESTS)
if (CPUMIsGuestInLongModeEx(&pVCpu->cpum.s.Guest))
{
uint64_t uDr6 = pVCpu->cpum.s.Guest.dr[6];
@@ -670,14 +652,10 @@ VMMR0_INT_DECL(bool) CPUMR0DebugStateMaybeSaveGuest(PVMCPU pVCpu, bool fDr6)
else
#endif
{
-#ifdef VBOX_WITH_HYBRID_32BIT_KERNEL
- cpumR0SaveDRx(&pVCpu->cpum.s.Guest.dr[0]);
-#else
pVCpu->cpum.s.Guest.dr[0] = ASMGetDR0();
pVCpu->cpum.s.Guest.dr[1] = ASMGetDR1();
pVCpu->cpum.s.Guest.dr[2] = ASMGetDR2();
pVCpu->cpum.s.Guest.dr[3] = ASMGetDR3();
-#endif
if (fDr6)
pVCpu->cpum.s.Guest.dr[6] = ASMGetDR6();
}
@@ -706,20 +684,16 @@ VMMR0_INT_DECL(void) CPUMR0LoadGuestDebugState(PVMCPU pVCpu, bool fDr6)
* Activate the guest state DR0-3.
* DR7 and DR6 (if fDr6 is true) are left to the caller.
*/
-#if HC_ARCH_BITS == 32 && defined(VBOX_WITH_64_BITS_GUESTS) && !defined(VBOX_WITH_HYBRID_32BIT_KERNEL)
+#if HC_ARCH_BITS == 32 && defined(VBOX_WITH_64_BITS_GUESTS)
if (CPUMIsGuestInLongModeEx(&pVCpu->cpum.s.Guest))
ASMAtomicOrU32(&pVCpu->cpum.s.fUseFlags, CPUM_SYNC_DEBUG_REGS_GUEST); /* Postpone it to the world switch. */
else
#endif
{
-#ifdef VBOX_WITH_HYBRID_32BIT_KERNEL
- cpumR0LoadDRx(&pVCpu->cpum.s.Guest.dr[0]);
-#else
ASMSetDR0(pVCpu->cpum.s.Guest.dr[0]);
ASMSetDR1(pVCpu->cpum.s.Guest.dr[1]);
ASMSetDR2(pVCpu->cpum.s.Guest.dr[2]);
ASMSetDR3(pVCpu->cpum.s.Guest.dr[3]);
-#endif
if (fDr6)
ASMSetDR6(pVCpu->cpum.s.Guest.dr[6]);
@@ -753,20 +727,16 @@ VMMR0_INT_DECL(void) CPUMR0LoadHyperDebugState(PVMCPU pVCpu, bool fDr6)
* Activate the guest state DR0-3.
* DR7 and DR6 (if fDr6 is true) are left to the caller.
*/
-#if HC_ARCH_BITS == 32 && defined(VBOX_WITH_64_BITS_GUESTS) && !defined(VBOX_WITH_HYBRID_32BIT_KERNEL)
+#if HC_ARCH_BITS == 32 && defined(VBOX_WITH_64_BITS_GUESTS)
if (CPUMIsGuestInLongModeEx(&pVCpu->cpum.s.Guest))
ASMAtomicOrU32(&pVCpu->cpum.s.fUseFlags, CPUM_SYNC_DEBUG_REGS_HYPER); /* Postpone it. */
else
#endif
{
-#ifdef VBOX_WITH_HYBRID_32BIT_KERNEL
- cpumR0LoadDRx(&pVCpu->cpum.s.Hyper.dr[0]);
-#else
ASMSetDR0(pVCpu->cpum.s.Hyper.dr[0]);
ASMSetDR1(pVCpu->cpum.s.Hyper.dr[1]);
ASMSetDR2(pVCpu->cpum.s.Hyper.dr[2]);
ASMSetDR3(pVCpu->cpum.s.Hyper.dr[3]);
-#endif
if (fDr6)
ASMSetDR6(X86_DR6_INIT_VAL);
diff --git a/src/VBox/VMM/VMMR0/CPUMR0A.asm b/src/VBox/VMM/VMMR0/CPUMR0A.asm
index e169def..fc65511 100644
--- a/src/VBox/VMM/VMMR0/CPUMR0A.asm
+++ b/src/VBox/VMM/VMMR0/CPUMR0A.asm
@@ -48,35 +48,6 @@
%endif
-;*******************************************************************************
-;* External Symbols *
-;*******************************************************************************
-%ifdef VBOX_WITH_HYBRID_32BIT_KERNEL
-extern NAME(SUPR0AbsIs64bit)
-extern NAME(SUPR0Abs64bitKernelCS)
-extern NAME(SUPR0Abs64bitKernelSS)
-extern NAME(SUPR0Abs64bitKernelDS)
-extern NAME(SUPR0AbsKernelCS)
-%endif
-
-
-;*******************************************************************************
-;* Global Variables *
-;*******************************************************************************
-%ifdef VBOX_WITH_HYBRID_32BIT_KERNEL
-BEGINDATA
-%if 0 ; Currently not used.
-g_r32_Zero: dd 0.0
-%endif
-
-;;
-; Store the SUPR0AbsIs64bit absolute value here so we can cmp/test without
-; needing to clobber a register. (This trick doesn't quite work for PE btw.
-; but that's not relevant atm.)
-GLOBALNAME g_fCPUMIs64bitHost
- dd NAME(SUPR0AbsIs64bit)
-%endif
-
BEGINCODE
@@ -160,35 +131,6 @@ BEGINCODE
mov pXState, [pCpumCpu + CPUMCPU.Host.pXStateR0]
mov eax, [pCpumCpu + CPUMCPU.Host.fXStateMask]
-%ifdef VBOX_WITH_HYBRID_32BIT_KERNEL
- ; The joy of 32-bit darwin kernels that runs the CPU in 64-bit mode.
- cmp byte [NAME(g_fCPUMIs64bitHost)], 0
- jz %%host_legacy_mode
- db 0xea ; jmp far .sixtyfourbit_mode
- dd %%host_sixtyfourbit_mode, NAME(SUPR0Abs64bitKernelCS)
-BITS 64
-%%host_sixtyfourbit_mode:
- or eax, eax
- jz %%host_sixtyfourbit_fxsave
-
- ; XSAVE
- mov edx, [pCpumCpu + CPUMCPU.Host.fXStateMask + 4]
- o64 xsave [pXState]
- jmp %%host_sixtyfourbit_done
-
- ; FXSAVE
-%%host_sixtyfourbit_fxsave:
- o64 fxsave [pXState]
-
-%%host_sixtyfourbit_done:
- jmp far [%%host_fpret wrt rip]
-%%host_fpret: ; 16:32 Pointer to %%host_done.
- dd %%host_done, NAME(SUPR0AbsKernelCS)
-BITS 32
-
-%%host_legacy_mode:
-%endif
-
;
; XSAVE or FXSAVE?
;
@@ -230,35 +172,6 @@ BITS 32
mov pXState, [pCpumCpu + CPUMCPU.Host.pXStateR0]
mov eax, [pCpumCpu + CPUMCPU.Host.fXStateMask]
-%ifdef VBOX_WITH_HYBRID_32BIT_KERNEL
- ; The joy of 32-bit darwin kernels that runs the CPU in 64-bit mode.
- cmp byte [NAME(g_fCPUMIs64bitHost)], 0
- jz %%host_legacy_mode
- db 0xea ; jmp far .sixtyfourbit_mode
- dd %%host_sixtyfourbit_mode, NAME(SUPR0Abs64bitKernelCS)
-BITS 64
-%%host_sixtyfourbit_mode:
- or eax, eax
- jz %%host_sixtyfourbit_fxrstor
-
- ; XRSTOR
- mov edx, [pCpumCpu + CPUMCPU.Host.fXStateMask + 4]
- o64 xrstor [pXState]
- jmp %%host_sixtyfourbit_done
-
- ; FXRSTOR
-%%host_sixtyfourbit_fxrstor:
- o64 fxrstor [pXState]
-
-%%host_sixtyfourbit_done:
- jmp far [%%host_fpret wrt rip]
-%%host_fpret: ; 16:32 Pointer to %%host_done.
- dd %%host_done, NAME(SUPR0AbsKernelCS)
-BITS 32
-
-%%host_legacy_mode:
-%endif
-
;
; XRSTOR or FXRSTOR?
;
@@ -341,35 +254,6 @@ BITS 32
mov pXState, [pCpumCpu + CPUMCPU.Guest.pXStateR0]
mov eax, [pCpumCpu + CPUMCPU.Guest.fXStateMask]
-%ifdef VBOX_WITH_HYBRID_32BIT_KERNEL
- ; The joy of 32-bit darwin kernels that runs the CPU in 64-bit mode.
- cmp byte [NAME(g_fCPUMIs64bitHost)], 0
- jz %%guest_legacy_mode
- db 0xea ; jmp far .sixtyfourbit_mode
- dd %%guest_sixtyfourbit_mode, NAME(SUPR0Abs64bitKernelCS)
-BITS 64
-%%guest_sixtyfourbit_mode:
- or eax, eax
- jz %%guest_sixtyfourbit_fxsave
-
- ; XSAVE
- mov edx, [pCpumCpu + CPUMCPU.Guest.fXStateMask + 4]
- o64 xsave [pXState]
- jmp %%guest_sixtyfourbit_done
-
- ; FXSAVE
-%%guest_sixtyfourbit_fxsave:
- SAVE_32_OR_64_FPU pCpumCpu, pXState, 1
-
-%%guest_sixtyfourbit_done:
- jmp far [%%guest_fpret wrt rip]
-%%guest_fpret: ; 16:32 Pointer to %%guest_done.
- dd %%guest_done, NAME(SUPR0AbsKernelCS)
-BITS 32
-
-%%guest_legacy_mode:
-%endif
-
;
; XSAVE or FXSAVE?
;
@@ -438,35 +322,6 @@ BITS 32
mov pXState, [pCpumCpu + CPUMCPU.Guest.pXStateR0]
mov eax, [pCpumCpu + CPUMCPU.Guest.fXStateMask]
-%ifdef VBOX_WITH_HYBRID_32BIT_KERNEL
- ; The joy of 32-bit darwin kernels that runs the CPU in 64-bit mode.
- cmp byte [NAME(g_fCPUMIs64bitHost)], 0
- jz %%guest_legacy_mode
- db 0xea ; jmp far .sixtyfourbit_mode
- dd %%guest_sixtyfourbit_mode, NAME(SUPR0Abs64bitKernelCS)
-BITS 64
-%%guest_sixtyfourbit_mode:
- or eax, eax
- jz %%guest_sixtyfourbit_fxrstor
-
- ; XRSTOR
- mov edx, [pCpumCpu + CPUMCPU.Guest.fXStateMask + 4]
- o64 xrstor [pXState]
- jmp %%guest_sixtyfourbit_done
-
- ; FXRSTOR
-%%guest_sixtyfourbit_fxrstor:
- RESTORE_32_OR_64_FPU pCpumCpu, pXState, 1
-
-%%guest_sixtyfourbit_done:
- jmp far [%%guest_fpret wrt rip]
-%%guest_fpret: ; 16:32 Pointer to %%guest_done.
- dd %%guest_done, NAME(SUPR0AbsKernelCS)
-BITS 32
-
-%%guest_legacy_mode:
-%endif
-
;
; XRSTOR or FXRSTOR?
;
@@ -560,8 +415,7 @@ ENDPROC cpumR0SaveHostRestoreGuestFPUState
%ifndef RT_ARCH_AMD64
-%ifdef VBOX_WITH_64_BITS_GUESTS
-%ifndef VBOX_WITH_HYBRID_32BIT_KERNEL
+ %ifdef VBOX_WITH_64_BITS_GUESTS
;;
; Saves the host FPU/SSE/AVX state.
;
@@ -573,23 +427,23 @@ BEGINPROC cpumR0SaveHostFPUState
;
; Prologue - xAX+xDX must be free for XSAVE/XRSTOR input.
;
-%ifdef RT_ARCH_AMD64
- %ifdef RT_OS_WINDOWS
- mov r11, rcx
- %else
- mov r11, rdi
- %endif
- %define pCpumCpu r11
- %define pXState r10
-%else
+ %ifdef RT_ARCH_AMD64
+ %ifdef RT_OS_WINDOWS
+ mov r11, rcx
+ %else
+ mov r11, rdi
+ %endif
+ %define pCpumCpu r11
+ %define pXState r10
+ %else
push ebp
mov ebp, esp
push ebx
push esi
mov ebx, dword [ebp + 8]
- %define pCpumCpu ebx
- %define pXState esi
-%endif
+ %define pCpumCpu ebx
+ %define pXState esi
+ %endif
pushf ; The darwin kernel can get upset or upset things if an
cli ; interrupt occurs while we're doing fxsave/fxrstor/cr0.
@@ -601,30 +455,17 @@ BEGINPROC cpumR0SaveHostFPUState
or dword [pCpumCpu + CPUMCPU.fUseFlags], (CPUM_USED_FPU | CPUM_USED_FPU_SINCE_REM)
popf
-%ifdef RT_ARCH_X86
+ %ifdef RT_ARCH_X86
pop esi
pop ebx
leave
-%endif
+ %endif
xor eax, eax
ret
-
-%ifdef VBOX_WITH_HYBRID_32BIT_KERNEL_IN_R0
-ALIGNCODE(16)
-BITS 64
-.sixtyfourbit_mode:
- ; Save the guest FPU (32-bit or 64-bit), preserves existing broken state. See @bugref{7138}.
- o64 fxsave [pXstate]
- jmp far [.fpret wrt rip]
-.fpret: ; 16:32 Pointer to .the_end.
- dd .done, NAME(SUPR0AbsKernelCS)
-BITS 32
-%endif
%undef pCpumCpu
%undef pXState
ENDPROC cpumR0SaveHostFPUState
-%endif
-%endif
+ %endif
%endif
@@ -744,126 +585,3 @@ BEGINPROC cpumR0RestoreHostFPUState
%undef pXState
ENDPROC cpumR0RestoreHostFPUState
-
-%ifdef VBOX_WITH_HYBRID_32BIT_KERNEL_IN_R0
-;;
-; DECLASM(void) cpumR0SaveDRx(uint64_t *pa4Regs);
-;
-ALIGNCODE(16)
-BEGINPROC cpumR0SaveDRx
-%ifdef RT_ARCH_AMD64
- %ifdef ASM_CALL64_GCC
- mov xCX, rdi
- %endif
-%else
- mov xCX, dword [esp + 4]
-%endif
- pushf ; Just to be on the safe side.
- cli
-%ifdef VBOX_WITH_HYBRID_32BIT_KERNEL
- cmp byte [NAME(g_fCPUMIs64bitHost)], 0
- jz .legacy_mode
- db 0xea ; jmp far .sixtyfourbit_mode
- dd .sixtyfourbit_mode, NAME(SUPR0Abs64bitKernelCS)
-.legacy_mode:
-%endif ; VBOX_WITH_HYBRID_32BIT_KERNEL
-
- ;
- ; Do the job.
- ;
- mov xAX, dr0
- mov xDX, dr1
- mov [xCX], xAX
- mov [xCX + 8 * 1], xDX
- mov xAX, dr2
- mov xDX, dr3
- mov [xCX + 8 * 2], xAX
- mov [xCX + 8 * 3], xDX
-
-.done:
- popf
- ret
-
-%ifdef VBOX_WITH_HYBRID_32BIT_KERNEL_IN_R0
-ALIGNCODE(16)
-BITS 64
-.sixtyfourbit_mode:
- and ecx, 0ffffffffh
-
- mov rax, dr0
- mov rdx, dr1
- mov r8, dr2
- mov r9, dr3
- mov [rcx], rax
- mov [rcx + 8 * 1], rdx
- mov [rcx + 8 * 2], r8
- mov [rcx + 8 * 3], r9
- jmp far [.fpret wrt rip]
-.fpret: ; 16:32 Pointer to .the_end.
- dd .done, NAME(SUPR0AbsKernelCS)
-BITS 32
-%endif
-ENDPROC cpumR0SaveDRx
-
-
-;;
-; DECLASM(void) cpumR0LoadDRx(uint64_t const *pa4Regs);
-;
-ALIGNCODE(16)
-BEGINPROC cpumR0LoadDRx
-%ifdef RT_ARCH_AMD64
- %ifdef ASM_CALL64_GCC
- mov xCX, rdi
- %endif
-%else
- mov xCX, dword [esp + 4]
-%endif
- pushf ; Just to be on the safe side.
- cli
-%ifdef VBOX_WITH_HYBRID_32BIT_KERNEL
- cmp byte [NAME(g_fCPUMIs64bitHost)], 0
- jz .legacy_mode
- db 0xea ; jmp far .sixtyfourbit_mode
- dd .sixtyfourbit_mode, NAME(SUPR0Abs64bitKernelCS)
-.legacy_mode:
-%endif ; VBOX_WITH_HYBRID_32BIT_KERNEL
-
- ;
- ; Do the job.
- ;
- mov xAX, [xCX]
- mov xDX, [xCX + 8 * 1]
- mov dr0, xAX
- mov dr1, xDX
- mov xAX, [xCX + 8 * 2]
- mov xDX, [xCX + 8 * 3]
- mov dr2, xAX
- mov dr3, xDX
-
-.done:
- popf
- ret
-
-%ifdef VBOX_WITH_HYBRID_32BIT_KERNEL_IN_R0
-ALIGNCODE(16)
-BITS 64
-.sixtyfourbit_mode:
- and ecx, 0ffffffffh
-
- mov rax, [rcx]
- mov rdx, [rcx + 8 * 1]
- mov r8, [rcx + 8 * 2]
- mov r9, [rcx + 8 * 3]
- mov dr0, rax
- mov dr1, rdx
- mov dr2, r8
- mov dr3, r9
- jmp far [.fpret wrt rip]
-.fpret: ; 16:32 Pointer to .the_end.
- dd .done, NAME(SUPR0AbsKernelCS)
-BITS 32
-%endif
-ENDPROC cpumR0LoadDRx
-
-%endif ; VBOX_WITH_HYBRID_32BIT_KERNEL_IN_R0
-
diff --git a/src/VBox/VMM/VMMR0/CPUMR0UnusedA.asm b/src/VBox/VMM/VMMR0/CPUMR0UnusedA.asm
index 542f971..fff4868 100644
--- a/src/VBox/VMM/VMMR0/CPUMR0UnusedA.asm
+++ b/src/VBox/VMM/VMMR0/CPUMR0UnusedA.asm
@@ -31,18 +31,6 @@
%endif
-;*******************************************************************************
-;* External Symbols *
-;*******************************************************************************
-%ifdef VBOX_WITH_HYBRID_32BIT_KERNEL
-extern NAME(SUPR0AbsIs64bit)
-extern NAME(SUPR0Abs64bitKernelCS)
-extern NAME(SUPR0Abs64bitKernelSS)
-extern NAME(SUPR0Abs64bitKernelDS)
-extern NAME(SUPR0AbsKernelCS)
-extern NAME(g_fCPUMIs64bitHost)
-%endif
-
;;
; Restores the guest's FPU/XMM state
@@ -62,29 +50,10 @@ BEGINPROC cpumR0LoadFPU
%else
mov xDX, dword [esp + 4]
%endif
-%ifdef VBOX_WITH_HYBRID_32BIT_KERNEL
- cmp byte [NAME(g_fCPUMIs64bitHost)], 0
- jz .legacy_mode
- db 0xea ; jmp far .sixtyfourbit_mode
- dd .sixtyfourbit_mode, NAME(SUPR0Abs64bitKernelCS)
-.legacy_mode:
-%endif ; VBOX_WITH_HYBRID_32BIT_KERNEL
fxrstor [xDX + CPUMCTX.fpu]
.done:
ret
-
-%ifdef VBOX_WITH_HYBRID_32BIT_KERNEL_IN_R0
-ALIGNCODE(16)
-BITS 64
-.sixtyfourbit_mode:
- and edx, 0ffffffffh
- fxrstor [rdx + CPUMCTX.fpu]
- jmp far [.fpret wrt rip]
-.fpret: ; 16:32 Pointer to .the_end.
- dd .done, NAME(SUPR0AbsKernelCS)
-BITS 32
-%endif
ENDPROC cpumR0LoadFPU
@@ -106,28 +75,9 @@ BEGINPROC cpumR0SaveFPU
%else
mov xDX, dword [esp + 4]
%endif
-%ifdef VBOX_WITH_HYBRID_32BIT_KERNEL
- cmp byte [NAME(g_fCPUMIs64bitHost)], 0
- jz .legacy_mode
- db 0xea ; jmp far .sixtyfourbit_mode
- dd .sixtyfourbit_mode, NAME(SUPR0Abs64bitKernelCS)
-.legacy_mode:
-%endif ; VBOX_WITH_HYBRID_32BIT_KERNEL
fxsave [xDX + CPUMCTX.fpu]
.done:
ret
-
-%ifdef VBOX_WITH_HYBRID_32BIT_KERNEL_IN_R0
-ALIGNCODE(16)
-BITS 64
-.sixtyfourbit_mode:
- and edx, 0ffffffffh
- fxsave [rdx + CPUMCTX.fpu]
- jmp far [.fpret wrt rip]
-.fpret: ; 16:32 Pointer to .the_end.
- dd .done, NAME(SUPR0AbsKernelCS)
-BITS 32
-%endif
ENDPROC cpumR0SaveFPU
@@ -149,13 +99,6 @@ BEGINPROC cpumR0LoadXMM
%else
mov xDX, dword [esp + 4]
%endif
-%ifdef VBOX_WITH_HYBRID_32BIT_KERNEL
- cmp byte [NAME(g_fCPUMIs64bitHost)], 0
- jz .legacy_mode
- db 0xea ; jmp far .sixtyfourbit_mode
- dd .sixtyfourbit_mode, NAME(SUPR0Abs64bitKernelCS)
-.legacy_mode:
-%endif ; VBOX_WITH_HYBRID_32BIT_KERNEL
movdqa xmm0, [xDX + CPUMCTX.fpu + X86FXSTATE.aXMM + 16*0]
movdqa xmm1, [xDX + CPUMCTX.fpu + X86FXSTATE.aXMM + 16*1]
@@ -179,41 +122,9 @@ BEGINPROC cpumR0LoadXMM
movdqa xmm14, [xDX + CPUMCTX.fpu + X86FXSTATE.aXMM + 16*14]
movdqa xmm15, [xDX + CPUMCTX.fpu + X86FXSTATE.aXMM + 16*15]
%endif
+
.done:
ret
-
-%ifdef VBOX_WITH_HYBRID_32BIT_KERNEL_IN_R0
-ALIGNCODE(16)
-BITS 64
-.sixtyfourbit_mode:
- and edx, 0ffffffffh
-
- movdqa xmm0, [rdx + CPUMCTX.fpu + X86FXSTATE.aXMM + 16*0]
- movdqa xmm1, [rdx + CPUMCTX.fpu + X86FXSTATE.aXMM + 16*1]
- movdqa xmm2, [rdx + CPUMCTX.fpu + X86FXSTATE.aXMM + 16*2]
- movdqa xmm3, [rdx + CPUMCTX.fpu + X86FXSTATE.aXMM + 16*3]
- movdqa xmm4, [rdx + CPUMCTX.fpu + X86FXSTATE.aXMM + 16*4]
- movdqa xmm5, [rdx + CPUMCTX.fpu + X86FXSTATE.aXMM + 16*5]
- movdqa xmm6, [rdx + CPUMCTX.fpu + X86FXSTATE.aXMM + 16*6]
- movdqa xmm7, [rdx + CPUMCTX.fpu + X86FXSTATE.aXMM + 16*7]
-
- test qword [rdx + CPUMCTX.msrEFER], MSR_K6_EFER_LMA
- jz .sixtyfourbit_done
-
- movdqa xmm8, [rdx + CPUMCTX.fpu + X86FXSTATE.aXMM + 16*8]
- movdqa xmm9, [rdx + CPUMCTX.fpu + X86FXSTATE.aXMM + 16*9]
- movdqa xmm10, [rdx + CPUMCTX.fpu + X86FXSTATE.aXMM + 16*10]
- movdqa xmm11, [rdx + CPUMCTX.fpu + X86FXSTATE.aXMM + 16*11]
- movdqa xmm12, [rdx + CPUMCTX.fpu + X86FXSTATE.aXMM + 16*12]
- movdqa xmm13, [rdx + CPUMCTX.fpu + X86FXSTATE.aXMM + 16*13]
- movdqa xmm14, [rdx + CPUMCTX.fpu + X86FXSTATE.aXMM + 16*14]
- movdqa xmm15, [rdx + CPUMCTX.fpu + X86FXSTATE.aXMM + 16*15]
-.sixtyfourbit_done:
- jmp far [.fpret wrt rip]
-.fpret: ; 16:32 Pointer to .the_end.
- dd .done, NAME(SUPR0AbsKernelCS)
-BITS 32
-%endif
ENDPROC cpumR0LoadXMM
@@ -235,13 +146,6 @@ BEGINPROC cpumR0SaveXMM
%else
mov xDX, dword [esp + 4]
%endif
-%ifdef VBOX_WITH_HYBRID_32BIT_KERNEL
- cmp byte [NAME(g_fCPUMIs64bitHost)], 0
- jz .legacy_mode
- db 0xea ; jmp far .sixtyfourbit_mode
- dd .sixtyfourbit_mode, NAME(SUPR0Abs64bitKernelCS)
-.legacy_mode:
-%endif ; VBOX_WITH_HYBRID_32BIT_KERNEL
movdqa [xDX + CPUMCTX.fpu + X86FXSTATE.aXMM + 16*0], xmm0
movdqa [xDX + CPUMCTX.fpu + X86FXSTATE.aXMM + 16*1], xmm1
@@ -264,44 +168,10 @@ BEGINPROC cpumR0SaveXMM
movdqa [xDX + CPUMCTX.fpu + X86FXSTATE.aXMM + 16*13], xmm13
movdqa [xDX + CPUMCTX.fpu + X86FXSTATE.aXMM + 16*14], xmm14
movdqa [xDX + CPUMCTX.fpu + X86FXSTATE.aXMM + 16*15], xmm15
-
%endif
+
.done:
ret
-
-%ifdef VBOX_WITH_HYBRID_32BIT_KERNEL_IN_R0
-ALIGNCODE(16)
-BITS 64
-.sixtyfourbit_mode:
- and edx, 0ffffffffh
-
- movdqa [rdx + CPUMCTX.fpu + X86FXSTATE.aXMM + 16*0], xmm0
- movdqa [rdx + CPUMCTX.fpu + X86FXSTATE.aXMM + 16*1], xmm1
- movdqa [rdx + CPUMCTX.fpu + X86FXSTATE.aXMM + 16*2], xmm2
- movdqa [rdx + CPUMCTX.fpu + X86FXSTATE.aXMM + 16*3], xmm3
- movdqa [rdx + CPUMCTX.fpu + X86FXSTATE.aXMM + 16*4], xmm4
- movdqa [rdx + CPUMCTX.fpu + X86FXSTATE.aXMM + 16*5], xmm5
- movdqa [rdx + CPUMCTX.fpu + X86FXSTATE.aXMM + 16*6], xmm6
- movdqa [rdx + CPUMCTX.fpu + X86FXSTATE.aXMM + 16*7], xmm7
-
- test qword [rdx + CPUMCTX.msrEFER], MSR_K6_EFER_LMA
- jz .sixtyfourbit_done
-
- movdqa [rdx + CPUMCTX.fpu + X86FXSTATE.aXMM + 16*8], xmm8
- movdqa [rdx + CPUMCTX.fpu + X86FXSTATE.aXMM + 16*9], xmm9
- movdqa [rdx + CPUMCTX.fpu + X86FXSTATE.aXMM + 16*10], xmm10
- movdqa [rdx + CPUMCTX.fpu + X86FXSTATE.aXMM + 16*11], xmm11
- movdqa [rdx + CPUMCTX.fpu + X86FXSTATE.aXMM + 16*12], xmm12
- movdqa [rdx + CPUMCTX.fpu + X86FXSTATE.aXMM + 16*13], xmm13
- movdqa [rdx + CPUMCTX.fpu + X86FXSTATE.aXMM + 16*14], xmm14
- movdqa [rdx + CPUMCTX.fpu + X86FXSTATE.aXMM + 16*15], xmm15
-
-.sixtyfourbit_done:
- jmp far [.fpret wrt rip]
-.fpret: ; 16:32 Pointer to .the_end.
- dd .done, NAME(SUPR0AbsKernelCS)
-BITS 32
-%endif
ENDPROC cpumR0SaveXMM
diff --git a/src/VBox/VMM/VMMR0/GIMR0.cpp b/src/VBox/VMM/VMMR0/GIMR0.cpp
index ce35903..cf82b9d 100644
--- a/src/VBox/VMM/VMMR0/GIMR0.cpp
+++ b/src/VBox/VMM/VMMR0/GIMR0.cpp
@@ -15,9 +15,10 @@
* hope that it will be useful, but WITHOUT ANY WARRANTY of any kind.
*/
-/*******************************************************************************
-* Header Files *
-*******************************************************************************/
+
+/*********************************************************************************************************************************
+* Header Files *
+*********************************************************************************************************************************/
#define LOG_GROUP LOG_GROUP_GIM
#include "GIMInternal.h"
#include "GIMHvInternal.h"
diff --git a/src/VBox/VMM/VMMR0/GIMR0Hv.cpp b/src/VBox/VMM/VMMR0/GIMR0Hv.cpp
index e6040f7..44b1a36 100644
--- a/src/VBox/VMM/VMMR0/GIMR0Hv.cpp
+++ b/src/VBox/VMM/VMMR0/GIMR0Hv.cpp
@@ -15,9 +15,10 @@
* hope that it will be useful, but WITHOUT ANY WARRANTY of any kind.
*/
-/*******************************************************************************
-* Header Files *
-*******************************************************************************/
+
+/*********************************************************************************************************************************
+* Header Files *
+*********************************************************************************************************************************/
#define LOG_GROUP LOG_GROUP_GIM
#include "GIMInternal.h"
#include "GIMHvInternal.h"
diff --git a/src/VBox/VMM/VMMR0/GIMR0Kvm.cpp b/src/VBox/VMM/VMMR0/GIMR0Kvm.cpp
index 28f8e64..b3171b2 100644
--- a/src/VBox/VMM/VMMR0/GIMR0Kvm.cpp
+++ b/src/VBox/VMM/VMMR0/GIMR0Kvm.cpp
@@ -15,9 +15,10 @@
* hope that it will be useful, but WITHOUT ANY WARRANTY of any kind.
*/
-/*******************************************************************************
-* Header Files *
-*******************************************************************************/
+
+/*********************************************************************************************************************************
+* Header Files *
+*********************************************************************************************************************************/
#define LOG_GROUP LOG_GROUP_GIM
#include "GIMInternal.h"
#include "GIMKvmInternal.h"
diff --git a/src/VBox/VMM/VMMR0/GMMR0.cpp b/src/VBox/VMM/VMMR0/GMMR0.cpp
index 83737b0..7089ee3 100644
--- a/src/VBox/VMM/VMMR0/GMMR0.cpp
+++ b/src/VBox/VMM/VMMR0/GMMR0.cpp
@@ -146,9 +146,9 @@
*/
-/*******************************************************************************
-* Header Files *
-*******************************************************************************/
+/*********************************************************************************************************************************
+* Header Files *
+*********************************************************************************************************************************/
#define LOG_GROUP LOG_GROUP_GMM
#include <VBox/rawpci.h>
#include <VBox/vmm/vm.h>
@@ -174,9 +174,9 @@
#include <iprt/time.h>
-/*******************************************************************************
-* Defined Constants And Macros *
-*******************************************************************************/
+/*********************************************************************************************************************************
+* Defined Constants And Macros *
+*********************************************************************************************************************************/
/** @def VBOX_USE_CRIT_SECT_FOR_GIANT
* Use a critical section instead of a fast mutex for the giant GMM lock.
*
@@ -187,9 +187,9 @@
#endif
-/*******************************************************************************
-* Structures and Typedefs *
-*******************************************************************************/
+/*********************************************************************************************************************************
+* Structures and Typedefs *
+*********************************************************************************************************************************/
/** Pointer to set of free chunks. */
typedef struct GMMCHUNKFREESET *PGMMCHUNKFREESET;
@@ -648,9 +648,9 @@ typedef struct GMMFINDDUPPAGEINFO
} GMMFINDDUPPAGEINFO;
-/*******************************************************************************
-* Global Variables *
-*******************************************************************************/
+/*********************************************************************************************************************************
+* Global Variables *
+*********************************************************************************************************************************/
/** Pointer to the GMM instance data. */
static PGMM g_pGMM = NULL;
@@ -728,9 +728,9 @@ static PGMM g_pGMM = NULL;
#endif
-/*******************************************************************************
-* Internal Functions *
-*******************************************************************************/
+/*********************************************************************************************************************************
+* Internal Functions *
+*********************************************************************************************************************************/
static DECLCALLBACK(int) gmmR0TermDestroyChunk(PAVLU32NODECORE pNode, void *pvGMM);
static bool gmmR0CleanupVMScanChunk(PGMM pGMM, PGVM pGVM, PGMMCHUNK pChunk);
DECLINLINE(void) gmmR0UnlinkChunk(PGMMCHUNK pChunk);
diff --git a/src/VBox/VMM/VMMR0/GVMMR0.cpp b/src/VBox/VMM/VMMR0/GVMMR0.cpp
index 4e52280..4b868fb 100644
--- a/src/VBox/VMM/VMMR0/GVMMR0.cpp
+++ b/src/VBox/VMM/VMMR0/GVMMR0.cpp
@@ -46,9 +46,9 @@
*/
-/*******************************************************************************
-* Header Files *
-*******************************************************************************/
+/*********************************************************************************************************************************
+* Header Files *
+*********************************************************************************************************************************/
#define LOG_GROUP LOG_GROUP_GVMM
#include <VBox/vmm/gvmm.h>
#include <VBox/vmm/gmm.h>
@@ -81,9 +81,9 @@
#include "dtrace/VBoxVMM.h"
-/*******************************************************************************
-* Defined Constants And Macros *
-*******************************************************************************/
+/*********************************************************************************************************************************
+* Defined Constants And Macros *
+*********************************************************************************************************************************/
#if defined(RT_OS_LINUX) || defined(RT_OS_SOLARIS) || defined(DOXYGEN_RUNNING)
/** Define this to enable the periodic preemption timer. */
# define GVMM_SCHED_WITH_PPT
@@ -137,9 +137,9 @@
-/*******************************************************************************
-* Structures and Typedefs *
-*******************************************************************************/
+/*********************************************************************************************************************************
+* Structures and Typedefs *
+*********************************************************************************************************************************/
/**
* Global VM handle.
@@ -310,9 +310,9 @@ typedef GVMM *PGVMM;
-/*******************************************************************************
-* Global Variables *
-*******************************************************************************/
+/*********************************************************************************************************************************
+* Global Variables *
+*********************************************************************************************************************************/
/** Pointer to the GVMM instance data.
* (Just my general dislike for global variables.) */
static PGVMM g_pGVMM = NULL;
@@ -344,9 +344,9 @@ static PGVMM g_pGVMM = NULL;
} while (0)
-/*******************************************************************************
-* Internal Functions *
-*******************************************************************************/
+/*********************************************************************************************************************************
+* Internal Functions *
+*********************************************************************************************************************************/
static void gvmmR0InitPerVMData(PGVM pGVM);
static DECLCALLBACK(void) gvmmR0HandleObjDestructor(void *pvObj, void *pvGVMM, void *pvHandle);
static int gvmmR0ByVM(PVM pVM, PGVM *ppGVM, PGVMM *ppGVMM, bool fTakeUsedLock);
diff --git a/src/VBox/VMM/VMMR0/HMR0.cpp b/src/VBox/VMM/VMMR0/HMR0.cpp
index b5fa90e..071ced0 100644
--- a/src/VBox/VMM/VMMR0/HMR0.cpp
+++ b/src/VBox/VMM/VMMR0/HMR0.cpp
@@ -15,9 +15,10 @@
* hope that it will be useful, but WITHOUT ANY WARRANTY of any kind.
*/
-/*******************************************************************************
-* Header Files *
-*******************************************************************************/
+
+/*********************************************************************************************************************************
+* Header Files *
+*********************************************************************************************************************************/
#define LOG_GROUP LOG_GROUP_HM
#include <VBox/vmm/hm.h>
#include <VBox/vmm/pgm.h>
@@ -44,9 +45,9 @@
#include "HMSVMR0.h"
-/*******************************************************************************
-* Internal Functions *
-*******************************************************************************/
+/*********************************************************************************************************************************
+* Internal Functions *
+*********************************************************************************************************************************/
static DECLCALLBACK(void) hmR0EnableCpuCallback(RTCPUID idCpu, void *pvUser1, void *pvUser2);
static DECLCALLBACK(void) hmR0DisableCpuCallback(RTCPUID idCpu, void *pvUser1, void *pvUser2);
static DECLCALLBACK(void) hmR0InitIntelCpu(RTCPUID idCpu, void *pvUser1, void *pvUser2);
@@ -55,9 +56,9 @@ static DECLCALLBACK(void) hmR0PowerCallback(RTPOWEREVENT enmEvent, void *pvUser)
static DECLCALLBACK(void) hmR0MpEventCallback(RTMPEVENT enmEvent, RTCPUID idCpu, void *pvData);
-/*******************************************************************************
-* Structures and Typedefs *
-*******************************************************************************/
+/*********************************************************************************************************************************
+* Structures and Typedefs *
+*********************************************************************************************************************************/
/**
* This is used to manage the status code of a RTMpOnAll in HM.
*/
@@ -72,9 +73,9 @@ typedef struct HMR0FIRSTRC
typedef HMR0FIRSTRC *PHMR0FIRSTRC;
-/*******************************************************************************
-* Global Variables *
-*******************************************************************************/
+/*********************************************************************************************************************************
+* Global Variables *
+*********************************************************************************************************************************/
/**
* Global data.
*/
@@ -1491,7 +1492,7 @@ VMMR0_INT_DECL(int) HMR0RunGuestCode(PVM pVM, PVMCPU pVCpu)
return rc;
}
-#if HC_ARCH_BITS == 32 && defined(VBOX_ENABLE_64_BITS_GUESTS) && !defined(VBOX_WITH_HYBRID_32BIT_KERNEL)
+#if HC_ARCH_BITS == 32 && defined(VBOX_ENABLE_64_BITS_GUESTS)
/**
* Save guest FPU/XMM state (64 bits guest mode & 32 bits host only)
@@ -1550,7 +1551,7 @@ VMMR0_INT_DECL(int) HMR0TestSwitcher3264(PVM pVM)
return rc;
}
-#endif /* HC_ARCH_BITS == 32 && defined(VBOX_WITH_64_BITS_GUESTS) && !defined(VBOX_WITH_HYBRID_32BIT_KERNEL) */
+#endif /* HC_ARCH_BITS == 32 && defined(VBOX_WITH_64_BITS_GUESTS) */
/**
* Returns suspend status of the host.
diff --git a/src/VBox/VMM/VMMR0/HMR0A.asm b/src/VBox/VMM/VMMR0/HMR0A.asm
index 486e26e..6f5a484 100644
--- a/src/VBox/VMM/VMMR0/HMR0A.asm
+++ b/src/VBox/VMM/VMMR0/HMR0A.asm
@@ -15,9 +15,9 @@
; hope that it will be useful, but WITHOUT ANY WARRANTY of any kind.
;
-;*******************************************************************************
-;* Header Files *
-;*******************************************************************************
+;*********************************************************************************************************************************
+;* Header Files *
+;*********************************************************************************************************************************
%include "VBox/asmdefs.mac"
%include "VBox/err.mac"
%include "VBox/vmm/hm_vmx.mac"
@@ -42,33 +42,30 @@
%endmacro
%endif
-;*******************************************************************************
-;* Defined Constants And Macros *
-;*******************************************************************************
-%ifdef RT_ARCH_AMD64
- %define MAYBE_64_BIT
-%endif
-%ifdef VBOX_WITH_HYBRID_32BIT_KERNEL
- %define MAYBE_64_BIT
-%else
- %ifdef RT_OS_DARWIN
- %ifdef RT_ARCH_AMD64
- ;;
- ; Load the NULL selector into DS, ES, FS and GS on 64-bit darwin so we don't
- ; risk loading a stale LDT value or something invalid.
- %define HM_64_BIT_USE_NULL_SEL
- %endif
- %endif
-%endif
-
-%ifdef RT_ARCH_AMD64
- %define VBOX_SKIP_RESTORE_SEG
-%endif
-
+;*********************************************************************************************************************************
+;* Defined Constants And Macros *
+;*********************************************************************************************************************************
;; The offset of the XMM registers in X86FXSTATE.
; Use define because I'm too lazy to convert the struct.
%define XMM_OFF_IN_X86FXSTATE 160
+;;
+; Determine skipping restoring of GDTR, IDTR, TR across VMX non-root operation
+;
+%ifdef RT_ARCH_AMD64
+ %define VMX_SKIP_GDTR
+ %define VMX_SKIP_TR
+ %define VBOX_SKIP_RESTORE_SEG
+ %ifdef RT_OS_DARWIN
+ ; Load the NULL selector into DS, ES, FS and GS on 64-bit darwin so we don't
+ ; risk loading a stale LDT value or something invalid.
+ %define HM_64_BIT_USE_NULL_SEL
+ ; Darwin (Mavericks) uses IDTR limit to store the CPU Id so we need to restore it always.
+ ; See @bugref{6875}.
+ %else
+ %define VMX_SKIP_IDTR
+ %endif
+%endif
;; @def MYPUSHAD
; Macro generating an equivalent to pushad
@@ -215,33 +212,24 @@
pop ds
%endmacro
-
-;*******************************************************************************
-;* External Symbols *
-;*******************************************************************************
-%ifdef VBOX_WITH_HYBRID_32BIT_KERNEL
-extern NAME(SUPR0AbsIs64bit)
-extern NAME(SUPR0Abs64bitKernelCS)
-extern NAME(SUPR0Abs64bitKernelSS)
-extern NAME(SUPR0Abs64bitKernelDS)
-extern NAME(SUPR0AbsKernelCS)
-%endif
-%ifdef VBOX_WITH_KERNEL_USING_XMM
-extern NAME(CPUMIsGuestFPUStateActive)
+%ifdef RT_ARCH_AMD64
+ %define MYPUSHAD MYPUSHAD64
+ %define MYPOPAD MYPOPAD64
+ %define MYPUSHSEGS MYPUSHSEGS64
+ %define MYPOPSEGS MYPOPSEGS64
+%else
+ %define MYPUSHAD MYPUSHAD32
+ %define MYPOPAD MYPOPAD32
+ %define MYPUSHSEGS MYPUSHSEGS32
+ %define MYPOPSEGS MYPOPSEGS32
%endif
-;*******************************************************************************
-;* Global Variables *
-;*******************************************************************************
-%ifdef VBOX_WITH_HYBRID_32BIT_KERNEL
-BEGINDATA
-;;
-; Store the SUPR0AbsIs64bit absolute value here so we can cmp/test without
-; needing to clobber a register. (This trick doesn't quite work for PE btw.
-; but that's not relevant atm.)
-GLOBALNAME g_fVMXIs64bitHost
- dd NAME(SUPR0AbsIs64bit)
+;*********************************************************************************************************************************
+;* External Symbols *
+;*********************************************************************************************************************************
+%ifdef VBOX_WITH_KERNEL_USING_XMM
+extern NAME(CPUMIsGuestFPUStateActive)
%endif
@@ -394,13 +382,6 @@ BEGINPROC VMXWriteVmcs64
%else ; RT_ARCH_X86
mov ecx, [esp + 4] ; idxField
lea edx, [esp + 8] ; &u64Data
- %ifdef VBOX_WITH_HYBRID_32BIT_KERNEL
- cmp byte [NAME(g_fVMXIs64bitHost)], 0
- jz .legacy_mode
- db 0xea ; jmp far .sixtyfourbit_mode
- dd .sixtyfourbit_mode, NAME(SUPR0Abs64bitKernelCS)
-.legacy_mode:
- %endif ; VBOX_WITH_HYBRID_32BIT_KERNEL
vmwrite ecx, [edx] ; low dword
jz .done
jc .done
@@ -417,24 +398,6 @@ BEGINPROC VMXWriteVmcs64
mov eax, VERR_VMX_INVALID_VMCS_FIELD
.the_end:
ret
-
-%ifdef VBOX_WITH_HYBRID_32BIT_KERNEL
-ALIGNCODE(16)
-BITS 64
-.sixtyfourbit_mode:
- and edx, 0ffffffffh
- and ecx, 0ffffffffh
- xor eax, eax
- vmwrite rcx, [rdx]
- mov r8d, VERR_VMX_INVALID_VMCS_FIELD
- cmovz eax, r8d
- mov r9d, VERR_VMX_INVALID_VMCS_PTR
- cmovc eax, r9d
- jmp far [.fpret wrt rip]
-.fpret: ; 16:32 Pointer to .the_end.
- dd .the_end, NAME(SUPR0AbsKernelCS)
-BITS 32
-%endif ; VBOX_WITH_HYBRID_32BIT_KERNEL
ENDPROC VMXWriteVmcs64
@@ -461,13 +424,6 @@ BEGINPROC VMXReadVmcs64
%else ; RT_ARCH_X86
mov ecx, [esp + 4] ; idxField
mov edx, [esp + 8] ; pData
- %ifdef VBOX_WITH_HYBRID_32BIT_KERNEL
- cmp byte [NAME(g_fVMXIs64bitHost)], 0
- jz .legacy_mode
- db 0xea ; jmp far .sixtyfourbit_mode
- dd .sixtyfourbit_mode, NAME(SUPR0Abs64bitKernelCS)
-.legacy_mode:
- %endif ; VBOX_WITH_HYBRID_32BIT_KERNEL
vmread [edx], ecx ; low dword
jz .done
jc .done
@@ -484,24 +440,6 @@ BEGINPROC VMXReadVmcs64
mov eax, VERR_VMX_INVALID_VMCS_FIELD
.the_end:
ret
-
-%ifdef VBOX_WITH_HYBRID_32BIT_KERNEL
-ALIGNCODE(16)
-BITS 64
-.sixtyfourbit_mode:
- and edx, 0ffffffffh
- and ecx, 0ffffffffh
- xor eax, eax
- vmread [rdx], rcx
- mov r8d, VERR_VMX_INVALID_VMCS_FIELD
- cmovz eax, r8d
- mov r9d, VERR_VMX_INVALID_VMCS_PTR
- cmovc eax, r9d
- jmp far [.fpret wrt rip]
-.fpret: ; 16:32 Pointer to .the_end.
- dd .the_end, NAME(SUPR0AbsKernelCS)
-BITS 32
-%endif ; VBOX_WITH_HYBRID_32BIT_KERNEL
ENDPROC VMXReadVmcs64
@@ -530,13 +468,6 @@ BEGINPROC VMXReadVmcs32
%else ; RT_ARCH_X86
mov ecx, [esp + 4] ; idxField
mov edx, [esp + 8] ; pu32Data
- %ifdef VBOX_WITH_HYBRID_32BIT_KERNEL
- cmp byte [NAME(g_fVMXIs64bitHost)], 0
- jz .legacy_mode
- db 0xea ; jmp far .sixtyfourbit_mode
- dd .sixtyfourbit_mode, NAME(SUPR0Abs64bitKernelCS)
-.legacy_mode:
- %endif ; VBOX_WITH_HYBRID_32BIT_KERNEL
xor eax, eax
vmread [edx], ecx
%endif ; RT_ARCH_X86
@@ -548,25 +479,6 @@ BEGINPROC VMXReadVmcs32
mov eax, VERR_VMX_INVALID_VMCS_FIELD
.the_end:
ret
-
-%ifdef VBOX_WITH_HYBRID_32BIT_KERNEL
-ALIGNCODE(16)
-BITS 64
-.sixtyfourbit_mode:
- and edx, 0ffffffffh
- and ecx, 0ffffffffh
- xor eax, eax
- vmread r10, rcx
- mov [rdx], r10d
- mov r8d, VERR_VMX_INVALID_VMCS_FIELD
- cmovz eax, r8d
- mov r9d, VERR_VMX_INVALID_VMCS_PTR
- cmovc eax, r9d
- jmp far [.fpret wrt rip]
-.fpret: ; 16:32 Pointer to .the_end.
- dd .the_end, NAME(SUPR0AbsKernelCS)
-BITS 32
-%endif ; VBOX_WITH_HYBRID_32BIT_KERNEL
ENDPROC VMXReadVmcs32
@@ -595,13 +507,6 @@ BEGINPROC VMXWriteVmcs32
%else ; RT_ARCH_X86
mov ecx, [esp + 4] ; idxField
mov edx, [esp + 8] ; u32Data
- %ifdef VBOX_WITH_HYBRID_32BIT_KERNEL
- cmp byte [NAME(g_fVMXIs64bitHost)], 0
- jz .legacy_mode
- db 0xea ; jmp far .sixtyfourbit_mode
- dd .sixtyfourbit_mode, NAME(SUPR0Abs64bitKernelCS)
-.legacy_mode:
- %endif ; VBOX_WITH_HYBRID_32BIT_KERNEL
xor eax, eax
vmwrite ecx, edx
%endif ; RT_ARCH_X86
@@ -613,24 +518,6 @@ BEGINPROC VMXWriteVmcs32
mov eax, VERR_VMX_INVALID_VMCS_FIELD
.the_end:
ret
-
-%ifdef VBOX_WITH_HYBRID_32BIT_KERNEL
-ALIGNCODE(16)
-BITS 64
-.sixtyfourbit_mode:
- and edx, 0ffffffffh
- and ecx, 0ffffffffh
- xor eax, eax
- vmwrite rcx, rdx
- mov r8d, VERR_VMX_INVALID_VMCS_FIELD
- cmovz eax, r8d
- mov r9d, VERR_VMX_INVALID_VMCS_PTR
- cmovc eax, r9d
- jmp far [.fpret wrt rip]
-.fpret: ; 16:32 Pointer to .the_end.
- dd .the_end, NAME(SUPR0AbsKernelCS)
-BITS 32
-%endif ; VBOX_WITH_HYBRID_32BIT_KERNEL
ENDPROC VMXWriteVmcs32
@@ -651,13 +538,6 @@ BEGINPROC VMXEnable
%endif
vmxon [rsp]
%else ; RT_ARCH_X86
- %ifdef VBOX_WITH_HYBRID_32BIT_KERNEL
- cmp byte [NAME(g_fVMXIs64bitHost)], 0
- jz .legacy_mode
- db 0xea ; jmp far .sixtyfourbit_mode
- dd .sixtyfourbit_mode, NAME(SUPR0Abs64bitKernelCS)
-.legacy_mode:
- %endif ; VBOX_WITH_HYBRID_32BIT_KERNEL
xor eax, eax
vmxon [esp + 4]
%endif ; RT_ARCH_X86
@@ -674,24 +554,6 @@ BEGINPROC VMXEnable
add rsp, 8
%endif
ret
-
-%ifdef VBOX_WITH_HYBRID_32BIT_KERNEL
-ALIGNCODE(16)
-BITS 64
-.sixtyfourbit_mode:
- lea rdx, [rsp + 4] ; &HCPhysVMXOn.
- and edx, 0ffffffffh
- xor eax, eax
- vmxon [rdx]
- mov r8d, VERR_VMX_VMXON_FAILED
- cmovz eax, r8d
- mov r9d, VERR_VMX_INVALID_VMXON_PTR
- cmovc eax, r9d
- jmp far [.fpret wrt rip]
-.fpret: ; 16:32 Pointer to .the_end.
- dd .the_end, NAME(SUPR0AbsKernelCS)
-BITS 32
-%endif ; VBOX_WITH_HYBRID_32BIT_KERNEL
ENDPROC VMXEnable
@@ -700,27 +562,9 @@ ENDPROC VMXEnable
; */
;DECLASM(void) VMXDisable(void);
BEGINPROC VMXDisable
-%ifdef VBOX_WITH_HYBRID_32BIT_KERNEL
- cmp byte [NAME(g_fVMXIs64bitHost)], 0
- jz .legacy_mode
- db 0xea ; jmp far .sixtyfourbit_mode
- dd .sixtyfourbit_mode, NAME(SUPR0Abs64bitKernelCS)
-.legacy_mode:
-%endif ; VBOX_WITH_HYBRID_32BIT_KERNEL
vmxoff
.the_end:
ret
-
-%ifdef VBOX_WITH_HYBRID_32BIT_KERNEL
-ALIGNCODE(16)
-BITS 64
-.sixtyfourbit_mode:
- vmxoff
- jmp far [.fpret wrt rip]
-.fpret: ; 16:32 Pointer to .the_end.
- dd .the_end, NAME(SUPR0AbsKernelCS)
-BITS 32
-%endif ; VBOX_WITH_HYBRID_32BIT_KERNEL
ENDPROC VMXDisable
@@ -742,13 +586,6 @@ BEGINPROC VMXClearVmcs
%endif
vmclear [rsp]
%else ; RT_ARCH_X86
- %ifdef VBOX_WITH_HYBRID_32BIT_KERNEL
- cmp byte [NAME(g_fVMXIs64bitHost)], 0
- jz .legacy_mode
- db 0xea ; jmp far .sixtyfourbit_mode
- dd .sixtyfourbit_mode, NAME(SUPR0Abs64bitKernelCS)
-.legacy_mode:
- %endif ; VBOX_WITH_HYBRID_32BIT_KERNEL
xor eax, eax
vmclear [esp + 4]
%endif ; RT_ARCH_X86
@@ -759,22 +596,6 @@ BEGINPROC VMXClearVmcs
add rsp, 8
%endif
ret
-
-%ifdef VBOX_WITH_HYBRID_32BIT_KERNEL
-ALIGNCODE(16)
-BITS 64
-.sixtyfourbit_mode:
- lea rdx, [rsp + 4] ; &HCPhysVmcs
- and edx, 0ffffffffh
- xor eax, eax
- vmclear [rdx]
- mov r9d, VERR_VMX_INVALID_VMCS_PTR
- cmovc eax, r9d
- jmp far [.fpret wrt rip]
-.fpret: ; 16:32 Pointer to .the_end.
- dd .the_end, NAME(SUPR0AbsKernelCS)
-BITS 32
-%endif
ENDPROC VMXClearVmcs
@@ -796,13 +617,6 @@ BEGINPROC VMXActivateVmcs
%endif
vmptrld [rsp]
%else
- %ifdef VBOX_WITH_HYBRID_32BIT_KERNEL
- cmp byte [NAME(g_fVMXIs64bitHost)], 0
- jz .legacy_mode
- db 0xea ; jmp far .sixtyfourbit_mode
- dd .sixtyfourbit_mode, NAME(SUPR0Abs64bitKernelCS)
-.legacy_mode:
- %endif ; VBOX_WITH_HYBRID_32BIT_KERNEL
xor eax, eax
vmptrld [esp + 4]
%endif
@@ -813,22 +627,6 @@ BEGINPROC VMXActivateVmcs
add rsp, 8
%endif
ret
-
-%ifdef VBOX_WITH_HYBRID_32BIT_KERNEL
-ALIGNCODE(16)
-BITS 64
-.sixtyfourbit_mode:
- lea rdx, [rsp + 4] ; &HCPhysVmcs
- and edx, 0ffffffffh
- xor eax, eax
- vmptrld [rdx]
- mov r9d, VERR_VMX_INVALID_VMCS_PTR
- cmovc eax, r9d
- jmp far [.fpret wrt rip]
-.fpret: ; 16:32 Pointer to .the_end.
- dd .the_end, NAME(SUPR0AbsKernelCS)
-BITS 32
-%endif ; VBOX_WITH_HYBRID_32BIT_KERNEL
ENDPROC VMXActivateVmcs
@@ -851,32 +649,11 @@ BEGINPROC VMXGetActivatedVmcs
vmptrst qword [rcx]
%endif
%else
- %ifdef VBOX_WITH_HYBRID_32BIT_KERNEL
- cmp byte [NAME(g_fVMXIs64bitHost)], 0
- jz .legacy_mode
- db 0xea ; jmp far .sixtyfourbit_mode
- dd .sixtyfourbit_mode, NAME(SUPR0Abs64bitKernelCS)
-.legacy_mode:
- %endif ; VBOX_WITH_HYBRID_32BIT_KERNEL
vmptrst qword [esp+04h]
%endif
xor eax, eax
.the_end:
ret
-
- %ifdef VBOX_WITH_HYBRID_32BIT_KERNEL
-ALIGNCODE(16)
-BITS 64
-.sixtyfourbit_mode:
- lea rdx, [rsp + 4] ; &HCPhysVmcs
- and edx, 0ffffffffh
- vmptrst qword [rdx]
- xor eax, eax
- jmp far [.fpret wrt rip]
-.fpret: ; 16:32 Pointer to .the_end.
- dd .the_end, NAME(SUPR0AbsKernelCS)
-BITS 32
- %endif ; VBOX_WITH_HYBRID_32BIT_KERNEL
%endif
ENDPROC VMXGetActivatedVmcs
@@ -900,13 +677,6 @@ BEGINPROC VMXR0InvEPT
DB 0x66, 0x0F, 0x38, 0x80, 0xA
%endif
%else
- %ifdef VBOX_WITH_HYBRID_32BIT_KERNEL
- cmp byte [NAME(g_fVMXIs64bitHost)], 0
- jz .legacy_mode
- db 0xea ; jmp far .sixtyfourbit_mode
- dd .sixtyfourbit_mode, NAME(SUPR0Abs64bitKernelCS)
-.legacy_mode:
- %endif ; VBOX_WITH_HYBRID_32BIT_KERNEL
mov ecx, [esp + 4]
mov edx, [esp + 8]
xor eax, eax
@@ -921,26 +691,6 @@ BEGINPROC VMXR0InvEPT
mov eax, VERR_INVALID_PARAMETER
.the_end:
ret
-
-%ifdef VBOX_WITH_HYBRID_32BIT_KERNEL
-ALIGNCODE(16)
-BITS 64
-.sixtyfourbit_mode:
- and esp, 0ffffffffh
- mov ecx, [rsp + 4] ; enmFlush
- mov edx, [rsp + 8] ; pDescriptor
- xor eax, eax
-; invept rcx, qword [rdx]
- DB 0x66, 0x0F, 0x38, 0x80, 0xA
- mov r8d, VERR_INVALID_PARAMETER
- cmovz eax, r8d
- mov r9d, VERR_VMX_INVALID_VMCS_PTR
- cmovc eax, r9d
- jmp far [.fpret wrt rip]
-.fpret: ; 16:32 Pointer to .the_end.
- dd .the_end, NAME(SUPR0AbsKernelCS)
-BITS 32
-%endif ; VBOX_WITH_HYBRID_32BIT_KERNEL
ENDPROC VMXR0InvEPT
@@ -964,13 +714,6 @@ BEGINPROC VMXR0InvVPID
DB 0x66, 0x0F, 0x38, 0x81, 0xA
%endif
%else
- %ifdef VBOX_WITH_HYBRID_32BIT_KERNEL
- cmp byte [NAME(g_fVMXIs64bitHost)], 0
- jz .legacy_mode
- db 0xea ; jmp far .sixtyfourbit_mode
- dd .sixtyfourbit_mode, NAME(SUPR0Abs64bitKernelCS)
-.legacy_mode:
- %endif ; VBOX_WITH_HYBRID_32BIT_KERNEL
mov ecx, [esp + 4]
mov edx, [esp + 8]
xor eax, eax
@@ -985,26 +728,6 @@ BEGINPROC VMXR0InvVPID
mov eax, VERR_INVALID_PARAMETER
.the_end:
ret
-
-%ifdef VBOX_WITH_HYBRID_32BIT_KERNEL
-ALIGNCODE(16)
-BITS 64
-.sixtyfourbit_mode:
- and esp, 0ffffffffh
- mov ecx, [rsp + 4] ; enmFlush
- mov edx, [rsp + 8] ; pDescriptor
- xor eax, eax
-; invvpid rcx, qword [rdx]
- DB 0x66, 0x0F, 0x38, 0x81, 0xA
- mov r8d, VERR_INVALID_PARAMETER
- cmovz eax, r8d
- mov r9d, VERR_VMX_INVALID_VMCS_PTR
- cmovc eax, r9d
- jmp far [.fpret wrt rip]
-.fpret: ; 16:32 Pointer to .the_end.
- dd .the_end, NAME(SUPR0AbsKernelCS)
-BITS 32
-%endif ; VBOX_WITH_HYBRID_32BIT_KERNEL
ENDPROC VMXR0InvVPID
@@ -1064,61 +787,6 @@ ENDPROC SVMR0InvlpgA
%endif ; GC_ARCH_BITS != 64
-%ifdef VBOX_WITH_HYBRID_32BIT_KERNEL
-
-;/**
-; * Gets 64-bit GDTR and IDTR on darwin.
-; * @param pGdtr Where to store the 64-bit GDTR.
-; * @param pIdtr Where to store the 64-bit IDTR.
-; */
-;DECLASM(void) HMR0Get64bitGdtrAndIdtr(PX86XDTR64 pGdtr, PX86XDTR64 pIdtr);
-ALIGNCODE(16)
-BEGINPROC HMR0Get64bitGdtrAndIdtr
- db 0xea ; jmp far .sixtyfourbit_mode
- dd .sixtyfourbit_mode, NAME(SUPR0Abs64bitKernelCS)
-.the_end:
- ret
-
-ALIGNCODE(16)
-BITS 64
-.sixtyfourbit_mode:
- and esp, 0ffffffffh
- mov ecx, [rsp + 4] ; pGdtr
- mov edx, [rsp + 8] ; pIdtr
- sgdt [rcx]
- sidt [rdx]
- jmp far [.fpret wrt rip]
-.fpret: ; 16:32 Pointer to .the_end.
- dd .the_end, NAME(SUPR0AbsKernelCS)
-BITS 32
-ENDPROC HMR0Get64bitGdtrAndIdtr
-
-
-;/**
-; * Gets 64-bit CR3 on darwin.
-; * @returns CR3
-; */
-;DECLASM(uint64_t) HMR0Get64bitCR3(void);
-ALIGNCODE(16)
-BEGINPROC HMR0Get64bitCR3
- db 0xea ; jmp far .sixtyfourbit_mode
- dd .sixtyfourbit_mode, NAME(SUPR0Abs64bitKernelCS)
-.the_end:
- ret
-
-ALIGNCODE(16)
-BITS 64
-.sixtyfourbit_mode:
- mov rax, cr3
- mov rdx, rax
- shr rdx, 32
- jmp far [.fpret wrt rip]
-.fpret: ; 16:32 Pointer to .the_end.
- dd .the_end, NAME(SUPR0AbsKernelCS)
-BITS 32
-ENDPROC HMR0Get64bitCR3
-
-%endif ; VBOX_WITH_HYBRID_32BIT_KERNEL
%ifdef VBOX_WITH_KERNEL_USING_XMM
@@ -1460,237 +1128,939 @@ ENDPROC HMR0SVMRunWrapXMM
%endif ; VBOX_WITH_KERNEL_USING_XMM
+
+;; @def RESTORE_STATE_VM32
+; Macro restoring essential host state and updating guest state
+; for common host, 32-bit guest for VT-x.
+%macro RESTORE_STATE_VM32 0
+ ; Restore base and limit of the IDTR & GDTR.
+ %ifndef VMX_SKIP_IDTR
+ lidt [xSP]
+ add xSP, xCB * 2
+ %endif
+ %ifndef VMX_SKIP_GDTR
+ lgdt [xSP]
+ add xSP, xCB * 2
+ %endif
+
+ push xDI
+ %ifndef VMX_SKIP_TR
+ mov xDI, [xSP + xCB * 3] ; pCtx (*3 to skip the saved xDI, TR, LDTR).
+ %else
+ mov xDI, [xSP + xCB * 2] ; pCtx (*2 to skip the saved xDI, LDTR).
+ %endif
+
+ mov [ss:xDI + CPUMCTX.eax], eax
+ mov [ss:xDI + CPUMCTX.ebx], ebx
+ mov [ss:xDI + CPUMCTX.ecx], ecx
+ mov [ss:xDI + CPUMCTX.edx], edx
+ mov [ss:xDI + CPUMCTX.esi], esi
+ mov [ss:xDI + CPUMCTX.ebp], ebp
+ mov xAX, cr2
+ mov [ss:xDI + CPUMCTX.cr2], xAX
+
+ %ifdef RT_ARCH_AMD64
+ pop xAX ; The guest edi we pushed above.
+ mov dword [ss:xDI + CPUMCTX.edi], eax
+ %else
+ pop dword [ss:xDI + CPUMCTX.edi] ; The guest edi we pushed above.
+ %endif
+
+ %ifndef VMX_SKIP_TR
+ ; Restore TSS selector; must mark it as not busy before using ltr (!)
+ ; ASSUME that this is supposed to be 'BUSY'. (saves 20-30 ticks on the T42p)
+ ; @todo get rid of sgdt
+ pop xBX ; Saved TR
+ sub xSP, xCB * 2
+ sgdt [xSP]
+ mov xAX, xBX
+ and eax, X86_SEL_MASK_OFF_RPL ; Mask away TI and RPL bits leaving only the descriptor offset.
+ add xAX, [xSP + 2] ; eax <- GDTR.address + descriptor offset.
+ and dword [ss:xAX + 4], ~RT_BIT(9) ; Clear the busy flag in TSS desc (bits 0-7=base, bit 9=busy bit).
+ ltr bx
+ add xSP, xCB * 2
+ %endif
+
+ pop xAX ; Saved LDTR
+ %ifdef RT_ARCH_AMD64
+ cmp eax, 0
+ je %%skip_ldt_write32
+ %endif
+ lldt ax
+
+%%skip_ldt_write32:
+ add xSP, xCB ; pCtx
+
+ %ifdef VMX_USE_CACHED_VMCS_ACCESSES
+ pop xDX ; Saved pCache
+
+ ; Note! If we get here as a result of invalid VMCS pointer, all the following
+ ; vmread's will fail (only eflags.cf=1 will be set) but that shouldn't cause any
+ ; trouble only just less efficient.
+ mov ecx, [ss:xDX + VMCSCACHE.Read.cValidEntries]
+ cmp ecx, 0 ; Can't happen
+ je %%no_cached_read32
+ jmp %%cached_read32
+
+ALIGN(16)
+%%cached_read32:
+ dec xCX
+ mov eax, [ss:xDX + VMCSCACHE.Read.aField + xCX * 4]
+ vmread [ss:xDX + VMCSCACHE.Read.aFieldVal + xCX * 8], xAX
+ cmp xCX, 0
+ jnz %%cached_read32
+%%no_cached_read32:
+ %endif
+
+ ; Restore segment registers.
+ MYPOPSEGS xAX, ax
+
+ ; Restore the host XCR0 if necessary.
+ pop xCX
+ test ecx, ecx
+ jnz %%xcr0_after_skip
+ pop xAX
+ pop xDX
+ xsetbv ; ecx is already zero.
+%%xcr0_after_skip:
+
+ ; Restore general purpose registers.
+ MYPOPAD
+%endmacro
+
+
+;;
+; Prepares for and executes VMLAUNCH/VMRESUME (32 bits guest mode)
;
-; The default setup of the StartVM routines.
+; @returns VBox status code
+; @param fResume x86:[ebp+8], msc:rcx,gcc:rdi Whether to use vmlauch/vmresume.
+; @param pCtx x86:[ebp+c], msc:rdx,gcc:rsi Pointer to the guest-CPU context.
+; @param pCache x86:[ebp+10],msc:r8, gcc:rdx Pointer to the VMCS cache.
+; @param pVM x86:[ebp+14],msc:r9, gcc:rcx Pointer to the cross context VM structure.
+; @param pVCpu x86:[ebp+18],msc:[ebp+30],gcc:r8 Pointer to the cross context VMCPU structure.
;
-%ifdef VBOX_WITH_HYBRID_32BIT_KERNEL
- %define MY_NAME(name) name %+ _32
+ALIGNCODE(16)
+BEGINPROC VMXR0StartVM32
+ push xBP
+ mov xBP, xSP
+
+ pushf
+ cli
+
+ ;
+ ; Save all general purpose host registers.
+ ;
+ MYPUSHAD
+
+ ;
+ ; First we have to write some final guest CPU context registers.
+ ;
+ mov eax, VMX_VMCS_HOST_RIP
+%ifdef RT_ARCH_AMD64
+ lea r10, [.vmlaunch_done wrt rip]
+ vmwrite rax, r10
%else
- %define MY_NAME(name) name
+ mov ecx, .vmlaunch_done
+ vmwrite eax, ecx
%endif
+ ; Note: assumes success!
+
+ ;
+ ; Unify input parameter registers.
+ ;
%ifdef RT_ARCH_AMD64
- %define MYPUSHAD MYPUSHAD64
- %define MYPOPAD MYPOPAD64
- %define MYPUSHSEGS MYPUSHSEGS64
- %define MYPOPSEGS MYPOPSEGS64
+ %ifdef ASM_CALL64_GCC
+ ; fResume already in rdi
+ ; pCtx already in rsi
+ mov rbx, rdx ; pCache
+ %else
+ mov rdi, rcx ; fResume
+ mov rsi, rdx ; pCtx
+ mov rbx, r8 ; pCache
+ %endif
%else
- %define MYPUSHAD MYPUSHAD32
- %define MYPOPAD MYPOPAD32
- %define MYPUSHSEGS MYPUSHSEGS32
- %define MYPOPSEGS MYPOPSEGS32
+ mov edi, [ebp + 8] ; fResume
+ mov esi, [ebp + 12] ; pCtx
+ mov ebx, [ebp + 16] ; pCache
+%endif
+
+ ;
+ ; Save the host XCR0 and load the guest one if necessary.
+ ; Note! Trashes rdx and rcx.
+ ;
+%ifdef ASM_CALL64_MSC
+ mov rax, [xBP + 30h] ; pVCpu
+%elifdef ASM_CALL64_GCC
+ mov rax, r8 ; pVCpu
+%else
+ mov eax, [xBP + 18h] ; pVCpu
%endif
+ test byte [xAX + VMCPU.hm + HMCPU.fLoadSaveGuestXcr0], 1
+ jz .xcr0_before_skip
-%include "HMR0Mixed.mac"
+ xor ecx, ecx
+ xgetbv ; Save the host one on the stack.
+ push xDX
+ push xAX
+ mov eax, [xSI + CPUMCTX.aXcr] ; Load the guest one.
+ mov edx, [xSI + CPUMCTX.aXcr + 4]
+ xor ecx, ecx ; paranoia
+ xsetbv
-%ifdef VBOX_WITH_HYBRID_32BIT_KERNEL
- ;
- ; Write the wrapper procedures.
- ;
- ; These routines are probably being too paranoid about selector
- ; restoring, but better safe than sorry...
- ;
+ push 0 ; Indicate that we must restore XCR0 (popped into ecx, thus 0).
+ jmp .xcr0_before_done
-; DECLASM(int) VMXR0StartVM32(RTHCUINT fResume, PCPUMCTX pCtx, PVMCSCACHE pCache, PVM pVM, PVMCPU pVCpu);
-ALIGNCODE(16)
-BEGINPROC VMXR0StartVM32
- cmp byte [NAME(g_fVMXIs64bitHost)], 0
- je near NAME(VMXR0StartVM32_32)
+.xcr0_before_skip:
+ push 3fh ; indicate that we need not.
+.xcr0_before_done:
- ; stack frame
- push esi
- push edi
- push fs
- push gs
+ ;
+ ; Save segment registers.
+ ; Note! Trashes rdx & rcx, so we moved it here (amd64 case).
+ ;
+ MYPUSHSEGS xAX, ax
+
+%ifdef VMX_USE_CACHED_VMCS_ACCESSES
+ mov ecx, [xBX + VMCSCACHE.Write.cValidEntries]
+ cmp ecx, 0
+ je .no_cached_writes
+ mov edx, ecx
+ mov ecx, 0
+ jmp .cached_write
+
+ALIGN(16)
+.cached_write:
+ mov eax, [xBX + VMCSCACHE.Write.aField + xCX * 4]
+ vmwrite xAX, [xBX + VMCSCACHE.Write.aFieldVal + xCX * 8]
+ inc xCX
+ cmp xCX, xDX
+ jl .cached_write
+
+ mov dword [xBX + VMCSCACHE.Write.cValidEntries], 0
+.no_cached_writes:
+
+ ; Save the pCache pointer.
+ push xBX
+%endif
- ; jmp far .thunk64
- db 0xea
- dd .thunk64, NAME(SUPR0Abs64bitKernelCS)
+ ; Save the pCtx pointer.
+ push xSI
-ALIGNCODE(16)
-BITS 64
-.thunk64:
- sub esp, 20h
- mov edi, [rsp + 20h + 14h] ; fResume
- mov esi, [rsp + 20h + 18h] ; pCtx
- mov edx, [rsp + 20h + 1Ch] ; pCache
- mov ecx, [rsp + 20h + 20h] ; pVM
- mov r8, [rsp + 20h + 24h] ; pVCpu
- call NAME(VMXR0StartVM32_64)
- add esp, 20h
- jmp far [.fpthunk32 wrt rip]
-.fpthunk32: ; 16:32 Pointer to .thunk32.
- dd .thunk32, NAME(SUPR0AbsKernelCS)
-
-BITS 32
-ALIGNCODE(16)
-.thunk32:
- pop gs
- pop fs
- pop edi
- pop esi
+ ; Save host LDTR.
+ xor eax, eax
+ sldt ax
+ push xAX
+
+%ifndef VMX_SKIP_TR
+ ; The host TR limit is reset to 0x67; save & restore it manually.
+ str eax
+ push xAX
+%endif
+
+%ifndef VMX_SKIP_GDTR
+ ; VT-x only saves the base of the GDTR & IDTR and resets the limit to 0xffff; we must restore the limit correctly!
+ sub xSP, xCB * 2
+ sgdt [xSP]
+%endif
+%ifndef VMX_SKIP_IDTR
+ sub xSP, xCB * 2
+ sidt [xSP]
+%endif
+
+ ; Load CR2 if necessary (may be expensive as writing CR2 is a synchronizing instruction).
+ mov xBX, [xSI + CPUMCTX.cr2]
+ mov xDX, cr2
+ cmp xBX, xDX
+ je .skip_cr2_write32
+ mov cr2, xBX
+
+.skip_cr2_write32:
+ mov eax, VMX_VMCS_HOST_RSP
+ vmwrite xAX, xSP
+ ; Note: assumes success!
+ ; Don't mess with ESP anymore!!!
+
+ ; Load guest general purpose registers.
+ mov eax, [xSI + CPUMCTX.eax]
+ mov ebx, [xSI + CPUMCTX.ebx]
+ mov ecx, [xSI + CPUMCTX.ecx]
+ mov edx, [xSI + CPUMCTX.edx]
+ mov ebp, [xSI + CPUMCTX.ebp]
+
+ ; Resume or start VM?
+ cmp xDI, 0 ; fResume
+ je .vmlaunch_launch
+
+ ; Load guest edi & esi.
+ mov edi, [xSI + CPUMCTX.edi]
+ mov esi, [xSI + CPUMCTX.esi]
+
+ vmresume
+ jmp .vmlaunch_done; ; Here if vmresume detected a failure.
+
+.vmlaunch_launch:
+ ; Save guest edi & esi.
+ mov edi, [xSI + CPUMCTX.edi]
+ mov esi, [xSI + CPUMCTX.esi]
+
+ vmlaunch
+ jmp .vmlaunch_done; ; Here if vmlaunch detected a failure.
+
+ALIGNCODE(16) ;; @todo YASM BUG - this alignment is wrong on darwin, it's 1 byte off.
+.vmlaunch_done:
+ jc near .vmxstart_invalid_vmcs_ptr
+ jz near .vmxstart_start_failed
+
+ RESTORE_STATE_VM32
+ mov eax, VINF_SUCCESS
+
+.vmstart_end:
+ popf
+ pop xBP
ret
-ENDPROC VMXR0StartVM32
+.vmxstart_invalid_vmcs_ptr:
+ RESTORE_STATE_VM32
+ mov eax, VERR_VMX_INVALID_VMCS_PTR_TO_START_VM
+ jmp .vmstart_end
+
+.vmxstart_start_failed:
+ RESTORE_STATE_VM32
+ mov eax, VERR_VMX_UNABLE_TO_START_VM
+ jmp .vmstart_end
+
+ENDPROC VMXR0StartVM32
+
+
+%ifdef RT_ARCH_AMD64
+;; @def RESTORE_STATE_VM64
+; Macro restoring essential host state and updating guest state
+; for 64-bit host, 64-bit guest for VT-x.
+;
+%macro RESTORE_STATE_VM64 0
+ ; Restore base and limit of the IDTR & GDTR
+ %ifndef VMX_SKIP_IDTR
+ lidt [xSP]
+ add xSP, xCB * 2
+ %endif
+ %ifndef VMX_SKIP_GDTR
+ lgdt [xSP]
+ add xSP, xCB * 2
+ %endif
+
+ push xDI
+ %ifndef VMX_SKIP_TR
+ mov xDI, [xSP + xCB * 3] ; pCtx (*3 to skip the saved xDI, TR, LDTR)
+ %else
+ mov xDI, [xSP + xCB * 2] ; pCtx (*2 to skip the saved xDI, LDTR)
+ %endif
+
+ mov qword [xDI + CPUMCTX.eax], rax
+ mov qword [xDI + CPUMCTX.ebx], rbx
+ mov qword [xDI + CPUMCTX.ecx], rcx
+ mov qword [xDI + CPUMCTX.edx], rdx
+ mov qword [xDI + CPUMCTX.esi], rsi
+ mov qword [xDI + CPUMCTX.ebp], rbp
+ mov qword [xDI + CPUMCTX.r8], r8
+ mov qword [xDI + CPUMCTX.r9], r9
+ mov qword [xDI + CPUMCTX.r10], r10
+ mov qword [xDI + CPUMCTX.r11], r11
+ mov qword [xDI + CPUMCTX.r12], r12
+ mov qword [xDI + CPUMCTX.r13], r13
+ mov qword [xDI + CPUMCTX.r14], r14
+ mov qword [xDI + CPUMCTX.r15], r15
+ mov rax, cr2
+ mov qword [xDI + CPUMCTX.cr2], rax
+
+ pop xAX ; The guest rdi we pushed above
+ mov qword [xDI + CPUMCTX.edi], rax
+
+ %ifndef VMX_SKIP_TR
+ ; Restore TSS selector; must mark it as not busy before using ltr (!)
+ ; ASSUME that this is supposed to be 'BUSY'. (saves 20-30 ticks on the T42p).
+ ; @todo get rid of sgdt
+ pop xBX ; Saved TR
+ sub xSP, xCB * 2
+ sgdt [xSP]
+ mov xAX, xBX
+ and eax, X86_SEL_MASK_OFF_RPL ; Mask away TI and RPL bits leaving only the descriptor offset.
+ add xAX, [xSP + 2] ; eax <- GDTR.address + descriptor offset.
+ and dword [xAX + 4], ~RT_BIT(9) ; Clear the busy flag in TSS desc (bits 0-7=base, bit 9=busy bit).
+ ltr bx
+ add xSP, xCB * 2
+ %endif
+
+ pop xAX ; Saved LDTR
+ cmp eax, 0
+ je %%skip_ldt_write64
+ lldt ax
+
+%%skip_ldt_write64:
+ pop xSI ; pCtx (needed in rsi by the macros below)
+
+ %ifdef VMX_USE_CACHED_VMCS_ACCESSES
+ pop xDX ; Saved pCache
+
+ ; Note! If we get here as a result of invalid VMCS pointer, all the following
+ ; vmread's will fail (only eflags.cf=1 will be set) but that shouldn't cause any
+ ; trouble only just less efficient.
+ mov ecx, [xDX + VMCSCACHE.Read.cValidEntries]
+ cmp ecx, 0 ; Can't happen
+ je %%no_cached_read64
+ jmp %%cached_read64
+
+ALIGN(16)
+%%cached_read64:
+ dec xCX
+ mov eax, [xDX + VMCSCACHE.Read.aField + xCX * 4]
+ vmread [xDX + VMCSCACHE.Read.aFieldVal + xCX * 8], xAX
+ cmp xCX, 0
+ jnz %%cached_read64
+%%no_cached_read64:
+ %endif
-; DECLASM(int) VMXR0StartVM64(RTHCUINT fResume, PCPUMCTX pCtx, PVMCSCACHE pCache, PVM pVM, PVMCPU pVCpu);
+ ; Restore segment registers.
+ MYPOPSEGS xAX, ax
+
+ ; Restore the host XCR0 if necessary.
+ pop xCX
+ test ecx, ecx
+ jnz %%xcr0_after_skip
+ pop xAX
+ pop xDX
+ xsetbv ; ecx is already zero.
+%%xcr0_after_skip:
+
+ ; Restore general purpose registers.
+ MYPOPAD
+%endmacro
+
+
+;;
+; Prepares for and executes VMLAUNCH/VMRESUME (64 bits guest mode)
+;
+; @returns VBox status code
+; @param fResume msc:rcx, gcc:rdi Whether to use vmlauch/vmresume.
+; @param pCtx msc:rdx, gcc:rsi Pointer to the guest-CPU context.
+; @param pCache msc:r8, gcc:rdx Pointer to the VMCS cache.
+; @param pVM msc:r9, gcc:rcx Pointer to the cross context VM structure.
+; @param pVCpu msc:[ebp+30], gcc:r8 Pointer to the cross context VMCPU structure.
+;
ALIGNCODE(16)
BEGINPROC VMXR0StartVM64
- cmp byte [NAME(g_fVMXIs64bitHost)], 0
- je .not_in_long_mode
+ push xBP
+ mov xBP, xSP
- ; stack frame
- push esi
- push edi
- push fs
- push gs
+ pushf
+ cli
- ; jmp far .thunk64
- db 0xea
- dd .thunk64, NAME(SUPR0Abs64bitKernelCS)
+ ; Save all general purpose host registers.
+ MYPUSHAD
+
+ ; First we have to save some final CPU context registers.
+ lea r10, [.vmlaunch64_done wrt rip]
+ mov rax, VMX_VMCS_HOST_RIP ; Return address (too difficult to continue after VMLAUNCH?).
+ vmwrite rax, r10
+ ; Note: assumes success!
+
+ ;
+ ; Unify the input parameter registers.
+ ;
+%ifdef ASM_CALL64_GCC
+ ; fResume already in rdi
+ ; pCtx already in rsi
+ mov rbx, rdx ; pCache
+%else
+ mov rdi, rcx ; fResume
+ mov rsi, rdx ; pCtx
+ mov rbx, r8 ; pCache
+%endif
+
+ ;
+ ; Save the host XCR0 and load the guest one if necessary.
+ ; Note! Trashes rdx and rcx.
+ ;
+%ifdef ASM_CALL64_MSC
+ mov rax, [xBP + 30h] ; pVCpu
+%else
+ mov rax, r8 ; pVCpu
+%endif
+ test byte [xAX + VMCPU.hm + HMCPU.fLoadSaveGuestXcr0], 1
+ jz .xcr0_before_skip
+
+ xor ecx, ecx
+ xgetbv ; Save the host one on the stack.
+ push xDX
+ push xAX
+
+ mov eax, [xSI + CPUMCTX.aXcr] ; Load the guest one.
+ mov edx, [xSI + CPUMCTX.aXcr + 4]
+ xor ecx, ecx ; paranoia
+ xsetbv
+
+ push 0 ; Indicate that we must restore XCR0 (popped into ecx, thus 0).
+ jmp .xcr0_before_done
+
+.xcr0_before_skip:
+ push 3fh ; indicate that we need not.
+.xcr0_before_done:
+
+ ;
+ ; Save segment registers.
+ ; Note! Trashes rdx & rcx, so we moved it here (amd64 case).
+ ;
+ MYPUSHSEGS xAX, ax
+
+%ifdef VMX_USE_CACHED_VMCS_ACCESSES
+ mov ecx, [xBX + VMCSCACHE.Write.cValidEntries]
+ cmp ecx, 0
+ je .no_cached_writes
+ mov edx, ecx
+ mov ecx, 0
+ jmp .cached_write
+
+ALIGN(16)
+.cached_write:
+ mov eax, [xBX + VMCSCACHE.Write.aField + xCX * 4]
+ vmwrite xAX, [xBX + VMCSCACHE.Write.aFieldVal + xCX * 8]
+ inc xCX
+ cmp xCX, xDX
+ jl .cached_write
+
+ mov dword [xBX + VMCSCACHE.Write.cValidEntries], 0
+.no_cached_writes:
+
+ ; Save the pCache pointer.
+ push xBX
+%endif
+
+ ; Save the pCtx pointer.
+ push xSI
+
+ ; Save host LDTR.
+ xor eax, eax
+ sldt ax
+ push xAX
+
+%ifndef VMX_SKIP_TR
+ ; The host TR limit is reset to 0x67; save & restore it manually.
+ str eax
+ push xAX
+%endif
+
+%ifndef VMX_SKIP_GDTR
+ ; VT-x only saves the base of the GDTR & IDTR and resets the limit to 0xffff; we must restore the limit correctly!
+ sub xSP, xCB * 2
+ sgdt [xSP]
+%endif
+%ifndef VMX_SKIP_IDTR
+ sub xSP, xCB * 2
+ sidt [xSP]
+%endif
+
+ ; Load CR2 if necessary (may be expensive as writing CR2 is a synchronizing instruction).
+ mov rbx, qword [xSI + CPUMCTX.cr2]
+ mov rdx, cr2
+ cmp rbx, rdx
+ je .skip_cr2_write
+ mov cr2, rbx
+
+.skip_cr2_write:
+ mov eax, VMX_VMCS_HOST_RSP
+ vmwrite xAX, xSP
+ ; Note: assumes success!
+ ; Don't mess with ESP anymore!!!
+
+ ; Load guest general purpose registers.
+ mov rax, qword [xSI + CPUMCTX.eax]
+ mov rbx, qword [xSI + CPUMCTX.ebx]
+ mov rcx, qword [xSI + CPUMCTX.ecx]
+ mov rdx, qword [xSI + CPUMCTX.edx]
+ mov rbp, qword [xSI + CPUMCTX.ebp]
+ mov r8, qword [xSI + CPUMCTX.r8]
+ mov r9, qword [xSI + CPUMCTX.r9]
+ mov r10, qword [xSI + CPUMCTX.r10]
+ mov r11, qword [xSI + CPUMCTX.r11]
+ mov r12, qword [xSI + CPUMCTX.r12]
+ mov r13, qword [xSI + CPUMCTX.r13]
+ mov r14, qword [xSI + CPUMCTX.r14]
+ mov r15, qword [xSI + CPUMCTX.r15]
+
+ ; Resume or start VM?
+ cmp xDI, 0 ; fResume
+ je .vmlaunch64_launch
+
+ ; Load guest rdi & rsi.
+ mov rdi, qword [xSI + CPUMCTX.edi]
+ mov rsi, qword [xSI + CPUMCTX.esi]
+
+ vmresume
+ jmp .vmlaunch64_done; ; Here if vmresume detected a failure.
+
+.vmlaunch64_launch:
+ ; Save guest rdi & rsi.
+ mov rdi, qword [xSI + CPUMCTX.edi]
+ mov rsi, qword [xSI + CPUMCTX.esi]
+
+ vmlaunch
+ jmp .vmlaunch64_done; ; Here if vmlaunch detected a failure.
ALIGNCODE(16)
-BITS 64
-.thunk64:
- sub esp, 20h
- mov edi, [rsp + 20h + 14h] ; fResume
- mov esi, [rsp + 20h + 18h] ; pCtx
- mov edx, [rsp + 20h + 1Ch] ; pCache
- mov ecx, [rsp + 20h + 20h] ; pVM
- mov r8, [rsp + 20h + 24h] ; pVCpu
- call NAME(VMXR0StartVM64_64)
- add esp, 20h
- jmp far [.fpthunk32 wrt rip]
-.fpthunk32: ; 16:32 Pointer to .thunk32.
- dd .thunk32, NAME(SUPR0AbsKernelCS)
-
-BITS 32
-ALIGNCODE(16)
-.thunk32:
- pop gs
- pop fs
- pop edi
- pop esi
- ret
+.vmlaunch64_done:
+ jc near .vmxstart64_invalid_vmcs_ptr
+ jz near .vmxstart64_start_failed
-.not_in_long_mode:
- mov eax, VERR_PGM_UNSUPPORTED_HOST_PAGING_MODE
+ RESTORE_STATE_VM64
+ mov eax, VINF_SUCCESS
+
+.vmstart64_end:
+ popf
+ pop xBP
ret
-ENDPROC VMXR0StartVM64
-;DECLASM(int) SVMR0VMRun(RTHCPHYS pVMCBHostPhys, RTHCPHYS pVMCBPhys, PCPUMCTX pCtx, PVM pVM, PVMCPU pVCpu);
+.vmxstart64_invalid_vmcs_ptr:
+ RESTORE_STATE_VM64
+ mov eax, VERR_VMX_INVALID_VMCS_PTR_TO_START_VM
+ jmp .vmstart64_end
+
+.vmxstart64_start_failed:
+ RESTORE_STATE_VM64
+ mov eax, VERR_VMX_UNABLE_TO_START_VM
+ jmp .vmstart64_end
+ENDPROC VMXR0StartVM64
+%endif ; RT_ARCH_AMD64
+
+
+;;
+; Prepares for and executes VMRUN (32 bits guests)
+;
+; @returns VBox status code
+; @param HCPhysVMCB Physical address of host VMCB.
+; @param HCPhysVMCB Physical address of guest VMCB.
+; @param pCtx Pointer to the guest CPU-context.
+; @param pVM msc:r9, gcc:rcx Pointer to the cross context VM structure.
+; @param pVCpu msc:[rsp+28],gcc:r8 Pointer to the cross context VMCPU structure.
+;
ALIGNCODE(16)
BEGINPROC SVMR0VMRun
- cmp byte [NAME(g_fVMXIs64bitHost)], 0
- je near NAME(SVMR0VMRun_32)
+%ifdef RT_ARCH_AMD64 ; fake a cdecl stack frame
+ %ifdef ASM_CALL64_GCC
+ push r8
+ push rcx
+ push rdx
+ push rsi
+ push rdi
+ %else
+ mov rax, [rsp + 28h]
+ push rax ; pVCpu
+ push r9 ; pVM
+ push r8 ; pCtx
+ push rdx ; HCPHYSGuestVMCB
+ push rcx ; HCPhysHostVMCB
+ %endif
+ push 0
+%endif
+ push xBP
+ mov xBP, xSP
+ pushf
- ; stack frame
- push esi
- push edi
- push fs
- push gs
+ ;
+ ; Save all general purpose host registers.
+ ;
+ MYPUSHAD
+
+ ;
+ ; Load pCtx into xSI.
+ ;
+ mov xSI, [xBP + xCB * 2 + RTHCPHYS_CB * 2] ; pCtx
- ; jmp far .thunk64
- db 0xea
- dd .thunk64, NAME(SUPR0Abs64bitKernelCS)
+ ;
+ ; Save the host XCR0 and load the guest one if necessary.
+ ;
+ mov xAX, [xBP + xCB * 2 + RTHCPHYS_CB * 2 + xCB * 2] ; pVCpu
+ test byte [xAX + VMCPU.hm + HMCPU.fLoadSaveGuestXcr0], 1
+ jz .xcr0_before_skip
-ALIGNCODE(16)
-BITS 64
-.thunk64:
- sub esp, 20h
- mov rdi, [rsp + 20h + 14h] ; pVMCBHostPhys
- mov rsi, [rsp + 20h + 1Ch] ; pVMCBPhys
- mov edx, [rsp + 20h + 24h] ; pCtx
- mov ecx, [rsp + 20h + 28h] ; pVM
- mov r8d, [rsp + 20h + 2Ch] ; pVCpu
- call NAME(SVMR0VMRun_64)
- add esp, 20h
- jmp far [.fpthunk32 wrt rip]
-.fpthunk32: ; 16:32 Pointer to .thunk32.
- dd .thunk32, NAME(SUPR0AbsKernelCS)
-
-BITS 32
-ALIGNCODE(16)
-.thunk32:
- pop gs
- pop fs
- pop edi
- pop esi
+ xor ecx, ecx
+ xgetbv ; Save the host one on the stack.
+ push xDX
+ push xAX
+
+ mov xSI, [xBP + xCB * 2 + RTHCPHYS_CB * 2] ; pCtx
+ mov eax, [xSI + CPUMCTX.aXcr] ; Load the guest one.
+ mov edx, [xSI + CPUMCTX.aXcr + 4]
+ xor ecx, ecx ; paranoia
+ xsetbv
+
+ push 0 ; Indicate that we must restore XCR0 (popped into ecx, thus 0).
+ jmp .xcr0_before_done
+
+.xcr0_before_skip:
+ push 3fh ; indicate that we need not.
+.xcr0_before_done:
+
+ ;
+ ; Save guest CPU-context pointer for simplifying saving of the GPRs afterwards.
+ ;
+ push xSI
+
+ ; Save host fs, gs, sysenter msr etc.
+ mov xAX, [xBP + xCB * 2] ; pVMCBHostPhys (64 bits physical address; x86: take low dword only)
+ push xAX ; save for the vmload after vmrun
+ vmsave
+
+ ; Setup eax for VMLOAD.
+ mov xAX, [xBP + xCB * 2 + RTHCPHYS_CB] ; pVMCBPhys (64 bits physical address; take low dword only)
+
+ ; Load guest general purpose registers.
+ ; eax is loaded from the VMCB by VMRUN.
+ mov ebx, [xSI + CPUMCTX.ebx]
+ mov ecx, [xSI + CPUMCTX.ecx]
+ mov edx, [xSI + CPUMCTX.edx]
+ mov edi, [xSI + CPUMCTX.edi]
+ mov ebp, [xSI + CPUMCTX.ebp]
+ mov esi, [xSI + CPUMCTX.esi]
+
+ ; Clear the global interrupt flag & execute sti to make sure external interrupts cause a world switch.
+ clgi
+ sti
+
+ ; Load guest fs, gs, sysenter msr etc.
+ vmload
+ ; Run the VM.
+ vmrun
+
+ ; eax is in the VMCB already; we can use it here.
+
+ ; Save guest fs, gs, sysenter msr etc.
+ vmsave
+
+ ; Load host fs, gs, sysenter msr etc.
+ pop xAX ; Pushed above
+ vmload
+
+ ; Set the global interrupt flag again, but execute cli to make sure IF=0.
+ cli
+ stgi
+
+ ;
+ ; Pop the context pointer (pushed above) and save the guest GPRs (sans RSP and RAX).
+ ;
+ pop xAX
+
+ mov [ss:xAX + CPUMCTX.ebx], ebx
+ mov [ss:xAX + CPUMCTX.ecx], ecx
+ mov [ss:xAX + CPUMCTX.edx], edx
+ mov [ss:xAX + CPUMCTX.esi], esi
+ mov [ss:xAX + CPUMCTX.edi], edi
+ mov [ss:xAX + CPUMCTX.ebp], ebp
+
+ ;
+ ; Restore the host xcr0 if necessary.
+ ;
+ pop xCX
+ test ecx, ecx
+ jnz .xcr0_after_skip
+ pop xAX
+ pop xDX
+ xsetbv ; ecx is already zero.
+.xcr0_after_skip:
+
+ ;
+ ; Restore host general purpose registers.
+ ;
+ MYPOPAD
+
+ mov eax, VINF_SUCCESS
+
+ popf
+ pop xBP
+%ifdef RT_ARCH_AMD64
+ add xSP, 6*xCB
+%endif
ret
-ENDPROC SVMR0VMRun
+ENDPROC SVMR0VMRun
-; DECLASM(int) SVMR0VMRun64(RTHCPHYS pVMCBHostPhys, RTHCPHYS pVMCBPhys, PCPUMCTX pCtx, PVM pVM, PVMCPU pVCpu);
+%ifdef RT_ARCH_AMD64
+;;
+; Prepares for and executes VMRUN (64 bits guests)
+;
+; @returns VBox status code
+; @param HCPhysVMCB Physical address of host VMCB.
+; @param HCPhysVMCB Physical address of guest VMCB.
+; @param pCtx Pointer to the guest-CPU context.
+; @param pVM msc:r9, gcc:rcx Pointer to the cross context VM structure.
+; @param pVCpu msc:[rsp+28],gcc:r8 Pointer to the cross context VMCPU structure.
+;
ALIGNCODE(16)
BEGINPROC SVMR0VMRun64
- cmp byte [NAME(g_fVMXIs64bitHost)], 0
- je .not_in_long_mode
+ ; Fake a cdecl stack frame
+ %ifdef ASM_CALL64_GCC
+ push r8
+ push rcx
+ push rdx
+ push rsi
+ push rdi
+ %else
+ mov rax, [rsp + 28h]
+ push rax ; rbp + 30h pVCpu
+ push r9 ; rbp + 28h pVM
+ push r8 ; rbp + 20h pCtx
+ push rdx ; rbp + 18h HCPHYSGuestVMCB
+ push rcx ; rbp + 10h HCPhysHostVMCB
+ %endif
+ push 0 ; rbp + 08h "fake ret addr"
+ push rbp ; rbp + 00h
+ mov rbp, rsp
+ pushf
- ; stack frame
- push esi
- push edi
- push fs
- push gs
+ ; Manual save and restore:
+ ; - General purpose registers except RIP, RSP, RAX
+ ;
+ ; Trashed:
+ ; - CR2 (we don't care)
+ ; - LDTR (reset to 0)
+ ; - DRx (presumably not changed at all)
+ ; - DR7 (reset to 0x400)
+ ;
- ; jmp far .thunk64
- db 0xea
- dd .thunk64, NAME(SUPR0Abs64bitKernelCS)
+ ;
+ ; Save all general purpose host registers.
+ ;
+ MYPUSHAD
-ALIGNCODE(16)
-BITS 64
-.thunk64:
- sub esp, 20h
- mov rdi, [rsp + 20h + 14h] ; pVMCBHostPhys
- mov rsi, [rsp + 20h + 1Ch] ; pVMCBPhys
- mov edx, [rsp + 20h + 24h] ; pCtx
- mov ecx, [rsp + 20h + 28h] ; pVM
- mov r8d, [rsp + 20h + 2Ch] ; pVCpu
- call NAME(SVMR0VMRun64_64)
- add esp, 20h
- jmp far [.fpthunk32 wrt rip]
-.fpthunk32: ; 16:32 Pointer to .thunk32.
- dd .thunk32, NAME(SUPR0AbsKernelCS)
-
-BITS 32
-ALIGNCODE(16)
-.thunk32:
- pop gs
- pop fs
- pop edi
- pop esi
- ret
+ ;
+ ; Load pCtx into xSI.
+ ;
+ mov xSI, [rbp + xCB * 2 + RTHCPHYS_CB * 2]
-.not_in_long_mode:
- mov eax, VERR_PGM_UNSUPPORTED_SHADOW_PAGING_MODE
- ret
-ENDPROC SVMR0VMRun64
-
- ;
- ; Do it a second time pretending we're a 64-bit host.
- ;
- ; This *HAS* to be done at the very end of the file to avoid restoring
- ; macros. So, add new code *BEFORE* this mess.
- ;
- BITS 64
- %undef RT_ARCH_X86
- %define RT_ARCH_AMD64
- %undef ASM_CALL64_MSC
- %define ASM_CALL64_GCC
- %define xCB 8
- %define xSP rsp
- %define xBP rbp
- %define xAX rax
- %define xBX rbx
- %define xCX rcx
- %define xDX rdx
- %define xDI rdi
- %define xSI rsi
- %define MY_NAME(name) name %+ _64
- %define MYPUSHAD MYPUSHAD64
- %define MYPOPAD MYPOPAD64
- %define MYPUSHSEGS MYPUSHSEGS64
- %define MYPOPSEGS MYPOPSEGS64
+ ;
+ ; Save the host XCR0 and load the guest one if necessary.
+ ;
+ mov rax, [xBP + 30h] ; pVCpu
+ test byte [xAX + VMCPU.hm + HMCPU.fLoadSaveGuestXcr0], 1
+ jz .xcr0_before_skip
+
+ xor ecx, ecx
+ xgetbv ; Save the host one on the stack.
+ push xDX
+ push xAX
+
+ mov xSI, [xBP + xCB * 2 + RTHCPHYS_CB * 2] ; pCtx
+ mov eax, [xSI + CPUMCTX.aXcr] ; Load the guest one.
+ mov edx, [xSI + CPUMCTX.aXcr + 4]
+ xor ecx, ecx ; paranoia
+ xsetbv
+
+ push 0 ; Indicate that we must restore XCR0 (popped into ecx, thus 0).
+ jmp .xcr0_before_done
+
+.xcr0_before_skip:
+ push 3fh ; indicate that we need not.
+.xcr0_before_done:
+
+ ;
+ ; Save guest CPU-context pointer for simplifying saving of the GPRs afterwards.
+ ;
+ push rsi
- %include "HMR0Mixed.mac"
-%endif ; VBOX_WITH_HYBRID_32BIT_KERNEL
+ ;
+ ; Save host fs, gs, sysenter msr etc.
+ ;
+ mov rax, [rbp + xCB * 2] ; pVMCBHostPhys (64 bits physical address; x86: take low dword only)
+ push rax ; Save for the vmload after vmrun
+ vmsave
+
+ ; Setup eax for VMLOAD.
+ mov rax, [rbp + xCB * 2 + RTHCPHYS_CB] ; pVMCBPhys (64 bits physical address; take low dword only)
+
+ ; Load guest general purpose registers.
+ ; rax is loaded from the VMCB by VMRUN.
+ mov rbx, qword [xSI + CPUMCTX.ebx]
+ mov rcx, qword [xSI + CPUMCTX.ecx]
+ mov rdx, qword [xSI + CPUMCTX.edx]
+ mov rdi, qword [xSI + CPUMCTX.edi]
+ mov rbp, qword [xSI + CPUMCTX.ebp]
+ mov r8, qword [xSI + CPUMCTX.r8]
+ mov r9, qword [xSI + CPUMCTX.r9]
+ mov r10, qword [xSI + CPUMCTX.r10]
+ mov r11, qword [xSI + CPUMCTX.r11]
+ mov r12, qword [xSI + CPUMCTX.r12]
+ mov r13, qword [xSI + CPUMCTX.r13]
+ mov r14, qword [xSI + CPUMCTX.r14]
+ mov r15, qword [xSI + CPUMCTX.r15]
+ mov rsi, qword [xSI + CPUMCTX.esi]
+
+ ; Clear the global interrupt flag & execute sti to make sure external interrupts cause a world switch.
+ clgi
+ sti
+
+ ; Load guest fs, gs, sysenter msr etc.
+ vmload
+ ; Run the VM.
+ vmrun
+
+ ; rax is in the VMCB already; we can use it here.
+
+ ; Save guest fs, gs, sysenter msr etc.
+ vmsave
+
+ ;
+ ; Load host fs, gs, sysenter msr etc.
+ ;
+ pop rax ; pushed above
+ vmload
+
+ ;
+ ; Set the global interrupt flag again, but execute cli to make sure IF=0.
+ ;
+ cli
+ stgi
+
+ ;
+ ; Pop the context pointer (pushed above) and save the guest GPRs (sans RSP and RAX).
+ ;
+ pop rax
+
+ mov qword [rax + CPUMCTX.ebx], rbx
+ mov qword [rax + CPUMCTX.ecx], rcx
+ mov qword [rax + CPUMCTX.edx], rdx
+ mov qword [rax + CPUMCTX.esi], rsi
+ mov qword [rax + CPUMCTX.edi], rdi
+ mov qword [rax + CPUMCTX.ebp], rbp
+ mov qword [rax + CPUMCTX.r8], r8
+ mov qword [rax + CPUMCTX.r9], r9
+ mov qword [rax + CPUMCTX.r10], r10
+ mov qword [rax + CPUMCTX.r11], r11
+ mov qword [rax + CPUMCTX.r12], r12
+ mov qword [rax + CPUMCTX.r13], r13
+ mov qword [rax + CPUMCTX.r14], r14
+ mov qword [rax + CPUMCTX.r15], r15
+
+ ;
+ ; Restore the host xcr0 if necessary.
+ ;
+ pop xCX
+ test ecx, ecx
+ jnz .xcr0_after_skip
+ pop xAX
+ pop xDX
+ xsetbv ; ecx is already zero.
+.xcr0_after_skip:
+
+ ;
+ ; Restore host general purpose registers.
+ ;
+ MYPOPAD
+
+ mov eax, VINF_SUCCESS
+
+ popf
+ pop rbp
+ add rsp, 6 * xCB
+ ret
+ENDPROC SVMR0VMRun64
+%endif ; RT_ARCH_AMD64
diff --git a/src/VBox/VMM/VMMR0/HMR0Mixed.mac b/src/VBox/VMM/VMMR0/HMR0Mixed.mac
deleted file mode 100644
index e2b99fe..0000000
--- a/src/VBox/VMM/VMMR0/HMR0Mixed.mac
+++ /dev/null
@@ -1,973 +0,0 @@
-; $Id: HMR0Mixed.mac $
-;; @file
-; HM - Ring-0 Host 32/64, Guest 32/64 world-switch routines
-;
-; Darwin uses this to build two versions in the hybrid case.
-; Included by HMR0A.asm with RT_ARCH_AMD64 defined or undefined.
-;
-
-;
-; Copyright (C) 2006-2015 Oracle Corporation
-;
-; This file is part of VirtualBox Open Source Edition (OSE), as
-; available from http://www.virtualbox.org. This file is free software;
-; you can redistribute it and/or modify it under the terms of the GNU
-; General Public License (GPL) as published by the Free Software
-; Foundation, in version 2 as it comes in the "COPYING" file of the
-; VirtualBox OSE distribution. VirtualBox OSE is distributed in the
-; hope that it will be useful, but WITHOUT ANY WARRANTY of any kind.
-;
-
-
-;;
-; Keep these macro definitions in this file as it gets included and compiled
-; with RT_ARCH_AMD64 once and RT_ARCH_X86 once.
-%undef VMX_SKIP_GDTR
-%undef VMX_SKIP_IDTR
-%undef VMX_SKIP_TR
-
-%ifdef RT_ARCH_AMD64
- %define VMX_SKIP_GDTR
- %ifdef RT_OS_DARWIN
- ; Darwin (Mavericks) uses IDTR limit to store the CPU Id so we need to restore it always.
- ; See @bugref{6875}.
- %else
- %define VMX_SKIP_IDTR
- %endif
- %define VMX_SKIP_TR
-%endif
-
-;; @def RESTORE_STATE_VM32
-; Macro restoring essential host state and updating guest state
-; for common host, 32-bit guest for VT-x.
-%macro RESTORE_STATE_VM32 0
- ; Restore base and limit of the IDTR & GDTR.
- %ifndef VMX_SKIP_IDTR
- lidt [xSP]
- add xSP, xCB * 2
- %endif
- %ifndef VMX_SKIP_GDTR
- lgdt [xSP]
- add xSP, xCB * 2
- %endif
-
- push xDI
- %ifndef VMX_SKIP_TR
- mov xDI, [xSP + xCB * 3] ; pCtx (*3 to skip the saved xDI, TR, LDTR).
- %else
- mov xDI, [xSP + xCB * 2] ; pCtx (*2 to skip the saved xDI, LDTR).
- %endif
-
- mov [ss:xDI + CPUMCTX.eax], eax
- mov [ss:xDI + CPUMCTX.ebx], ebx
- mov [ss:xDI + CPUMCTX.ecx], ecx
- mov [ss:xDI + CPUMCTX.edx], edx
- mov [ss:xDI + CPUMCTX.esi], esi
- mov [ss:xDI + CPUMCTX.ebp], ebp
- mov xAX, cr2
- mov [ss:xDI + CPUMCTX.cr2], xAX
-
- %ifdef RT_ARCH_AMD64
- pop xAX ; The guest edi we pushed above.
- mov dword [ss:xDI + CPUMCTX.edi], eax
- %else
- pop dword [ss:xDI + CPUMCTX.edi] ; The guest edi we pushed above.
- %endif
-
- %ifndef VMX_SKIP_TR
- ; Restore TSS selector; must mark it as not busy before using ltr (!)
- ; ASSUME that this is supposed to be 'BUSY'. (saves 20-30 ticks on the T42p)
- ; @todo get rid of sgdt
- pop xBX ; Saved TR
- sub xSP, xCB * 2
- sgdt [xSP]
- mov xAX, xBX
- and eax, X86_SEL_MASK_OFF_RPL ; Mask away TI and RPL bits leaving only the descriptor offset.
- add xAX, [xSP + 2] ; eax <- GDTR.address + descriptor offset.
- and dword [ss:xAX + 4], ~RT_BIT(9) ; Clear the busy flag in TSS desc (bits 0-7=base, bit 9=busy bit).
- ltr bx
- add xSP, xCB * 2
- %endif
-
- pop xAX ; Saved LDTR
- %ifdef RT_ARCH_AMD64
- cmp eax, 0
- je %%skip_ldt_write32
- %endif
- lldt ax
-
-%%skip_ldt_write32:
- add xSP, xCB ; pCtx
-
- %ifdef VMX_USE_CACHED_VMCS_ACCESSES
- pop xDX ; Saved pCache
-
- ; Note! If we get here as a result of invalid VMCS pointer, all the following
- ; vmread's will fail (only eflags.cf=1 will be set) but that shouldn't cause any
- ; trouble only just less efficient.
- mov ecx, [ss:xDX + VMCSCACHE.Read.cValidEntries]
- cmp ecx, 0 ; Can't happen
- je %%no_cached_read32
- jmp %%cached_read32
-
-ALIGN(16)
-%%cached_read32:
- dec xCX
- mov eax, [ss:xDX + VMCSCACHE.Read.aField + xCX * 4]
- vmread [ss:xDX + VMCSCACHE.Read.aFieldVal + xCX * 8], xAX
- cmp xCX, 0
- jnz %%cached_read32
-%%no_cached_read32:
- %endif
-
- ; Restore segment registers.
- MYPOPSEGS xAX, ax
-
- ; Restore the host XCR0 if necessary.
- pop xCX
- test ecx, ecx
- jnz %%xcr0_after_skip
- pop xAX
- pop xDX
- xsetbv ; ecx is already zero.
-%%xcr0_after_skip:
-
- ; Restore general purpose registers.
- MYPOPAD
-%endmacro
-
-
-;;
-; Prepares for and executes VMLAUNCH/VMRESUME (32 bits guest mode)
-;
-; @returns VBox status code
-; @param fResume x86:[ebp+8], msc:rcx,gcc:rdi Whether to use vmlauch/vmresume.
-; @param pCtx x86:[ebp+c], msc:rdx,gcc:rsi Pointer to the guest-CPU context.
-; @param pCache x86:[ebp+10],msc:r8, gcc:rdx Pointer to the VMCS cache.
-; @param pVM x86:[ebp+14],msc:r9, gcc:rcx Pointer to the cross context VM structure.
-; @param pVCpu x86:[ebp+18],msc:[ebp+30],gcc:r8 Pointer to the cross context VMCPU structure.
-;
-ALIGNCODE(16)
-BEGINPROC MY_NAME(VMXR0StartVM32)
- push xBP
- mov xBP, xSP
-
- pushf
- cli
-
- ;
- ; Save all general purpose host registers.
- ;
- MYPUSHAD
-
- ;
- ; First we have to write some final guest CPU context registers.
- ;
- mov eax, VMX_VMCS_HOST_RIP
-%ifdef RT_ARCH_AMD64
- lea r10, [.vmlaunch_done wrt rip]
- vmwrite rax, r10
-%else
- mov ecx, .vmlaunch_done
- vmwrite eax, ecx
-%endif
- ; Note: assumes success!
-
- ;
- ; Unify input parameter registers.
- ;
-%ifdef RT_ARCH_AMD64
- %ifdef ASM_CALL64_GCC
- ; fResume already in rdi
- ; pCtx already in rsi
- mov rbx, rdx ; pCache
- %else
- mov rdi, rcx ; fResume
- mov rsi, rdx ; pCtx
- mov rbx, r8 ; pCache
- %endif
-%else
- mov edi, [ebp + 8] ; fResume
- mov esi, [ebp + 12] ; pCtx
- mov ebx, [ebp + 16] ; pCache
-%endif
-
- ;
- ; Save the host XCR0 and load the guest one if necessary.
- ; Note! Trashes rdx and rcx.
- ;
-%ifdef ASM_CALL64_MSC
- mov rax, [xBP + 30h] ; pVCpu
-%elifdef ASM_CALL64_GCC
- mov rax, r8 ; pVCpu
-%else
- mov eax, [xBP + 18h] ; pVCpu
-%endif
- test byte [xAX + VMCPU.hm + HMCPU.fLoadSaveGuestXcr0], 1
- jz .xcr0_before_skip
-
- xor ecx, ecx
- xgetbv ; Save the host one on the stack.
- push xDX
- push xAX
-
- mov eax, [xSI + CPUMCTX.aXcr] ; Load the guest one.
- mov edx, [xSI + CPUMCTX.aXcr + 4]
- xor ecx, ecx ; paranoia
- xsetbv
-
- push 0 ; Indicate that we must restore XCR0 (popped into ecx, thus 0).
- jmp .xcr0_before_done
-
-.xcr0_before_skip:
- push 3fh ; indicate that we need not.
-.xcr0_before_done:
-
- ;
- ; Save segment registers.
- ; Note! Trashes rdx & rcx, so we moved it here (amd64 case).
- ;
- MYPUSHSEGS xAX, ax
-
-%ifdef VMX_USE_CACHED_VMCS_ACCESSES
- mov ecx, [xBX + VMCSCACHE.Write.cValidEntries]
- cmp ecx, 0
- je .no_cached_writes
- mov edx, ecx
- mov ecx, 0
- jmp .cached_write
-
-ALIGN(16)
-.cached_write:
- mov eax, [xBX + VMCSCACHE.Write.aField + xCX * 4]
- vmwrite xAX, [xBX + VMCSCACHE.Write.aFieldVal + xCX * 8]
- inc xCX
- cmp xCX, xDX
- jl .cached_write
-
- mov dword [xBX + VMCSCACHE.Write.cValidEntries], 0
-.no_cached_writes:
-
- ; Save the pCache pointer.
- push xBX
-%endif
-
- ; Save the pCtx pointer.
- push xSI
-
- ; Save host LDTR.
- xor eax, eax
- sldt ax
- push xAX
-
-%ifndef VMX_SKIP_TR
- ; The host TR limit is reset to 0x67; save & restore it manually.
- str eax
- push xAX
-%endif
-
-%ifndef VMX_SKIP_GDTR
- ; VT-x only saves the base of the GDTR & IDTR and resets the limit to 0xffff; we must restore the limit correctly!
- sub xSP, xCB * 2
- sgdt [xSP]
-%endif
-%ifndef VMX_SKIP_IDTR
- sub xSP, xCB * 2
- sidt [xSP]
-%endif
-
- ; Load CR2 if necessary (may be expensive as writing CR2 is a synchronizing instruction).
- mov xBX, [xSI + CPUMCTX.cr2]
- mov xDX, cr2
- cmp xBX, xDX
- je .skip_cr2_write32
- mov cr2, xBX
-
-.skip_cr2_write32:
- mov eax, VMX_VMCS_HOST_RSP
- vmwrite xAX, xSP
- ; Note: assumes success!
- ; Don't mess with ESP anymore!!!
-
- ; Load guest general purpose registers.
- mov eax, [xSI + CPUMCTX.eax]
- mov ebx, [xSI + CPUMCTX.ebx]
- mov ecx, [xSI + CPUMCTX.ecx]
- mov edx, [xSI + CPUMCTX.edx]
- mov ebp, [xSI + CPUMCTX.ebp]
-
- ; Resume or start VM?
- cmp xDI, 0 ; fResume
- je .vmlaunch_launch
-
- ; Load guest edi & esi.
- mov edi, [xSI + CPUMCTX.edi]
- mov esi, [xSI + CPUMCTX.esi]
-
- vmresume
- jmp .vmlaunch_done; ; Here if vmresume detected a failure.
-
-.vmlaunch_launch:
- ; Save guest edi & esi.
- mov edi, [xSI + CPUMCTX.edi]
- mov esi, [xSI + CPUMCTX.esi]
-
- vmlaunch
- jmp .vmlaunch_done; ; Here if vmlaunch detected a failure.
-
-ALIGNCODE(16) ;; @todo YASM BUG - this alignment is wrong on darwin, it's 1 byte off.
-.vmlaunch_done:
- jc near .vmxstart_invalid_vmcs_ptr
- jz near .vmxstart_start_failed
-
- RESTORE_STATE_VM32
- mov eax, VINF_SUCCESS
-
-.vmstart_end:
- popf
- pop xBP
- ret
-
-.vmxstart_invalid_vmcs_ptr:
- RESTORE_STATE_VM32
- mov eax, VERR_VMX_INVALID_VMCS_PTR_TO_START_VM
- jmp .vmstart_end
-
-.vmxstart_start_failed:
- RESTORE_STATE_VM32
- mov eax, VERR_VMX_UNABLE_TO_START_VM
- jmp .vmstart_end
-
-ENDPROC MY_NAME(VMXR0StartVM32)
-
-
-%ifdef RT_ARCH_AMD64
-;; @def RESTORE_STATE_VM64
-; Macro restoring essential host state and updating guest state
-; for 64-bit host, 64-bit guest for VT-x.
-;
-%macro RESTORE_STATE_VM64 0
- ; Restore base and limit of the IDTR & GDTR
- %ifndef VMX_SKIP_IDTR
- lidt [xSP]
- add xSP, xCB * 2
- %endif
- %ifndef VMX_SKIP_GDTR
- lgdt [xSP]
- add xSP, xCB * 2
- %endif
-
- push xDI
- %ifndef VMX_SKIP_TR
- mov xDI, [xSP + xCB * 3] ; pCtx (*3 to skip the saved xDI, TR, LDTR)
- %else
- mov xDI, [xSP + xCB * 2] ; pCtx (*2 to skip the saved xDI, LDTR)
- %endif
-
- mov qword [xDI + CPUMCTX.eax], rax
- mov qword [xDI + CPUMCTX.ebx], rbx
- mov qword [xDI + CPUMCTX.ecx], rcx
- mov qword [xDI + CPUMCTX.edx], rdx
- mov qword [xDI + CPUMCTX.esi], rsi
- mov qword [xDI + CPUMCTX.ebp], rbp
- mov qword [xDI + CPUMCTX.r8], r8
- mov qword [xDI + CPUMCTX.r9], r9
- mov qword [xDI + CPUMCTX.r10], r10
- mov qword [xDI + CPUMCTX.r11], r11
- mov qword [xDI + CPUMCTX.r12], r12
- mov qword [xDI + CPUMCTX.r13], r13
- mov qword [xDI + CPUMCTX.r14], r14
- mov qword [xDI + CPUMCTX.r15], r15
- mov rax, cr2
- mov qword [xDI + CPUMCTX.cr2], rax
-
- pop xAX ; The guest rdi we pushed above
- mov qword [xDI + CPUMCTX.edi], rax
-
- %ifndef VMX_SKIP_TR
- ; Restore TSS selector; must mark it as not busy before using ltr (!)
- ; ASSUME that this is supposed to be 'BUSY'. (saves 20-30 ticks on the T42p).
- ; @todo get rid of sgdt
- pop xBX ; Saved TR
- sub xSP, xCB * 2
- sgdt [xSP]
- mov xAX, xBX
- and eax, X86_SEL_MASK_OFF_RPL ; Mask away TI and RPL bits leaving only the descriptor offset.
- add xAX, [xSP + 2] ; eax <- GDTR.address + descriptor offset.
- and dword [xAX + 4], ~RT_BIT(9) ; Clear the busy flag in TSS desc (bits 0-7=base, bit 9=busy bit).
- ltr bx
- add xSP, xCB * 2
- %endif
-
- pop xAX ; Saved LDTR
- cmp eax, 0
- je %%skip_ldt_write64
- lldt ax
-
-%%skip_ldt_write64:
- pop xSI ; pCtx (needed in rsi by the macros below)
-
- %ifdef VMX_USE_CACHED_VMCS_ACCESSES
- pop xDX ; Saved pCache
-
- ; Note! If we get here as a result of invalid VMCS pointer, all the following
- ; vmread's will fail (only eflags.cf=1 will be set) but that shouldn't cause any
- ; trouble only just less efficient.
- mov ecx, [xDX + VMCSCACHE.Read.cValidEntries]
- cmp ecx, 0 ; Can't happen
- je %%no_cached_read64
- jmp %%cached_read64
-
-ALIGN(16)
-%%cached_read64:
- dec xCX
- mov eax, [xDX + VMCSCACHE.Read.aField + xCX * 4]
- vmread [xDX + VMCSCACHE.Read.aFieldVal + xCX * 8], xAX
- cmp xCX, 0
- jnz %%cached_read64
-%%no_cached_read64:
- %endif
-
- ; Restore segment registers.
- MYPOPSEGS xAX, ax
-
- ; Restore the host XCR0 if necessary.
- pop xCX
- test ecx, ecx
- jnz %%xcr0_after_skip
- pop xAX
- pop xDX
- xsetbv ; ecx is already zero.
-%%xcr0_after_skip:
-
- ; Restore general purpose registers.
- MYPOPAD
-%endmacro
-
-
-;;
-; Prepares for and executes VMLAUNCH/VMRESUME (64 bits guest mode)
-;
-; @returns VBox status code
-; @param fResume msc:rcx, gcc:rdi Whether to use vmlauch/vmresume.
-; @param pCtx msc:rdx, gcc:rsi Pointer to the guest-CPU context.
-; @param pCache msc:r8, gcc:rdx Pointer to the VMCS cache.
-; @param pVM msc:r9, gcc:rcx Pointer to the cross context VM structure.
-; @param pVCpu msc:[ebp+30], gcc:r8 Pointer to the cross context VMCPU structure.
-;
-ALIGNCODE(16)
-BEGINPROC MY_NAME(VMXR0StartVM64)
- push xBP
- mov xBP, xSP
-
- pushf
- cli
-
- ; Save all general purpose host registers.
- MYPUSHAD
-
- ; First we have to save some final CPU context registers.
- lea r10, [.vmlaunch64_done wrt rip]
- mov rax, VMX_VMCS_HOST_RIP ; Return address (too difficult to continue after VMLAUNCH?).
- vmwrite rax, r10
- ; Note: assumes success!
-
- ;
- ; Unify the input parameter registers.
- ;
-%ifdef ASM_CALL64_GCC
- ; fResume already in rdi
- ; pCtx already in rsi
- mov rbx, rdx ; pCache
-%else
- mov rdi, rcx ; fResume
- mov rsi, rdx ; pCtx
- mov rbx, r8 ; pCache
-%endif
-
- ;
- ; Save the host XCR0 and load the guest one if necessary.
- ; Note! Trashes rdx and rcx.
- ;
-%ifdef ASM_CALL64_MSC
- mov rax, [xBP + 30h] ; pVCpu
-%else
- mov rax, r8 ; pVCpu
-%endif
- test byte [xAX + VMCPU.hm + HMCPU.fLoadSaveGuestXcr0], 1
- jz .xcr0_before_skip
-
- xor ecx, ecx
- xgetbv ; Save the host one on the stack.
- push xDX
- push xAX
-
- mov eax, [xSI + CPUMCTX.aXcr] ; Load the guest one.
- mov edx, [xSI + CPUMCTX.aXcr + 4]
- xor ecx, ecx ; paranoia
- xsetbv
-
- push 0 ; Indicate that we must restore XCR0 (popped into ecx, thus 0).
- jmp .xcr0_before_done
-
-.xcr0_before_skip:
- push 3fh ; indicate that we need not.
-.xcr0_before_done:
-
- ;
- ; Save segment registers.
- ; Note! Trashes rdx & rcx, so we moved it here (amd64 case).
- ;
- MYPUSHSEGS xAX, ax
-
-%ifdef VMX_USE_CACHED_VMCS_ACCESSES
- mov ecx, [xBX + VMCSCACHE.Write.cValidEntries]
- cmp ecx, 0
- je .no_cached_writes
- mov edx, ecx
- mov ecx, 0
- jmp .cached_write
-
-ALIGN(16)
-.cached_write:
- mov eax, [xBX + VMCSCACHE.Write.aField + xCX * 4]
- vmwrite xAX, [xBX + VMCSCACHE.Write.aFieldVal + xCX * 8]
- inc xCX
- cmp xCX, xDX
- jl .cached_write
-
- mov dword [xBX + VMCSCACHE.Write.cValidEntries], 0
-.no_cached_writes:
-
- ; Save the pCache pointer.
- push xBX
-%endif
-
- ; Save the pCtx pointer.
- push xSI
-
- ; Save host LDTR.
- xor eax, eax
- sldt ax
- push xAX
-
-%ifndef VMX_SKIP_TR
- ; The host TR limit is reset to 0x67; save & restore it manually.
- str eax
- push xAX
-%endif
-
-%ifndef VMX_SKIP_GDTR
- ; VT-x only saves the base of the GDTR & IDTR and resets the limit to 0xffff; we must restore the limit correctly!
- sub xSP, xCB * 2
- sgdt [xSP]
-%endif
-%ifndef VMX_SKIP_IDTR
- sub xSP, xCB * 2
- sidt [xSP]
-%endif
-
- ; Load CR2 if necessary (may be expensive as writing CR2 is a synchronizing instruction).
- mov rbx, qword [xSI + CPUMCTX.cr2]
- mov rdx, cr2
- cmp rbx, rdx
- je .skip_cr2_write
- mov cr2, rbx
-
-.skip_cr2_write:
- mov eax, VMX_VMCS_HOST_RSP
- vmwrite xAX, xSP
- ; Note: assumes success!
- ; Don't mess with ESP anymore!!!
-
- ; Load guest general purpose registers.
- mov rax, qword [xSI + CPUMCTX.eax]
- mov rbx, qword [xSI + CPUMCTX.ebx]
- mov rcx, qword [xSI + CPUMCTX.ecx]
- mov rdx, qword [xSI + CPUMCTX.edx]
- mov rbp, qword [xSI + CPUMCTX.ebp]
- mov r8, qword [xSI + CPUMCTX.r8]
- mov r9, qword [xSI + CPUMCTX.r9]
- mov r10, qword [xSI + CPUMCTX.r10]
- mov r11, qword [xSI + CPUMCTX.r11]
- mov r12, qword [xSI + CPUMCTX.r12]
- mov r13, qword [xSI + CPUMCTX.r13]
- mov r14, qword [xSI + CPUMCTX.r14]
- mov r15, qword [xSI + CPUMCTX.r15]
-
- ; Resume or start VM?
- cmp xDI, 0 ; fResume
- je .vmlaunch64_launch
-
- ; Load guest rdi & rsi.
- mov rdi, qword [xSI + CPUMCTX.edi]
- mov rsi, qword [xSI + CPUMCTX.esi]
-
- vmresume
- jmp .vmlaunch64_done; ; Here if vmresume detected a failure.
-
-.vmlaunch64_launch:
- ; Save guest rdi & rsi.
- mov rdi, qword [xSI + CPUMCTX.edi]
- mov rsi, qword [xSI + CPUMCTX.esi]
-
- vmlaunch
- jmp .vmlaunch64_done; ; Here if vmlaunch detected a failure.
-
-ALIGNCODE(16)
-.vmlaunch64_done:
- jc near .vmxstart64_invalid_vmcs_ptr
- jz near .vmxstart64_start_failed
-
- RESTORE_STATE_VM64
- mov eax, VINF_SUCCESS
-
-.vmstart64_end:
- popf
- pop xBP
- ret
-
-.vmxstart64_invalid_vmcs_ptr:
- RESTORE_STATE_VM64
- mov eax, VERR_VMX_INVALID_VMCS_PTR_TO_START_VM
- jmp .vmstart64_end
-
-.vmxstart64_start_failed:
- RESTORE_STATE_VM64
- mov eax, VERR_VMX_UNABLE_TO_START_VM
- jmp .vmstart64_end
-ENDPROC MY_NAME(VMXR0StartVM64)
-%endif ; RT_ARCH_AMD64
-
-
-;;
-; Prepares for and executes VMRUN (32 bits guests)
-;
-; @returns VBox status code
-; @param HCPhysVMCB Physical address of host VMCB.
-; @param HCPhysVMCB Physical address of guest VMCB.
-; @param pCtx Pointer to the guest CPU-context.
-; @param pVM msc:r9, gcc:rcx Pointer to the cross context VM structure.
-; @param pVCpu msc:[rsp+28],gcc:r8 Pointer to the cross context VMCPU structure.
-;
-ALIGNCODE(16)
-BEGINPROC MY_NAME(SVMR0VMRun)
-%ifdef RT_ARCH_AMD64 ; fake a cdecl stack frame
- %ifdef ASM_CALL64_GCC
- push r8
- push rcx
- push rdx
- push rsi
- push rdi
- %else
- mov rax, [rsp + 28h]
- push rax ; pVCpu
- push r9 ; pVM
- push r8 ; pCtx
- push rdx ; HCPHYSGuestVMCB
- push rcx ; HCPhysHostVMCB
- %endif
- push 0
-%endif
- push xBP
- mov xBP, xSP
- pushf
-
- ;
- ; Save all general purpose host registers.
- ;
- MYPUSHAD
-
- ;
- ; Load pCtx into xSI.
- ;
- mov xSI, [xBP + xCB * 2 + RTHCPHYS_CB * 2] ; pCtx
-
- ;
- ; Save the host XCR0 and load the guest one if necessary.
- ;
- mov xAX, [xBP + xCB * 2 + RTHCPHYS_CB * 2 + xCB * 2] ; pVCpu
- test byte [xAX + VMCPU.hm + HMCPU.fLoadSaveGuestXcr0], 1
- jz .xcr0_before_skip
-
- xor ecx, ecx
- xgetbv ; Save the host one on the stack.
- push xDX
- push xAX
-
- mov xSI, [xBP + xCB * 2 + RTHCPHYS_CB * 2] ; pCtx
- mov eax, [xSI + CPUMCTX.aXcr] ; Load the guest one.
- mov edx, [xSI + CPUMCTX.aXcr + 4]
- xor ecx, ecx ; paranoia
- xsetbv
-
- push 0 ; Indicate that we must restore XCR0 (popped into ecx, thus 0).
- jmp .xcr0_before_done
-
-.xcr0_before_skip:
- push 3fh ; indicate that we need not.
-.xcr0_before_done:
-
- ;
- ; Save guest CPU-context pointer for simplifying saving of the GPRs afterwards.
- ;
- push xSI
-
- ; Save host fs, gs, sysenter msr etc.
- mov xAX, [xBP + xCB * 2] ; pVMCBHostPhys (64 bits physical address; x86: take low dword only)
- push xAX ; save for the vmload after vmrun
- vmsave
-
- ; Setup eax for VMLOAD.
- mov xAX, [xBP + xCB * 2 + RTHCPHYS_CB] ; pVMCBPhys (64 bits physical address; take low dword only)
-
- ; Load guest general purpose registers.
- ; eax is loaded from the VMCB by VMRUN.
- mov ebx, [xSI + CPUMCTX.ebx]
- mov ecx, [xSI + CPUMCTX.ecx]
- mov edx, [xSI + CPUMCTX.edx]
- mov edi, [xSI + CPUMCTX.edi]
- mov ebp, [xSI + CPUMCTX.ebp]
- mov esi, [xSI + CPUMCTX.esi]
-
- ; Clear the global interrupt flag & execute sti to make sure external interrupts cause a world switch.
- clgi
- sti
-
- ; Load guest fs, gs, sysenter msr etc.
- vmload
- ; Run the VM.
- vmrun
-
- ; eax is in the VMCB already; we can use it here.
-
- ; Save guest fs, gs, sysenter msr etc.
- vmsave
-
- ; Load host fs, gs, sysenter msr etc.
- pop xAX ; Pushed above
- vmload
-
- ; Set the global interrupt flag again, but execute cli to make sure IF=0.
- cli
- stgi
-
- ;
- ; Pop the context pointer (pushed above) and save the guest GPRs (sans RSP and RAX).
- ;
- pop xAX
-
- mov [ss:xAX + CPUMCTX.ebx], ebx
- mov [ss:xAX + CPUMCTX.ecx], ecx
- mov [ss:xAX + CPUMCTX.edx], edx
- mov [ss:xAX + CPUMCTX.esi], esi
- mov [ss:xAX + CPUMCTX.edi], edi
- mov [ss:xAX + CPUMCTX.ebp], ebp
-
- ;
- ; Restore the host xcr0 if necessary.
- ;
- pop xCX
- test ecx, ecx
- jnz .xcr0_after_skip
- pop xAX
- pop xDX
- xsetbv ; ecx is already zero.
-.xcr0_after_skip:
-
- ;
- ; Restore host general purpose registers.
- ;
- MYPOPAD
-
- mov eax, VINF_SUCCESS
-
- popf
- pop xBP
-%ifdef RT_ARCH_AMD64
- add xSP, 6*xCB
-%endif
- ret
-ENDPROC MY_NAME(SVMR0VMRun)
-
-%ifdef RT_ARCH_AMD64
-;;
-; Prepares for and executes VMRUN (64 bits guests)
-;
-; @returns VBox status code
-; @param HCPhysVMCB Physical address of host VMCB.
-; @param HCPhysVMCB Physical address of guest VMCB.
-; @param pCtx Pointer to the guest-CPU context.
-; @param pVM msc:r9, gcc:rcx Pointer to the cross context VM structure.
-; @param pVCpu msc:[rsp+28],gcc:r8 Pointer to the cross context VMCPU structure.
-;
-ALIGNCODE(16)
-BEGINPROC MY_NAME(SVMR0VMRun64)
- ; Fake a cdecl stack frame
- %ifdef ASM_CALL64_GCC
- push r8
- push rcx
- push rdx
- push rsi
- push rdi
- %else
- mov rax, [rsp + 28h]
- push rax ; rbp + 30h pVCpu
- push r9 ; rbp + 28h pVM
- push r8 ; rbp + 20h pCtx
- push rdx ; rbp + 18h HCPHYSGuestVMCB
- push rcx ; rbp + 10h HCPhysHostVMCB
- %endif
- push 0 ; rbp + 08h "fake ret addr"
- push rbp ; rbp + 00h
- mov rbp, rsp
- pushf
-
- ; Manual save and restore:
- ; - General purpose registers except RIP, RSP, RAX
- ;
- ; Trashed:
- ; - CR2 (we don't care)
- ; - LDTR (reset to 0)
- ; - DRx (presumably not changed at all)
- ; - DR7 (reset to 0x400)
- ;
-
- ;
- ; Save all general purpose host registers.
- ;
- MYPUSHAD
-
- ;
- ; Load pCtx into xSI.
- ;
- mov xSI, [rbp + xCB * 2 + RTHCPHYS_CB * 2]
-
- ;
- ; Save the host XCR0 and load the guest one if necessary.
- ;
- mov rax, [xBP + 30h] ; pVCpu
- test byte [xAX + VMCPU.hm + HMCPU.fLoadSaveGuestXcr0], 1
- jz .xcr0_before_skip
-
- xor ecx, ecx
- xgetbv ; Save the host one on the stack.
- push xDX
- push xAX
-
- mov xSI, [xBP + xCB * 2 + RTHCPHYS_CB * 2] ; pCtx
- mov eax, [xSI + CPUMCTX.aXcr] ; Load the guest one.
- mov edx, [xSI + CPUMCTX.aXcr + 4]
- xor ecx, ecx ; paranoia
- xsetbv
-
- push 0 ; Indicate that we must restore XCR0 (popped into ecx, thus 0).
- jmp .xcr0_before_done
-
-.xcr0_before_skip:
- push 3fh ; indicate that we need not.
-.xcr0_before_done:
-
- ;
- ; Save guest CPU-context pointer for simplifying saving of the GPRs afterwards.
- ;
- push rsi
-
- ;
- ; Save host fs, gs, sysenter msr etc.
- ;
- mov rax, [rbp + xCB * 2] ; pVMCBHostPhys (64 bits physical address; x86: take low dword only)
- push rax ; Save for the vmload after vmrun
- vmsave
-
- ; Setup eax for VMLOAD.
- mov rax, [rbp + xCB * 2 + RTHCPHYS_CB] ; pVMCBPhys (64 bits physical address; take low dword only)
-
- ; Load guest general purpose registers.
- ; rax is loaded from the VMCB by VMRUN.
- mov rbx, qword [xSI + CPUMCTX.ebx]
- mov rcx, qword [xSI + CPUMCTX.ecx]
- mov rdx, qword [xSI + CPUMCTX.edx]
- mov rdi, qword [xSI + CPUMCTX.edi]
- mov rbp, qword [xSI + CPUMCTX.ebp]
- mov r8, qword [xSI + CPUMCTX.r8]
- mov r9, qword [xSI + CPUMCTX.r9]
- mov r10, qword [xSI + CPUMCTX.r10]
- mov r11, qword [xSI + CPUMCTX.r11]
- mov r12, qword [xSI + CPUMCTX.r12]
- mov r13, qword [xSI + CPUMCTX.r13]
- mov r14, qword [xSI + CPUMCTX.r14]
- mov r15, qword [xSI + CPUMCTX.r15]
- mov rsi, qword [xSI + CPUMCTX.esi]
-
- ; Clear the global interrupt flag & execute sti to make sure external interrupts cause a world switch.
- clgi
- sti
-
- ; Load guest fs, gs, sysenter msr etc.
- vmload
- ; Run the VM.
- vmrun
-
- ; rax is in the VMCB already; we can use it here.
-
- ; Save guest fs, gs, sysenter msr etc.
- vmsave
-
- ;
- ; Load host fs, gs, sysenter msr etc.
- ;
- pop rax ; pushed above
- vmload
-
- ;
- ; Set the global interrupt flag again, but execute cli to make sure IF=0.
- ;
- cli
- stgi
-
- ;
- ; Pop the context pointer (pushed above) and save the guest GPRs (sans RSP and RAX).
- ;
- pop rax
-
- mov qword [rax + CPUMCTX.ebx], rbx
- mov qword [rax + CPUMCTX.ecx], rcx
- mov qword [rax + CPUMCTX.edx], rdx
- mov qword [rax + CPUMCTX.esi], rsi
- mov qword [rax + CPUMCTX.edi], rdi
- mov qword [rax + CPUMCTX.ebp], rbp
- mov qword [rax + CPUMCTX.r8], r8
- mov qword [rax + CPUMCTX.r9], r9
- mov qword [rax + CPUMCTX.r10], r10
- mov qword [rax + CPUMCTX.r11], r11
- mov qword [rax + CPUMCTX.r12], r12
- mov qword [rax + CPUMCTX.r13], r13
- mov qword [rax + CPUMCTX.r14], r14
- mov qword [rax + CPUMCTX.r15], r15
-
- ;
- ; Restore the host xcr0 if necessary.
- ;
- pop xCX
- test ecx, ecx
- jnz .xcr0_after_skip
- pop xAX
- pop xDX
- xsetbv ; ecx is already zero.
-.xcr0_after_skip:
-
- ;
- ; Restore host general purpose registers.
- ;
- MYPOPAD
-
- mov eax, VINF_SUCCESS
-
- popf
- pop rbp
- add rsp, 6 * xCB
- ret
-ENDPROC MY_NAME(SVMR0VMRun64)
-%endif ; RT_ARCH_AMD64
-
diff --git a/src/VBox/VMM/VMMR0/HMSVMR0.cpp b/src/VBox/VMM/VMMR0/HMSVMR0.cpp
index edfce59..acea0c5 100644
--- a/src/VBox/VMM/VMMR0/HMSVMR0.cpp
+++ b/src/VBox/VMM/VMMR0/HMSVMR0.cpp
@@ -15,9 +15,10 @@
* hope that it will be useful, but WITHOUT ANY WARRANTY of any kind.
*/
-/*******************************************************************************
-* Header Files *
-*******************************************************************************/
+
+/*********************************************************************************************************************************
+* Header Files *
+*********************************************************************************************************************************/
#define LOG_GROUP LOG_GROUP_HM
#include <iprt/asm-amd64-x86.h>
#include <iprt/thread.h>
@@ -41,9 +42,9 @@
#endif
-/*******************************************************************************
-* Defined Constants And Macros *
-*******************************************************************************/
+/*********************************************************************************************************************************
+* Defined Constants And Macros *
+*********************************************************************************************************************************/
#ifdef VBOX_WITH_STATISTICS
# define HMSVM_EXITCODE_STAM_COUNTER_INC(u64ExitCode) do { \
STAM_COUNTER_INC(&pVCpu->hm.s.StatExitAll); \
@@ -260,9 +261,10 @@ typedef enum SVMMSREXITWRITE
*/
typedef int FNSVMEXITHANDLER(PVMCPU pVCpu, PCPUMCTX pCtx, PSVMTRANSIENT pSvmTransient);
-/*******************************************************************************
-* Internal Functions *
-*******************************************************************************/
+
+/*********************************************************************************************************************************
+* Internal Functions *
+*********************************************************************************************************************************/
static void hmR0SvmSetMsrPermission(PVMCPU pVCpu, unsigned uMsr, SVMMSREXITREAD enmRead, SVMMSREXITWRITE enmWrite);
static void hmR0SvmPendingEventToTrpmTrap(PVMCPU pVCpu);
static void hmR0SvmLeave(PVM pVM, PVMCPU pVCpu, PCPUMCTX pCtx);
@@ -304,9 +306,10 @@ static FNSVMEXITHANDLER hmR0SvmExitXcptDB;
DECLINLINE(int) hmR0SvmHandleExit(PVMCPU pVCpu, PCPUMCTX pMixedCtx, PSVMTRANSIENT pSvmTransient);
-/*******************************************************************************
-* Global Variables *
-*******************************************************************************/
+
+/*********************************************************************************************************************************
+* Global Variables *
+*********************************************************************************************************************************/
/** Ring-0 memory object for the IO bitmap. */
RTR0MEMOBJ g_hMemObjIOBitmap = NIL_RTR0MEMOBJ;
/** Physical address of the IO bitmap. */
@@ -880,7 +883,7 @@ static void hmR0SvmFlushTaggedTlb(PVMCPU pVCpu)
/* Set TLB flush state as checked until we return from the world switch. */
ASMAtomicWriteBool(&pVCpu->hm.s.fCheckedTLBFlush, true);
- /* Check for explicit TLB shootdowns. */
+ /* Check for explicit TLB flushes. */
if (VMCPU_FF_TEST_AND_CLEAR(pVCpu, VMCPU_FF_TLB_FLUSH))
{
pVCpu->hm.s.fForceTLBFlush = true;
@@ -955,25 +958,6 @@ static void hmR0SvmFlushTaggedTlb(PVMCPU pVCpu)
pVCpu->hm.s.fForceTLBFlush = false;
}
- /** @todo We never set VMCPU_FF_TLB_SHOOTDOWN anywhere so this path should
- * not be executed. See hmQueueInvlPage() where it is commented
- * out. Support individual entry flushing someday. */
-#if 0
- else
- {
- if (VMCPU_FF_IS_PENDING(pVCpu, VMCPU_FF_TLB_SHOOTDOWN))
- {
- /* Deal with pending TLB shootdown actions which were queued when we were not executing code. */
- STAM_COUNTER_INC(&pVCpu->hm.s.StatTlbShootdown);
- for (uint32_t i = 0; i < pVCpu->hm.s.TlbShootdown.cPages; i++)
- SVMR0InvlpgA(pVCpu->hm.s.TlbShootdown.aPages[i], pVmcb->ctrl.TLBCtrl.n.u32ASID);
-
- pVCpu->hm.s.TlbShootdown.cPages = 0;
- VMCPU_FF_CLEAR(pVCpu, VMCPU_FF_TLB_SHOOTDOWN);
- }
- }
-#endif
-
/* Update VMCB with the ASID. */
if (pVmcb->ctrl.TLBCtrl.n.u32ASID != pVCpu->hm.s.uCurrentAsid)
@@ -1015,7 +999,7 @@ static void hmR0SvmFlushTaggedTlb(PVMCPU pVCpu)
* bits for the 32->64 switcher.
*
* @{ */
-#if HC_ARCH_BITS == 32 && defined(VBOX_ENABLE_64_BITS_GUESTS) && !defined(VBOX_WITH_HYBRID_32BIT_KERNEL)
+#if HC_ARCH_BITS == 32 && defined(VBOX_ENABLE_64_BITS_GUESTS)
/**
* Prepares for and executes VMRUN (64-bit guests on a 32-bit host).
*
@@ -1464,7 +1448,7 @@ static void hmR0SvmLoadSharedDebugState(PVMCPU pVCpu, PSVMVMCB pVmcb, PCPUMCTX p
*
* Note! DBGF expects a clean DR6 state before executing guest code.
*/
-#if HC_ARCH_BITS == 32 && defined(VBOX_WITH_64_BITS_GUESTS) && !defined(VBOX_WITH_HYBRID_32BIT_KERNEL)
+#if HC_ARCH_BITS == 32 && defined(VBOX_WITH_64_BITS_GUESTS)
if ( CPUMIsGuestInLongModeEx(pCtx)
&& !CPUMIsHyperDebugStateActivePending(pVCpu))
{
@@ -1517,7 +1501,7 @@ static void hmR0SvmLoadSharedDebugState(PVMCPU pVCpu, PSVMVMCB pVmcb, PCPUMCTX p
*/
if (pCtx->dr[7] & (X86_DR7_ENABLED_MASK | X86_DR7_GD)) /** @todo Why GD? */
{
-#if HC_ARCH_BITS == 32 && defined(VBOX_WITH_64_BITS_GUESTS) && !defined(VBOX_WITH_HYBRID_32BIT_KERNEL)
+#if HC_ARCH_BITS == 32 && defined(VBOX_WITH_64_BITS_GUESTS)
if ( CPUMIsGuestInLongModeEx(pCtx)
&& !CPUMIsGuestDebugStateActivePending(pVCpu))
{
@@ -1541,7 +1525,7 @@ static void hmR0SvmLoadSharedDebugState(PVMCPU pVCpu, PSVMVMCB pVmcb, PCPUMCTX p
* If no debugging enabled, we'll lazy load DR0-3. We don't need to
* intercept #DB as DR6 is updated in the VMCB.
*/
-#if HC_ARCH_BITS == 32 && defined(VBOX_WITH_64_BITS_GUESTS) && !defined(VBOX_WITH_HYBRID_32BIT_KERNEL)
+#if HC_ARCH_BITS == 32 && defined(VBOX_WITH_64_BITS_GUESTS)
else if ( !CPUMIsGuestDebugStateActivePending(pVCpu)
&& !CPUMIsGuestDebugStateActive(pVCpu))
#else
@@ -1685,7 +1669,7 @@ static int hmR0SvmSetupVMRunHandler(PVMCPU pVCpu, PCPUMCTX pCtx)
return VERR_PGM_UNSUPPORTED_SHADOW_PAGING_MODE;
#endif
Assert(pVCpu->CTX_SUFF(pVM)->hm.s.fAllow64BitGuests); /* Guaranteed by hmR3InitFinalizeR0(). */
-#if HC_ARCH_BITS == 32 && !defined(VBOX_WITH_HYBRID_32BIT_KERNEL)
+#if HC_ARCH_BITS == 32
/* 32-bit host. We need to switch to 64-bit before running the 64-bit guest. */
pVCpu->hm.s.svm.pfnVMRun = SVMR0VMSwitcherRun64;
#else
@@ -2184,7 +2168,7 @@ static int hmR0SvmLongJmpToRing3(PVM pVM, PVMCPU pVCpu, PCPUMCTX pCtx)
* @param pvUser The user argument (pointer to the possibly
* out-of-date guest-CPU context).
*/
-DECLCALLBACK(int) hmR0SvmCallRing3Callback(PVMCPU pVCpu, VMMCALLRING3 enmOperation, void *pvUser)
+static DECLCALLBACK(int) hmR0SvmCallRing3Callback(PVMCPU pVCpu, VMMCALLRING3 enmOperation, void *pvUser)
{
if (enmOperation == VMMCALLRING3_VM_R0_ASSERTION)
{
@@ -3131,7 +3115,7 @@ static void hmR0SvmPreRunGuestCommitted(PVM pVM, PVMCPU pVCpu, PCPUMCTX pCtx, PS
pVmcb->ctrl.u64VmcbCleanBits = 0;
/* Store status of the shared guest-host state at the time of VMRUN. */
-#if HC_ARCH_BITS == 32 && defined(VBOX_WITH_64_BITS_GUESTS) && !defined(VBOX_WITH_HYBRID_32BIT_KERNEL)
+#if HC_ARCH_BITS == 32 && defined(VBOX_WITH_64_BITS_GUESTS)
if (CPUMIsGuestInLongModeEx(pCtx))
{
pSvmTransient->fWasGuestDebugStateActive = CPUMIsGuestDebugStateActivePending(pVCpu);
@@ -3146,7 +3130,7 @@ static void hmR0SvmPreRunGuestCommitted(PVM pVM, PVMCPU pVCpu, PCPUMCTX pCtx, PS
pSvmTransient->fWasGuestFPUStateActive = CPUMIsGuestFPUStateActive(pVCpu);
/* Flush the appropriate tagged-TLB entries. */
- ASMAtomicWriteBool(&pVCpu->hm.s.fCheckedTLBFlush, true); /* Used for TLB-shootdowns, set this across the world switch. */
+ ASMAtomicWriteBool(&pVCpu->hm.s.fCheckedTLBFlush, true); /* Used for TLB flushing, set this across the world switch. */
hmR0SvmFlushTaggedTlb(pVCpu);
Assert(HMR0GetCurrentCpu()->idCpu == pVCpu->hm.s.idLastCpu);
@@ -3229,8 +3213,8 @@ static void hmR0SvmPostRunGuest(PVM pVM, PVMCPU pVCpu, PCPUMCTX pMixedCtx, PSVMT
{
Assert(!VMMRZCallRing3IsEnabled(pVCpu));
- ASMAtomicWriteBool(&pVCpu->hm.s.fCheckedTLBFlush, false); /* See HMInvalidatePageOnAllVCpus(): used for TLB-shootdowns. */
- ASMAtomicIncU32(&pVCpu->hm.s.cWorldSwitchExits); /* Initialized in vmR3CreateUVM(): used for TLB-shootdowns. */
+ ASMAtomicWriteBool(&pVCpu->hm.s.fCheckedTLBFlush, false); /* See HMInvalidatePageOnAllVCpus(): used for TLB flushing. */
+ ASMAtomicIncU32(&pVCpu->hm.s.cWorldSwitchExits); /* Initialized in vmR3CreateUVM(): used for EMT poking. */
PSVMVMCB pVmcb = (PSVMVMCB)pVCpu->hm.s.svm.pvVmcb;
pVmcb->ctrl.u64VmcbCleanBits = HMSVM_VMCB_CLEAN_ALL; /* Mark the VMCB-state cache as unmodified by VMM. */
diff --git a/src/VBox/VMM/VMMR0/HMSVMR0.h b/src/VBox/VMM/VMMR0/HMSVMR0.h
index 1456af0..10d2f3b 100644
--- a/src/VBox/VMM/VMMR0/HMSVMR0.h
+++ b/src/VBox/VMM/VMMR0/HMSVMR0.h
@@ -50,11 +50,11 @@ VMMR0DECL(int) SVMR0SetupVM(PVM pVM);
VMMR0DECL(int) SVMR0RunGuestCode(PVM pVM, PVMCPU pVCpu, PCPUMCTX pCtx);
VMMR0DECL(int) SVMR0SaveHostState(PVM pVM, PVMCPU pVCpu);
-#if HC_ARCH_BITS == 32 && defined(VBOX_WITH_64_BITS_GUESTS) && !defined(VBOX_WITH_HYBRID_32BIT_KERNEL)
+#if HC_ARCH_BITS == 32 && defined(VBOX_WITH_64_BITS_GUESTS)
DECLASM(int) SVMR0VMSwitcherRun64(RTHCPHYS pVMCBHostPhys, RTHCPHYS pVMCBPhys, PCPUMCTX pCtx, PVM pVM, PVMCPU pVCpu);
VMMR0DECL(int) SVMR0Execute64BitsHandler(PVM pVM, PVMCPU pVCpu, PCPUMCTX pCtx, HM64ON32OP enmOp, uint32_t cbParam,
uint32_t *paParam);
-#endif /* HC_ARCH_BITS == 32 && defined(VBOX_WITH_64_BITS_GUESTS) && !defined(VBOX_WITH_HYBRID_32BIT_KERNEL) */
+#endif /* HC_ARCH_BITS == 32 && defined(VBOX_WITH_64_BITS_GUESTS) */
/**
* Prepares for and executes VMRUN (32-bit guests).
diff --git a/src/VBox/VMM/VMMR0/HMVMXR0.cpp b/src/VBox/VMM/VMMR0/HMVMXR0.cpp
index 4a6210d..d5f6765 100644
--- a/src/VBox/VMM/VMMR0/HMVMXR0.cpp
+++ b/src/VBox/VMM/VMMR0/HMVMXR0.cpp
@@ -15,9 +15,10 @@
* hope that it will be useful, but WITHOUT ANY WARRANTY of any kind.
*/
-/*******************************************************************************
-* Header Files *
-*******************************************************************************/
+
+/*********************************************************************************************************************************
+* Header Files *
+*********************************************************************************************************************************/
#define LOG_GROUP LOG_GROUP_HM
#include <iprt/x86.h>
#include <iprt/asm-amd64-x86.h>
@@ -51,21 +52,9 @@
#endif
-/*******************************************************************************
-* Defined Constants And Macros *
-*******************************************************************************/
-#if defined(RT_ARCH_AMD64)
-# define HMVMX_IS_64BIT_HOST_MODE() (true)
-typedef RTHCUINTREG HMVMXHCUINTREG;
-#elif defined(VBOX_WITH_HYBRID_32BIT_KERNEL)
-extern "C" uint32_t g_fVMXIs64bitHost;
-# define HMVMX_IS_64BIT_HOST_MODE() (g_fVMXIs64bitHost != 0)
-typedef uint64_t HMVMXHCUINTREG;
-#else
-# define HMVMX_IS_64BIT_HOST_MODE() (false)
-typedef RTHCUINTREG HMVMXHCUINTREG;
-#endif
-
+/*********************************************************************************************************************************
+* Defined Constants And Macros *
+*********************************************************************************************************************************/
/** Use the function table. */
#define HMVMX_USE_FUNCTION_TABLE
@@ -201,9 +190,9 @@ typedef RTHCUINTREG HMVMXHCUINTREG;
} while (0)
-/*******************************************************************************
-* Structures and Typedefs *
-*******************************************************************************/
+/*********************************************************************************************************************************
+* Structures and Typedefs *
+*********************************************************************************************************************************/
/**
* VMX transient state.
*
@@ -342,15 +331,15 @@ typedef FNVMXEXITHANDLER *PFNVMXEXITHANDLER;
#endif
-/*******************************************************************************
-* Internal Functions *
-*******************************************************************************/
+/*********************************************************************************************************************************
+* Internal Functions *
+*********************************************************************************************************************************/
static void hmR0VmxFlushEpt(PVMCPU pVCpu, VMXFLUSHEPT enmFlush);
static void hmR0VmxFlushVpid(PVM pVM, PVMCPU pVCpu, VMXFLUSHVPID enmFlush, RTGCPTR GCPtr);
static int hmR0VmxInjectEventVmcs(PVMCPU pVCpu, PCPUMCTX pMixedCtx, uint64_t u64IntInfo, uint32_t cbInstr,
uint32_t u32ErrCode, RTGCUINTREG GCPtrFaultAddress,
bool fStepping, uint32_t *puIntState);
-#if HC_ARCH_BITS == 32 && !defined(VBOX_WITH_HYBRID_32BIT_KERNEL)
+#if HC_ARCH_BITS == 32
static int hmR0VmxInitVmcsReadCache(PVM pVM, PVMCPU pVCpu);
#endif
#ifndef HMVMX_USE_FUNCTION_TABLE
@@ -423,9 +412,10 @@ static int hmR0VmxExitXcptGeneric(PVMCPU pVCpu, PCPUMCTX pMixedCtx, PVM
#endif
static uint32_t hmR0VmxCheckGuestState(PVM pVM, PVMCPU pVCpu, PCPUMCTX pCtx);
-/*******************************************************************************
-* Global Variables *
-*******************************************************************************/
+
+/*********************************************************************************************************************************
+* Global Variables *
+*********************************************************************************************************************************/
#ifdef HMVMX_USE_FUNCTION_TABLE
/**
@@ -1627,7 +1617,8 @@ static int hmR0VmxCheckVmcsCtls(PVMCPU pVCpu)
{
rc = VMXReadVmcs32(VMX_VMCS32_CTRL_PROC_EXEC2, &u32Val);
AssertRCReturn(rc, rc);
- AssertMsgReturn(pVCpu->hm.s.vmx.u32ProcCtls2 == u32Val, ("Cache=%#RX32 VMCS=%#RX32", pVCpu->hm.s.vmx.u32ProcCtls2, u32Val),
+ AssertMsgReturn(pVCpu->hm.s.vmx.u32ProcCtls2 == u32Val,
+ ("Cache=%#RX32 VMCS=%#RX32", pVCpu->hm.s.vmx.u32ProcCtls2, u32Val),
VERR_VMX_PROC_EXEC2_CTLS_CACHE_INVALID);
}
@@ -1883,12 +1874,6 @@ static void hmR0VmxFlushTaggedTlbNone(PVM pVM, PVMCPU pVCpu, PHMGLOBALCPUINFO pC
VMCPU_FF_CLEAR(pVCpu, VMCPU_FF_TLB_FLUSH);
- /** @todo TLB shootdown is currently not used. See hmQueueInvlPage(). */
-#if 0
- VMCPU_FF_CLEAR(pVCpu, VMCPU_FF_TLB_SHOOTDOWN);
- pVCpu->hm.s.TlbShootdown.cPages = 0;
-#endif
-
Assert(pCpu->idCpu != NIL_RTCPUID);
pVCpu->hm.s.idLastCpu = pCpu->idCpu;
pVCpu->hm.s.cTlbFlushes = pCpu->cTlbFlushes;
@@ -1962,7 +1947,7 @@ static void hmR0VmxFlushTaggedTlbBoth(PVM pVM, PVMCPU pVCpu, PHMGLOBALCPUINFO pC
VMCPU_FF_CLEAR(pVCpu, VMCPU_FF_TLB_FLUSH); /* Already flushed-by-EPT, skip doing it again below. */
}
- /* Check for explicit TLB shootdowns. */
+ /* Check for explicit TLB flushes. */
if (VMCPU_FF_TEST_AND_CLEAR(pVCpu, VMCPU_FF_TLB_FLUSH))
{
/*
@@ -1977,34 +1962,7 @@ static void hmR0VmxFlushTaggedTlbBoth(PVM pVM, PVMCPU pVCpu, PHMGLOBALCPUINFO pC
HMVMX_SET_TAGGED_TLB_FLUSHED();
}
- /** @todo We never set VMCPU_FF_TLB_SHOOTDOWN anywhere. See hmQueueInvlPage()
- * where it is commented out. Support individual entry flushing
- * someday. */
-#if 0
- if (VMCPU_FF_IS_PENDING(pVCpu, VMCPU_FF_TLB_SHOOTDOWN))
- {
- STAM_COUNTER_INC(&pVCpu->hm.s.StatTlbShootdown);
-
- /*
- * Flush individual guest entries using VPID from the TLB or as little as possible with EPT
- * as supported by the CPU.
- */
- if (pVM->hm.s.vmx.Msrs.u64EptVpidCaps & MSR_IA32_VMX_EPT_VPID_CAP_INVVPID_INDIV_ADDR)
- {
- for (uint32_t i = 0; i < pVCpu->hm.s.TlbShootdown.cPages; i++)
- hmR0VmxFlushVpid(pVM, pVCpu, VMXFLUSHVPID_INDIV_ADDR, pVCpu->hm.s.TlbShootdown.aPages[i]);
- }
- else
- hmR0VmxFlushEpt(pVCpu, pVM->hm.s.vmx.enmFlushEpt);
-
- HMVMX_SET_TAGGED_TLB_FLUSHED();
- VMCPU_FF_CLEAR(pVCpu, VMCPU_FF_TLB_SHOOTDOWN);
- pVCpu->hm.s.TlbShootdown.cPages = 0;
- }
-#endif
-
pVCpu->hm.s.fForceTLBFlush = false;
-
HMVMX_UPDATE_FLUSH_SKIPPED_STAT();
Assert(pVCpu->hm.s.idLastCpu == pCpu->idCpu);
@@ -2055,7 +2013,7 @@ static void hmR0VmxFlushTaggedTlbEpt(PVM pVM, PVMCPU pVCpu, PHMGLOBALCPUINFO pCp
STAM_COUNTER_INC(&pVCpu->hm.s.StatFlushTlbWorldSwitch);
}
- /* Check for explicit TLB shootdown flushes. */
+ /* Check for explicit TLB flushes. */
if (VMCPU_FF_TEST_AND_CLEAR(pVCpu, VMCPU_FF_TLB_FLUSH))
{
pVCpu->hm.s.fForceTLBFlush = true;
@@ -2070,25 +2028,6 @@ static void hmR0VmxFlushTaggedTlbEpt(PVM pVM, PVMCPU pVCpu, PHMGLOBALCPUINFO pCp
hmR0VmxFlushEpt(pVCpu, pVM->hm.s.vmx.enmFlushEpt);
pVCpu->hm.s.fForceTLBFlush = false;
}
- /** @todo We never set VMCPU_FF_TLB_SHOOTDOWN anywhere. See hmQueueInvlPage()
- * where it is commented out. Support individual entry flushing
- * someday. */
-#if 0
- else
- {
- if (VMCPU_FF_IS_PENDING(pVCpu, VMCPU_FF_TLB_SHOOTDOWN))
- {
- /* We cannot flush individual entries without VPID support. Flush using EPT. */
- STAM_COUNTER_INC(&pVCpu->hm.s.StatTlbShootdown);
- hmR0VmxFlushEpt(pVCpu, pVM->hm.s.vmx.enmFlushEpt);
- }
- else
- STAM_COUNTER_INC(&pVCpu->hm.s.StatNoFlushTlbWorldSwitch);
-
- pVCpu->hm.s.TlbShootdown.cPages = 0;
- VMCPU_FF_CLEAR(pVCpu, VMCPU_FF_TLB_SHOOTDOWN);
- }
-#endif
}
@@ -2123,7 +2062,7 @@ static void hmR0VmxFlushTaggedTlbVpid(PVM pVM, PVMCPU pVCpu, PHMGLOBALCPUINFO pC
STAM_COUNTER_INC(&pVCpu->hm.s.StatFlushTlbWorldSwitch);
}
- /* Check for explicit TLB shootdown flushes. */
+ /* Check for explicit TLB flushes. */
if (VMCPU_FF_TEST_AND_CLEAR(pVCpu, VMCPU_FF_TLB_FLUSH))
{
/*
@@ -2165,35 +2104,6 @@ static void hmR0VmxFlushTaggedTlbVpid(PVM pVM, PVMCPU pVCpu, PHMGLOBALCPUINFO pC
}
}
}
- /** @todo We never set VMCPU_FF_TLB_SHOOTDOWN anywhere. See hmQueueInvlPage()
- * where it is commented out. Support individual entry flushing
- * someday. */
-#if 0
- else
- {
- AssertMsg(pVCpu->hm.s.uCurrentAsid && pCpu->uCurrentAsid,
- ("hm->uCurrentAsid=%lu hm->cTlbFlushes=%lu cpu->uCurrentAsid=%lu cpu->cTlbFlushes=%lu\n",
- pVCpu->hm.s.uCurrentAsid, pVCpu->hm.s.cTlbFlushes,
- pCpu->uCurrentAsid, pCpu->cTlbFlushes));
-
- if (VMCPU_FF_IS_PENDING(pVCpu, VMCPU_FF_TLB_SHOOTDOWN))
- {
- /* Flush individual guest entries using VPID or as little as possible with EPT as supported by the CPU. */
- if (pVM->hm.s.vmx.Msrs.u64EptVpidCaps & MSR_IA32_VMX_EPT_VPID_CAP_INVVPID_INDIV_ADDR)
- {
- for (uint32_t i = 0; i < pVCpu->hm.s.TlbShootdown.cPages; i++)
- hmR0VmxFlushVpid(pVM, pVCpu, VMXFLUSHVPID_INDIV_ADDR, pVCpu->hm.s.TlbShootdown.aPages[i]);
- }
- else
- hmR0VmxFlushVpid(pVM, pVCpu, pVM->hm.s.vmx.enmFlushVpid, 0 /* GCPtr */);
-
- pVCpu->hm.s.TlbShootdown.cPages = 0;
- VMCPU_FF_CLEAR(pVCpu, VMCPU_FF_TLB_SHOOTDOWN);
- }
- else
- STAM_COUNTER_INC(&pVCpu->hm.s.StatNoFlushTlbWorldSwitch);
- }
-#endif
AssertMsg(pVCpu->hm.s.cTlbFlushes == pCpu->cTlbFlushes,
("Flush count mismatch for cpu %d (%u vs %u)\n", pCpu->idCpu, pVCpu->hm.s.cTlbFlushes, pCpu->cTlbFlushes));
@@ -2231,9 +2141,6 @@ DECLINLINE(void) hmR0VmxFlushTaggedTlb(PVMCPU pVCpu, PHMGLOBALCPUINFO pCpu)
break;
}
- /* VMCPU_FF_TLB_SHOOTDOWN is unused. */
- Assert(!VMCPU_FF_IS_PENDING(pVCpu, VMCPU_FF_TLB_SHOOTDOWN));
-
/* Don't assert that VMCPU_FF_TLB_FLUSH should no longer be pending. It can be set by other EMTs. */
}
@@ -2742,19 +2649,6 @@ VMMR0DECL(int) VMXR0SetupVM(PVM pVM)
return VERR_INTERNAL_ERROR;
}
-#ifdef VBOX_WITH_HYBRID_32BIT_KERNEL
- /*
- * This is for the darwin 32-bit/PAE kernels trying to execute 64-bit guests. We don't bother with
- * the 32<->64 switcher in this case. This is a rare, legacy use-case with barely any test coverage.
- */
- if ( pVM->hm.s.fAllow64BitGuests
- && !HMVMX_IS_64BIT_HOST_MODE())
- {
- LogRel(("VMXR0SetupVM: Unsupported guest and host paging mode combination.\n"));
- return VERR_PGM_UNSUPPORTED_HOST_PAGING_MODE;
- }
-#endif
-
/* Initialize these always, see hmR3InitFinalizeR0().*/
pVM->hm.s.vmx.enmFlushEpt = VMXFLUSHEPT_NONE;
pVM->hm.s.vmx.enmFlushVpid = VMXFLUSHVPID_NONE;
@@ -2769,9 +2663,8 @@ VMMR0DECL(int) VMXR0SetupVM(PVM pVM)
/* Check if we can use the VMCS controls for swapping the EFER MSR. */
Assert(!pVM->hm.s.vmx.fSupportsVmcsEfer);
-#if HC_ARCH_BITS == 64 || defined(VBOX_WITH_HYBRID_32BIT_KERNEL)
- if ( HMVMX_IS_64BIT_HOST_MODE()
- && (pVM->hm.s.vmx.Msrs.VmxEntry.n.allowed1 & VMX_VMCS_CTRL_ENTRY_LOAD_GUEST_EFER_MSR)
+#if HC_ARCH_BITS == 64
+ if ( (pVM->hm.s.vmx.Msrs.VmxEntry.n.allowed1 & VMX_VMCS_CTRL_ENTRY_LOAD_GUEST_EFER_MSR)
&& (pVM->hm.s.vmx.Msrs.VmxExit.n.allowed1 & VMX_VMCS_CTRL_EXIT_LOAD_HOST_EFER_MSR)
&& (pVM->hm.s.vmx.Msrs.VmxExit.n.allowed1 & VMX_VMCS_CTRL_EXIT_SAVE_GUEST_EFER_MSR))
{
@@ -2825,7 +2718,7 @@ VMMR0DECL(int) VMXR0SetupVM(PVM pVM)
AssertLogRelMsgRCReturnStmt(rc, ("VMXR0SetupVM: hmR0VmxInitUpdatedGuestStateMask failed! rc=%Rrc (pVM=%p)\n", rc, pVM),
hmR0VmxUpdateErrorRecord(pVM, pVCpu, rc), rc);
-#if HC_ARCH_BITS == 32 && !defined(VBOX_WITH_HYBRID_32BIT_KERNEL)
+#if HC_ARCH_BITS == 32
rc = hmR0VmxInitVmcsReadCache(pVM, pVCpu);
AssertLogRelMsgRCReturnStmt(rc, ("VMXR0SetupVM: hmR0VmxInitVmcsReadCache failed! rc=%Rrc (pVM=%p)\n", rc, pVM),
hmR0VmxUpdateErrorRecord(pVM, pVCpu, rc), rc);
@@ -2861,19 +2754,8 @@ DECLINLINE(int) hmR0VmxSaveHostControlRegs(PVM pVM, PVMCPU pVCpu)
int rc = VMXWriteVmcsHstN(VMX_VMCS_HOST_CR0, uReg);
AssertRCReturn(rc, rc);
-#ifdef VBOX_WITH_HYBRID_32BIT_KERNEL
- /* For the darwin 32-bit hybrid kernel, we need the 64-bit CR3 as it uses 64-bit paging. */
- if (HMVMX_IS_64BIT_HOST_MODE())
- {
- uint64_t uRegCR3 = HMR0Get64bitCR3();
- rc = VMXWriteVmcs64(VMX_VMCS_HOST_CR3, uRegCR3);
- }
- else
-#endif
- {
- uReg = ASMGetCR3();
- rc = VMXWriteVmcsHstN(VMX_VMCS_HOST_CR3, uReg);
- }
+ uReg = ASMGetCR3();
+ rc = VMXWriteVmcsHstN(VMX_VMCS_HOST_CR3, uReg);
AssertRCReturn(rc, rc);
uReg = ASMGetCR4();
@@ -2949,24 +2831,8 @@ DECLINLINE(int) hmR0VmxSaveHostSegmentRegs(PVM pVM, PVMCPU pVCpu)
/*
* Host CS and SS segment registers.
*/
-#ifdef VBOX_WITH_HYBRID_32BIT_KERNEL
- RTSEL uSelCS;
- RTSEL uSelSS;
- if (HMVMX_IS_64BIT_HOST_MODE())
- {
- uSelCS = (RTSEL)(uintptr_t)&SUPR0Abs64bitKernelCS;
- uSelSS = (RTSEL)(uintptr_t)&SUPR0Abs64bitKernelSS;
- }
- else
- {
- /* Seems darwin uses the LDT (TI flag is set) in the CS & SS selectors which VT-x doesn't like. */
- uSelCS = (RTSEL)(uintptr_t)&SUPR0AbsKernelCS;
- uSelSS = (RTSEL)(uintptr_t)&SUPR0AbsKernelSS;
- }
-#else
RTSEL uSelCS = ASMGetCS();
RTSEL uSelSS = ASMGetSS();
-#endif
/*
* Host TR segment register.
@@ -3017,60 +2883,45 @@ DECLINLINE(int) hmR0VmxSaveHostSegmentRegs(PVM pVM, PVMCPU pVCpu)
* Host GDTR and IDTR.
*/
RTGDTR Gdtr;
+ RTIDTR Idtr;
RT_ZERO(Gdtr);
-#ifdef VBOX_WITH_HYBRID_32BIT_KERNEL
- if (HMVMX_IS_64BIT_HOST_MODE())
- {
- X86XDTR64 Gdtr64;
- X86XDTR64 Idtr64;
- HMR0Get64bitGdtrAndIdtr(&Gdtr64, &Idtr64);
- rc = VMXWriteVmcs64(VMX_VMCS_HOST_GDTR_BASE, Gdtr64.uAddr); AssertRCReturn(rc, rc);
- rc = VMXWriteVmcs64(VMX_VMCS_HOST_IDTR_BASE, Idtr64.uAddr); AssertRCReturn(rc, rc);
-
- Gdtr.cbGdt = Gdtr64.cb;
- Gdtr.pGdt = (uintptr_t)Gdtr64.uAddr;
- }
- else
-#endif
- {
- RTIDTR Idtr;
- ASMGetGDTR(&Gdtr);
- ASMGetIDTR(&Idtr);
- rc = VMXWriteVmcsHstN(VMX_VMCS_HOST_GDTR_BASE, Gdtr.pGdt); AssertRCReturn(rc, rc);
- rc = VMXWriteVmcsHstN(VMX_VMCS_HOST_IDTR_BASE, Idtr.pIdt); AssertRCReturn(rc, rc);
+ RT_ZERO(Idtr);
+ ASMGetGDTR(&Gdtr);
+ ASMGetIDTR(&Idtr);
+ rc = VMXWriteVmcsHstN(VMX_VMCS_HOST_GDTR_BASE, Gdtr.pGdt); AssertRCReturn(rc, rc);
+ rc = VMXWriteVmcsHstN(VMX_VMCS_HOST_IDTR_BASE, Idtr.pIdt); AssertRCReturn(rc, rc);
#if HC_ARCH_BITS == 64
- /*
- * Determine if we need to manually need to restore the GDTR and IDTR limits as VT-x zaps them to the
- * maximum limit (0xffff) on every VM-exit.
- */
- if (Gdtr.cbGdt != 0xffff)
- {
- pVCpu->hm.s.vmx.fRestoreHostFlags |= VMX_RESTORE_HOST_GDTR;
- AssertCompile(sizeof(Gdtr) == sizeof(X86XDTR64));
- memcpy(&pVCpu->hm.s.vmx.RestoreHost.HostGdtr, &Gdtr, sizeof(X86XDTR64));
- }
+ /*
+ * Determine if we need to manually need to restore the GDTR and IDTR limits as VT-x zaps them to the
+ * maximum limit (0xffff) on every VM-exit.
+ */
+ if (Gdtr.cbGdt != 0xffff)
+ {
+ pVCpu->hm.s.vmx.fRestoreHostFlags |= VMX_RESTORE_HOST_GDTR;
+ AssertCompile(sizeof(Gdtr) == sizeof(X86XDTR64));
+ memcpy(&pVCpu->hm.s.vmx.RestoreHost.HostGdtr, &Gdtr, sizeof(X86XDTR64));
+ }
- /*
- * IDT limit is effectively capped at 0xfff. (See Intel spec. 6.14.1 "64-Bit Mode IDT"
- * and Intel spec. 6.2 "Exception and Interrupt Vectors".) Therefore if the host has the limit as 0xfff, VT-x
- * bloating the limit to 0xffff shouldn't cause any different CPU behavior. However, several hosts either insists
- * on 0xfff being the limit (Windows Patch Guard) or uses the limit for other purposes (darwin puts the CPU ID in there
- * but botches sidt alignment in at least one consumer). So, we're only allowing IDTR.LIMIT to be left at 0xffff on
- * hosts where we are pretty sure it won't cause trouble.
- */
+ /*
+ * IDT limit is effectively capped at 0xfff. (See Intel spec. 6.14.1 "64-Bit Mode IDT"
+ * and Intel spec. 6.2 "Exception and Interrupt Vectors".) Therefore if the host has the limit as 0xfff, VT-x
+ * bloating the limit to 0xffff shouldn't cause any different CPU behavior. However, several hosts either insists
+ * on 0xfff being the limit (Windows Patch Guard) or uses the limit for other purposes (darwin puts the CPU ID in there
+ * but botches sidt alignment in at least one consumer). So, we're only allowing IDTR.LIMIT to be left at 0xffff on
+ * hosts where we are pretty sure it won't cause trouble.
+ */
# if defined(RT_OS_LINUX) || defined(RT_OS_SOLARIS)
- if (Idtr.cbIdt < 0x0fff)
+ if (Idtr.cbIdt < 0x0fff)
# else
- if (Idtr.cbIdt != 0xffff)
+ if (Idtr.cbIdt != 0xffff)
# endif
- {
- pVCpu->hm.s.vmx.fRestoreHostFlags |= VMX_RESTORE_HOST_IDTR;
- AssertCompile(sizeof(Idtr) == sizeof(X86XDTR64));
- memcpy(&pVCpu->hm.s.vmx.RestoreHost.HostIdtr, &Idtr, sizeof(X86XDTR64));
- }
-#endif
+ {
+ pVCpu->hm.s.vmx.fRestoreHostFlags |= VMX_RESTORE_HOST_IDTR;
+ AssertCompile(sizeof(Idtr) == sizeof(X86XDTR64));
+ memcpy(&pVCpu->hm.s.vmx.RestoreHost.HostIdtr, &Idtr, sizeof(X86XDTR64));
}
+#endif
/*
* Host TR base. Verify that TR selector doesn't point past the GDT. Masking off the TI and RPL bits
@@ -3081,68 +2932,51 @@ DECLINLINE(int) hmR0VmxSaveHostSegmentRegs(PVM pVM, PVMCPU pVCpu)
VERR_VMX_INVALID_HOST_STATE);
PCX86DESCHC pDesc = (PCX86DESCHC)(Gdtr.pGdt + (uSelTR & X86_SEL_MASK));
-#ifdef VBOX_WITH_HYBRID_32BIT_KERNEL
- if (HMVMX_IS_64BIT_HOST_MODE())
- {
- /* We need the 64-bit TR base for hybrid darwin. */
- uint64_t u64TRBase = X86DESC64_BASE((PX86DESC64)pDesc);
- rc = VMXWriteVmcs64(VMX_VMCS_HOST_TR_BASE, u64TRBase);
- }
- else
-#endif
- {
- uintptr_t uTRBase;
#if HC_ARCH_BITS == 64
- uTRBase = X86DESC64_BASE(pDesc);
+ uintptr_t uTRBase = X86DESC64_BASE(pDesc);
- /*
- * VT-x unconditionally restores the TR limit to 0x67 and type to 11 (32-bit busy TSS) on all VM-exits.
- * The type is the same for 64-bit busy TSS[1]. The limit needs manual restoration if the host has something else.
- * Task switching is not supported in 64-bit mode[2], but the limit still matters as IOPM is supported in 64-bit mode.
- * Restoring the limit lazily while returning to ring-3 is safe because IOPM is not applicable in ring-0.
- *
- * [1] See Intel spec. 3.5 "System Descriptor Types".
- * [2] See Intel spec. 7.2.3 "TSS Descriptor in 64-bit mode".
- */
- Assert(pDesc->System.u4Type == 11);
- if ( pDesc->System.u16LimitLow != 0x67
- || pDesc->System.u4LimitHigh)
- {
- pVCpu->hm.s.vmx.fRestoreHostFlags |= VMX_RESTORE_HOST_SEL_TR;
- /* If the host has made GDT read-only, we would need to temporarily toggle CR0.WP before writing the GDT. */
- if (pVM->hm.s.fHostKernelFeatures & SUPKERNELFEATURES_GDT_READ_ONLY)
- pVCpu->hm.s.vmx.fRestoreHostFlags |= VMX_RESTORE_HOST_GDT_READ_ONLY;
- pVCpu->hm.s.vmx.RestoreHost.uHostSelTR = uSelTR;
+ /*
+ * VT-x unconditionally restores the TR limit to 0x67 and type to 11 (32-bit busy TSS) on all VM-exits.
+ * The type is the same for 64-bit busy TSS[1]. The limit needs manual restoration if the host has something else.
+ * Task switching is not supported in 64-bit mode[2], but the limit still matters as IOPM is supported in 64-bit mode.
+ * Restoring the limit lazily while returning to ring-3 is safe because IOPM is not applicable in ring-0.
+ *
+ * [1] See Intel spec. 3.5 "System Descriptor Types".
+ * [2] See Intel spec. 7.2.3 "TSS Descriptor in 64-bit mode".
+ */
+ Assert(pDesc->System.u4Type == 11);
+ if ( pDesc->System.u16LimitLow != 0x67
+ || pDesc->System.u4LimitHigh)
+ {
+ pVCpu->hm.s.vmx.fRestoreHostFlags |= VMX_RESTORE_HOST_SEL_TR;
+ /* If the host has made GDT read-only, we would need to temporarily toggle CR0.WP before writing the GDT. */
+ if (pVM->hm.s.fHostKernelFeatures & SUPKERNELFEATURES_GDT_READ_ONLY)
+ pVCpu->hm.s.vmx.fRestoreHostFlags |= VMX_RESTORE_HOST_GDT_READ_ONLY;
+ pVCpu->hm.s.vmx.RestoreHost.uHostSelTR = uSelTR;
- /* Store the GDTR here as we need it while restoring TR. */
- memcpy(&pVCpu->hm.s.vmx.RestoreHost.HostGdtr, &Gdtr, sizeof(X86XDTR64));
- }
+ /* Store the GDTR here as we need it while restoring TR. */
+ memcpy(&pVCpu->hm.s.vmx.RestoreHost.HostGdtr, &Gdtr, sizeof(X86XDTR64));
+ }
#else
- uTRBase = X86DESC_BASE(pDesc);
+ uintptr_t uTRBase = X86DESC_BASE(pDesc);
#endif
- rc = VMXWriteVmcsHstN(VMX_VMCS_HOST_TR_BASE, uTRBase);
- }
+ rc = VMXWriteVmcsHstN(VMX_VMCS_HOST_TR_BASE, uTRBase);
AssertRCReturn(rc, rc);
/*
* Host FS base and GS base.
*/
-#if HC_ARCH_BITS == 64 || defined(VBOX_WITH_HYBRID_32BIT_KERNEL)
- if (HMVMX_IS_64BIT_HOST_MODE())
- {
- uint64_t u64FSBase = ASMRdMsr(MSR_K8_FS_BASE);
- uint64_t u64GSBase = ASMRdMsr(MSR_K8_GS_BASE);
- rc = VMXWriteVmcs64(VMX_VMCS_HOST_FS_BASE, u64FSBase); AssertRCReturn(rc, rc);
- rc = VMXWriteVmcs64(VMX_VMCS_HOST_GS_BASE, u64GSBase); AssertRCReturn(rc, rc);
-
-# if HC_ARCH_BITS == 64
- /* Store the base if we have to restore FS or GS manually as we need to restore the base as well. */
- if (pVCpu->hm.s.vmx.fRestoreHostFlags & VMX_RESTORE_HOST_SEL_FS)
- pVCpu->hm.s.vmx.RestoreHost.uHostFSBase = u64FSBase;
- if (pVCpu->hm.s.vmx.fRestoreHostFlags & VMX_RESTORE_HOST_SEL_GS)
- pVCpu->hm.s.vmx.RestoreHost.uHostGSBase = u64GSBase;
-# endif
- }
+#if HC_ARCH_BITS == 64
+ uint64_t u64FSBase = ASMRdMsr(MSR_K8_FS_BASE);
+ uint64_t u64GSBase = ASMRdMsr(MSR_K8_GS_BASE);
+ rc = VMXWriteVmcs64(VMX_VMCS_HOST_FS_BASE, u64FSBase); AssertRCReturn(rc, rc);
+ rc = VMXWriteVmcs64(VMX_VMCS_HOST_GS_BASE, u64GSBase); AssertRCReturn(rc, rc);
+
+ /* Store the base if we have to restore FS or GS manually as we need to restore the base as well. */
+ if (pVCpu->hm.s.vmx.fRestoreHostFlags & VMX_RESTORE_HOST_SEL_FS)
+ pVCpu->hm.s.vmx.RestoreHost.uHostFSBase = u64FSBase;
+ if (pVCpu->hm.s.vmx.fRestoreHostFlags & VMX_RESTORE_HOST_SEL_GS)
+ pVCpu->hm.s.vmx.RestoreHost.uHostGSBase = u64GSBase;
#endif
return rc;
}
@@ -3177,20 +3011,7 @@ DECLINLINE(int) hmR0VmxSaveHostMsrs(PVM pVM, PVMCPU pVCpu)
*/
rc = VMXWriteVmcs32(VMX_VMCS32_HOST_SYSENTER_CS, ASMRdMsr_Low(MSR_IA32_SYSENTER_CS));
AssertRCReturn(rc, rc);
-#ifdef VBOX_WITH_HYBRID_32BIT_KERNEL
- if (HMVMX_IS_64BIT_HOST_MODE())
- {
- rc = VMXWriteVmcs64(VMX_VMCS_HOST_SYSENTER_ESP, ASMRdMsr(MSR_IA32_SYSENTER_ESP));
- AssertRCReturn(rc, rc);
- rc = VMXWriteVmcs64(VMX_VMCS_HOST_SYSENTER_EIP, ASMRdMsr(MSR_IA32_SYSENTER_EIP));
- }
- else
- {
- rc = VMXWriteVmcs32(VMX_VMCS_HOST_SYSENTER_ESP, ASMRdMsr_Low(MSR_IA32_SYSENTER_ESP));
- AssertRCReturn(rc, rc);
- rc = VMXWriteVmcs32(VMX_VMCS_HOST_SYSENTER_EIP, ASMRdMsr_Low(MSR_IA32_SYSENTER_EIP));
- }
-#elif HC_ARCH_BITS == 32
+#if HC_ARCH_BITS == 32
rc = VMXWriteVmcs32(VMX_VMCS_HOST_SYSENTER_ESP, ASMRdMsr_Low(MSR_IA32_SYSENTER_ESP));
AssertRCReturn(rc, rc);
rc = VMXWriteVmcs32(VMX_VMCS_HOST_SYSENTER_EIP, ASMRdMsr_Low(MSR_IA32_SYSENTER_EIP));
@@ -3243,7 +3064,7 @@ static bool hmR0VmxShouldSwapEferMsr(PVMCPU pVCpu, PCPUMCTX pMixedCtx)
return true;
#endif
-#if HC_ARCH_BITS == 32 && defined(VBOX_ENABLE_64_BITS_GUESTS) && !defined(VBOX_WITH_HYBRID_32BIT_KERNEL)
+#if HC_ARCH_BITS == 32 && defined(VBOX_ENABLE_64_BITS_GUESTS)
/* For 32-bit hosts running 64-bit guests, we always swap EFER in the world-switcher. Nothing to do here. */
if (CPUMIsGuestInLongMode(pVCpu))
return false;
@@ -3383,14 +3204,9 @@ DECLINLINE(int) hmR0VmxLoadGuestExitCtls(PVMCPU pVCpu, PCPUMCTX pMixedCtx)
* Set the host long mode active (EFER.LMA) bit (which Intel calls "Host address-space size") if necessary.
* On VM-exit, VT-x sets both the host EFER.LMA and EFER.LME bit to this value. See assertion in hmR0VmxSaveHostMsrs().
*/
-#if HC_ARCH_BITS == 64 || defined(VBOX_WITH_HYBRID_32BIT_KERNEL)
- if (HMVMX_IS_64BIT_HOST_MODE())
- {
- val |= VMX_VMCS_CTRL_EXIT_HOST_ADDR_SPACE_SIZE;
- Log4(("Load[%RU32]: VMX_VMCS_CTRL_EXIT_HOST_ADDR_SPACE_SIZE\n", pVCpu->idCpu));
- }
- else
- Assert(!(val & VMX_VMCS_CTRL_EXIT_HOST_ADDR_SPACE_SIZE));
+#if HC_ARCH_BITS == 64
+ val |= VMX_VMCS_CTRL_EXIT_HOST_ADDR_SPACE_SIZE;
+ Log4(("Load[%RU32]: VMX_VMCS_CTRL_EXIT_HOST_ADDR_SPACE_SIZE\n", pVCpu->idCpu));
#else
if (CPUMIsGuestInLongModeEx(pMixedCtx))
{
@@ -3400,7 +3216,7 @@ DECLINLINE(int) hmR0VmxLoadGuestExitCtls(PVMCPU pVCpu, PCPUMCTX pMixedCtx)
}
else
Assert(!(val & VMX_VMCS_CTRL_EXIT_HOST_ADDR_SPACE_SIZE));
-#endif /* HC_ARCH_BITS == 64 || defined(VBOX_WITH_HYBRID_32BIT_KERNEL) */
+#endif
/* If the newer VMCS fields for managing EFER exists, use it. */
if ( pVM->hm.s.vmx.fSupportsVmcsEfer
@@ -4192,7 +4008,7 @@ static int hmR0VmxLoadSharedDebugState(PVMCPU pVCpu, PCPUMCTX pMixedCtx)
*
* Note! DBGF expects a clean DR6 state before executing guest code.
*/
-#if HC_ARCH_BITS == 32 && defined(VBOX_WITH_64_BITS_GUESTS) && !defined(VBOX_WITH_HYBRID_32BIT_KERNEL)
+#if HC_ARCH_BITS == 32 && defined(VBOX_WITH_64_BITS_GUESTS)
if ( CPUMIsGuestInLongModeEx(pMixedCtx)
&& !CPUMIsHyperDebugStateActivePending(pVCpu))
{
@@ -4225,7 +4041,7 @@ static int hmR0VmxLoadSharedDebugState(PVMCPU pVCpu, PCPUMCTX pMixedCtx)
*/
if (pMixedCtx->dr[7] & (X86_DR7_ENABLED_MASK | X86_DR7_GD)) /** @todo Why GD? */
{
-#if HC_ARCH_BITS == 32 && defined(VBOX_WITH_64_BITS_GUESTS) && !defined(VBOX_WITH_HYBRID_32BIT_KERNEL)
+#if HC_ARCH_BITS == 32 && defined(VBOX_WITH_64_BITS_GUESTS)
if ( CPUMIsGuestInLongModeEx(pMixedCtx)
&& !CPUMIsGuestDebugStateActivePending(pVCpu))
{
@@ -4250,7 +4066,7 @@ static int hmR0VmxLoadSharedDebugState(PVMCPU pVCpu, PCPUMCTX pMixedCtx)
* If no debugging enabled, we'll lazy load DR0-3. Unlike on AMD-V, we
* must intercept #DB in order to maintain a correct DR6 guest value.
*/
-#if HC_ARCH_BITS == 32 && defined(VBOX_WITH_64_BITS_GUESTS) && !defined(VBOX_WITH_HYBRID_32BIT_KERNEL)
+#if HC_ARCH_BITS == 32 && defined(VBOX_WITH_64_BITS_GUESTS)
else if ( !CPUMIsGuestDebugStateActivePending(pVCpu)
&& !CPUMIsGuestDebugStateActive(pVCpu))
#else
@@ -4325,7 +4141,7 @@ static void hmR0VmxValidateSegmentRegs(PVM pVM, PVMCPU pVCpu, PCPUMCTX pCtx)
Assert( !(pCtx->cs.u32Limit & 0xfff00000)
|| (pCtx->cs.Attr.n.u1Granularity));
/* CS cannot be loaded with NULL in protected mode. */
- Assert(pCtx->cs.Attr.u && !(pCtx->cs.Attr.u & X86DESCATTR_UNUSABLE)); /** @todo is this really true even for 64-bit CS?!? */
+ Assert(pCtx->cs.Attr.u && !(pCtx->cs.Attr.u & X86DESCATTR_UNUSABLE)); /** @todo is this really true even for 64-bit CS? */
if (pCtx->cs.Attr.n.u4Type == 9 || pCtx->cs.Attr.n.u4Type == 11)
Assert(pCtx->cs.Attr.n.u2Dpl == pCtx->ss.Attr.n.u2Dpl);
else if (pCtx->cs.Attr.n.u4Type == 13 || pCtx->cs.Attr.n.u4Type == 15)
@@ -4410,14 +4226,11 @@ static void hmR0VmxValidateSegmentRegs(PVM pVM, PVMCPU pVCpu, PCPUMCTX pCtx)
|| (pCtx->gs.Attr.n.u4Type & X86_SEL_TYPE_READ));
}
/* 64-bit capable CPUs. */
-# if HC_ARCH_BITS == 64 || defined(VBOX_WITH_HYBRID_32BIT_KERNEL)
- if (HMVMX_IS_64BIT_HOST_MODE())
- {
- Assert(!(pCtx->cs.u64Base >> 32));
- Assert(!pCtx->ss.Attr.u || !(pCtx->ss.u64Base >> 32));
- Assert(!pCtx->ds.Attr.u || !(pCtx->ds.u64Base >> 32));
- Assert(!pCtx->es.Attr.u || !(pCtx->es.u64Base >> 32));
- }
+# if HC_ARCH_BITS == 64
+ Assert(!(pCtx->cs.u64Base >> 32));
+ Assert(!pCtx->ss.Attr.u || !(pCtx->ss.u64Base >> 32));
+ Assert(!pCtx->ds.Attr.u || !(pCtx->ds.u64Base >> 32));
+ Assert(!pCtx->es.Attr.u || !(pCtx->es.u64Base >> 32));
# endif
}
else if ( CPUMIsGuestInV86ModeEx(pCtx)
@@ -4462,14 +4275,11 @@ static void hmR0VmxValidateSegmentRegs(PVM pVM, PVMCPU pVCpu, PCPUMCTX pCtx)
Assert(pCtx->gs.u32Limit == 0xffff);
Assert(u32GSAttr == 0xf3);
/* 64-bit capable CPUs. */
-# if HC_ARCH_BITS == 64 || defined(VBOX_WITH_HYBRID_32BIT_KERNEL)
- if (HMVMX_IS_64BIT_HOST_MODE())
- {
- Assert(!(pCtx->cs.u64Base >> 32));
- Assert(!u32SSAttr || !(pCtx->ss.u64Base >> 32));
- Assert(!u32DSAttr || !(pCtx->ds.u64Base >> 32));
- Assert(!u32ESAttr || !(pCtx->es.u64Base >> 32));
- }
+# if HC_ARCH_BITS == 64
+ Assert(!(pCtx->cs.u64Base >> 32));
+ Assert(!u32SSAttr || !(pCtx->ss.u64Base >> 32));
+ Assert(!u32DSAttr || !(pCtx->ds.u64Base >> 32));
+ Assert(!u32ESAttr || !(pCtx->es.u64Base >> 32));
# endif
}
}
@@ -4776,7 +4586,7 @@ static int hmR0VmxLoadGuestMsrs(PVMCPU pVCpu, PCPUMCTX pMixedCtx)
if (HMCPU_CF_IS_PENDING(pVCpu, HM_CHANGED_VMX_GUEST_AUTO_MSRS))
{
/* For 64-bit hosts, we load/restore them lazily, see hmR0VmxLazyLoadGuestMsrs(). */
-#if HC_ARCH_BITS == 32 || defined(VBOX_WITH_HYBRID_32BIT_KERNEL)
+#if HC_ARCH_BITS == 32
if (pVM->hm.s.fAllow64BitGuests)
{
int rc = VINF_SUCCESS;
@@ -4903,7 +4713,7 @@ static int hmR0VmxSetupVMRunHandler(PVMCPU pVCpu, PCPUMCTX pMixedCtx)
return VERR_PGM_UNSUPPORTED_SHADOW_PAGING_MODE;
#endif
Assert(pVCpu->CTX_SUFF(pVM)->hm.s.fAllow64BitGuests); /* Guaranteed by hmR3InitFinalizeR0(). */
-#if HC_ARCH_BITS == 32 && !defined(VBOX_WITH_HYBRID_32BIT_KERNEL)
+#if HC_ARCH_BITS == 32
/* 32-bit host. We need to switch to 64-bit before running the 64-bit guest. */
if (pVCpu->hm.s.vmx.pfnStartVM != VMXR0SwitcherStartVM64)
{
@@ -4917,28 +4727,24 @@ static int hmR0VmxSetupVMRunHandler(PVMCPU pVCpu, PCPUMCTX pMixedCtx)
pVCpu->hm.s.vmx.pfnStartVM = VMXR0SwitcherStartVM64;
}
#else
- /* 64-bit host or hybrid host. */
+ /* 64-bit host. */
pVCpu->hm.s.vmx.pfnStartVM = VMXR0StartVM64;
#endif
}
else
{
/* Guest is not in long mode, use the 32-bit handler. */
-#if HC_ARCH_BITS == 32 && !defined(VBOX_WITH_HYBRID_32BIT_KERNEL)
- if (pVCpu->hm.s.vmx.pfnStartVM != VMXR0StartVM32)
+#if HC_ARCH_BITS == 32
+ if ( pVCpu->hm.s.vmx.pfnStartVM != VMXR0StartVM32
+ && pVCpu->hm.s.vmx.pfnStartVM != NULL) /* Very first entry would have saved host-state already, ignore it. */
{
- if (pVCpu->hm.s.vmx.pfnStartVM != NULL) /* Very first entry would have saved host-state already, ignore it. */
- {
- /* Currently, all mode changes sends us back to ring-3, so these should be set. See @bugref{6944}. */
- AssertMsg(HMCPU_CF_IS_SET(pVCpu, HM_CHANGED_VMX_EXIT_CTLS
- | HM_CHANGED_VMX_ENTRY_CTLS
- | HM_CHANGED_GUEST_EFER_MSR), ("flags=%#x\n", HMCPU_CF_VALUE(pVCpu)));
- }
- pVCpu->hm.s.vmx.pfnStartVM = VMXR0StartVM32;
+ /* Currently, all mode changes sends us back to ring-3, so these should be set. See @bugref{6944}. */
+ AssertMsg(HMCPU_CF_IS_SET(pVCpu, HM_CHANGED_VMX_EXIT_CTLS
+ | HM_CHANGED_VMX_ENTRY_CTLS
+ | HM_CHANGED_GUEST_EFER_MSR), ("flags=%#x\n", HMCPU_CF_VALUE(pVCpu)));
}
-#else
- pVCpu->hm.s.vmx.pfnStartVM = VMXR0StartVM32;
#endif
+ pVCpu->hm.s.vmx.pfnStartVM = VMXR0StartVM32;
}
Assert(pVCpu->hm.s.vmx.pfnStartVM);
return VINF_SUCCESS;
@@ -5023,7 +4829,7 @@ static void hmR0VmxReportWorldSwitchError(PVM pVM, PVMCPU pVCpu, int rcVMRun, PC
/* VMX control bits. */
uint32_t u32Val;
uint64_t u64Val;
- HMVMXHCUINTREG uHCReg;
+ RTHCUINTREG uHCReg;
rc = VMXReadVmcs32(VMX_VMCS32_CTRL_PIN_EXEC, &u32Val); AssertRC(rc);
Log4(("VMX_VMCS32_CTRL_PIN_EXEC %#RX32\n", u32Val));
rc = VMXReadVmcs32(VMX_VMCS32_CTRL_PROC_EXEC, &u32Val); AssertRC(rc);
@@ -5160,16 +4966,13 @@ static void hmR0VmxReportWorldSwitchError(PVM pVM, PVMCPU pVCpu, int rcVMRun, PC
Log4(("Host RSP %#RHv\n", uHCReg));
rc = VMXReadVmcsHstN(VMX_VMCS_HOST_RIP, &uHCReg); AssertRC(rc);
Log4(("Host RIP %#RHv\n", uHCReg));
-# if HC_ARCH_BITS == 64 || defined(VBOX_WITH_HYBRID_32BIT_KERNEL)
- if (HMVMX_IS_64BIT_HOST_MODE())
- {
- Log4(("MSR_K6_EFER = %#RX64\n", ASMRdMsr(MSR_K6_EFER)));
- Log4(("MSR_K8_CSTAR = %#RX64\n", ASMRdMsr(MSR_K8_CSTAR)));
- Log4(("MSR_K8_LSTAR = %#RX64\n", ASMRdMsr(MSR_K8_LSTAR)));
- Log4(("MSR_K6_STAR = %#RX64\n", ASMRdMsr(MSR_K6_STAR)));
- Log4(("MSR_K8_SF_MASK = %#RX64\n", ASMRdMsr(MSR_K8_SF_MASK)));
- Log4(("MSR_K8_KERNEL_GS_BASE = %#RX64\n", ASMRdMsr(MSR_K8_KERNEL_GS_BASE)));
- }
+# if HC_ARCH_BITS == 64
+ Log4(("MSR_K6_EFER = %#RX64\n", ASMRdMsr(MSR_K6_EFER)));
+ Log4(("MSR_K8_CSTAR = %#RX64\n", ASMRdMsr(MSR_K8_CSTAR)));
+ Log4(("MSR_K8_LSTAR = %#RX64\n", ASMRdMsr(MSR_K8_LSTAR)));
+ Log4(("MSR_K6_STAR = %#RX64\n", ASMRdMsr(MSR_K6_STAR)));
+ Log4(("MSR_K8_SF_MASK = %#RX64\n", ASMRdMsr(MSR_K8_SF_MASK)));
+ Log4(("MSR_K8_KERNEL_GS_BASE = %#RX64\n", ASMRdMsr(MSR_K8_KERNEL_GS_BASE)));
# endif
#endif /* VBOX_STRICT */
break;
@@ -5184,7 +4987,7 @@ static void hmR0VmxReportWorldSwitchError(PVM pVM, PVMCPU pVCpu, int rcVMRun, PC
}
-#if HC_ARCH_BITS == 32 && defined(VBOX_ENABLE_64_BITS_GUESTS) && !defined(VBOX_WITH_HYBRID_32BIT_KERNEL)
+#if HC_ARCH_BITS == 32 && defined(VBOX_ENABLE_64_BITS_GUESTS)
#ifndef VMX_USE_CACHED_VMCS_ACCESSES
# error "VMX_USE_CACHED_VMCS_ACCESSES not defined when it should be!"
#endif
@@ -5615,48 +5418,7 @@ VMMR0DECL(int) VMXWriteCachedVmcsEx(PVMCPU pVCpu, uint32_t idxField, uint64_t u6
pCache->Write.cValidEntries++;
return VINF_SUCCESS;
}
-
-/* Enable later when the assembly code uses these as callbacks. */
-#if 0
-/*
- * Loads the VMCS write-cache into the CPU (by executing VMWRITEs).
- *
- * @param pVCpu Pointer to the VMCPU.
- * @param pCache Pointer to the VMCS cache.
- *
- * @remarks No-long-jump zone!!!
- */
-VMMR0DECL(void) VMXWriteCachedVmcsLoad(PVMCPU pVCpu, PVMCSCACHE pCache)
-{
- AssertPtr(pCache);
- for (uint32_t i = 0; i < pCache->Write.cValidEntries; i++)
- {
- int rc = VMXWriteVmcs64(pCache->Write.aField[i], pCache->Write.aFieldVal[i]);
- AssertRC(rc);
- }
- pCache->Write.cValidEntries = 0;
-}
-
-
-/**
- * Stores the VMCS read-cache from the CPU (by executing VMREADs).
- *
- * @param pVCpu Pointer to the VMCPU.
- * @param pCache Pointer to the VMCS cache.
- *
- * @remarks No-long-jump zone!!!
- */
-VMMR0DECL(void) VMXReadCachedVmcsStore(PVMCPU pVCpu, PVMCSCACHE pCache)
-{
- AssertPtr(pCache);
- for (uint32_t i = 0; i < pCache->Read.cValidEntries; i++)
- {
- int rc = VMXReadVmcs64(pCache->Read.aField[i], &pCache->Read.aFieldVal[i]);
- AssertRC(rc);
- }
-}
-#endif
-#endif /* HC_ARCH_BITS == 32 && defined(VBOX_ENABLE_64_BITS_GUESTS) && !defined(VBOX_WITH_HYBRID_32BIT_KERNEL) */
+#endif /* HC_ARCH_BITS == 32 && defined(VBOX_ENABLE_64_BITS_GUESTS) */
/**
@@ -7372,7 +7134,7 @@ static int hmR0VmxExitToRing3(PVM pVM, PVMCPU pVCpu, PCPUMCTX pMixedCtx, int rcE
* may be out-of-sync. Make sure to update the required
* fields before using them.
*/
-DECLCALLBACK(int) hmR0VmxCallRing3Callback(PVMCPU pVCpu, VMMCALLRING3 enmOperation, void *pvUser)
+static DECLCALLBACK(int) hmR0VmxCallRing3Callback(PVMCPU pVCpu, VMMCALLRING3 enmOperation, void *pvUser)
{
if (enmOperation == VMMCALLRING3_VM_R0_ASSERTION)
{
@@ -8750,7 +8512,7 @@ static void hmR0VmxPreRunGuestCommitted(PVM pVM, PVMCPU pVCpu, PCPUMCTX pMixedCt
AssertMsg(!HMCPU_CF_VALUE(pVCpu), ("fContextUseFlags=%#RX32\n", HMCPU_CF_VALUE(pVCpu)));
/* Store status of the shared guest-host state at the time of VM-entry. */
-#if HC_ARCH_BITS == 32 && defined(VBOX_WITH_64_BITS_GUESTS) && !defined(VBOX_WITH_HYBRID_32BIT_KERNEL)
+#if HC_ARCH_BITS == 32 && defined(VBOX_WITH_64_BITS_GUESTS)
if (CPUMIsGuestInLongModeEx(pMixedCtx))
{
pVmxTransient->fWasGuestDebugStateActive = CPUMIsGuestDebugStateActivePending(pVCpu);
@@ -8779,7 +8541,7 @@ static void hmR0VmxPreRunGuestCommitted(PVM pVM, PVMCPU pVCpu, PCPUMCTX pMixedCt
pVmxTransient->fUpdateTscOffsettingAndPreemptTimer = false;
}
- ASMAtomicWriteBool(&pVCpu->hm.s.fCheckedTLBFlush, true); /* Used for TLB-shootdowns, set this across the world switch. */
+ ASMAtomicWriteBool(&pVCpu->hm.s.fCheckedTLBFlush, true); /* Used for TLB flushing, set this across the world switch. */
hmR0VmxFlushTaggedTlb(pVCpu, pCpu); /* Invalidate the appropriate guest entries from the TLB. */
Assert(idCurrentCpu == pVCpu->hm.s.idLastCpu);
pVCpu->hm.s.vmx.LastError.idCurrentCpu = idCurrentCpu; /* Update the error reporting info. with the current host CPU. */
@@ -8852,8 +8614,8 @@ static void hmR0VmxPostRunGuest(PVM pVM, PVMCPU pVCpu, PCPUMCTX pMixedCtx, PVMXT
Assert(!VMMRZCallRing3IsEnabled(pVCpu));
- ASMAtomicWriteBool(&pVCpu->hm.s.fCheckedTLBFlush, false); /* See HMInvalidatePageOnAllVCpus(): used for TLB-shootdowns. */
- ASMAtomicIncU32(&pVCpu->hm.s.cWorldSwitchExits); /* Initialized in vmR3CreateUVM(): used for TLB-shootdowns. */
+ ASMAtomicWriteBool(&pVCpu->hm.s.fCheckedTLBFlush, false); /* See HMInvalidatePageOnAllVCpus(): used for TLB flushing. */
+ ASMAtomicIncU32(&pVCpu->hm.s.cWorldSwitchExits); /* Initialized in vmR3CreateUVM(): used for EMT poking. */
HMVMXCPU_GST_RESET_TO(pVCpu, 0); /* Exits/longjmps to ring-3 requires saving the guest state. */
pVmxTransient->fVmcsFieldsRead = 0; /* Transient fields need to be read from the VMCS. */
pVmxTransient->fVectoringPF = false; /* Vectoring page-fault needs to be determined later. */
@@ -9510,38 +9272,33 @@ static uint32_t hmR0VmxCheckGuestState(PVM pVM, PVMCPU pVCpu, PCPUMCTX pCtx)
* RIP and RFLAGS.
*/
uint32_t u32Eflags;
-#if HC_ARCH_BITS == 64 || defined(VBOX_WITH_HYBRID_32BIT_KERNEL)
- if (HMVMX_IS_64BIT_HOST_MODE())
+#if HC_ARCH_BITS == 64
+ rc = VMXReadVmcs64(VMX_VMCS_GUEST_RIP, &u64Val);
+ AssertRCBreak(rc);
+ /* pCtx->rip can be different than the one in the VMCS (e.g. run guest code and VM-exits that don't update it). */
+ if ( !fLongModeGuest
+ || !pCtx->cs.Attr.n.u1Long)
{
- rc = VMXReadVmcs64(VMX_VMCS_GUEST_RIP, &u64Val);
- AssertRCBreak(rc);
- /* pCtx->rip can be different than the one in the VMCS (e.g. run guest code and VM-exits that don't update it). */
- if ( !fLongModeGuest
- || !pCtx->cs.Attr.n.u1Long)
- {
- HMVMX_CHECK_BREAK(!(u64Val & UINT64_C(0xffffffff00000000)), VMX_IGS_LONGMODE_RIP_INVALID);
- }
- /** @todo If the processor supports N < 64 linear-address bits, bits 63:N
- * must be identical if the "IA-32e mode guest" VM-entry
- * control is 1 and CS.L is 1. No check applies if the
- * CPU supports 64 linear-address bits. */
-
- /* Flags in pCtx can be different (real-on-v86 for instance). We are only concerned about the VMCS contents here. */
- rc = VMXReadVmcs64(VMX_VMCS_GUEST_RFLAGS, &u64Val);
- AssertRCBreak(rc);
- HMVMX_CHECK_BREAK(!(u64Val & UINT64_C(0xffffffffffc08028)), /* Bit 63:22, Bit 15, 5, 3 MBZ. */
- VMX_IGS_RFLAGS_RESERVED);
- HMVMX_CHECK_BREAK((u64Val & X86_EFL_RA1_MASK), VMX_IGS_RFLAGS_RESERVED1); /* Bit 1 MB1. */
- u32Eflags = u64Val;
+ HMVMX_CHECK_BREAK(!(u64Val & UINT64_C(0xffffffff00000000)), VMX_IGS_LONGMODE_RIP_INVALID);
}
- else
+ /** @todo If the processor supports N < 64 linear-address bits, bits 63:N
+ * must be identical if the "IA-32e mode guest" VM-entry
+ * control is 1 and CS.L is 1. No check applies if the
+ * CPU supports 64 linear-address bits. */
+
+ /* Flags in pCtx can be different (real-on-v86 for instance). We are only concerned about the VMCS contents here. */
+ rc = VMXReadVmcs64(VMX_VMCS_GUEST_RFLAGS, &u64Val);
+ AssertRCBreak(rc);
+ HMVMX_CHECK_BREAK(!(u64Val & UINT64_C(0xffffffffffc08028)), /* Bit 63:22, Bit 15, 5, 3 MBZ. */
+ VMX_IGS_RFLAGS_RESERVED);
+ HMVMX_CHECK_BREAK((u64Val & X86_EFL_RA1_MASK), VMX_IGS_RFLAGS_RESERVED1); /* Bit 1 MB1. */
+ u32Eflags = u64Val;
+#else
+ rc = VMXReadVmcs32(VMX_VMCS_GUEST_RFLAGS, &u32Eflags);
+ AssertRCBreak(rc);
+ HMVMX_CHECK_BREAK(!(u32Eflags & 0xffc08028), VMX_IGS_RFLAGS_RESERVED); /* Bit 31:22, Bit 15, 5, 3 MBZ. */
+ HMVMX_CHECK_BREAK((u32Eflags & X86_EFL_RA1_MASK), VMX_IGS_RFLAGS_RESERVED1); /* Bit 1 MB1. */
#endif
- {
- rc = VMXReadVmcs32(VMX_VMCS_GUEST_RFLAGS, &u32Eflags);
- AssertRCBreak(rc);
- HMVMX_CHECK_BREAK(!(u32Eflags & 0xffc08028), VMX_IGS_RFLAGS_RESERVED); /* Bit 31:22, Bit 15, 5, 3 MBZ. */
- HMVMX_CHECK_BREAK((u32Eflags & X86_EFL_RA1_MASK), VMX_IGS_RFLAGS_RESERVED1); /* Bit 1 MB1. */
- }
if ( fLongModeGuest
|| ( fUnrestrictedGuest
@@ -9562,38 +9319,35 @@ static uint32_t hmR0VmxCheckGuestState(PVM pVM, PVMCPU pVCpu, PCPUMCTX pCtx)
/*
* 64-bit checks.
*/
-#if HC_ARCH_BITS == 64 || defined(VBOX_WITH_HYBRID_32BIT_KERNEL)
- if (HMVMX_IS_64BIT_HOST_MODE())
+#if HC_ARCH_BITS == 64
+ if (fLongModeGuest)
{
- if (fLongModeGuest)
- {
- HMVMX_CHECK_BREAK(u32GuestCR0 & X86_CR0_PG, VMX_IGS_CR0_PG_LONGMODE);
- HMVMX_CHECK_BREAK(u32GuestCR4 & X86_CR4_PAE, VMX_IGS_CR4_PAE_LONGMODE);
- }
+ HMVMX_CHECK_BREAK(u32GuestCR0 & X86_CR0_PG, VMX_IGS_CR0_PG_LONGMODE);
+ HMVMX_CHECK_BREAK(u32GuestCR4 & X86_CR4_PAE, VMX_IGS_CR4_PAE_LONGMODE);
+ }
- if ( !fLongModeGuest
- && (u32GuestCR4 & X86_CR4_PCIDE))
- {
- HMVMX_ERROR_BREAK(VMX_IGS_CR4_PCIDE);
- }
+ if ( !fLongModeGuest
+ && (u32GuestCR4 & X86_CR4_PCIDE))
+ {
+ HMVMX_ERROR_BREAK(VMX_IGS_CR4_PCIDE);
+ }
- /** @todo CR3 field must be such that bits 63:52 and bits in the range
- * 51:32 beyond the processor's physical-address width are 0. */
+ /** @todo CR3 field must be such that bits 63:52 and bits in the range
+ * 51:32 beyond the processor's physical-address width are 0. */
- if ( (pVCpu->hm.s.vmx.u32EntryCtls & VMX_VMCS_CTRL_ENTRY_LOAD_DEBUG)
- && (pCtx->dr[7] & X86_DR7_MBZ_MASK))
- {
- HMVMX_ERROR_BREAK(VMX_IGS_DR7_RESERVED);
- }
+ if ( (pVCpu->hm.s.vmx.u32EntryCtls & VMX_VMCS_CTRL_ENTRY_LOAD_DEBUG)
+ && (pCtx->dr[7] & X86_DR7_MBZ_MASK))
+ {
+ HMVMX_ERROR_BREAK(VMX_IGS_DR7_RESERVED);
+ }
- rc = VMXReadVmcs64(VMX_VMCS_HOST_SYSENTER_ESP, &u64Val);
- AssertRCBreak(rc);
- HMVMX_CHECK_BREAK(X86_IS_CANONICAL(u64Val), VMX_IGS_SYSENTER_ESP_NOT_CANONICAL);
+ rc = VMXReadVmcs64(VMX_VMCS_HOST_SYSENTER_ESP, &u64Val);
+ AssertRCBreak(rc);
+ HMVMX_CHECK_BREAK(X86_IS_CANONICAL(u64Val), VMX_IGS_SYSENTER_ESP_NOT_CANONICAL);
- rc = VMXReadVmcs64(VMX_VMCS_HOST_SYSENTER_EIP, &u64Val);
- AssertRCBreak(rc);
- HMVMX_CHECK_BREAK(X86_IS_CANONICAL(u64Val), VMX_IGS_SYSENTER_EIP_NOT_CANONICAL);
- }
+ rc = VMXReadVmcs64(VMX_VMCS_HOST_SYSENTER_EIP, &u64Val);
+ AssertRCBreak(rc);
+ HMVMX_CHECK_BREAK(X86_IS_CANONICAL(u64Val), VMX_IGS_SYSENTER_EIP_NOT_CANONICAL);
#endif
/*
@@ -9641,7 +9395,8 @@ static uint32_t hmR0VmxCheckGuestState(PVM pVM, PVMCPU pVCpu, PCPUMCTX pCtx)
AssertRCBreak(rc);
HMVMX_CHECK_BREAK(!(u64Val & UINT64_C(0xfffffffffffff2fe)),
VMX_IGS_EFER_MSR_RESERVED); /* Bits 63:12, bit 9, bits 7:1 MBZ. */
- HMVMX_CHECK_BREAK(RT_BOOL(u64Val & MSR_K6_EFER_LMA) == RT_BOOL(pVCpu->hm.s.vmx.u32EntryCtls & VMX_VMCS_CTRL_ENTRY_IA32E_MODE_GUEST),
+ HMVMX_CHECK_BREAK(RT_BOOL(u64Val & MSR_K6_EFER_LMA) == RT_BOOL( pVCpu->hm.s.vmx.u32EntryCtls
+ & VMX_VMCS_CTRL_ENTRY_IA32E_MODE_GUEST),
VMX_IGS_EFER_LMA_GUEST_MODE_MISMATCH);
HMVMX_CHECK_BREAK( fUnrestrictedGuest
|| !(u32GuestCR0 & X86_CR0_PG)
@@ -9763,21 +9518,18 @@ static uint32_t hmR0VmxCheckGuestState(PVM pVM, PVMCPU pVCpu, PCPUMCTX pCtx)
|| (pCtx->gs.Attr.n.u4Type & X86_SEL_TYPE_READ), VMX_IGS_GS_ATTR_TYPE_INVALID);
}
/* 64-bit capable CPUs. */
-#if HC_ARCH_BITS == 64 || defined(VBOX_WITH_HYBRID_32BIT_KERNEL)
- if (HMVMX_IS_64BIT_HOST_MODE())
- {
- HMVMX_CHECK_BREAK(X86_IS_CANONICAL(pCtx->fs.u64Base), VMX_IGS_FS_BASE_NOT_CANONICAL);
- HMVMX_CHECK_BREAK(X86_IS_CANONICAL(pCtx->gs.u64Base), VMX_IGS_GS_BASE_NOT_CANONICAL);
- HMVMX_CHECK_BREAK( (pCtx->ldtr.Attr.u & X86DESCATTR_UNUSABLE)
- || X86_IS_CANONICAL(pCtx->ldtr.u64Base), VMX_IGS_LDTR_BASE_NOT_CANONICAL);
- HMVMX_CHECK_BREAK(!(pCtx->cs.u64Base >> 32), VMX_IGS_LONGMODE_CS_BASE_INVALID);
- HMVMX_CHECK_BREAK((pCtx->ss.Attr.u & X86DESCATTR_UNUSABLE) || !(pCtx->ss.u64Base >> 32),
- VMX_IGS_LONGMODE_SS_BASE_INVALID);
- HMVMX_CHECK_BREAK((pCtx->ds.Attr.u & X86DESCATTR_UNUSABLE) || !(pCtx->ds.u64Base >> 32),
- VMX_IGS_LONGMODE_DS_BASE_INVALID);
- HMVMX_CHECK_BREAK((pCtx->es.Attr.u & X86DESCATTR_UNUSABLE) || !(pCtx->es.u64Base >> 32),
- VMX_IGS_LONGMODE_ES_BASE_INVALID);
- }
+#if HC_ARCH_BITS == 64
+ HMVMX_CHECK_BREAK(X86_IS_CANONICAL(pCtx->fs.u64Base), VMX_IGS_FS_BASE_NOT_CANONICAL);
+ HMVMX_CHECK_BREAK(X86_IS_CANONICAL(pCtx->gs.u64Base), VMX_IGS_GS_BASE_NOT_CANONICAL);
+ HMVMX_CHECK_BREAK( (pCtx->ldtr.Attr.u & X86DESCATTR_UNUSABLE)
+ || X86_IS_CANONICAL(pCtx->ldtr.u64Base), VMX_IGS_LDTR_BASE_NOT_CANONICAL);
+ HMVMX_CHECK_BREAK(!(pCtx->cs.u64Base >> 32), VMX_IGS_LONGMODE_CS_BASE_INVALID);
+ HMVMX_CHECK_BREAK((pCtx->ss.Attr.u & X86DESCATTR_UNUSABLE) || !(pCtx->ss.u64Base >> 32),
+ VMX_IGS_LONGMODE_SS_BASE_INVALID);
+ HMVMX_CHECK_BREAK((pCtx->ds.Attr.u & X86DESCATTR_UNUSABLE) || !(pCtx->ds.u64Base >> 32),
+ VMX_IGS_LONGMODE_DS_BASE_INVALID);
+ HMVMX_CHECK_BREAK((pCtx->es.Attr.u & X86DESCATTR_UNUSABLE) || !(pCtx->es.u64Base >> 32),
+ VMX_IGS_LONGMODE_ES_BASE_INVALID);
#endif
}
else
@@ -9822,21 +9574,18 @@ static uint32_t hmR0VmxCheckGuestState(PVM pVM, PVMCPU pVCpu, PCPUMCTX pCtx)
HMVMX_CHECK_BREAK(pCtx->gs.u32Limit == 0xffff, VMX_IGS_V86_GS_LIMIT_INVALID);
HMVMX_CHECK_BREAK(u32GSAttr == 0xf3, VMX_IGS_V86_GS_ATTR_INVALID);
/* 64-bit capable CPUs. */
-#if HC_ARCH_BITS == 64 || defined(VBOX_WITH_HYBRID_32BIT_KERNEL)
- if (HMVMX_IS_64BIT_HOST_MODE())
- {
- HMVMX_CHECK_BREAK(X86_IS_CANONICAL(pCtx->fs.u64Base), VMX_IGS_FS_BASE_NOT_CANONICAL);
- HMVMX_CHECK_BREAK(X86_IS_CANONICAL(pCtx->gs.u64Base), VMX_IGS_GS_BASE_NOT_CANONICAL);
- HMVMX_CHECK_BREAK( (pCtx->ldtr.Attr.u & X86DESCATTR_UNUSABLE)
- || X86_IS_CANONICAL(pCtx->ldtr.u64Base), VMX_IGS_LDTR_BASE_NOT_CANONICAL);
- HMVMX_CHECK_BREAK(!(pCtx->cs.u64Base >> 32), VMX_IGS_LONGMODE_CS_BASE_INVALID);
- HMVMX_CHECK_BREAK((pCtx->ss.Attr.u & X86DESCATTR_UNUSABLE) || !(pCtx->ss.u64Base >> 32),
- VMX_IGS_LONGMODE_SS_BASE_INVALID);
- HMVMX_CHECK_BREAK((pCtx->ds.Attr.u & X86DESCATTR_UNUSABLE) || !(pCtx->ds.u64Base >> 32),
- VMX_IGS_LONGMODE_DS_BASE_INVALID);
- HMVMX_CHECK_BREAK((pCtx->es.Attr.u & X86DESCATTR_UNUSABLE) || !(pCtx->es.u64Base >> 32),
- VMX_IGS_LONGMODE_ES_BASE_INVALID);
- }
+#if HC_ARCH_BITS == 64
+ HMVMX_CHECK_BREAK(X86_IS_CANONICAL(pCtx->fs.u64Base), VMX_IGS_FS_BASE_NOT_CANONICAL);
+ HMVMX_CHECK_BREAK(X86_IS_CANONICAL(pCtx->gs.u64Base), VMX_IGS_GS_BASE_NOT_CANONICAL);
+ HMVMX_CHECK_BREAK( (pCtx->ldtr.Attr.u & X86DESCATTR_UNUSABLE)
+ || X86_IS_CANONICAL(pCtx->ldtr.u64Base), VMX_IGS_LDTR_BASE_NOT_CANONICAL);
+ HMVMX_CHECK_BREAK(!(pCtx->cs.u64Base >> 32), VMX_IGS_LONGMODE_CS_BASE_INVALID);
+ HMVMX_CHECK_BREAK((pCtx->ss.Attr.u & X86DESCATTR_UNUSABLE) || !(pCtx->ss.u64Base >> 32),
+ VMX_IGS_LONGMODE_SS_BASE_INVALID);
+ HMVMX_CHECK_BREAK((pCtx->ds.Attr.u & X86DESCATTR_UNUSABLE) || !(pCtx->ds.u64Base >> 32),
+ VMX_IGS_LONGMODE_DS_BASE_INVALID);
+ HMVMX_CHECK_BREAK((pCtx->es.Attr.u & X86DESCATTR_UNUSABLE) || !(pCtx->es.u64Base >> 32),
+ VMX_IGS_LONGMODE_ES_BASE_INVALID);
#endif
}
@@ -9845,11 +9594,8 @@ static uint32_t hmR0VmxCheckGuestState(PVM pVM, PVMCPU pVCpu, PCPUMCTX pCtx)
*/
HMVMX_CHECK_BREAK(!(pCtx->tr.Sel & X86_SEL_LDT), VMX_IGS_TR_TI_INVALID);
/* 64-bit capable CPUs. */
-#if HC_ARCH_BITS == 64 || defined(VBOX_WITH_HYBRID_32BIT_KERNEL)
- if (HMVMX_IS_64BIT_HOST_MODE())
- {
- HMVMX_CHECK_BREAK(X86_IS_CANONICAL(pCtx->tr.u64Base), VMX_IGS_TR_BASE_NOT_CANONICAL);
- }
+#if HC_ARCH_BITS == 64
+ HMVMX_CHECK_BREAK(X86_IS_CANONICAL(pCtx->tr.u64Base), VMX_IGS_TR_BASE_NOT_CANONICAL);
#endif
if (fLongModeGuest)
{
@@ -9874,17 +9620,14 @@ static uint32_t hmR0VmxCheckGuestState(PVM pVM, PVMCPU pVCpu, PCPUMCTX pCtx)
/*
* GDTR and IDTR.
*/
-#if HC_ARCH_BITS == 64 || defined(VBOX_WITH_HYBRID_32BIT_KERNEL)
- if (HMVMX_IS_64BIT_HOST_MODE())
- {
- rc = VMXReadVmcs64(VMX_VMCS_GUEST_GDTR_BASE, &u64Val);
- AssertRCBreak(rc);
- HMVMX_CHECK_BREAK(X86_IS_CANONICAL(u64Val), VMX_IGS_GDTR_BASE_NOT_CANONICAL);
+#if HC_ARCH_BITS == 64
+ rc = VMXReadVmcs64(VMX_VMCS_GUEST_GDTR_BASE, &u64Val);
+ AssertRCBreak(rc);
+ HMVMX_CHECK_BREAK(X86_IS_CANONICAL(u64Val), VMX_IGS_GDTR_BASE_NOT_CANONICAL);
- rc = VMXReadVmcs64(VMX_VMCS_GUEST_IDTR_BASE, &u64Val);
- AssertRCBreak(rc);
- HMVMX_CHECK_BREAK(X86_IS_CANONICAL(u64Val), VMX_IGS_IDTR_BASE_NOT_CANONICAL);
- }
+ rc = VMXReadVmcs64(VMX_VMCS_GUEST_IDTR_BASE, &u64Val);
+ AssertRCBreak(rc);
+ HMVMX_CHECK_BREAK(X86_IS_CANONICAL(u64Val), VMX_IGS_IDTR_BASE_NOT_CANONICAL);
#endif
rc = VMXReadVmcs32(VMX_VMCS32_GUEST_GDTR_LIMIT, &u32Val);
@@ -9963,21 +9706,18 @@ static uint32_t hmR0VmxCheckGuestState(PVM pVM, PVMCPU pVCpu, PCPUMCTX pCtx)
}
/* Pending debug exceptions. */
- if (HMVMX_IS_64BIT_HOST_MODE())
- {
- rc = VMXReadVmcs64(VMX_VMCS_GUEST_PENDING_DEBUG_EXCEPTIONS, &u64Val);
- AssertRCBreak(rc);
- /* Bits 63:15, Bit 13, Bits 11:4 MBZ. */
- HMVMX_CHECK_BREAK(!(u64Val & UINT64_C(0xffffffffffffaff0)), VMX_IGS_LONGMODE_PENDING_DEBUG_RESERVED);
- u32Val = u64Val; /* For pending debug exceptions checks below. */
- }
- else
- {
- rc = VMXReadVmcs32(VMX_VMCS_GUEST_PENDING_DEBUG_EXCEPTIONS, &u32Val);
- AssertRCBreak(rc);
- /* Bits 31:15, Bit 13, Bits 11:4 MBZ. */
- HMVMX_CHECK_BREAK(!(u64Val & 0xffffaff0), VMX_IGS_PENDING_DEBUG_RESERVED);
- }
+#if HC_ARCH_BITS == 64
+ rc = VMXReadVmcs64(VMX_VMCS_GUEST_PENDING_DEBUG_EXCEPTIONS, &u64Val);
+ AssertRCBreak(rc);
+ /* Bits 63:15, Bit 13, Bits 11:4 MBZ. */
+ HMVMX_CHECK_BREAK(!(u64Val & UINT64_C(0xffffffffffffaff0)), VMX_IGS_LONGMODE_PENDING_DEBUG_RESERVED);
+ u32Val = u64Val; /* For pending debug exceptions checks below. */
+#else
+ rc = VMXReadVmcs32(VMX_VMCS_GUEST_PENDING_DEBUG_EXCEPTIONS, &u32Val);
+ AssertRCBreak(rc);
+ /* Bits 31:15, Bit 13, Bits 11:4 MBZ. */
+ HMVMX_CHECK_BREAK(!(u32Val & 0xffffaff0), VMX_IGS_PENDING_DEBUG_RESERVED);
+#endif
if ( (u32IntrState & VMX_VMCS_GUEST_INTERRUPTIBILITY_STATE_BLOCK_STI)
|| (u32IntrState & VMX_VMCS_GUEST_INTERRUPTIBILITY_STATE_BLOCK_MOVSS)
@@ -10706,7 +10446,7 @@ HMVMX_EXIT_DECL hmR0VmxExitErrInvalidGuestState(PVMCPU pVCpu, PCPUMCTX pMixedCtx
#ifdef VBOX_STRICT
uint32_t uIntrState;
- HMVMXHCUINTREG uHCReg;
+ RTHCUINTREG uHCReg;
uint64_t u64Val;
uint32_t u32Val;
@@ -10838,7 +10578,8 @@ HMVMX_EXIT_DECL hmR0VmxExitRdmsr(PVMCPU pVCpu, PCPUMCTX pMixedCtx, PVMXTRANSIENT
if ( hmR0VmxIsAutoLoadStoreGuestMsr(pVCpu, pMixedCtx->ecx)
&& pMixedCtx->ecx != MSR_K6_EFER)
{
- AssertMsgFailed(("Unexpected RDMSR for an MSR in the auto-load/store area in the VMCS. ecx=%#RX32\n", pMixedCtx->ecx));
+ AssertMsgFailed(("Unexpected RDMSR for an MSR in the auto-load/store area in the VMCS. ecx=%#RX32\n",
+ pMixedCtx->ecx));
HMVMX_RETURN_UNEXPECTED_EXIT();
}
# if HC_ARCH_BITS == 64
@@ -11129,7 +10870,8 @@ HMVMX_EXIT_DECL hmR0VmxExitMovCRx(PVMCPU pVCpu, PCPUMCTX pMixedCtx, PVMXTRANSIEN
AssertRCReturn(rc, rc);
rcStrict = IEMExecDecodedLmsw(pVCpu, pVmxTransient->cbInstr,
VMX_EXIT_QUALIFICATION_CRX_LMSW_DATA(uExitQualification));
- AssertMsg(rcStrict == VINF_SUCCESS || rcStrict == VINF_IEM_RAISED_XCPT || rcStrict == VINF_PGM_CHANGE_MODE, ("%Rrc\n", VBOXSTRICTRC_VAL(rcStrict)));
+ AssertMsg(rcStrict == VINF_SUCCESS || rcStrict == VINF_IEM_RAISED_XCPT || rcStrict == VINF_PGM_CHANGE_MODE,
+ ("%Rrc\n", VBOXSTRICTRC_VAL(rcStrict)));
STAM_COUNTER_INC(&pVCpu->hm.s.StatExitLmsw);
Log4(("CRX LMSW rcStrict=%d\n", VBOXSTRICTRC_VAL(rcStrict)));
break;
@@ -11184,14 +10926,16 @@ HMVMX_EXIT_DECL hmR0VmxExitIoInstr(PVMCPU pVCpu, PCPUMCTX pMixedCtx, PVMXTRANSIE
PVM pVM = pVCpu->CTX_SUFF(pVM);
if (fIOString)
{
-#ifdef VBOX_WITH_2ND_IEM_STEP /* This used to gurus with debian 32-bit guest without NP (on ATA reads). See @bugref{5752#c158}. Should work now. */
+#ifdef VBOX_WITH_2ND_IEM_STEP /* This used to gurus with debian 32-bit guest without NP (on ATA reads).
+ See @bugref{5752#c158}. Should work now. */
/*
* INS/OUTS - I/O String instruction.
*
* Use instruction-information if available, otherwise fall back on
* interpreting the instruction.
*/
- Log4(("CS:RIP=%04x:%08RX64 %#06x/%u %c str\n", pMixedCtx->cs.Sel, pMixedCtx->rip, uIOPort, cbValue, fIOWrite ? 'w' : 'r'));
+ Log4(("CS:RIP=%04x:%08RX64 %#06x/%u %c str\n", pMixedCtx->cs.Sel, pMixedCtx->rip, uIOPort, cbValue,
+ fIOWrite ? 'w' : 'r'));
AssertReturn(pMixedCtx->dx == uIOPort, VERR_VMX_IPE_2);
if (MSR_IA32_VMX_BASIC_INFO_VMCS_INS_OUTS(pVM->hm.s.vmx.Msrs.u64BasicInfo))
{
@@ -11249,7 +10993,8 @@ HMVMX_EXIT_DECL hmR0VmxExitIoInstr(PVMCPU pVCpu, PCPUMCTX pMixedCtx, PVMXTRANSIE
}
else
{
- AssertMsg(rcStrict == VERR_EM_INTERPRETER, ("rcStrict=%Rrc RIP %#RX64\n", VBOXSTRICTRC_VAL(rcStrict), pMixedCtx->rip));
+ AssertMsg(rcStrict == VERR_EM_INTERPRETER, ("rcStrict=%Rrc RIP=%#RX64\n", VBOXSTRICTRC_VAL(rcStrict),
+ pMixedCtx->rip));
rcStrict = VINF_EM_RAW_EMULATE_INSTR;
}
#endif
@@ -11659,10 +11404,10 @@ HMVMX_EXIT_DECL hmR0VmxExitEptMisconfig(PVMCPU pVCpu, PCPUMCTX pMixedCtx, PVMXTR
|| rc == VERR_PAGE_NOT_PRESENT)
{
/* Successfully handled MMIO operation. */
- HMCPU_CF_SET(pVCpu, HM_CHANGED_GUEST_RIP
- | HM_CHANGED_GUEST_RSP
- | HM_CHANGED_GUEST_RFLAGS
- | HM_CHANGED_VMX_GUEST_APIC_STATE);
+ HMCPU_CF_SET(pVCpu, HM_CHANGED_GUEST_RIP
+ | HM_CHANGED_GUEST_RSP
+ | HM_CHANGED_GUEST_RFLAGS
+ | HM_CHANGED_VMX_GUEST_APIC_STATE);
rc = VINF_SUCCESS;
}
return rc;
diff --git a/src/VBox/VMM/VMMR0/HMVMXR0.h b/src/VBox/VMM/VMMR0/HMVMXR0.h
index c671caf..8d07556 100644
--- a/src/VBox/VMM/VMMR0/HMVMXR0.h
+++ b/src/VBox/VMM/VMMR0/HMVMXR0.h
@@ -44,7 +44,7 @@ DECLASM(int) VMXR0StartVM32(RTHCUINT fResume, PCPUMCTX pCtx, PVMCSCACHE pCach
DECLASM(int) VMXR0StartVM64(RTHCUINT fResume, PCPUMCTX pCtx, PVMCSCACHE pCache, PVM pVM, PVMCPU pVCpu);
-# if HC_ARCH_BITS == 32 && defined(VBOX_WITH_64_BITS_GUESTS) && !defined(VBOX_WITH_HYBRID_32BIT_KERNEL)
+# if HC_ARCH_BITS == 32 && defined(VBOX_WITH_64_BITS_GUESTS)
DECLASM(int) VMXR0SwitcherStartVM64(RTHCUINT fResume, PCPUMCTX pCtx, PVMCSCACHE pCache, PVM pVM, PVMCPU pVCpu);
VMMR0DECL(int) VMXR0Execute64BitsHandler(PVM pVM, PVMCPU pVCpu, PCPUMCTX pCtx, HM64ON32OP enmOp, uint32_t cbParam,
uint32_t *paParam);
@@ -62,16 +62,7 @@ DECLINLINE(int) VMXReadCachedVmcsEx(PVMCPU pVCpu, uint32_t idxCache, RTGCUINTREG
}
# endif
-# ifdef VBOX_WITH_HYBRID_32BIT_KERNEL
-/* Don't use fAllow64BitGuests for VMXReadVmcsGstN() even though it looks right, as it can be forced to 'true'.
- HMVMX_IS_64BIT_HOST_MODE() is what we need. */
-# define VMXReadVmcsHstN(idxField, p64Val) HMVMX_IS_64BIT_HOST_MODE() ? \
- VMXReadVmcs64(idxField, p64Val) \
- : (*(p64Val) &= UINT64_C(0xffffffff), \
- VMXReadVmcs32(idxField, (uint32_t *)(p64Val)))
-# define VMXReadVmcsGstN VMXReadVmcsHstN
-# define VMXReadVmcsGstNByIdxVal VMXReadVmcsGstN
-# elif HC_ARCH_BITS == 32
+# if HC_ARCH_BITS == 32
# define VMXReadVmcsHstN VMXReadVmcs32
# define VMXReadVmcsGstN(idxField, pVal) VMXReadCachedVmcsEx(pVCpu, idxField##_CACHE_IDX, pVal)
# define VMXReadVmcsGstNByIdxVal(idxField, pVal) VMXReadCachedVmcsEx(pVCpu, idxField, pVal)
diff --git a/src/VBox/VMM/VMMR0/PDMR0Device.cpp b/src/VBox/VMM/VMMR0/PDMR0Device.cpp
index a43727f..098571b 100644
--- a/src/VBox/VMM/VMMR0/PDMR0Device.cpp
+++ b/src/VBox/VMM/VMMR0/PDMR0Device.cpp
@@ -16,9 +16,9 @@
*/
-/*******************************************************************************
-* Header Files *
-*******************************************************************************/
+/*********************************************************************************************************************************
+* Header Files *
+*********************************************************************************************************************************/
#define LOG_GROUP LOG_GROUP_PDM_DEVICE
#include "PDMInternal.h"
#include <VBox/vmm/pdm.h>
@@ -40,9 +40,9 @@
#include "PDMInline.h"
-/*******************************************************************************
-* Global Variables *
-*******************************************************************************/
+/*********************************************************************************************************************************
+* Global Variables *
+*********************************************************************************************************************************/
RT_C_DECLS_BEGIN
extern DECLEXPORT(const PDMDEVHLPR0) g_pdmR0DevHlp;
extern DECLEXPORT(const PDMPICHLPR0) g_pdmR0PicHlp;
@@ -55,9 +55,9 @@ extern DECLEXPORT(const PDMDRVHLPR0) g_pdmR0DrvHlp;
RT_C_DECLS_END
-/*******************************************************************************
-* Internal Functions *
-*******************************************************************************/
+/*********************************************************************************************************************************
+* Internal Functions *
+*********************************************************************************************************************************/
static bool pdmR0IsaSetIrq(PVM pVM, int iIrq, int iLevel, uint32_t uTagSrc);
diff --git a/src/VBox/VMM/VMMR0/PDMR0Driver.cpp b/src/VBox/VMM/VMMR0/PDMR0Driver.cpp
index 355521f..e6cc960 100644
--- a/src/VBox/VMM/VMMR0/PDMR0Driver.cpp
+++ b/src/VBox/VMM/VMMR0/PDMR0Driver.cpp
@@ -15,9 +15,10 @@
* hope that it will be useful, but WITHOUT ANY WARRANTY of any kind.
*/
-/*******************************************************************************
-* Header Files *
-*******************************************************************************/
+
+/*********************************************************************************************************************************
+* Header Files *
+*********************************************************************************************************************************/
#define LOG_GROUP LOG_GROUP_PDM_DRIVER
#include "PDMInternal.h"
#include <VBox/vmm/pdm.h>
diff --git a/src/VBox/VMM/VMMR0/PGMR0.cpp b/src/VBox/VMM/VMMR0/PGMR0.cpp
index 07a61a9..a3a7d14 100644
--- a/src/VBox/VMM/VMMR0/PGMR0.cpp
+++ b/src/VBox/VMM/VMMR0/PGMR0.cpp
@@ -15,9 +15,10 @@
* hope that it will be useful, but WITHOUT ANY WARRANTY of any kind.
*/
-/*******************************************************************************
-* Header Files *
-*******************************************************************************/
+
+/*********************************************************************************************************************************
+* Header Files *
+*********************************************************************************************************************************/
#define LOG_GROUP LOG_GROUP_PGM
#include <VBox/rawpci.h>
#include <VBox/vmm/pgm.h>
diff --git a/src/VBox/VMM/VMMR0/PGMR0SharedPage.cpp b/src/VBox/VMM/VMMR0/PGMR0SharedPage.cpp
index 607d5f1..3ccf61b 100644
--- a/src/VBox/VMM/VMMR0/PGMR0SharedPage.cpp
+++ b/src/VBox/VMM/VMMR0/PGMR0SharedPage.cpp
@@ -15,9 +15,10 @@
* hope that it will be useful, but WITHOUT ANY WARRANTY of any kind.
*/
-/*******************************************************************************
-* Header Files *
-*******************************************************************************/
+
+/*********************************************************************************************************************************
+* Header Files *
+*********************************************************************************************************************************/
#define LOG_GROUP LOG_GROUP_PGM_SHARED
#include <VBox/vmm/pgm.h>
#include <VBox/vmm/gmm.h>
diff --git a/src/VBox/VMM/VMMR0/TRPMR0.cpp b/src/VBox/VMM/VMMR0/TRPMR0.cpp
index b96a7eb..5ababae 100644
--- a/src/VBox/VMM/VMMR0/TRPMR0.cpp
+++ b/src/VBox/VMM/VMMR0/TRPMR0.cpp
@@ -16,9 +16,9 @@
*/
-/*******************************************************************************
-* Header Files *
-*******************************************************************************/
+/*********************************************************************************************************************************
+* Header Files *
+*********************************************************************************************************************************/
#define LOG_GROUP LOG_GROUP_TRPM
#include <VBox/vmm/trpm.h>
#include "TRPMInternal.h"
@@ -30,6 +30,11 @@
#include <iprt/asm-amd64-x86.h>
+#if defined(RT_OS_DARWIN) && ARCH_BITS == 32
+# error "32-bit darwin is no longer supported. Go back to 4.3 or earlier!"
+#endif
+
+
/**
* Dispatches an interrupt that arrived while we were in the guest context.
*
@@ -57,18 +62,6 @@ VMMR0DECL(void) TRPMR0DispatchHostInterrupt(PVM pVM)
#else /* The complicated way: */
-# ifdef VBOX_WITH_HYBRID_32BIT_KERNEL
- /*
- * Check if we're in long mode or not.
- */
- if ( (ASMCpuId_EDX(0x80000001) & X86_CPUID_EXT_FEATURE_EDX_LONG_MODE)
- && (ASMRdMsr(MSR_K6_EFER) & MSR_K6_EFER_LMA))
- {
- trpmR0DispatchHostInterruptSimple(uActiveVector);
- return;
- }
-# endif
-
/*
* Get the handler pointer (16:32 ptr) / (16:48 ptr).
*/
diff --git a/src/VBox/VMM/VMMR0/VMMR0.cpp b/src/VBox/VMM/VMMR0/VMMR0.cpp
index 08ea197..c6b130d 100644
--- a/src/VBox/VMM/VMMR0/VMMR0.cpp
+++ b/src/VBox/VMM/VMMR0/VMMR0.cpp
@@ -15,9 +15,10 @@
* hope that it will be useful, but WITHOUT ANY WARRANTY of any kind.
*/
-/*******************************************************************************
-* Header Files *
-*******************************************************************************/
+
+/*********************************************************************************************************************************
+* Header Files *
+*********************************************************************************************************************************/
#define LOG_GROUP LOG_GROUP_VMM
#include <VBox/vmm/vmm.h>
#include <VBox/sup.h>
@@ -60,10 +61,15 @@
# pragma intrinsic(_AddressOfReturnAddress)
#endif
+#if defined(RT_OS_DARWIN) && ARCH_BITS == 32
+# error "32-bit darwin is no longer supported. Go back to 4.3 or earlier!"
+#endif
+
-/*******************************************************************************
-* Defined Constants And Macros *
-*******************************************************************************/
+
+/*********************************************************************************************************************************
+* Defined Constants And Macros *
+*********************************************************************************************************************************/
/** @def VMM_CHECK_SMAP_SETUP
* SMAP check setup. */
/** @def VMM_CHECK_SMAP_CHECK
@@ -112,9 +118,9 @@
#endif
-/*******************************************************************************
-* Internal Functions *
-*******************************************************************************/
+/*********************************************************************************************************************************
+* Internal Functions *
+*********************************************************************************************************************************/
RT_C_DECLS_BEGIN
#if defined(RT_ARCH_X86) && (defined(RT_OS_SOLARIS) || defined(RT_OS_FREEBSD))
extern uint64_t __udivdi3(uint64_t, uint64_t);
@@ -123,9 +129,9 @@ extern uint64_t __umoddi3(uint64_t, uint64_t);
RT_C_DECLS_END
-/*******************************************************************************
-* Global Variables *
-*******************************************************************************/
+/*********************************************************************************************************************************
+* Global Variables *
+*********************************************************************************************************************************/
/** Drag in necessary library bits.
* The runtime lives here (in VMMR0.r0) and VBoxDD*R0.r0 links against us. */
PFNRT g_VMMR0Deps[] =
@@ -904,29 +910,6 @@ static void vmmR0RecordRC(PVM pVM, PVMCPU pVCpu, int rc)
/**
- * Unused ring-0 entry point that used to be called from the interrupt gate.
- *
- * Will be removed one of the next times we do a major SUPDrv version bump.
- *
- * @returns VBox status code.
- * @param pVM Pointer to the VM.
- * @param enmOperation Which operation to execute.
- * @param pvArg Argument to the operation.
- * @remarks Assume called with interrupts disabled.
- */
-VMMR0DECL(int) VMMR0EntryInt(PVM pVM, VMMR0OPERATION enmOperation, void *pvArg)
-{
- /*
- * We're returning VERR_NOT_SUPPORT here so we've got something else
- * than -1 which the interrupt gate glue code might return.
- */
- Log(("operation %#x is not supported\n", enmOperation));
- NOREF(enmOperation); NOREF(pvArg); NOREF(pVM);
- return VERR_NOT_SUPPORTED;
-}
-
-
-/**
* The Ring 0 entry point, called by the fast-ioctl path.
*
* @param pVM Pointer to the VM.
@@ -1888,7 +1871,7 @@ static int vmmR0EntryExWorker(PVM pVM, VMCPUID idCpu, VMMR0OPERATION enmOperatio
return VINF_SUCCESS;
-#if HC_ARCH_BITS == 32 && defined(VBOX_WITH_64_BITS_GUESTS) && !defined(VBOX_WITH_HYBRID_32BIT_KERNEL)
+#if HC_ARCH_BITS == 32 && defined(VBOX_WITH_64_BITS_GUESTS)
case VMMR0_DO_TEST_SWITCHER3264:
if (idCpu == NIL_VMCPUID)
return VERR_INVALID_CPU_ID;
diff --git a/src/VBox/VMM/VMMR0/VMMR0TripleFaultHack.cpp b/src/VBox/VMM/VMMR0/VMMR0TripleFaultHack.cpp
index 6ba93f5..45b0a60 100644
--- a/src/VBox/VMM/VMMR0/VMMR0TripleFaultHack.cpp
+++ b/src/VBox/VMM/VMMR0/VMMR0TripleFaultHack.cpp
@@ -18,9 +18,10 @@
* hope that it will be useful, but WITHOUT ANY WARRANTY of any kind.
*/
-/*******************************************************************************
-* Header Files *
-*******************************************************************************/
+
+/*********************************************************************************************************************************
+* Header Files *
+*********************************************************************************************************************************/
#define LOG_GROUP LOG_GROUP_VMM
#include <VBox/vmm/vmm.h>
#include "VMMInternal.h"
@@ -33,9 +34,9 @@
#include <iprt/string.h>
-/*******************************************************************************
-* Global Variables *
-*******************************************************************************/
+/*********************************************************************************************************************************
+* Global Variables *
+*********************************************************************************************************************************/
static RTR0MEMOBJ g_hMemPage0;
static RTR0MEMOBJ g_hMapPage0;
static uint8_t *g_pbPage0;
@@ -53,9 +54,9 @@ static void *g_pvSavedLowCore;
/** @} */
-/*******************************************************************************
-* Internal Functions *
-*******************************************************************************/
+/*********************************************************************************************************************************
+* Internal Functions *
+*********************************************************************************************************************************/
/* VMMR0TripleFaultHackA.asm */
DECLASM(void) vmmR0TripleFaultHackStart(void);
DECLASM(void) vmmR0TripleFaultHackEnd(void);
diff --git a/src/VBox/VMM/VMMR3/CFGM.cpp b/src/VBox/VMM/VMMR3/CFGM.cpp
index d7e35e0..f712d2b 100644
--- a/src/VBox/VMM/VMMR3/CFGM.cpp
+++ b/src/VBox/VMM/VMMR3/CFGM.cpp
@@ -51,9 +51,10 @@
*
*/
-/*******************************************************************************
-* Header Files *
-*******************************************************************************/
+
+/*********************************************************************************************************************************
+* Header Files *
+*********************************************************************************************************************************/
#define LOG_GROUP LOG_GROUP_CFGM
#include <VBox/vmm/cfgm.h>
#include <VBox/vmm/dbgf.h>
@@ -71,9 +72,9 @@
#include <iprt/uuid.h>
-/*******************************************************************************
-* Internal Functions *
-*******************************************************************************/
+/*********************************************************************************************************************************
+* Internal Functions *
+*********************************************************************************************************************************/
static void cfgmR3DumpPath(PCFGMNODE pNode, PCDBGFINFOHLP pHlp);
static void cfgmR3Dump(PCFGMNODE pRoot, unsigned iLevel, PCDBGFINFOHLP pHlp);
static DECLCALLBACK(void) cfgmR3Info(PVM pVM, PCDBGFINFOHLP pHlp, const char *pszArgs);
diff --git a/src/VBox/VMM/VMMR3/CPUM.cpp b/src/VBox/VMM/VMMR3/CPUM.cpp
index 2048ee5..5c9e320 100644
--- a/src/VBox/VMM/VMMR3/CPUM.cpp
+++ b/src/VBox/VMM/VMMR3/CPUM.cpp
@@ -31,9 +31,10 @@
* @see grp_cpum
*/
-/*******************************************************************************
-* Header Files *
-*******************************************************************************/
+
+/*********************************************************************************************************************************
+* Header Files *
+*********************************************************************************************************************************/
#define LOG_GROUP LOG_GROUP_CPUM
#include <VBox/vmm/cpum.h>
#include <VBox/vmm/cpumdis.h>
@@ -63,9 +64,9 @@
#include "internal/pgm.h"
-/*******************************************************************************
-* Defined Constants And Macros *
-*******************************************************************************/
+/*********************************************************************************************************************************
+* Defined Constants And Macros *
+*********************************************************************************************************************************/
/**
* This was used in the saved state up to the early life of version 14.
*
@@ -75,9 +76,9 @@
#define CPUM_CHANGED_HIDDEN_SEL_REGS_INVALID RT_BIT(12)
-/*******************************************************************************
-* Structures and Typedefs *
-*******************************************************************************/
+/*********************************************************************************************************************************
+* Structures and Typedefs *
+*********************************************************************************************************************************/
/**
* What kind of cpu info dump to perform.
@@ -92,9 +93,9 @@ typedef enum CPUMDUMPTYPE
typedef CPUMDUMPTYPE *PCPUMDUMPTYPE;
-/*******************************************************************************
-* Internal Functions *
-*******************************************************************************/
+/*********************************************************************************************************************************
+* Internal Functions *
+*********************************************************************************************************************************/
static DECLCALLBACK(int) cpumR3LiveExec(PVM pVM, PSSMHANDLE pSSM, uint32_t uPass);
static DECLCALLBACK(int) cpumR3SaveExec(PVM pVM, PSSMHANDLE pSSM);
static DECLCALLBACK(int) cpumR3LoadPrep(PVM pVM, PSSMHANDLE pSSM);
@@ -107,9 +108,9 @@ static DECLCALLBACK(void) cpumR3InfoHyper(PVM pVM, PCDBGFINFOHLP pHlp, const cha
static DECLCALLBACK(void) cpumR3InfoHost(PVM pVM, PCDBGFINFOHLP pHlp, const char *pszArgs);
-/*******************************************************************************
-* Global Variables *
-*******************************************************************************/
+/*********************************************************************************************************************************
+* Global Variables *
+*********************************************************************************************************************************/
/** Saved state field descriptors for CPUMCTX. */
static const SSMFIELD g_aCpumCtxFields[] =
{
@@ -2075,65 +2076,54 @@ static DECLCALLBACK(void) cpumR3InfoHost(PVM pVM, PCDBGFINFOHLP pHlp, const char
* Format the registers.
*/
#if HC_ARCH_BITS == 32
-# ifdef VBOX_WITH_HYBRID_32BIT_KERNEL
- if (!(pCtx->efer & MSR_K6_EFER_LMA))
-# endif
- {
- pHlp->pfnPrintf(pHlp,
- "eax=xxxxxxxx ebx=%08x ecx=xxxxxxxx edx=xxxxxxxx esi=%08x edi=%08x\n"
- "eip=xxxxxxxx esp=%08x ebp=%08x iopl=%d %31s\n"
- "cs=%04x ds=%04x es=%04x fs=%04x gs=%04x eflags=%08x\n"
- "cr0=%08RX64 cr2=xxxxxxxx cr3=%08RX64 cr4=%08RX64 gdtr=%08x:%04x ldtr=%04x\n"
- "dr[0]=%08RX64 dr[1]=%08RX64x dr[2]=%08RX64 dr[3]=%08RX64x dr[6]=%08RX64 dr[7]=%08RX64\n"
- "SysEnter={cs=%04x eip=%08x esp=%08x}\n"
- ,
- /*pCtx->eax,*/ pCtx->ebx, /*pCtx->ecx, pCtx->edx,*/ pCtx->esi, pCtx->edi,
- /*pCtx->eip,*/ pCtx->esp, pCtx->ebp, X86_EFL_GET_IOPL(efl), szEFlags,
- pCtx->cs, pCtx->ds, pCtx->es, pCtx->fs, pCtx->gs, efl,
- pCtx->cr0, /*pCtx->cr2,*/ pCtx->cr3, pCtx->cr4,
- pCtx->dr0, pCtx->dr1, pCtx->dr2, pCtx->dr3, pCtx->dr6, pCtx->dr7,
- (uint32_t)pCtx->gdtr.uAddr, pCtx->gdtr.cb, pCtx->ldtr,
- pCtx->SysEnter.cs, pCtx->SysEnter.eip, pCtx->SysEnter.esp);
- }
-# ifdef VBOX_WITH_HYBRID_32BIT_KERNEL
- else
-# endif
-#endif
-#if HC_ARCH_BITS == 64 || defined(VBOX_WITH_HYBRID_32BIT_KERNEL)
- {
- pHlp->pfnPrintf(pHlp,
- "rax=xxxxxxxxxxxxxxxx rbx=%016RX64 rcx=xxxxxxxxxxxxxxxx\n"
- "rdx=xxxxxxxxxxxxxxxx rsi=%016RX64 rdi=%016RX64\n"
- "rip=xxxxxxxxxxxxxxxx rsp=%016RX64 rbp=%016RX64\n"
- " r8=xxxxxxxxxxxxxxxx r9=xxxxxxxxxxxxxxxx r10=%016RX64\n"
- "r11=%016RX64 r12=%016RX64 r13=%016RX64\n"
- "r14=%016RX64 r15=%016RX64\n"
- "iopl=%d %31s\n"
- "cs=%04x ds=%04x es=%04x fs=%04x gs=%04x eflags=%08RX64\n"
- "cr0=%016RX64 cr2=xxxxxxxxxxxxxxxx cr3=%016RX64\n"
- "cr4=%016RX64 ldtr=%04x tr=%04x\n"
- "dr[0]=%016RX64 dr[1]=%016RX64 dr[2]=%016RX64\n"
- "dr[3]=%016RX64 dr[6]=%016RX64 dr[7]=%016RX64\n"
- "gdtr=%016RX64:%04x idtr=%016RX64:%04x\n"
- "SysEnter={cs=%04x eip=%08x esp=%08x}\n"
- "FSbase=%016RX64 GSbase=%016RX64 efer=%08RX64\n"
- ,
- /*pCtx->rax,*/ pCtx->rbx, /*pCtx->rcx,
- pCtx->rdx,*/ pCtx->rsi, pCtx->rdi,
- /*pCtx->rip,*/ pCtx->rsp, pCtx->rbp,
- /*pCtx->r8, pCtx->r9,*/ pCtx->r10,
- pCtx->r11, pCtx->r12, pCtx->r13,
- pCtx->r14, pCtx->r15,
- X86_EFL_GET_IOPL(efl), szEFlags,
- pCtx->cs, pCtx->ds, pCtx->es, pCtx->fs, pCtx->gs, efl,
- pCtx->cr0, /*pCtx->cr2,*/ pCtx->cr3,
- pCtx->cr4, pCtx->ldtr, pCtx->tr,
- pCtx->dr0, pCtx->dr1, pCtx->dr2,
- pCtx->dr3, pCtx->dr6, pCtx->dr7,
- pCtx->gdtr.uAddr, pCtx->gdtr.cb, pCtx->idtr.uAddr, pCtx->idtr.cb,
- pCtx->SysEnter.cs, pCtx->SysEnter.eip, pCtx->SysEnter.esp,
- pCtx->FSbase, pCtx->GSbase, pCtx->efer);
- }
+ pHlp->pfnPrintf(pHlp,
+ "eax=xxxxxxxx ebx=%08x ecx=xxxxxxxx edx=xxxxxxxx esi=%08x edi=%08x\n"
+ "eip=xxxxxxxx esp=%08x ebp=%08x iopl=%d %31s\n"
+ "cs=%04x ds=%04x es=%04x fs=%04x gs=%04x eflags=%08x\n"
+ "cr0=%08RX64 cr2=xxxxxxxx cr3=%08RX64 cr4=%08RX64 gdtr=%08x:%04x ldtr=%04x\n"
+ "dr[0]=%08RX64 dr[1]=%08RX64x dr[2]=%08RX64 dr[3]=%08RX64x dr[6]=%08RX64 dr[7]=%08RX64\n"
+ "SysEnter={cs=%04x eip=%08x esp=%08x}\n"
+ ,
+ /*pCtx->eax,*/ pCtx->ebx, /*pCtx->ecx, pCtx->edx,*/ pCtx->esi, pCtx->edi,
+ /*pCtx->eip,*/ pCtx->esp, pCtx->ebp, X86_EFL_GET_IOPL(efl), szEFlags,
+ pCtx->cs, pCtx->ds, pCtx->es, pCtx->fs, pCtx->gs, efl,
+ pCtx->cr0, /*pCtx->cr2,*/ pCtx->cr3, pCtx->cr4,
+ pCtx->dr0, pCtx->dr1, pCtx->dr2, pCtx->dr3, pCtx->dr6, pCtx->dr7,
+ (uint32_t)pCtx->gdtr.uAddr, pCtx->gdtr.cb, pCtx->ldtr,
+ pCtx->SysEnter.cs, pCtx->SysEnter.eip, pCtx->SysEnter.esp);
+#else
+ pHlp->pfnPrintf(pHlp,
+ "rax=xxxxxxxxxxxxxxxx rbx=%016RX64 rcx=xxxxxxxxxxxxxxxx\n"
+ "rdx=xxxxxxxxxxxxxxxx rsi=%016RX64 rdi=%016RX64\n"
+ "rip=xxxxxxxxxxxxxxxx rsp=%016RX64 rbp=%016RX64\n"
+ " r8=xxxxxxxxxxxxxxxx r9=xxxxxxxxxxxxxxxx r10=%016RX64\n"
+ "r11=%016RX64 r12=%016RX64 r13=%016RX64\n"
+ "r14=%016RX64 r15=%016RX64\n"
+ "iopl=%d %31s\n"
+ "cs=%04x ds=%04x es=%04x fs=%04x gs=%04x eflags=%08RX64\n"
+ "cr0=%016RX64 cr2=xxxxxxxxxxxxxxxx cr3=%016RX64\n"
+ "cr4=%016RX64 ldtr=%04x tr=%04x\n"
+ "dr[0]=%016RX64 dr[1]=%016RX64 dr[2]=%016RX64\n"
+ "dr[3]=%016RX64 dr[6]=%016RX64 dr[7]=%016RX64\n"
+ "gdtr=%016RX64:%04x idtr=%016RX64:%04x\n"
+ "SysEnter={cs=%04x eip=%08x esp=%08x}\n"
+ "FSbase=%016RX64 GSbase=%016RX64 efer=%08RX64\n"
+ ,
+ /*pCtx->rax,*/ pCtx->rbx, /*pCtx->rcx,
+ pCtx->rdx,*/ pCtx->rsi, pCtx->rdi,
+ /*pCtx->rip,*/ pCtx->rsp, pCtx->rbp,
+ /*pCtx->r8, pCtx->r9,*/ pCtx->r10,
+ pCtx->r11, pCtx->r12, pCtx->r13,
+ pCtx->r14, pCtx->r15,
+ X86_EFL_GET_IOPL(efl), szEFlags,
+ pCtx->cs, pCtx->ds, pCtx->es, pCtx->fs, pCtx->gs, efl,
+ pCtx->cr0, /*pCtx->cr2,*/ pCtx->cr3,
+ pCtx->cr4, pCtx->ldtr, pCtx->tr,
+ pCtx->dr0, pCtx->dr1, pCtx->dr2,
+ pCtx->dr3, pCtx->dr6, pCtx->dr7,
+ pCtx->gdtr.uAddr, pCtx->gdtr.cb, pCtx->idtr.uAddr, pCtx->idtr.cb,
+ pCtx->SysEnter.cs, pCtx->SysEnter.eip, pCtx->SysEnter.esp,
+ pCtx->FSbase, pCtx->GSbase, pCtx->efer);
#endif
}
diff --git a/src/VBox/VMM/VMMR3/CPUMDbg.cpp b/src/VBox/VMM/VMMR3/CPUMDbg.cpp
index c96a35b..bc3d662 100644
--- a/src/VBox/VMM/VMMR3/CPUMDbg.cpp
+++ b/src/VBox/VMM/VMMR3/CPUMDbg.cpp
@@ -16,9 +16,9 @@
*/
-/*******************************************************************************
-* Header Files *
-*******************************************************************************/
+/*********************************************************************************************************************************
+* Header Files *
+*********************************************************************************************************************************/
#define LOG_GROUP LOG_GROUP_DBGF
#include <VBox/vmm/cpum.h>
#include <VBox/vmm/dbgf.h>
diff --git a/src/VBox/VMM/VMMR3/CPUMR3CpuId.cpp b/src/VBox/VMM/VMMR3/CPUMR3CpuId.cpp
index 0b069b6..050d65e 100644
--- a/src/VBox/VMM/VMMR3/CPUMR3CpuId.cpp
+++ b/src/VBox/VMM/VMMR3/CPUMR3CpuId.cpp
@@ -15,9 +15,10 @@
* hope that it will be useful, but WITHOUT ANY WARRANTY of any kind.
*/
-/*******************************************************************************
-* Header Files *
-*******************************************************************************/
+
+/*********************************************************************************************************************************
+* Header Files *
+*********************************************************************************************************************************/
#define LOG_GROUP LOG_GROUP_CPUM
#include <VBox/vmm/cpum.h>
#include <VBox/vmm/dbgf.h>
@@ -34,9 +35,9 @@
#include <iprt/string.h>
-/*******************************************************************************
-* Defined Constants And Macros *
-*******************************************************************************/
+/*********************************************************************************************************************************
+* Defined Constants And Macros *
+*********************************************************************************************************************************/
/** For sanity and avoid wasting hyper heap on buggy config / saved state. */
#define CPUM_CPUID_MAX_LEAVES 2048
/* Max size we accept for the XSAVE area. */
@@ -45,9 +46,9 @@
#define CPUM_MIN_XSAVE_AREA_SIZE 0x240
-/*******************************************************************************
-* Global Variables *
-*******************************************************************************/
+/*********************************************************************************************************************************
+* Global Variables *
+*********************************************************************************************************************************/
/**
* The intel pentium family.
*/
@@ -124,35 +125,38 @@ static const CPUMMICROARCH g_aenmIntelFamily06[] =
/* [68(0x44)] = */ kCpumMicroarch_Intel_Unknown,
/* [69(0x45)] = */ kCpumMicroarch_Intel_Core7_Haswell,
/* [70(0x46)] = */ kCpumMicroarch_Intel_Core7_Haswell,
- /* [71(0x47)] = */ kCpumMicroarch_Intel_Unknown,
+ /* [71(0x47)] = */ kCpumMicroarch_Intel_Core7_Broadwell, /* i7-5775C */
/* [72(0x48)] = */ kCpumMicroarch_Intel_Unknown,
/* [73(0x49)] = */ kCpumMicroarch_Intel_Unknown,
/* [74(0x4a)] = */ kCpumMicroarch_Intel_Atom_Silvermont,
/* [75(0x4b)] = */ kCpumMicroarch_Intel_Unknown,
- /* [76(0x4c)] = */ kCpumMicroarch_Intel_Unknown,
+ /* [76(0x4c)] = */ kCpumMicroarch_Intel_Atom_Airmount,
/* [77(0x4d)] = */ kCpumMicroarch_Intel_Atom_Silvermont,
- /* [78(0x4e)] = */ kCpumMicroarch_Intel_Unknown,
- /* [79(0x4f)] = */ kCpumMicroarch_Intel_Unknown,
+ /* [78(0x4e)] = */ kCpumMicroarch_Intel_Core7_Skylake, /* unconfirmed */
+ /* [79(0x4f)] = */ kCpumMicroarch_Intel_Core7_Broadwell, /* unconfirmed, Broadwell-E */
/* [80(0x50)] = */ kCpumMicroarch_Intel_Unknown,
/* [81(0x51)] = */ kCpumMicroarch_Intel_Unknown,
/* [82(0x52)] = */ kCpumMicroarch_Intel_Unknown,
/* [83(0x53)] = */ kCpumMicroarch_Intel_Unknown,
/* [84(0x54)] = */ kCpumMicroarch_Intel_Unknown,
- /* [85(0x55)] = */ kCpumMicroarch_Intel_Unknown,
- /* [86(0x56)] = */ kCpumMicroarch_Intel_Unknown,
+ /* [85(0x55)] = */ kCpumMicroarch_Intel_Core7_Skylake, /* unconfirmed server cpu */
+ /* [86(0x56)] = */ kCpumMicroarch_Intel_Core7_Broadwell, /* Xeon D-1540, Broadwell-DE */
/* [87(0x57)] = */ kCpumMicroarch_Intel_Unknown,
/* [88(0x58)] = */ kCpumMicroarch_Intel_Unknown,
/* [89(0x59)] = */ kCpumMicroarch_Intel_Unknown,
- /* [90(0x5a)] = */ kCpumMicroarch_Intel_Unknown,
+ /* [90(0x5a)] = */ kCpumMicroarch_Intel_Atom_Silvermont, /* Moorefield */
/* [91(0x5b)] = */ kCpumMicroarch_Intel_Unknown,
- /* [92(0x5c)] = */ kCpumMicroarch_Intel_Unknown,
- /* [93(0x5d)] = */ kCpumMicroarch_Intel_Unknown,
- /* [94(0x5e)] = */ kCpumMicroarch_Intel_Core7_Skylake, /* 6700K */
+ /* [92(0x5c)] = */ kCpumMicroarch_Intel_Atom_Goldmont, /* unconfirmed */
+ /* [93(0x5d)] = */ kCpumMicroarch_Intel_Atom_Silvermont, /* x3-C3230 */
+ /* [94(0x5e)] = */ kCpumMicroarch_Intel_Core7_Skylake, /* i7-6700K */
/* [95(0x5f)] = */ kCpumMicroarch_Intel_Unknown,
/* [96(0x60)] = */ kCpumMicroarch_Intel_Unknown,
/* [97(0x61)] = */ kCpumMicroarch_Intel_Unknown,
/* [98(0x62)] = */ kCpumMicroarch_Intel_Unknown,
/* [99(0x63)] = */ kCpumMicroarch_Intel_Unknown,
+ /* [99(0x64)] = */ kCpumMicroarch_Intel_Unknown,
+ /* [99(0x65)] = */ kCpumMicroarch_Intel_Unknown,
+ /* [99(0x66)] = */ kCpumMicroarch_Intel_Core7_Cannonlake, /* unconfirmed */
};
diff --git a/src/VBox/VMM/VMMR3/CPUMR3Db.cpp b/src/VBox/VMM/VMMR3/CPUMR3Db.cpp
index 1e4243c..d3eb861 100644
--- a/src/VBox/VMM/VMMR3/CPUMR3Db.cpp
+++ b/src/VBox/VMM/VMMR3/CPUMR3Db.cpp
@@ -15,9 +15,10 @@
* hope that it will be useful, but WITHOUT ANY WARRANTY of any kind.
*/
-/*******************************************************************************
-* Header Files *
-*******************************************************************************/
+
+/*********************************************************************************************************************************
+* Header Files *
+*********************************************************************************************************************************/
#define LOG_GROUP LOG_GROUP_CPUM
#include <VBox/vmm/cpum.h>
#include "CPUMInternal.h"
@@ -30,9 +31,9 @@
#include <iprt/string.h>
-/*******************************************************************************
-* Structures and Typedefs *
-*******************************************************************************/
+/*********************************************************************************************************************************
+* Structures and Typedefs *
+*********************************************************************************************************************************/
typedef struct CPUMDBENTRY
{
/** The CPU name. */
@@ -75,9 +76,9 @@ typedef struct CPUMDBENTRY
} CPUMDBENTRY;
-/*******************************************************************************
-* Defined Constants And Macros *
-*******************************************************************************/
+/*********************************************************************************************************************************
+* Defined Constants And Macros *
+*********************************************************************************************************************************/
/** @def NULL_ALONE
* For eliminating an unnecessary data dependency in standalone builds (for
diff --git a/src/VBox/VMM/VMMR3/CSAM.cpp b/src/VBox/VMM/VMMR3/CSAM.cpp
index 5afaaa5..8ff930d 100644
--- a/src/VBox/VMM/VMMR3/CSAM.cpp
+++ b/src/VBox/VMM/VMMR3/CSAM.cpp
@@ -15,9 +15,10 @@
* hope that it will be useful, but WITHOUT ANY WARRANTY of any kind.
*/
-/*******************************************************************************
-* Header Files *
-*******************************************************************************/
+
+/*********************************************************************************************************************************
+* Header Files *
+*********************************************************************************************************************************/
#define LOG_GROUP LOG_GROUP_CSAM
#include <VBox/vmm/cpum.h>
#include <VBox/vmm/stam.h>
@@ -67,9 +68,10 @@
/* Enable to scan beyond ret instructions.
#define CSAM_ANALYSE_BEYOND_RET */
-/*******************************************************************************
-* Internal Functions *
-*******************************************************************************/
+
+/*********************************************************************************************************************************
+* Internal Functions *
+*********************************************************************************************************************************/
static DECLCALLBACK(int) csamR3Save(PVM pVM, PSSMHANDLE pSSM);
static DECLCALLBACK(int) csamR3Load(PVM pVM, PSSMHANDLE pSSM, uint32_t uVersion, uint32_t uPass);
static FNPGMR3VIRTINVALIDATE csamR3CodePageInvalidate;
@@ -92,9 +94,9 @@ static FNDBGCCMD csamr3CmdOff;
#endif
-/*******************************************************************************
-* Global Variables *
-*******************************************************************************/
+/*********************************************************************************************************************************
+* Global Variables *
+*********************************************************************************************************************************/
#ifdef VBOX_WITH_DEBUGGER
/** Command descriptors. */
static const DBGCCMD g_aCmds[] =
@@ -1033,8 +1035,8 @@ DECLINLINE(int) csamR3DISInstr(PVM pVM, RTRCPTR InstrGC, uint8_t *InstrHC, DISCP
* @param pUserData User pointer (callback specific)
*
*/
-static int CSAMR3AnalyseCallback(PVM pVM, DISCPUSTATE *pCpu, RCPTRTYPE(uint8_t *) pInstrGC, RCPTRTYPE(uint8_t *) pCurInstrGC,
- PCSAMP2GLOOKUPREC pCacheRec, void *pUserData)
+static DECLCALLBACK(int) CSAMR3AnalyseCallback(PVM pVM, DISCPUSTATE *pCpu, RCPTRTYPE(uint8_t *) pInstrGC, RCPTRTYPE(uint8_t *) pCurInstrGC,
+ PCSAMP2GLOOKUPREC pCacheRec, void *pUserData)
{
PCSAMPAGE pPage = (PCSAMPAGE)pUserData;
int rc;
diff --git a/src/VBox/VMM/VMMR3/DBGF.cpp b/src/VBox/VMM/VMMR3/DBGF.cpp
index c578c1c..908d56d 100644
--- a/src/VBox/VMM/VMMR3/DBGF.cpp
+++ b/src/VBox/VMM/VMMR3/DBGF.cpp
@@ -66,9 +66,9 @@
*/
-/*******************************************************************************
-* Header Files *
-*******************************************************************************/
+/*********************************************************************************************************************************
+* Header Files *
+*********************************************************************************************************************************/
#define LOG_GROUP LOG_GROUP_DBGF
#include <VBox/vmm/dbgf.h>
#include <VBox/vmm/selm.h>
@@ -92,9 +92,9 @@
#include <iprt/env.h>
-/*******************************************************************************
-* Internal Functions *
-*******************************************************************************/
+/*********************************************************************************************************************************
+* Internal Functions *
+*********************************************************************************************************************************/
static int dbgfR3VMMWait(PVM pVM);
static int dbgfR3VMMCmd(PVM pVM, DBGFCMD enmCmd, PDBGFCMDDATA pCmdData, bool *pfResumeExecution);
static DECLCALLBACK(int) dbgfR3Attach(PVM pVM);
diff --git a/src/VBox/VMM/VMMR3/DBGFAddr.cpp b/src/VBox/VMM/VMMR3/DBGFAddr.cpp
index d3a4765..14b81e3 100644
--- a/src/VBox/VMM/VMMR3/DBGFAddr.cpp
+++ b/src/VBox/VMM/VMMR3/DBGFAddr.cpp
@@ -16,9 +16,9 @@
*/
-/*******************************************************************************
-* Header Files *
-*******************************************************************************/
+/*********************************************************************************************************************************
+* Header Files *
+*********************************************************************************************************************************/
#define LOG_GROUP LOG_GROUP_DBGF
#include <VBox/vmm/dbgf.h>
#include <VBox/vmm/pgm.h>
diff --git a/src/VBox/VMM/VMMR3/DBGFAddrSpace.cpp b/src/VBox/VMM/VMMR3/DBGFAddrSpace.cpp
index 795245b..efc3a66 100644
--- a/src/VBox/VMM/VMMR3/DBGFAddrSpace.cpp
+++ b/src/VBox/VMM/VMMR3/DBGFAddrSpace.cpp
@@ -33,9 +33,10 @@
*
*/
-/*******************************************************************************
-* Header Files *
-*******************************************************************************/
+
+/*********************************************************************************************************************************
+* Header Files *
+*********************************************************************************************************************************/
#define LOG_GROUP LOG_GROUP_DBGF
#include <VBox/vmm/dbgf.h>
#include <VBox/vmm/hm.h>
@@ -59,9 +60,9 @@
#include <iprt/param.h>
-/*******************************************************************************
-* Structures and Typedefs *
-*******************************************************************************/
+/*********************************************************************************************************************************
+* Structures and Typedefs *
+*********************************************************************************************************************************/
/**
* Address space database node.
*/
@@ -102,9 +103,9 @@ typedef int FNDBGFR3ASSEARCHOPEN(const char *pszFilename, void *pvUser);
typedef FNDBGFR3ASSEARCHOPEN *PFNDBGFR3ASSEARCHOPEN;
-/*******************************************************************************
-* Defined Constants And Macros *
-*******************************************************************************/
+/*********************************************************************************************************************************
+* Defined Constants And Macros *
+*********************************************************************************************************************************/
/** Locks the address space database for writing. */
#define DBGF_AS_DB_LOCK_WRITE(pUVM) \
do { \
diff --git a/src/VBox/VMM/VMMR3/DBGFBp.cpp b/src/VBox/VMM/VMMR3/DBGFBp.cpp
index 086fcaa..d560630 100644
--- a/src/VBox/VMM/VMMR3/DBGFBp.cpp
+++ b/src/VBox/VMM/VMMR3/DBGFBp.cpp
@@ -16,9 +16,9 @@
*/
-/*******************************************************************************
-* Header Files *
-*******************************************************************************/
+/*********************************************************************************************************************************
+* Header Files *
+*********************************************************************************************************************************/
#define LOG_GROUP LOG_GROUP_DBGF
#include <VBox/vmm/dbgf.h>
#include <VBox/vmm/selm.h>
@@ -38,9 +38,9 @@
#include <iprt/string.h>
-/*******************************************************************************
-* Internal Functions *
-*******************************************************************************/
+/*********************************************************************************************************************************
+* Internal Functions *
+*********************************************************************************************************************************/
RT_C_DECLS_BEGIN
static int dbgfR3BpRegArm(PVM pVM, PDBGFBP pBp);
static int dbgfR3BpInt3Arm(PUVM pUVM, PDBGFBP pBp);
diff --git a/src/VBox/VMM/VMMR3/DBGFCoreWrite.cpp b/src/VBox/VMM/VMMR3/DBGFCoreWrite.cpp
index d1c8457..99a2a3d 100644
--- a/src/VBox/VMM/VMMR3/DBGFCoreWrite.cpp
+++ b/src/VBox/VMM/VMMR3/DBGFCoreWrite.cpp
@@ -44,9 +44,10 @@
*
*/
-/*******************************************************************************
-* Header Files *
-*******************************************************************************/
+
+/*********************************************************************************************************************************
+* Header Files *
+*********************************************************************************************************************************/
#define LOG_GROUP LOG_GROUP_DBGF
#include <iprt/param.h>
#include <iprt/file.h>
@@ -69,15 +70,15 @@
#include "../../Runtime/include/internal/ldrELF64.h"
-/*******************************************************************************
-* Defined Constants And Macros *
-*******************************************************************************/
+/*********************************************************************************************************************************
+* Defined Constants And Macros *
+*********************************************************************************************************************************/
#define DBGFLOG_NAME "DBGFCoreWrite"
-/*******************************************************************************
-* Global Variables *
-*******************************************************************************/
+/*********************************************************************************************************************************
+* Global Variables *
+*********************************************************************************************************************************/
static const int g_NoteAlign = 8;
static const int g_cbNoteName = 16;
@@ -86,9 +87,9 @@ static const char *g_pcszCoreVBoxCore = "VBCORE";
static const char *g_pcszCoreVBoxCpu = "VBCPU";
-/*******************************************************************************
-* Structures and Typedefs *
-*******************************************************************************/
+/*********************************************************************************************************************************
+* Structures and Typedefs *
+*********************************************************************************************************************************/
/**
* Guest core writer data.
*
diff --git a/src/VBox/VMM/VMMR3/DBGFCpu.cpp b/src/VBox/VMM/VMMR3/DBGFCpu.cpp
index cf0ebd1..2859582 100644
--- a/src/VBox/VMM/VMMR3/DBGFCpu.cpp
+++ b/src/VBox/VMM/VMMR3/DBGFCpu.cpp
@@ -16,9 +16,9 @@
*/
-/*******************************************************************************
-* Header Files *
-*******************************************************************************/
+/*********************************************************************************************************************************
+* Header Files *
+*********************************************************************************************************************************/
#define LOG_GROUP LOG_GROUP_DBGF
#include <VBox/vmm/dbgf.h>
#include <VBox/vmm/cpum.h>
diff --git a/src/VBox/VMM/VMMR3/DBGFDisas.cpp b/src/VBox/VMM/VMMR3/DBGFDisas.cpp
index 6b6c77a..2c945bc 100644
--- a/src/VBox/VMM/VMMR3/DBGFDisas.cpp
+++ b/src/VBox/VMM/VMMR3/DBGFDisas.cpp
@@ -15,9 +15,10 @@
* hope that it will be useful, but WITHOUT ANY WARRANTY of any kind.
*/
-/*******************************************************************************
-* Header Files *
-*******************************************************************************/
+
+/*********************************************************************************************************************************
+* Header Files *
+*********************************************************************************************************************************/
#define LOG_GROUP LOG_GROUP_DBGF
#include <VBox/vmm/dbgf.h>
#include <VBox/vmm/selm.h>
@@ -43,9 +44,9 @@
#include <iprt/ctype.h>
-/*******************************************************************************
-* Structures and Typedefs *
-*******************************************************************************/
+/*********************************************************************************************************************************
+* Structures and Typedefs *
+*********************************************************************************************************************************/
/**
* Structure used when disassembling and instructions in DBGF.
* This is used so the reader function can get the stuff it needs.
@@ -87,9 +88,9 @@ typedef struct
} DBGFDISASSTATE, *PDBGFDISASSTATE;
-/*******************************************************************************
-* Internal Functions *
-*******************************************************************************/
+/*********************************************************************************************************************************
+* Internal Functions *
+*********************************************************************************************************************************/
static FNDISREADBYTES dbgfR3DisasInstrRead;
diff --git a/src/VBox/VMM/VMMR3/DBGFInfo.cpp b/src/VBox/VMM/VMMR3/DBGFInfo.cpp
index ddabf29..2ebba63 100644
--- a/src/VBox/VMM/VMMR3/DBGFInfo.cpp
+++ b/src/VBox/VMM/VMMR3/DBGFInfo.cpp
@@ -16,9 +16,9 @@
*/
-/*******************************************************************************
-* Header Files *
-*******************************************************************************/
+/*********************************************************************************************************************************
+* Header Files *
+*********************************************************************************************************************************/
#define LOG_GROUP LOG_GROUP_DBGF_INFO
#include <VBox/vmm/dbgf.h>
@@ -38,9 +38,9 @@
#include <iprt/thread.h>
-/*******************************************************************************
-* Internal Functions *
-*******************************************************************************/
+/*********************************************************************************************************************************
+* Internal Functions *
+*********************************************************************************************************************************/
static DECLCALLBACK(void) dbgfR3InfoLog_Printf(PCDBGFINFOHLP pHlp, const char *pszFormat, ...);
static DECLCALLBACK(void) dbgfR3InfoLog_PrintfV(PCDBGFINFOHLP pHlp, const char *pszFormat, va_list args);
static DECLCALLBACK(void) dbgfR3InfoLogRel_Printf(PCDBGFINFOHLP pHlp, const char *pszFormat, ...);
@@ -50,9 +50,9 @@ static DECLCALLBACK(void) dbgfR3InfoStdErr_PrintfV(PCDBGFINFOHLP pHlp, const cha
static DECLCALLBACK(void) dbgfR3InfoHelp(PVM pVM, PCDBGFINFOHLP pHlp, const char *pszArgs);
-/*******************************************************************************
-* Global Variables *
-*******************************************************************************/
+/*********************************************************************************************************************************
+* Global Variables *
+*********************************************************************************************************************************/
/** Logger output. */
static const DBGFINFOHLP g_dbgfR3InfoLogHlp =
{
diff --git a/src/VBox/VMM/VMMR3/DBGFLog.cpp b/src/VBox/VMM/VMMR3/DBGFLog.cpp
index a65e19a..24499ae 100644
--- a/src/VBox/VMM/VMMR3/DBGFLog.cpp
+++ b/src/VBox/VMM/VMMR3/DBGFLog.cpp
@@ -16,9 +16,9 @@
*/
-/*******************************************************************************
-* Header Files *
-*******************************************************************************/
+/*********************************************************************************************************************************
+* Header Files *
+*********************************************************************************************************************************/
#include <VBox/vmm/vmapi.h>
#include <VBox/vmm/vmm.h>
#include <VBox/vmm/dbgf.h>
diff --git a/src/VBox/VMM/VMMR3/DBGFMem.cpp b/src/VBox/VMM/VMMR3/DBGFMem.cpp
index c6f3ceb..6177385 100644
--- a/src/VBox/VMM/VMMR3/DBGFMem.cpp
+++ b/src/VBox/VMM/VMMR3/DBGFMem.cpp
@@ -16,9 +16,9 @@
*/
-/*******************************************************************************
-* Header Files *
-*******************************************************************************/
+/*********************************************************************************************************************************
+* Header Files *
+*********************************************************************************************************************************/
#define LOG_GROUP LOG_GROUP_DBGF
#include <VBox/vmm/dbgf.h>
#include <VBox/vmm/pgm.h>
diff --git a/src/VBox/VMM/VMMR3/DBGFOS.cpp b/src/VBox/VMM/VMMR3/DBGFOS.cpp
index 8a008e3..bb0f1bd 100644
--- a/src/VBox/VMM/VMMR3/DBGFOS.cpp
+++ b/src/VBox/VMM/VMMR3/DBGFOS.cpp
@@ -16,9 +16,9 @@
*/
-/*******************************************************************************
-* Header Files *
-*******************************************************************************/
+/*********************************************************************************************************************************
+* Header Files *
+*********************************************************************************************************************************/
#define LOG_GROUP LOG_GROUP_DBGF
#include <VBox/vmm/dbgf.h>
#include <VBox/vmm/mm.h>
@@ -32,9 +32,9 @@
#include <iprt/param.h>
-/*******************************************************************************
-* Defined Constants And Macros *
-*******************************************************************************/
+/*********************************************************************************************************************************
+* Defined Constants And Macros *
+*********************************************************************************************************************************/
#define DBGF_OS_READ_LOCK(pUVM) \
do { int rcLock = RTCritSectRwEnterShared(&pUVM->dbgf.s.CritSect); AssertRC(rcLock); } while (0)
@@ -47,9 +47,9 @@
do { int rcLock = RTCritSectRwLeaveExcl(&pUVM->dbgf.s.CritSect); AssertRC(rcLock); } while (0)
-/*******************************************************************************
-* Structures and Typedefs *
-*******************************************************************************/
+/*********************************************************************************************************************************
+* Structures and Typedefs *
+*********************************************************************************************************************************/
/**
* EMT interface wrappers.
*
diff --git a/src/VBox/VMM/VMMR3/DBGFR3PlugIn.cpp b/src/VBox/VMM/VMMR3/DBGFR3PlugIn.cpp
index 788ffbb..98bd4cd 100644
--- a/src/VBox/VMM/VMMR3/DBGFR3PlugIn.cpp
+++ b/src/VBox/VMM/VMMR3/DBGFR3PlugIn.cpp
@@ -16,9 +16,9 @@
*/
-/*******************************************************************************
-* Header Files *
-*******************************************************************************/
+/*********************************************************************************************************************************
+* Header Files *
+*********************************************************************************************************************************/
#define LOG_GROUP LOG_GROUP_DBGF
#include <VBox/vmm/dbgf.h>
#include <VBox/vmm/mm.h>
@@ -39,9 +39,9 @@
#include <iprt/path.h>
-/*******************************************************************************
-* Defined Constants And Macros *
-*******************************************************************************/
+/*********************************************************************************************************************************
+* Defined Constants And Macros *
+*********************************************************************************************************************************/
#define DBGF_PLUG_IN_READ_LOCK(pUVM) \
do { int rcLock = RTCritSectRwEnterShared(&pUVM->dbgf.s.CritSect); AssertRC(rcLock); } while (0)
@@ -57,9 +57,9 @@
#define DBGFPLUGIN_MAX_NAME 64
-/*******************************************************************************
-* Structures and Typedefs *
-*******************************************************************************/
+/*********************************************************************************************************************************
+* Structures and Typedefs *
+*********************************************************************************************************************************/
/**
* Plug-in tracking record.
*/
@@ -80,9 +80,9 @@ typedef struct DBGFPLUGIN
typedef DBGFPLUGIN *PDBGFPLUGIN;
-/*******************************************************************************
-* Internal Functions *
-*******************************************************************************/
+/*********************************************************************************************************************************
+* Internal Functions *
+*********************************************************************************************************************************/
static DECLCALLBACK(void) dbgfPlugInUnloadAll(PUVM pUVM);
static FNDBGFHANDLERINT dbgfR3PlugInInfoList;
diff --git a/src/VBox/VMM/VMMR3/DBGFR3Trace.cpp b/src/VBox/VMM/VMMR3/DBGFR3Trace.cpp
index 41e156b..58b5da6 100644
--- a/src/VBox/VMM/VMMR3/DBGFR3Trace.cpp
+++ b/src/VBox/VMM/VMMR3/DBGFR3Trace.cpp
@@ -16,9 +16,9 @@
*/
-/*******************************************************************************
-* Header Files *
-*******************************************************************************/
+/*********************************************************************************************************************************
+* Header Files *
+*********************************************************************************************************************************/
#define LOG_GROUP LOG_GROUP_DBGF
#include <VBox/vmm/dbgftrace.h>
#include <VBox/vmm/cfgm.h>
@@ -37,15 +37,15 @@
#include <iprt/trace.h>
-/*******************************************************************************
-* Internal Functions *
-*******************************************************************************/
+/*********************************************************************************************************************************
+* Internal Functions *
+*********************************************************************************************************************************/
static DECLCALLBACK(void) dbgfR3TraceInfo(PVM pVM, PCDBGFINFOHLP pHlp, const char *pszArgs);
-/*******************************************************************************
-* Global Variables *
-*******************************************************************************/
+/*********************************************************************************************************************************
+* Global Variables *
+*********************************************************************************************************************************/
/**
* VMM trace point group translation table.
*/
diff --git a/src/VBox/VMM/VMMR3/DBGFReg.cpp b/src/VBox/VMM/VMMR3/DBGFReg.cpp
index 179efc1..2f6bfad 100644
--- a/src/VBox/VMM/VMMR3/DBGFReg.cpp
+++ b/src/VBox/VMM/VMMR3/DBGFReg.cpp
@@ -16,9 +16,9 @@
*/
-/*******************************************************************************
-* Header Files *
-*******************************************************************************/
+/*********************************************************************************************************************************
+* Header Files *
+*********************************************************************************************************************************/
#define LOG_GROUP LOG_GROUP_DBGF
#include <VBox/vmm/dbgf.h>
#include "DBGFInternal.h"
@@ -33,9 +33,9 @@
#include <iprt/uint128.h>
-/*******************************************************************************
-* Defined Constants And Macros *
-*******************************************************************************/
+/*********************************************************************************************************************************
+* Defined Constants And Macros *
+*********************************************************************************************************************************/
/** Locks the register database for writing. */
#define DBGF_REG_DB_LOCK_WRITE(pUVM) \
do { \
@@ -69,9 +69,9 @@
#define DBGF_REG_MAX_NAME 40
-/*******************************************************************************
-* Structures and Typedefs *
-*******************************************************************************/
+/*********************************************************************************************************************************
+* Structures and Typedefs *
+*********************************************************************************************************************************/
/**
* Register set registration record type.
*/
diff --git a/src/VBox/VMM/VMMR3/DBGFStack.cpp b/src/VBox/VMM/VMMR3/DBGFStack.cpp
index b14a6a5..1764b87 100644
--- a/src/VBox/VMM/VMMR3/DBGFStack.cpp
+++ b/src/VBox/VMM/VMMR3/DBGFStack.cpp
@@ -16,9 +16,9 @@
*/
-/*******************************************************************************
-* Header Files *
-*******************************************************************************/
+/*********************************************************************************************************************************
+* Header Files *
+*********************************************************************************************************************************/
#define LOG_GROUP LOG_GROUP_DBGF
#include <VBox/vmm/dbgf.h>
#include <VBox/vmm/selm.h>
diff --git a/src/VBox/VMM/VMMR3/EM.cpp b/src/VBox/VMM/VMMR3/EM.cpp
index d7fbb36..cdee17c 100644
--- a/src/VBox/VMM/VMMR3/EM.cpp
+++ b/src/VBox/VMM/VMMR3/EM.cpp
@@ -31,9 +31,10 @@
* @see grp_em
*/
-/*******************************************************************************
-* Header Files *
-*******************************************************************************/
+
+/*********************************************************************************************************************************
+* Header Files *
+*********************************************************************************************************************************/
#define LOG_GROUP LOG_GROUP_EM
#include <VBox/vmm/em.h>
#include <VBox/vmm/vmm.h>
@@ -70,17 +71,17 @@
#include <iprt/thread.h>
-/*******************************************************************************
-* Defined Constants And Macros *
-*******************************************************************************/
+/*********************************************************************************************************************************
+* Defined Constants And Macros *
+*********************************************************************************************************************************/
#if 0 /* Disabled till after 2.1.0 when we've time to test it. */
#define EM_NOTIFY_HM
#endif
-/*******************************************************************************
-* Internal Functions *
-*******************************************************************************/
+/*********************************************************************************************************************************
+* Internal Functions *
+*********************************************************************************************************************************/
static DECLCALLBACK(int) emR3Save(PVM pVM, PSSMHANDLE pSSM);
static DECLCALLBACK(int) emR3Load(PVM pVM, PSSMHANDLE pSSM, uint32_t uVersion, uint32_t uPass);
#if defined(LOG_ENABLED) || defined(VBOX_STRICT)
diff --git a/src/VBox/VMM/VMMR3/EMHM.cpp b/src/VBox/VMM/VMMR3/EMHM.cpp
index 59267f3..54a8d68 100644
--- a/src/VBox/VMM/VMMR3/EMHM.cpp
+++ b/src/VBox/VMM/VMMR3/EMHM.cpp
@@ -15,9 +15,10 @@
* hope that it will be useful, but WITHOUT ANY WARRANTY of any kind.
*/
-/*******************************************************************************
-* Header Files *
-*******************************************************************************/
+
+/*********************************************************************************************************************************
+* Header Files *
+*********************************************************************************************************************************/
#define LOG_GROUP LOG_GROUP_EM
#include <VBox/vmm/em.h>
#include <VBox/vmm/vmm.h>
@@ -49,17 +50,17 @@
#include <iprt/asm.h>
-/*******************************************************************************
-* Defined Constants And Macros *
-*******************************************************************************/
+/*********************************************************************************************************************************
+* Defined Constants And Macros *
+*********************************************************************************************************************************/
#if 0 /* Disabled till after 2.1.0 when we've time to test it. */
#define EM_NOTIFY_HM
#endif
-/*******************************************************************************
-* Internal Functions *
-*******************************************************************************/
+/*********************************************************************************************************************************
+* Internal Functions *
+*********************************************************************************************************************************/
DECLINLINE(int) emR3HmExecuteInstruction(PVM pVM, PVMCPU pVCpu, const char *pszPrefix, int rcGC = VINF_SUCCESS);
static int emR3HmExecuteIOInstruction(PVM pVM, PVMCPU pVCpu);
static int emR3HmForcedActions(PVM pVM, PVMCPU pVCpu, PCPUMCTX pCtx);
diff --git a/src/VBox/VMM/VMMR3/EMR3Dbg.cpp b/src/VBox/VMM/VMMR3/EMR3Dbg.cpp
index 8eb438c..dda4829 100644
--- a/src/VBox/VMM/VMMR3/EMR3Dbg.cpp
+++ b/src/VBox/VMM/VMMR3/EMR3Dbg.cpp
@@ -15,9 +15,10 @@
* hope that it will be useful, but WITHOUT ANY WARRANTY of any kind.
*/
-/*******************************************************************************
-* Header Files *
-*******************************************************************************/
+
+/*********************************************************************************************************************************
+* Header Files *
+*********************************************************************************************************************************/
#define LOG_GROUP LOG_GROUP_EM
#include <VBox/vmm/em.h>
#include <VBox/dbg.h>
diff --git a/src/VBox/VMM/VMMR3/EMRaw.cpp b/src/VBox/VMM/VMMR3/EMRaw.cpp
index 91f9907..e1c1e44 100644
--- a/src/VBox/VMM/VMMR3/EMRaw.cpp
+++ b/src/VBox/VMM/VMMR3/EMRaw.cpp
@@ -16,9 +16,9 @@
*/
-/*******************************************************************************
-* Header Files *
-*******************************************************************************/
+/*********************************************************************************************************************************
+* Header Files *
+*********************************************************************************************************************************/
#define LOG_GROUP LOG_GROUP_EM
#include <VBox/vmm/em.h>
#include <VBox/vmm/vmm.h>
@@ -55,9 +55,9 @@
-/*******************************************************************************
-* Internal Functions *
-*******************************************************************************/
+/*********************************************************************************************************************************
+* Internal Functions *
+*********************************************************************************************************************************/
static int emR3RawForcedActions(PVM pVM, PVMCPU pVCpu, PCPUMCTX pCtx);
DECLINLINE(int) emR3RawExecuteInstruction(PVM pVM, PVMCPU pVCpu, const char *pszPrefix, int rcGC = VINF_SUCCESS);
static int emR3RawGuestTrap(PVM pVM, PVMCPU pVCpu);
diff --git a/src/VBox/VMM/VMMR3/FTM.cpp b/src/VBox/VMM/VMMR3/FTM.cpp
index 317cc86..bb3bb42 100644
--- a/src/VBox/VMM/VMMR3/FTM.cpp
+++ b/src/VBox/VMM/VMMR3/FTM.cpp
@@ -16,9 +16,9 @@
*/
-/*******************************************************************************
-* Header Files *
-*******************************************************************************/
+/*********************************************************************************************************************************
+* Header Files *
+*********************************************************************************************************************************/
#define LOG_GROUP LOG_GROUP_FTM
#include <VBox/vmm/ftm.h>
#include <VBox/vmm/em.h>
@@ -89,9 +89,10 @@ typedef struct FTMTCPHDRMEM
uint32_t cb;
} FTMTCPHDRMEM;
-/*******************************************************************************
-* Global Variables *
-*******************************************************************************/
+
+/*********************************************************************************************************************************
+* Global Variables *
+*********************************************************************************************************************************/
static const char g_szWelcome[] = "VirtualBox-Fault-Tolerance-Sync-1.0\n";
static DECLCALLBACK(int) ftmR3PageTreeDestroyCallback(PAVLGCPHYSNODECORE pBaseNode, void *pvUser);
diff --git a/src/VBox/VMM/VMMR3/GIM.cpp b/src/VBox/VMM/VMMR3/GIM.cpp
index 7c56d3c..964184b 100644
--- a/src/VBox/VMM/VMMR3/GIM.cpp
+++ b/src/VBox/VMM/VMMR3/GIM.cpp
@@ -45,9 +45,10 @@
* changed during the lifetime of the VM.
*/
-/*******************************************************************************
-* Header Files *
-*******************************************************************************/
+
+/*********************************************************************************************************************************
+* Header Files *
+*********************************************************************************************************************************/
#define LOG_GROUP LOG_GROUP_GIM
#include <VBox/log.h>
#include "GIMInternal.h"
@@ -64,9 +65,10 @@
#include "GIMHvInternal.h"
#include "GIMKvmInternal.h"
-/*******************************************************************************
-* Internal Functions *
-*******************************************************************************/
+
+/*********************************************************************************************************************************
+* Internal Functions *
+*********************************************************************************************************************************/
static DECLCALLBACK(int) gimR3Save(PVM pVM, PSSMHANDLE pSSM);
static DECLCALLBACK(int) gimR3Load(PVM pVM, PSSMHANDLE pSSM, uint32_t uSSMVersion, uint32_t uPass);
static FNPGMPHYSHANDLER gimR3Mmio2WriteHandler;
diff --git a/src/VBox/VMM/VMMR3/GIMHv.cpp b/src/VBox/VMM/VMMR3/GIMHv.cpp
index a03f127..971f249 100644
--- a/src/VBox/VMM/VMMR3/GIMHv.cpp
+++ b/src/VBox/VMM/VMMR3/GIMHv.cpp
@@ -15,9 +15,10 @@
* hope that it will be useful, but WITHOUT ANY WARRANTY of any kind.
*/
-/*******************************************************************************
-* Header Files *
-*******************************************************************************/
+
+/*********************************************************************************************************************************
+* Header Files *
+*********************************************************************************************************************************/
#define LOG_GROUP LOG_GROUP_GIM
#include "GIMInternal.h"
@@ -35,9 +36,9 @@
#include <VBox/version.h>
-/*******************************************************************************
-* Defined Constants And Macros *
-*******************************************************************************/
+/*********************************************************************************************************************************
+* Defined Constants And Macros *
+*********************************************************************************************************************************/
//#define GIMHV_HYPERCALL "GIMHvHypercall"
/**
@@ -46,9 +47,9 @@
#define GIM_HV_SAVED_STATE_VERSION UINT32_C(1)
-/*******************************************************************************
-* Global Variables *
-*******************************************************************************/
+/*********************************************************************************************************************************
+* Global Variables *
+*********************************************************************************************************************************/
#ifdef VBOX_WITH_STATISTICS
# define GIMHV_MSRRANGE(a_uFirst, a_uLast, a_szName) \
{ (a_uFirst), (a_uLast), kCpumMsrRdFn_Gim, kCpumMsrWrFn_Gim, 0, 0, 0, 0, 0, a_szName, { 0 }, { 0 }, { 0 }, { 0 } }
@@ -94,6 +95,17 @@ VMMR3_INT_DECL(int) gimR3HvInit(PVM pVM)
PGIMHV pHv = &pVM->gim.s.u.Hv;
/*
+ * Read configuration.
+ */
+ PCFGMNODE pCfgNode = CFGMR3GetChild(CFGMR3GetRoot(pVM), "GIM/HyperV");
+
+ /** @cfgm{/GIM/HyperV/VendorID, string, 'VBoxVBoxVBox'}
+ * The Hyper-V vendor signature, must be 12 characters. */
+ char szVendor[13];
+ rc = CFGMR3QueryStringDef(pCfgNode, "VendorID", szVendor, sizeof(szVendor), "VBoxVBoxVBox");
+ AssertLogRelRCReturn(rc, rc);
+
+ /*
* Determine interface capabilities based on the version.
*/
if (!pVM->gim.s.u32Version)
@@ -177,9 +189,21 @@ VMMR3_INT_DECL(int) gimR3HvInit(PVM pVM)
RT_ZERO(HyperLeaf);
HyperLeaf.uLeaf = UINT32_C(0x40000000);
HyperLeaf.uEax = UINT32_C(0x40000006); /* Minimum value for Hyper-V is 0x40000005. */
- HyperLeaf.uEbx = 0x7263694D; /* 'Micr' */
- HyperLeaf.uEcx = 0x666F736F; /* 'osof' */
- HyperLeaf.uEdx = 0x76482074; /* 't Hv' */
+ /* Don't report vendor as 'Microsoft Hv' by default, see @bugref{7270#c152}. */
+ {
+ uint32_t uVendorEbx;
+ uint32_t uVendorEcx;
+ uint32_t uVendorEdx;
+ uVendorEbx = ((uint32_t)szVendor[ 3]) << 24 | ((uint32_t)szVendor[ 2]) << 16 | ((uint32_t)szVendor[1]) << 8
+ | (uint32_t)szVendor[ 0];
+ uVendorEcx = ((uint32_t)szVendor[ 7]) << 24 | ((uint32_t)szVendor[ 6]) << 16 | ((uint32_t)szVendor[5]) << 8
+ | (uint32_t)szVendor[ 4];
+ uVendorEdx = ((uint32_t)szVendor[11]) << 24 | ((uint32_t)szVendor[10]) << 16 | ((uint32_t)szVendor[9]) << 8
+ | (uint32_t)szVendor[ 8];
+ HyperLeaf.uEbx = uVendorEbx;
+ HyperLeaf.uEcx = uVendorEcx;
+ HyperLeaf.uEdx = uVendorEdx;
+ }
rc = CPUMR3CpuIdInsert(pVM, &HyperLeaf);
AssertLogRelRCReturn(rc, rc);
diff --git a/src/VBox/VMM/VMMR3/GIMKvm.cpp b/src/VBox/VMM/VMMR3/GIMKvm.cpp
index 87cf117..5bc6332 100644
--- a/src/VBox/VMM/VMMR3/GIMKvm.cpp
+++ b/src/VBox/VMM/VMMR3/GIMKvm.cpp
@@ -15,9 +15,10 @@
* hope that it will be useful, but WITHOUT ANY WARRANTY of any kind.
*/
-/*******************************************************************************
-* Header Files *
-*******************************************************************************/
+
+/*********************************************************************************************************************************
+* Header Files *
+*********************************************************************************************************************************/
#define LOG_GROUP LOG_GROUP_GIM
#include "GIMInternal.h"
@@ -37,9 +38,9 @@
#include <VBox/version.h>
-/*******************************************************************************
-* Defined Constants And Macros *
-*******************************************************************************/
+/*********************************************************************************************************************************
+* Defined Constants And Macros *
+*********************************************************************************************************************************/
/**
* GIM KVM saved-state version.
@@ -58,9 +59,10 @@ typedef struct KVMWALLCLOCKINFO
/** Pointer to the wall-clock info. struct. */
typedef KVMWALLCLOCKINFO *PKVMWALLCLOCKINFO;
-/*******************************************************************************
-* Global Variables *
-*******************************************************************************/
+
+/*********************************************************************************************************************************
+* Global Variables *
+*********************************************************************************************************************************/
#ifdef VBOX_WITH_STATISTICS
# define GIMKVM_MSRRANGE(a_uFirst, a_uLast, a_szName) \
{ (a_uFirst), (a_uLast), kCpumMsrRdFn_Gim, kCpumMsrWrFn_Gim, 0, 0, 0, 0, 0, a_szName, { 0 }, { 0 }, { 0 }, { 0 } }
diff --git a/src/VBox/VMM/VMMR3/GIMMinimal.cpp b/src/VBox/VMM/VMMR3/GIMMinimal.cpp
index 8ef3ae3..54dc5af 100644
--- a/src/VBox/VMM/VMMR3/GIMMinimal.cpp
+++ b/src/VBox/VMM/VMMR3/GIMMinimal.cpp
@@ -15,9 +15,10 @@
* hope that it will be useful, but WITHOUT ANY WARRANTY of any kind.
*/
-/*******************************************************************************
-* Header Files *
-*******************************************************************************/
+
+/*********************************************************************************************************************************
+* Header Files *
+*********************************************************************************************************************************/
#define LOG_GROUP LOG_GROUP_GIM
#include "GIMInternal.h"
@@ -31,9 +32,10 @@
#include <VBox/vmm/tm.h>
#include <VBox/vmm/pdmapi.h>
-/*******************************************************************************
-* Defined Constants And Macros *
-*******************************************************************************/
+
+/*********************************************************************************************************************************
+* Defined Constants And Macros *
+*********************************************************************************************************************************/
/**
* Initializes the Minimal provider.
diff --git a/src/VBox/VMM/VMMR3/GMM.cpp b/src/VBox/VMM/VMMR3/GMM.cpp
index c4433d9..7d9e0e0 100644
--- a/src/VBox/VMM/VMMR3/GMM.cpp
+++ b/src/VBox/VMM/VMMR3/GMM.cpp
@@ -16,9 +16,9 @@
*/
-/*******************************************************************************
-* Header Files *
-*******************************************************************************/
+/*********************************************************************************************************************************
+* Header Files *
+*********************************************************************************************************************************/
#define LOG_GROUP LOG_GROUP_GMM
#include <VBox/vmm/gmm.h>
#include <VBox/vmm/vmm.h>
diff --git a/src/VBox/VMM/VMMR3/HM.cpp b/src/VBox/VMM/VMMR3/HM.cpp
index 60cd7c9..bb36bd7 100644
--- a/src/VBox/VMM/VMMR3/HM.cpp
+++ b/src/VBox/VMM/VMMR3/HM.cpp
@@ -16,9 +16,9 @@
*/
-/*******************************************************************************
-* Header Files *
-*******************************************************************************/
+/*********************************************************************************************************************************
+* Header Files *
+*********************************************************************************************************************************/
#define LOG_GROUP LOG_GROUP_HM
#include <VBox/vmm/cpum.h>
#include <VBox/vmm/stam.h>
@@ -51,9 +51,9 @@
#include <iprt/thread.h>
-/*******************************************************************************
-* Global Variables *
-*******************************************************************************/
+/*********************************************************************************************************************************
+* Global Variables *
+*********************************************************************************************************************************/
#ifdef VBOX_WITH_STATISTICS
# define EXIT_REASON(def, val, str) #def " - " #val " - " str
# define EXIT_REASON_NIL() NULL
@@ -305,9 +305,9 @@ static const char * const g_apszAmdVExitReasons[MAX_EXITREASON_STAT] =
} while (0)
-/*******************************************************************************
-* Internal Functions *
-*******************************************************************************/
+/*********************************************************************************************************************************
+* Internal Functions *
+*********************************************************************************************************************************/
static DECLCALLBACK(int) hmR3Save(PVM pVM, PSSMHANDLE pSSM);
static DECLCALLBACK(int) hmR3Load(PVM pVM, PSSMHANDLE pSSM, uint32_t uVersion, uint32_t uPass);
static int hmR3InitCPU(PVM pVM);
@@ -671,7 +671,7 @@ static int hmR3InitCPU(PVM pVM)
"/PROF/CPU%d/HM/InGC", i);
AssertRC(rc);
-# if HC_ARCH_BITS == 32 && defined(VBOX_ENABLE_64_BITS_GUESTS) && !defined(VBOX_WITH_HYBRID_32BIT_KERNEL)
+# if HC_ARCH_BITS == 32 && defined(VBOX_ENABLE_64_BITS_GUESTS)
rc = STAMR3RegisterF(pVM, &pVCpu->hm.s.StatWorldSwitch3264, STAMTYPE_PROFILE, STAMVISIBILITY_USED,
STAMUNIT_TICKS_PER_CALL, "Profiling of the 32/64 switcher.",
"/PROF/CPU%d/HM/Switcher3264", i);
@@ -797,7 +797,7 @@ static int hmR3InitCPU(PVM pVM)
HM_REG_COUNTER(&pVCpu->hm.s.StatVmxCheckBadTr, "/HM/CPU%d/VMXCheck/TR", "Could not use VMX due to unsuitable TR.");
HM_REG_COUNTER(&pVCpu->hm.s.StatVmxCheckPmOk, "/HM/CPU%d/VMXCheck/VMX_PM", "VMX execution in protected mode OK.");
-#if HC_ARCH_BITS == 32 && defined(VBOX_ENABLE_64_BITS_GUESTS) && !defined(VBOX_WITH_HYBRID_32BIT_KERNEL)
+#if HC_ARCH_BITS == 32 && defined(VBOX_ENABLE_64_BITS_GUESTS)
HM_REG_COUNTER(&pVCpu->hm.s.StatFpu64SwitchBack, "/HM/CPU%d/Switch64/Fpu", "Saving guest FPU/XMM state.");
HM_REG_COUNTER(&pVCpu->hm.s.StatDebug64SwitchBack, "/HM/CPU%d/Switch64/Debug", "Saving guest debug state.");
#endif
@@ -1546,7 +1546,7 @@ VMMR3_INT_DECL(void) HMR3Relocate(PVM pVM)
pVCpu->hm.s.enmShadowMode = PGMGetShadowMode(pVCpu);
}
}
-#if HC_ARCH_BITS == 32 && defined(VBOX_ENABLE_64_BITS_GUESTS) && !defined(VBOX_WITH_HYBRID_32BIT_KERNEL)
+#if HC_ARCH_BITS == 32 && defined(VBOX_ENABLE_64_BITS_GUESTS)
if (HMIsEnabled(pVM))
{
switch (PGMGetHostMode(pVM))
@@ -1744,7 +1744,7 @@ VMMR3_INT_DECL(void) HMR3Reset(PVM pVM)
* @param pVCpu The VMCPU for the EMT we're being called on.
* @param pvUser Unused.
*/
-DECLCALLBACK(VBOXSTRICTRC) hmR3RemovePatches(PVM pVM, PVMCPU pVCpu, void *pvUser)
+static DECLCALLBACK(VBOXSTRICTRC) hmR3RemovePatches(PVM pVM, PVMCPU pVCpu, void *pvUser)
{
VMCPUID idCpu = (VMCPUID)(uintptr_t)pvUser;
@@ -1883,7 +1883,7 @@ VMMR3_INT_DECL(int) HMR3DisablePatching(PVM pVM, RTGCPTR pPatchMem, unsigned cb
* @param pvUser User specified CPU context.
*
*/
-DECLCALLBACK(VBOXSTRICTRC) hmR3ReplaceTprInstr(PVM pVM, PVMCPU pVCpu, void *pvUser)
+static DECLCALLBACK(VBOXSTRICTRC) hmR3ReplaceTprInstr(PVM pVM, PVMCPU pVCpu, void *pvUser)
{
/*
* Only execute the handler on the VCPU the original patch request was
@@ -2057,7 +2057,7 @@ DECLCALLBACK(VBOXSTRICTRC) hmR3ReplaceTprInstr(PVM pVM, PVMCPU pVCpu, void *pvUs
* @param pvUser User specified CPU context.
*
*/
-DECLCALLBACK(VBOXSTRICTRC) hmR3PatchTprInstr(PVM pVM, PVMCPU pVCpu, void *pvUser)
+static DECLCALLBACK(VBOXSTRICTRC) hmR3PatchTprInstr(PVM pVM, PVMCPU pVCpu, void *pvUser)
{
/*
* Only execute the handler on the VCPU the original patch request was
diff --git a/src/VBox/VMM/VMMR3/IEMR3.cpp b/src/VBox/VMM/VMMR3/IEMR3.cpp
index 767e948..2ef0599 100644
--- a/src/VBox/VMM/VMMR3/IEMR3.cpp
+++ b/src/VBox/VMM/VMMR3/IEMR3.cpp
@@ -15,9 +15,10 @@
* hope that it will be useful, but WITHOUT ANY WARRANTY of any kind.
*/
-/*******************************************************************************
-* Header Files *
-*******************************************************************************/
+
+/*********************************************************************************************************************************
+* Header Files *
+*********************************************************************************************************************************/
#define LOG_GROUP LOG_GROUP_EM
#include <VBox/vmm/iem.h>
#include <VBox/vmm/cpum.h>
diff --git a/src/VBox/VMM/VMMR3/IOM.cpp b/src/VBox/VMM/VMMR3/IOM.cpp
index b081555..6098f3a 100644
--- a/src/VBox/VMM/VMMR3/IOM.cpp
+++ b/src/VBox/VMM/VMMR3/IOM.cpp
@@ -96,9 +96,9 @@
* */
-/*******************************************************************************
-* Header Files *
-*******************************************************************************/
+/*********************************************************************************************************************************
+* Header Files *
+*********************************************************************************************************************************/
#define LOG_GROUP LOG_GROUP_IOM
#include <VBox/vmm/iom.h>
#include <VBox/vmm/cpum.h>
@@ -123,9 +123,9 @@
#include "IOMInline.h"
-/*******************************************************************************
-* Internal Functions *
-*******************************************************************************/
+/*********************************************************************************************************************************
+* Internal Functions *
+*********************************************************************************************************************************/
static void iomR3FlushCache(PVM pVM);
static DECLCALLBACK(int) iomR3RelocateIOPortCallback(PAVLROIOPORTNODECORE pNode, void *pvUser);
static DECLCALLBACK(int) iomR3RelocateMMIOCallback(PAVLROGCPHYSNODECORE pNode, void *pvUser);
diff --git a/src/VBox/VMM/VMMR3/MM.cpp b/src/VBox/VMM/VMMR3/MM.cpp
index 9cc1617..4f3108c 100644
--- a/src/VBox/VMM/VMMR3/MM.cpp
+++ b/src/VBox/VMM/VMMR3/MM.cpp
@@ -140,9 +140,9 @@ Hypervisor Memory Area (HMA) Layout: Base 00000000a0000000, 0x00800000 bytes
*/
-/*******************************************************************************
-* Header Files *
-*******************************************************************************/
+/*********************************************************************************************************************************
+* Header Files *
+*********************************************************************************************************************************/
#define LOG_GROUP LOG_GROUP_MM
#include <VBox/vmm/mm.h>
#include <VBox/vmm/pgm.h>
@@ -161,16 +161,16 @@ Hypervisor Memory Area (HMA) Layout: Base 00000000a0000000, 0x00800000 bytes
#include <iprt/string.h>
-/*******************************************************************************
-* Defined Constants And Macros *
-*******************************************************************************/
+/*********************************************************************************************************************************
+* Defined Constants And Macros *
+*********************************************************************************************************************************/
/** The current saved state version of MM. */
#define MM_SAVED_STATE_VERSION 2
-/*******************************************************************************
-* Internal Functions *
-*******************************************************************************/
+/*********************************************************************************************************************************
+* Internal Functions *
+*********************************************************************************************************************************/
static DECLCALLBACK(int) mmR3Save(PVM pVM, PSSMHANDLE pSSM);
static DECLCALLBACK(int) mmR3Load(PVM pVM, PSSMHANDLE pSSM, uint32_t uVersion, uint32_t uPass);
diff --git a/src/VBox/VMM/VMMR3/MMHeap.cpp b/src/VBox/VMM/VMMR3/MMHeap.cpp
index 40df227..6c33d32 100644
--- a/src/VBox/VMM/VMMR3/MMHeap.cpp
+++ b/src/VBox/VMM/VMMR3/MMHeap.cpp
@@ -16,9 +16,9 @@
*/
-/*******************************************************************************
-* Header Files *
-*******************************************************************************/
+/*********************************************************************************************************************************
+* Header Files *
+*********************************************************************************************************************************/
#define LOG_GROUP LOG_GROUP_MM_HEAP
#include <VBox/vmm/mm.h>
#include <VBox/vmm/stam.h>
@@ -35,9 +35,9 @@
#include <iprt/string.h>
-/*******************************************************************************
-* Internal Functions *
-*******************************************************************************/
+/*********************************************************************************************************************************
+* Internal Functions *
+*********************************************************************************************************************************/
static void *mmR3HeapAlloc(PMMHEAP pHeap, MMTAG enmTag, size_t cbSize, bool fZero);
diff --git a/src/VBox/VMM/VMMR3/MMHyper.cpp b/src/VBox/VMM/VMMR3/MMHyper.cpp
index b904856..9525c94 100644
--- a/src/VBox/VMM/VMMR3/MMHyper.cpp
+++ b/src/VBox/VMM/VMMR3/MMHyper.cpp
@@ -16,9 +16,9 @@
*/
-/*******************************************************************************
-* Header Files *
-*******************************************************************************/
+/*********************************************************************************************************************************
+* Header Files *
+*********************************************************************************************************************************/
#define LOG_GROUP LOG_GROUP_MM_HYPER
#include <VBox/vmm/pgm.h>
#include <VBox/vmm/mm.h>
@@ -35,9 +35,9 @@
#include <iprt/string.h>
-/*******************************************************************************
-* Internal Functions *
-*******************************************************************************/
+/*********************************************************************************************************************************
+* Internal Functions *
+*********************************************************************************************************************************/
static DECLCALLBACK(bool) mmR3HyperRelocateCallback(PVM pVM, RTGCPTR GCPtrOld, RTGCPTR GCPtrNew, PGMRELOCATECALL enmMode,
void *pvUser);
static int mmR3HyperMap(PVM pVM, const size_t cb, const char *pszDesc, PRTGCPTR pGCPtr, PMMLOOKUPHYPER *ppLookup);
diff --git a/src/VBox/VMM/VMMR3/MMPagePool.cpp b/src/VBox/VMM/VMMR3/MMPagePool.cpp
index 3f4ff77..c3e0676 100644
--- a/src/VBox/VMM/VMMR3/MMPagePool.cpp
+++ b/src/VBox/VMM/VMMR3/MMPagePool.cpp
@@ -15,9 +15,10 @@
* hope that it will be useful, but WITHOUT ANY WARRANTY of any kind.
*/
-/*******************************************************************************
-* Header Files *
-*******************************************************************************/
+
+/*********************************************************************************************************************************
+* Header Files *
+*********************************************************************************************************************************/
#define LOG_GROUP LOG_GROUP_MM_POOL
#include <VBox/vmm/mm.h>
#include <VBox/vmm/pgm.h>
@@ -38,9 +39,9 @@
-/*******************************************************************************
-* Internal Functions *
-*******************************************************************************/
+/*********************************************************************************************************************************
+* Internal Functions *
+*********************************************************************************************************************************/
#ifdef IN_RING3
static void * mmR3PagePoolAlloc(PMMPAGEPOOL pPool);
static void mmR3PagePoolFree(PMMPAGEPOOL pPool, void *pv);
diff --git a/src/VBox/VMM/VMMR3/MMUkHeap.cpp b/src/VBox/VMM/VMMR3/MMUkHeap.cpp
index 2534ce7..0ffc30b 100644
--- a/src/VBox/VMM/VMMR3/MMUkHeap.cpp
+++ b/src/VBox/VMM/VMMR3/MMUkHeap.cpp
@@ -16,9 +16,9 @@
*/
-/*******************************************************************************
-* Header Files *
-*******************************************************************************/
+/*********************************************************************************************************************************
+* Header Files *
+*********************************************************************************************************************************/
#define LOG_GROUP LOG_GROUP_MM_HEAP
#include <VBox/vmm/mm.h>
#include <VBox/vmm/stam.h>
@@ -34,9 +34,9 @@
#include <iprt/heap.h>
-/*******************************************************************************
-* Internal Functions *
-*******************************************************************************/
+/*********************************************************************************************************************************
+* Internal Functions *
+*********************************************************************************************************************************/
static void *mmR3UkHeapAlloc(PMMUKHEAP pHeap, MMTAG enmTag, size_t cb, bool fZero, PRTR0PTR pR0Ptr);
diff --git a/src/VBox/VMM/VMMR3/PATM.cpp b/src/VBox/VMM/VMMR3/PATM.cpp
index d24e4f7..0e9ccca 100644
--- a/src/VBox/VMM/VMMR3/PATM.cpp
+++ b/src/VBox/VMM/VMMR3/PATM.cpp
@@ -17,9 +17,10 @@
* hope that it will be useful, but WITHOUT ANY WARRANTY of any kind.
*/
-/*******************************************************************************
-* Header Files *
-*******************************************************************************/
+
+/*********************************************************************************************************************************
+* Header Files *
+*********************************************************************************************************************************/
#define LOG_GROUP LOG_GROUP_PATM
#include <VBox/vmm/patm.h>
#include <VBox/vmm/stam.h>
@@ -88,9 +89,9 @@ typedef struct
} PATMDISASM, *PPATMDISASM;
-/*******************************************************************************
-* Internal Functions *
-*******************************************************************************/
+/*********************************************************************************************************************************
+* Internal Functions *
+*********************************************************************************************************************************/
static int patmDisableUnusablePatch(PVM pVM, RTRCPTR pInstrGC, RTRCPTR pConflictAddr, PPATCHINFO pPatch);
static int patmActivateInt3Patch(PVM pVM, PPATCHINFO pPatch);
static int patmDeactivateInt3Patch(PVM pVM, PPATCHINFO pPatch);
@@ -1699,7 +1700,7 @@ static int patmAnalyseFunctionCallback(PVM pVM, DISCPUSTATE *pCpu, RCPTRTYPE(uin
* @param pCacheRec Cache record ptr
*
*/
-static int patmRecompileCallback(PVM pVM, DISCPUSTATE *pCpu, RCPTRTYPE(uint8_t *) pInstrGC, RCPTRTYPE(uint8_t *) pCurInstrGC, PPATMP2GLOOKUPREC pCacheRec)
+static DECLCALLBACK(int) patmRecompileCallback(PVM pVM, DISCPUSTATE *pCpu, RCPTRTYPE(uint8_t *) pInstrGC, RCPTRTYPE(uint8_t *) pCurInstrGC, PPATMP2GLOOKUPREC pCacheRec)
{
PPATCHINFO pPatch = (PPATCHINFO)pCacheRec->pPatch;
int rc = VINF_SUCCESS;
@@ -2184,7 +2185,8 @@ static bool patmIsKnownDisasmJump(PPATCHINFO pPatch, RTRCPTR pInstrGC)
* @param pCacheRec Cache record ptr
*
*/
-int patmr3DisasmCallback(PVM pVM, DISCPUSTATE *pCpu, RCPTRTYPE(uint8_t *) pInstrGC, RCPTRTYPE(uint8_t *) pCurInstrGC, PPATMP2GLOOKUPREC pCacheRec)
+DECLCALLBACK(int) patmR3DisasmCallback(PVM pVM, DISCPUSTATE *pCpu, RCPTRTYPE(uint8_t *) pInstrGC,
+ RCPTRTYPE(uint8_t *) pCurInstrGC, PPATMP2GLOOKUPREC pCacheRec)
{
PPATCHINFO pPatch = (PPATCHINFO)pCacheRec->pPatch;
NOREF(pInstrGC);
@@ -2938,7 +2940,7 @@ static int patmR3PatchBlock(PVM pVM, RTRCPTR pInstrGC, R3PTRTYPE(uint8_t *) pIns
#ifdef LOG_ENABLED
Log(("Patch code ----------------------------------------------------------\n"));
- patmr3DisasmCodeStream(pVM, PATCHCODE_PTR_GC(pPatch), PATCHCODE_PTR_GC(pPatch), patmr3DisasmCallback, &cacheRec);
+ patmr3DisasmCodeStream(pVM, PATCHCODE_PTR_GC(pPatch), PATCHCODE_PTR_GC(pPatch), patmR3DisasmCallback, &cacheRec);
/* Free leftover lock if any. */
if (cacheRec.Lock.pvMap)
{
@@ -3122,7 +3124,7 @@ static int patmIdtHandler(PVM pVM, RTRCPTR pInstrGC, uint32_t uOpSize, PPATMPATC
#ifdef LOG_ENABLED
Log(("Patch code ----------------------------------------------------------\n"));
- patmr3DisasmCodeStream(pVM, PATCHCODE_PTR_GC(pPatch), PATCHCODE_PTR_GC(pPatch), patmr3DisasmCallback, pCacheRec);
+ patmr3DisasmCodeStream(pVM, PATCHCODE_PTR_GC(pPatch), PATCHCODE_PTR_GC(pPatch), patmR3DisasmCallback, pCacheRec);
Log(("Patch code ends -----------------------------------------------------\n"));
#endif
Log(("Successfully installed IDT handler patch at %RRv\n", pInstrGC));
@@ -3196,7 +3198,7 @@ static int patmInstallTrapTrampoline(PVM pVM, RTRCPTR pInstrGC, PPATMPATCHREC pP
#ifdef LOG_ENABLED
Log(("Patch code ----------------------------------------------------------\n"));
- patmr3DisasmCodeStream(pVM, PATCHCODE_PTR_GC(pPatch), PATCHCODE_PTR_GC(pPatch), patmr3DisasmCallback, pCacheRec);
+ patmr3DisasmCodeStream(pVM, PATCHCODE_PTR_GC(pPatch), PATCHCODE_PTR_GC(pPatch), patmR3DisasmCallback, pCacheRec);
Log(("Patch code ends -----------------------------------------------------\n"));
#endif
PATM_LOG_ORG_PATCH_INSTR(pVM, pPatch, "TRAP handler");
@@ -3343,7 +3345,7 @@ static int patmDuplicateFunction(PVM pVM, RTRCPTR pInstrGC, PPATMPATCHREC pPatch
#ifdef LOG_ENABLED
Log(("Patch code ----------------------------------------------------------\n"));
- patmr3DisasmCodeStream(pVM, PATCHCODE_PTR_GC(pPatch), PATCHCODE_PTR_GC(pPatch), patmr3DisasmCallback, pCacheRec);
+ patmr3DisasmCodeStream(pVM, PATCHCODE_PTR_GC(pPatch), PATCHCODE_PTR_GC(pPatch), patmR3DisasmCallback, pCacheRec);
Log(("Patch code ends -----------------------------------------------------\n"));
#endif
@@ -5647,7 +5649,7 @@ int patmR3RemovePatch(PVM pVM, PPATMPATCHREC pPatchRec, bool fForceRemove)
* @param pNode The current patch to guest record to check.
* @param pvUser The refresh state.
*/
-static int patmR3PatchRefreshFindTrampolinePatch(PAVLU32NODECORE pNode, void *pvUser)
+static DECLCALLBACK(int) patmR3PatchRefreshFindTrampolinePatch(PAVLU32NODECORE pNode, void *pvUser)
{
PRECPATCHTOGUEST pPatch2GuestRec = (PRECPATCHTOGUEST)pNode;
PPATMREFRESHPATCH pRefreshPatchState = (PPATMREFRESHPATCH)pvUser;
diff --git a/src/VBox/VMM/VMMR3/PATMGuest.cpp b/src/VBox/VMM/VMMR3/PATMGuest.cpp
index 00c3b74..b38dba3 100644
--- a/src/VBox/VMM/VMMR3/PATMGuest.cpp
+++ b/src/VBox/VMM/VMMR3/PATMGuest.cpp
@@ -15,9 +15,10 @@
* hope that it will be useful, but WITHOUT ANY WARRANTY of any kind.
*/
-/*******************************************************************************
-* Header Files *
-*******************************************************************************/
+
+/*********************************************************************************************************************************
+* Header Files *
+*********************************************************************************************************************************/
#define LOG_GROUP LOG_GROUP_PATM
#include <VBox/vmm/patm.h>
#include <VBox/vmm/pgm.h>
@@ -154,7 +155,7 @@ int PATMPatchSysenterXP(PVM pVM, RTGCPTR32 pInstrGC, PPATMPATCHREC pPatchRec)
RT_ZERO(cacheRec);
cacheRec.pPatch = pPatch;
- patmr3DisasmCodeStream(pVM, pInstrGC, pInstrGC, patmr3DisasmCallback, &cacheRec);
+ patmr3DisasmCodeStream(pVM, pInstrGC, pInstrGC, patmR3DisasmCallback, &cacheRec);
/* Free leftover lock if any. */
if (cacheRec.Lock.pvMap)
PGMPhysReleasePageMappingLock(pVM, &cacheRec.Lock);
diff --git a/src/VBox/VMM/VMMR3/PATMPatch.cpp b/src/VBox/VMM/VMMR3/PATMPatch.cpp
index 43ced91..7c1d332 100644
--- a/src/VBox/VMM/VMMR3/PATMPatch.cpp
+++ b/src/VBox/VMM/VMMR3/PATMPatch.cpp
@@ -17,9 +17,10 @@
* hope that it will be useful, but WITHOUT ANY WARRANTY of any kind.
*/
-/*******************************************************************************
-* Header Files *
-*******************************************************************************/
+
+/*********************************************************************************************************************************
+* Header Files *
+*********************************************************************************************************************************/
#define LOG_GROUP LOG_GROUP_PATM
#include <VBox/vmm/patm.h>
#include <VBox/vmm/pdmapi.h>
@@ -46,9 +47,9 @@
#include "PATMPatch.h"
-/*******************************************************************************
-* Structures and Typedefs *
-*******************************************************************************/
+/*********************************************************************************************************************************
+* Structures and Typedefs *
+*********************************************************************************************************************************/
/**
* Internal structure for passing more information about call fixups to
* patmPatchGenCode.
@@ -62,9 +63,9 @@ typedef struct
} PATMCALLINFO, *PPATMCALLINFO;
-/*******************************************************************************
-* Defined Constants And Macros *
-*******************************************************************************/
+/*********************************************************************************************************************************
+* Defined Constants And Macros *
+*********************************************************************************************************************************/
/** Value to use when not sure about the patch size. */
#define PATCHGEN_DEF_SIZE 256
diff --git a/src/VBox/VMM/VMMR3/PATMR3Dbg.cpp b/src/VBox/VMM/VMMR3/PATMR3Dbg.cpp
index e87fd18..cbf4b9c 100644
--- a/src/VBox/VMM/VMMR3/PATMR3Dbg.cpp
+++ b/src/VBox/VMM/VMMR3/PATMR3Dbg.cpp
@@ -15,9 +15,10 @@
* hope that it will be useful, but WITHOUT ANY WARRANTY of any kind.
*/
-/*******************************************************************************
-* Header Files *
-*******************************************************************************/
+
+/*********************************************************************************************************************************
+* Header Files *
+*********************************************************************************************************************************/
#define LOG_GROUP LOG_GROUP_PATM
#include <VBox/vmm/patm.h>
#include <VBox/vmm/dbgf.h>
@@ -33,9 +34,9 @@
#include <iprt/string.h>
-/*******************************************************************************
-* Defined Constants And Macros *
-*******************************************************************************/
+/*********************************************************************************************************************************
+* Defined Constants And Macros *
+*********************************************************************************************************************************/
/** Adds a structure member to a debug (pseudo) module as a symbol. */
#define ADD_MEMBER(a_hDbgMod, a_Struct, a_Member, a_pszName) \
do { \
diff --git a/src/VBox/VMM/VMMR3/PATMSSM.cpp b/src/VBox/VMM/VMMR3/PATMSSM.cpp
index 392ed40..bf7ee2f 100644
--- a/src/VBox/VMM/VMMR3/PATMSSM.cpp
+++ b/src/VBox/VMM/VMMR3/PATMSSM.cpp
@@ -17,9 +17,10 @@
* hope that it will be useful, but WITHOUT ANY WARRANTY of any kind.
*/
-/*******************************************************************************
-* Header Files *
-*******************************************************************************/
+
+/*********************************************************************************************************************************
+* Header Files *
+*********************************************************************************************************************************/
#define LOG_GROUP LOG_GROUP_PATM
#include <VBox/vmm/patm.h>
#include <VBox/vmm/pdmapi.h>
@@ -151,16 +152,16 @@ typedef struct PATMCALLBACKARGS
typedef PATMCALLBACKARGS *PPATMCALLBACKARGS;
-/*******************************************************************************
-* Internal Functions *
-*******************************************************************************/
+/*********************************************************************************************************************************
+* Internal Functions *
+*********************************************************************************************************************************/
static int patmCorrectFixup(PVM pVM, unsigned ulSSMVersion, PATM &patmInfo, PPATCHINFO pPatch, PRELOCREC pRec,
int32_t offset, RTRCPTR *pFixup);
-/*******************************************************************************
-* Global Variables *
-*******************************************************************************/
+/*********************************************************************************************************************************
+* Global Variables *
+*********************************************************************************************************************************/
/**
* SSM descriptor table for the PATM structure.
*/
@@ -821,6 +822,7 @@ DECLCALLBACK(int) patmR3Load(PVM pVM, PSSMHANDLE pSSM, uint32_t uVersion, uint32
int rc;
if ( uVersion != PATM_SAVED_STATE_VERSION
+ && uVersion != PATM_SAVED_STATE_VERSION_NO_RAW_MEM
&& uVersion != PATM_SAVED_STATE_VERSION_MEM
&& uVersion != PATM_SAVED_STATE_VERSION_FIXUP_HACK
&& uVersion != PATM_SAVED_STATE_VERSION_VER16
diff --git a/src/VBox/VMM/VMMR3/PDM.cpp b/src/VBox/VMM/VMMR3/PDM.cpp
index 8cae057..e570bb7 100644
--- a/src/VBox/VMM/VMMR3/PDM.cpp
+++ b/src/VBox/VMM/VMMR3/PDM.cpp
@@ -246,9 +246,9 @@
*/
-/*******************************************************************************
-* Header Files *
-*******************************************************************************/
+/*********************************************************************************************************************************
+* Header Files *
+*********************************************************************************************************************************/
#define LOG_GROUP LOG_GROUP_PDM
#include "PDMInternal.h"
#include <VBox/vmm/pdm.h>
@@ -273,9 +273,9 @@
#include <iprt/string.h>
-/*******************************************************************************
-* Defined Constants And Macros *
-*******************************************************************************/
+/*********************************************************************************************************************************
+* Defined Constants And Macros *
+*********************************************************************************************************************************/
/** The PDM saved state version. */
#define PDM_SAVED_STATE_VERSION 5
/** Before the PDM audio architecture was introduced there was an "AudioSniffer"
@@ -293,9 +293,9 @@
#define PDMPOWEROFF_WARN_AT_NS UINT64_C( 900000000)
-/*******************************************************************************
-* Structures and Typedefs *
-*******************************************************************************/
+/*********************************************************************************************************************************
+* Structures and Typedefs *
+*********************************************************************************************************************************/
/**
* Statistics of asynchronous notification tasks - used by reset, suspend and
* power off.
@@ -321,9 +321,9 @@ typedef struct PDMNOTIFYASYNCSTATS
typedef PDMNOTIFYASYNCSTATS *PPDMNOTIFYASYNCSTATS;
-/*******************************************************************************
-* Internal Functions *
-*******************************************************************************/
+/*********************************************************************************************************************************
+* Internal Functions *
+*********************************************************************************************************************************/
static DECLCALLBACK(int) pdmR3LiveExec(PVM pVM, PSSMHANDLE pSSM, uint32_t uPass);
static DECLCALLBACK(int) pdmR3SaveExec(PVM pVM, PSSMHANDLE pSSM);
static DECLCALLBACK(int) pdmR3LoadExec(PVM pVM, PSSMHANDLE pSSM, uint32_t uVersion, uint32_t uPass);
diff --git a/src/VBox/VMM/VMMR3/PDMAsyncCompletion.cpp b/src/VBox/VMM/VMMR3/PDMAsyncCompletion.cpp
index 51b3466..517accc 100644
--- a/src/VBox/VMM/VMMR3/PDMAsyncCompletion.cpp
+++ b/src/VBox/VMM/VMMR3/PDMAsyncCompletion.cpp
@@ -16,9 +16,9 @@
*/
-/*******************************************************************************
-* Header Files *
-*******************************************************************************/
+/*********************************************************************************************************************************
+* Header Files *
+*********************************************************************************************************************************/
#define LOG_GROUP LOG_GROUP_PDM_ASYNC_COMPLETION
#include "PDMInternal.h"
#include <VBox/vmm/pdm.h>
@@ -44,9 +44,9 @@
#include "PDMAsyncCompletionInternal.h"
-/*******************************************************************************
-* Structures and Typedefs *
-*******************************************************************************/
+/*********************************************************************************************************************************
+* Structures and Typedefs *
+*********************************************************************************************************************************/
/**
* Async I/O type.
*/
@@ -148,9 +148,9 @@ typedef struct PDMACBWMGR
typedef PPDMACBWMGR *PPPDMACBWMGR;
-/*******************************************************************************
-* Internal Functions *
-*******************************************************************************/
+/*********************************************************************************************************************************
+* Internal Functions *
+*********************************************************************************************************************************/
static void pdmR3AsyncCompletionPutTask(PPDMASYNCCOMPLETIONENDPOINT pEndpoint, PPDMASYNCCOMPLETIONTASK pTask);
diff --git a/src/VBox/VMM/VMMR3/PDMAsyncCompletionFile.cpp b/src/VBox/VMM/VMMR3/PDMAsyncCompletionFile.cpp
index 59fbc29..b3f0fbc 100644
--- a/src/VBox/VMM/VMMR3/PDMAsyncCompletionFile.cpp
+++ b/src/VBox/VMM/VMMR3/PDMAsyncCompletionFile.cpp
@@ -16,9 +16,9 @@
*/
-/*******************************************************************************
-* Header Files *
-*******************************************************************************/
+/*********************************************************************************************************************************
+* Header Files *
+*********************************************************************************************************************************/
#define LOG_GROUP LOG_GROUP_PDM_ASYNC_COMPLETION
#include "PDMInternal.h"
#include <VBox/vmm/pdm.h>
@@ -44,9 +44,10 @@
#include "PDMAsyncCompletionFileInternal.h"
-/*******************************************************************************
-* Internal Functions *
-*******************************************************************************/
+
+/*********************************************************************************************************************************
+* Internal Functions *
+*********************************************************************************************************************************/
#ifdef VBOX_WITH_DEBUGGER
static FNDBGCCMD pdmacEpFileErrorInject;
# ifdef PDM_ASYNC_COMPLETION_FILE_WITH_DELAY
@@ -54,9 +55,10 @@ static FNDBGCCMD pdmacEpFileDelayInject;
# endif
#endif
-/*******************************************************************************
-* Global Variables *
-*******************************************************************************/
+
+/*********************************************************************************************************************************
+* Global Variables *
+*********************************************************************************************************************************/
#ifdef VBOX_WITH_DEBUGGER
static const DBGCVARDESC g_aInjectErrorArgs[] =
{
@@ -296,7 +298,7 @@ int pdmacFileEpAddTask(PPDMASYNCCOMPLETIONENDPOINTFILE pEndpoint, PPDMACTASKFILE
return VINF_SUCCESS;
}
-void pdmacFileEpTaskCompleted(PPDMACTASKFILE pTask, void *pvUser, int rc)
+static DECLCALLBACK(void) pdmacFileEpTaskCompleted(PPDMACTASKFILE pTask, void *pvUser, int rc)
{
PPDMASYNCCOMPLETIONTASKFILE pTaskFile = (PPDMASYNCCOMPLETIONTASKFILE)pvUser;
@@ -787,7 +789,7 @@ static DECLCALLBACK(void) pdmacR3TimerCallback(PVM pVM, PTMTIMER pTimer, void *p
#endif /* VBOX_WITH_DEBUGGER */
-static int pdmacFileInitialize(PPDMASYNCCOMPLETIONEPCLASS pClassGlobals, PCFGMNODE pCfgNode)
+static DECLCALLBACK(int) pdmacFileInitialize(PPDMASYNCCOMPLETIONEPCLASS pClassGlobals, PCFGMNODE pCfgNode)
{
PPDMASYNCCOMPLETIONEPCLASSFILE pEpClassFile = (PPDMASYNCCOMPLETIONEPCLASSFILE)pClassGlobals;
RTFILEAIOLIMITS AioLimits; /** < Async I/O limitations. */
@@ -871,7 +873,7 @@ static int pdmacFileInitialize(PPDMASYNCCOMPLETIONEPCLASS pClassGlobals, PCFGMNO
return rc;
}
-static void pdmacFileTerminate(PPDMASYNCCOMPLETIONEPCLASS pClassGlobals)
+static DECLCALLBACK(void) pdmacFileTerminate(PPDMASYNCCOMPLETIONEPCLASS pClassGlobals)
{
PPDMASYNCCOMPLETIONEPCLASSFILE pEpClassFile = (PPDMASYNCCOMPLETIONEPCLASSFILE)pClassGlobals;
@@ -885,8 +887,8 @@ static void pdmacFileTerminate(PPDMASYNCCOMPLETIONEPCLASS pClassGlobals)
RTCritSectDelete(&pEpClassFile->CritSect);
}
-static int pdmacFileEpInitialize(PPDMASYNCCOMPLETIONENDPOINT pEndpoint,
- const char *pszUri, uint32_t fFlags)
+static DECLCALLBACK(int) pdmacFileEpInitialize(PPDMASYNCCOMPLETIONENDPOINT pEndpoint,
+ const char *pszUri, uint32_t fFlags)
{
PPDMASYNCCOMPLETIONENDPOINTFILE pEpFile = (PPDMASYNCCOMPLETIONENDPOINTFILE)pEndpoint;
PPDMASYNCCOMPLETIONEPCLASSFILE pEpClassFile = (PPDMASYNCCOMPLETIONEPCLASSFILE)pEndpoint->pEpClass;
@@ -1114,14 +1116,14 @@ static int pdmacFileEpInitialize(PPDMASYNCCOMPLETIONENDPOINT pEndpoint,
return rc;
}
-static int pdmacFileEpRangesLockedDestroy(PAVLRFOFFNODECORE pNode, void *pvUser)
+static DECLCALLBACK(int) pdmacFileEpRangesLockedDestroy(PAVLRFOFFNODECORE pNode, void *pvUser)
{
NOREF(pNode); NOREF(pvUser);
AssertMsgFailed(("The locked ranges tree should be empty at that point\n"));
return VINF_SUCCESS;
}
-static int pdmacFileEpClose(PPDMASYNCCOMPLETIONENDPOINT pEndpoint)
+static DECLCALLBACK(int) pdmacFileEpClose(PPDMASYNCCOMPLETIONENDPOINT pEndpoint)
{
PPDMASYNCCOMPLETIONENDPOINTFILE pEpFile = (PPDMASYNCCOMPLETIONENDPOINTFILE)pEndpoint;
PPDMASYNCCOMPLETIONEPCLASSFILE pEpClassFile = (PPDMASYNCCOMPLETIONEPCLASSFILE)pEndpoint->pEpClass;
@@ -1160,10 +1162,10 @@ static int pdmacFileEpClose(PPDMASYNCCOMPLETIONENDPOINT pEndpoint)
return VINF_SUCCESS;
}
-static int pdmacFileEpRead(PPDMASYNCCOMPLETIONTASK pTask,
- PPDMASYNCCOMPLETIONENDPOINT pEndpoint, RTFOFF off,
- PCRTSGSEG paSegments, size_t cSegments,
- size_t cbRead)
+static DECLCALLBACK(int) pdmacFileEpRead(PPDMASYNCCOMPLETIONTASK pTask,
+ PPDMASYNCCOMPLETIONENDPOINT pEndpoint, RTFOFF off,
+ PCRTSGSEG paSegments, size_t cSegments,
+ size_t cbRead)
{
PPDMASYNCCOMPLETIONENDPOINTFILE pEpFile = (PPDMASYNCCOMPLETIONENDPOINTFILE)pEndpoint;
@@ -1182,10 +1184,10 @@ static int pdmacFileEpRead(PPDMASYNCCOMPLETIONTASK pTask,
return rc;
}
-static int pdmacFileEpWrite(PPDMASYNCCOMPLETIONTASK pTask,
- PPDMASYNCCOMPLETIONENDPOINT pEndpoint, RTFOFF off,
- PCRTSGSEG paSegments, size_t cSegments,
- size_t cbWrite)
+static DECLCALLBACK(int) pdmacFileEpWrite(PPDMASYNCCOMPLETIONTASK pTask,
+ PPDMASYNCCOMPLETIONENDPOINT pEndpoint, RTFOFF off,
+ PCRTSGSEG paSegments, size_t cSegments,
+ size_t cbWrite)
{
PPDMASYNCCOMPLETIONENDPOINTFILE pEpFile = (PPDMASYNCCOMPLETIONENDPOINTFILE)pEndpoint;
@@ -1204,8 +1206,8 @@ static int pdmacFileEpWrite(PPDMASYNCCOMPLETIONTASK pTask,
return rc;
}
-static int pdmacFileEpFlush(PPDMASYNCCOMPLETIONTASK pTask,
- PPDMASYNCCOMPLETIONENDPOINT pEndpoint)
+static DECLCALLBACK(int) pdmacFileEpFlush(PPDMASYNCCOMPLETIONTASK pTask,
+ PPDMASYNCCOMPLETIONENDPOINT pEndpoint)
{
PPDMASYNCCOMPLETIONENDPOINTFILE pEpFile = (PPDMASYNCCOMPLETIONENDPOINTFILE)pEndpoint;
PPDMASYNCCOMPLETIONTASKFILE pTaskFile = (PPDMASYNCCOMPLETIONTASKFILE)pTask;
@@ -1228,7 +1230,7 @@ static int pdmacFileEpFlush(PPDMASYNCCOMPLETIONTASK pTask,
return VINF_AIO_TASK_PENDING;
}
-static int pdmacFileEpGetSize(PPDMASYNCCOMPLETIONENDPOINT pEndpoint, uint64_t *pcbSize)
+static DECLCALLBACK(int) pdmacFileEpGetSize(PPDMASYNCCOMPLETIONENDPOINT pEndpoint, uint64_t *pcbSize)
{
PPDMASYNCCOMPLETIONENDPOINTFILE pEpFile = (PPDMASYNCCOMPLETIONENDPOINTFILE)pEndpoint;
@@ -1237,7 +1239,7 @@ static int pdmacFileEpGetSize(PPDMASYNCCOMPLETIONENDPOINT pEndpoint, uint64_t *p
return VINF_SUCCESS;
}
-static int pdmacFileEpSetSize(PPDMASYNCCOMPLETIONENDPOINT pEndpoint, uint64_t cbSize)
+static DECLCALLBACK(int) pdmacFileEpSetSize(PPDMASYNCCOMPLETIONENDPOINT pEndpoint, uint64_t cbSize)
{
int rc;
PPDMASYNCCOMPLETIONENDPOINTFILE pEpFile = (PPDMASYNCCOMPLETIONENDPOINTFILE)pEndpoint;
diff --git a/src/VBox/VMM/VMMR3/PDMAsyncCompletionFileFailsafe.cpp b/src/VBox/VMM/VMMR3/PDMAsyncCompletionFileFailsafe.cpp
index cc0e49f..5a84405 100644
--- a/src/VBox/VMM/VMMR3/PDMAsyncCompletionFileFailsafe.cpp
+++ b/src/VBox/VMM/VMMR3/PDMAsyncCompletionFileFailsafe.cpp
@@ -16,9 +16,10 @@
* hope that it will be useful, but WITHOUT ANY WARRANTY of any kind.
*/
-/*******************************************************************************
-* Header Files *
-*******************************************************************************/
+
+/*********************************************************************************************************************************
+* Header Files *
+*********************************************************************************************************************************/
#define LOG_GROUP LOG_GROUP_PDM_ASYNC_COMPLETION
#include <iprt/asm.h>
#include <iprt/assert.h>
diff --git a/src/VBox/VMM/VMMR3/PDMAsyncCompletionFileNormal.cpp b/src/VBox/VMM/VMMR3/PDMAsyncCompletionFileNormal.cpp
index 6446c90..7cd0ba4 100644
--- a/src/VBox/VMM/VMMR3/PDMAsyncCompletionFileNormal.cpp
+++ b/src/VBox/VMM/VMMR3/PDMAsyncCompletionFileNormal.cpp
@@ -15,9 +15,10 @@
* hope that it will be useful, but WITHOUT ANY WARRANTY of any kind.
*/
-/*******************************************************************************
-* Header Files *
-*******************************************************************************/
+
+/*********************************************************************************************************************************
+* Header Files *
+*********************************************************************************************************************************/
#define LOG_GROUP LOG_GROUP_PDM_ASYNC_COMPLETION
#include <iprt/types.h>
#include <iprt/asm.h>
@@ -35,9 +36,9 @@
#define PDMACEPFILEMGR_REQS_STEP 64
-/*******************************************************************************
-* Internal functions *
-*******************************************************************************/
+/*********************************************************************************************************************************
+* Internal functions *
+*********************************************************************************************************************************/
static int pdmacFileAioMgrNormalProcessTaskList(PPDMACTASKFILE pTaskHead,
PPDMACEPFILEMGR pAioMgr,
PPDMASYNCCOMPLETIONENDPOINTFILE pEndpoint);
diff --git a/src/VBox/VMM/VMMR3/PDMBlkCache.cpp b/src/VBox/VMM/VMMR3/PDMBlkCache.cpp
index e3adae2..3031e36 100644
--- a/src/VBox/VMM/VMMR3/PDMBlkCache.cpp
+++ b/src/VBox/VMM/VMMR3/PDMBlkCache.cpp
@@ -19,9 +19,10 @@
* This component implements an I/O cache based on the 2Q cache algorithm.
*/
-/*******************************************************************************
-* Header Files *
-*******************************************************************************/
+
+/*********************************************************************************************************************************
+* Header Files *
+*********************************************************************************************************************************/
#define LOG_GROUP LOG_GROUP_PDM_BLK_CACHE
#include "PDMInternal.h"
#include <iprt/asm.h>
@@ -65,9 +66,10 @@
#define PDM_BLK_CACHE_SAVED_STATE_VERSION 1
-/*******************************************************************************
-* Internal Functions *
-*******************************************************************************/
+
+/*********************************************************************************************************************************
+* Internal Functions *
+*********************************************************************************************************************************/
static PPDMBLKCACHEENTRY pdmBlkCacheEntryAlloc(PPDMBLKCACHE pBlkCache,
uint64_t off, size_t cbData, uint8_t *pbBuffer);
@@ -1372,7 +1374,7 @@ VMMR3DECL(int) PDMR3BlkCacheRetainInt(PVM pVM, void *pvUser, PPPDMBLKCACHE ppBlk
* @param pNode The node to destroy.
* @param pvUser Opaque user data.
*/
-static int pdmBlkCacheEntryDestroy(PAVLRU64NODECORE pNode, void *pvUser)
+static DECLCALLBACK(int) pdmBlkCacheEntryDestroy(PAVLRU64NODECORE pNode, void *pvUser)
{
PPDMBLKCACHEENTRY pEntry = (PPDMBLKCACHEENTRY)pNode;
PPDMBLKCACHEGLOBAL pCache = (PPDMBLKCACHEGLOBAL)pvUser;
@@ -2692,7 +2694,7 @@ VMMR3DECL(void) PDMR3BlkCacheIoXferComplete(PPDMBLKCACHE pBlkCache, PPDMBLKCACHE
* @param pNode The node to destroy.
* @param pvUser Opaque user data.
*/
-static int pdmBlkCacheEntryQuiesce(PAVLRU64NODECORE pNode, void *pvUser)
+static DECLCALLBACK(int) pdmBlkCacheEntryQuiesce(PAVLRU64NODECORE pNode, void *pvUser)
{
PPDMBLKCACHEENTRY pEntry = (PPDMBLKCACHEENTRY)pNode;
PPDMBLKCACHE pBlkCache = pEntry->pBlkCache;
diff --git a/src/VBox/VMM/VMMR3/PDMCritSect.cpp b/src/VBox/VMM/VMMR3/PDMCritSect.cpp
index e5e4d9c..decca4f 100644
--- a/src/VBox/VMM/VMMR3/PDMCritSect.cpp
+++ b/src/VBox/VMM/VMMR3/PDMCritSect.cpp
@@ -16,9 +16,9 @@
*/
-/*******************************************************************************
-* Header Files *
-*******************************************************************************/
+/*********************************************************************************************************************************
+* Header Files *
+*********************************************************************************************************************************/
#define LOG_GROUP LOG_GROUP_PDM//_CRITSECT
#include "PDMInternal.h"
#include <VBox/vmm/pdmcritsect.h>
@@ -37,9 +37,9 @@
#include <iprt/thread.h>
-/*******************************************************************************
-* Internal Functions *
-*******************************************************************************/
+/*********************************************************************************************************************************
+* Internal Functions *
+*********************************************************************************************************************************/
static int pdmR3CritSectDeleteOne(PVM pVM, PUVM pUVM, PPDMCRITSECTINT pCritSect, PPDMCRITSECTINT pPrev, bool fFinal);
static int pdmR3CritSectRwDeleteOne(PVM pVM, PUVM pUVM, PPDMCRITSECTRWINT pCritSect, PPDMCRITSECTRWINT pPrev, bool fFinal);
diff --git a/src/VBox/VMM/VMMR3/PDMDevHlp.cpp b/src/VBox/VMM/VMMR3/PDMDevHlp.cpp
index 305af84..587fb19 100644
--- a/src/VBox/VMM/VMMR3/PDMDevHlp.cpp
+++ b/src/VBox/VMM/VMMR3/PDMDevHlp.cpp
@@ -16,9 +16,9 @@
*/
-/*******************************************************************************
-* Header Files *
-*******************************************************************************/
+/*********************************************************************************************************************************
+* Header Files *
+*********************************************************************************************************************************/
#define LOG_GROUP LOG_GROUP_PDM_DEVICE
#include "PDMInternal.h"
#include <VBox/vmm/pdm.h>
@@ -48,9 +48,9 @@
#include "PDMInline.h"
-/*******************************************************************************
-* Defined Constants And Macros *
-*******************************************************************************/
+/*********************************************************************************************************************************
+* Defined Constants And Macros *
+*********************************************************************************************************************************/
/** @def PDM_DEVHLP_DEADLOCK_DETECTION
* Define this to enable the deadlock detection when accessing physical memory.
*/
diff --git a/src/VBox/VMM/VMMR3/PDMDevMiscHlp.cpp b/src/VBox/VMM/VMMR3/PDMDevMiscHlp.cpp
index 73e2a3b..be28767 100644
--- a/src/VBox/VMM/VMMR3/PDMDevMiscHlp.cpp
+++ b/src/VBox/VMM/VMMR3/PDMDevMiscHlp.cpp
@@ -16,9 +16,9 @@
*/
-/*******************************************************************************
-* Header Files *
-*******************************************************************************/
+/*********************************************************************************************************************************
+* Header Files *
+*********************************************************************************************************************************/
#define LOG_GROUP LOG_GROUP_PDM_DEVICE
#include "PDMInternal.h"
#include <VBox/vmm/pdm.h>
diff --git a/src/VBox/VMM/VMMR3/PDMDevice.cpp b/src/VBox/VMM/VMMR3/PDMDevice.cpp
index 0c75fef..2e76d57 100644
--- a/src/VBox/VMM/VMMR3/PDMDevice.cpp
+++ b/src/VBox/VMM/VMMR3/PDMDevice.cpp
@@ -16,9 +16,9 @@
*/
-/*******************************************************************************
-* Header Files *
-*******************************************************************************/
+/*********************************************************************************************************************************
+* Header Files *
+*********************************************************************************************************************************/
#define LOG_GROUP LOG_GROUP_PDM_DEVICE
#include "PDMInternal.h"
#include <VBox/vmm/pdm.h>
@@ -48,9 +48,9 @@
#include <iprt/thread.h>
-/*******************************************************************************
-* Structures and Typedefs *
-*******************************************************************************/
+/*********************************************************************************************************************************
+* Structures and Typedefs *
+*********************************************************************************************************************************/
/**
* Internal callback structure pointer.
* The main purpose is to define the extra data we associate
@@ -74,9 +74,9 @@ typedef PDMDEVREGCBINT *PPDMDEVREGCBINT;
typedef const PDMDEVREGCBINT *PCPDMDEVREGCBINT;
-/*******************************************************************************
-* Internal Functions *
-*******************************************************************************/
+/*********************************************************************************************************************************
+* Internal Functions *
+*********************************************************************************************************************************/
static DECLCALLBACK(int) pdmR3DevReg_Register(PPDMDEVREGCB pCallbacks, PCPDMDEVREG pReg);
static int pdmR3DevLoadModules(PVM pVM);
static int pdmR3DevLoad(PVM pVM, PPDMDEVREGCBINT pRegCB, const char *pszFilename, const char *pszName);
diff --git a/src/VBox/VMM/VMMR3/PDMDriver.cpp b/src/VBox/VMM/VMMR3/PDMDriver.cpp
index df81238..468f33c 100644
--- a/src/VBox/VMM/VMMR3/PDMDriver.cpp
+++ b/src/VBox/VMM/VMMR3/PDMDriver.cpp
@@ -16,9 +16,9 @@
*/
-/*******************************************************************************
-* Header Files *
-*******************************************************************************/
+/*********************************************************************************************************************************
+* Header Files *
+*********************************************************************************************************************************/
#define LOG_GROUP LOG_GROUP_PDM_DRIVER
#include "PDMInternal.h"
#include <VBox/vmm/pdm.h>
@@ -41,9 +41,9 @@
#include <iprt/string.h>
-/*******************************************************************************
-* Structures and Typedefs *
-*******************************************************************************/
+/*********************************************************************************************************************************
+* Structures and Typedefs *
+*********************************************************************************************************************************/
/**
* Internal callback structure pointer.
*
@@ -65,9 +65,9 @@ typedef struct PDMDRVREGCBINT
typedef const PDMDRVREGCBINT *PCPDMDRVREGCBINT;
-/*******************************************************************************
-* Internal Functions *
-*******************************************************************************/
+/*********************************************************************************************************************************
+* Internal Functions *
+*********************************************************************************************************************************/
static DECLCALLBACK(int) pdmR3DrvRegister(PCPDMDRVREGCB pCallbacks, PCPDMDRVREG pReg);
static int pdmR3DrvLoad(PVM pVM, PPDMDRVREGCBINT pRegCB, const char *pszFilename, const char *pszName);
diff --git a/src/VBox/VMM/VMMR3/PDMLdr.cpp b/src/VBox/VMM/VMMR3/PDMLdr.cpp
index d9005ad..8e5db78 100644
--- a/src/VBox/VMM/VMMR3/PDMLdr.cpp
+++ b/src/VBox/VMM/VMMR3/PDMLdr.cpp
@@ -17,9 +17,10 @@
//#define PDMLDR_FAKE_MODE
-/*******************************************************************************
-* Header Files *
-*******************************************************************************/
+
+/*********************************************************************************************************************************
+* Header Files *
+*********************************************************************************************************************************/
#define LOG_GROUP LOG_GROUP_PDM_LDR
#include "PDMInternal.h"
#include <VBox/vmm/pdm.h>
@@ -46,9 +47,9 @@
#include <limits.h>
-/*******************************************************************************
-* Structures and Typedefs *
-*******************************************************************************/
+/*********************************************************************************************************************************
+* Structures and Typedefs *
+*********************************************************************************************************************************/
/**
* Structure which the user argument of the RTLdrGetBits() callback points to.
* @internal
@@ -60,9 +61,9 @@ typedef struct PDMGETIMPORTARGS
} PDMGETIMPORTARGS, *PPDMGETIMPORTARGS;
-/*******************************************************************************
-* Internal Functions *
-*******************************************************************************/
+/*********************************************************************************************************************************
+* Internal Functions *
+*********************************************************************************************************************************/
static DECLCALLBACK(int) pdmR3GetImportRC(RTLDRMOD hLdrMod, const char *pszModule, const char *pszSymbol, unsigned uSymbol, RTUINTPTR *pValue, void *pvUser);
static int pdmR3LoadR0U(PUVM pUVM, const char *pszFilename, const char *pszName, const char *pszSearchPath);
static char *pdmR3FileRC(const char *pszFile, const char *pszSearchPath);
@@ -720,8 +721,8 @@ static int pdmR3LoadR0U(PUVM pUVM, const char *pszFilename, const char *pszName,
LogRel(("PDMLdr: pdmR3LoadR0U: pszName=\"%s\" rc=%Rrc szErr=\"%s\"\n", pszName, rc, ErrInfo.Core.pszMsg));
/* Don't consider VERR_PDM_MODULE_NAME_CLASH and VERR_NO_MEMORY above as these are very unlikely. */
- if (RT_FAILURE(rc) && pUVM->pVM) /** @todo VMR3SetErrorU. */
- rc = VMSetError(pUVM->pVM, rc, RT_SRC_POS, N_("Cannot load R0 module %s: %s"), pszFilename, ErrInfo.Core.pszMsg);
+ if (RT_FAILURE(rc))
+ rc = VMR3SetError(pUVM, rc, RT_SRC_POS, N_("Failed to load R0 module %s: %s"), pszFilename, ErrInfo.Core.pszMsg);
RTMemTmpFree(pszFile); /* might be reference thru pszFilename in the above VMSetError call. */
return rc;
diff --git a/src/VBox/VMM/VMMR3/PDMNetShaper.cpp b/src/VBox/VMM/VMMR3/PDMNetShaper.cpp
index b1bc046..6aaab8e 100644
--- a/src/VBox/VMM/VMMR3/PDMNetShaper.cpp
+++ b/src/VBox/VMM/VMMR3/PDMNetShaper.cpp
@@ -16,9 +16,9 @@
*/
-/*******************************************************************************
-* Header Files *
-*******************************************************************************/
+/*********************************************************************************************************************************
+* Header Files *
+*********************************************************************************************************************************/
#define LOG_GROUP LOG_GROUP_NET_SHAPER
#include "PDMInternal.h"
#include <VBox/vmm/pdm.h>
@@ -44,9 +44,9 @@
#include "PDMNetShaperInternal.h"
-/*******************************************************************************
-* Structures and Typedefs *
-*******************************************************************************/
+/*********************************************************************************************************************************
+* Structures and Typedefs *
+*********************************************************************************************************************************/
/**
* Network shaper data. One instance per VM.
diff --git a/src/VBox/VMM/VMMR3/PDMQueue.cpp b/src/VBox/VMM/VMMR3/PDMQueue.cpp
index 64875ce..5daff82 100644
--- a/src/VBox/VMM/VMMR3/PDMQueue.cpp
+++ b/src/VBox/VMM/VMMR3/PDMQueue.cpp
@@ -16,9 +16,9 @@
*/
-/*******************************************************************************
-* Header Files *
-*******************************************************************************/
+/*********************************************************************************************************************************
+* Header Files *
+*********************************************************************************************************************************/
#define LOG_GROUP LOG_GROUP_PDM_QUEUE
#include "PDMInternal.h"
#include <VBox/vmm/pdm.h>
@@ -36,9 +36,9 @@
#include <iprt/thread.h>
-/*******************************************************************************
-* Internal Functions *
-*******************************************************************************/
+/*********************************************************************************************************************************
+* Internal Functions *
+*********************************************************************************************************************************/
DECLINLINE(void) pdmR3QueueFreeItem(PPDMQUEUE pQueue, PPDMQUEUEITEMCORE pItem);
static bool pdmR3QueueFlush(PPDMQUEUE pQueue);
static DECLCALLBACK(void) pdmR3QueueTimer(PVM pVM, PTMTIMER pTimer, void *pvUser);
diff --git a/src/VBox/VMM/VMMR3/PDMThread.cpp b/src/VBox/VMM/VMMR3/PDMThread.cpp
index 65c8e6a..698e871 100644
--- a/src/VBox/VMM/VMMR3/PDMThread.cpp
+++ b/src/VBox/VMM/VMMR3/PDMThread.cpp
@@ -15,9 +15,10 @@
* hope that it will be useful, but WITHOUT ANY WARRANTY of any kind.
*/
-/*******************************************************************************
-* Header Files *
-*******************************************************************************/
+
+/*********************************************************************************************************************************
+* Header Files *
+*********************************************************************************************************************************/
///@todo #define LOG_GROUP LOG_GROUP_PDM_THREAD
#include "PDMInternal.h"
#include <VBox/vmm/pdm.h>
@@ -33,9 +34,9 @@
#include <iprt/thread.h>
-/*******************************************************************************
-* Internal Functions *
-*******************************************************************************/
+/*********************************************************************************************************************************
+* Internal Functions *
+*********************************************************************************************************************************/
static DECLCALLBACK(int) pdmR3ThreadMain(RTTHREAD Thread, void *pvUser);
diff --git a/src/VBox/VMM/VMMR3/PDMUsb.cpp b/src/VBox/VMM/VMMR3/PDMUsb.cpp
index 17edd4f..2314e0f 100644
--- a/src/VBox/VMM/VMMR3/PDMUsb.cpp
+++ b/src/VBox/VMM/VMMR3/PDMUsb.cpp
@@ -16,9 +16,9 @@
*/
-/*******************************************************************************
-* Header Files *
-*******************************************************************************/
+/*********************************************************************************************************************************
+* Header Files *
+*********************************************************************************************************************************/
#define LOG_GROUP LOG_GROUP_PDM_DRIVER
#include "PDMInternal.h"
#include <VBox/vmm/pdm.h>
@@ -43,9 +43,9 @@
#include <iprt/uuid.h>
-/*******************************************************************************
-* Structures and Typedefs *
-*******************************************************************************/
+/*********************************************************************************************************************************
+* Structures and Typedefs *
+*********************************************************************************************************************************/
/**
* Internal callback structure pointer.
*
@@ -64,9 +64,9 @@ typedef struct PDMUSBREGCBINT
typedef const PDMUSBREGCBINT *PCPDMUSBREGCBINT;
-/*******************************************************************************
-* Defined Constants And Macros *
-*******************************************************************************/
+/*********************************************************************************************************************************
+* Defined Constants And Macros *
+*********************************************************************************************************************************/
/** @def PDMUSB_ASSERT_USBINS
* Asserts the validity of the USB device instance.
*/
@@ -82,15 +82,15 @@ typedef const PDMUSBREGCBINT *PCPDMUSBREGCBINT;
#endif
-/*******************************************************************************
-* Internal Functions *
-*******************************************************************************/
+/*********************************************************************************************************************************
+* Internal Functions *
+*********************************************************************************************************************************/
static void pdmR3UsbDestroyDevice(PVM pVM, PPDMUSBINS pUsbIns);
-/*******************************************************************************
-* Global Variables *
-*******************************************************************************/
+/*********************************************************************************************************************************
+* Global Variables *
+*********************************************************************************************************************************/
extern const PDMUSBHLP g_pdmR3UsbHlp;
diff --git a/src/VBox/VMM/VMMR3/PGM.cpp b/src/VBox/VMM/VMMR3/PGM.cpp
index 911e2f5..441111b 100644
--- a/src/VBox/VMM/VMMR3/PGM.cpp
+++ b/src/VBox/VMM/VMMR3/PGM.cpp
@@ -610,9 +610,10 @@
* Breakdown of the changes involved?
*/
-/*******************************************************************************
-* Header Files *
-*******************************************************************************/
+
+/*********************************************************************************************************************************
+* Header Files *
+*********************************************************************************************************************************/
#define LOG_GROUP LOG_GROUP_PGM
#include <VBox/vmm/dbgf.h>
#include <VBox/vmm/pgm.h>
@@ -647,9 +648,9 @@
#include <iprt/thread.h>
-/*******************************************************************************
-* Structures and Typedefs *
-*******************************************************************************/
+/*********************************************************************************************************************************
+* Structures and Typedefs *
+*********************************************************************************************************************************/
/**
* Argument package for pgmR3RElocatePhysHnadler, pgmR3RelocateVirtHandler and
* pgmR3RelocateHyperVirtHandler.
@@ -663,9 +664,9 @@ typedef struct PGMRELOCHANDLERARGS
typedef PGMRELOCHANDLERARGS const *PCPGMRELOCHANDLERARGS;
-/*******************************************************************************
-* Internal Functions *
-*******************************************************************************/
+/*********************************************************************************************************************************
+* Internal Functions *
+*********************************************************************************************************************************/
static int pgmR3InitPaging(PVM pVM);
static int pgmR3InitStats(PVM pVM);
static DECLCALLBACK(void) pgmR3PhysInfo(PVM pVM, PCDBGFINFOHLP pHlp, const char *pszArgs);
@@ -694,9 +695,9 @@ static FNDBGCCMD pgmR3CmdPhysToFile;
#endif
-/*******************************************************************************
-* Global Variables *
-*******************************************************************************/
+/*********************************************************************************************************************************
+* Global Variables *
+*********************************************************************************************************************************/
#ifdef VBOX_WITH_DEBUGGER
/** Argument descriptors for '.pgmerror' and '.pgmerroroff'. */
static const DBGCVARDESC g_aPgmErrorArgs[] =
@@ -1652,14 +1653,12 @@ static int pgmR3InitPaging(PVM pVM)
case SUPPAGINGMODE_AMD64_GLOBAL:
case SUPPAGINGMODE_AMD64_NX:
case SUPPAGINGMODE_AMD64_GLOBAL_NX:
-#ifndef VBOX_WITH_HYBRID_32BIT_KERNEL
if (ARCH_BITS != 64)
{
AssertMsgFailed(("Host mode %d (64-bit) is not supported by non-64bit builds\n", pVM->pgm.s.enmHostMode));
LogRel(("PGM: Host mode %d (64-bit) is not supported by non-64bit builds\n", pVM->pgm.s.enmHostMode));
return VERR_PGM_UNSUPPORTED_HOST_PAGING_MODE;
}
-#endif
break;
default:
AssertMsgFailed(("Host mode %d is not supported\n", pVM->pgm.s.enmHostMode));
diff --git a/src/VBox/VMM/VMMR3/PGMDbg.cpp b/src/VBox/VMM/VMMR3/PGMDbg.cpp
index 26864df..6bce863 100644
--- a/src/VBox/VMM/VMMR3/PGMDbg.cpp
+++ b/src/VBox/VMM/VMMR3/PGMDbg.cpp
@@ -15,9 +15,10 @@
* hope that it will be useful, but WITHOUT ANY WARRANTY of any kind.
*/
-/*******************************************************************************
-* Header Files *
-*******************************************************************************/
+
+/*********************************************************************************************************************************
+* Header Files *
+*********************************************************************************************************************************/
#define LOG_GROUP LOG_GROUP_PGM
#include <VBox/vmm/pgm.h>
#include <VBox/vmm/stam.h>
@@ -33,17 +34,17 @@
#include <VBox/err.h>
-/*******************************************************************************
-* Defined Constants And Macros *
-*******************************************************************************/
+/*********************************************************************************************************************************
+* Defined Constants And Macros *
+*********************************************************************************************************************************/
/** The max needle size that we will bother searching for
* This must not be more than half a page! */
#define MAX_NEEDLE_SIZE 256
-/*******************************************************************************
-* Structures and Typedefs *
-*******************************************************************************/
+/*********************************************************************************************************************************
+* Structures and Typedefs *
+*********************************************************************************************************************************/
/**
* State structure for the paging hierarchy dumpers.
*/
@@ -102,22 +103,16 @@ typedef PGMR3DUMPHIERARCHYSTATE *PPGMR3DUMPHIERARCHYSTATE;
* @param pvNeedle Pointer to what we search for.
* @param cbNeedle Size of what we're searching for.
*/
-#if defined(_MSC_VER) || defined(RT_OS_OS2)
-# define DECLASMCALLBACK(type) type __cdecl
-#elif defined(__GNUC__) && defined(RT_ARCH_X86)
-# define DECLASMCALLBACK(type) type __attribute__((cdecl,regparm(0)))
-#else
-# define DECLASMCALLBACK(type) type
-#endif
-typedef DECLASMCALLBACK(uint8_t const *) FNPGMR3DBGFIXEDMEMSCAN(void const *pvHaystack, uint32_t cbHaystack,
- void const *pvNeedle, size_t cbNeedle);
+
+typedef DECLCALLBACK(uint8_t const *) FNPGMR3DBGFIXEDMEMSCAN(void const *pvHaystack, uint32_t cbHaystack,
+ void const *pvNeedle, size_t cbNeedle);
/** Pointer to an fixed size and step assembly scanner function. */
typedef FNPGMR3DBGFIXEDMEMSCAN *PFNPGMR3DBGFIXEDMEMSCAN;
-/*******************************************************************************
-* Internal Functions *
-*******************************************************************************/
+/*********************************************************************************************************************************
+* Internal Functions *
+*********************************************************************************************************************************/
DECLASM(uint8_t const *) pgmR3DbgFixedMemScan8Wide8Step(void const *, uint32_t, void const *, size_t cbNeedle);
DECLASM(uint8_t const *) pgmR3DbgFixedMemScan4Wide4Step(void const *, uint32_t, void const *, size_t cbNeedle);
DECLASM(uint8_t const *) pgmR3DbgFixedMemScan2Wide2Step(void const *, uint32_t, void const *, size_t cbNeedle);
diff --git a/src/VBox/VMM/VMMR3/PGMHandler.cpp b/src/VBox/VMM/VMMR3/PGMHandler.cpp
index 785aad3..be969e5 100644
--- a/src/VBox/VMM/VMMR3/PGMHandler.cpp
+++ b/src/VBox/VMM/VMMR3/PGMHandler.cpp
@@ -16,9 +16,9 @@
*/
-/*******************************************************************************
-* Header Files *
-*******************************************************************************/
+/*********************************************************************************************************************************
+* Header Files *
+*********************************************************************************************************************************/
#define LOG_GROUP LOG_GROUP_PGM
#include <VBox/vmm/dbgf.h>
#include <VBox/vmm/pgm.h>
@@ -54,9 +54,9 @@
#include <VBox/vmm/hm.h>
-/*******************************************************************************
-* Internal Functions *
-*******************************************************************************/
+/*********************************************************************************************************************************
+* Internal Functions *
+*********************************************************************************************************************************/
static DECLCALLBACK(int) pgmR3HandlerPhysicalOneClear(PAVLROGCPHYSNODECORE pNode, void *pvUser);
static DECLCALLBACK(int) pgmR3HandlerPhysicalOneSet(PAVLROGCPHYSNODECORE pNode, void *pvUser);
static DECLCALLBACK(int) pgmR3InfoHandlersPhysicalOne(PAVLROGCPHYSNODECORE pNode, void *pvUser);
diff --git a/src/VBox/VMM/VMMR3/PGMMap.cpp b/src/VBox/VMM/VMMR3/PGMMap.cpp
index e20bbe0..04679e1 100644
--- a/src/VBox/VMM/VMMR3/PGMMap.cpp
+++ b/src/VBox/VMM/VMMR3/PGMMap.cpp
@@ -16,9 +16,9 @@
*/
-/*******************************************************************************
-* Header Files *
-*******************************************************************************/
+/*********************************************************************************************************************************
+* Header Files *
+*********************************************************************************************************************************/
#define LOG_GROUP LOG_GROUP_PGM
#include <VBox/vmm/dbgf.h>
#include <VBox/vmm/pgm.h>
@@ -33,9 +33,9 @@
#include <iprt/string.h>
-/*******************************************************************************
-* Internal Functions *
-*******************************************************************************/
+/*********************************************************************************************************************************
+* Internal Functions *
+*********************************************************************************************************************************/
#ifndef PGM_WITHOUT_MAPPINGS
static void pgmR3MapClearPDEs(PVM pVM, PPGMMAPPING pMap, unsigned iOldPDE);
static void pgmR3MapSetPDEs(PVM pVM, PPGMMAPPING pMap, unsigned iNewPDE);
diff --git a/src/VBox/VMM/VMMR3/PGMPhys.cpp b/src/VBox/VMM/VMMR3/PGMPhys.cpp
index d96cce2..2f1acd6 100644
--- a/src/VBox/VMM/VMMR3/PGMPhys.cpp
+++ b/src/VBox/VMM/VMMR3/PGMPhys.cpp
@@ -16,9 +16,9 @@
*/
-/*******************************************************************************
-* Header Files *
-*******************************************************************************/
+/*********************************************************************************************************************************
+* Header Files *
+*********************************************************************************************************************************/
#define LOG_GROUP LOG_GROUP_PGM_PHYS
#include <VBox/vmm/pgm.h>
#include <VBox/vmm/iom.h>
@@ -47,9 +47,9 @@
#include <iprt/system.h>
-/*******************************************************************************
-* Defined Constants And Macros *
-*******************************************************************************/
+/*********************************************************************************************************************************
+* Defined Constants And Macros *
+*********************************************************************************************************************************/
/** The number of pages to free in one batch. */
#define PGMPHYS_FREE_PAGE_BATCH_SIZE 128
diff --git a/src/VBox/VMM/VMMR3/PGMPool.cpp b/src/VBox/VMM/VMMR3/PGMPool.cpp
index 2f9849d..7513087 100644
--- a/src/VBox/VMM/VMMR3/PGMPool.cpp
+++ b/src/VBox/VMM/VMMR3/PGMPool.cpp
@@ -92,9 +92,9 @@
*/
-/*******************************************************************************
-* Header Files *
-*******************************************************************************/
+/*********************************************************************************************************************************
+* Header Files *
+*********************************************************************************************************************************/
#define LOG_GROUP LOG_GROUP_PGM_POOL
#include <VBox/vmm/pgm.h>
#include <VBox/vmm/mm.h>
@@ -110,9 +110,9 @@
#include <VBox/dbg.h>
-/*******************************************************************************
-* Internal Functions *
-*******************************************************************************/
+/*********************************************************************************************************************************
+* Internal Functions *
+*********************************************************************************************************************************/
#ifdef VBOX_WITH_DEBUGGER
static FNDBGCCMD pgmR3PoolCmdCheck;
#endif
diff --git a/src/VBox/VMM/VMMR3/PGMSavedState.cpp b/src/VBox/VMM/VMMR3/PGMSavedState.cpp
index 5eaa93f..dceca8b 100644
--- a/src/VBox/VMM/VMMR3/PGMSavedState.cpp
+++ b/src/VBox/VMM/VMMR3/PGMSavedState.cpp
@@ -16,9 +16,9 @@
*/
-/*******************************************************************************
-* Header Files *
-*******************************************************************************/
+/*********************************************************************************************************************************
+* Header Files *
+*********************************************************************************************************************************/
#define LOG_GROUP LOG_GROUP_PGM
#include <VBox/vmm/pgm.h>
#include <VBox/vmm/stam.h>
@@ -42,9 +42,9 @@
#include <iprt/thread.h>
-/*******************************************************************************
-* Defined Constants And Macros *
-*******************************************************************************/
+/*********************************************************************************************************************************
+* Defined Constants And Macros *
+*********************************************************************************************************************************/
/** Saved state data unit version. */
#define PGM_SAVED_STATE_VERSION 14
/** Saved state data unit version before the PAE PDPE registers. */
@@ -125,9 +125,9 @@
/** @} */
-/*******************************************************************************
-* Structures and Typedefs *
-*******************************************************************************/
+/*********************************************************************************************************************************
+* Structures and Typedefs *
+*********************************************************************************************************************************/
/** For loading old saved states. (pre-smp) */
typedef struct
{
@@ -149,9 +149,9 @@ typedef struct
} PGMOLD;
-/*******************************************************************************
-* Global Variables *
-*******************************************************************************/
+/*********************************************************************************************************************************
+* Global Variables *
+*********************************************************************************************************************************/
/** PGM fields to save/load. */
static const SSMFIELD s_aPGMFields[] =
diff --git a/src/VBox/VMM/VMMR3/PGMSharedPage.cpp b/src/VBox/VMM/VMMR3/PGMSharedPage.cpp
index f03313c..9efd8c4 100644
--- a/src/VBox/VMM/VMMR3/PGMSharedPage.cpp
+++ b/src/VBox/VMM/VMMR3/PGMSharedPage.cpp
@@ -16,9 +16,9 @@
*/
-/*******************************************************************************
-* Header Files *
-*******************************************************************************/
+/*********************************************************************************************************************************
+* Header Files *
+*********************************************************************************************************************************/
#define LOG_GROUP LOG_GROUP_PGM_SHARED
#include <VBox/vmm/pgm.h>
#include <VBox/vmm/stam.h>
@@ -39,9 +39,10 @@
#ifdef VBOX_WITH_PAGE_SHARING
-/*******************************************************************************
-* Global Variables *
-*******************************************************************************/
+
+/*********************************************************************************************************************************
+* Global Variables *
+*********************************************************************************************************************************/
# ifdef VBOX_STRICT
/** Keep a copy of all registered shared modules for the .pgmcheckduppages debugger command. */
static PGMMREGISTERSHAREDMODULEREQ g_apSharedModules[512] = {0};
diff --git a/src/VBox/VMM/VMMR3/SELM.cpp b/src/VBox/VMM/VMMR3/SELM.cpp
index 6293ba6..e0bcb08 100644
--- a/src/VBox/VMM/VMMR3/SELM.cpp
+++ b/src/VBox/VMM/VMMR3/SELM.cpp
@@ -55,9 +55,10 @@
*
*/
-/*******************************************************************************
-* Header Files *
-*******************************************************************************/
+
+/*********************************************************************************************************************************
+* Header Files *
+*********************************************************************************************************************************/
#define LOG_GROUP LOG_GROUP_SELM
#include <VBox/vmm/selm.h>
#include <VBox/vmm/cpum.h>
@@ -88,9 +89,9 @@
#define SELM_SAVED_STATE_VERSION 5
-/*******************************************************************************
-* Internal Functions *
-*******************************************************************************/
+/*********************************************************************************************************************************
+* Internal Functions *
+*********************************************************************************************************************************/
static DECLCALLBACK(int) selmR3Save(PVM pVM, PSSMHANDLE pSSM);
static DECLCALLBACK(int) selmR3Load(PVM pVM, PSSMHANDLE pSSM, uint32_t uVersion, uint32_t uPass);
static DECLCALLBACK(int) selmR3LoadDone(PVM pVM, PSSMHANDLE pSSM);
@@ -102,9 +103,9 @@ static DECLCALLBACK(void) selmR3InfoLdtGuest(PVM pVM, PCDBGFINFOHLP pHlp, const
//static DECLCALLBACK(void) selmR3InfoTssGuest(PVM pVM, PCDBGFINFOHLP pHlp, const char *pszArgs);
-/*******************************************************************************
-* Global Variables *
-*******************************************************************************/
+/*********************************************************************************************************************************
+* Global Variables *
+*********************************************************************************************************************************/
#ifdef LOG_ENABLED
/** Segment register names. */
static char const g_aszSRegNms[X86_SREG_COUNT][4] = { "ES", "CS", "SS", "DS", "FS", "GS" };
diff --git a/src/VBox/VMM/VMMR3/SSM.cpp b/src/VBox/VMM/VMMR3/SSM.cpp
index 5fd8583..dc6c98a 100644
--- a/src/VBox/VMM/VMMR3/SSM.cpp
+++ b/src/VBox/VMM/VMMR3/SSM.cpp
@@ -140,9 +140,9 @@
*/
-/*******************************************************************************
-* Header Files *
-*******************************************************************************/
+/*********************************************************************************************************************************
+* Header Files *
+*********************************************************************************************************************************/
#define LOG_GROUP LOG_GROUP_SSM
#include <VBox/vmm/ssm.h>
#include <VBox/vmm/dbgf.h>
@@ -169,9 +169,9 @@
#include <iprt/zip.h>
-/*******************************************************************************
-* Defined Constants And Macros *
-*******************************************************************************/
+/*********************************************************************************************************************************
+* Defined Constants And Macros *
+*********************************************************************************************************************************/
/** The max length of a unit name. */
#define SSM_MAX_NAME_SIZE 48
@@ -341,9 +341,9 @@ AssertCompile(SSM_ZIP_BLOCK_SIZE / _1K * _1K == SSM_ZIP_BLOCK_SIZE);
-/*******************************************************************************
-* Structures and Typedefs *
-*******************************************************************************/
+/*********************************************************************************************************************************
+* Structures and Typedefs *
+*********************************************************************************************************************************/
/** SSM state. */
typedef enum SSMSTATE
{
@@ -865,17 +865,17 @@ typedef SSMFILEFTR *PSSMFILEFTR;
typedef SSMFILEFTR const *PCSSMFILEFTR;
-/*******************************************************************************
-* Global Variables *
-*******************************************************************************/
+/*********************************************************************************************************************************
+* Global Variables *
+*********************************************************************************************************************************/
/** Zeros used by the struct putter.
* This must be at least 8 bytes or the code breaks. */
static uint8_t const g_abZero[_1K] = {0};
-/*******************************************************************************
-* Internal Functions *
-*******************************************************************************/
+/*********************************************************************************************************************************
+* Internal Functions *
+*********************************************************************************************************************************/
#ifndef SSM_STANDALONE
static int ssmR3LazyInit(PVM pVM);
static DECLCALLBACK(int) ssmR3SelfLiveExec(PVM pVM, PSSMHANDLE pSSM, uint32_t uPass);
diff --git a/src/VBox/VMM/VMMR3/STAM.cpp b/src/VBox/VMM/VMMR3/STAM.cpp
index 6122182..02f4b93 100644
--- a/src/VBox/VMM/VMMR3/STAM.cpp
+++ b/src/VBox/VMM/VMMR3/STAM.cpp
@@ -44,9 +44,10 @@
* @see grp_stam
*/
-/*******************************************************************************
-* Header Files *
-*******************************************************************************/
+
+/*********************************************************************************************************************************
+* Header Files *
+*********************************************************************************************************************************/
#define LOG_GROUP LOG_GROUP_STAM
#include <VBox/vmm/stam.h>
#include "STAMInternal.h"
@@ -63,16 +64,16 @@
#include <iprt/string.h>
-/*******************************************************************************
-* Defined Constants And Macros *
-*******************************************************************************/
+/*********************************************************************************************************************************
+* Defined Constants And Macros *
+*********************************************************************************************************************************/
/** The maximum name length excluding the terminator. */
#define STAM_MAX_NAME_LEN 239
-/*******************************************************************************
-* Structures and Typedefs *
-*******************************************************************************/
+/*********************************************************************************************************************************
+* Structures and Typedefs *
+*********************************************************************************************************************************/
/**
* Argument structure for stamR3PrintOne().
*/
@@ -136,9 +137,9 @@ typedef struct STAMR0SAMPLE
} STAMR0SAMPLE;
-/*******************************************************************************
-* Internal Functions *
-*******************************************************************************/
+/*********************************************************************************************************************************
+* Internal Functions *
+*********************************************************************************************************************************/
#ifdef STAM_WITH_LOOKUP_TREE
static void stamR3LookupDestroyTree(PSTAMLOOKUP pRoot);
#endif
@@ -166,9 +167,9 @@ static FNDBGCCMD stamR3CmdStatsReset;
#endif
-/*******************************************************************************
-* Global Variables *
-*******************************************************************************/
+/*********************************************************************************************************************************
+* Global Variables *
+*********************************************************************************************************************************/
#ifdef VBOX_WITH_DEBUGGER
/** Pattern argument. */
static const DBGCVARDESC g_aArgPat[] =
diff --git a/src/VBox/VMM/VMMR3/TM.cpp b/src/VBox/VMM/VMMR3/TM.cpp
index d7ce18d..86434b1 100644
--- a/src/VBox/VMM/VMMR3/TM.cpp
+++ b/src/VBox/VMM/VMMR3/TM.cpp
@@ -116,12 +116,13 @@
*
*/
-/*******************************************************************************
-* Header Files *
-*******************************************************************************/
+
+/*********************************************************************************************************************************
+* Header Files *
+*********************************************************************************************************************************/
#define LOG_GROUP LOG_GROUP_TM
#include <VBox/vmm/tm.h>
-#include <iprt/asm-amd64-x86.h> /* for SUPGetCpuHzFromGIP from sup.h */
+#include <iprt/asm-amd64-x86.h> /* for SUPGetCpuHzFromGip from sup.h */
#include <VBox/vmm/vmm.h>
#include <VBox/vmm/mm.h>
#include <VBox/vmm/hm.h>
@@ -156,16 +157,16 @@
#include "TMInline.h"
-/*******************************************************************************
-* Defined Constants And Macros *
-*******************************************************************************/
+/*********************************************************************************************************************************
+* Defined Constants And Macros *
+*********************************************************************************************************************************/
/** The current saved state version.*/
#define TM_SAVED_STATE_VERSION 3
-/*******************************************************************************
-* Internal Functions *
-*******************************************************************************/
+/*********************************************************************************************************************************
+* Internal Functions *
+*********************************************************************************************************************************/
static bool tmR3HasFixedTSC(PVM pVM);
static const char * tmR3GetTSCModeName(PVM pVM);
static uint64_t tmR3CalibrateTSC(PVM pVM);
diff --git a/src/VBox/VMM/VMMR3/TRPM.cpp b/src/VBox/VMM/VMMR3/TRPM.cpp
index 3f869fb..c08202a 100644
--- a/src/VBox/VMM/VMMR3/TRPM.cpp
+++ b/src/VBox/VMM/VMMR3/TRPM.cpp
@@ -69,9 +69,10 @@
*
*/
-/*******************************************************************************
-* Header Files *
-*******************************************************************************/
+
+/*********************************************************************************************************************************
+* Header Files *
+*********************************************************************************************************************************/
#define LOG_GROUP LOG_GROUP_TRPM
#include <VBox/vmm/trpm.h>
#include <VBox/vmm/cpum.h>
@@ -103,9 +104,9 @@
#include <iprt/alloc.h>
-/*******************************************************************************
-* Structures and Typedefs *
-*******************************************************************************/
+/*********************************************************************************************************************************
+* Structures and Typedefs *
+*********************************************************************************************************************************/
/**
* Trap handler function.
* @todo need to specialize this as we go along.
@@ -125,9 +126,9 @@ typedef enum TRPMHANDLER
} TRPMHANDLER, *PTRPMHANDLER;
-/*******************************************************************************
-* Global Variables *
-*******************************************************************************/
+/*********************************************************************************************************************************
+* Global Variables *
+*********************************************************************************************************************************/
/** Preinitialized IDT.
* The u16OffsetLow is a value of the TRPMHANDLER enum which TRPMR3Relocate()
* will use to pick the right address. The u16SegSel is always VMM CS.
@@ -428,9 +429,9 @@ static VBOXIDTE_GENERIC g_aIdt[256] =
#define TRPM_SAVED_STATE_VERSION_UNI 8 /* SMP support bumped the version */
-/*******************************************************************************
-* Internal Functions *
-*******************************************************************************/
+/*********************************************************************************************************************************
+* Internal Functions *
+*********************************************************************************************************************************/
static DECLCALLBACK(int) trpmR3Save(PVM pVM, PSSMHANDLE pSSM);
static DECLCALLBACK(int) trpmR3Load(PVM pVM, PSSMHANDLE pSSM, uint32_t uVersion, uint32_t uPass);
diff --git a/src/VBox/VMM/VMMR3/VM.cpp b/src/VBox/VMM/VMMR3/VM.cpp
index 74d2b62..0db8e52 100644
--- a/src/VBox/VMM/VMMR3/VM.cpp
+++ b/src/VBox/VMM/VMMR3/VM.cpp
@@ -38,9 +38,10 @@
*
*/
-/*******************************************************************************
-* Header Files *
-*******************************************************************************/
+
+/*********************************************************************************************************************************
+* Header Files *
+*********************************************************************************************************************************/
#define LOG_GROUP LOG_GROUP_VM
#include <VBox/vmm/cfgm.h>
#include <VBox/vmm/vmm.h>
@@ -90,16 +91,16 @@
#include <iprt/uuid.h>
-/*******************************************************************************
-* Global Variables *
-*******************************************************************************/
+/*********************************************************************************************************************************
+* Global Variables *
+*********************************************************************************************************************************/
/** Pointer to the list of VMs. */
static PUVM g_pUVMsHead = NULL;
-/*******************************************************************************
-* Internal Functions *
-*******************************************************************************/
+/*********************************************************************************************************************************
+* Internal Functions *
+*********************************************************************************************************************************/
static int vmR3CreateUVM(uint32_t cCpus, PCVMM2USERMETHODS pVmm2UserMethods, PUVM *ppUVM);
static int vmR3CreateU(PUVM pUVM, uint32_t cCpus, PFNCFGMCONSTRUCTOR pfnCFGMConstructor, void *pvUserCFGM);
static int vmR3ReadBaseConfig(PVM pVM, PUVM pUVM, uint32_t cCpus);
@@ -3830,7 +3831,7 @@ VMMR3_INT_DECL(uint32_t) VMR3GetErrorCount(PUVM pUVM)
* @param ... The arguments.
* @thread Any thread.
*/
-static int vmR3SetErrorU(PUVM pUVM, int rc, RT_SRC_POS_DECL, const char *pszFormat, ...)
+static int vmR3SetErrorU(PUVM pUVM, int rc, RT_SRC_POS_DECL, const char *pszFormat, ...) RT_IPRT_FORMAT_ATTR(6, 7)
{
va_list va;
va_start(va, pszFormat);
@@ -3937,6 +3938,17 @@ VMMR3DECL(int) VMR3SetError(PUVM pUVM, int rc, RT_SRC_POS_DECL, const char *pszF
VMMR3DECL(int) VMR3SetErrorV(PUVM pUVM, int rc, RT_SRC_POS_DECL, const char *pszFormat, va_list va)
{
UVM_ASSERT_VALID_EXT_RETURN(pUVM, VERR_INVALID_VM_HANDLE);
+
+ /* Take shortcut when called on EMT, skipping VM handle requirement + validation. */
+ if (VMR3GetVMCPUThread(pUVM) != NIL_RTTHREAD)
+ {
+ va_list vaCopy;
+ va_copy(vaCopy, va);
+ vmR3SetErrorUV(pUVM, rc, RT_SRC_POS_ARGS, pszFormat, &vaCopy);
+ va_end(vaCopy);
+ return rc;
+ }
+
VM_ASSERT_VALID_EXT_RETURN(pUVM->pVM, VERR_INVALID_VM_HANDLE);
return VMSetErrorV(pUVM->pVM, rc, pszFile, iLine, pszFunction, pszFormat, va);
}
diff --git a/src/VBox/VMM/VMMR3/VMEmt.cpp b/src/VBox/VMM/VMMR3/VMEmt.cpp
index 9f8aaf9..6dd6d00 100644
--- a/src/VBox/VMM/VMMR3/VMEmt.cpp
+++ b/src/VBox/VMM/VMMR3/VMEmt.cpp
@@ -16,9 +16,9 @@
*/
-/*******************************************************************************
-* Header Files *
-*******************************************************************************/
+/*********************************************************************************************************************************
+* Header Files *
+*********************************************************************************************************************************/
#define LOG_GROUP LOG_GROUP_VM
#include <VBox/vmm/tm.h>
#include <VBox/vmm/dbgf.h>
@@ -43,9 +43,9 @@
#include <iprt/time.h>
-/*******************************************************************************
-* Internal Functions *
-*******************************************************************************/
+/*********************************************************************************************************************************
+* Internal Functions *
+*********************************************************************************************************************************/
int vmR3EmulationThreadWithId(RTTHREAD ThreadSelf, PUVMCPU pUVCpu, VMCPUID idCpu);
diff --git a/src/VBox/VMM/VMMR3/VMM.cpp b/src/VBox/VMM/VMMR3/VMM.cpp
index cdafff3..54eaab9 100644
--- a/src/VBox/VMM/VMMR3/VMM.cpp
+++ b/src/VBox/VMM/VMMR3/VMM.cpp
@@ -70,9 +70,10 @@
*
*/
-/*******************************************************************************
-* Header Files *
-*******************************************************************************/
+
+/*********************************************************************************************************************************
+* Header Files *
+*********************************************************************************************************************************/
#define LOG_GROUP LOG_GROUP_VMM
#include <VBox/vmm/vmm.h>
#include <VBox/vmm/vmapi.h>
@@ -121,18 +122,18 @@
-/*******************************************************************************
-* Defined Constants And Macros *
-*******************************************************************************/
+/*********************************************************************************************************************************
+* Defined Constants And Macros *
+*********************************************************************************************************************************/
/** The saved state version. */
#define VMM_SAVED_STATE_VERSION 4
/** The saved state version used by v3.0 and earlier. (Teleportation) */
#define VMM_SAVED_STATE_VERSION_3_0 3
-/*******************************************************************************
-* Internal Functions *
-*******************************************************************************/
+/*********************************************************************************************************************************
+* Internal Functions *
+*********************************************************************************************************************************/
static int vmmR3InitStacks(PVM pVM);
static int vmmR3InitLoggers(PVM pVM);
static void vmmR3InitRegisterStats(PVM pVM);
@@ -1389,7 +1390,7 @@ VMMR3_INT_DECL(int) VMMR3HmRunGC(PVM pVM, PVMCPU pVCpu)
* @param idCpu Virtual CPU to perform SIPI on
* @param uVector SIPI vector
*/
-DECLCALLBACK(int) vmmR3SendSipi(PVM pVM, VMCPUID idCpu, uint32_t uVector)
+static DECLCALLBACK(int) vmmR3SendSipi(PVM pVM, VMCPUID idCpu, uint32_t uVector)
{
PVMCPU pVCpu = VMMGetCpuById(pVM, idCpu);
VMCPU_ASSERT_EMT(pVCpu);
@@ -1420,7 +1421,7 @@ DECLCALLBACK(int) vmmR3SendSipi(PVM pVM, VMCPUID idCpu, uint32_t uVector)
# endif
}
-DECLCALLBACK(int) vmmR3SendInitIpi(PVM pVM, VMCPUID idCpu)
+static DECLCALLBACK(int) vmmR3SendInitIpi(PVM pVM, VMCPUID idCpu)
{
PVMCPU pVCpu = VMMGetCpuById(pVM, idCpu);
VMCPU_ASSERT_EMT(pVCpu);
@@ -2421,7 +2422,6 @@ static DECLCALLBACK(void) vmmR3InfoFF(PVM pVM, PCDBGFINFOHLP pHlp, const char *p
PRINT_FLAG(VMCPU_FF_,HM_UPDATE_PAE_PDPES);
PRINT_FLAG(VMCPU_FF_,PGM_SYNC_CR3);
PRINT_FLAG(VMCPU_FF_,PGM_SYNC_CR3_NON_GLOBAL);
- PRINT_FLAG(VMCPU_FF_,TLB_SHOOTDOWN);
PRINT_FLAG(VMCPU_FF_,TLB_FLUSH);
PRINT_FLAG(VMCPU_FF_,INHIBIT_INTERRUPTS);
PRINT_FLAG(VMCPU_FF_,BLOCK_NMIS);
diff --git a/src/VBox/VMM/VMMR3/VMMGuruMeditation.cpp b/src/VBox/VMM/VMMR3/VMMGuruMeditation.cpp
index 540a390..02c3b6f 100644
--- a/src/VBox/VMM/VMMR3/VMMGuruMeditation.cpp
+++ b/src/VBox/VMM/VMMR3/VMMGuruMeditation.cpp
@@ -15,9 +15,10 @@
* hope that it will be useful, but WITHOUT ANY WARRANTY of any kind.
*/
-/*******************************************************************************
-* Header Files *
-*******************************************************************************/
+
+/*********************************************************************************************************************************
+* Header Files *
+*********************************************************************************************************************************/
#define LOG_GROUP LOG_GROUP_VMM
#include <VBox/vmm/vmm.h>
#include <VBox/vmm/pdmapi.h>
@@ -41,9 +42,9 @@
#include <iprt/stdarg.h>
-/*******************************************************************************
-* Structures and Typedefs *
-*******************************************************************************/
+/*********************************************************************************************************************************
+* Structures and Typedefs *
+*********************************************************************************************************************************/
/**
* Structure to pass to DBGFR3Info() and for doing all other
* output during fatal dump.
diff --git a/src/VBox/VMM/VMMR3/VMMSwitcher.cpp b/src/VBox/VMM/VMMR3/VMMSwitcher.cpp
index 0dde993..396b375 100644
--- a/src/VBox/VMM/VMMR3/VMMSwitcher.cpp
+++ b/src/VBox/VMM/VMMR3/VMMSwitcher.cpp
@@ -16,9 +16,9 @@
*/
-/*******************************************************************************
-* Header Files *
-*******************************************************************************/
+/*********************************************************************************************************************************
+* Header Files *
+*********************************************************************************************************************************/
#define LOG_GROUP LOG_GROUP_VMM
#include <VBox/vmm/vmm.h>
#include <VBox/vmm/pgm.h>
@@ -41,9 +41,9 @@
#include <iprt/ctype.h>
-/*******************************************************************************
-* Global Variables *
-*******************************************************************************/
+/*********************************************************************************************************************************
+* Global Variables *
+*********************************************************************************************************************************/
/** Array of switcher definitions.
* The type and index shall match!
*/
@@ -59,11 +59,7 @@ static PVMMSWITCHERDEF g_apRawModeSwitchers[VMMSWITCHER_MAX] =
&vmmR3SwitcherPAEToPAE_Def,
NULL, //&vmmR3SwitcherPAEToAMD64_Def,
NULL, //&vmmR3SwitcherPAETo32Bit_Def,
-# ifdef VBOX_WITH_HYBRID_32BIT_KERNEL
- &vmmR3SwitcherAMD64ToPAE_Def,
-# else
NULL, //&vmmR3SwitcherAMD64ToPAE_Def,
-# endif
NULL, //&vmmR3SwitcherAMD64ToAMD64_Def,
# else /* RT_ARCH_AMD64 */
NULL, //&vmmR3Switcher32BitTo32Bit_Def,
@@ -102,7 +98,7 @@ static PVMMSWITCHERDEF g_apRawModeSwitchers[VMMSWITCHER_MAX] =
static PVMMSWITCHERDEF g_apHmSwitchers[VMMSWITCHER_MAX] =
{
NULL, /* invalid entry */
-#if HC_ARCH_BITS == 32 && !defined(VBOX_WITH_HYBRID_32BIT_KERNEL)
+#if HC_ARCH_BITS == 32
NULL, //&vmmR3Switcher32BitTo32Bit_Def,
NULL, //&vmmR3Switcher32BitToPAE_Def,
&vmmR3Switcher32BitToAMD64_Def,
@@ -216,7 +212,7 @@ static void vmmR3Switcher32On64IdtRelocate(PVM pVM, PVMMSWITCHERDEF pSwitcher, u
*/
int vmmR3SwitcherInit(PVM pVM)
{
-#if !defined(VBOX_WITH_RAW_MODE) && (HC_ARCH_BITS == 64 || defined(VBOX_WITH_HYBRID_32BIT_KERNEL))
+#if !defined(VBOX_WITH_RAW_MODE) && (HC_ARCH_BITS == 64)
return VINF_SUCCESS;
#else
@@ -361,7 +357,7 @@ int vmmR3SwitcherInit(PVM pVM)
*/
void vmmR3SwitcherRelocate(PVM pVM, RTGCINTPTR offDelta)
{
-#if defined(VBOX_WITH_RAW_MODE) || (HC_ARCH_BITS != 64 && !defined(VBOX_WITH_HYBRID_32BIT_KERNEL))
+#if defined(VBOX_WITH_RAW_MODE) || (HC_ARCH_BITS != 64)
/*
* Relocate all the switchers.
*/
@@ -410,7 +406,7 @@ void vmmR3SwitcherRelocate(PVM pVM, RTGCINTPTR offDelta)
}
-#if defined(VBOX_WITH_RAW_MODE) || (HC_ARCH_BITS != 64 && !defined(VBOX_WITH_HYBRID_32BIT_KERNEL))
+#if defined(VBOX_WITH_RAW_MODE) || (HC_ARCH_BITS != 64)
/**
* Generic switcher code relocator.
@@ -763,18 +759,14 @@ static void vmmR3SwitcherGenericRelocate(PVM pVM, PVMMSWITCHERDEF pSwitcher,
break;
}
-# if defined(RT_ARCH_AMD64) || defined(VBOX_WITH_HYBRID_32BIT_KERNEL)
+# if defined(RT_ARCH_AMD64)
/*
* 64-bit HC Code Selector (no argument).
*/
case FIX_HC_64BIT_CS:
{
Assert(offSrc < pSwitcher->cbCode);
-# if defined(RT_OS_DARWIN) && defined(VBOX_WITH_HYBRID_32BIT_KERNEL)
- *uSrc.pu16 = 0x80; /* KERNEL64_CS from i386/seg.h */
-# else
AssertFatalMsgFailed(("FIX_HC_64BIT_CS not implemented for this host\n"));
-# endif
break;
}
@@ -1015,7 +1007,7 @@ static RTRCPTR vmmR3SwitcherGetHyperGDT(PVM pVM)
{
if (HMIsRawModeCtxNeeded(pVM))
return SELMGetHyperGDT(pVM);
-# if HC_ARCH_BITS != 32 || defined(VBOX_WITH_HYBRID_32BIT_KERNEL)
+# if HC_ARCH_BITS != 32
AssertFailed(); /* This path is only applicable to some 32-bit hosts. */
# endif
return NIL_RTRCPTR;
@@ -1150,7 +1142,7 @@ VMMR3_INT_DECL(int) VMMR3SelectSwitcher(PVM pVM, VMMSWITCHER enmSwitcher)
return VERR_NOT_IMPLEMENTED;
}
-#endif /* #defined(VBOX_WITH_RAW_MODE) || (HC_ARCH_BITS != 64 && !defined(VBOX_WITH_HYBRID_32BIT_KERNEL)) */
+#endif /* #defined(VBOX_WITH_RAW_MODE) || (HC_ARCH_BITS != 64) */
/**
diff --git a/src/VBox/VMM/VMMR3/VMMTests.cpp b/src/VBox/VMM/VMMR3/VMMTests.cpp
index 66843dd..7eb4f92 100644
--- a/src/VBox/VMM/VMMR3/VMMTests.cpp
+++ b/src/VBox/VMM/VMMR3/VMMTests.cpp
@@ -17,9 +17,10 @@
//#define NO_SUPCALLR0VMM
-/*******************************************************************************
-* Header Files *
-*******************************************************************************/
+
+/*********************************************************************************************************************************
+* Header Files *
+*********************************************************************************************************************************/
#define LOG_GROUP LOG_GROUP_VMM
#include <iprt/asm-amd64-x86.h> /* for SUPGetCpuHzFromGIP */
#include <VBox/vmm/vmm.h>
diff --git a/src/VBox/VMM/VMMR3/VMReq.cpp b/src/VBox/VMM/VMMR3/VMReq.cpp
index 7c3aaf4..4064c65 100644
--- a/src/VBox/VMM/VMMR3/VMReq.cpp
+++ b/src/VBox/VMM/VMMR3/VMReq.cpp
@@ -16,9 +16,9 @@
*/
-/*******************************************************************************
-* Header Files *
-*******************************************************************************/
+/*********************************************************************************************************************************
+* Header Files *
+*********************************************************************************************************************************/
#define LOG_GROUP LOG_GROUP_VM
#include <VBox/vmm/mm.h>
#include <VBox/vmm/vmm.h>
@@ -37,9 +37,9 @@
#include <iprt/thread.h>
-/*******************************************************************************
-* Internal Functions *
-*******************************************************************************/
+/*********************************************************************************************************************************
+* Internal Functions *
+*********************************************************************************************************************************/
static int vmR3ReqProcessOneU(PUVM pUVM, PVMREQ pReq);
diff --git a/src/VBox/VMM/VMMRC/CPUMRC.cpp b/src/VBox/VMM/VMMRC/CPUMRC.cpp
index 098dbbc..0a5a14e 100644
--- a/src/VBox/VMM/VMMRC/CPUMRC.cpp
+++ b/src/VBox/VMM/VMMRC/CPUMRC.cpp
@@ -16,9 +16,9 @@
*/
-/*******************************************************************************
-* Header Files *
-*******************************************************************************/
+/*********************************************************************************************************************************
+* Header Files *
+*********************************************************************************************************************************/
#define LOG_GROUP LOG_GROUP_CPUM
#include <VBox/vmm/cpum.h>
#include <VBox/vmm/vmm.h>
@@ -32,9 +32,9 @@
#include <VBox/log.h>
-/*******************************************************************************
-* Internal Functions *
-*******************************************************************************/
+/*********************************************************************************************************************************
+* Internal Functions *
+*********************************************************************************************************************************/
RT_C_DECLS_BEGIN /* addressed from asm (not called so no DECLASM). */
DECLCALLBACK(int) cpumRCHandleNPAndGP(PVM pVM, PCPUMCTXCORE pRegFrame, uintptr_t uUser);
RT_C_DECLS_END
diff --git a/src/VBox/VMM/VMMRC/CSAMRC.cpp b/src/VBox/VMM/VMMRC/CSAMRC.cpp
index 81091d7..43e0d2f 100644
--- a/src/VBox/VMM/VMMRC/CSAMRC.cpp
+++ b/src/VBox/VMM/VMMRC/CSAMRC.cpp
@@ -16,9 +16,9 @@
*/
-/*******************************************************************************
-* Header Files *
-*******************************************************************************/
+/*********************************************************************************************************************************
+* Header Files *
+*********************************************************************************************************************************/
#define LOG_GROUP LOG_GROUP_CSAM
#include <VBox/vmm/cpum.h>
#include <VBox/vmm/stam.h>
diff --git a/src/VBox/VMM/VMMRC/IOMRC.cpp b/src/VBox/VMM/VMMRC/IOMRC.cpp
index d511dec..0dc19cf 100644
--- a/src/VBox/VMM/VMMRC/IOMRC.cpp
+++ b/src/VBox/VMM/VMMRC/IOMRC.cpp
@@ -16,9 +16,9 @@
*/
-/*******************************************************************************
-* Header Files *
-*******************************************************************************/
+/*********************************************************************************************************************************
+* Header Files *
+*********************************************************************************************************************************/
#define LOG_GROUP LOG_GROUP_IOM
#include <VBox/vmm/iom.h>
#include <VBox/vmm/cpum.h>
diff --git a/src/VBox/VMM/VMMRC/MMRamRC.cpp b/src/VBox/VMM/VMMRC/MMRamRC.cpp
index 7eafef5..7789347 100644
--- a/src/VBox/VMM/VMMRC/MMRamRC.cpp
+++ b/src/VBox/VMM/VMMRC/MMRamRC.cpp
@@ -16,9 +16,9 @@
*/
-/*******************************************************************************
-* Header Files *
-*******************************************************************************/
+/*********************************************************************************************************************************
+* Header Files *
+*********************************************************************************************************************************/
#define LOG_GROUP LOG_GROUP_MM
#include <VBox/vmm/mm.h>
#include <VBox/vmm/cpum.h>
@@ -34,9 +34,9 @@
#include <VBox/err.h>
-/*******************************************************************************
-* Internal Functions *
-*******************************************************************************/
+/*********************************************************************************************************************************
+* Internal Functions *
+*********************************************************************************************************************************/
static DECLCALLBACK(int) mmGCRamTrap0eHandler(PVM pVM, PCPUMCTXCORE pRegFrame);
DECLASM(void) MMGCRamReadNoTrapHandler_EndProc(void);
diff --git a/src/VBox/VMM/VMMRC/PATMRC.cpp b/src/VBox/VMM/VMMRC/PATMRC.cpp
index ac386bc..fad2d38 100644
--- a/src/VBox/VMM/VMMRC/PATMRC.cpp
+++ b/src/VBox/VMM/VMMRC/PATMRC.cpp
@@ -16,9 +16,9 @@
*/
-/*******************************************************************************
-* Header Files *
-*******************************************************************************/
+/*********************************************************************************************************************************
+* Header Files *
+*********************************************************************************************************************************/
#define LOG_GROUP LOG_GROUP_PATM
#include <VBox/vmm/patm.h>
#include <VBox/vmm/cpum.h>
diff --git a/src/VBox/VMM/VMMRC/PDMRCDevice.cpp b/src/VBox/VMM/VMMRC/PDMRCDevice.cpp
index 0cb2fe3..e28d5b3 100644
--- a/src/VBox/VMM/VMMRC/PDMRCDevice.cpp
+++ b/src/VBox/VMM/VMMRC/PDMRCDevice.cpp
@@ -16,9 +16,9 @@
*/
-/*******************************************************************************
-* Header Files *
-*******************************************************************************/
+/*********************************************************************************************************************************
+* Header Files *
+*********************************************************************************************************************************/
#define LOG_GROUP LOG_GROUP_PDM_DEVICE
#include "PDMInternal.h"
#include <VBox/vmm/pdm.h>
@@ -38,9 +38,9 @@
#include "PDMInline.h"
-/*******************************************************************************
-* Global Variables *
-*******************************************************************************/
+/*********************************************************************************************************************************
+* Global Variables *
+*********************************************************************************************************************************/
RT_C_DECLS_BEGIN
extern DECLEXPORT(const PDMDEVHLPRC) g_pdmRCDevHlp;
extern DECLEXPORT(const PDMPICHLPRC) g_pdmRCPicHlp;
@@ -53,9 +53,9 @@ extern DECLEXPORT(const PDMDRVHLPRC) g_pdmRCDrvHlp;
RT_C_DECLS_END
-/*******************************************************************************
-* Internal Functions *
-*******************************************************************************/
+/*********************************************************************************************************************************
+* Internal Functions *
+*********************************************************************************************************************************/
static bool pdmRCIsaSetIrq(PVM pVM, int iIrq, int iLevel, uint32_t uTagSrc);
diff --git a/src/VBox/VMM/VMMRC/PGMRC.cpp b/src/VBox/VMM/VMMRC/PGMRC.cpp
index 80756d2..1710eaa 100644
--- a/src/VBox/VMM/VMMRC/PGMRC.cpp
+++ b/src/VBox/VMM/VMMRC/PGMRC.cpp
@@ -16,9 +16,9 @@
*/
-/*******************************************************************************
-* Header Files *
-*******************************************************************************/
+/*********************************************************************************************************************************
+* Header Files *
+*********************************************************************************************************************************/
#define LOG_GROUP LOG_GROUP_PGM
#include <VBox/vmm/pgm.h>
#include <VBox/vmm/cpum.h>
@@ -44,9 +44,9 @@
-/*******************************************************************************
-* Internal Functions *
-*******************************************************************************/
+/*********************************************************************************************************************************
+* Internal Functions *
+*********************************************************************************************************************************/
diff --git a/src/VBox/VMM/VMMRC/SELMRC.cpp b/src/VBox/VMM/VMMRC/SELMRC.cpp
index 39fb73e..f733bb7 100644
--- a/src/VBox/VMM/VMMRC/SELMRC.cpp
+++ b/src/VBox/VMM/VMMRC/SELMRC.cpp
@@ -15,9 +15,10 @@
* hope that it will be useful, but WITHOUT ANY WARRANTY of any kind.
*/
-/*******************************************************************************
-* Header Files *
-*******************************************************************************/
+
+/*********************************************************************************************************************************
+* Header Files *
+*********************************************************************************************************************************/
#define LOG_GROUP LOG_GROUP_SELM
#include <VBox/vmm/selm.h>
#include <VBox/vmm/mm.h>
@@ -37,9 +38,9 @@
#include "SELMInline.h"
-/*******************************************************************************
-* Global Variables *
-*******************************************************************************/
+/*********************************************************************************************************************************
+* Global Variables *
+*********************************************************************************************************************************/
#ifdef LOG_ENABLED
/** Segment register names. */
static char const g_aszSRegNms[X86_SREG_COUNT][4] = { "ES", "CS", "SS", "DS", "FS", "GS" };
diff --git a/src/VBox/VMM/VMMRC/TRPMRC.cpp b/src/VBox/VMM/VMMRC/TRPMRC.cpp
index b82a941..2032840 100644
--- a/src/VBox/VMM/VMMRC/TRPMRC.cpp
+++ b/src/VBox/VMM/VMMRC/TRPMRC.cpp
@@ -16,9 +16,9 @@
*/
-/*******************************************************************************
-* Header Files *
-*******************************************************************************/
+/*********************************************************************************************************************************
+* Header Files *
+*********************************************************************************************************************************/
#define LOG_GROUP LOG_GROUP_TRPM
#include <VBox/vmm/trpm.h>
#include <VBox/vmm/cpum.h>
diff --git a/src/VBox/VMM/VMMRC/TRPMRCHandlers.cpp b/src/VBox/VMM/VMMRC/TRPMRCHandlers.cpp
index 62a37e7..f8382f9 100644
--- a/src/VBox/VMM/VMMRC/TRPMRCHandlers.cpp
+++ b/src/VBox/VMM/VMMRC/TRPMRCHandlers.cpp
@@ -16,9 +16,9 @@
*/
-/*******************************************************************************
-* Header Files *
-*******************************************************************************/
+/*********************************************************************************************************************************
+* Header Files *
+*********************************************************************************************************************************/
#define LOG_GROUP LOG_GROUP_TRPM
#include <VBox/vmm/selm.h>
#include <VBox/vmm/iom.h>
@@ -47,9 +47,9 @@
#include <iprt/x86.h>
-/*******************************************************************************
-* Defined Constants And Macros *
-*******************************************************************************/
+/*********************************************************************************************************************************
+* Defined Constants And Macros *
+*********************************************************************************************************************************/
/* still here. MODR/M byte parsing */
#define X86_OPCODE_MODRM_MOD_MASK 0xc0
#define X86_OPCODE_MODRM_REG_MASK 0x38
@@ -81,9 +81,10 @@
# define TRPM_EXIT_DBG_HOOK_HYPER(a_iVector) do {} while (0)
#endif
-/*******************************************************************************
-* Structures and Typedefs *
-*******************************************************************************/
+
+/*********************************************************************************************************************************
+* Structures and Typedefs *
+*********************************************************************************************************************************/
/** Pointer to a readonly hypervisor trap record. */
typedef const struct TRPMGCHYPER *PCTRPMGCHYPER;
@@ -116,9 +117,9 @@ typedef struct TRPMGCHYPER
} TRPMGCHYPER;
-/*******************************************************************************
-* Global Variables *
-*******************************************************************************/
+/*********************************************************************************************************************************
+* Global Variables *
+*********************************************************************************************************************************/
RT_C_DECLS_BEGIN
/** Defined in VMMRC0.asm or VMMRC99.asm.
* @{ */
@@ -132,9 +133,9 @@ extern const TRPMGCHYPER g_aTrap0eHandlersEnd[1];
RT_C_DECLS_END
-/*******************************************************************************
-* Internal Functions *
-*******************************************************************************/
+/*********************************************************************************************************************************
+* Internal Functions *
+*********************************************************************************************************************************/
RT_C_DECLS_BEGIN /* addressed from asm (not called so no DECLASM). */
DECLCALLBACK(int) trpmRCTrapInGeneric(PVM pVM, PCPUMCTXCORE pRegFrame, uintptr_t uUser);
RT_C_DECLS_END
diff --git a/src/VBox/VMM/VMMRC/VMMRC.cpp b/src/VBox/VMM/VMMRC/VMMRC.cpp
index f18b38e..15ced1c 100644
--- a/src/VBox/VMM/VMMRC/VMMRC.cpp
+++ b/src/VBox/VMM/VMMRC/VMMRC.cpp
@@ -16,9 +16,9 @@
*/
-/*******************************************************************************
-* Header Files *
-*******************************************************************************/
+/*********************************************************************************************************************************
+* Header Files *
+*********************************************************************************************************************************/
#define LOG_GROUP LOG_GROUP_VMM
#include <iprt/asm-amd64-x86.h> /* for SUPGetCpuHzFromGIP */
#include <VBox/vmm/vmm.h>
@@ -33,17 +33,17 @@
#include <iprt/initterm.h>
-/*******************************************************************************
-* Global Variables *
-*******************************************************************************/
+/*********************************************************************************************************************************
+* Global Variables *
+*********************************************************************************************************************************/
/** Default logger instance. */
extern "C" DECLIMPORT(RTLOGGERRC) g_Logger;
extern "C" DECLIMPORT(RTLOGGERRC) g_RelLogger;
-/*******************************************************************************
-* Internal Functions *
-*******************************************************************************/
+/*********************************************************************************************************************************
+* Internal Functions *
+*********************************************************************************************************************************/
static int vmmGCTest(PVM pVM, unsigned uOperation, unsigned uArg);
static DECLCALLBACK(int) vmmGCTestTmpPFHandler(PVM pVM, PCPUMCTXCORE pRegFrame);
static DECLCALLBACK(int) vmmGCTestTmpPFHandlerCorruptFS(PVM pVM, PCPUMCTXCORE pRegFrame);
diff --git a/src/VBox/VMM/VMMRZ/DBGFRZ.cpp b/src/VBox/VMM/VMMRZ/DBGFRZ.cpp
index 523aa59..77ccbfb 100644
--- a/src/VBox/VMM/VMMRZ/DBGFRZ.cpp
+++ b/src/VBox/VMM/VMMRZ/DBGFRZ.cpp
@@ -16,9 +16,9 @@
*/
-/*******************************************************************************
-* Header Files *
-*******************************************************************************/
+/*********************************************************************************************************************************
+* Header Files *
+*********************************************************************************************************************************/
#define LOG_GROUP LOG_GROUP_DBGF
#include <VBox/vmm/dbgf.h>
#include <VBox/vmm/selm.h>
diff --git a/src/VBox/VMM/VMMRZ/PGMRZDynMap.cpp b/src/VBox/VMM/VMMRZ/PGMRZDynMap.cpp
index 1357b2d..2ce5700 100644
--- a/src/VBox/VMM/VMMRZ/PGMRZDynMap.cpp
+++ b/src/VBox/VMM/VMMRZ/PGMRZDynMap.cpp
@@ -16,9 +16,9 @@
*/
-/*******************************************************************************
-* Internal Functions *
-*******************************************************************************/
+/*********************************************************************************************************************************
+* Internal Functions *
+*********************************************************************************************************************************/
#define LOG_GROUP LOG_GROUP_PGM_DYNMAP
#include <VBox/vmm/pgm.h>
#include "PGMInternal.h"
@@ -41,9 +41,9 @@
#include <iprt/string.h>
-/*******************************************************************************
-* Defined Constants And Macros *
-*******************************************************************************/
+/*********************************************************************************************************************************
+* Defined Constants And Macros *
+*********************************************************************************************************************************/
#ifdef IN_RING0
/** The max size of the mapping cache (in pages). */
# define PGMR0DYNMAP_MAX_PAGES ((16*_1M) >> PAGE_SHIFT)
@@ -155,9 +155,9 @@
#endif
-/*******************************************************************************
-* Structures and Typedefs *
-*******************************************************************************/
+/*********************************************************************************************************************************
+* Structures and Typedefs *
+*********************************************************************************************************************************/
#ifdef IN_RING0
/**
* Ring-0 dynamic mapping cache segment.
@@ -309,9 +309,9 @@ typedef CTX_MID(PGM,DYNMAP) *PPGMRZDYNMAP;
-/*******************************************************************************
-* Global Variables *
-*******************************************************************************/
+/*********************************************************************************************************************************
+* Global Variables *
+*********************************************************************************************************************************/
#ifdef IN_RING0
/** Pointer to the ring-0 dynamic mapping cache. */
static PGMR0DYNMAP *g_pPGMR0DynMap;
@@ -320,9 +320,9 @@ static PGMR0DYNMAP *g_pPGMR0DynMap;
static bool g_fPGMR0DynMapTestRunning = false;
-/*******************************************************************************
-* Internal Functions *
-*******************************************************************************/
+/*********************************************************************************************************************************
+* Internal Functions *
+*********************************************************************************************************************************/
static void pgmRZDynMapReleasePage(PPGMRZDYNMAP pThis, uint32_t iPage, uint32_t cRefs);
#ifdef IN_RING0
static int pgmR0DynMapSetup(PPGMRZDYNMAP pThis);
diff --git a/src/VBox/VMM/VMMRZ/VMMRZ.cpp b/src/VBox/VMM/VMMRZ/VMMRZ.cpp
index deda2ea..cbe2178 100644
--- a/src/VBox/VMM/VMMRZ/VMMRZ.cpp
+++ b/src/VBox/VMM/VMMRZ/VMMRZ.cpp
@@ -16,9 +16,9 @@
*/
-/*******************************************************************************
-* Header Files *
-*******************************************************************************/
+/*********************************************************************************************************************************
+* Header Files *
+*********************************************************************************************************************************/
#include <VBox/vmm/vmm.h>
#include "VMMInternal.h"
#include <VBox/vmm/vm.h>
diff --git a/src/VBox/VMM/VMMSwitcher/AMD64Stub.asm b/src/VBox/VMM/VMMSwitcher/AMD64Stub.asm
index 0238944..b5006ca 100644
--- a/src/VBox/VMM/VMMSwitcher/AMD64Stub.asm
+++ b/src/VBox/VMM/VMMSwitcher/AMD64Stub.asm
@@ -31,11 +31,8 @@
BEGINCODE
GLOBALNAME Start
-%ifndef VBOX_WITH_HYBRID_32BIT_KERNEL
-BITS 64
-%else
BITS 32
-%endif
+
BEGINPROC vmmR0ToRawMode
mov eax, VERR_VMM_SWITCHER_STUB
ret
diff --git a/src/VBox/VMM/VMMSwitcher/AMD64andLegacy.mac b/src/VBox/VMM/VMMSwitcher/AMD64andLegacy.mac
index 0e83630..3f9428e 100644
--- a/src/VBox/VMM/VMMSwitcher/AMD64andLegacy.mac
+++ b/src/VBox/VMM/VMMSwitcher/AMD64andLegacy.mac
@@ -46,7 +46,6 @@ GLOBALNAME Fixups
BEGINCODE
GLOBALNAME Start
-%ifndef VBOX_WITH_HYBRID_32BIT_KERNEL
BITS 64
;;
@@ -205,79 +204,6 @@ gth64_apic_done:
ENDPROC vmmR0ToRawMode
-%else ; VBOX_WITH_HYBRID_32BIT_KERNEL
-
-
-BITS 32
-
-;;
-; The C interface.
-;
-BEGINPROC vmmR0ToRawMode
- %ifdef DEBUG_STUFF
- COM32_S_NEWLINE
- COM32_S_CHAR '^'
- %endif
-
- %ifdef VBOX_WITH_STATISTICS
- ;
- ; Switcher stats.
- ;
- FIXUP FIX_HC_VM_OFF, 1, VM.StatSwitcherToGC
- mov edx, 0ffffffffh
- STAM_PROFILE_ADV_START edx
- %endif
-
- ; Thunk to/from 64 bit when invoking the worker routine.
- ;
- FIXUP FIX_HC_VM_OFF, 1, VM.cpum
- mov edx, 0ffffffffh
-
- push 0
- push cs
- push 0
- FIXUP FIX_HC_32BIT, 1, .vmmR0ToRawModeReturn - NAME(Start)
- push 0ffffffffh
-
- FIXUP FIX_HC_64BIT_CS, 1
- push 0ffffh
- FIXUP FIX_HC_32BIT, 1, NAME(vmmR0ToRawModeAsm) - NAME(Start)
- push 0ffffffffh
- retf
-.vmmR0ToRawModeReturn:
-
- ;
- ; This selector reloading is probably not necessary, but we do it anyway to be quite sure
- ; the CPU has the right idea about the selectors.
- ;
- mov edx, ds
- mov ds, edx
- mov ecx, es
- mov es, ecx
- mov edx, ss
- mov ss, edx
-
- %ifdef VBOX_WITH_VMMR0_DISABLE_LAPIC_NMI
- Missing implementation!
- %endif
-
-
- %ifdef VBOX_WITH_STATISTICS
- ;
- ; Switcher stats.
- ;
- FIXUP FIX_HC_VM_OFF, 1, VM.StatSwitcherToHC
- mov edx, 0ffffffffh
- STAM_PROFILE_ADV_STOP edx
- %endif
-
- ret
-ENDPROC vmmR0ToRawMode
-
-BITS 64
-%endif ;!VBOX_WITH_HYBRID_32BIT_KERNEL
-
-
; *****************************************************************************
; vmmR0ToRawModeAsm
diff --git a/src/VBox/VMM/include/CPUMInternal.h b/src/VBox/VMM/include/CPUMInternal.h
index 8ec19e4..9344621 100644
--- a/src/VBox/VMM/include/CPUMInternal.h
+++ b/src/VBox/VMM/include/CPUMInternal.h
@@ -111,13 +111,6 @@ typedef uint64_t STAMCOUNTER;
#define CPUM_USE_SUPPORTS_LONGMODE RT_BIT(20)
/** @} */
-/* Sanity check. */
-#ifndef VBOX_FOR_DTRACE_LIB
-#if defined(VBOX_WITH_HYBRID_32BIT_KERNEL) && (HC_ARCH_BITS != 32 || R0_ARCH_BITS != 32)
-# error "VBOX_WITH_HYBRID_32BIT_KERNEL is only for 32 bit builds."
-#endif
-#endif
-
/** @name CPUM Saved State Version.
* @{ */
@@ -201,15 +194,12 @@ typedef CPUMINFO const *CPCPUMINFO;
/**
* The saved host CPU state.
- *
- * @remark The special VBOX_WITH_HYBRID_32BIT_KERNEL checks here are for the 10.4.x series
- * of Mac OS X where the OS is essentially 32-bit but the cpu mode can be 64-bit.
*/
typedef struct CPUMHOSTCTX
{
/** General purpose register, selectors, flags and more
* @{ */
-#if HC_ARCH_BITS == 64 || defined(VBOX_WITH_HYBRID_32BIT_KERNEL)
+#if HC_ARCH_BITS == 64
/** General purpose register ++
* { */
/*uint64_t rax; - scratch*/
@@ -263,7 +253,7 @@ typedef struct CPUMHOSTCTX
RTSEL csPadding;
/** @} */
-#if HC_ARCH_BITS == 32 && !defined(VBOX_WITH_HYBRID_32BIT_KERNEL)
+#if HC_ARCH_BITS == 32
/** Control registers.
* @{ */
uint32_t cr0;
@@ -308,7 +298,7 @@ typedef struct CPUMHOSTCTX
/* padding to get 64byte aligned size */
uint8_t auPadding[20];
-#elif HC_ARCH_BITS == 64 || defined(VBOX_WITH_HYBRID_32BIT_KERNEL)
+#elif HC_ARCH_BITS == 64
/** Control registers.
* @{ */
@@ -351,14 +341,10 @@ typedef struct CPUMHOSTCTX
/** @} */
/* padding to get 32byte aligned size */
-# ifdef VBOX_WITH_HYBRID_32BIT_KERNEL
- uint8_t auPadding[52];
-# else
uint8_t auPadding[4];
-# endif
#else
-# error HC_ARCH_BITS not defined
+# error HC_ARCH_BITS not defined or unsupported
#endif
/** Pointer to the FPU/SSE/AVX/XXXX state raw-mode mapping. */
@@ -557,8 +543,6 @@ DECLASM(void) cpumR0SetFCW(uint16_t u16FCW);
DECLASM(uint16_t) cpumR0GetFCW(void);
DECLASM(void) cpumR0SetMXCSR(uint32_t u32MXCSR);
DECLASM(uint32_t) cpumR0GetMXCSR(void);
-DECLASM(void) cpumR0LoadDRx(uint64_t const *pa4Regs);
-DECLASM(void) cpumR0SaveDRx(uint64_t *pa4Regs);
#endif
RT_C_DECLS_END
diff --git a/src/VBox/VMM/include/CPUMInternal.mac b/src/VBox/VMM/include/CPUMInternal.mac
index 62b57e2..e5804ea 100644
--- a/src/VBox/VMM/include/CPUMInternal.mac
+++ b/src/VBox/VMM/include/CPUMInternal.mac
@@ -63,14 +63,6 @@ endstruc
%define CPUM_HANDLER_CTXCORE_IN_EBP RT_BIT(31)
-;; if anyone figures how to do %if HC_ARCH_BITS == 64 || defined(VBOX_WITH_HYBRID_32BIT_KERNEL) in
-; nasm please tell / fix this hack.
-%ifdef VBOX_WITH_HYBRID_32BIT_KERNEL
- %define fVBOX_WITH_HYBRID_32BIT_KERNEL 1
-%else
- %define fVBOX_WITH_HYBRID_32BIT_KERNEL 0
-%endif
-
struc CPUM
;...
.offCPUMCPU0 resd 1
@@ -248,7 +240,7 @@ struc CPUMCPU
;
alignb 64
.Host resb 0
-%if HC_ARCH_BITS == 64 || fVBOX_WITH_HYBRID_32BIT_KERNEL
+%if HC_ARCH_BITS == 64
;.Host.rax resq 1 - scratch
.Host.rbx resq 1
;.Host.rcx resq 1 - scratch
@@ -294,7 +286,7 @@ struc CPUMCPU
.Host.cs resw 1
.Host.csPadding resw 1
-%if HC_ARCH_BITS == 32 && fVBOX_WITH_HYBRID_32BIT_KERNEL == 0
+%if HC_ARCH_BITS == 32
.Host.cr0 resd 1
;.Host.cr2 resd 1 - scratch
.Host.cr3 resd 1
@@ -353,11 +345,7 @@ struc CPUMCPU
.Host.FSbase resq 1
.Host.GSbase resq 1
.Host.efer resq 1
- %if fVBOX_WITH_HYBRID_32BIT_KERNEL
- .Host.auPadding resb 54
- %else
.Host.auPadding resb 4
- %endif
%endif ; 64-bit
.Host.pXStateRC RTRCPTR_RES 1
alignb RTR0PTR_CB
diff --git a/src/VBox/VMM/include/HMInternal.h b/src/VBox/VMM/include/HMInternal.h
index 6a2d631..83fcc33 100644
--- a/src/VBox/VMM/include/HMInternal.h
+++ b/src/VBox/VMM/include/HMInternal.h
@@ -33,12 +33,16 @@
#include <iprt/avl.h>
#include <iprt/string.h>
-#if HC_ARCH_BITS == 64 || defined(VBOX_WITH_HYBRID_32BIT_KERNEL) || defined (VBOX_WITH_64_BITS_GUESTS)
+#if defined(RT_OS_DARWIN) && HC_ARCH_BITS == 32
+# error "32-bit darwin is no longer supported. Go back to 4.3 or earlier!"
+#endif
+
+#if HC_ARCH_BITS == 64 || defined (VBOX_WITH_64_BITS_GUESTS)
/* Enable 64 bits guest support. */
# define VBOX_ENABLE_64_BITS_GUESTS
#endif
-#if HC_ARCH_BITS == 32 && defined(VBOX_ENABLE_64_BITS_GUESTS) && !defined(VBOX_WITH_HYBRID_32BIT_KERNEL)
+#if HC_ARCH_BITS == 32 && defined(VBOX_ENABLE_64_BITS_GUESTS)
# define VMX_USE_CACHED_VMCS_ACCESSES
#endif
@@ -210,9 +214,6 @@ RT_C_DECLS_BEGIN
| HM_CHANGED_GUEST_LAZY_MSRS)
/** @} */
-/** Maximum number of page flushes we are willing to remember before considering a full TLB flush. */
-#define HM_MAX_TLB_SHOOTDOWN_PAGES 8
-
/** Size for the EPT identity page table (1024 4 MB pages to cover the entire address space). */
#define HM_EPT_IDENTITY_PG_TABLE_SIZE PAGE_SIZE
/** Size of the TSS structure + 2 pages for the IO bitmap + end byte. */
@@ -384,7 +385,7 @@ typedef struct HM
uint32_t cbGuestPatchMem;
uint32_t u32Alignment0;
-#if HC_ARCH_BITS == 32 && defined(VBOX_ENABLE_64_BITS_GUESTS) && !defined(VBOX_WITH_HYBRID_32BIT_KERNEL)
+#if HC_ARCH_BITS == 32 && defined(VBOX_ENABLE_64_BITS_GUESTS)
/** 32 to 64 bits switcher entrypoint. */
R0PTRTYPE(PFNHMSWITCHERHC) pfnHost32ToGuest64R0;
RTR0PTR pvR0Alignment0;
@@ -856,14 +857,6 @@ typedef struct HMCPU
* HMR0Enter and cleared in HMR0Leave. */
RTCPUID idEnteredCpu;
- /** To keep track of pending TLB shootdown pages. (SMP guest only) */
- struct
- {
- RTGCPTR aPages[HM_MAX_TLB_SHOOTDOWN_PAGES];
- uint32_t cPages;
- uint32_t u32Alignment0; /**< Explicit alignment padding. */
- } TlbShootdown;
-
/** VT-x/AMD-V VM-exit/#VMXEXIT history, circular array. */
uint16_t auExitHistory[31];
/** The index of the next free slot in the history array. */
@@ -882,7 +875,7 @@ typedef struct HMCPU
STAMPROFILEADV StatLoadGuestState;
STAMPROFILEADV StatInGC;
-#if HC_ARCH_BITS == 32 && defined(VBOX_ENABLE_64_BITS_GUESTS) && !defined(VBOX_WITH_HYBRID_32BIT_KERNEL)
+#if HC_ARCH_BITS == 32 && defined(VBOX_ENABLE_64_BITS_GUESTS)
STAMPROFILEADV StatWorldSwitch3264;
#endif
STAMPROFILEADV StatPoke;
@@ -999,7 +992,7 @@ typedef struct HMCPU
STAMCOUNTER StatVmxCheckBadTr;
STAMCOUNTER StatVmxCheckPmOk;
-#if HC_ARCH_BITS == 32 && defined(VBOX_ENABLE_64_BITS_GUESTS) && !defined(VBOX_WITH_HYBRID_32BIT_KERNEL)
+#if HC_ARCH_BITS == 32 && defined(VBOX_ENABLE_64_BITS_GUESTS)
STAMCOUNTER StatFpu64SwitchBack;
STAMCOUNTER StatDebug64SwitchBack;
#endif
@@ -1039,21 +1032,6 @@ DECLASM(int) HMR0VMXStartVMWrapXMM(RTHCUINT fResume, PCPUMCTX pCtx, PVMCSCACHE p
DECLASM(int) HMR0SVMRunWrapXMM(RTHCPHYS pVmcbHostPhys, RTHCPHYS pVmcbPhys, PCPUMCTX pCtx, PVM pVM, PVMCPU pVCpu, PFNHMSVMVMRUN pfnVMRun);
# endif
-# ifdef VBOX_WITH_HYBRID_32BIT_KERNEL
-/**
- * Gets 64-bit GDTR and IDTR on darwin.
- * @param pGdtr Where to store the 64-bit GDTR.
- * @param pIdtr Where to store the 64-bit IDTR.
- */
-DECLASM(void) HMR0Get64bitGdtrAndIdtr(PX86XDTR64 pGdtr, PX86XDTR64 pIdtr);
-
-/**
- * Gets 64-bit CR3 on darwin.
- * @returns CR3
- */
-DECLASM(uint64_t) HMR0Get64bitCR3(void);
-# endif /* VBOX_WITH_HYBRID_32BIT_KERNEL */
-
#endif /* IN_RING0 */
/** @} */
diff --git a/src/VBox/VMM/include/HMInternal.mac b/src/VBox/VMM/include/HMInternal.mac
index c951174..d2fedaf 100644
--- a/src/VBox/VMM/include/HMInternal.mac
+++ b/src/VBox/VMM/include/HMInternal.mac
@@ -2,6 +2,7 @@
;; @file
; HM - Internal header file.
;
+
;
; Copyright (C) 2006-2015 Oracle Corporation
;
@@ -15,9 +16,7 @@
;
%if HC_ARCH_BITS == 32
- %ifndef VBOX_WITH_HYBRID_32BIT_KERNEL
- %define VMX_USE_CACHED_VMCS_ACCESSES
- %endif
+ %define VMX_USE_CACHED_VMCS_ACCESSES
%endif
;Maximum number of cached entries.
diff --git a/src/VBox/VMM/include/PATMInternal.h b/src/VBox/VMM/include/PATMInternal.h
index 4503672..b3a7a1a 100644
--- a/src/VBox/VMM/include/PATMInternal.h
+++ b/src/VBox/VMM/include/PATMInternal.h
@@ -676,7 +676,7 @@ DECLINLINE(RTRCPTR) PATMResolveBranch(PDISCPUSTATE pCpu, RTRCPTR pBranchInstrGC)
}
#ifdef LOG_ENABLED
-int patmr3DisasmCallback(PVM pVM, DISCPUSTATE *pCpu, RCPTRTYPE(uint8_t *) pInstrGC, RCPTRTYPE(uint8_t *) pCurInstrGC, PPATMP2GLOOKUPREC pCacheRec);
+DECLCALLBACK(int) patmR3DisasmCallback(PVM pVM, DISCPUSTATE *pCpu, RCPTRTYPE(uint8_t *) pInstrGC, RCPTRTYPE(uint8_t *) pCurInstrGC, PPATMP2GLOOKUPREC pCacheRec);
int patmr3DisasmCodeStream(PVM pVM, RCPTRTYPE(uint8_t *) pInstrGC, RCPTRTYPE(uint8_t *) pCurInstrGC, PFN_PATMR3ANALYSE pfnPATMR3Analyse, PPATMP2GLOOKUPREC pCacheRec);
#endif
diff --git a/src/VBox/VMM/include/PDMAsyncCompletionFileInternal.h b/src/VBox/VMM/include/PDMAsyncCompletionFileInternal.h
index a8be234..7ed7680 100644
--- a/src/VBox/VMM/include/PDMAsyncCompletionFileInternal.h
+++ b/src/VBox/VMM/include/PDMAsyncCompletionFileInternal.h
@@ -542,8 +542,6 @@ void pdmacFileTaskFree(PPDMASYNCCOMPLETIONENDPOINTFILE pEndpoint,
int pdmacFileEpAddTask(PPDMASYNCCOMPLETIONENDPOINTFILE pEndpoint, PPDMACTASKFILE pTask);
-void pdmacFileEpTaskCompleted(PPDMACTASKFILE pTask, void *pvUser, int rc);
-
int pdmacFileCacheInit(PPDMASYNCCOMPLETIONEPCLASSFILE pClassFile, PCFGMNODE pCfgNode);
void pdmacFileCacheDestroy(PPDMASYNCCOMPLETIONEPCLASSFILE pClassFile);
int pdmacFileEpCacheInit(PPDMASYNCCOMPLETIONENDPOINTFILE pEndpoint, PPDMASYNCCOMPLETIONEPCLASSFILE pClassFile);
diff --git a/src/VBox/VMM/include/PGMInternal.h b/src/VBox/VMM/include/PGMInternal.h
index 57b5f7e..94c59fe 100644
--- a/src/VBox/VMM/include/PGMInternal.h
+++ b/src/VBox/VMM/include/PGMInternal.h
@@ -67,14 +67,10 @@
* executed from one), while in ring-0 there are none at all. Neither context
* manages the page tables for intermediate switcher context, that's all done in
* ring-3.
- *
- * On 32-bit darwin (hybrid kernel) we do 64-bit guest support differently, so
- * there we can safely work without mappings if we don't compile in raw-mode.
*/
#if defined(IN_RING0) \
|| ( !defined(VBOX_WITH_RAW_MODE) \
&& ( HC_ARCH_BITS != 32 \
- || defined(VBOX_WITH_HYBRID_32BIT_KERNEL) \
|| !defined(VBOX_WITH_64_BITS_GUESTS) \
) \
)
diff --git a/src/VBox/VMM/include/TMInternal.h b/src/VBox/VMM/include/TMInternal.h
index ce0359b..6028f70 100644
--- a/src/VBox/VMM/include/TMInternal.h
+++ b/src/VBox/VMM/include/TMInternal.h
@@ -766,10 +766,11 @@ int tmCpuTickResumeLocked(PVM pVM, PVMCPU pVCpu);
int tmVirtualPauseLocked(PVM pVM);
int tmVirtualResumeLocked(PVM pVM);
-DECLEXPORT(void) tmVirtualNanoTSBadPrev(PRTTIMENANOTSDATA pData, uint64_t u64NanoTS,
- uint64_t u64DeltaPrev, uint64_t u64PrevNanoTS);
-DECLEXPORT(uint64_t) tmVirtualNanoTSRediscover(PRTTIMENANOTSDATA pData);
-DECLEXPORT(uint64_t) tmVirtualNanoTSBadCpuIndex(PRTTIMENANOTSDATA pData, uint16_t idApic, uint16_t iCpuSet, uint16_t iGipCpu);
+DECLCALLBACK(DECLEXPORT(void)) tmVirtualNanoTSBadPrev(PRTTIMENANOTSDATA pData, uint64_t u64NanoTS,
+ uint64_t u64DeltaPrev, uint64_t u64PrevNanoTS);
+DECLCALLBACK(DECLEXPORT(uint64_t)) tmVirtualNanoTSRediscover(PRTTIMENANOTSDATA pData);
+DECLCALLBACK(DECLEXPORT(uint64_t)) tmVirtualNanoTSBadCpuIndex(PRTTIMENANOTSDATA pData, uint16_t idApic,
+ uint16_t iCpuSet, uint16_t iGipCpu);
#ifdef IN_RING3
static const char * tmR3GetTSCModeNameEx(TMTSCMODE enmMode);
diff --git a/src/VBox/VMM/include/VMMInternal.h b/src/VBox/VMM/include/VMMInternal.h
index 1377757..45abd3b 100644
--- a/src/VBox/VMM/include/VMMInternal.h
+++ b/src/VBox/VMM/include/VMMInternal.h
@@ -28,6 +28,10 @@
#if !defined(IN_VMM_R3) && !defined(IN_VMM_R0) && !defined(IN_VMM_RC)
# error "Not in VMM! This is an internal header!"
#endif
+#if defined(RT_OS_DARWIN) && HC_ARCH_BITS == 32
+# error "32-bit darwin is no longer supported. Go back to 4.3 or earlier!"
+#endif
+
/** @defgroup grp_vmm_int Internals
diff --git a/src/VBox/VMM/testcase/Instructions/tstVBInsTstR3.cpp b/src/VBox/VMM/testcase/Instructions/tstVBInsTstR3.cpp
index 4573c63..55aa4bb 100644
--- a/src/VBox/VMM/testcase/Instructions/tstVBInsTstR3.cpp
+++ b/src/VBox/VMM/testcase/Instructions/tstVBInsTstR3.cpp
@@ -16,9 +16,9 @@
*/
-/*******************************************************************************
-* Header Files *
-*******************************************************************************/
+/*********************************************************************************************************************************
+* Header Files *
+*********************************************************************************************************************************/
#include <iprt/mem.h>
#include <iprt/string.h>
#include <iprt/test.h>
@@ -32,9 +32,9 @@
#endif
-/*******************************************************************************
-* Structures and Typedefs *
-*******************************************************************************/
+/*********************************************************************************************************************************
+* Structures and Typedefs *
+*********************************************************************************************************************************/
#if HC_ARCH_BITS == 64
typedef uint64_t VBINSTSTREG;
#else
@@ -42,9 +42,9 @@ typedef uint32_t VBINSTSTREG;
#endif
-/*******************************************************************************
-* Global Variables *
-*******************************************************************************/
+/*********************************************************************************************************************************
+* Global Variables *
+*********************************************************************************************************************************/
RTTEST g_hTest;
diff --git a/src/VBox/VMM/testcase/Makefile.kmk b/src/VBox/VMM/testcase/Makefile.kmk
index 2b7e48b..170a1e9 100644
--- a/src/VBox/VMM/testcase/Makefile.kmk
+++ b/src/VBox/VMM/testcase/Makefile.kmk
@@ -145,11 +145,6 @@ VBOX_PATH_VMM_SRC = $(PATH_ROOT)/src/VBox/VMM
ifdef VBOX_WITH_RAW_MODE
tstVMStructRC_TEMPLATE = VBoxRcExe
tstVMStructRC_DEFS = IN_VMM_RC IN_DIS IN_RT_RC VBOX_WITH_RAW_MODE
- ifeq ($(KBUILD_TARGET).$(KBUILD_TARGET_ARCH),darwin.x86)
- tstVMStructRC_DEFS += \
- VBOX_WITH_2X_4GB_ADDR_SPACE VBOX_WITH_2X_4GB_ADDR_SPACE_IN_RC \
- VBOX_WITH_HYBRID_32BIT_KERNEL VBOX_WITH_HYBRID_32BIT_KERNEL_IN_RC
- endif
ifdef VBOX_WITH_R0_LOGGING
tstVMStructRC_DEFS += VBOX_WITH_R0_LOGGING
endif
@@ -164,11 +159,6 @@ endif
tstVMStructSize_TEMPLATE= VBOXR3AUTOTST
tstVMStructSize_DEFS = IN_VMM_R3 IN_DIS
-ifeq ($(KBUILD_TARGET).$(KBUILD_TARGET_ARCH),darwin.x86)
- tstVMStructSize_DEFS += \
- VBOX_WITH_2X_4GB_ADDR_SPACE VBOX_WITH_2X_4GB_ADDR_SPACE_IN_R3 \
- VBOX_WITH_HYBRID_32BIT_KERNEL VBOX_WITH_HYBRID_32BIT_KERNEL_IN_R3
-endif
ifdef VBOX_WITH_RAW_MODE
tstVMStructSize_DEFS += VBOX_WITH_RAW_MODE
endif
@@ -477,11 +467,6 @@ if !defined(VBOX_ONLY_EXTPACKS) \
|| defined(VBOX_WITH_DTRACE_RC))
tstVMStructDTrace_TEMPLATE= VBOXR3AUTOTST
tstVMStructDTrace_DEFS = IN_VMM_R3 IN_DIS
- ifeq ($(KBUILD_TARGET).$(KBUILD_TARGET_ARCH),darwin.x86)
- tstVMStructDTrace_DEFS += \
- VBOX_WITH_2X_4GB_ADDR_SPACE VBOX_WITH_2X_4GB_ADDR_SPACE_IN_R3 \
- VBOX_WITH_HYBRID_32BIT_KERNEL VBOX_WITH_HYBRID_32BIT_KERNEL_IN_R3
- endif
ifdef VBOX_WITH_RAW_MODE
tstVMStructDTrace_DEFS += VBOX_WITH_RAW_MODE
endif
diff --git a/src/VBox/VMM/testcase/tstAnimate.cpp b/src/VBox/VMM/testcase/tstAnimate.cpp
index f1519c2..ebc4c90 100644
--- a/src/VBox/VMM/testcase/tstAnimate.cpp
+++ b/src/VBox/VMM/testcase/tstAnimate.cpp
@@ -16,9 +16,9 @@
*/
-/*******************************************************************************
-* Header Files *
-*******************************************************************************/
+/*********************************************************************************************************************************
+* Header Files *
+*********************************************************************************************************************************/
#include <VBox/vmm/vm.h>
#include <VBox/vmm/vmm.h>
#include <VBox/vmm/cpum.h>
@@ -47,9 +47,10 @@
#include <signal.h>
-/*******************************************************************************
-* Global Variables *
-*******************************************************************************/
+
+/*********************************************************************************************************************************
+* Global Variables *
+*********************************************************************************************************************************/
static volatile bool g_fSignaled = false;
diff --git a/src/VBox/VMM/testcase/tstAsmStructs.cpp b/src/VBox/VMM/testcase/tstAsmStructs.cpp
index f5862b6..61b6172 100644
--- a/src/VBox/VMM/testcase/tstAsmStructs.cpp
+++ b/src/VBox/VMM/testcase/tstAsmStructs.cpp
@@ -15,9 +15,10 @@
* hope that it will be useful, but WITHOUT ANY WARRANTY of any kind.
*/
-/*******************************************************************************
-* Header Files *
-*******************************************************************************/
+
+/*********************************************************************************************************************************
+* Header Files *
+*********************************************************************************************************************************/
#include <VBox/vmm/cpum.h>
#include "CPUMInternal.h"
#include <VBox/vmm/trpm.h>
diff --git a/src/VBox/VMM/testcase/tstCFGM.cpp b/src/VBox/VMM/testcase/tstCFGM.cpp
index f0d3668..7f23042 100644
--- a/src/VBox/VMM/testcase/tstCFGM.cpp
+++ b/src/VBox/VMM/testcase/tstCFGM.cpp
@@ -17,9 +17,9 @@
-/*******************************************************************************
-* Header Files *
-*******************************************************************************/
+/*********************************************************************************************************************************
+* Header Files *
+*********************************************************************************************************************************/
#include <VBox/sup.h>
#include <VBox/vmm/cfgm.h>
#include <VBox/vmm/mm.h>
diff --git a/src/VBox/VMM/testcase/tstCompressionBenchmark.cpp b/src/VBox/VMM/testcase/tstCompressionBenchmark.cpp
index d05de89..25dbe20 100644
--- a/src/VBox/VMM/testcase/tstCompressionBenchmark.cpp
+++ b/src/VBox/VMM/testcase/tstCompressionBenchmark.cpp
@@ -16,9 +16,9 @@
*/
-/*******************************************************************************
-* Header Files *
-*******************************************************************************/
+/*********************************************************************************************************************************
+* Header Files *
+*********************************************************************************************************************************/
#include <iprt/asm.h>
#include <iprt/assert.h>
#include <iprt/buildconfig.h>
@@ -38,9 +38,9 @@
#include <iprt/zip.h>
-/*******************************************************************************
-* Global Variables *
-*******************************************************************************/
+/*********************************************************************************************************************************
+* Global Variables *
+*********************************************************************************************************************************/
static size_t g_cPages = 20*_1M / PAGE_SIZE;
static size_t g_cbPages;
static uint8_t *g_pabSrc;
diff --git a/src/VBox/VMM/testcase/tstGlobalConfig.cpp b/src/VBox/VMM/testcase/tstGlobalConfig.cpp
index 4b627ed..f8c1945 100644
--- a/src/VBox/VMM/testcase/tstGlobalConfig.cpp
+++ b/src/VBox/VMM/testcase/tstGlobalConfig.cpp
@@ -16,9 +16,9 @@
*/
-/*******************************************************************************
-* Header Files *
-*******************************************************************************/
+/*********************************************************************************************************************************
+* Header Files *
+*********************************************************************************************************************************/
#include <VBox/vmm/vmm.h>
#include <VBox/err.h>
#include <iprt/assert.h>
diff --git a/src/VBox/VMM/testcase/tstIEMCheckMc.cpp b/src/VBox/VMM/testcase/tstIEMCheckMc.cpp
index 8e1a3a5..6a69679 100644
--- a/src/VBox/VMM/testcase/tstIEMCheckMc.cpp
+++ b/src/VBox/VMM/testcase/tstIEMCheckMc.cpp
@@ -15,9 +15,10 @@
* hope that it will be useful, but WITHOUT ANY WARRANTY of any kind.
*/
-/*******************************************************************************
-* Header Files *
-*******************************************************************************/
+
+/*********************************************************************************************************************************
+* Header Files *
+*********************************************************************************************************************************/
#include <iprt/assert.h>
#include <iprt/rand.h>
#include <iprt/test.h>
@@ -28,9 +29,9 @@
#include "../include/IEMInternal.h"
-/*******************************************************************************
-* Global Variables *
-*******************************************************************************/
+/*********************************************************************************************************************************
+* Global Variables *
+*********************************************************************************************************************************/
bool volatile g_fRandom;
uint8_t volatile g_bRandom;
uint128_t g_u128Zero;
@@ -73,11 +74,11 @@ uint128_t g_u128Zero;
typedef VBOXSTRICTRC (* PFNIEMOP)(PIEMCPU pIemCpu);
#define FNIEMOP_DEF(a_Name) \
- static VBOXSTRICTRC a_Name(PIEMCPU pIemCpu) RT_NO_THROW
+ static VBOXSTRICTRC a_Name(PIEMCPU pIemCpu) RT_NO_THROW_DEF
#define FNIEMOP_DEF_1(a_Name, a_Type0, a_Name0) \
- static VBOXSTRICTRC a_Name(PIEMCPU pIemCpu, a_Type0 a_Name0) RT_NO_THROW
+ static VBOXSTRICTRC a_Name(PIEMCPU pIemCpu, a_Type0 a_Name0) RT_NO_THROW_DEF
#define FNIEMOP_DEF_2(a_Name, a_Type0, a_Name0, a_Type1, a_Name1) \
- static VBOXSTRICTRC a_Name(PIEMCPU pIemCpu, a_Type0 a_Name0, a_Type1 a_Name1) RT_NO_THROW
+ static VBOXSTRICTRC a_Name(PIEMCPU pIemCpu, a_Type0 a_Name0, a_Type1 a_Name1) RT_NO_THROW_DEF
#define IEM_NOT_REACHED_DEFAULT_CASE_RET() default: return VERR_IPE_NOT_REACHED_DEFAULT_CASE
#define IEM_RETURN_ASPECT_NOT_IMPLEMENTED() return IEM_RETURN_ASPECT_NOT_IMPLEMENTED
diff --git a/src/VBox/VMM/testcase/tstInstrEmul.cpp b/src/VBox/VMM/testcase/tstInstrEmul.cpp
index 27116a1..f19f2b0 100644
--- a/src/VBox/VMM/testcase/tstInstrEmul.cpp
+++ b/src/VBox/VMM/testcase/tstInstrEmul.cpp
@@ -15,9 +15,10 @@
* hope that it will be useful, but WITHOUT ANY WARRANTY of any kind.
*/
-/*******************************************************************************
-* Header Files *
-*******************************************************************************/
+
+/*********************************************************************************************************************************
+* Header Files *
+*********************************************************************************************************************************/
#include <stdio.h>
#include <VBox/vmm/vm.h>
#include <VBox/err.h>
diff --git a/src/VBox/VMM/testcase/tstMMHyperHeap.cpp b/src/VBox/VMM/testcase/tstMMHyperHeap.cpp
index 9568dc5..874300d 100644
--- a/src/VBox/VMM/testcase/tstMMHyperHeap.cpp
+++ b/src/VBox/VMM/testcase/tstMMHyperHeap.cpp
@@ -15,9 +15,10 @@
* hope that it will be useful, but WITHOUT ANY WARRANTY of any kind.
*/
-/*******************************************************************************
-* Header Files *
-*******************************************************************************/
+
+/*********************************************************************************************************************************
+* Header Files *
+*********************************************************************************************************************************/
#include <VBox/vmm/mm.h>
#include <VBox/vmm/stam.h>
#include <VBox/vmm/vm.h>
diff --git a/src/VBox/VMM/testcase/tstMicro.cpp b/src/VBox/VMM/testcase/tstMicro.cpp
index d6bf925..31f2d0b 100644
--- a/src/VBox/VMM/testcase/tstMicro.cpp
+++ b/src/VBox/VMM/testcase/tstMicro.cpp
@@ -15,9 +15,10 @@
* hope that it will be useful, but WITHOUT ANY WARRANTY of any kind.
*/
-/*******************************************************************************
-* Header Files *
-*******************************************************************************/
+
+/*********************************************************************************************************************************
+* Header Files *
+*********************************************************************************************************************************/
#include <VBox/vmm/vm.h>
#include <VBox/vmm/vmm.h>
#include <VBox/vmm/mm.h>
@@ -38,9 +39,9 @@
#include "tstMicro.h"
-/*******************************************************************************
-* Defined Constants And Macros *
-*******************************************************************************/
+/*********************************************************************************************************************************
+* Defined Constants And Macros *
+*********************************************************************************************************************************/
#define TESTCASE "tstVMM"
static const char *GetDescription(TSTMICROTEST enmTest)
diff --git a/src/VBox/VMM/testcase/tstMicroRC.cpp b/src/VBox/VMM/testcase/tstMicroRC.cpp
index 5c65d2a..4dfbd49 100644
--- a/src/VBox/VMM/testcase/tstMicroRC.cpp
+++ b/src/VBox/VMM/testcase/tstMicroRC.cpp
@@ -15,9 +15,10 @@
* hope that it will be useful, but WITHOUT ANY WARRANTY of any kind.
*/
-/*******************************************************************************
-* Header Files *
-*******************************************************************************/
+
+/*********************************************************************************************************************************
+* Header Files *
+*********************************************************************************************************************************/
#include <VBox/vmm/vm.h>
#include <VBox/vmm/vmm.h>
#include <VBox/vmm/selm.h>
@@ -30,9 +31,9 @@
#include <iprt/string.h>
-/*******************************************************************************
-* Internal Functions *
-*******************************************************************************/
+/*********************************************************************************************************************************
+* Internal Functions *
+*********************************************************************************************************************************/
RT_C_DECLS_BEGIN
DECLEXPORT(int) tstMicroRC(PTSTMICRO pTst, unsigned uTestcase);
RT_C_DECLS_END
diff --git a/src/VBox/VMM/testcase/tstPDMAsyncCompletion.cpp b/src/VBox/VMM/testcase/tstPDMAsyncCompletion.cpp
index 9ace5a1..b064dc0 100644
--- a/src/VBox/VMM/testcase/tstPDMAsyncCompletion.cpp
+++ b/src/VBox/VMM/testcase/tstPDMAsyncCompletion.cpp
@@ -20,9 +20,10 @@
* hope that it will be useful, but WITHOUT ANY WARRANTY of any kind.
*/
-/*******************************************************************************
-* Header Files *
-*******************************************************************************/
+
+/*********************************************************************************************************************************
+* Header Files *
+*********************************************************************************************************************************/
#define LOG_GROUP LOG_GROUP_PDM_ASYNC_COMPLETION
#include "VMInternal.h" /* UVM */
@@ -58,7 +59,7 @@ PPDMASYNCCOMPLETIONTASK g_AsyncCompletionTasks[NR_TASKS];
volatile uint32_t g_cTasksLeft;
RTSEMEVENT g_FinishedEventSem;
-void pfnAsyncTaskCompleted(PVM pVM, void *pvUser, void *pvUser2, int rc)
+static DECLCALLBACK(void) AsyncTaskCompleted(PVM pVM, void *pvUser, void *pvUser2, int rc)
{
LogFlow((TESTCASE ": %s: pVM=%p pvUser=%p pvUser2=%p\n", __FUNCTION__, pVM, pvUser, pvUser2));
NOREF(rc);
@@ -104,7 +105,7 @@ extern "C" DECLEXPORT(int) TrustedMain(int argc, char **argv, char **envp)
* Create the template.
*/
PPDMASYNCCOMPLETIONTEMPLATE pTemplate;
- rc = PDMR3AsyncCompletionTemplateCreateInternal(pVM, &pTemplate, pfnAsyncTaskCompleted, NULL, "Test");
+ rc = PDMR3AsyncCompletionTemplateCreateInternal(pVM, &pTemplate, AsyncTaskCompleted, NULL, "Test");
if (RT_FAILURE(rc))
{
RTPrintf(TESTCASE ": Error while creating the template!! rc=%d\n", rc);
diff --git a/src/VBox/VMM/testcase/tstPDMAsyncCompletionStress.cpp b/src/VBox/VMM/testcase/tstPDMAsyncCompletionStress.cpp
index f2e23aa..f90880a 100644
--- a/src/VBox/VMM/testcase/tstPDMAsyncCompletionStress.cpp
+++ b/src/VBox/VMM/testcase/tstPDMAsyncCompletionStress.cpp
@@ -17,9 +17,10 @@
* hope that it will be useful, but WITHOUT ANY WARRANTY of any kind.
*/
-/*******************************************************************************
-* Header Files *
-*******************************************************************************/
+
+/*********************************************************************************************************************************
+* Header Files *
+*********************************************************************************************************************************/
#define LOG_GROUP LOG_GROUP_PDM_ASYNC_COMPLETION
#include "VMInternal.h" /* UVM */
@@ -155,7 +156,7 @@ size_t g_cbTestPattern;
/** Array holding test files. */
PDMACTESTFILE g_aTestFiles[NR_OPEN_ENDPOINTS];
-static void tstPDMACStressTestFileTaskCompleted(PVM pVM, void *pvUser, void *pvUser2, int rcReq);
+static DECLCALLBACK(void) tstPDMACStressTestFileTaskCompleted(PVM pVM, void *pvUser, void *pvUser2, int rcReq);
static void tstPDMACStressTestFileVerify(PPDMACTESTFILE pTestFile, PPDMACTESTFILETASK pTestTask)
{
@@ -326,7 +327,7 @@ static bool tstPDMACTestIsTrue(int iPercentage)
return (uRnd <= iPercentage); /* This should be enough for our purpose */
}
-static int tstPDMACTestFileThread(PVM pVM, PPDMTHREAD pThread)
+static DECLCALLBACK(int) tstPDMACTestFileThread(PVM pVM, PPDMTHREAD pThread)
{
PPDMACTESTFILE pTestFile = (PPDMACTESTFILE)pThread->pvUser;
int iWriteChance = 100; /* Chance to get a write task in percent. */
@@ -387,7 +388,7 @@ static int tstPDMACTestFileThread(PVM pVM, PPDMTHREAD pThread)
return rc;
}
-static void tstPDMACStressTestFileTaskCompleted(PVM pVM, void *pvUser, void *pvUser2, int rcReq)
+static DECLCALLBACK(void) tstPDMACStressTestFileTaskCompleted(PVM pVM, void *pvUser, void *pvUser2, int rcReq)
{
PPDMACTESTFILE pTestFile = (PPDMACTESTFILE)pvUser2;
PPDMACTESTFILETASK pTestTask = (PPDMACTESTFILETASK)pvUser;
@@ -457,7 +458,8 @@ static int tstPDMACStressTestFileOpen(PVM pVM, PPDMACTESTFILE pTestFile, unsigne
char szDesc[256];
RTStrPrintf(szDesc, sizeof(szDesc), "Template-%d", iTestId);
- rc = PDMR3AsyncCompletionTemplateCreateInternal(pVM, &pTestFile->pTemplate, tstPDMACStressTestFileTaskCompleted, pTestFile, szDesc);
+ rc = PDMR3AsyncCompletionTemplateCreateInternal(pVM, &pTestFile->pTemplate, tstPDMACStressTestFileTaskCompleted,
+ pTestFile, szDesc);
if (RT_SUCCESS(rc))
{
/* Open the endpoint now. Because async completion endpoints cannot create files we have to do it before. */
diff --git a/src/VBox/VMM/testcase/tstSSM-2.cpp b/src/VBox/VMM/testcase/tstSSM-2.cpp
index adca3db..33fbe2c 100644
--- a/src/VBox/VMM/testcase/tstSSM-2.cpp
+++ b/src/VBox/VMM/testcase/tstSSM-2.cpp
@@ -16,9 +16,9 @@
*/
-/*******************************************************************************
-* Header Files *
-*******************************************************************************/
+/*********************************************************************************************************************************
+* Header Files *
+*********************************************************************************************************************************/
#include <VBox/vmm/ssm.h>
#include <VBox/log.h>
diff --git a/src/VBox/VMM/testcase/tstSSM.cpp b/src/VBox/VMM/testcase/tstSSM.cpp
index 8adc853..99ce887 100644
--- a/src/VBox/VMM/testcase/tstSSM.cpp
+++ b/src/VBox/VMM/testcase/tstSSM.cpp
@@ -16,9 +16,9 @@
*/
-/*******************************************************************************
-* Header Files *
-*******************************************************************************/
+/*********************************************************************************************************************************
+* Header Files *
+*********************************************************************************************************************************/
#include <VBox/vmm/ssm.h>
#include "VMInternal.h" /* createFakeVM */
#include <VBox/vmm/vm.h>
@@ -41,9 +41,9 @@
#include <iprt/path.h>
-/*******************************************************************************
-* Defined Constants And Macros *
-*******************************************************************************/
+/*********************************************************************************************************************************
+* Defined Constants And Macros *
+*********************************************************************************************************************************/
#define TSTSSM_BIG_CONFIG 1
#ifdef TSTSSM_BIG_CONFIG
@@ -53,9 +53,9 @@
#endif
-/*******************************************************************************
-* Global Variables *
-*******************************************************************************/
+/*********************************************************************************************************************************
+* Global Variables *
+*********************************************************************************************************************************/
const uint8_t gabPage[PAGE_SIZE] = {0};
const char gachMem1[] = "sdfg\1asdfa\177hjkl;sdfghjkl;dfghjkl;dfghjkl;\0\0asdf;kjasdf;lkjasd;flkjasd;lfkjasd\0;lfk";
#ifdef TSTSSM_BIG_CONFIG
diff --git a/src/VBox/VMM/testcase/tstVMM-HM.cpp b/src/VBox/VMM/testcase/tstVMM-HM.cpp
index 8b1e391..50fe559 100644
--- a/src/VBox/VMM/testcase/tstVMM-HM.cpp
+++ b/src/VBox/VMM/testcase/tstVMM-HM.cpp
@@ -16,9 +16,9 @@
*/
-/*******************************************************************************
-* Header Files *
-*******************************************************************************/
+/*********************************************************************************************************************************
+* Header Files *
+*********************************************************************************************************************************/
#include <VBox/vmm/vm.h>
#include <VBox/vmm/vmm.h>
#include <VBox/vmm/cpum.h>
@@ -30,9 +30,9 @@
#include <iprt/stream.h>
-/*******************************************************************************
-* Defined Constants And Macros *
-*******************************************************************************/
+/*********************************************************************************************************************************
+* Defined Constants And Macros *
+*********************************************************************************************************************************/
#define TESTCASE "tstVMM-Hm"
VMMR3DECL(int) VMMDoHmTest(PVM pVM);
diff --git a/src/VBox/VMM/testcase/tstVMM.cpp b/src/VBox/VMM/testcase/tstVMM.cpp
index f3ed507..dc1b671 100644
--- a/src/VBox/VMM/testcase/tstVMM.cpp
+++ b/src/VBox/VMM/testcase/tstVMM.cpp
@@ -16,9 +16,9 @@
*/
-/*******************************************************************************
-* Header Files *
-*******************************************************************************/
+/*********************************************************************************************************************************
+* Header Files *
+*********************************************************************************************************************************/
#include <VBox/vmm/vm.h>
#include <VBox/vmm/vmm.h>
#include <VBox/vmm/cpum.h>
@@ -38,22 +38,22 @@
#include <iprt/thread.h>
-/*******************************************************************************
-* Defined Constants And Macros *
-*******************************************************************************/
+/*********************************************************************************************************************************
+* Defined Constants And Macros *
+*********************************************************************************************************************************/
#define TESTCASE "tstVMM"
-/*******************************************************************************
-* Global Variables *
-*******************************************************************************/
+/*********************************************************************************************************************************
+* Global Variables *
+*********************************************************************************************************************************/
static uint32_t g_cCpus = 1;
-/*******************************************************************************
-* Internal Functions *
-*******************************************************************************/
+/*********************************************************************************************************************************
+* Internal Functions *
+*********************************************************************************************************************************/
VMMR3DECL(int) VMMDoTest(PVM pVM); /* Linked into VMM, see ../VMMTests.cpp. */
VMMR3DECL(int) VMMDoBruteForceMsrs(PVM pVM); /* Ditto. */
VMMR3DECL(int) VMMDoKnownMsrs(PVM pVM); /* Ditto. */
@@ -253,7 +253,7 @@ extern "C" DECLEXPORT(int) TrustedMain(int argc, char **argv, char **envp)
return 1;
case 'V':
- RTPrintf("$Revision: 100868 $\n");
+ RTPrintf("$Revision: 102121 $\n");
return 0;
default:
diff --git a/src/VBox/VMM/testcase/tstVMMFork.cpp b/src/VBox/VMM/testcase/tstVMMFork.cpp
index 071c28c..516c7b2 100644
--- a/src/VBox/VMM/testcase/tstVMMFork.cpp
+++ b/src/VBox/VMM/testcase/tstVMMFork.cpp
@@ -16,9 +16,9 @@
*/
-/*******************************************************************************
-* Header Files *
-*******************************************************************************/
+/*********************************************************************************************************************************
+* Header Files *
+*********************************************************************************************************************************/
#include <VBox/vmm/vm.h>
#include <VBox/vmm/vmm.h>
#include <VBox/err.h>
@@ -32,9 +32,9 @@
#include <unistd.h>
-/*******************************************************************************
-* Defined Constants And Macros *
-*******************************************************************************/
+/*********************************************************************************************************************************
+* Defined Constants And Macros *
+*********************************************************************************************************************************/
#define TESTCASE "tstVMMFork"
#define AUTO_TEST_ARGS 1
diff --git a/src/VBox/VMM/testcase/tstVMMR0CallHost-1.cpp b/src/VBox/VMM/testcase/tstVMMR0CallHost-1.cpp
index 1ee8453..a43ba26 100644
--- a/src/VBox/VMM/testcase/tstVMMR0CallHost-1.cpp
+++ b/src/VBox/VMM/testcase/tstVMMR0CallHost-1.cpp
@@ -15,9 +15,10 @@
* hope that it will be useful, but WITHOUT ANY WARRANTY of any kind.
*/
-/*******************************************************************************
-* Header Files *
-*******************************************************************************/
+
+/*********************************************************************************************************************************
+* Header Files *
+*********************************************************************************************************************************/
#include <VBox/err.h>
#include <VBox/param.h>
#include <iprt/alloca.h>
@@ -32,17 +33,17 @@
#include "VMMInternal.h"
-/*******************************************************************************
-* Defined Constants And Macros *
-*******************************************************************************/
+/*********************************************************************************************************************************
+* Defined Constants And Macros *
+*********************************************************************************************************************************/
#if !defined(VMM_R0_SWITCH_STACK) && !defined(VMM_R0_NO_SWITCH_STACK)
# error "VMM_R0_SWITCH_STACK or VMM_R0_NO_SWITCH_STACK has to be defined."
#endif
-/*******************************************************************************
-* Global Variables *
-*******************************************************************************/
+/*********************************************************************************************************************************
+* Global Variables *
+*********************************************************************************************************************************/
/** The jump buffer. */
static VMMR0JMPBUF g_Jmp;
/** The number of jumps we've done. */
diff --git a/src/VBox/VMM/testcase/tstVMREQ.cpp b/src/VBox/VMM/testcase/tstVMREQ.cpp
index 4a1d24f..53a50ed 100644
--- a/src/VBox/VMM/testcase/tstVMREQ.cpp
+++ b/src/VBox/VMM/testcase/tstVMREQ.cpp
@@ -16,9 +16,9 @@
*/
-/*******************************************************************************
-* Header Files *
-*******************************************************************************/
+/*********************************************************************************************************************************
+* Header Files *
+*********************************************************************************************************************************/
#include <VBox/vmm/vm.h>
#include <VBox/vmm/vmm.h>
#include <VBox/vmm/cpum.h>
@@ -33,14 +33,15 @@
#include <iprt/time.h>
-/*******************************************************************************
-* Defined Constants And Macros *
-*******************************************************************************/
+/*********************************************************************************************************************************
+* Defined Constants And Macros *
+*********************************************************************************************************************************/
#define TESTCASE "tstVMREQ"
-/*******************************************************************************
-* Global Variables *
-*******************************************************************************/
+
+/*********************************************************************************************************************************
+* Global Variables *
+*********************************************************************************************************************************/
/** the error count. */
static int g_cErrors = 0;
diff --git a/src/VBox/VMM/testcase/tstVMStruct.h b/src/VBox/VMM/testcase/tstVMStruct.h
index 27c38a3..764bf6f 100644
--- a/src/VBox/VMM/testcase/tstVMStruct.h
+++ b/src/VBox/VMM/testcase/tstVMStruct.h
@@ -62,7 +62,7 @@
GEN_CHECK_OFF(CPUMHOSTCTX, pXStateR3);
GEN_CHECK_OFF(CPUMHOSTCTX, pXStateR0);
GEN_CHECK_OFF(CPUMHOSTCTX, pXStateRC);
-#if HC_ARCH_BITS == 64 || defined(VBOX_WITH_HYBRID_32BIT_KERNEL)
+#if HC_ARCH_BITS == 64
GEN_CHECK_OFF(CPUMHOSTCTX, rbx);
GEN_CHECK_OFF(CPUMHOSTCTX, rdi);
GEN_CHECK_OFF(CPUMHOSTCTX, rsi);
@@ -90,7 +90,7 @@
GEN_CHECK_OFF(CPUMHOSTCTX, es);
GEN_CHECK_OFF(CPUMHOSTCTX, ds);
GEN_CHECK_OFF(CPUMHOSTCTX, cs);
-#if HC_ARCH_BITS == 32 && !defined(VBOX_WITH_HYBRID_32BIT_KERNEL)
+#if HC_ARCH_BITS == 32
GEN_CHECK_OFF(CPUMHOSTCTX, cr0);
GEN_CHECK_OFF(CPUMHOSTCTX, cr3);
GEN_CHECK_OFF(CPUMHOSTCTX, cr4);
@@ -106,7 +106,7 @@
GEN_CHECK_OFF(CPUMHOSTCTX, tr);
GEN_CHECK_OFF(CPUMHOSTCTX, SysEnter);
GEN_CHECK_OFF(CPUMHOSTCTX, efer);
-#elif HC_ARCH_BITS == 64 || defined(VBOX_WITH_HYBRID_32BIT_KERNEL)
+#elif HC_ARCH_BITS == 64
GEN_CHECK_OFF(CPUMHOSTCTX, cr0);
GEN_CHECK_OFF(CPUMHOSTCTX, cr3);
GEN_CHECK_OFF(CPUMHOSTCTX, cr4);
diff --git a/src/VBox/VMM/testcase/tstVMStructDTrace.cpp b/src/VBox/VMM/testcase/tstVMStructDTrace.cpp
index 880abd8..658a7fd 100644
--- a/src/VBox/VMM/testcase/tstVMStructDTrace.cpp
+++ b/src/VBox/VMM/testcase/tstVMStructDTrace.cpp
@@ -18,9 +18,9 @@
*/
-/*******************************************************************************
-* Header Files *
-*******************************************************************************/
+/*********************************************************************************************************************************
+* Header Files *
+*********************************************************************************************************************************/
#define IN_TSTVMSTRUCTGC 1
#include <VBox/vmm/cfgm.h>
#include <VBox/vmm/cpum.h>
diff --git a/src/VBox/VMM/testcase/tstVMStructRC.cpp b/src/VBox/VMM/testcase/tstVMStructRC.cpp
index 8bbf983..4e9fedb 100644
--- a/src/VBox/VMM/testcase/tstVMStructRC.cpp
+++ b/src/VBox/VMM/testcase/tstVMStructRC.cpp
@@ -46,9 +46,9 @@ AssertCompileSize(RTGCPHYS, 8);
AssertCompileSize(RTHCPHYS, 8);
-/*******************************************************************************
-* Header Files *
-*******************************************************************************/
+/*********************************************************************************************************************************
+* Header Files *
+*********************************************************************************************************************************/
#define IN_TSTVMSTRUCTGC 1
#include <VBox/vmm/cfgm.h>
#include <VBox/vmm/cpum.h>
diff --git a/src/VBox/VMM/testcase/tstVMStructSize.cpp b/src/VBox/VMM/testcase/tstVMStructSize.cpp
index 9d34af1..529d37b 100644
--- a/src/VBox/VMM/testcase/tstVMStructSize.cpp
+++ b/src/VBox/VMM/testcase/tstVMStructSize.cpp
@@ -17,9 +17,10 @@
* hope that it will be useful, but WITHOUT ANY WARRANTY of any kind.
*/
-/*******************************************************************************
-* Header Files *
-*******************************************************************************/
+
+/*********************************************************************************************************************************
+* Header Files *
+*********************************************************************************************************************************/
#include <VBox/vmm/cfgm.h>
#include <VBox/vmm/cpum.h>
#include <VBox/vmm/mm.h>
diff --git a/src/VBox/VMM/testcase/tstX86-1.cpp b/src/VBox/VMM/testcase/tstX86-1.cpp
index 6bde70f..29b1f24 100644
--- a/src/VBox/VMM/testcase/tstX86-1.cpp
+++ b/src/VBox/VMM/testcase/tstX86-1.cpp
@@ -16,9 +16,9 @@
*/
-/*******************************************************************************
-* Header Files *
-*******************************************************************************/
+/*********************************************************************************************************************************
+* Header Files *
+*********************************************************************************************************************************/
#include <iprt/test.h>
#include <iprt/param.h>
#include <iprt/mem.h>
@@ -38,9 +38,9 @@
#endif
-/*******************************************************************************
-* Structures and Typedefs *
-*******************************************************************************/
+/*********************************************************************************************************************************
+* Structures and Typedefs *
+*********************************************************************************************************************************/
typedef struct TRAPINFO
{
uintptr_t uTrapPC;
@@ -52,9 +52,9 @@ typedef struct TRAPINFO
typedef TRAPINFO const *PCTRAPINFO;
-/*******************************************************************************
-* Global Variables *
-*******************************************************************************/
+/*********************************************************************************************************************************
+* Global Variables *
+*********************************************************************************************************************************/
RT_C_DECLS_BEGIN
uint8_t *g_pbEfPage = NULL;
uint8_t *g_pbEfExecPage = NULL;
@@ -62,9 +62,9 @@ extern TRAPINFO g_aTrapInfo[];
RT_C_DECLS_END
-/*******************************************************************************
-* Internal Functions *
-*******************************************************************************/
+/*********************************************************************************************************************************
+* Internal Functions *
+*********************************************************************************************************************************/
DECLASM(int32_t) x861_Test1(void);
DECLASM(int32_t) x861_Test2(void);
DECLASM(int32_t) x861_Test3(void);
diff --git a/src/VBox/VMM/testcase/tstX86-FpuSaveRestore.cpp b/src/VBox/VMM/testcase/tstX86-FpuSaveRestore.cpp
index 9d0d215..a4df7aa 100644
--- a/src/VBox/VMM/testcase/tstX86-FpuSaveRestore.cpp
+++ b/src/VBox/VMM/testcase/tstX86-FpuSaveRestore.cpp
@@ -16,9 +16,9 @@
*/
-/*******************************************************************************
-* Header Files *
-*******************************************************************************/
+/*********************************************************************************************************************************
+* Header Files *
+*********************************************************************************************************************************/
#include <iprt/initterm.h>
#include <iprt/message.h>
#include <iprt/string.h>
diff --git a/src/VBox/ValidationKit/bootsectors/VBoxBs2Linker.cpp b/src/VBox/ValidationKit/bootsectors/VBoxBs2Linker.cpp
index efe192b..6617ca6 100644
--- a/src/VBox/ValidationKit/bootsectors/VBoxBs2Linker.cpp
+++ b/src/VBox/ValidationKit/bootsectors/VBoxBs2Linker.cpp
@@ -25,9 +25,9 @@
*/
-/*******************************************************************************
-* Header Files *
-*******************************************************************************/
+/*********************************************************************************************************************************
+* Header Files *
+*********************************************************************************************************************************/
#include <stdio.h>
#include <string.h>
#include <stdlib.h>
@@ -97,7 +97,7 @@ int main(int argc, char **argv)
}
case 'V':
- printf("%s\n", "$Revision: 100880 $");
+ printf("%s\n", "$Revision: 102121 $");
return 0;
case '?':
diff --git a/src/VBox/ValidationKit/common/constants/result.py b/src/VBox/ValidationKit/common/constants/result.py
old mode 100755
new mode 100644
diff --git a/src/VBox/ValidationKit/common/constants/rtexitcode.py b/src/VBox/ValidationKit/common/constants/rtexitcode.py
old mode 100755
new mode 100644
diff --git a/src/VBox/ValidationKit/common/constants/tbreq.py b/src/VBox/ValidationKit/common/constants/tbreq.py
old mode 100755
new mode 100644
diff --git a/src/VBox/ValidationKit/common/constants/tbresp.py b/src/VBox/ValidationKit/common/constants/tbresp.py
old mode 100755
new mode 100644
diff --git a/src/VBox/ValidationKit/common/constants/valueunit.py b/src/VBox/ValidationKit/common/constants/valueunit.py
old mode 100755
new mode 100644
diff --git a/src/VBox/ValidationKit/snippets/alloc-1.c b/src/VBox/ValidationKit/snippets/alloc-1.c
index e1a0f5f..8cfeea0 100644
--- a/src/VBox/ValidationKit/snippets/alloc-1.c
+++ b/src/VBox/ValidationKit/snippets/alloc-1.c
@@ -24,9 +24,10 @@
* terms and conditions of either the GPL or the CDDL or both.
*/
-/*******************************************************************************
-* Header Files *
-*******************************************************************************/
+
+/*********************************************************************************************************************************
+* Header Files *
+*********************************************************************************************************************************/
#include <stdlib.h>
#include <stdio.h>
diff --git a/src/VBox/ValidationKit/snippets/time-1.c b/src/VBox/ValidationKit/snippets/time-1.c
index 309f9d6..02e494a 100644
--- a/src/VBox/ValidationKit/snippets/time-1.c
+++ b/src/VBox/ValidationKit/snippets/time-1.c
@@ -24,9 +24,10 @@
* terms and conditions of either the GPL or the CDDL or both.
*/
-/*******************************************************************************
-* Header Files *
-*******************************************************************************/
+
+/*********************************************************************************************************************************
+* Header Files *
+*********************************************************************************************************************************/
#include <stdio.h>
#include <time.h>
#include <sys/time.h>
diff --git a/src/VBox/ValidationKit/testanalysis/__init__.py b/src/VBox/ValidationKit/testanalysis/__init__.py
old mode 100755
new mode 100644
diff --git a/src/VBox/ValidationKit/testanalysis/reader.py b/src/VBox/ValidationKit/testanalysis/reader.py
old mode 100644
new mode 100755
diff --git a/src/VBox/ValidationKit/testanalysis/reporting.py b/src/VBox/ValidationKit/testanalysis/reporting.py
old mode 100644
new mode 100755
diff --git a/src/VBox/ValidationKit/testboxscript/TestBoxHelper.cpp b/src/VBox/ValidationKit/testboxscript/TestBoxHelper.cpp
index a39814b..280cf5b 100644
--- a/src/VBox/ValidationKit/testboxscript/TestBoxHelper.cpp
+++ b/src/VBox/ValidationKit/testboxscript/TestBoxHelper.cpp
@@ -25,9 +25,9 @@
*/
-/*******************************************************************************
-* Header Files *
-*******************************************************************************/
+/*********************************************************************************************************************************
+* Header Files *
+*********************************************************************************************************************************/
#include <iprt/buildconfig.h>
#include <iprt/env.h>
#include <iprt/initterm.h>
diff --git a/src/VBox/ValidationKit/testdriver/__init__.py b/src/VBox/ValidationKit/testdriver/__init__.py
old mode 100755
new mode 100644
diff --git a/src/VBox/ValidationKit/testdriver/vboxcon.py b/src/VBox/ValidationKit/testdriver/vboxcon.py
old mode 100644
new mode 100755
diff --git a/src/VBox/ValidationKit/testmanager/__init__.py b/src/VBox/ValidationKit/testmanager/__init__.py
old mode 100755
new mode 100644
diff --git a/src/VBox/ValidationKit/testmanager/config.py b/src/VBox/ValidationKit/testmanager/config.py
old mode 100755
new mode 100644
diff --git a/src/VBox/ValidationKit/testmanager/core/__init__.py b/src/VBox/ValidationKit/testmanager/core/__init__.py
old mode 100755
new mode 100644
diff --git a/src/VBox/ValidationKit/testmanager/core/coreconsts.py b/src/VBox/ValidationKit/testmanager/core/coreconsts.py
old mode 100755
new mode 100644
diff --git a/src/VBox/ValidationKit/testmanager/debug/__init__.py b/src/VBox/ValidationKit/testmanager/debug/__init__.py
old mode 100755
new mode 100644
diff --git a/src/VBox/ValidationKit/testmanager/webui/__init__.py b/src/VBox/ValidationKit/testmanager/webui/__init__.py
old mode 100755
new mode 100644
diff --git a/src/VBox/ValidationKit/testmanager/webui/wuihlpgraph.py b/src/VBox/ValidationKit/testmanager/webui/wuihlpgraph.py
old mode 100644
new mode 100755
diff --git a/src/VBox/ValidationKit/testmanager/webui/wuihlpgraphbase.py b/src/VBox/ValidationKit/testmanager/webui/wuihlpgraphbase.py
old mode 100644
new mode 100755
diff --git a/src/VBox/ValidationKit/tests/usb/usbgadget.py b/src/VBox/ValidationKit/tests/usb/usbgadget.py
old mode 100644
new mode 100755
diff --git a/src/VBox/ValidationKit/utils/TestExecServ/TestExecService.cpp b/src/VBox/ValidationKit/utils/TestExecServ/TestExecService.cpp
index 6d62b7c..e6c0710 100644
--- a/src/VBox/ValidationKit/utils/TestExecServ/TestExecService.cpp
+++ b/src/VBox/ValidationKit/utils/TestExecServ/TestExecService.cpp
@@ -25,9 +25,9 @@
*/
-/*******************************************************************************
-* Header Files *
-*******************************************************************************/
+/*********************************************************************************************************************************
+* Header Files *
+*********************************************************************************************************************************/
#define LOG_GROUP RTLOGGROUP_DEFAULT
#include <iprt/alloca.h>
#include <iprt/asm.h>
@@ -66,9 +66,9 @@
-/*******************************************************************************
-* Structures and Typedefs *
-*******************************************************************************/
+/*********************************************************************************************************************************
+* Structures and Typedefs *
+*********************************************************************************************************************************/
/**
* Handle IDs used by txsDoExec for the poll set.
*/
@@ -152,9 +152,9 @@ typedef struct TXSEXEC
typedef TXSEXEC *PTXSEXEC;
-/*******************************************************************************
-* Global Variables *
-*******************************************************************************/
+/*********************************************************************************************************************************
+* Global Variables *
+*********************************************************************************************************************************/
/**
* Transport layers.
*/
@@ -3352,7 +3352,7 @@ static RTEXITCODE txsParseArgv(int argc, char **argv, bool *pfExit)
break;
case 'V':
- RTPrintf("$Revision: 101700 $\n");
+ RTPrintf("$Revision: 102121 $\n");
*pfExit = true;
return RTEXITCODE_SUCCESS;
diff --git a/src/VBox/ValidationKit/utils/TestExecServ/TestExecServiceTcp.cpp b/src/VBox/ValidationKit/utils/TestExecServ/TestExecServiceTcp.cpp
index 80442ff..116d1af 100644
--- a/src/VBox/ValidationKit/utils/TestExecServ/TestExecServiceTcp.cpp
+++ b/src/VBox/ValidationKit/utils/TestExecServ/TestExecServiceTcp.cpp
@@ -25,9 +25,9 @@
*/
-/*******************************************************************************
-* Header Files *
-*******************************************************************************/
+/*********************************************************************************************************************************
+* Header Files *
+*********************************************************************************************************************************/
#define LOG_GROUP RTLOGGROUP_DEFAULT
#include <iprt/asm.h>
#include <iprt/assert.h>
@@ -45,9 +45,9 @@
#include "TestExecServiceInternal.h"
-/*******************************************************************************
-* Defined Constants And Macros *
-*******************************************************************************/
+/*********************************************************************************************************************************
+* Defined Constants And Macros *
+*********************************************************************************************************************************/
/** The default server port. */
#define TXS_TCP_DEF_BIND_PORT 5042
/** The default client port. */
@@ -59,9 +59,9 @@
#define TXS_TCP_DEF_CONNECT_ADDRESS "10.0.2.2"
-/*******************************************************************************
-* Global Variables *
-*******************************************************************************/
+/*********************************************************************************************************************************
+* Global Variables *
+*********************************************************************************************************************************/
/** @name TCP Parameters
* @{ */
static enum { TXSTCPMODE_BOTH, TXSTCPMODE_CLIENT, TXSTCPMODE_SERVER }
diff --git a/src/VBox/ValidationKit/utils/cpu/cidet-app.cpp b/src/VBox/ValidationKit/utils/cpu/cidet-app.cpp
index 38e3a15..5e33fee 100644
--- a/src/VBox/ValidationKit/utils/cpu/cidet-app.cpp
+++ b/src/VBox/ValidationKit/utils/cpu/cidet-app.cpp
@@ -25,9 +25,9 @@
*/
-/*******************************************************************************
-* Header Files *
-*******************************************************************************/
+/*********************************************************************************************************************************
+* Header Files *
+*********************************************************************************************************************************/
#include "cidet.h"
#include <iprt/asm-amd64-x86.h>
@@ -51,9 +51,9 @@
#endif
-/*******************************************************************************
-* Defined Constants And Macros *
-*******************************************************************************/
+/*********************************************************************************************************************************
+* Defined Constants And Macros *
+*********************************************************************************************************************************/
/** @def CIDET_LEAVE_GS_ALONE
* Leave GS alone on 64-bit darwin (gs is 0, no ldt or gdt entry to load that'll
* restore the lower 32-bits of the base when saving and restoring the register).
@@ -63,9 +63,9 @@
#endif
-/*******************************************************************************
-* Structures and Typedefs *
-*******************************************************************************/
+/*********************************************************************************************************************************
+* Structures and Typedefs *
+*********************************************************************************************************************************/
/**
* CIDET driver app buffer.
*/
@@ -130,9 +130,9 @@ typedef CIDETAPP *PCIDETAPP;
typedef PCIDETAPP *PPCIDETAPP;
-/*******************************************************************************
-* Global Variables *
-*******************************************************************************/
+/*********************************************************************************************************************************
+* Global Variables *
+*********************************************************************************************************************************/
/** The test instance handle. */
static RTTEST g_hTest;
/** Points to the instance data while executing, NULL if not executing or if
@@ -165,9 +165,9 @@ static CIDETBUFCFG g_aDataBufCfgs[CIDETAPP_DATA_BUF_COUNT] =
};
-/*******************************************************************************
-* Internal Functions *
-*******************************************************************************/
+/*********************************************************************************************************************************
+* Internal Functions *
+*********************************************************************************************************************************/
DECLASM(void) CidetAppSaveAndRestoreCtx(void);
DECLASM(void) CidetAppRestoreCtx(PCCIDETCPUCTX pRestoreCtx);
DECLASM(void) CidetAppExecute(PCIDETCPUCTX pSaveCtx, PCCIDETCPUCTX pRestoreCtx);
diff --git a/src/VBox/ValidationKit/utils/cpu/cidet-core.cpp b/src/VBox/ValidationKit/utils/cpu/cidet-core.cpp
index fa22495..c9ebc64 100644
--- a/src/VBox/ValidationKit/utils/cpu/cidet-core.cpp
+++ b/src/VBox/ValidationKit/utils/cpu/cidet-core.cpp
@@ -25,9 +25,9 @@
*/
-/*******************************************************************************
-* Defined Constants And Macros *
-*******************************************************************************/
+/*********************************************************************************************************************************
+* Defined Constants And Macros *
+*********************************************************************************************************************************/
#define CIDET_INSTR_TEST_OP_FLAG(a_pInstr, a_fFlag) \
( ((a_pInstr)->afOperands[0] & (a_fFlag)) \
|| ((a_pInstr)->afOperands[1] & (a_fFlag)) \
@@ -58,9 +58,9 @@
#endif
-/*******************************************************************************
-* Header Files *
-*******************************************************************************/
+/*********************************************************************************************************************************
+* Header Files *
+*********************************************************************************************************************************/
#include "cidet.h"
#include <iprt/assert.h>
@@ -74,9 +74,9 @@
#endif
-/*******************************************************************************
-* Global Variables *
-*******************************************************************************/
+/*********************************************************************************************************************************
+* Global Variables *
+*********************************************************************************************************************************/
/** For translating CIDET_OF_Z_XXX values (after shifting). */
uint16_t const g_acbCidetOfSizes[] =
{
diff --git a/src/VBox/ValidationKit/utils/cpu/cidet-instr-1.cpp b/src/VBox/ValidationKit/utils/cpu/cidet-instr-1.cpp
index cff79aa..5e1b963 100644
--- a/src/VBox/ValidationKit/utils/cpu/cidet-instr-1.cpp
+++ b/src/VBox/ValidationKit/utils/cpu/cidet-instr-1.cpp
@@ -26,16 +26,16 @@
-/*******************************************************************************
-* Header Files *
-*******************************************************************************/
+/*********************************************************************************************************************************
+* Header Files *
+*********************************************************************************************************************************/
#include "cidet.h"
#include <VBox/err.h>
-/*******************************************************************************
-* Defined Constants And Macros *
-*******************************************************************************/
+/*********************************************************************************************************************************
+* Defined Constants And Macros *
+*********************************************************************************************************************************/
/*
* Shorter defines for the EFLAGS to save table space.
*/
@@ -54,9 +54,9 @@
#define OF X86_EFL_OF
-/*******************************************************************************
-* Structures and Typedefs *
-*******************************************************************************/
+/*********************************************************************************************************************************
+* Structures and Typedefs *
+*********************************************************************************************************************************/
typedef struct CIDET2IN1OUTWITHFLAGSU8ENTRY
{
uint8_t uIn1;
diff --git a/src/VBox/ValidationKit/utils/cpu/cidet.h b/src/VBox/ValidationKit/utils/cpu/cidet.h
index c0576f1..7a6c996 100644
--- a/src/VBox/ValidationKit/utils/cpu/cidet.h
+++ b/src/VBox/ValidationKit/utils/cpu/cidet.h
@@ -118,7 +118,7 @@
* @param fInvalid When set, get the next invalid operands that will
* cause exceptions/faults.
*/
-typedef int FNCIDETSETUPINOUT(struct CIDETCORE *pThis, bool fInvalid);
+typedef DECLCALLBACK(int) FNCIDETSETUPINOUT(struct CIDETCORE *pThis, bool fInvalid);
/** Pointer to a FNCIDETSETUPINOUT function. */
typedef FNCIDETSETUPINOUT *PFNCIDETSETUPINOUT;
diff --git a/src/VBox/ValidationKit/utils/cpu/cpu-alloc-all-mem.cpp b/src/VBox/ValidationKit/utils/cpu/cpu-alloc-all-mem.cpp
index c1e48bd..1b1fd7c 100644
--- a/src/VBox/ValidationKit/utils/cpu/cpu-alloc-all-mem.cpp
+++ b/src/VBox/ValidationKit/utils/cpu/cpu-alloc-all-mem.cpp
@@ -25,9 +25,9 @@
*/
-/*******************************************************************************
-* Header Files *
-*******************************************************************************/
+/*********************************************************************************************************************************
+* Header Files *
+*********************************************************************************************************************************/
#include <iprt/test.h>
#include <iprt/asm.h>
@@ -38,9 +38,9 @@
#include <iprt/time.h>
-/*******************************************************************************
-* Structures and Typedefs *
-*******************************************************************************/
+/*********************************************************************************************************************************
+* Structures and Typedefs *
+*********************************************************************************************************************************/
typedef struct TSTALLOC
{
/** The page sequence number. */
diff --git a/src/VBox/ValidationKit/utils/cpu/cpu-numa.cpp b/src/VBox/ValidationKit/utils/cpu/cpu-numa.cpp
index 29c85c7..2500ce7 100644
--- a/src/VBox/ValidationKit/utils/cpu/cpu-numa.cpp
+++ b/src/VBox/ValidationKit/utils/cpu/cpu-numa.cpp
@@ -25,9 +25,9 @@
*/
-/*******************************************************************************
-* Header Files *
-*******************************************************************************/
+/*********************************************************************************************************************************
+* Header Files *
+*********************************************************************************************************************************/
#include <iprt/test.h>
#include <iprt/asm.h>
@@ -41,9 +41,9 @@
#include <iprt/time.h>
-/*******************************************************************************
-* Global Variables *
-*******************************************************************************/
+/*********************************************************************************************************************************
+* Global Variables *
+*********************************************************************************************************************************/
/** The number of threads to skip when testing. */
static uint32_t g_cThreadsToSkip = 1;
diff --git a/src/VBox/ValidationKit/utils/cpu/exceptionsR3.cpp b/src/VBox/ValidationKit/utils/cpu/exceptionsR3.cpp
index 79df0f7..2699637 100644
--- a/src/VBox/ValidationKit/utils/cpu/exceptionsR3.cpp
+++ b/src/VBox/ValidationKit/utils/cpu/exceptionsR3.cpp
@@ -25,9 +25,9 @@
*/
-/*******************************************************************************
-* Header Files *
-*******************************************************************************/
+/*********************************************************************************************************************************
+* Header Files *
+*********************************************************************************************************************************/
#include <iprt/cdefs.h>
#include <iprt/ctype.h>
#include <iprt/getopt.h>
@@ -45,9 +45,9 @@
#endif
-/*******************************************************************************
-* Defined Constants And Macros *
-*******************************************************************************/
+/*********************************************************************************************************************************
+* Defined Constants And Macros *
+*********************************************************************************************************************************/
/** Executes a simple test. */
#define TST_XCPT(Trapper, iTrap, uErr) \
do \
@@ -68,9 +68,9 @@
} while (0)
-/*******************************************************************************
-* Global Variables *
-*******************************************************************************/
+/*********************************************************************************************************************************
+* Global Variables *
+*********************************************************************************************************************************/
/** Where to longjmp to when getting a signal/exception. */
jmp_buf g_JmpBuf;
#ifdef USE_SIGNALS
@@ -82,9 +82,9 @@ siginfo_t volatile g_SigInfo;
#endif
-/*******************************************************************************
-* Internal Functions *
-*******************************************************************************/
+/*********************************************************************************************************************************
+* Internal Functions *
+*********************************************************************************************************************************/
DECLASM(void) tstXcptAsmNullPtrRead(void);
DECLASM(void) tstXcptAsmNullPtrWrite(void);
DECLASM(void) tstXcptAsmSysEnter(void);
diff --git a/src/VBox/ValidationKit/utils/cpu/xmmsaving.cpp b/src/VBox/ValidationKit/utils/cpu/xmmsaving.cpp
index d50a4f7..6da0a0f 100644
--- a/src/VBox/ValidationKit/utils/cpu/xmmsaving.cpp
+++ b/src/VBox/ValidationKit/utils/cpu/xmmsaving.cpp
@@ -26,16 +26,16 @@
*/
-/*******************************************************************************
-* Header Files *
-*******************************************************************************/
+/*********************************************************************************************************************************
+* Header Files *
+*********************************************************************************************************************************/
#include <iprt/test.h>
#include <iprt/x86.h>
-/*******************************************************************************
-* Structures and Typedefs *
-*******************************************************************************/
+/*********************************************************************************************************************************
+* Structures and Typedefs *
+*********************************************************************************************************************************/
typedef struct MYXMMREGSET
{
RTUINT128U aRegs[16];
diff --git a/src/VBox/ValidationKit/utils/misc/loadgenerator.cpp b/src/VBox/ValidationKit/utils/misc/loadgenerator.cpp
index 69f6075..470a5ca 100644
--- a/src/VBox/ValidationKit/utils/misc/loadgenerator.cpp
+++ b/src/VBox/ValidationKit/utils/misc/loadgenerator.cpp
@@ -25,9 +25,9 @@
*/
-/*******************************************************************************
-* Header Files *
-*******************************************************************************/
+/*********************************************************************************************************************************
+* Header Files *
+*********************************************************************************************************************************/
#include <iprt/thread.h>
#include <iprt/time.h>
#include <iprt/initterm.h>
@@ -42,17 +42,17 @@
#include <VBox/sup.h>
-/*******************************************************************************
-* Global Variables *
-*******************************************************************************/
+/*********************************************************************************************************************************
+* Global Variables *
+*********************************************************************************************************************************/
/** Whether the threads should quit or not. */
static bool volatile g_fQuit = false;
static const char *g_pszProgramName = NULL;
-/*******************************************************************************
-* Internal Functions *
-*******************************************************************************/
+/*********************************************************************************************************************************
+* Internal Functions *
+*********************************************************************************************************************************/
static int Error(const char *pszFormat, ...);
@@ -305,7 +305,7 @@ int main(int argc, char **argv)
return 1;
case 'V':
- RTPrintf("$Revision: 100880 $\n");
+ RTPrintf("$Revision: 102121 $\n");
return 0;
case VINF_GETOPT_NOT_OPTION:
diff --git a/src/VBox/ValidationKit/utils/misc/loadgeneratorR0.cpp b/src/VBox/ValidationKit/utils/misc/loadgeneratorR0.cpp
index 53134e9..028d4f4 100644
--- a/src/VBox/ValidationKit/utils/misc/loadgeneratorR0.cpp
+++ b/src/VBox/ValidationKit/utils/misc/loadgeneratorR0.cpp
@@ -25,9 +25,9 @@
*/
-/*******************************************************************************
-* Header Files *
-*******************************************************************************/
+/*********************************************************************************************************************************
+* Header Files *
+*********************************************************************************************************************************/
#include <iprt/mp.h>
#include <VBox/sup.h>
#include <VBox/err.h>
diff --git a/src/VBox/ValidationKit/utils/misc/vts_rm.cpp b/src/VBox/ValidationKit/utils/misc/vts_rm.cpp
index a3855c2..38a930a 100644
--- a/src/VBox/ValidationKit/utils/misc/vts_rm.cpp
+++ b/src/VBox/ValidationKit/utils/misc/vts_rm.cpp
@@ -25,9 +25,9 @@
*/
-/*******************************************************************************
-* Header Files *
-*******************************************************************************/
+/*********************************************************************************************************************************
+* Header Files *
+*********************************************************************************************************************************/
#include <iprt/path.h>
#include <iprt/err.h>
#include <iprt/initterm.h>
diff --git a/src/VBox/ValidationKit/utils/misc/vts_tar.cpp b/src/VBox/ValidationKit/utils/misc/vts_tar.cpp
index 595caea..323c76b 100644
--- a/src/VBox/ValidationKit/utils/misc/vts_tar.cpp
+++ b/src/VBox/ValidationKit/utils/misc/vts_tar.cpp
@@ -25,9 +25,9 @@
*/
-/*******************************************************************************
-* Header Files *
-*******************************************************************************/
+/*********************************************************************************************************************************
+* Header Files *
+*********************************************************************************************************************************/
#include <iprt/zip.h>
#include <iprt/err.h>
#include <iprt/initterm.h>
diff --git a/src/VBox/ValidationKit/utils/network/NetPerf.cpp b/src/VBox/ValidationKit/utils/network/NetPerf.cpp
index df95d90..4a328a1 100644
--- a/src/VBox/ValidationKit/utils/network/NetPerf.cpp
+++ b/src/VBox/ValidationKit/utils/network/NetPerf.cpp
@@ -25,9 +25,9 @@
*/
-/*******************************************************************************
-* Header Files *
-*******************************************************************************/
+/*********************************************************************************************************************************
+* Header Files *
+*********************************************************************************************************************************/
#include <iprt/asm.h>
#include <iprt/assert.h>
#include <iprt/ctype.h>
@@ -49,9 +49,9 @@
#include <iprt/timer.h>
-/*******************************************************************************
-* Defined Constants And Macros *
-*******************************************************************************/
+/*********************************************************************************************************************************
+* Defined Constants And Macros *
+*********************************************************************************************************************************/
/** Default TCP port (update help text if you change this) */
#define NETPERF_DEFAULT_PORT 5002
@@ -90,9 +90,9 @@
#define NETPERF_LEN_PREFIX 4
-/*******************************************************************************
-* Structures and Typedefs *
-*******************************************************************************/
+/*********************************************************************************************************************************
+* Structures and Typedefs *
+*********************************************************************************************************************************/
typedef enum NETPERFPROTO
{
NETPERFPROTO_INVALID = 0,
@@ -201,9 +201,9 @@ typedef struct NETPERFHDR
/** @} */
-/*******************************************************************************
-* Global Variables *
-*******************************************************************************/
+/*********************************************************************************************************************************
+* Global Variables *
+*********************************************************************************************************************************/
/** Connection start/identifier to make sure other end is NetPerf. */
static const char g_ConnectStart[] = "yo! waaazzzzzaaaaup dude?";
/** Start of parameters proposal made by the client. */
@@ -319,7 +319,7 @@ static void Usage(PRTSTREAM pStrm)
* @param pvUser Pointer to the stop variable.
* @param iTick The tick, ignored.
*/
-static void netperfStopTimerCallback(RTTIMERLR hTimer, void *pvUser, uint64_t iTick)
+static DECLCALLBACK(void) netperfStopTimerCallback(RTTIMERLR hTimer, void *pvUser, uint64_t iTick)
{
bool volatile *pfStop = (bool volatile *)pvUser;
/* RTPrintf("Time's Up!\n");*/
@@ -1863,7 +1863,7 @@ int main(int argc, char *argv[])
return RTEXITCODE_SUCCESS;
case 'V':
- RTPrintf("$Revision: 101719 $\n");
+ RTPrintf("$Revision: 102181 $\n");
return RTEXITCODE_SUCCESS;
case 'w':
diff --git a/src/VBox/ValidationKit/utils/nt/ntsetfreq.cpp b/src/VBox/ValidationKit/utils/nt/ntsetfreq.cpp
index 8afa85a..32f3ceb 100644
--- a/src/VBox/ValidationKit/utils/nt/ntsetfreq.cpp
+++ b/src/VBox/ValidationKit/utils/nt/ntsetfreq.cpp
@@ -25,9 +25,9 @@
*/
-/*******************************************************************************
-* Header Files *
-*******************************************************************************/
+/*********************************************************************************************************************************
+* Header Files *
+*********************************************************************************************************************************/
#define _WIN32_WINNT 0x0500
#include <Windows.h>
diff --git a/src/VBox/ValidationKit/utils/nt/nttimesources.cpp b/src/VBox/ValidationKit/utils/nt/nttimesources.cpp
index 6c91328..42efa12 100644
--- a/src/VBox/ValidationKit/utils/nt/nttimesources.cpp
+++ b/src/VBox/ValidationKit/utils/nt/nttimesources.cpp
@@ -25,9 +25,9 @@
*/
-/*******************************************************************************
-* Header Files *
-*******************************************************************************/
+/*********************************************************************************************************************************
+* Header Files *
+*********************************************************************************************************************************/
#include <Windows.h>
#include <iprt/asm.h>
@@ -37,9 +37,9 @@
#include <iprt/test.h>
-/*******************************************************************************
-* Structures and Typedefs *
-*******************************************************************************/
+/*********************************************************************************************************************************
+* Structures and Typedefs *
+*********************************************************************************************************************************/
typedef struct _MY_KSYSTEM_TIME
{
ULONG LowPart;
diff --git a/src/VBox/ValidationKit/utils/usb/UsbTest.cpp b/src/VBox/ValidationKit/utils/usb/UsbTest.cpp
index 2b03a47..46bbc5b 100644
--- a/src/VBox/ValidationKit/utils/usb/UsbTest.cpp
+++ b/src/VBox/ValidationKit/utils/usb/UsbTest.cpp
@@ -26,9 +26,9 @@
*/
-/*******************************************************************************
-* Header Files *
-*******************************************************************************/
+/*********************************************************************************************************************************
+* Header Files *
+*********************************************************************************************************************************/
#include <iprt/err.h>
#include <iprt/getopt.h>
#include <iprt/path.h>
@@ -50,16 +50,18 @@
#include <sys/ioctl.h>
#include <linux/usbdevice_fs.h>
-/*******************************************************************************
-* Defined Constants And Macros *
-*******************************************************************************/
+
+/*********************************************************************************************************************************
+* Defined Constants And Macros *
+*********************************************************************************************************************************/
/** Number of tests implemented at the moment. */
#define USBTEST_TEST_CASES 25
-/*******************************************************************************
-* Structures and Typedefs *
-*******************************************************************************/
+
+/*********************************************************************************************************************************
+* Structures and Typedefs *
+*********************************************************************************************************************************/
/**
* USB test request data.
@@ -109,9 +111,10 @@ typedef struct USBDEVDESC
#define USBTEST_REQUEST _IOWR('U', 100, USBTESTPARMS)
-/*******************************************************************************
-* Global Variables *
-*******************************************************************************/
+
+/*********************************************************************************************************************************
+* Global Variables *
+*********************************************************************************************************************************/
/** Command line parameters */
static const RTGETOPTDEF g_aCmdOptions[] =
diff --git a/src/apps/adpctl/VBoxNetAdpCtl.cpp b/src/apps/adpctl/VBoxNetAdpCtl.cpp
index 2e46d36..dadb1ec 100644
--- a/src/apps/adpctl/VBoxNetAdpCtl.cpp
+++ b/src/apps/adpctl/VBoxNetAdpCtl.cpp
@@ -17,9 +17,9 @@
-/*******************************************************************************
-* Header Files *
-*******************************************************************************/
+/*********************************************************************************************************************************
+* Header Files *
+*********************************************************************************************************************************/
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
diff --git a/src/bldprogs/VBoxCPP.cpp b/src/bldprogs/VBoxCPP.cpp
index 9185b25..a222950 100644
--- a/src/bldprogs/VBoxCPP.cpp
+++ b/src/bldprogs/VBoxCPP.cpp
@@ -25,9 +25,9 @@
*/
-/*******************************************************************************
-* Header Files *
-*******************************************************************************/
+/*********************************************************************************************************************************
+* Header Files *
+*********************************************************************************************************************************/
#include <VBox/VBoxTpG.h>
#include <iprt/alloca.h>
@@ -48,9 +48,9 @@
#include "scmstream.h"
-/*******************************************************************************
-* Defined Constants And Macros *
-*******************************************************************************/
+/*********************************************************************************************************************************
+* Defined Constants And Macros *
+*********************************************************************************************************************************/
/** The bitmap type. */
#define VBCPP_BITMAP_TYPE uint64_t
/** The bitmap size as a multiple of VBCPP_BITMAP_TYPE. */
@@ -65,9 +65,9 @@
#define VBCPP_BITMAP_OR(a_bm1, a_bm2) do { (a_bm1)[0] |= (a_bm2)[0]; (a_bm1)[1] |= (a_bm2)[1]; } while (0)
-/*******************************************************************************
-* Structures and Typedefs *
-*******************************************************************************/
+/*********************************************************************************************************************************
+* Structures and Typedefs *
+*********************************************************************************************************************************/
/** Pointer to the C preprocessor instance data. */
typedef struct VBCPP *PVBCPP;
@@ -518,9 +518,9 @@ typedef struct VBCPP
} VBCPP;
-/*******************************************************************************
-* Internal Functions *
-*******************************************************************************/
+/*********************************************************************************************************************************
+* Internal Functions *
+*********************************************************************************************************************************/
static PVBCPPMACRO vbcppMacroLookup(PVBCPP pThis, const char *pszDefine, size_t cchDefine);
static RTEXITCODE vbcppMacroExpandIt(PVBCPP pThis, PVBCPPMACROEXP pExp, size_t offMacro, PVBCPPMACRO pMacro, size_t offParameters);
static RTEXITCODE vbcppMacroExpandReScan(PVBCPP pThis, PVBCPPMACROEXP pExp, VBCPPMACRORESCANMODE enmMode, size_t *pcReplacements);
@@ -5359,7 +5359,7 @@ static RTEXITCODE vbcppParseOptions(PVBCPP pThis, int argc, char **argv, bool *p
case 'V':
{
/* The following is assuming that svn does it's job here. */
- static const char s_szRev[] = "$Revision: 100896 $";
+ static const char s_szRev[] = "$Revision: 102116 $";
const char *psz = RTStrStripL(strchr(s_szRev, ' '));
RTPrintf("r%.*s\n", strchr(psz, ' ') - psz, psz);
*pfExit = true;
diff --git a/src/bldprogs/VBoxCmp.cpp b/src/bldprogs/VBoxCmp.cpp
index b05d8f6..30d69f3 100644
--- a/src/bldprogs/VBoxCmp.cpp
+++ b/src/bldprogs/VBoxCmp.cpp
@@ -16,9 +16,9 @@
*/
-/*******************************************************************************
-* Header Files *
-*******************************************************************************/
+/*********************************************************************************************************************************
+* Header Files *
+*********************************************************************************************************************************/
#include <sys/types.h>
#include <sys/stat.h>
#include <stdio.h>
diff --git a/src/bldprogs/VBoxCompilerPlugInsGcc.cpp b/src/bldprogs/VBoxCompilerPlugInsGcc.cpp
index cf29c9c..122e02e 100644
--- a/src/bldprogs/VBoxCompilerPlugInsGcc.cpp
+++ b/src/bldprogs/VBoxCompilerPlugInsGcc.cpp
@@ -15,6 +15,7 @@
* hope that it will be useful, but WITHOUT ANY WARRANTY of any kind.
*/
+
/*********************************************************************************************************************************
* Header Files *
*********************************************************************************************************************************/
diff --git a/src/bldprogs/VBoxDef2LazyLoad.cpp b/src/bldprogs/VBoxDef2LazyLoad.cpp
index 507db93..5a7e7c8 100644
--- a/src/bldprogs/VBoxDef2LazyLoad.cpp
+++ b/src/bldprogs/VBoxDef2LazyLoad.cpp
@@ -17,9 +17,10 @@
* hope that it will be useful, but WITHOUT ANY WARRANTY of any kind.
*/
-/*******************************************************************************
-* Header Files *
-*******************************************************************************/
+
+/*********************************************************************************************************************************
+* Header Files *
+*********************************************************************************************************************************/
#include <ctype.h>
#include <stdio.h>
#include <string.h>
@@ -27,9 +28,9 @@
#include <iprt/types.h>
-/*******************************************************************************
-* Structures and Typedefs *
-*******************************************************************************/
+/*********************************************************************************************************************************
+* Structures and Typedefs *
+*********************************************************************************************************************************/
typedef struct MYEXPORT
{
struct MYEXPORT *pNext;
@@ -41,9 +42,9 @@ typedef MYEXPORT *PMYEXPORT;
-/*******************************************************************************
-* Global Variables *
-*******************************************************************************/
+/*********************************************************************************************************************************
+* Global Variables *
+*********************************************************************************************************************************/
/** @name Options
* @{ */
static const char *g_pszOutput = NULL;
@@ -843,7 +844,7 @@ int main(int argc, char **argv)
else if ( !strcmp(psz, "--version")
|| !strcmp(psz, "-V"))
{
- printf("$Revision: 98271 $\n");
+ printf("$Revision: 102116 $\n");
return RTEXITCODE_SUCCESS;
}
else
diff --git a/src/bldprogs/VBoxPeSetVersion.cpp b/src/bldprogs/VBoxPeSetVersion.cpp
index e2dd846..6e1c861 100644
--- a/src/bldprogs/VBoxPeSetVersion.cpp
+++ b/src/bldprogs/VBoxPeSetVersion.cpp
@@ -16,9 +16,9 @@
*/
-/*******************************************************************************
-* Header Files *
-*******************************************************************************/
+/*********************************************************************************************************************************
+* Header Files *
+*********************************************************************************************************************************/
#include <Windows.h>
#include <stdio.h>
#include <string.h>
diff --git a/src/bldprogs/VBoxTpG.cpp b/src/bldprogs/VBoxTpG.cpp
index 8f874cf..cb8881a 100644
--- a/src/bldprogs/VBoxTpG.cpp
+++ b/src/bldprogs/VBoxTpG.cpp
@@ -16,9 +16,9 @@
*/
-/*******************************************************************************
-* Header Files *
-*******************************************************************************/
+/*********************************************************************************************************************************
+* Header Files *
+*********************************************************************************************************************************/
#include <VBox/VBoxTpG.h>
#include <iprt/alloca.h>
@@ -41,9 +41,9 @@
#include "scmstream.h"
-/*******************************************************************************
-* Structures and Typedefs *
-*******************************************************************************/
+/*********************************************************************************************************************************
+* Structures and Typedefs *
+*********************************************************************************************************************************/
typedef struct VTGATTRS
{
@@ -117,9 +117,9 @@ typedef struct VTGSTRING
typedef VTGSTRING *PVTGSTRING;
-/*******************************************************************************
-* Global Variables *
-*******************************************************************************/
+/*********************************************************************************************************************************
+* Global Variables *
+*********************************************************************************************************************************/
/** The string space organizing the string table strings. Each node is a VTGSTRING. */
static RTSTRSPACE g_StrSpace = NULL;
/** Used by the string table enumerator to set VTGSTRING::offStrTab. */
@@ -2325,7 +2325,7 @@ static RTEXITCODE parseArguments(int argc, char **argv)
case 'V':
{
/* The following is assuming that svn does it's job here. */
- static const char s_szRev[] = "$Revision: 100896 $";
+ static const char s_szRev[] = "$Revision: 102116 $";
const char *psz = RTStrStripL(strchr(s_szRev, ' '));
RTPrintf("r%.*s\n", strchr(psz, ' ') - psz, psz);
return RTEXITCODE_SUCCESS;
diff --git a/src/bldprogs/bin2c.c b/src/bldprogs/bin2c.c
index b4cffdc..1038302 100644
--- a/src/bldprogs/bin2c.c
+++ b/src/bldprogs/bin2c.c
@@ -15,9 +15,10 @@
* hope that it will be useful, but WITHOUT ANY WARRANTY of any kind.
*/
-/*******************************************************************************
-* Header Files *
-*******************************************************************************/
+
+/*********************************************************************************************************************************
+* Header Files *
+*********************************************************************************************************************************/
#include <ctype.h>
#include <stdio.h>
#include <string.h>
diff --git a/src/bldprogs/filesplitter.cpp b/src/bldprogs/filesplitter.cpp
index 6114786..607bc6b 100644
--- a/src/bldprogs/filesplitter.cpp
+++ b/src/bldprogs/filesplitter.cpp
@@ -16,9 +16,9 @@
*/
-/*******************************************************************************
-* Header Files *
-*******************************************************************************/
+/*********************************************************************************************************************************
+* Header Files *
+*********************************************************************************************************************************/
#include <sys/types.h>
#include <sys/stat.h>
#include <stdio.h>
@@ -29,9 +29,9 @@
#include <iprt/stdarg.h>
-/*******************************************************************************
-* Defined Constants And Macros *
-*******************************************************************************/
+/*********************************************************************************************************************************
+* Defined Constants And Macros *
+*********************************************************************************************************************************/
#ifndef S_ISDIR
# define S_ISDIR(a_fMode) ( (S_IFMT & (a_fMode)) == S_IFDIR )
#endif
diff --git a/src/bldprogs/preload.cpp b/src/bldprogs/preload.cpp
index 43e6aa2..77deb68 100644
--- a/src/bldprogs/preload.cpp
+++ b/src/bldprogs/preload.cpp
@@ -15,9 +15,10 @@
* hope that it will be useful, but WITHOUT ANY WARRANTY of any kind.
*/
-/*******************************************************************************
-* Header Files *
-*******************************************************************************/
+
+/*********************************************************************************************************************************
+* Header Files *
+*********************************************************************************************************************************/
#ifdef RT_OS_WINDOWS
# include <Windows.h>
#else
@@ -146,7 +147,7 @@ int main(int argc, char **argv)
if ( !strcmp(argv[i], "--version")
|| !strcmp(argv[i], "-V"))
{
- printf("$Revision: 100896 $\n");
+ printf("$Revision: 102116 $\n");
return 0;
}
fprintf(stderr, "syntax error: unknown option '%s'\n", argv[i]);
diff --git a/src/bldprogs/scm.cpp b/src/bldprogs/scm.cpp
index f2684ab..a568aba 100644
--- a/src/bldprogs/scm.cpp
+++ b/src/bldprogs/scm.cpp
@@ -15,9 +15,10 @@
* hope that it will be useful, but WITHOUT ANY WARRANTY of any kind.
*/
-/*******************************************************************************
-* Header Files *
-*******************************************************************************/
+
+/*********************************************************************************************************************************
+* Header Files *
+*********************************************************************************************************************************/
#include <iprt/assert.h>
#include <iprt/ctype.h>
#include <iprt/dir.h>
@@ -38,16 +39,16 @@
#include "scmdiff.h"
-/*******************************************************************************
-* Defined Constants And Macros *
-*******************************************************************************/
+/*********************************************************************************************************************************
+* Defined Constants And Macros *
+*********************************************************************************************************************************/
/** The name of the settings files. */
#define SCM_SETTINGS_FILENAME ".scm-settings"
-/*******************************************************************************
-* Structures and Typedefs *
-*******************************************************************************/
+/*********************************************************************************************************************************
+* Structures and Typedefs *
+*********************************************************************************************************************************/
/**
* Option identifiers.
@@ -71,6 +72,9 @@ typedef enum SCMOPT
SCMOPT_NO_STRIP_TRAILING_BLANKS,
SCMOPT_STRIP_TRAILING_LINES,
SCMOPT_NO_STRIP_TRAILING_LINES,
+ SCMOPT_FIX_FLOWER_BOX_MARKERS,
+ SCMOPT_NO_FIX_FLOWER_BOX_MARKERS,
+ SCMOPT_MIN_BLANK_LINES_BEFORE_FLOWER_BOX_MARKERS,
SCMOPT_ONLY_SVN_DIRS,
SCMOPT_NOT_ONLY_SVN_DIRS,
SCMOPT_ONLY_SVN_FILES,
@@ -82,6 +86,7 @@ typedef enum SCMOPT
SCMOPT_SET_SVN_KEYWORDS,
SCMOPT_DONT_SET_SVN_KEYWORDS,
SCMOPT_TAB_SIZE,
+ SCMOPT_WIDTH,
SCMOPT_FILTER_OUT_DIRS,
SCMOPT_FILTER_FILES,
SCMOPT_FILTER_OUT_FILES,
@@ -101,10 +106,18 @@ typedef enum SCMOPT
} SCMOPT;
-/*******************************************************************************
-* Global Variables *
-*******************************************************************************/
+/*********************************************************************************************************************************
+* Global Variables *
+*********************************************************************************************************************************/
const char g_szTabSpaces[16+1] = " ";
+const char g_szAsterisks[255+1] =
+"****************************************************************************************************"
+"****************************************************************************************************"
+"*******************************************************";
+const char g_szSpaces[255+1] =
+" "
+" "
+" ";
static const char g_szProgName[] = "scm";
static const char *g_pszChangedSuff = "";
static bool g_fDryRun = true;
@@ -117,21 +130,24 @@ static int g_iVerbosity = 2;//99; //0;
/** The global settings. */
static SCMSETTINGSBASE const g_Defaults =
{
- /* .fConvertEol = */ true,
- /* .fConvertTabs = */ true,
- /* .fForceFinalEol = */ true,
- /* .fForceTrailingLine = */ false,
- /* .fStripTrailingBlanks = */ true,
- /* .fStripTrailingLines = */ true,
- /* .fOnlySvnFiles = */ false,
- /* .fOnlySvnDirs = */ false,
- /* .fSetSvnEol = */ false,
- /* .fSetSvnExecutable = */ false,
- /* .fSetSvnKeywords = */ false,
- /* .cchTab = */ 8,
- /* .pszFilterFiles = */ (char *)"",
- /* .pszFilterOutFiles = */ (char *)"*.exe|*.com|20*-*-*.log",
- /* .pszFilterOutDirs = */ (char *)".svn|.hg|.git|CVS",
+ /* .fConvertEol = */ true,
+ /* .fConvertTabs = */ true,
+ /* .fForceFinalEol = */ true,
+ /* .fForceTrailingLine = */ false,
+ /* .fStripTrailingBlanks = */ true,
+ /* .fStripTrailingLines = */ true,
+ /* .fFixFlowerBoxMarkers = */ true,
+ /* .cMinBlankLinesBeforeFlowerBoxMakers = */ 2,
+ /* .fOnlySvnFiles = */ false,
+ /* .fOnlySvnDirs = */ false,
+ /* .fSetSvnEol = */ false,
+ /* .fSetSvnExecutable = */ false,
+ /* .fSetSvnKeywords = */ false,
+ /* .cchTab = */ 8,
+ /* .cchWidth = */ 130,
+ /* .pszFilterFiles = */ (char *)"",
+ /* .pszFilterOutFiles = */ (char *)"*.exe|*.com|20*-*-*.log",
+ /* .pszFilterOutDirs = */ (char *)".svn|.hg|.git|CVS",
};
/** Option definitions for the base settings. */
@@ -149,6 +165,9 @@ static RTGETOPTDEF g_aScmOpts[] =
{ "--no-strip-trailing-blanks", SCMOPT_NO_STRIP_TRAILING_BLANKS, RTGETOPT_REQ_NOTHING },
{ "--strip-trailing-lines", SCMOPT_STRIP_TRAILING_LINES, RTGETOPT_REQ_NOTHING },
{ "--strip-no-trailing-lines", SCMOPT_NO_STRIP_TRAILING_LINES, RTGETOPT_REQ_NOTHING },
+ { "--min-blank-lines-before-flower-box-makers", SCMOPT_FIX_FLOWER_BOX_MARKERS, RTGETOPT_REQ_UINT8 },
+ { "--fix-flower-box-markers", SCMOPT_FIX_FLOWER_BOX_MARKERS, RTGETOPT_REQ_NOTHING },
+ { "--no-fix-flower-box-markers", SCMOPT_NO_FIX_FLOWER_BOX_MARKERS, RTGETOPT_REQ_NOTHING },
{ "--only-svn-dirs", SCMOPT_ONLY_SVN_DIRS, RTGETOPT_REQ_NOTHING },
{ "--not-only-svn-dirs", SCMOPT_NOT_ONLY_SVN_DIRS, RTGETOPT_REQ_NOTHING },
{ "--only-svn-files", SCMOPT_ONLY_SVN_FILES, RTGETOPT_REQ_NOTHING },
@@ -160,6 +179,7 @@ static RTGETOPTDEF g_aScmOpts[] =
{ "--set-svn-keywords", SCMOPT_SET_SVN_KEYWORDS, RTGETOPT_REQ_NOTHING },
{ "--dont-set-svn-keywords", SCMOPT_DONT_SET_SVN_KEYWORDS, RTGETOPT_REQ_NOTHING },
{ "--tab-size", SCMOPT_TAB_SIZE, RTGETOPT_REQ_UINT8 },
+ { "--width", SCMOPT_WIDTH, RTGETOPT_REQ_UINT8 },
{ "--filter-out-dirs", SCMOPT_FILTER_OUT_DIRS, RTGETOPT_REQ_STRING },
{ "--filter-files", SCMOPT_FILTER_FILES, RTGETOPT_REQ_STRING },
{ "--filter-out-files", SCMOPT_FILTER_OUT_FILES, RTGETOPT_REQ_STRING },
@@ -192,6 +212,7 @@ static PFNSCMREWRITER const g_aRewritersFor_C_and_CPP[] =
rewrite_AdjustTrailingLines,
rewrite_SvnNoExecutable,
rewrite_SvnKeywords,
+ rewrite_FixFlowerBoxMarkers,
rewrite_C_and_CPP
};
@@ -327,8 +348,8 @@ static void scmSettingsBaseDelete(PSCMSETTINGSBASE pSettings)
{
if (pSettings)
{
- Assert(pSettings->cchTab != ~(unsigned)0);
- pSettings->cchTab = ~(unsigned)0;
+ Assert(pSettings->cchTab != UINT8_MAX);
+ pSettings->cchTab = UINT8_MAX;
RTStrFree(pSettings->pszFilterFiles);
pSettings->pszFilterFiles = NULL;
@@ -385,6 +406,7 @@ static int scmSettingsBaseHandleOpt(PSCMSETTINGSBASE pSettings, int rc, PRTGETOP
pSettings->fForceTrailingLine = false;
return VINF_SUCCESS;
+
case SCMOPT_STRIP_TRAILING_BLANKS:
pSettings->fStripTrailingBlanks = true;
return VINF_SUCCESS;
@@ -392,6 +414,11 @@ static int scmSettingsBaseHandleOpt(PSCMSETTINGSBASE pSettings, int rc, PRTGETOP
pSettings->fStripTrailingBlanks = false;
return VINF_SUCCESS;
+ case SCMOPT_MIN_BLANK_LINES_BEFORE_FLOWER_BOX_MARKERS:
+ pSettings->cMinBlankLinesBeforeFlowerBoxMakers = pValueUnion->u8;
+ return VINF_SUCCESS;
+
+
case SCMOPT_STRIP_TRAILING_LINES:
pSettings->fStripTrailingLines = true;
return VINF_SUCCESS;
@@ -399,6 +426,13 @@ static int scmSettingsBaseHandleOpt(PSCMSETTINGSBASE pSettings, int rc, PRTGETOP
pSettings->fStripTrailingLines = false;
return VINF_SUCCESS;
+ case SCMOPT_FIX_FLOWER_BOX_MARKERS:
+ pSettings->fFixFlowerBoxMarkers = true;
+ return VINF_SUCCESS;
+ case SCMOPT_NO_FIX_FLOWER_BOX_MARKERS:
+ pSettings->fFixFlowerBoxMarkers = false;
+ return VINF_SUCCESS;
+
case SCMOPT_ONLY_SVN_DIRS:
pSettings->fOnlySvnDirs = true;
return VINF_SUCCESS;
@@ -445,6 +479,15 @@ static int scmSettingsBaseHandleOpt(PSCMSETTINGSBASE pSettings, int rc, PRTGETOP
pSettings->cchTab = pValueUnion->u8;
return VINF_SUCCESS;
+ case SCMOPT_WIDTH:
+ if (pValueUnion->u8 < 20 || pValueUnion->u8 > 200)
+ {
+ RTMsgError("Invalid width size: %u - must be in {20..200} range\n", pValueUnion->u8);
+ return VERR_OUT_OF_RANGE;
+ }
+ pSettings->cchWidth = pValueUnion->u8;
+ return VINF_SUCCESS;
+
case SCMOPT_FILTER_OUT_DIRS:
case SCMOPT_FILTER_FILES:
case SCMOPT_FILTER_OUT_FILES:
@@ -1441,6 +1484,73 @@ static int scmProcessSomething(const char *pszSomething, PSCMSETTINGS pSettingsS
return rc;
}
+static void usage(PCRTGETOPTDEF paOpts, size_t cOpts)
+{
+ RTPrintf("VirtualBox Source Code Massager\n"
+ "\n"
+ "Usage: %s [options] <files & dirs>\n"
+ "\n"
+ "Options:\n", g_szProgName);
+ for (size_t i = 0; i < cOpts; i++)
+ {
+ bool fAdvanceTwo = false;
+ if ((paOpts[i].fFlags & RTGETOPT_REQ_MASK) == RTGETOPT_REQ_NOTHING)
+ {
+ fAdvanceTwo = i + 1 < cOpts
+ && ( strstr(paOpts[i+1].pszLong, "-no-") != NULL
+ || strstr(paOpts[i+1].pszLong, "-not-") != NULL
+ || strstr(paOpts[i+1].pszLong, "-dont-") != NULL
+ || (paOpts[i].iShort == 'q' && paOpts[i+1].iShort == 'v')
+ || (paOpts[i].iShort == 'd' && paOpts[i+1].iShort == 'D')
+ );
+ if (fAdvanceTwo)
+ RTPrintf(" %s, %s\n", paOpts[i].pszLong, paOpts[i + 1].pszLong);
+ else
+ RTPrintf(" %s\n", paOpts[i].pszLong);
+ }
+ else if ((paOpts[i].fFlags & RTGETOPT_REQ_MASK) == RTGETOPT_REQ_STRING)
+ RTPrintf(" %s string\n", paOpts[i].pszLong);
+ else
+ RTPrintf(" %s value\n", paOpts[i].pszLong);
+ switch (paOpts[i].iShort)
+ {
+ case 'd':
+ case 'D': RTPrintf(" Default: --dry-run\n"); break;
+ case 'f': RTPrintf(" Default: none\n"); break;
+ case 'q':
+ case 'v': RTPrintf(" Default: -vv\n"); break;
+
+ case SCMOPT_DIFF_IGNORE_EOL: RTPrintf(" Default: false\n"); break;
+ case SCMOPT_DIFF_IGNORE_SPACE: RTPrintf(" Default: false\n"); break;
+ case SCMOPT_DIFF_IGNORE_LEADING_SPACE: RTPrintf(" Default: false\n"); break;
+ case SCMOPT_DIFF_IGNORE_TRAILING_SPACE: RTPrintf(" Default: false\n"); break;
+ case SCMOPT_DIFF_SPECIAL_CHARS: RTPrintf(" Default: true\n"); break;
+
+ case SCMOPT_CONVERT_EOL: RTPrintf(" Default: %RTbool\n", g_Defaults.fConvertEol); break;
+ case SCMOPT_CONVERT_TABS: RTPrintf(" Default: %RTbool\n", g_Defaults.fConvertTabs); break;
+ case SCMOPT_FORCE_FINAL_EOL: RTPrintf(" Default: %RTbool\n", g_Defaults.fForceFinalEol); break;
+ case SCMOPT_FORCE_TRAILING_LINE: RTPrintf(" Default: %RTbool\n", g_Defaults.fForceTrailingLine); break;
+ case SCMOPT_STRIP_TRAILING_BLANKS: RTPrintf(" Default: %RTbool\n", g_Defaults.fStripTrailingBlanks); break;
+ case SCMOPT_STRIP_TRAILING_LINES: RTPrintf(" Default: %RTbool\n", g_Defaults.fStripTrailingLines); break;
+ case SCMOPT_FIX_FLOWER_BOX_MARKERS: RTPrintf(" Default: %RTbool\n", g_Defaults.fFixFlowerBoxMarkers); break;
+ case SCMOPT_MIN_BLANK_LINES_BEFORE_FLOWER_BOX_MARKERS: RTPrintf(" Default: %u\n", g_Defaults.cMinBlankLinesBeforeFlowerBoxMakers); break;
+ case SCMOPT_ONLY_SVN_DIRS: RTPrintf(" Default: %RTbool\n", g_Defaults.fOnlySvnDirs); break;
+ case SCMOPT_ONLY_SVN_FILES: RTPrintf(" Default: %RTbool\n", g_Defaults.fOnlySvnFiles); break;
+ case SCMOPT_SET_SVN_EOL: RTPrintf(" Default: %RTbool\n", g_Defaults.fSetSvnEol); break;
+ case SCMOPT_SET_SVN_EXECUTABLE: RTPrintf(" Default: %RTbool\n", g_Defaults.fSetSvnExecutable); break;
+ case SCMOPT_SET_SVN_KEYWORDS: RTPrintf(" Default: %RTbool\n", g_Defaults.fSetSvnKeywords); break;
+ case SCMOPT_TAB_SIZE: RTPrintf(" Default: %u\n", g_Defaults.cchTab); break;
+ case SCMOPT_WIDTH: RTPrintf(" Default: %u\n", g_Defaults.cchWidth); break;
+ case SCMOPT_FILTER_OUT_DIRS: RTPrintf(" Default: %s\n", g_Defaults.pszFilterOutDirs); break;
+ case SCMOPT_FILTER_FILES: RTPrintf(" Default: %s\n", g_Defaults.pszFilterFiles); break;
+ case SCMOPT_FILTER_OUT_FILES: RTPrintf(" Default: %s\n", g_Defaults.pszFilterOutFiles); break;
+ default: AssertMsgFailed(("i=%d %d %s\n", i, paOpts[i].iShort, paOpts[i].pszLong));
+ }
+ i += fAdvanceTwo;
+ }
+
+}
+
int main(int argc, char **argv)
{
int rc = RTR3InitExe(argc, &argv, 0);
@@ -1504,50 +1614,7 @@ int main(int argc, char **argv)
break;
case 'h':
- RTPrintf("VirtualBox Source Code Massager\n"
- "\n"
- "Usage: %s [options] <files & dirs>\n"
- "\n"
- "Options:\n", g_szProgName);
- for (size_t i = 0; i < RT_ELEMENTS(s_aOpts); i++)
- {
- bool fAdvanceTwo = false;
- if ((s_aOpts[i].fFlags & RTGETOPT_REQ_MASK) == RTGETOPT_REQ_NOTHING)
- {
- fAdvanceTwo = i + 1 < RT_ELEMENTS(s_aOpts)
- && ( strstr(s_aOpts[i+1].pszLong, "-no-") != NULL
- || strstr(s_aOpts[i+1].pszLong, "-not-") != NULL
- || strstr(s_aOpts[i+1].pszLong, "-dont-") != NULL
- );
- if (fAdvanceTwo)
- RTPrintf(" %s, %s\n", s_aOpts[i].pszLong, s_aOpts[i + 1].pszLong);
- else
- RTPrintf(" %s\n", s_aOpts[i].pszLong);
- }
- else if ((s_aOpts[i].fFlags & RTGETOPT_REQ_MASK) == RTGETOPT_REQ_STRING)
- RTPrintf(" %s string\n", s_aOpts[i].pszLong);
- else
- RTPrintf(" %s value\n", s_aOpts[i].pszLong);
- switch (s_aOpts[i].iShort)
- {
- case SCMOPT_CONVERT_EOL: RTPrintf(" Default: %RTbool\n", g_Defaults.fConvertEol); break;
- case SCMOPT_CONVERT_TABS: RTPrintf(" Default: %RTbool\n", g_Defaults.fConvertTabs); break;
- case SCMOPT_FORCE_FINAL_EOL: RTPrintf(" Default: %RTbool\n", g_Defaults.fForceFinalEol); break;
- case SCMOPT_FORCE_TRAILING_LINE: RTPrintf(" Default: %RTbool\n", g_Defaults.fForceTrailingLine); break;
- case SCMOPT_STRIP_TRAILING_BLANKS: RTPrintf(" Default: %RTbool\n", g_Defaults.fStripTrailingBlanks); break;
- case SCMOPT_STRIP_TRAILING_LINES: RTPrintf(" Default: %RTbool\n", g_Defaults.fStripTrailingLines); break;
- case SCMOPT_ONLY_SVN_DIRS: RTPrintf(" Default: %RTbool\n", g_Defaults.fOnlySvnDirs); break;
- case SCMOPT_ONLY_SVN_FILES: RTPrintf(" Default: %RTbool\n", g_Defaults.fOnlySvnFiles); break;
- case SCMOPT_SET_SVN_EOL: RTPrintf(" Default: %RTbool\n", g_Defaults.fSetSvnEol); break;
- case SCMOPT_SET_SVN_EXECUTABLE: RTPrintf(" Default: %RTbool\n", g_Defaults.fSetSvnExecutable); break;
- case SCMOPT_SET_SVN_KEYWORDS: RTPrintf(" Default: %RTbool\n", g_Defaults.fSetSvnKeywords); break;
- case SCMOPT_TAB_SIZE: RTPrintf(" Default: %u\n", g_Defaults.cchTab); break;
- case SCMOPT_FILTER_OUT_DIRS: RTPrintf(" Default: %s\n", g_Defaults.pszFilterOutDirs); break;
- case SCMOPT_FILTER_FILES: RTPrintf(" Default: %s\n", g_Defaults.pszFilterFiles); break;
- case SCMOPT_FILTER_OUT_FILES: RTPrintf(" Default: %s\n", g_Defaults.pszFilterOutFiles); break;
- }
- i += fAdvanceTwo;
- }
+ usage(s_aOpts, RT_ELEMENTS(s_aOpts));
return 1;
case 'q':
@@ -1561,7 +1628,7 @@ int main(int argc, char **argv)
case 'V':
{
/* The following is assuming that svn does it's job here. */
- static const char s_szRev[] = "$Revision: 101715 $";
+ static const char s_szRev[] = "$Revision: 102132 $";
const char *psz = RTStrStripL(strchr(s_szRev, ' '));
RTPrintf("r%.*s\n", strchr(psz, ' ') - psz, psz);
return 0;
diff --git a/src/bldprogs/scm.h b/src/bldprogs/scm.h
index d130fce..949b5ef 100644
--- a/src/bldprogs/scm.h
+++ b/src/bldprogs/scm.h
@@ -105,6 +105,7 @@ FNSCMREWRITER rewrite_SvnNoExecutable;
FNSCMREWRITER rewrite_SvnKeywords;
FNSCMREWRITER rewrite_Makefile_kup;
FNSCMREWRITER rewrite_Makefile_kmk;
+FNSCMREWRITER rewrite_FixFlowerBoxMarkers;
FNSCMREWRITER rewrite_C_and_CPP;
/** @} */
@@ -140,6 +141,12 @@ typedef struct SCMSETTINGSBASE
bool fForceTrailingLine;
bool fStripTrailingBlanks;
bool fStripTrailingLines;
+
+ /** Whether to fix C/C++ flower box section markers. */
+ bool fFixFlowerBoxMarkers;
+ /** The minimum number of blank lines we want before flowerbox markers. */
+ uint8_t cMinBlankLinesBeforeFlowerBoxMakers;
+
/** Only process files that are part of a SVN working copy. */
bool fOnlySvnFiles;
/** Only recurse into directories containing an .svn dir. */
@@ -150,8 +157,10 @@ typedef struct SCMSETTINGSBASE
bool fSetSvnExecutable;
/** Set svn:keyword if completely or partially missing. */
bool fSetSvnKeywords;
- /** */
- unsigned cchTab;
+ /** Tab size. */
+ uint8_t cchTab;
+ /** Optimal source code width. */
+ uint8_t cchWidth;
/** Only consider files matching these patterns. This is only applied to the
* base names. */
char *pszFilterFiles;
@@ -219,6 +228,8 @@ typedef SCMSETTINGS const *PCSCMSETTINGS;
void ScmVerbose(PSCMRWSTATE pState, int iLevel, const char *pszFormat, ...);
extern const char g_szTabSpaces[16+1];
+extern const char g_szAsterisks[255+1];
+extern const char g_szSpaces[255+1];
RT_C_DECLS_END
diff --git a/src/bldprogs/scmdiff.cpp b/src/bldprogs/scmdiff.cpp
index bbbb840..44eb70c 100644
--- a/src/bldprogs/scmdiff.cpp
+++ b/src/bldprogs/scmdiff.cpp
@@ -15,9 +15,10 @@
* hope that it will be useful, but WITHOUT ANY WARRANTY of any kind.
*/
-/*******************************************************************************
-* Header Files *
-*******************************************************************************/
+
+/*********************************************************************************************************************************
+* Header Files *
+*********************************************************************************************************************************/
#include <iprt/assert.h>
#include <iprt/ctype.h>
#include <iprt/message.h>
@@ -27,9 +28,9 @@
#include "scmdiff.h"
-/*******************************************************************************
-* Global Variables *
-*******************************************************************************/
+/*********************************************************************************************************************************
+* Global Variables *
+*********************************************************************************************************************************/
static const char g_szTabSpaces[16+1] = " ";
diff --git a/src/bldprogs/scmrw.cpp b/src/bldprogs/scmrw.cpp
index 6613363..a48a861 100644
--- a/src/bldprogs/scmrw.cpp
+++ b/src/bldprogs/scmrw.cpp
@@ -15,9 +15,10 @@
* hope that it will be useful, but WITHOUT ANY WARRANTY of any kind.
*/
-/*******************************************************************************
-* Header Files *
-*******************************************************************************/
+
+/*********************************************************************************************************************************
+* Header Files *
+*********************************************************************************************************************************/
#include <iprt/assert.h>
#include <iprt/ctype.h>
#include <iprt/dir.h>
@@ -37,6 +38,48 @@
#include "scm.h"
+/**
+ * Worker for isBlankLine.
+ *
+ * @returns true if blank, false if not.
+ * @param pchLine Pointer to the start of the line.
+ * @param cchLine The (encoded) length of the line, excluding EOL char.
+ */
+static bool isBlankLineSlow(const char *pchLine, size_t cchLine)
+{
+ /*
+ * From the end, more likely to hit a non-blank char there.
+ */
+ while (cchLine-- > 0)
+ if (!RT_C_IS_BLANK(pchLine[cchLine]))
+ return false;
+ return true;
+}
+
+/**
+ * Helper for checking whether a line is blank.
+ *
+ * @returns true if blank, false if not.
+ * @param pchLine Pointer to the start of the line.
+ * @param cchLine The (encoded) length of the line, excluding EOL char.
+ */
+DECLINLINE(bool) isBlankLine(const char *pchLine, size_t cchLine)
+{
+ if (cchLine == 0)
+ return true;
+ /*
+ * We're more likely to fine a non-space char at the end of the line than
+ * at the start, due to source code indentation.
+ */
+ if (pchLine[cchLine - 1])
+ return false;
+
+ /*
+ * Don't bother inlining loop code.
+ */
+ return isBlankLineSlow(pchLine, cchLine);
+}
+
/**
* Strip trailing blanks (space & tab).
@@ -421,6 +464,188 @@ bool rewrite_Makefile_kmk(PSCMRWSTATE pState, PSCMSTREAM pIn, PSCMSTREAM pOut, P
return false;
}
+
+static bool isFlowerBoxSectionMarker(PSCMSTREAM pIn, const char *pchLine, size_t cchLine,
+ const char **ppchText, size_t *pcchText)
+{
+ *ppchText = NULL;
+ *pcchText = 0;
+
+ /*
+ * The first line.
+ */
+ if (pchLine[0] != '/')
+ return false;
+ size_t offLine = 1;
+ while (offLine < cchLine && pchLine[offLine] == '*')
+ offLine++;
+ if (offLine < 20) /* (Code below depend on a reasonable minimum here.) */
+ return false;
+ while (offLine < cchLine && RT_C_IS_BLANK(pchLine[offLine]))
+ offLine++;
+ if (offLine != cchLine)
+ return false;
+
+ size_t const cchBox = cchLine;
+
+ /*
+ * The next line, extracting the text.
+ */
+ SCMEOL enmEol;
+ pchLine = ScmStreamGetLine(pIn, &cchLine, &enmEol);
+ if (cchLine < cchBox - 3)
+ return false;
+
+ offLine = 0;
+ if (RT_C_IS_BLANK(pchLine[0]))
+ offLine = RT_C_IS_BLANK(pchLine[1]) ? 2 : 1;
+
+ if (pchLine[offLine] != '*')
+ return false;
+ offLine++;
+
+ if (!RT_C_IS_BLANK(pchLine[offLine + 1]))
+ return false;
+ offLine++;
+
+ while (offLine < cchLine && RT_C_IS_BLANK(pchLine[offLine]))
+ offLine++;
+ if (offLine >= cchLine)
+ return false;
+ if (!RT_C_IS_UPPER(pchLine[offLine]))
+ return false;
+
+ *ppchText = &pchLine[offLine];
+ size_t const offText = offLine;
+
+ /* From the end now. */
+ offLine = cchLine - 1;
+ while (RT_C_IS_BLANK(pchLine[offLine]))
+ offLine--;
+
+ if (pchLine[offLine] != '*')
+ return false;
+ offLine--;
+ if (!RT_C_IS_BLANK(pchLine[offLine]))
+ return false;
+ offLine--;
+ while (RT_C_IS_BLANK(pchLine[offLine]))
+ offLine--;
+ *pcchText = offLine - offText + 1;
+
+ /*
+ * Third line closes the box.
+ */
+ pchLine = ScmStreamGetLine(pIn, &cchLine, &enmEol);
+ if (cchLine < cchBox - 3)
+ return false;
+
+ offLine = 0;
+ if (RT_C_IS_BLANK(pchLine[0]))
+ offLine = RT_C_IS_BLANK(pchLine[1]) ? 2 : 1;
+ while (offLine < cchLine && pchLine[offLine] == '*')
+ offLine++;
+ if (offLine < cchBox - 4)
+ return false;
+
+ if (pchLine[offLine] != '/')
+ return false;
+ offLine++;
+
+ while (offLine < cchLine && RT_C_IS_BLANK(pchLine[offLine]))
+ offLine++;
+ if (offLine != cchLine)
+ return false;
+
+ return true;
+}
+
+
+/**
+ * Flower box marker comments in C and C++ code.
+ *
+ * @returns true if modifications were made, false if not.
+ * @param pIn The input stream.
+ * @param pOut The output stream.
+ * @param pSettings The settings.
+ */
+bool rewrite_FixFlowerBoxMarkers(PSCMRWSTATE pState, PSCMSTREAM pIn, PSCMSTREAM pOut, PCSCMSETTINGSBASE pSettings)
+{
+ if (!pSettings->fFixFlowerBoxMarkers)
+ return false;
+
+ /*
+ * Work thru the file line by line looking for flower box markers.
+ */
+ size_t cChanges = 0;
+ size_t cBlankLines = 0;
+ SCMEOL enmEol;
+ size_t cchLine;
+ const char *pchLine;
+ while ((pchLine = ScmStreamGetLine(pIn, &cchLine, &enmEol)) != NULL)
+ {
+ /*
+ * Get a likely match for a first line.
+ */
+ if ( pchLine[0] == '/'
+ && cchLine > 20
+ && pchLine[1] == '*'
+ && pchLine[2] == '*'
+ && pchLine[3] == '*')
+ {
+ size_t const offSaved = ScmStreamTell(pIn);
+ char const *pchText;
+ size_t cchText;
+ if (isFlowerBoxSectionMarker(pIn, pchLine, cchLine, &pchText, &cchText))
+ {
+ while (cBlankLines < pSettings->cMinBlankLinesBeforeFlowerBoxMakers)
+ {
+ ScmStreamPutEol(pOut, enmEol);
+ cBlankLines++;
+ }
+
+ ScmStreamPutCh(pOut, '/');
+ ScmStreamWrite(pOut, g_szAsterisks, pSettings->cchWidth - 1);
+ ScmStreamPutEol(pOut, enmEol);
+
+ static const char s_szLead[] = "* ";
+ ScmStreamWrite(pOut, s_szLead, sizeof(s_szLead) - 1);
+ ScmStreamWrite(pOut, pchText, cchText);
+ size_t offCurPlus1 = sizeof(s_szLead) - 1 + cchText + 1;
+ ScmStreamWrite(pOut, g_szSpaces, offCurPlus1 < pSettings->cchWidth ? pSettings->cchWidth - offCurPlus1 : 1);
+ ScmStreamPutCh(pOut, '*');
+ ScmStreamPutEol(pOut, enmEol);
+
+ ScmStreamWrite(pOut, g_szAsterisks, pSettings->cchWidth - 1);
+ ScmStreamPutCh(pOut, '/');
+ ScmStreamPutEol(pOut, enmEol);
+
+ cChanges++;
+ cBlankLines = 0;
+ continue;
+ }
+
+ int rc = ScmStreamSeekAbsolute(pIn, offSaved);
+ if (RT_FAILURE(rc))
+ return false;
+ }
+
+ int rc = ScmStreamPutLine(pOut, pchLine, cchLine, enmEol);
+ if (RT_FAILURE(rc))
+ return false;
+
+ /* Do blank line accounting so we can ensure at least two blank lines
+ before each section marker. */
+ if (!isBlankLine(pchLine, cchLine))
+ cBlankLines = 0;
+ else
+ cBlankLines++;
+ }
+ if (cChanges > 0)
+ ScmVerbose(pState, 2, " * Converted %zu flower boxer markers\n", cChanges);
+ return cChanges != 0;
+}
+
/**
* Rewrite a C/C++ source or header file.
*
diff --git a/src/bldprogs/scmstream.cpp b/src/bldprogs/scmstream.cpp
index b5782f4..1522200 100644
--- a/src/bldprogs/scmstream.cpp
+++ b/src/bldprogs/scmstream.cpp
@@ -15,9 +15,10 @@
* hope that it will be useful, but WITHOUT ANY WARRANTY of any kind.
*/
-/*******************************************************************************
-* Header Files *
-*******************************************************************************/
+
+/*********************************************************************************************************************************
+* Header Files *
+*********************************************************************************************************************************/
#include <iprt/assert.h>
#include <iprt/ctype.h>
#include <iprt/err.h>
@@ -1160,6 +1161,24 @@ int ScmStreamPutCh(PSCMSTREAM pStream, char ch)
}
/**
+ * Puts an EOL marker to the stream.
+ *
+ * @returns IPRt status code.
+ * @param pStream The stream. Must be in write mode.
+ * @param enmEol The end-of-line marker to write.
+ */
+int ScmStreamPutEol(PSCMSTREAM pStream, SCMEOL enmEol)
+{
+ if (enmEol == SCMEOL_LF)
+ return ScmStreamWrite(pStream, "\n", 1);
+ if (enmEol == SCMEOL_CRLF)
+ return ScmStreamWrite(pStream, "\r\n", 2);
+ if (enmEol == SCMEOL_NONE)
+ return VINF_SUCCESS;
+ AssertFailedReturn(VERR_INVALID_PARAMETER);
+}
+
+/**
* Formats a string and writes it to the SCM stream.
*
* @returns The number of bytes written (>= 0). Negative value are IPRT error
diff --git a/src/bldprogs/scmstream.h b/src/bldprogs/scmstream.h
index e443bca..fecc566 100644
--- a/src/bldprogs/scmstream.h
+++ b/src/bldprogs/scmstream.h
@@ -122,6 +122,7 @@ SCMEOL ScmStreamGetEolByLine(PSCMSTREAM pStream, size_t iLine);
int ScmStreamPutLine(PSCMSTREAM pStream, const char *pchLine, size_t cchLine, SCMEOL enmEol);
int ScmStreamWrite(PSCMSTREAM pStream, const char *pchBuf, size_t cchBuf);
int ScmStreamPutCh(PSCMSTREAM pStream, char ch);
+int ScmStreamPutEol(PSCMSTREAM pStream, SCMEOL enmEol);
ssize_t ScmStreamPrintf(PSCMSTREAM pStream, const char *pszFormat, ...);
ssize_t ScmStreamPrintfV(PSCMSTREAM pStream, const char *pszFormat, va_list va);
int ScmStreamCopyLines(PSCMSTREAM pDst, PSCMSTREAM pSrc, size_t cLines);
diff --git a/src/bldprogs/scmsubversion.cpp b/src/bldprogs/scmsubversion.cpp
index 9d675b4..61f908f 100644
--- a/src/bldprogs/scmsubversion.cpp
+++ b/src/bldprogs/scmsubversion.cpp
@@ -17,9 +17,10 @@
#define SCM_WITH_DYNAMIC_LIB_SVN
-/*******************************************************************************
-* Header Files *
-*******************************************************************************/
+
+/*********************************************************************************************************************************
+* Header Files *
+*********************************************************************************************************************************/
#include <iprt/assert.h>
#include <iprt/ctype.h>
#include <iprt/dir.h>
@@ -47,9 +48,9 @@
#endif
-/*******************************************************************************
-* Defined Constants And Macros *
-*******************************************************************************/
+/*********************************************************************************************************************************
+* Defined Constants And Macros *
+*********************************************************************************************************************************/
#ifdef SCM_WITH_DYNAMIC_LIB_SVN
# if defined(RT_OS_WINDOWS) && defined(RT_ARCH_X86)
# define APR_CALL __stdcall
@@ -65,9 +66,9 @@
#endif
-/*******************************************************************************
-* Structures and Typedefs *
-*******************************************************************************/
+/*********************************************************************************************************************************
+* Structures and Typedefs *
+*********************************************************************************************************************************/
#if defined(SCM_WITH_DYNAMIC_LIB_SVN) && !defined(SCM_WITH_SVN_HEADERS)
typedef int apr_status_t;
typedef int64_t apr_time_t;
@@ -123,9 +124,9 @@ typedef enum svn_depth_t
#endif /* SCM_WITH_DYNAMIC_LIB_SVN && !SCM_WITH_SVN_HEADERS */
-/*******************************************************************************
-* Global Variables *
-*******************************************************************************/
+/*********************************************************************************************************************************
+* Global Variables *
+*********************************************************************************************************************************/
static char g_szSvnPath[RTPATH_MAX];
static enum
{
diff --git a/src/libs/xpcom18a4/python/__init__.py b/src/libs/xpcom18a4/python/__init__.py
old mode 100644
new mode 100755
diff --git a/src/libs/xpcom18a4/python/components.py b/src/libs/xpcom18a4/python/components.py
old mode 100644
new mode 100755
diff --git a/src/libs/xpcom18a4/python/nsError.py b/src/libs/xpcom18a4/python/nsError.py
old mode 100644
new mode 100755
diff --git a/src/libs/xpcom18a4/python/tools/tracer_demo.py b/src/libs/xpcom18a4/python/tools/tracer_demo.py
old mode 100644
new mode 100755
diff --git a/src/recompiler/Sun/testmath.c b/src/recompiler/Sun/testmath.c
index 847bf05..02f9d31 100644
--- a/src/recompiler/Sun/testmath.c
+++ b/src/recompiler/Sun/testmath.c
@@ -4,9 +4,9 @@
*/
-/*******************************************************************************
-* Header Files *
-*******************************************************************************/
+/*********************************************************************************************************************************
+* Header Files *
+*********************************************************************************************************************************/
#ifndef MATHTEST_STANDALONE
# include <iprt/assert.h>
# include <math.h>
diff --git a/src/recompiler/VBoxREMWrapper.cpp b/src/recompiler/VBoxREMWrapper.cpp
index 4e2c766..7fe7413 100644
--- a/src/recompiler/VBoxREMWrapper.cpp
+++ b/src/recompiler/VBoxREMWrapper.cpp
@@ -148,9 +148,9 @@
*/
-/*******************************************************************************
-* Defined Constants And Macros *
-*******************************************************************************/
+/*********************************************************************************************************************************
+* Defined Constants And Macros *
+*********************************************************************************************************************************/
/** @def USE_REM_STUBS
* Define USE_REM_STUBS to stub the entire REM stuff. This is useful during
* early porting (before we start running stuff).
@@ -192,9 +192,9 @@
#endif
-/*******************************************************************************
-* Header Files *
-*******************************************************************************/
+/*********************************************************************************************************************************
+* Header Files *
+*********************************************************************************************************************************/
#define LOG_GROUP LOG_GROUP_REM
#include <VBox/vmm/rem.h>
#include <VBox/vmm/vmm.h>
@@ -225,9 +225,9 @@
#include <iprt/stream.h>
-/*******************************************************************************
-* Structures and Typedefs *
-*******************************************************************************/
+/*********************************************************************************************************************************
+* Structures and Typedefs *
+*********************************************************************************************************************************/
/**
* Parameter descriptor.
*/
@@ -330,9 +330,9 @@ typedef struct REMEXECMEM
} REMEXECMEM, *PREMEXECMEM;
-/*******************************************************************************
-* Global Variables *
-*******************************************************************************/
+/*********************************************************************************************************************************
+* Global Variables *
+*********************************************************************************************************************************/
#ifndef USE_REM_STUBS
/** Loader handle of the REM object/DLL. */
static RTLDRMOD g_ModREM2 = NIL_RTLDRMOD;
@@ -1394,9 +1394,9 @@ static PREMEXECMEM g_pExecMemHead;
-/*******************************************************************************
-* Internal Functions *
-*******************************************************************************/
+/*********************************************************************************************************************************
+* Internal Functions *
+*********************************************************************************************************************************/
# ifndef VBOX_USE_BITNESS_SELECTOR
static int remGenerateExportGlue(PRTUINTPTR pValue, PCREMFNDESC pDesc);
diff --git a/src/recompiler/VBoxRecompiler.c b/src/recompiler/VBoxRecompiler.c
index 2c3c580..3d87415 100644
--- a/src/recompiler/VBoxRecompiler.c
+++ b/src/recompiler/VBoxRecompiler.c
@@ -16,9 +16,9 @@
*/
-/*******************************************************************************
-* Header Files *
-*******************************************************************************/
+/*********************************************************************************************************************************
+* Header Files *
+*********************************************************************************************************************************/
#define LOG_GROUP LOG_GROUP_REM
#include <stdio.h> /* FILE */
#include "osdep.h"
@@ -71,9 +71,9 @@ ram_addr_t get_phys_page_offset(target_ulong addr);
#endif
-/*******************************************************************************
-* Defined Constants And Macros *
-*******************************************************************************/
+/*********************************************************************************************************************************
+* Defined Constants And Macros *
+*********************************************************************************************************************************/
/** Copy 80-bit fpu register at pSrc to pDst.
* This is probably faster than *calling* memcpy.
@@ -93,9 +93,9 @@ ram_addr_t get_phys_page_offset(target_ulong addr);
#define SEL_FLAGS_SMASK UINT32_C(0x1F0FF)
-/*******************************************************************************
-* Internal Functions *
-*******************************************************************************/
+/*********************************************************************************************************************************
+* Internal Functions *
+*********************************************************************************************************************************/
static DECLCALLBACK(int) remR3Save(PVM pVM, PSSMHANDLE pSSM);
static DECLCALLBACK(int) remR3Load(PVM pVM, PSSMHANDLE pSSM, uint32_t uVersion, uint32_t uPass);
static void remR3StateUpdate(PVM pVM, PVMCPU pVCpu);
@@ -120,9 +120,9 @@ static void remR3NotifyHandlerPhysicalRegister(PVM pVM, PGMPHYSHANDLERKIND enmKi
static void remR3NotifyHandlerPhysicalModify(PVM pVM, PGMPHYSHANDLERKIND enmKind, RTGCPHYS GCPhysOld, RTGCPHYS GCPhysNew, RTGCPHYS cb, bool fHasHCHandler, bool fRestoreAsRAM);
-/*******************************************************************************
-* Global Variables *
-*******************************************************************************/
+/*********************************************************************************************************************************
+* Global Variables *
+*********************************************************************************************************************************/
/** @todo Move stats to REM::s some rainy day we have nothing do to. */
#ifdef VBOX_WITH_STATISTICS
@@ -236,9 +236,9 @@ static const DBGCCMD g_aCmds[] =
uint8_t *code_gen_prologue;
-/*******************************************************************************
-* Internal Functions *
-*******************************************************************************/
+/*********************************************************************************************************************************
+* Internal Functions *
+*********************************************************************************************************************************/
void remAbort(int rc, const char *pszTip);
extern int testmath(void);
--
Alioth's /usr/local/bin/git-commit-notice on /srv/git.debian.org/git/pkg-virtualbox/virtualbox.git
More information about the Pkg-virtualbox-commits
mailing list