DInput8HookingExample icon indicating copy to clipboard operation
DInput8HookingExample copied to clipboard

Should use case-insensitive comparison when comparing file names

Open anr2me opened this issue 2 years ago • 1 comments

For example at:

https://github.com/pampersrocker/DInput8HookingExample/blob/b9b7e790fe0deb96c2c7884dcf5b3aac5a88c879/MinimalDInput8Hook/Hook.cpp#L39

As some program imports using "KERNEL32.dll" naming while some use "KERNEL32.DLL", and so on.

I'm replacing it with strcasecmp by declaring this:

#ifdef _MSC_VER 
//not #if defined(_WIN32) || defined(_WIN64) because we have strncasecmp in mingw
#define strncasecmp _strnicmp
#define strcasecmp _stricmp
#endif

PS: Not sure whether imported function names can be case-insensitive too or not

anr2me avatar Sep 18 '23 21:09 anr2me

You are correct, the filename should have a case insensitive compare, since on Windows all Filenames are case insensitive.

Function names or Symbol Names in general are however case sensitive, as changes in case would be another function per C/C++ standard.

pampersrocker avatar Sep 19 '23 11:09 pampersrocker