GetModuleFileName and case sensitivity
-
Hi Guys, I am using GetModuleFileName API in my program. It returns me the name of my executable. However, I see that under different environments, it give me output like -- Win XP output: test.exe -- Win 7 output: TEST.EXE not sure why the API gives me different outputs. Please help.
-
Hi Guys, I am using GetModuleFileName API in my program. It returns me the name of my executable. However, I see that under different environments, it give me output like -- Win XP output: test.exe -- Win 7 output: TEST.EXE not sure why the API gives me different outputs. Please help.
Here is an excerpt from the documentation for
GetModuleFileName
- The string returned will use the same format that was specified when the module was loaded. Therefore, the path can be a long or short file name, and can use the prefix "\\?\". So the output will depend on how your EXE was loaded.«_Superman_» _I love work. It gives me something to do between weekends.
-
Here is an excerpt from the documentation for
GetModuleFileName
- The string returned will use the same format that was specified when the module was loaded. Therefore, the path can be a long or short file name, and can use the prefix "\\?\". So the output will depend on how your EXE was loaded.«_Superman_» _I love work. It gives me something to do between weekends.
"So the output will depend on how your EXE was loaded." Can you please help in elaborating it more?
-
"So the output will depend on how your EXE was loaded." Can you please help in elaborating it more?
To add more context, we are using CreateProcess(...) API to launch the exe file. However, even though the code is same but GetModuleFileName returns me different output.
-
Hi Guys, I am using GetModuleFileName API in my program. It returns me the name of my executable. However, I see that under different environments, it give me output like -- Win XP output: test.exe -- Win 7 output: TEST.EXE not sure why the API gives me different outputs. Please help.
Vikrams..pls read it http://msdn.microsoft.com/en-us/library/windows/desktop/aa365247(v=vs.85).aspx. I think this may be the reason. :)
-
To add more context, we are using CreateProcess(...) API to launch the exe file. However, even though the code is same but GetModuleFileName returns me different output.
It would be better if you explained what problem this is causing you. The character case of an executable filename is not significant in Windows. If you want to read the full documentation it is at http://msdn.microsoft.com/en-us/library/windows/desktop/ms683197(v=vs.85).aspx[^].
Use the best guess
-
Vikrams..pls read it http://msdn.microsoft.com/en-us/library/windows/desktop/aa365247(v=vs.85).aspx. I think this may be the reason. :)
I went though it, but able to get the reason.
-
I went though it, but able to get the reason.
-
I would like to know if this particular API has any known issues.
-
I would like to know if this particular API has any known issues.