fix: reject task append to JumpList when description exceeds 260 characters (#28485)
* fix: reject task when description exceeds 260 characters * Switched out wcslen() for size() [linear -> constant time] * Included comment describing the need for the additional check * Added information about character limit to documentation * Added newline character to end of jump-list-category.md
This commit is contained in:
parent
c280d770dc
commit
82ea8ea68c
4 changed files with 16 additions and 1 deletions
|
@ -28,6 +28,13 @@ bool AppendTask(const JumpListItem& item, IObjectCollection* collection) {
|
|||
FAILED(link->SetDescription(item.description.c_str())))
|
||||
return false;
|
||||
|
||||
// SetDescription limits the size of the parameter to INFOTIPSIZE (1024),
|
||||
// which suggests rejection when exceeding that limit, but experimentation
|
||||
// has shown that descriptions longer than 260 characters cause a silent
|
||||
// failure, despite SetDescription returning the success code S_OK.
|
||||
if (item.description.size() > 260)
|
||||
return false;
|
||||
|
||||
if (!item.icon_path.empty() &&
|
||||
FAILED(link->SetIconLocation(item.icon_path.value().c_str(),
|
||||
item.icon_index)))
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue