mirror of
				https://github.com/python/cpython.git
				synced 2025-10-31 13:41:24 +00:00 
			
		
		
		
	Fixes issue4653 - Correctly specify the buffer size to FormatMessageW and
correctly check for errors on two CreateFileMapping calls.
This commit is contained in:
		
							parent
							
								
									93f756b274
								
							
						
					
					
						commit
						b803c6c4b8
					
				
					 3 changed files with 3 additions and 3 deletions
				
			
		|  | @ -127,7 +127,7 @@ char *map_new_file(DWORD flags, char *filename, | ||||||
| 
 | 
 | ||||||
|     CloseHandle(hFile); |     CloseHandle(hFile); | ||||||
| 
 | 
 | ||||||
|     if (hFileMapping == INVALID_HANDLE_VALUE) { |     if (hFileMapping == NULL) { | ||||||
|         if (notify) |         if (notify) | ||||||
|             notify(SYSTEM_ERROR, |             notify(SYSTEM_ERROR, | ||||||
|                    "CreateFileMapping (%s)", filename); |                    "CreateFileMapping (%s)", filename); | ||||||
|  |  | ||||||
|  | @ -1019,7 +1019,7 @@ static char *MapExistingFile(char *pathname, DWORD *psize) | ||||||
|                                       NULL, PAGE_READONLY, 0, 0, NULL); |                                       NULL, PAGE_READONLY, 0, 0, NULL); | ||||||
|     CloseHandle(hFile); |     CloseHandle(hFile); | ||||||
| 
 | 
 | ||||||
|     if (hFileMapping == INVALID_HANDLE_VALUE) |     if (hFileMapping == NULL) | ||||||
|         return NULL; |         return NULL; | ||||||
| 
 | 
 | ||||||
|     data = MapViewOfFile(hFileMapping, |     data = MapViewOfFile(hFileMapping, | ||||||
|  |  | ||||||
|  | @ -235,7 +235,7 @@ dl_funcptr _PyImport_GetDynLoadWindows(const char *shortname, | ||||||
|                            SUBLANG_DEFAULT), |                            SUBLANG_DEFAULT), | ||||||
|                            /* Default language */ |                            /* Default language */ | ||||||
|                 theInfo, /* the buffer */ |                 theInfo, /* the buffer */ | ||||||
|                 sizeof(theInfo), /* the buffer size */ |                 sizeof(theInfo) / sizeof(wchar_t), /* size in wchars */ | ||||||
|                 NULL); /* no additional format args. */ |                 NULL); /* no additional format args. */ | ||||||
| 
 | 
 | ||||||
|             /* Problem: could not get the error message.
 |             /* Problem: could not get the error message.
 | ||||||
|  |  | ||||||
		Loading…
	
	Add table
		Add a link
		
	
		Reference in a new issue
	
	 Gregory P. Smith
						Gregory P. Smith