The `Allocate` method has two variants:
* Allocate(size_t): Performs a normal allocation, but throws a COMException on OOM.
* Allocate(ptrdiff_t offset, size_t size): Allocates a block of size `size`, and initializes a control block for an `IWeakReference` at `offset`. The weak reference resolves to the allocated object, which can finally be freed by calling `ControlBlock::ReleaseTarget`.
The IWeakReference implementation seems to be rather odd, which I have tried to demonstrate (and test) in the unit tests:
* `ReleaseTarget` only frees the object if the strong ref count is _below_ 0.
* `IWeakReference::Resolve` will _not_ set the output pointer to `NULL` if the weak reference is no longer alive.
This MR implements these functions sans exception support.
--
https://gitlab.winehq.org/wine/wine/-/merge_requests/8774
Patches taken from !6207, no-op but should make the `write_type` helpers more readable and flexible.
--
v3: widl: Move some type name construction out of write_type_left.
widl: Remove unnecessary recursion for TYPE_BITFIELD.
widl: Introduce a new append_basic_type helper.
widl: Wrap strappend parameters in a new struct strbuf.
https://gitlab.winehq.org/wine/wine/-/merge_requests/8696
This addresses a regression introduced by commit e603bbf69c7 where we'd get
dlls/winebus.sys/bus_udev.c: In function ‘lnxev_device_haptics_thread’:
dlls/winebus.sys/bus_udev.c:711:36: error: ‘__u16’ undeclared
on FreeBSD 13.
--
https://gitlab.winehq.org/wine/wine/-/merge_requests/8771