From a1fa1c0ca6eb959a1579b39125428ca6b24373ca Mon Sep 17 00:00:00 2001 From: baldurk Date: Thu, 13 Oct 2016 15:56:29 +0200 Subject: [PATCH] Handle more than 2k of saved ignored PDBs --- renderdoc/os/win32/win32_callstack.cpp | 23 +++++++++++++++++++++-- 1 file changed, 21 insertions(+), 2 deletions(-) diff --git a/renderdoc/os/win32/win32_callstack.cpp b/renderdoc/os/win32/win32_callstack.cpp index 10e08c7d7..9086ec2f3 100644 --- a/renderdoc/os/win32/win32_callstack.cpp +++ b/renderdoc/os/win32/win32_callstack.cpp @@ -532,9 +532,28 @@ Win32CallstackResolver::Win32CallstackResolver(char *moduleDB, size_t DBSize, st fclose(f); } - wchar_t inputBuf[2048]; - GetPrivateProfileStringW(L"renderdoc", L"ignores", NULL, &inputBuf[0], 2048, configPath.c_str()); + DWORD sz = 2048; + wchar_t *inputBuf = new wchar_t[sz]; + + for(;;) + { + DWORD read = + GetPrivateProfileStringW(L"renderdoc", L"ignores", NULL, inputBuf, sz, configPath.c_str()); + + if(read == sz - 1) + { + sz *= 2; + delete[] inputBuf; + inputBuf = new wchar_t[sz]; + continue; + } + + break; + } wstring ignores = inputBuf; + + delete[] inputBuf; + split(ignores, pdbIgnores, L';'); wstring widepdbsearch = StringFormat::UTF82Wide(pdbSearchPaths);