From fe9dad382d7569f5c84fb575c2a92932c1b82c69 Mon Sep 17 00:00:00 2001 From: "SND\\ussrhero_cp" Date: Thu, 28 Apr 2016 18:16:06 +0000 Subject: [PATCH] [pykd_ext_2.0] fixed : debug output git-svn-id: https://pykd.svn.codeplex.com/svn@90982 9b283d60-5439-405e-af05-b73fd8c4d996 --- pykd_ext/pyclass.h | 17 +++++++++-------- 1 file changed, 9 insertions(+), 8 deletions(-) diff --git a/pykd_ext/pyclass.h b/pykd_ext/pyclass.h index 85cd875..be0f56e 100644 --- a/pykd_ext/pyclass.h +++ b/pykd_ext/pyclass.h @@ -6,6 +6,7 @@ #include #include +#include struct convert_from_python { @@ -15,10 +16,10 @@ struct convert_from_python { if (IsPy3()) { - wchar_t buf[0x100]; - size_t len = 0x100; - len = PyUnicode_AsWideChar(m_obj, buf, len); - return std::wstring(buf, len); + std::vector buf(0x10000); + size_t len = buf.size(); + len = PyUnicode_AsWideChar(m_obj, &buf[0], len); + return std::wstring(&buf[0], len); } else return std::wstring(_bstr_t(PyString_AsString(m_obj))); @@ -28,10 +29,10 @@ struct convert_from_python { if (IsPy3()) { - wchar_t buf[0x100]; - size_t len = 0x100; - len = PyUnicode_AsWideChar(m_obj, buf, len); - std::wstring str(buf, len); + std::vector buf(0x10000); + size_t len = buf.size(); + len = PyUnicode_AsWideChar(m_obj, &buf[0], len); + std::wstring str(&buf[0], len); return std::string(_bstr_t(str.c_str())); } else