Rémi Bernon (@rbernon) commented about dlls/windows.devices.enumeration/main.c:
static HRESULT WINAPI device_statics_CreateWatcherAqsFilter( IDeviceInformationStatics *iface, HSTRING filter, IDeviceWatcher **watcher ) {
- FIXME( "iface %p, filter %s, watcher %p stub!\n", iface, debugstr_hstring(filter), watcher );
- return E_NOTIMPL;
- struct device_watcher *this;
- TRACE( "iface %p, filter %s, watcher %p\n", iface, debugstr_hstring(filter), watcher );
- if (!(this = calloc( 1, sizeof(*this) ))) return E_OUTOFMEMORY;
- this->IDeviceWatcher_iface.lpVtbl = &device_watcher_vtbl;
- this->ref = 1;
- WindowsDuplicateString( filter, &this->filter );
Now that the filter string is kept on the object, you should probably also call `WindowsDuplicateString` in `device_statics2_CreateWatcher`. And you need to call `WindowsDeleteString` in `device_watcher_Release`.