[Python-checkins] cpython (3.3): Fixes issue4653 - Correctly specify the buffer size to FormatMessageW and

gregory.p.smith python-checkins at python.org
Sun Mar 24 00:06:16 CET 2013


http://hg.python.org/cpython/rev/4db1b0bb3683
changeset:   82936:4db1b0bb3683
branch:      3.3
parent:      82932:263fdce97aa0
user:        Gregory P. Smith <greg at krypto.org>
date:        Sat Mar 23 16:05:36 2013 -0700
summary:
  Fixes issue4653 - Correctly specify the buffer size to FormatMessageW and
correctly check for errors on two CreateFileMapping calls.

files:
  PC/bdist_wininst/extract.c |  2 +-
  PC/bdist_wininst/install.c |  2 +-
  Python/dynload_win.c       |  2 +-
  3 files changed, 3 insertions(+), 3 deletions(-)


diff --git a/PC/bdist_wininst/extract.c b/PC/bdist_wininst/extract.c
--- a/PC/bdist_wininst/extract.c
+++ b/PC/bdist_wininst/extract.c
@@ -127,7 +127,7 @@
 
     CloseHandle(hFile);
 
-    if (hFileMapping == INVALID_HANDLE_VALUE) {
+    if (hFileMapping == NULL) {
         if (notify)
             notify(SYSTEM_ERROR,
                    "CreateFileMapping (%s)", filename);
diff --git a/PC/bdist_wininst/install.c b/PC/bdist_wininst/install.c
--- a/PC/bdist_wininst/install.c
+++ b/PC/bdist_wininst/install.c
@@ -1019,7 +1019,7 @@
                                       NULL, PAGE_READONLY, 0, 0, NULL);
     CloseHandle(hFile);
 
-    if (hFileMapping == INVALID_HANDLE_VALUE)
+    if (hFileMapping == NULL)
         return NULL;
 
     data = MapViewOfFile(hFileMapping,
diff --git a/Python/dynload_win.c b/Python/dynload_win.c
--- a/Python/dynload_win.c
+++ b/Python/dynload_win.c
@@ -235,7 +235,7 @@
                            SUBLANG_DEFAULT),
                            /* Default language */
                 theInfo, /* the buffer */
-                sizeof(theInfo), /* the buffer size */
+                sizeof(theInfo) / sizeof(wchar_t), /* size in wchars */
                 NULL); /* no additional format args. */
 
             /* Problem: could not get the error message.

-- 
Repository URL: http://hg.python.org/cpython


More information about the Python-checkins mailing list