Retriving RtlIpv4StringToAddress fails
CodeGuru Home VC++ / MFC / C++ .NET / C# Visual Basic VB Forums Developer.com
Results 1 to 2 of 2

Thread: Retriving RtlIpv4StringToAddress fails

  1. #1
    Join Date
    Feb 2011
    Posts
    32

    Thumbs up Retriving RtlIpv4StringToAddress fails

    Code:
    HMODULE hMod=LoadLibrary("ntdll.dll")
    if(hMod!=NULL)
    {
        ret=(RTLIP4TOSTRING)GetProcAddress(hMod,"RtlIpv4StringToAddress");
        if(ret==NULL)
        {
             //error
        } 
    }

    Could someone tell me why I always get "ret" as NULL ? I am using Vista SP1. Thank you

  2. #2
    ovidiucucu's Avatar
    ovidiucucu is offline Moderator/Reviewer Power Poster
    Join Date
    Feb 2003
    Location
    Iasi - Romania
    Posts
    8,059

    Re: Retriving RtlIpv4StringToAddress fails

    It always returns NULL because there is no "RtlIpv4StringToAddress" exported by ntdll.dll. Not even in Windows Vista or Windows 7.
    Instead, use "RtlIpv4StringToAddressA" or "RtlIpv4StringToAddressW" if you want the ANSI or UNICODE version, respectively.
    Last edited by ovidiucucu; April 17th, 2011 at 12:31 PM.
    Ovidiu Cucu
    "When in Rome, do as Romans do."
    Visit: Microsoft Virtual Academy
    Follow: https://twitter.com/#!/ovidiucucu
    My blog: http://codexpert.ro/blog/author/ovidiu-cucu/

Posting Permissions

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


Windows Mobile Development Center


Click Here to Expand Forum to Full Width

This is a CodeGuru survey question.


Featured


HTML5 Development Center