aboutsummaryrefslogtreecommitdiffstats
path: root/rawshark.c
diff options
context:
space:
mode:
authorChris Maynard <Christopher.Maynard@GTECH.COM>2012-06-09 03:41:23 +0000
committerChris Maynard <Christopher.Maynard@GTECH.COM>2012-06-09 03:41:23 +0000
commite40c7ab1dcf863d230af94cf0bbb30335fe0d5eb (patch)
treed0664afb826f432d6bf85b0e99d5ed4ac9cfd1dd /rawshark.c
parentc3dadc73f3d2f9682fb8f3b2850e661bfb0b98d7 (diff)
Be sure to specify FORMAT_MESSAGE_IGNORE_INSERTS in the dwFlags arg to all FormatMessage() calls where FORMAT_MESSAGE_FROM_SYSTEM is also specified. (Ref: http://blogs.msdn.com/b/oldnewthing/archive/2007/11/28/6564257.aspx)
svn path=/trunk/; revision=43172
Diffstat (limited to 'rawshark.c')
-rw-r--r--rawshark.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/rawshark.c b/rawshark.c
index 7604627a98..719eba1870 100644
--- a/rawshark.c
+++ b/rawshark.c
@@ -321,7 +321,7 @@ raw_pipe_open(const char *pipe_name)
err = GetLastError();
if (err != ERROR_PIPE_BUSY) {
- FormatMessage(FORMAT_MESSAGE_FROM_SYSTEM | FORMAT_MESSAGE_ALLOCATE_BUFFER,
+ FormatMessage(FORMAT_MESSAGE_FROM_SYSTEM | FORMAT_MESSAGE_ALLOCATE_BUFFER | FORMAT_MESSAGE_IGNORE_INSERTS,
NULL, err, 0, (LPTSTR) &err_str, 0, NULL);
fprintf(stderr, "rawshark: \"%s\" could not be opened: %s (error %d)\n",
pipe_name, utf_16to8(err_str), err);
@@ -331,7 +331,7 @@ raw_pipe_open(const char *pipe_name)
if (!WaitNamedPipe(utf_8to16(pipe_name), 30 * 1000)) {
err = GetLastError();
- FormatMessage(FORMAT_MESSAGE_FROM_SYSTEM | FORMAT_MESSAGE_ALLOCATE_BUFFER,
+ FormatMessage(FORMAT_MESSAGE_FROM_SYSTEM | FORMAT_MESSAGE_ALLOCATE_BUFFER | FORMAT_MESSAGE_IGNORE_INSERTS,
NULL, err, 0, (LPTSTR) &err_str, 0, NULL);
fprintf(stderr, "rawshark: \"%s\" could not be waited for: %s (error %d)\n",
pipe_name, utf_16to8(err_str), err);