Default path for application and LoadLibrary

Tech-Archive recommends: Repair Windows Errors & Optimize Windows Performance



This is wide question, so maybe it is not about MFC but about windows
executables at all. But anyway. In my application I have delay loaded
libraries. I use several components in my application which are implemented
in separated DLLs. Before running them I need to know if they are fisically
exist in the application's folder. And if they dodn't simple don't use them.
The problem is that my application could be run with some kind of default
application path. I don't know exactly how it works, but the point is that
my application fisically exist let's say in the path "C:\Program
Files\MyApp" and if I run my program from that path by simple clicking on it
the default path will be the same. So in the code if I open a file like
CFile(_T("Myfile.txt")) and it is in the C:\Program Files\MyApp" it will be
opened just fine. But if my programm will be started with different default
path (let's say "C:\MyAppArchive") and in the code there will be
CFile(_T("Myfile.txt")) then it fails as particular file could not be found
in MyAppArchive.

But! LoadLibrary seems like working different way. It is not taking default
app path, but someway always look to the folder where my exe is placed.
So.. Some way I need to implement my file existence checker the same way.

Could you suggest me where to start digging?
Thanks!

German Koninin


.



Relevant Pages

  • RE: priviledge escalation techniques
    ... executables already listed there. ... Subject: priviledge escalation techniques ... The easiest way to perform privilege escalation on windows, ... read & execute and list (this folder, subfolders and files), create ...
    (Pen-Test)
  • Re: priviledge escalation techniques
    ... SYSTEM credentials for executables in the Run key would ... Subject: priviledge escalation techniques ... The easiest way to perform privilege escalation on windows, ... read & execute and list (this folder, subfolders and files), create ...
    (Pen-Test)
  • Re: no Help in Windows XP
    ... in the C:\WINDOWS\ServicePackFiles\i386 folder. ... When I right click on it and left click on Install I get a dialogue box the says "The file dataspec.xmf on Windows XP Pro SP3 is needed. ... The path to many executables are recorded in the registry. ... I know of the following registry key: ...
    (microsoft.public.windowsxp.basics)
  • Re: Default path for application and LoadLibrary
    ... executables at all. ... libraries. ... are fisically exist in the application's folder. ... Some way I need to implement my file existence checker the same way. ...
    (microsoft.public.vc.mfc)
  • Re: Cant delete DOS Executables
    ... > I have a huge problem with my Windows XP Pro SP-1. ... > that I cannot delete any DOS executables anymore. ... > with every DOS executable in every folder. ...
    (microsoft.public.windowsxp.general)