<div dir="ltr">Thank you, I was mistaken about the layout, so changing the UUID indeed makes the factory creation succeed. <br><br>The buffer is a leftover from earlier work in the same class, where I tried a more specific DirectX 12 approach (CreateDXGIFactory2 and such). Since the September 2020 example in this mailing list is the best fitting example I could find, I turned the experiment into an earlier DirectX version. I kept some of the other code, which turns out to be a mistake, because I mislead myself into trying to find the error in the wrong place.<br><br>Anyway, since that post I have made some progress, trying to call a virtual function as per C instead of C++. Thankfully, Microsoft COM objects follow a standard of "pointing to interface -> pointing to vtable" on the offsets, so I expected to just follow several pointers in succession and be able to get to the functions of the IDXGIFactory. <br><br>However, with the addition of Jorn's recommendation, I will change my approach. If there is no need to manually 'mess around' with vtable mapping, I'd rather have jextract do it for me.<br><br>PS: I believe the 2025 way of dereferencing looks _roughly_ like this (because I might well be wrong about the getters, perhaps it should have been x.address()): <br><br>MemorySegment vtable = factory.get(ValueLayout.ADDRESS, 0).reinterpret(8, Arena.global(), null);<br>MemorySegment fpointer = vtable.get(ValueLayout.ADDRESS, 0).reinterpret(8, Arena.global(), null);<br>          <br>FunctionDescriptor fdesc = FunctionDescriptor.of(<br>    ValueLayout.JAVA_INT, // return value<br>    ValueLayout.ADDRESS,  // vtable reference - not sure if I need this<br>    ValueLayout.ADDRESS, ValueLayout.ADDRESS, ValueLayout.ADDRESS // parameters); <br>                    <br>MethodHandle handle = linker.downcallHandle(fpointer, fdesc);<br>System.out.println("Handle to QueryInterface created.");<br><br>hresult = (int) handle.invokeExact(vtable, factory, uuidValue, factory);<br><br>Anyway, thanks again for the help, it has allowed me to continue my FFM experiments.<br><br>Kind regards,<br>Hugo<br></div>