在 2025-10-21 15:38, Yan-Jie Wang 写道:
+    if(::MultiByteToWideChar(CP_ACP,0,pSrc,-1,bstr,wcSize)==0) {
+      ::SysFreeString(bstr);
+      _com_issue_error(HRESULT_FROM_WIN32(::GetLastError()));

It seems possible that `SysFreeString()` can invalidate the last error value, 
so this should probably be

    DWORD err = ::GetLastError();
    ::SysFreeString(bstr);
    _com_issue_error(HRESULT_FROM_WIN32(err));


+    if(::WideCharToMultiByte(CP_ACP,0,pSrc,-1,str,mbSize,NULL,NULL)==0) {
+      delete[] str;
+      _com_issue_error(HRESULT_FROM_WIN32(::GetLastError()));

And likewise, this one.


--
Best regards,
LIU Hao

Attachment: OpenPGP_signature.asc
Description: OpenPGP digital signature

_______________________________________________
Mingw-w64-public mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/mingw-w64-public

Reply via email to