Changeset 106809 in vbox for trunk/include/VBox
- Timestamp:
- Oct 31, 2024 2:37:43 PM (6 months ago)
- svn:sync-xref-src-repo-rev:
- 165710
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/include/VBox/com/defs.h
r106061 r106809 563 563 // use this macro to implement scriptable interfaces 564 564 #ifdef RT_OS_WINDOWS 565 #define VBOX_SCRIPTABLE_IMPL(iface) \ 566 public ATL::IDispatchImpl<iface, &IID_##iface, &LIBID_VirtualBox, \ 565 /* 2024-10-31 bird: Avoid using IID_xxxx here, because our IID_IEventSource is 566 non-unique and defined differently by the the Windows SDK's Uuid.lib. This 567 manifested as 0x8002802b/TYPE_E_ELEMENTNOTFOUND trouble in vbox.py when 568 setting up event listening for a newly started test VM. The cause was a 569 linking library reordering, causing the IID_IEventSource symbol to be picked 570 from Uuid.lib rather than VBoxCOM.lib. 571 572 To work around this particular issue and avoid any future issues, we will 573 switch to using the compiler builtin __uuidof() to get the interface ID. The 574 compiler will create readonly variables with names using the UUID value 575 itself, on the format _GUID_xxxxxxxx_xxxx_xxxx_xxxx_xxxxxxxxxxxx. This will 576 effectively eliminate any duplicate interface-name clashes with the system, 577 provided nobody uses the IID_xxxx constants. */ 578 # define VBOX_SCRIPTABLE_IMPL(iface) \ 579 public ATL::IDispatchImpl<iface, /*&IID_##iface*/ &__uuidof(iface), &LIBID_VirtualBox, \ 567 580 kTypeLibraryMajorVersion, kTypeLibraryMinorVersion> 568 581 569 # define VBOX_SCRIPTABLE_DISPATCH_IMPL(iface)\582 # define VBOX_SCRIPTABLE_DISPATCH_IMPL(iface) \ 570 583 STDMETHOD(QueryInterface)(REFIID riid, void **ppObj) \ 571 584 { \ 572 if (riid == IID_##iface)\585 if (riid == /*IID_##iface*/ __uuidof(iface)) \ 573 586 { \ 574 587 *ppObj = (iface *)this; \ … … 592 605 } 593 606 #else 594 # define VBOX_SCRIPTABLE_IMPL(iface)\607 # define VBOX_SCRIPTABLE_IMPL(iface) \ 595 608 public iface 596 # define VBOX_SCRIPTABLE_DISPATCH_IMPL(iface)609 # define VBOX_SCRIPTABLE_DISPATCH_IMPL(iface) 597 610 #endif 598 611
Note:
See TracChangeset
for help on using the changeset viewer.