Skip to content

Commit

Permalink
Fixes issue4653 - Correctly specify the buffer size to FormatMessageW…
Browse files Browse the repository at this point in the history
… and

correctly check for errors on two CreateFileMapping calls.
  • Loading branch information
gpshead committed Mar 23, 2013
1 parent 93f756b commit b803c6c
Show file tree
Hide file tree
Showing 3 changed files with 3 additions and 3 deletions.
2 changes: 1 addition & 1 deletion PC/bdist_wininst/extract.c
Original file line number Diff line number Diff line change
Expand Up @@ -127,7 +127,7 @@ char *map_new_file(DWORD flags, char *filename,

CloseHandle(hFile);

if (hFileMapping == INVALID_HANDLE_VALUE) {
if (hFileMapping == NULL) {
if (notify)
notify(SYSTEM_ERROR,
"CreateFileMapping (%s)", filename);
Expand Down
2 changes: 1 addition & 1 deletion PC/bdist_wininst/install.c
Original file line number Diff line number Diff line change
Expand Up @@ -1019,7 +1019,7 @@ static char *MapExistingFile(char *pathname, DWORD *psize)
NULL, PAGE_READONLY, 0, 0, NULL);
CloseHandle(hFile);

if (hFileMapping == INVALID_HANDLE_VALUE)
if (hFileMapping == NULL)
return NULL;

data = MapViewOfFile(hFileMapping,
Expand Down
2 changes: 1 addition & 1 deletion Python/dynload_win.c
Original file line number Diff line number Diff line change
Expand Up @@ -235,7 +235,7 @@ dl_funcptr _PyImport_GetDynLoadWindows(const char *shortname,
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.
Expand Down

0 comments on commit b803c6c

Please sign in to comment.