0

I am working on a project where I use an ISAPI dll file/web service to generate a file. I previously used a hardcoded location as to where to store the file, which worked great, I am now trying to swap it with a location stored within a specified text file.

The problem I am having is that it seems to be appending the current path of the IIS worker process 'C:\Windows\SysWOW64\inetsrv' to the start of the location information I store inside my text file. I am not sure if this is down to my code or an IIS 7 server setting? Can anyone point me in the right direction?

Many Thanks.

2 Answers2

0

I think you have to use SetDllDirectory in MSDN

After calling SetDllDirectory, the standard DLL search path is:

  1. The directory from which the application loaded.
  2. The directory specified by the lpPathName parameter.
  3. The system directory. Use the GetSystemDirectory function to get the path of this directory.The name of this directory is System32.
  4. The 16-bit system directory. There is no function that obtains the path of this directory, but it is searched. The name of this directory is System.
  5. The Windows directory. Use the GetWindowsDirectory function to get the path of this directory.
  6. The directories that are listed in the PATH environment variable.
Hugues Van Landeghem
  • 6,755
  • 3
  • 34
  • 59
0

This is not a direct answer, but may put you in the right direction. Working on the http://xxm.sf.net/ project, I've found you can set the current directory (for the process) from within the ISAPI dll. It appears that inetinfo.exe/dllhost.exe/w3wp.exe (or any other process IIS uses to call your ISAPI from) doesn't mind and keeps operating normally.

Stijn Sanders
  • 35,982
  • 11
  • 45
  • 67