-
Notifications
You must be signed in to change notification settings - Fork 84
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Custom error message when incorrect-architecture OCI.DLL is in PATH on Windows #49
Comments
…an invalid architecture; if found adjust the message that is returned to include that location; otherwise, use the default message, as suggested (#49).
I just pushed a commit to address this. Please take a look and let me know if that addresses your request. Thanks! |
Thank you! It works fine. But could you fix following? As for this code I prefer predefined macros as follows to checking sizeof(void*). #if defined _M_AMD64
if (ntHeaders.FileHeader.Machine == IMAGE_FILE_MACHINE_AMD64)
return 1;
#elif defined _M_IX86
if (ntHeaders.FileHeader.Machine == IMAGE_FILE_MACHINE_I386)
return 1;
#else
#error unsupported architecture
#endif |
I just pushed changes based on your suggestions. Thanks. Some of those should be "impossible", but the Windows documentation doesn't state it is, so better safe than sorry! |
Thank you! It satisfies my request. |
When incorrect-architecture OCI.DLL is in the PATH and correct-architecture OCI.DLL isn't there, GetLastError() returns ERROR_BAD_EXE_FORMAT(%1 is not a valid Win32 application). How about custom error message saying "c:\full\path\of\OCI.DLL is 32-bit, which isn't available in x64 programs" or so in this case?
This will reduce issues such as oracle/node-oracledb#752.
Architecture could be checked by
nt_hdr->FileHeader.Machine
in #48 (comment) or by the following function.The text was updated successfully, but these errors were encountered: