[ros-dev] [ros-diffs] [gadamopoulos] 66992: [BROWSEUI] - CProgressDialog: Allocate big enough buffers needed for the text messages during initialization and don't reallocate them at all. Should stop thrashing the heap w...

Thomas Faber thomas.faber at reactos.org
Tue Mar 31 05:33:23 UTC 2015


On 2015-03-31 00:50, gadamopoulos at svn.reactos.org wrote:
> --- trunk/reactos/dll/win32/browseui/CProgressDialog.cpp	[iso-8859-1] (original)
> +++ trunk/reactos/dll/win32/browseui/CProgressDialog.cpp	[iso-8859-1] Mon Mar 30 22:50:34 2015
>  CProgressDialog::CProgressDialog()
>  {

> +    this->cancelMsg[0] = this->title[0];

Did you mean this->cancelMsg[0] = this->title[0] = 0;?
(or UNICODE_NULL for that matter)

>  static void set_buffer(LPWSTR *buffer, LPCWSTR string)
>  {

> +
> +    ULONG len = max((wcslen(string) + 1)*sizeof(WCHAR), BUFFER_SIZE);
>      StringCchCopyW(*buffer, len, string);

This makes no sense. I think you simply want
StringCchCopyW(*buffer, len, BUFFER_SIZE);


Thanks!
-Thomas



More information about the Ros-dev mailing list