[vbox-dev] Type conflicts in vbox C API

Frank Mehnert frank.mehnert at oracle.com
Mon Jun 2 13:52:50 GMT 2014


Hi Taowei,

On Monday 02 June 2014 12:28:35 Taowei Luo wrote:
> Hi, I'm developing the vbox drivers for libvirt, with the vbox c api.
> 
> I have a question. Is there any type conflict in vbox C API between
> different versions?
> 
> For example, I have a var type named nsresult. In some C API versions, It
> defines nsresult as type PRUint32. Is it true that all nsresults (in
> different versions) will be defined as the same type PRUint32?
> 
> I know it may be false for structs which have function pointers. But in
> other cases, especially basic types, is the type compatible with all c api
> versions?

nsresult is always PRUint32. Note that this code is always a status
code and will never include any pointer or similar. Values bigger
than 0x80000000 are used for errors, NS_OK is defined as 0.

In general, the API will not differ between VBox versions of the same
stable branch but the API might change with a new major release. For
example, VBox 4.3.2 and 4.3.4 have the same API while VBox 4.2.2 and
4.3.2 differ a bit. Usually the changes between different API versions
are small and all changes are documented in section 12 of the VirtualBox
SDK documentation (SDKRef.pdf, not UserManual.pdf!)

Kind regards,

Frank
-- 
Dr.-Ing. Frank Mehnert | Software Development Director, VirtualBox
ORACLE Deutschland B.V. & Co. KG | Werkstr. 24 | 71384 Weinstadt, Germany

Hauptverwaltung: Riesstr. 25, D-80992 München
Registergericht: Amtsgericht München, HRA 95603
Geschäftsführer: Jürgen Kunz

Komplementärin: ORACLE Deutschland Verwaltung B.V.
Hertogswetering 163/167, 3543 AS Utrecht, Niederlande
Handelsregister der Handelskammer Midden-Niederlande, Nr. 30143697
Geschäftsführer: Alexander van der Ven, Astrid Kepper, Val Maher




More information about the vbox-dev mailing list