CodeGuru Home VC++ / MFC / C++ .NET / C# Visual Basic VB Forums Developer.com
Results 1 to 3 of 3
  1. #1
    Join Date
    Dec 2010
    Posts
    121

    Passing some parameters from 64bit exe to 32bit dll?

    The caveat is that it works, you can call over from 64bit exe to 32bit dll...
    I need to use a 32bit dll in that case is that I need to use that dll to hook a 32bit program.
    And now I want to supply some parameter information to the dll, which is just a path name.
    Any ways I can easily achieve this?
    Thanks
    Jack

  2. #2
    Arjay's Avatar
    Arjay is offline Moderator / EX MS MVP Power Poster
    Join Date
    Aug 2004
    Posts
    13,490

    Re: Passing some parameters from 64bit exe to 32bit dll?

    So pass the string parameter. Why ask, just do it?

  3. #3
    Join Date
    Nov 2000
    Location
    Voronezh, Russia
    Posts
    6,620

    Re: Passing some parameters from 64bit exe to 32bit dll?

    Quote Originally Posted by luckiejacky View Post
    The caveat is that it works, you can call over from 64bit exe to 32bit dll...
    No, basically you cannot. To call a dll code you need to load the dll to your process. And there is no way to load a dll to a process of different architecture, i.e. 32-bit to 64-bit and vice versa. So there is no way to "supply parameter information to the dll" unless your definitions of "call over ... to", "supply", "parameter" and "information" are something different from comonly used terms.

    And one only exception I can imagine is a 32-bit COM dll registerd very special way that indeed can be "called" by 64-bit process, that technically is hardly possible to combine with hooking dll because of a number of factors I don't want to discuss right now.

    So you'd better provide some more details, in case you really need a solution to your problem.

    As long as we started talking about hooking dlls, you need to know that you cannot install a 32-bit hook from 64-bit process. Becase you need to know the hook proc address, which can be found only when you load the dll to the process, which loading is not possible because of architecture mismatch.

    And even when you managed to install the global hook, your dll runs in the victim process on its own, so it has to read the path somehow independent from the hook installer process, and then why wouldn't it just be read from a well known source, registry for example, or side-by-side ini file?
    Best regards,
    Igor

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  





Click Here to Expand Forum to Full Width

Featured