« Previous Next »

Thread: \\?\ path prefix

Last post 09-24-2009 10:20 AM by Hristo Stefanov. 6 replies.

Average Rating Rate It (5)

RSS

Page 1 of 1 (7 items)

Sort Posts:

  • 09-21-2009, 11:49 AM

    \\?\ path prefix

    Hello,
    I have an ISAPI mudule that calls a managed C++ DLL. The managed DLL works OK when called from a normal windows application, but I get E0434F4D exception when calling from an ISAPI module. I think the problem is related to the fact that my ISAPI module is loaded from path that starts with \\?\C:\ instead of C:\.

    Does anybody have an idea about the exception or how to disable that path mangling for my ISAPI module?
  • 09-21-2009, 1:08 PM In reply to

    • anilr
    • Top 10 Contributor
    • Joined on 05-23-2006, 6:13 PM
    • Redmond, WA
    • Posts 2,343

    Re: \\?\ path prefix

    Is you ISAPI dll statically linked to export functions in the managed dll - I would suggest using LoadLibrary/GetProcAddress to get the exported functions from the managed dll - the \\?\ prefix to the path is something IIS does for security reason and CLR does not handle it correctly as you have already noticed.

    Anil Ruia
    Senior Software Design Engineer
    IIS Core Server
  • 09-22-2009, 5:27 AM In reply to

    Re: \\?\ path prefix

    Thank you for your prompt reply. Actually the ISAPI module is written in Delphi (do not ask why) and there is a special syntax that in turn does LoadLibrary/GetProcAddress. However, my question is how to disable the \\?\ prefixing at least for development and troubleshooting purposes. Is there a configuration switch?

  • 09-22-2009, 3:10 PM In reply to

    • anilr
    • Top 10 Contributor
    • Joined on 05-23-2006, 6:13 PM
    • Redmond, WA
    • Posts 2,343

    Re: \\?\ path prefix

    No, there is no switch to change that behavior.

    Anil Ruia
    Senior Software Design Engineer
    IIS Core Server
  • 09-23-2009, 8:16 AM In reply to

    Re: \\?\ path prefix

    OK, provided that CLR does not handle that prefix correctly, how is a native ISAPI DLL supposed to call a mixed (native+managed) DLL?

  • 09-23-2009, 12:50 PM In reply to

    • anilr
    • Top 10 Contributor
    • Joined on 05-23-2006, 6:13 PM
    • Redmond, WA
    • Posts 2,343

    Re: \\?\ path prefix

    If you do LoadLibrary yourselves on the mixed dll rather than depending on being statically linked - you can make sure that the path you pass to LoadLibrary is not in the \\?\ format.

    Anil Ruia
    Senior Software Design Engineer
    IIS Core Server
  • 09-24-2009, 10:20 AM In reply to

    Re: \\?\ path prefix

    OK, I understand.

    Is there anything special about the worker process or the way it treats ISAPI modules, cause the same configuration works OK when loaded from a normal windows process but  fails (with the mentioned exception in the first post of the thread) when run from the worker process?

    In other word - is there any special sandboxing of the worker process that may cause problems with calling a mixed DLL from the ISAPI module?

Page 1 of 1 (7 items)
Microsoft Communities