Chromium Code Reviews| Index: base/win/pe_image.cc |
| diff --git a/base/win/pe_image.cc b/base/win/pe_image.cc |
| index e67eb0886f1423e978f50d99e88b770106df5440..a5c41388de34c0ae5ea24e6df4c694f1273c18d5 100644 |
| --- a/base/win/pe_image.cc |
| +++ b/base/win/pe_image.cc |
| @@ -10,8 +10,6 @@ |
| namespace base { |
| namespace win { |
| -// TODO(jschuh): crbug.com/167707 Make sure this code works on 64-bit. |
| - |
| // Structure to perform imports enumerations. |
| struct EnumAllImportsStorage { |
| PEImage::EnumImportsFunction callback; |
| @@ -213,7 +211,7 @@ FARPROC PEImage::GetProcAddress(LPCSTR function_name) const { |
| if (exports <= function && exports + size > function) |
| #pragma warning(push) |
| #pragma warning(disable: 4312) |
| - // This cast generates a warning because it is 32 bit specific. |
| + // Cast from 32-bit value to 64-bit pointer generates C4312 on 64-bit. |
|
Nico
2015/12/23 20:57:01
It'd be nice if the comment also said why the warn
Will Harris
2015/12/24 05:35:51
I changed this function to return -1 on both 64-bi
|
| return reinterpret_cast<FARPROC>(0xFFFFFFFF); |
| #pragma warning(pop) |
| @@ -456,7 +454,7 @@ bool PEImage::EnumDelayImportChunks(EnumDelayImportChunksFunction callback, |
| } else { |
| #pragma warning(push) |
| #pragma warning(disable: 4312) |
| - // These casts generate warnings because they are 32 bit specific. |
| + // Casts from 32-bit values to 64-bit pointers generates C4312 on 64-bit. |
|
Nico
2015/12/23 20:57:01
ditto
Will Harris
2015/12/24 05:35:51
Done. Actually just changed the cast instead of su
|
| module_name = reinterpret_cast<LPCSTR>(delay_descriptor->rvaDLLName); |
| name_table = |
| reinterpret_cast<PIMAGE_THUNK_DATA>(delay_descriptor->rvaINT); |
| @@ -493,12 +491,8 @@ bool PEImage::EnumOneDelayImportChunk(EnumImportsFunction callback, |
| import = reinterpret_cast<PIMAGE_IMPORT_BY_NAME>( |
| RVAToAddr(name_table->u1.ForwarderString)); |
| } else { |
| -#pragma warning(push) |
| -#pragma warning(disable: 4312) |
| - // This cast generates a warning because it is 32 bit specific. |
| import = reinterpret_cast<PIMAGE_IMPORT_BY_NAME>( |
| name_table->u1.ForwarderString); |
| -#pragma warning(pop) |
| } |
| hint = import->Hint; |