• dll redirection

    From mutazilah@gmail.com@21:1/5 to All on Mon Jul 17 09:39:16 2023
    I am trying the use of ".local" at the bottom of this:

    https://learn.microsoft.com/en-us/windows/win32/dlls/dynamic-link-library-redirection

    My application is called pdptest.exe so I created a dummy
    text file called pdptest.exe.local

    I wanted it to use my own msvcrt.dll in the same directory.

    Nothing happened - it still used the normal one provided
    by Windows 10.

    Then I recompiled pdptest.exe - and voila, it worked - ie
    it executed my msvcrt.dll when I ran pdptest.

    Then I created another directory and copied pdptest.exe,
    pdptest.exe.local and msvcrt.dll to it.

    It didn't work - ie it went to the Windows-provided one.

    Any idea what is happening?

    Although that's still not what I want.

    What I would like to be able to do is have my existing
    unchanged executables that depend on msvcrt.dll and
    that I have put into my c:\winpath execute an msvcrt.dll
    from a specified directory, or follow the PATH variable
    or some other variable. Or even if they execute an
    msvcrt.dll that is in c:\winpath, that would also be ok.

    I don't want to create a ".local" dummy file for every
    single one of my executables. Nor do I want to change
    any of my executables.

    Any idea how to do that?

    BTW, I wasn't able to rename msvcrt.dll to msvcrt.dxx
    in c:\windows\syswow64 so that I could put in my own.

    I really want different windows to be able to have a
    different PATH variable, so normally syswow64 is
    right, and default, but I in select windows I can
    change my PATH and start getting my own msvcrt.dll
    executed, because all the programs I will be running
    will work nicely with that one.

    I checked knowndlls as described here:

    https://learn.microsoft.com/en-us/windows/win32/dlls/dynamic-link-library-search-order

    and msvcrt is on the list.

    Maybe I need to delete that?

    Thanks. Paul.

    --- SoupGate-Win32 v1.05
    * Origin: fsxNet Usenet Gateway (21:1/5)
  • From JJ@21:1/5 to muta...@gmail.com on Tue Jul 18 05:11:30 2023
    On Mon, 17 Jul 2023 09:39:16 -0700 (PDT), muta...@gmail.com wrote:
    I am trying the use of ".local" at the bottom of this:

    https://learn.microsoft.com/en-us/windows/win32/dlls/dynamic-link-library-redirection

    My application is called pdptest.exe so I created a dummy
    text file called pdptest.exe.local

    I wanted it to use my own msvcrt.dll in the same directory.

    Nothing happened - it still used the normal one provided
    by Windows 10.

    Then I recompiled pdptest.exe - and voila, it worked - ie
    it executed my msvcrt.dll when I ran pdptest.

    Then I created another directory and copied pdptest.exe,
    pdptest.exe.local and msvcrt.dll to it.

    It didn't work - ie it went to the Windows-provided one.

    Any idea what is happening?

    Although that's still not what I want.

    What I would like to be able to do is have my existing
    unchanged executables that depend on msvcrt.dll and
    that I have put into my c:\winpath execute an msvcrt.dll
    from a specified directory, or follow the PATH variable
    or some other variable. Or even if they execute an
    msvcrt.dll that is in c:\winpath, that would also be ok.

    I don't want to create a ".local" dummy file for every
    single one of my executables. Nor do I want to change
    any of my executables.

    Any idea how to do that?

    BTW, I wasn't able to rename msvcrt.dll to msvcrt.dxx
    in c:\windows\syswow64 so that I could put in my own.

    I really want different windows to be able to have a
    different PATH variable, so normally syswow64 is
    right, and default, but I in select windows I can
    change my PATH and start getting my own msvcrt.dll
    executed, because all the programs I will be running
    will work nicely with that one.

    I checked knowndlls as described here:

    https://learn.microsoft.com/en-us/windows/win32/dlls/dynamic-link-library-search-order

    and msvcrt is on the list.

    Maybe I need to delete that?

    Thanks. Paul.

    If I understand it correctly, the priority of things which affect the DLL loading is:

    1. Application bitness. i.e. 32-bit or 64-bit.

    2. Application manifest.

    3. DLL redirection.

    4. Safe DLL search mode.

    5. DLL search order.

    --- SoupGate-Win32 v1.05
    * Origin: fsxNet Usenet Gateway (21:1/5)