aboutsummaryrefslogtreecommitdiff
path: root/src/client
diff options
context:
space:
mode:
authordoshimun <doshimun@4c0a9323-5329-0410-9bdc-e9ce6186880e>2008-05-08 18:15:07 +0000
committerdoshimun <doshimun@4c0a9323-5329-0410-9bdc-e9ce6186880e>2008-05-08 18:15:07 +0000
commit7ab126ecdd5237ccd566f415cc560b39f87e8a0f (patch)
treee5663db8f6e6e5537ccea20e0bbd7c7afd35979d /src/client
parentSome style guide compliance changes and changed the prototype of the method t... (diff)
downloadbreakpad-7ab126ecdd5237ccd566f415cc560b39f87e8a0f.tar.xz
Replace the user of wcscpy_s with safe_wcscpy in common/windows/string_utils-inl.h to
make the code compatible for teams that still use VS 2003 to build. Fix a bug in client ClientInfo class that returned CustomClientInfo struct containing a pointer in the client process address space instead of pointer to in-process data structure. git-svn-id: http://google-breakpad.googlecode.com/svn/trunk@271 4c0a9323-5329-0410-9bdc-e9ce6186880e
Diffstat (limited to 'src/client')
-rw-r--r--src/client/windows/common/ipc_protocol.h6
-rw-r--r--src/client/windows/crash_generation/client_info.cc7
-rw-r--r--src/client/windows/crash_generation/client_info.h2
-rw-r--r--src/client/windows/crash_generation/crash_generation.vcproj4
-rw-r--r--src/client/windows/tests/crash_generation_app/crash_generation_app.cc4
5 files changed, 16 insertions, 7 deletions
diff --git a/src/client/windows/common/ipc_protocol.h b/src/client/windows/common/ipc_protocol.h
index e0a27a88..cba8699c 100644
--- a/src/client/windows/common/ipc_protocol.h
+++ b/src/client/windows/common/ipc_protocol.h
@@ -34,6 +34,7 @@
#include <DbgHelp.h>
#include <string>
#include <utility>
+#include "common/windows/string_utils-inl.h"
#include "google_breakpad/common/minidump_format.h"
namespace google_breakpad {
@@ -60,7 +61,7 @@ struct CustomInfoEntry {
name[0] = L'\0';
return;
}
- wcscpy_s(name, kNameMaxLength, name_arg);
+ WindowsStringUtils::safe_wcscpy(name, kNameMaxLength, name_arg);
}
void set_value(const wchar_t* value_arg) {
@@ -68,7 +69,8 @@ struct CustomInfoEntry {
value[0] = L'\0';
return;
}
- wcscpy_s(value, kValueMaxLength, value_arg);
+
+ WindowsStringUtils::safe_wcscpy(value, kValueMaxLength, value_arg);
}
void set(const wchar_t* name_arg, const wchar_t* value_arg) {
diff --git a/src/client/windows/crash_generation/client_info.cc b/src/client/windows/crash_generation/client_info.cc
index 0da031c9..6d602744 100644
--- a/src/client/windows/crash_generation/client_info.cc
+++ b/src/client/windows/crash_generation/client_info.cc
@@ -169,8 +169,11 @@ bool ClientInfo::PopulateCustomInfo() {
return bytes_count == read_count;
}
-const CustomClientInfo& ClientInfo::GetCustomInfo() const {
- return custom_client_info_;
+CustomClientInfo ClientInfo::GetCustomInfo() const {
+ CustomClientInfo custom_info;
+ custom_info.entries = custom_info_entries_.get();
+ custom_info.count = custom_client_info_.count;
+ return custom_info;
}
} // namespace google_breakpad
diff --git a/src/client/windows/crash_generation/client_info.h b/src/client/windows/crash_generation/client_info.h
index f203b83d..a134d1bb 100644
--- a/src/client/windows/crash_generation/client_info.h
+++ b/src/client/windows/crash_generation/client_info.h
@@ -93,7 +93,7 @@ class ClientInfo {
bool PopulateCustomInfo();
// Returns the client custom information.
- const CustomClientInfo& GetCustomInfo() const;
+ CustomClientInfo GetCustomInfo() const;
private:
// Crash generation server.
diff --git a/src/client/windows/crash_generation/crash_generation.vcproj b/src/client/windows/crash_generation/crash_generation.vcproj
index 055ced6e..b9979b26 100644
--- a/src/client/windows/crash_generation/crash_generation.vcproj
+++ b/src/client/windows/crash_generation/crash_generation.vcproj
@@ -326,6 +326,10 @@
RelativePath=".\minidump_generator.h"
>
</File>
+ <File
+ RelativePath="..\..\..\common\windows\string_utils-inl.h"
+ >
+ </File>
</Filter>
<Filter
Name="Resource Files"
diff --git a/src/client/windows/tests/crash_generation_app/crash_generation_app.cc b/src/client/windows/tests/crash_generation_app/crash_generation_app.cc
index e0cd2f04..7ed1021b 100644
--- a/src/client/windows/tests/crash_generation_app/crash_generation_app.cc
+++ b/src/client/windows/tests/crash_generation_app/crash_generation_app.cc
@@ -35,7 +35,7 @@
namespace google_breakpad {
const int kMaxLoadString = 100;
-const wchar_t kPipeName[] = L"\\\\.\\pipe\\GoogleCrashServices-Testing";
+const wchar_t kPipeName[] = L"\\\\.\\pipe\\GoogleCrashServices\\S-1-5-21-39260824-743453154-142223018-195347";
const DWORD kEditBoxStyles = WS_CHILD |
WS_VISIBLE |
@@ -221,7 +221,7 @@ static void _cdecl ShowClientCrashed(void* context,
QueueUserWorkItem(AppendTextWorker, line, WT_EXECUTEDEFAULT);
- const CustomClientInfo& custom_info = client_info->GetCustomInfo();
+ CustomClientInfo custom_info = client_info->GetCustomInfo();
if (custom_info.count <= 0) {
return;
}