Syntax
Parameters
remoteDeviceType: const char* The UTF-8 saved device name to select, or
nullptr to clear the default when createIfMissing is false.
createIfMissingType: bool Whether to create a minimal record when selecting a device that isn’t saved.
Return value
Type: HRESULT ReturnsS_OK on success; otherwise returns a failure HRESULT. Catalog operations also return catalog-specific errors described in Error codes.
Remarks
SetcreateIfMissing to true to create a minimal record when needed. Otherwise a missing record returns WD_E_DEVICE_NOTFOUND. Pass nullptr and false to clear the default without removing the record. Don’t issue competing default changes as if they were a cross-process transaction.
Saved-device APIs and pairing-ID APIs change different local stores. They don’t replace the explicit remoteDevice argument of a remote API call; callers that want default selection must resolve it themselves.
