提交 3d33e388 编写于 作者: T Taowei Luo 提交者: Michal Privoznik

vbox: Make IMediumAttachment work with vbox2.2 and 3.0

The GetMedium will always return a IHardDisk object them.
In 2.2 and 3.0, it is what GetHardDisk exactly do. In 3.1 and later,
The IMedium is same as IHardDisk.
上级 0cd409cd
......@@ -4680,14 +4680,13 @@ _mediumCreateDiffStorage(IMedium *medium ATTRIBUTE_UNUSED,
}
static nsresult
_mediumAttachmentGetMedium(IMediumAttachment *mediumAttachment ATTRIBUTE_UNUSED,
IMedium **medium ATTRIBUTE_UNUSED)
_mediumAttachmentGetMedium(IMediumAttachment *mediumAttachment,
IHardDisk **hardDisk)
{
#if VBOX_API_VERSION < 3001000
vboxUnsupported();
return 0;
return mediumAttachment->vtbl->GetHardDisk(mediumAttachment, hardDisk);
#else /* VBOX_API_VERSION >= 3001000 */
return mediumAttachment->vtbl->GetMedium(mediumAttachment, medium);
return mediumAttachment->vtbl->GetMedium(mediumAttachment, hardDisk);
#endif /* VBOX_API_VERSION >= 3001000 */
}
......
......@@ -426,7 +426,7 @@ typedef struct {
/* Functions for IMediumAttachment */
typedef struct {
nsresult (*GetMedium)(IMediumAttachment *mediumAttachment, IMedium **medium);
nsresult (*GetMedium)(IMediumAttachment *mediumAttachment, IHardDisk **hardDisk);
nsresult (*GetController)(IMediumAttachment *mediumAttachment, PRUnichar **controller);
nsresult (*GetType)(IMediumAttachment *mediumAttachment, PRUint32 *type);
nsresult (*GetPort)(IMediumAttachment *mediumAttachment, PRInt32 *port);
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册