summaryrefslogtreecommitdiff
path: root/plugins/Toaster
diff options
context:
space:
mode:
authorMikalaiR <nikolay.romanovich@narod.ru>2015-08-31 08:07:29 +0000
committerMikalaiR <nikolay.romanovich@narod.ru>2015-08-31 08:07:29 +0000
commit9331a9d035bb1b2f9e08ef9141acad1e180fb70b (patch)
treea68e84905f289c9bf67c0015ff1d06c27b04bf06 /plugins/Toaster
parent291d2b6a67bf9501c5427758092805b66aa44dcf (diff)
Toaster: wcslen -> mir_wstrlen
git-svn-id: http://svn.miranda-ng.org/main/trunk@15125 1316c22d-e87f-b044-9b9b-93d7a3e3ba9c
Diffstat (limited to 'plugins/Toaster')
-rw-r--r--plugins/Toaster/src/string_reference_wrapper.h2
-rw-r--r--plugins/Toaster/src/toast_notification.cpp29
2 files changed, 16 insertions, 15 deletions
diff --git a/plugins/Toaster/src/string_reference_wrapper.h b/plugins/Toaster/src/string_reference_wrapper.h
index 4ce37d5245..6daeb0fee1 100644
--- a/plugins/Toaster/src/string_reference_wrapper.h
+++ b/plugins/Toaster/src/string_reference_wrapper.h
@@ -25,7 +25,7 @@ public:
template <size_t _>
StringReferenceWrapper(_In_reads_(_) wchar_t(&stringRef)[_]) throw()
{
- size_t length = wcslen(stringRef);
+ size_t length = mir_wstrlen(stringRef);
WindowsCreateStringReference(stringRef, length, &_header, &_hstring);
}
diff --git a/plugins/Toaster/src/toast_notification.cpp b/plugins/Toaster/src/toast_notification.cpp
index b681d3ce85..2e9bf89596 100644
--- a/plugins/Toaster/src/toast_notification.cpp
+++ b/plugins/Toaster/src/toast_notification.cpp
@@ -27,18 +27,19 @@ HRESULT ToastNotification::GetNodeByTag(_In_ HSTRING tagName, _Outptr_ ABI::Wind
{
Microsoft::WRL::ComPtr<ABI::Windows::Data::Xml::Dom::IXmlNodeList> nodeList;
HRESULT hr = xml->GetElementsByTagName(tagName, &nodeList);
- if (FAILED(hr))
- return hr;
-
- UINT32 length;
- hr = nodeList->get_Length(&length);
- if (FAILED(hr))
- return hr;
-
- if (length == 0)
- return E_INVALIDARG;
-
- return nodeList->Item(0, node);
+ if (SUCCEEDED(hr))
+ {
+ UINT32 length;
+ hr = nodeList->get_Length(&length);
+ if (SUCCEEDED(hr))
+ {
+ if (length)
+ hr = nodeList->Item(0, node);
+ else
+ hr = E_INVALIDARG;
+ }
+ }
+ return hr;
}
HRESULT ToastNotification::AddNode(_In_ HSTRING name, _Outptr_ ABI::Windows::Data::Xml::Dom::IXmlNode **node, _In_ ABI::Windows::Data::Xml::Dom::IXmlNode *rootNode, _In_ ABI::Windows::Data::Xml::Dom::IXmlDocument* xml)
@@ -92,14 +93,14 @@ HRESULT ToastNotification::SetTextValues(_In_reads_(textValuesCount) wchar_t** t
if (FAILED(hr))
return hr;
- for (UINT32 i = 0; i < textValuesCount; i++)
+ for (UINT i = 0; i < textValuesCount; i++)
{
Microsoft::WRL::ComPtr<ABI::Windows::Data::Xml::Dom::IXmlNode> textNode;
hr = nodeList->Item(i, &textNode);
if (FAILED(hr))
return hr;
- hr = SetNodeValueString(StringReferenceWrapper(textValues[i], (UINT32)wcslen(textValues[i])).Get(), textNode.Get(), xml);
+ hr = SetNodeValueString(StringReferenceWrapper(textValues[i], (UINT32)(mir_wstrlen(textValues[i]))).Get(), textNode.Get(), xml);
if (FAILED(hr))
return hr;
}