diff options
author | patthoyts <patthoyts@users.sourceforge.net> | 2009-05-13 22:03:38 (GMT) |
---|---|---|
committer | patthoyts <patthoyts@users.sourceforge.net> | 2009-05-13 22:03:38 (GMT) |
commit | 3624cdf255546ee3aa2f5f8fa60216aede7cf0a6 (patch) | |
tree | e90aeb308a60ce722db765a87ffb7007f6baaad2 /win | |
parent | 79279ff1ca39daa66f69addece5c01fbfaae1d01 (diff) | |
download | tk-3624cdf255546ee3aa2f5f8fa60216aede7cf0a6.zip tk-3624cdf255546ee3aa2f5f8fa60216aede7cf0a6.tar.gz tk-3624cdf255546ee3aa2f5f8fa60216aede7cf0a6.tar.bz2 |
FormatMessage should always use the ignore-inserts flag when processing system errors.
Diffstat (limited to 'win')
-rw-r--r-- | win/tkWinSend.c | 8 | ||||
-rw-r--r-- | win/tkWinTest.c | 6 |
2 files changed, 8 insertions, 6 deletions
diff --git a/win/tkWinSend.c b/win/tkWinSend.c index f7cba1f..913de71 100644 --- a/win/tkWinSend.c +++ b/win/tkWinSend.c @@ -10,7 +10,7 @@ * See the file "license.terms" for information on usage and redistribution of * this file, and for a DISCLAIMER OF ALL WARRANTIES. * - * RCS: @(#) $Id: tkWinSend.c,v 1.19 2009/01/28 20:47:49 nijtmans Exp $ + * RCS: @(#) $Id: tkWinSend.c,v 1.20 2009/05/13 22:03:38 patthoyts Exp $ */ #include "tkInt.h" @@ -839,9 +839,9 @@ Win32ErrorObj( TCHAR sBuffer[30]; Tcl_Obj* errPtr = NULL; - FormatMessage(FORMAT_MESSAGE_ALLOCATE_BUFFER | FORMAT_MESSAGE_FROM_SYSTEM, - NULL, (DWORD)hrError, LANG_NEUTRAL, - (LPTSTR)&lpBuffer, 0, NULL); + FormatMessage(FORMAT_MESSAGE_ALLOCATE_BUFFER | FORMAT_MESSAGE_FROM_SYSTEM + | FORMAT_MESSAGE_IGNORE_INSERTS, NULL, (DWORD)hrError, + LANG_NEUTRAL, (LPTSTR)&lpBuffer, 0, NULL); if (lpBuffer == NULL) { lpBuffer = sBuffer; diff --git a/win/tkWinTest.c b/win/tkWinTest.c index 3060dda..8cc343f 100644 --- a/win/tkWinTest.c +++ b/win/tkWinTest.c @@ -11,7 +11,7 @@ * See the file "license.terms" for information on usage and redistribution of * this file, and for a DISCLAIMER OF ALL WARRANTIES. * - * RCS: @(#) $Id: tkWinTest.c,v 1.24 2008/12/10 05:02:52 das Exp $ + * RCS: @(#) $Id: tkWinTest.c,v 1.25 2009/05/13 22:03:39 patthoyts Exp $ */ #include "tkWinInt.h" @@ -107,13 +107,15 @@ AppendSystemError( Tcl_Obj *resultPtr = Tcl_GetObjResult(interp); length = FormatMessageW(FORMAT_MESSAGE_FROM_SYSTEM + | FORMAT_MESSAGE_IGNORE_INSERTS | FORMAT_MESSAGE_ALLOCATE_BUFFER, NULL, error, MAKELANGID(LANG_NEUTRAL, SUBLANG_DEFAULT), (WCHAR *) &wMsgPtr, 0, NULL); if (length == 0) { char *msgPtr; - length = FormatMessageA(FORMAT_MESSAGE_FROM_SYSTEM + length = FormatMessageA(FORMAT_MESSAGE_FROM_SYSTEM + | FORMAT_MESSAGE_IGNORE_INSERTS | FORMAT_MESSAGE_ALLOCATE_BUFFER, NULL, error, MAKELANGID(LANG_NEUTRAL, SUBLANG_DEFAULT), (char *) &msgPtr, 0, NULL); |