From 9331a9d035bb1b2f9e08ef9141acad1e180fb70b Mon Sep 17 00:00:00 2001 From: MikalaiR Date: Mon, 31 Aug 2015 08:07:29 +0000 Subject: Toaster: wcslen -> mir_wstrlen git-svn-id: http://svn.miranda-ng.org/main/trunk@15125 1316c22d-e87f-b044-9b9b-93d7a3e3ba9c --- plugins/Toaster/src/toast_notification.cpp | 29 +++++++++++++++-------------- 1 file changed, 15 insertions(+), 14 deletions(-) (limited to 'plugins/Toaster/src/toast_notification.cpp') 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 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 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; } -- cgit v1.2.3