MSVCRT.lib

Viewing 2 posts - 1 through 2 (of 2 total)
  • Author
    Posts
  • #465
    reasonman
    Participant

    I’m trying to use CRT function getenv() in my Win 7 – 64 driver. The linker gives me an error: LNK2019: unresolved external symbol… My VS2010 project already statically links in the CRT (/MTd), but for some reason, getenv() is not included. If I link in MSVCRT.LIB from the WinDDK, the driver will link, but it won’t run.

    I’ve been reading through some of the “msvcrt dll hell” articles on the web. Some of the workarounds they suggest seem very cumbersome. I can see that other BazisLib functions already use getenv() as well as many other CRT functions. So, I suspect that this issue must have already been resolved by somebody.

    Thanks in advance for any assistance.

    #2162
    support
    Keymaster

    Hi,

    getenv() is a function for normal applications, not drivers.
    To get process environment from the driver you’ll probably need to parse the PEB structure.
    Try googling or looking into ReactOS sources for more details.

Viewing 2 posts - 1 through 2 (of 2 total)
  • You must be logged in to reply to this topic.